Home Unreal Engine

light leak ingame engine

polycounter lvl 14
Offline / Send Message
NAIMA polycounter lvl 14

Hello I am using Unreal game engine with lumen and I am trying to build an environment but I am having annoying light leak or shadow not correct cover by distance view , I am trying all possible model configuration , double, walls, split parts, single parts , thin walls, thick walls, whatever I do nothing changes, the light always leaks throught ... I am not sure what else to try to avoid this and if its actually an engine limitation or due to something else?


distance view


closer view



I am using a directional light and this issue happens when I move the light in that particular position from mostly angled vertical , but it increases with distance and decreases to disappear when closer.

Replies

  • Fabi_G
    Offline / Send Message
    Fabi_G high dynamic range

    Interesting, do you use Virtual Shadow Maps and Nanite? Could you share the mesh?

  • NAIMA
    Offline / Send Message
    NAIMA polycounter lvl 14

    I am not sure what is virtual shadow maps but I am definetly not using nanite... here is the mesh , I have changed it a lot since then , the only solution I found, which is a work around and not ideal solution is to add a second layer of floor to the balconies that is higher up of the actual floor, now since I am working this building to be just mostly like a scenery or simbolic presence I don't mind, but if I wanted people to walk on the balconies than this would be a big issue...

  • Fabi_G
    Offline / Send Message
    Fabi_G high dynamic range

    Here is Epic Games documentation about virtual shadow maps.

    If I understand correctly, it was developed with nanite meshes in mind. You can check which shadow map method is set by searching for shadow map method in the project settings. Did you start from a template? It might be set by default. From my little experience with unreal 5 so far, if a project uses fully dynamic lighting it makes sense to use nanite meshes.

  • NAIMA
    Offline / Send Message
    NAIMA polycounter lvl 14

    I checked and I am using virtual shadow maps beta, Nanite is only needed to be enabled on meshes that use a lot of geometry from what I understood .

  • Fabi_G
    Offline / Send Message
    Fabi_G high dynamic range

    "What Types of Meshes Should Nanite Be Used For?"

     https://docs.unrealengine.com/5.0/en-US/nanite-virtualized-geometry-in-unreal-engine/#:~:text=What%20Types%20of%20Meshes%20Should%20Nanite%20Be%20Used%20For%3F

    Whether to use it depends much on your project specs (baked lighting not possible)

    I didn't experience any issues yet using regular modelled meshes.

    I'd check if enabling nanite for the mesh changes anything.

  • Fabi_G
    Offline / Send Message
    Fabi_G high dynamic range

    Hey, I tested your mesh in engine and could reproduce the issue. It doesn't seem to be related to the set shadow map method.

    I could reduce the the bleeding by switching to shadow map method (doesn't work with nanite!), reducing shadow bias and shadow slope bias, as well as increase shadow filter sharpen.

    Default

    Modified bias values plus sharpen

    Those parameters don't seem to have an affect when virtual shadow map method is used.

    Feels hacky and I don't understand what's under the hood and if it will cause problems elsewhere - so I wouldn't really recommend this.

    Good luck finding a satisfying solution, share if you do!

  • NAIMA
    Offline / Send Message
    NAIMA polycounter lvl 14

    Thanks so this hacky way means can't be used virtual shadow map?

  • Fabi_G
    Offline / Send Message
    Fabi_G high dynamic range

    Hey, yes it one would have to revert to the previous shadow map method for the light parameters to work, as they don't seem to be implemented with VSM (hopefully will in the future, considering it's still in beta). But the previous version doesn't work with nanite meshes.

    There might be are other solutions, but I don't know them.

    One option would be to get the latest sample project (matrix city?) and inspect the lighting setup.

    Edit: Briefly looked into the CitySample, doesn't appear like there is any special light setup and same thing can be observed on balconies depending on light angle, view angle and distance.

    For now, I would work around it by adjusting geometry and choose appropriate light angle.

  • NAIMA
    Offline / Send Message
    NAIMA polycounter lvl 14

    The way I "fixed" but as said is also a kind of hack is to add a second floor on the balconies that is higher and over the other , this would look odd if some npc or character should go there but its fine if its just to be looked at from distance ... I still would prefer it not to be needed , but this is the best solution I could find, based on the sugestion I read to avoid less than 10 cms walls to avoid light leaks, despit my structure there is probably 50 cms thick or more ...


    That said I tried to copy the exact same settings of Matrix city but I didn't like how it come out in my world, first of all the lux of the sunsky is normally set at 75000 lux and I had to bring down to 1000 to follow the Matrix city style, but then put at -3 intensity the overall intensity of the post processing box, and rise to 100 cndl the intensity of interior lights to avoid them beeing to low to even illuminate around, I found though that thse settings still where too bright for me so I preferred to lower the intensity to 150 lux , and put the postprocess box intensity to something like 1 , still keeping at 100 cndl the intensity of interior lights...

    I am not sure of this is correct or a good way to go but seems better to look at at least ,the other problem is that all the textures I downloaded from quixel when applied on my mesh look washed out and I had to downtone the albedo with gray or very dark color to make them look less washed out, I also am not sure if this is the right pproach , because if I left the lights as standard and the textures as standard setup as they come when I drop in I would only see mostly bright scene with very washed out textures, I also had to increase contrast and normal map intensity to make them look a bit better....


    This is the scene I tried to reproduce , and this is the illumination I got, I used the same sun inclination , time of the day and longitude and latitude settings of where and when the photo was taken .

    this is the ingame shot instead.



  • Fabi_G
    Offline / Send Message
    Fabi_G high dynamic range

    I always turn off autoexposure in postprossing volume before lighting so exposure is consistent, and then set light how it looks good. It's probably a good idea to have parameters in the base material to adjust the textures. Keep in mind that darker albedo color will reflect less light.

Sign In or Register to comment.