No matter what I do, I can't seem to stop the sunlight from 'leaking' through the meshes. Is there any solution?

In this scene, the character is completely surrounded by wall meshes, yet the light still leaks through.

There is light-bleed in your scene due to Lumen.

  • View Mode > Lumen > Lumen Scene
  • Move around and look for:
    • beams of light that shouldn’t be there (appearing/disappearing).
    • light bleeding in from the bottoms of walls (or even tops and sides).
  • Solution 1 :slight_smile: Use light-blocking geometry
    • Create a cube or other static mesh primitive
    • Scale and position behind your visible mesh to block the light from your environment.
  • Solution 2 : Edit material
    • Find your material instance in the Content Browser
    • Right-click and choose “Find Parent” until you find the master material.
    • Open the master material in the material editor
    • Note the input pin for “Pixel Depth Offset”. If there is a connection to this pin, disconnect it by ALT-Clicking.
    • Click “Apply”.

If solution 1 worked for you, you just have to remember that polygons are only visible from one side, and DirectionalLights are only blocked by one side of the poly. You can test this by setting the light to “Movable” and you’ll see which polygons aren’t blocking ANYTHING.

If the material solution worked, the problem was that Lumen doesn’t support Pixel Depth Offset yet.

I have no association with either of these guys, but I learned this from watching these guys on Udemy.

  • Stanislav Zhuikov
  • Ben Tristem
1 Like

For this project, I’m using screen space, and there’s nothing connected to Pixel Depth Offset in the material either. Even after adding basic cubes around the entire structure, the directional light isn’t being blocked.

image

looks partially like an autoexposure issue to me. set it 0,0 or 1,1 for testing or whatever you prefer as a baseline.

it should no leak into the cube tho. unless shadow bias makes it leak thru the joint edges. i dunno how good ssgi is. so…

1 Like


It still didn’t work.

i dunno what that exposure contrast scale does (i can’t boot the engine, rn. busy compiling).

the autoexposure settings i meant are in the postprocessing volume → exposure tab. min and max EV

1 Like


Still no luck. I wasn’t even using a post-process volume before.
probably should have used it.

is the volume set to infinite extend or spread around the box? that should work to some degree.

1 Like

In the previous screenshot, it was only around the structure, but now it’s in infinite mode.

I believe it’s some kind of light leakage issue because before placing the basic cubes around the structure, the character was casting a shadow, and now the shadow has disappeared.
Perhaps there’s an issue with my meshes?

well… brain to square one. since this seems to be in a dungeon of some kind. have you actually tried to disable the sun light. i mean… that is the source of iight that maybe leaks. also disable skylights. since they can actually render a generic ambient term that will mess up interior scenes if not controlled.

there are methods to disable and reenable it at runtime if required.

1 Like

This game is just a small personal project for my son to play. The first dungeon was made on a separate map, and this one probably will be too, but I wanted to test the open-world day and night system in a dungeon.

Anyway, thank you very much for the help, guys!

are your wall and floor materials have double sided enabled?