Search Unity

GI Light Bleeding Problem

Discussion in 'Global Illumination' started by bananahead, Sep 29, 2015.

  1. bananahead

    bananahead

    Joined:
    Mar 29, 2013
    Posts:
    14
    Hey Guys,

    i have a problem thats giving me a headache since 2 days and i don't find a solution.
    I googled like hell (maybe i just used the wrong keywords) but i only found one other guy with the same problem.

    i only use one directional light as the sun in realtime mode. No baked lights.
    The problem is, the lights and shadows are bleeding in the corners.
    My Geometry is solid and has thickness. There are three pieces of geometry: the roof, the floor and the walls (all walls together are one mesh).
    The meshes fit perfect together (no intersection and no gap.
    All meshes have three UV-Layouts (i dont even know if they need them, but for testing i tried it).

    So i thought it would be a problem with my light-properties or something. I made a new blank scene and put Unity-Cubes together to test it out. Still the same problem!

    i already played with the resolution.
    Does someone have an idea?
     

    Attached Files:

    Last edited: Sep 29, 2015
  2. ReggieDeez

    ReggieDeez

    Joined:
    Sep 29, 2015
    Posts:
    3
    Hey Bananahead,

    I am working in a similar setup. Are you still generating Lightmap UVs? If so try advanced settings of Hard Angle 60, Pack Margin 16, Angle Error 1, and Area Error 1. One thing I also did to combat the light leaking was to put a emission value of .25 on my interior walls/ceilings; this kind of makes everything a little white but evens out all the corners and seams. Try playing with that as well as your sun with bounce/Indirect GI.

    Best,
     
  3. bananahead

    bananahead

    Joined:
    Mar 29, 2013
    Posts:
    14
    hey, many thanks for the reply.
    i generate lightmap uv's in unity with your suggested settings. (hard angle of 60, pack margin... etc.)
    i will try your workaround and test some more setups.
     
  4. bananahead

    bananahead

    Joined:
    Mar 29, 2013
    Posts:
    14
    i am still fighting with shadow/light leaking.

    after some try-and-errors i think the problem is the automatic uv-generation with enlighten. it seems not to work properly with my model.
    As you can see, the lightmap uv seems to be S***ty (some polygons are not lit). Maybe there is something wrong with my model.

    light_problem1.JPG light_problem2.JPG

    i reimported the same model with and without three uv-layouts. (the first model has three uvs, the second is the same model with only my texture-uv)
    it seems that enlighten unwraps my model depending on the existing uv-layout in the third slot.
    i tried precomputing with different resolutions but my problem still appears.

    light_problem3.JPG light_problem4.JPG light_problem5.JPG

    please help me with this problem. i need this for a project at work so pls help me. -.-
     
  5. bananahead

    bananahead

    Joined:
    Mar 29, 2013
    Posts:
    14
    pump up! ;)

    no one has a clue? i don't get the GI work properly! i still get the bleeding!
     
  6. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Please go to the Lighting window, Object tab and with the object in question selected, look at the preview of Realtime Intensity. The problem is likely caused by the UVs but it is very hard to see in the final image. Looking at the problem in lightmap space is often much more useful.
     
  7. bananahead

    bananahead

    Joined:
    Mar 29, 2013
    Posts:
    14
    Hello KEngelstoft,
    thanks for the reply. here is a screenshot of the realtime intensity on the floor. The ceiling looks similar.
    no matter if i generate the lightmap-uvs inside blender or in unity (with different settings)... bleeding still occurs.

    i hope you have an idea what the problem is.
    realtime-intensity.JPG
     
  8. lero42

    lero42

    Joined:
    Apr 8, 2015
    Posts:
    1
    Same problem here. I would love to know a solution for this problem.
     
  9. bananahead

    bananahead

    Joined:
    Mar 29, 2013
    Posts:
    14
    PUMP!
    does no one have any idea???
     
  10. bananahead

    bananahead

    Joined:
    Mar 29, 2013
    Posts:
    14
    am i the only one having this issue? is there a workaround? pls people, i don't have ideas anymore...
     
  11. Scripter05

    Scripter05

    Joined:
    Sep 4, 2012
    Posts:
    2
    Have you tried increasing Realtime Resolution?

    Final gather can fix this issue but it only available for baked lightmaps.
     
  12. bananahead

    bananahead

    Joined:
    Mar 29, 2013
    Posts:
    14
    yup, i tried to increase the resolution but its still bleeding.
    i cranked the resolution up to 15 what should be enough. it precomputes more than one hour but still looks horrible.
     
  13. treborguy

    treborguy

    Joined:
    Apr 17, 2014
    Posts:
    30
    I found increasing the realtime resolution helped somewhat, but also making walls actually intersect, and also making the walls thicker. There are still a lot of problems though that I'm trying to figure out.

    My next step to improve things further was to make everything one mesh (in a 3d modelling program). This yields the most accurate lightmap so far, but STILL there's a little bit of bleed. will let you know if I come up with a solution.
     
  14. treborguy

    treborguy

    Joined:
    Apr 17, 2014
    Posts:
    30
    [SOLVED] OK. I'm about to be everyone's best friend in the whole world. No amount of tweaking the GI settings will get rid of the artifacts that you're experiencing.

    The solution is just to scale your whole world up (about 5 times from the standard scale) and set your realtime resolution back down to 1 if you've increased it. If that's too heavy, play with the scale of your level, the larger it is, the more texels there are to compute. you can also set your realtime resolution to be less than 1. It's something to do with the way that indirect lighting is calculated. You might also find that turning Indirect Intensity down to a very low number ie. 0.04 or less, and then turning every other light bounce setting to max (in the GI settings and on the light itself) could get rid of some artifacts.

    You will obviously have to turn gravity up to compensate.

    The next thing you want to do is make sure that where geometry is touching, that it IS intersecting. If two faces are perfectly touching, light will still get through and you will get artifacts.

    It fixes these problems:

    - Experiencing bleed on a wall where your geometry is meeting
    - Light shining through solid walls
    - Light on walls adjacent to where you have a door or window or similar

    Now I just have to figure out why blend probes aren't working on my dynamic objects...
     
  15. treborguy

    treborguy

    Joined:
    Apr 17, 2014
    Posts:
    30
    OK, also if you have light bleeding right through to a room where it should never reach, check the scale of your light is not too big. It's as if light emanates from every part of the light's bounding shape.
     
  16. bananahead

    bananahead

    Joined:
    Mar 29, 2013
    Posts:
    14

    sorry, but nothing is [SOLVED]!!
    if i get it right, the "precomputed resolution" slider just works as an multiplier. So, if i make the model five times bigger, its the same result as i pump up the resolution to 5.

    and refering to this thread: http://forum.unity3d.com/threads/light-map-issue.108125/#post-715426 the geometry doesn't have to be intersecting.
    without intersecting geometry i get better results than with intersecting geometry.

    one thing helped me: i didn't import all meshes at once as an prefab (3ds max fbx export).
    I imported every mesh for its own and reassembled them inside unity. nearly no bleeding.
     
  17. bananahead

    bananahead

    Joined:
    Mar 29, 2013
    Posts:
    14
    Update:

    now we went away from realtime-GI and try to bake the shadows.
    The damn bleeding still occurs. I tested different setups on the model and the uvs.
    My light- and importsettings (i tried calculated and imported normals and for the lightmap-uvlayout i didnt generate uvs):
    import.JPG lighting-settings.JPG

    Here are my results:

    1st normal model out of blender, all walls together one mesh:
    01.JPG

    with lightmap-uv on the second channel:

    02.JPG

    With Edgeloops on the bottom and the floor:

    03.JPG
     
  18. bananahead

    bananahead

    Joined:
    Mar 29, 2013
    Posts:
    14
    out of max (every other thing was modelled in blender):

    05.JPG
    Seperated Walls (every wall a single "cube"):

    04.JPG


    someone knows a solution?
     
  19. vahid62

    vahid62

    Joined:
    Sep 2, 2012
    Posts:
    2
    1.jpg I have same problem and can't figour out it
     
    Last edited: Nov 23, 2015
  20. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    It looks like the door is pretty thin, and the lighting changed dramatically ie it happens between indoors and outdoors. Assuming this is a directional light, it means there's not enough padding in the lightmap uvs.

    If using point lights, that's a different problem (they don't get occluded afaik). I would probably split the mesh on the floor so the inside floor does not share uv island with outside floor. That's just off the top of my head, rather than based on testing.
     
  21. tawdry

    tawdry

    Joined:
    Sep 3, 2014
    Posts:
    1,357
    Same problem dropping the shadow bias etc to 0 masks it pretty well
     
  22. loledas

    loledas

    Joined:
    May 3, 2015
    Posts:
    18
    I'm having the same issues, and I'm starting to think so it's problem with unity5 itself, because this doesn't occur on other engines...
     
  23. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,913
    It will happen in any other engine with walls that thin. Unreal 4.11 (unreleased preview) inserted a whole new system just to try and help with this.

    You have to increase the indirect/realtime resolution. Minimum 8-12 for thin walls - 3 won't be enough. Make sure your Baked/Irradiance scene views are aligned well.
     
    Last edited: Feb 23, 2016
  24. jtrim1

    jtrim1

    Joined:
    Sep 27, 2014
    Posts:
    11
    Hey everyone! I thought I'd chime in with something I discovered tonight when I was looking for a solution to this same issue. I was having an issue where I'd get these bright edges up in the corners of rooms etc. Mine was a UV issue, where the polygons on the UV map where disjointed (I just did automatic UV mapping in blender) and for example, it might have put one of my living room wall polys next to a wall poly from another room. if one room was brightly lit, and the other was dark, the very edge of the brightly lit room was bleeding ever so slightly onto the polygon of my darkly lit poly from another room. I was able to fix this by adding a bit of a "margin" between all of the polys on my UV map. in blender there is a setting called "Island Margin" that you can set a spacing between every "Island". this gives a buffer zone between the UV polys for any bleeding. I went from having a house full of these bright edged corners to perfectly baked house lighting with no edge bleeding.

    I hope that might be relevent to this in some way. if not, well, I'm happy mine is fixed! :)
     
    DougRichardson likes this.
  25. danielrugu

    danielrugu

    Joined:
    Jul 24, 2016
    Posts:
    14
    Guys, I had this problem in a interior design scene too. I was breaking my head with all the solutions here and what I found online. The best solution was to create 3D planes in Maya or Unity and block the directional light from hitting where the bleeding is happening. And done and no mode time wasted.
     

    Attached Files:

    Salvador-Romero likes this.
  26. abhisri

    abhisri

    Joined:
    Apr 28, 2017
    Posts:
    1
    hi, it can be solved as:
    -Select your light
    -Go to inspector tab
    -under the 'light'
    - Select Mode as "Mixed" or "Realtime"
    - turn 'Bias' to 0
    In my case it works, i hope it solves your problem too.....
    if not please let me know

    Screenshot (2).png
     
    Jar2Jar likes this.
  27. ekergraphics

    ekergraphics

    Joined:
    Feb 22, 2017
    Posts:
    257
    Bias can only help so much. In some cases, ie for us, it still doesn't help totally:

    leak.jpg

    We wrote this off as a shortcoming of Unity's generally rather basic shadow implementation.

    There's assets on the store to take care of this now (screen space contact shadows), and a Unity staff member has indicated that a future 2017.x release might also replace their current shadowing techniques.

    Until then, I guess this is a part of the "Unity look" that many people complain about online, perhaps?
     
  28. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    Just increase lightmap resolution or lightmap scale to fix the issue
    Also use Progressive Lightmapper for lightmapping

    The only solution is resolution. I already tested in depth in another topic
     
    AlanOToole likes this.
  29. Jar2Jar

    Jar2Jar

    Joined:
    Dec 2, 2017
    Posts:
    1
    Yes, It did work for me...
    In some case you might have to come up with a secondary UV for light maps. Up to you to decide on your level where to use secondary UV or not. Unity genarator did not work, had to import a mesh with 2 UV on it, have seen case that unity gerator worked well, just a matter of trying all the workflow though. Thanks.