Invisible Lumen light blockers for Top-Down games 5-0EA

When normally doing Top-Down games, what we do is we try to make objects occlude character model transparent so that player can see their character clearly. However, in the case of Lumen this causes light from outside to enter inside locations that it should have been blocked by. Is there a way to put invisible light barriers that prevent Lumen light from propagating while being invisible to player camera?

Have you tried adding a plane or other mesh and disabling “Rendering > Render in Main Pass”? This works for normal invisible-shadow-caster purposes, curious if it does not also work with Lumen.

1 Like

Thanks for the answer. I tried doing that and it successfully blocks Lumen light propagation except for screen space ray tracing part which results in corners being illuminated

I’ve recently been investigating how to do this. While “Render in Main Pass” does seem to work for hiding an entire mesh (but still have it block light), I was having issues with partially see-through materials where Opacity mask is used to allow seeing through part of the wall but where it should still block light (i.e. just show a hole in the wall that character is standing behind).

I found the following seems to be the closest I could get:

  • Enable hardware ray tracing
    • (Software ray tracing for Lumen seemed to ignore RayTracingQualitySwitchReplace in next part)
  • Use RayTracingQualitySwitchReplace node in material.
    • Normal material should have see-through settings as desired with Opacity mask.
    • RayTraced material version should use Opacity 1 for areas that Lumen should see as solid.
  • Use cmd “r.Lumen.ScreenProbeGather.ScreenTraces 0” to limit light bleeding because of screen space effects.
  • Don’t get too attached to this working as who knows if future Lumen implementation changes would “render” this unusable in the future.
1 Like

As an update, I later discovered the “Shadow Pass Switch” node which you can use to control value flowing into OpacityMask (i.e. 1 for “Shadow” and “Default” would be the mask that makes the material see-through in certain places). It seemed like it would be the intended feature to use (instead of hacky RayTracingQualitySwitchReplace node I used above which was leveraging how Lumen does lighting). You’d still probably want to turn off r.Lumen.ScreenProbeGather.ScreenTraces to prevent screen-space light bleeding (which degrades other things Lumen does).

Disclaimer: I didn’t spend too much time going back to see how well it really worked, but in brief testing, it looked like it would do the trick.

1 Like

When I disable Render in Main Pass, it does block light, but it also leaves a black mesh there. Is that expected, or am I missing something?

This used to work properly in 5.0 but seems to be broken at 5.1. Note that suggested approach by cd_vbg works but not for Nanite meshes.

You can use “cast hidden shadow” node in Blueprint to achieve similar functionality. Although not nearly the same affect. Dont know if there is a better method available.

One option is to use low poly invisible masked mesh that overlaps with your nanite mesh.

1 Like

you can use ‘hidden shadow’ checkbox without blueprint, then uncheck visible and desired effect achieved :smiley: