Download

Can you disable a skylight in certain areas?

I am not sure I quite understand what you mean by fog sheet… something that brightens the stuff behind it?

A fog sheet may not solve HIS problem, but it will probably solve mine if there’s a way to make emissive textures cut through it. I originally tried using decal actors to darken the scene but those had issues, but fog is actually a really clever approach to creating a “volume of shadow”.

I have actually found an “almost” working solution. Here’s my setup:

I created a BP that had two planes facing separate directions on top of each other. I assigned the same material to both of those. The assigned material is an Unlit Transparent material that just takes the SceneColor and multiplies it by a tint, like such:

Once that is done, in my BP I have a PostProcessVolume public variable in which I stick my “cave darkening” post process volume. The construction script of the BP then does this:

The color line going off the Post Process Volume’s Scene Color Tint. Basically the plane that darkens the scene just takes that color and applies the tint, essentially acting as a lens that mimics the PPV. The lightening plane takes the inverse of that value, making it a lens that negates the PPV. Now the important part is, since the color value of that plane will be well over 1, there’ll be a lot of Bloom and Lens Flare so it’s important to set both of those to 0 in the PPV.

Now all you have to do is smack that on the entrance of your cave, right against the PPV. As I said, this is “almost” correct because there’s some flicker when going through the entrance plane, especially if the PPV has a fade distance set. Right now I am working on how to fix that and I’ll update if I have any results. Hope this helps!

I wonder if there’s a way to incorporate this effect into a single actor/material, so that you can use a mesh or primitive to specify a “shadow volume”, which darkens every surface it overlaps without darkening any surface it doesn’t… obviously your method works but it seems pretty convoluted for something that I imagine is much simpler than we’re making it.

Decal materials ALMOST work, it’s just UE does some weird fading things at the edges which makes it impossible to position them inside of a surface without also darkening its outer edges, and decals will not be cut through by emissive materials or other light sources the way shadow would.

My method is simple enough to put in the level and aside from the ocassional camera flicker upon entering an exiting it works just fine. You define your PPV and plug the plane “corks” on the penumbra areas where the PPV cuts off. Unfortunately I don’t think the flicker can be solved since it’s related to the camera clipping the plane but not yet entering the PPV so for a small instant the non darkened setting flashes.

If your camera moves quickly or if you can cut to the camera inside of the PPV youre good.

Hmm, that actually looks pretty good @DamirH. Thanks for sharing it!

Yeah but if the flicker can’t be solved then I don’t really consider it a good solution long-term. An acceptable stop-gap sure, but light flickering like that would be more distracting than I’d be willing to allow. Especially if you reuse that sort of set-up a lot in a level, rather than just a couple places.

Nope it can’t. If it fades out as you approach the darkness would disappear because you’re still not in the PPV.

After some Googling I’ve got what may be a useful alternate solution, though I haven’t really messed around to see how performant it is.

It’s possible, using a combination of WorldPosition, ObjectPosition and ObjectBounds, to determine if a rendered pixel falls within the bounds of a volume. This can be used to mask out the shadow postprocess effect (as long as it’s set to be unbounded in terms of enabling it for the camera). So by placing the PPV where you want to darken the area, it will render everything within that volume darker, and everything outside of it lighter, regardless of whether you’re standing in or out of it.

The issue is this only works with box-shaped volumes, due to how bounds are reported. I’m trying to find a better way of determining if a position falls within the volume of an object but it’s tricky.

I’m afraid that is even more convoluted than the previous solution. It might be possible to have a material that darkens itself if a flag is set and you could make a volume that sets that flag on every object in itself.

It’s not really all that convoluted (can be done in fairly minimal shader instructions) and it does save a draw call and game logic on the dark/light planar materials that cover the trigger to change postprocess brightness.

The real issue is if you use it in many areas, the shader instructions rack up quick because each rendered pixel has to be checked for EACH separate instance of the darkening effect you’ve placed in the level. You could probably consolidate them via clever parametrization, though (i.e. using one postprocess to shadow a number of different prespecified areas of the map)

Now that 4.14 has released, i wonder that if this is still an issue or not. Can you exclude a movable object from skylight’s light ? Can an object be set to not to get any light from skylight ?

I have a movable object in the scene ( a car) and i want that object to not to receive any lights from skylight. Post process volume is the answer or do i need to do a workaround a lot ?

As above posts, I have not an interior cave or building that must be pitch black, I just want to the exterior of my car to not to get any light.

Not the best way but I have Used a sphere reflection capture on a value around 0.5 before to darken specific areas. you can change the cube map to something more fitting for the cave, and it will blend out near the door dependent on its placement.

Toggle “cast shadows” on the skylight is pretty useless. It only make the shadows of the directionnal light a bit darker, you can do the same thing by reducing the intensity or the light color but that’s not a solution to the outdoor/indoor Skylight problem.
It change the tone of outdoor shadows but switching on/off does absolutly nothing on the interiors.

I tryied " using two sided lighting" and “shadow two sided” on my interior room mesh but it has no effect

This is one hell of a necro but some of the info in this thread is still useful. The best solution we have now is setting thd cave interior to a separate lighting channel. Might be hard to do the cutoff point properly though.

But SkyLights don’t have a Lighting Channel setting.

Exactly, it’s often requested (maybe that’s why those threads are oftenly revived) but never done because as Epic guys said “it’s too much work and not one the highest priority” but I don’t see any other solution. In my actual project, all indoor meshes/point lights are set to light channel 2 but it’s still affected by skylight, even with skylight shadows activated, even with double sided shadow on the mesh, etc.

Actualy, the only workaround which really works to me for an indoor/outdoor “openworld” is to use the old system like in The Elder Scrolls with outdoor and indoor in differents levels and loading/unloading them with a trigger. Even adding interiors levels to the World level doesn’t work because they are considered as the same level by lights.

Ah, I wasn’t aware of that. Well, that sucks. The compromise we made in the end is that our cave entrances are winding paths and the light starts fading out halfway down after you can no longer see the entrance.