[UE5] Emissive material passing through walls

Description of what’s happening

I have a maze mesh, a floor, the firspersoncharacter bp and some exit portals with an emitting color material.

Previewing the scene won’t show you the bug:


Only playing the game or simulate will make this happen, sometimes also in editor when building, playing, seems random.

That’s it, light passes through the maze’s wall

Tests

  1. I added a cube after the wall; that makes me think there might be something about the maze’s mesh, maybe…

  2. Disabling Affect Dynamic Indirect Lighting and Affect Distance Field Lighting on portaBP mesh fixes the issue but makes the portal look bad for me


    ON

    OFF

  3. PortalWall of PortalBP is currently movable, i tried to set it up to static and build all, nothing changes

  4. I rebuilt maze mesh uv map (using unreal engine modeling too auto uv)

  5. i tried disabling nanite for both mazem test block and portalwall meshes. No changes.

Notes

Nanite is enabled, lumen is enabled

Question

How can i fix it?

2 Likes

During simulation i’ve also seen this happening:

3 Likes

Is that maze build with only one mesh? I believe that Lumen works better with smaller parts instead of one big mesh. You may consider splitting everything up?

4 Likes

I am considering to make it procedurally generated one day so the output would be 1 mesh anyway :frowning:

3 Likes

Oh, :smiley: Yeah, I mean you could try a test run and see if things get better. If yes, you may adapt your procedural approach. But I don’t have much experience with Lumen so there may be another answer from a real Lumen Pro coming in …

4 Likes

i’m really hoping for that hero <3 btw i will consider it for sure

1 Like

Yes it is the first test i did as i described here: [UE5] Emissive material passing through walls

i’m not able to understand what’s the problem anyway

2 Likes

Right now, Lumen really doesn´t like complex shapes, or to thin walls.

Have you tried to simply rebuild the walls from simple cubes in that region? Then you could make them thicker, to check, if the light gets blocked.

While i was unable to recreate your problem, at least one sideeffect of to thin walls was, that the light started shining through gaps, where two thin walls connect, that still looked like one massive wall.

One noticeable effect of complex meshes is, that several parts won´t work with Lumen and will be ignored for f.e. it´s global illumination (in such cases, it will fall back to screen space stuff, if i understand that correct).

I tried it with a test labyrinth, one made from one big complex mesh (left side, with all those pink and therefore unsupported parts, which Lumen will ignore), and then i rebuilt the whole labyrinth from just cubes, where every wall is a separate segment. In terms of global illumination, the differences are quite noticeable in areas, where the light has to bounce often, to illuminate the place.

Check out those dark corners in the closeup. Both are taken from the same spot in both labyrinths, top left corner, where the top left glowing block sits. Left closeup is pitch black, while the right close up from the labyrinth built from separate blocks gets illuminated better.

Note: On the right side, those small pink areas vanish, once i get closer. Same for the yellow blocks, guess thats some distance culling. The left side always stays a pink mess, no matter, how close i am ^.^

3 Likes

No two-sided material (i also tried them)

here’s is the world normal visualizer:

2 Likes

Thank you @Suthriel for your in depth research, i simply love this community :heartbeat:

As i said to @Pantoth creating the maze with separated meshes instead of 1 mesh is not suitable for me right now - i will consider it as last-resource.

For now disabling ADIL (Affect Dynamic Indirect Lighting) and ADFL (Affect Distance Field Lighting) into the portal mesh (the one with the emissive material) is a valid workaround, not a fix. Exactly like change the entire maze into multiple separated meshes.

ADIL and ADFL are related to the mesh distance fields that i was studying right now :mag_right:

Thanks to the doc i’ve seen there’s a visualizer for that (there’s one for everything i guess xD)

I see increasing the quality (see doc section) of the Distance Field Resolution Scale Build Settings into the maze’s mesh is somehow fixing the issue.

Using Distance Field Resolution Scale to 0 (it was 1) this is what happens: the portals’ color influence the entire mesh.

Increasing it to 5 fixes the issue. :partying_face:

Mesh Distance Field visualizer differences

Distance field resolution scale: 1

Distance field resolution scale: 5

The difference is almost imperceptible but increase performance on mesh indirect lighting calculation.

Distance field resolution scale: 0

The difference becomes evident when you put it to 0


Notes

Since i started the thread i tweaked on volumetric lighting and fog so the lighting is different from previous posts, that’s not affecting the issue.

ADIL and ADFL references: Open World Tools Property Reference | Unreal Engine Documentation

2 Likes

This is my dungeon generator, I tried putting inside it an emissive cube and I noticed your same problem (And the dungeon is not a single mesh, they are several procedural meshes):

The strange thing is that the light isn’t really passing through the wall, but if you see it from the distance:

Another strange thing is that it doesn’t happen if you disable the skylight, they are working fine even from the distance

If you add every type of light source that is not an emissive materials it starts to get bugged again:

I’ve tried Directional, Rect, Spot, Point and Sky Lights and they all cause the same effect, it’s definitely a bug!


Edit: The problem is that emissive materials don’t behave like real lights, shadows are not casted (at least with my settings) and the lighting pass through the wall if the source is visible, I will use them more carefully now that I’m aware of this:

3 Likes