Download

Can you disable a skylight in certain areas?

So I added a skylight to my landscape and it made the shadows look 10x better however when I go inside something that’s supposed to be dark for instance a cave it’s a lot brighter in there. Is there a way to “turn off” a skylight in certain areas with a volume or something? Any help would be much appreciated!

You could always setup a trigger box that when overlapped it could set the intensity of the Skylight to be lower.

I’ve actually messed around with that approach and the main issue with it is when standing outside the cave and looking in, that darkness isn’t present. It’s like the sun gets turned down when you walk inside, rather than the light being occluded.

I do sort of wish for “occlusion volumes” or “light intensity volumes” which reduce the intensity of light within their bounds, or something. As a way for designers to make areas more shadowy (or less) than the lighting calculations know they ought to be.

I second this notion as I ran into the same issue.

Hi Last_Attempt,

Generally this case is what Distance Field Ambient Occlusion was meant to handle. What it does is try to represent how occluded pixels are by looking up the distance fields of the surrounding geometry. It can be calculated dynamically for most modern hardware. Have you looked into this feature at all?

For static lighting where lightmass can be used, you should be able to set the skylight to cast static shadows and then you will have high quality baked sky ambient occlusion.

Does “most modern hardware” include the PS4? :stuck_out_tongue:

I haven’t looked into that yet, it sounds like what I need though. Do you know how to set it up and if so do you mind explaining it to me?

It could be depending on the projects performance tradeoffs. Also DFAO is being optimized further right now. DanielW has some pretty massive optimizations that involve looking up into a global distance field that could really help.

I suggest taking a look here, it will do a better job that I could

https://docs.unrealengine.com/latest/INT/Engine/Rendering/LightingAndShadows/DistanceFieldAmbientOcclusion/index.html

This is great news, thanks a lot!

Ok thanks, I’ll definitely look into it.

Hmm, that didn’t seem to really change anything actually. I’ll give you a few examples:

This is what I want my cave to look like - http://i.imgur.com/fnewq7B.jpg
However this is what it looks like with a skylight - http://i.imgur.com/BW8vdfu.jpg

But I also love how it changes my outside shadows so that they look like this - http://i.imgur.com/MsgU3jk.jpg
Instead of like this where they’re crushed looking - http://i.imgur.com/el6tEvS.jpg

I think you could use a separate pp volume for the cave and then use a pp material like this to adjust the lighting: 3D Modeling & Texturing: [Unreal Engine 4] Localized Post-Process Effects

Ok, I’ll try that out.

That approach only allows for very simple shapes. It’ll be difficult masking out a cave.

You need to toggle cast shadows on the skylight to see if it is doing anything. Also did you go under the editor or project settings and enable build mesh distance fields? Should be in the doc page I sent. If you don’t do that you won’t get any distance fields.

You need to toggle cast shadows on the skylight to see if it is doing anything. Also did you go under the editor or project settings and enable build mesh distance fields? Should be in the doc page I sent. If you don’t do that you won’t get any distance fields.

Yeah, I did both of those things and it didn’t really change much, in the lighter cave picture both of them are on it’s weird.

Silly question - you did restart the editor right?

Yep, since I can’t really find a solution I just said screw it and made the skylight not as bright so now the cave is darker.

That is fine for going in, but once you’re in and the darkening post process volume takes effect, looking back out makes the outside look dark as well. I’ve just tried creating a completely enclosed space with a skylight and DFAO and it still didn’t make it pitch black inside. This seems like a rather impossible problem to solve right now.