Shader/Material masked by distance but Lumen still on

Hello everyone,

I feel stuck on what is seems to be a very simple workflow. I have a material with a simple emissive setup based on distance. Basically, I want the emissive to be activated if the camera is close enough (in this case, 512 units):

I also created a simple Shader to test the funcionality of this example and applied it to a Niagara System to test the distance as I work on the material:

What I currently have on the scene doesn’t make 100% sense to me. Under 512 units, I have a lit sphere and Lumen is also visible in the scene, which is expected. However, if I get away beyond 512 units the emissive is off… but the Lumen is still ON or that is what it looks like to me.


Just in case anyone is wondering, I intentionally deactivate the Niagara System to verify the particle is not causing any Lumen:

The only work around I found are either Unchecking “Affect Dynamic Indirect Lighting” or “Affect Distance Field Lighting”. However this doesn’t feel like a proper solution for me. If I have a emissive value of 0 in the material, Lumen shouldn’t show up, am I right? Setting the Emissive to 0 directly in the material would directly turn off Lumen, but the idea would be doing it based on a distance inside of the Shader with a simple math calculation.

I also tried using the Function “Debug Scalar Values” to check if the emissive is actually beyond 0, but looks like the debug is showing the right numbers (except that 0 doesn’t appear when you are close enough).


So… yeah, anyone have any ideas of what I am doing wrong here? Feels kind of simple but I am stuck. Any help would be appreciated it.

Depending on if you are using surface cache or hit lighting mode, it will either pre-compute “cards” that represent a material for use in raytracing or it will evaluate the material pro. You can view them with the visualization viewmodes. Until the cards are re-computed, dynamic material changes won’t be reflected in GI or reflections. This can also cause issues with materials that rely on view vectors, like fresnel.

Hit lighting evaluates the actual material. So it can handle real time changes and other more complex materials, but at an added cost.