Static mesh lighting switched based on distance?

I have a problem with small, movable objects in areas that do not receive direct lighting: When viewed up close, everything is fine. But from a certain distance (e.g. 1 meter for objects a few centimeters big), it seems that the lighting model switches and the object is lit directly by the light it should only receive indirect lighting from.

The following two pictures show what happens with a small light switch (there is a directional light behind the observer, but it does not directly hit the switch because it is obscured by the ceiling):

7679-switch_regular.png

7680-switch_bright.png

The distance when the switch happens changes when I scale the object. It can also be influence by changing the “Bounds Scale”, but increasing that also changes the brightness of the object when viewed from close by, and it seems that it would affect other things like culling.

Apart from that, it also depends on the resolution, i.e. the size of the object in pixels. For example, when I tried to take the pictures using the high resolution screen shot tool, the effect only happened at larger distances when using higher resolutions.

So, how do I keep my light switches from getting lit up when viewed from a distance?

Hi dysplaced -

You mention that the directional light is blocked by the ceiling, but what is the actual lighting environment that is influencing the light switch?

Thank You

Eric Ketchum

In this particular case, there is no other light directly influencing the object, so it should be only light probes (indirect lighting on movable objects). However, the same effect occurs with switches that are also influenced by other lights, it’s just less noticable.

Hi dysplaced -

This is a result of the blending between Static and Dynamic Shadows in the Lightmapping from your directional light. Essentially, the switch from dynamically lit object to Static Lighting is causing that jump you are seeing. It is more pronounced because of the size of your object. I was able to reproduce this exact behavior by just scaling down a provided engine asset. You can mitigate this distance transition by adjusting the Dynamic Shadow Distance Stationary setting in your Directional Light source under Cascaded Shadow Maps. I used a moderate setting of just 500 units from camera and was able to fix my test case. You will have to adjust based on your view of the light switch and how far away you will be seeing the object.

Let me know if I can help you further with this issue -

Eric Ketchum

Each movable object used with a stationary light gets a ‘preshadow’ created to handle shadowing from the static environment onto that object. The preshadow gets culled when it is small enough on the screen. You can disable it by setting these console variables to 1

r.Shadow.MinPreShadowResolution
r.Shadow.PreShadowFadeResolution

If you put the values in ConsoleVariables.ini they will be set every time you run.

Thank you both for your help! However, setting the console variables does not completely solve the issue, although it is reduced (high brightness only at the edges):

7726-new_artifact.png

Activating dynamic shadows resolves the issue but decreases quality in other parts of the scene (which I might be able to work around by optimizing the parameters if there is no other solution). I assume it also comes with a performance hit.