Search Unity

Unity 5.3.1p2 Light Probe issue: dark spot in the opposite direction of the directional light

Discussion in 'Global Illumination' started by andrei-ichim, Jan 8, 2016.

  1. Howard-Day

    Howard-Day

    Joined:
    Oct 25, 2013
    Posts:
    137
    And on the beta? It's not in b20, right?
     
  2. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    No, its in b21.
     
    Howard-Day and Tinovdk like this.
  3. Shizola

    Shizola

    Joined:
    Jun 29, 2014
    Posts:
    476
    So... about that patch :p
     
  4. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Works great in B21. . . . you just make me a very happy artist :D
    next is proper mixed mode please :D
     
  5. Pawige

    Pawige

    Joined:
    Nov 26, 2012
    Posts:
    40
    Still having severe issues here. I rebaked the scene in my current project and things got worse, not better, so I created this test scene to see what was going on: LightProbes.jpg
    Static object on the right, dynamic on the left. Two directional lights, one red (intensity 1), one green (intensity 2). Seems all probes now have a spot of light exactly opposite the main light direction, and the ambient lighting is still weird; it's too dark and too blue in this case.
     
    SteveKouts likes this.
  6. Pawige

    Pawige

    Joined:
    Nov 26, 2012
    Posts:
    40
    Couldn't get the second image to upload in the last post, but here's what stuff looked like in my actual project's scene. The grass and rocks are dynamic, everything else is baked static:
    WeirdProbes.jpg The lightprobes are quite clearly very different than the lighting on the static objects would suggest they should be.
     
  7. Deleted User

    Deleted User

    Guest

    This makes me happy to see
     
  8. Owers

    Owers

    Joined:
    Jul 7, 2012
    Posts:
    39
    Trying beta 21. The results are a lot better than before, but the issue still remains in areas were normals are tight, especially in creases and normal maps (colours are opposite of the light/emission source):

    Unity 5.3.5f1:


    Unity 5.4.0b21:


    It could be better, but the results are at least useable so long as you don't increase light and emission intensity too much. I hope this isn't the final fix. We're so close!
     
    Shizola, AcidArrow and Arkhham like this.
  9. Arkhham

    Arkhham

    Joined:
    May 7, 2016
    Posts:
    167
    But.. what about 5.3's patch? delayed?
     
    Skolstvo likes this.
  10. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Yes, it got a bit delayed. It should go live in the next 10 mins or so.
     
    Arkhham likes this.
  11. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
  12. Futurerobot

    Futurerobot

    Joined:
    Jul 13, 2011
    Posts:
    179
    It's a lot better now, but I'm afraid there's still an issue left. Lights apply light to the opposite side of objects. These tests are from 5.3.5p3
    lightprobeissue4.png


    Here's a more dramatic example, scaled up the lightprobe gizmos to show how they react.
    The big sphere on the left is lightmapped, the one on the right is lightprobe lit.
    lightprobeissue5.png
     
  13. Shizola

    Shizola

    Joined:
    Jun 29, 2014
    Posts:
    476
    After updating to 5.3.5p3 and re-baking my characters look pretty much the same (slightly burnt on the bottom) My probe gizmos look messed up which isn't encouraging.

    5.3.4.PNG 5.3.5.PNG

    And I'm also getting this error after hitting play
    "Error adding Enlighten probe set: Failed to allocate probe set 596524d671ced247b3d770c14006ac61"
     
    Deleted User likes this.
  14. Deleted User

    Deleted User

    Guest

    I think we just expect them to work in a different way than they would do in real life. If you look at the Unite 2016 keynote, you can see that its normal to get weird light wrapping on the opposite side of light sources,
    look for yourself, you can clearly see what i'm talking about UniteProbes.jpg
     
    bluescrn, laurentlavigne and Shizola like this.
  15. Skolstvo

    Skolstvo

    Joined:
    Dec 21, 2015
    Posts:
    107
    @monkzoren In that case Unity lightmapping is broken, and needs to be fixed.
     
  16. Deleted User

    Deleted User

    Guest

    Estimating by the forum threads on this forum, I think that is the case yes.
    EDIT: Looking forward to the progressive ligthmapper!
     
  17. Skolstvo

    Skolstvo

    Joined:
    Dec 21, 2015
    Posts:
    107
    @monkzoren

    Indeed, funny how light is caught directly from the opposite direction of the light source, not from the actual geometry that the light is bouncing from. Oh well, I guess physics might not be the best model for light transport after all.
     
  18. ArchVizPRO

    ArchVizPRO

    Joined:
    Apr 27, 2014
    Posts:
    457
    I have done some test and for me lightprobe now reacts as they should.
    No problems here.
    Thank you Unity !
     
    KEngelstoft and Deleted User like this.
  19. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    It's a ringing problem known from spherical harmonics, It's like they didn't use the code to counter act it, it's a known issue of SH with known solution ...
     
    KEngelstoft likes this.
  20. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    btw just want to check is everyone still getting messed up probe baked in gamma space?
    my probes mostly broken when using gamma space, but normal in linear space.
    Pinging @KEngelstoft
     
  21. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,791
    Probes are finally in the realm of usable, so hurrah!

    They still do seem a bit weird though. similar to what @Owers saw. I did a comparison with 4.

    probes.jpg
     
    bluescrn likes this.
  22. PlatformSix

    PlatformSix

    Joined:
    Feb 27, 2014
    Posts:
    57
    Found a weird bug (# 804898) with the new light probes - if you're getting some weird results like this, make sure your light-probe-volume encloses all your lights - seems under some circumstances un-enclosed lights will apply to all probes regardless of range.
     

    Attached Files:

    julienkay and Deleted User like this.
  23. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    I have a fix for this "Error adding Enlighten probe set" error coming to 5.3.5p5. In the meantime, as a workaround, you can clear your lighting data asset and then clear the GI cache.
     
    Shizola likes this.
  24. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Thank you for reporting, I'll take a look.
     
  25. Shizola

    Shizola

    Joined:
    Jun 29, 2014
    Posts:
    476
    Cheers.
     
  26. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    How does it look when you clear the GI cache? I tried your scene and it looks fine, so clearing should help. This is because the patch 3 version in some cases reads stale data from the cache. 5.3.5p5 will invalidate the cached probe files and rebake what is needed.
     
  27. PlatformSix

    PlatformSix

    Joined:
    Feb 27, 2014
    Posts:
    57
    No change with clearing the GI cache and re-baking (also, this is on v5.4.0b21). I added this to the bug report, as well as some details about how it seems to be related to area lights.

    I've attached my test project here, in case anyone else would like to see if it occurs for them...
     

    Attached Files:

  28. Futurerobot

    Futurerobot

    Joined:
    Jul 13, 2011
    Posts:
    179
    @KEngelstoft Do you have any updates on the issue of the lit area opposite lightsources?

    I got an email that my bug was not reproducible anymore, but when I opened the testcase I submitted and baked in 5.3.5p3 I got the backside lit bug. I wonder if the fix was tested with the testcase supplied, or with other cases.
    (The email said it was not reproducible in 5.4, but afaik the fix was backported to 5.3.5p3?).

    In testcases from the fix posted here, usually several low level lights have been used, which doesn't make this bug apparent. However, it's not representative for many scenarios on mobile where only lightprobes are used to light dynamic objects, and much more dramatic lighting is used. In any case it should be clearly visible in the testcases I supplied.

    Here's a typical use-case for our mobile lighting, a dark dungeon entrance. The problem is very visible even when not using "burnout" level lights.
    Dungeonentrance.png
     
    SteveKouts and rrsimon like this.
  29. julienkay

    julienkay

    Joined:
    Nov 12, 2013
    Posts:
    171
    @PlatformSix I had a similar issue where there was a weird blue/yellow color tint in my light probes.
    Thanks for posting a way around the issue. Enclosing all lights with the light probe volume fixed it.

    @KEngelstoft case #805202 if you need another test project reproducing the bug.
     

    Attached Files:

    Deleted User and PlatformSix like this.
  30. Deleted User

    Deleted User

    Guest

    @KEngelstoft Any new updates? been waiting since January, and the wait/lack of info getting a bit ridiculous
     
    Shizola likes this.
  31. SteveKouts

    SteveKouts

    Joined:
    Aug 23, 2012
    Posts:
    79
    LightProbeIssues_01.jpg LightProbeErrorsConsole.jpg
    I have this patch installed and tried re-baking lighting and probes, its definitely not fixed.
    Here's my result. Half the probes are random primary colors and the other half are black.
    I also get probe errors in the console.
     
  32. SteveKouts

    SteveKouts

    Joined:
    Aug 23, 2012
    Posts:
    79
    I also tried another test scene and Im getting the same problem.
    I also cleared bake data. this is Unity 5.3.5p3 Clearly worse than before. NewSceneSameErrorsInLighting.jpg
     
  33. SteveKouts

    SteveKouts

    Joined:
    Aug 23, 2012
    Posts:
    79
    OK!! I just cleared Bake data and GI CACHE and rebaked, LightProbesFIXED.jpg and it seems to be WORKING!!!! OMFG!
    [Edit]: Still some issues but its better.
     
    Last edited: Jun 16, 2016
  34. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Looks like your Lighting Data Asset is baked with a previous version. Did you try clearing GI Cache and rebaking? The 5.3.5p5 should remove the need to do this clear.
     
  35. SteveKouts

    SteveKouts

    Joined:
    Aug 23, 2012
    Posts:
    79
    Yeh I cleared the lighting data and GI cache and i got the above result its good now but there is still some issues which have already been pointed out by other people in this thread.
     
  36. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
  37. krides

    krides

    Joined:
    Apr 7, 2011
    Posts:
    38
    Hey guys. I have the same problem as everybody here, so I switched to 5.3.5p3 hoping that it would be fixed there. I cleared all lighting data, cleared the GI Cache as explained above, pressed Build, and, three hours later, I got this error for each Light Probe I have in my scene:

    IsFinite(indirectProbeData[coefficient])

    This is it. There's no other info in the error.

    Also, the probes (and so the dynamic objects) all look exactly like on the screenshots SteveKouts and Shizola have posted.

    I repeat, clearing the GI Cache from the Preferences didn't help at all. Does anybody have a solution? What GI Cache settings do you have? In mine compression is enabled by default, and I'm not sure it should be, but I left it as it was.
     
  38. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    @krides Do you have area lights in the scene?
    Gi Cache compression should be left enabled, it doesn't have any effect to turn it off, except it will take more disk space.
     
  39. krides

    krides

    Joined:
    Apr 7, 2011
    Posts:
    38
    No, zero area lights. However, I have a whole bunch of emissive materials, and also I'm using both Precomputed Realtime and Baked GI (the latter only for two directional lights).
     
  40. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Hmm, could be a different issue. Would you mind filing a bug report so I can investigate your scene. I haven't seen this before: IsFinite(indirectProbeData[coefficient])
     
  41. krides

    krides

    Joined:
    Apr 7, 2011
    Posts:
    38
    I am currently doing another bake (it will probably take another hour or so). If the issue persists, I'll file a report. Thanks!

    UPDATE: Okay, the bake is finished. The light probes are broken like before, but I no longer have the IsFinite error this time.

    UPDATE 2: Uploaded a bug report. Case 806217
     
    Last edited: Jun 16, 2016
  42. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86


    Cleared the GI cache/ lighting data, some probes are fixed,some remain broken.
    I tried the suggestion of 'encompassing all lights' with probes, but it had no effect.
    (5.3.5p3)
     
  43. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86


    The errors occur based on proximity to the coloured light source ( point light / no shadows / baked / directional specular).

    These probes are newly created- post update.

    Light settings
     
  44. Skolstvo

    Skolstvo

    Joined:
    Dec 21, 2015
    Posts:
    107
    Has anyone looked into environment cubemap to light probe conversion? Might be a more bug free way to get decent looking lighting.
     
  45. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    Moving the light somewhere else fixed the issue.



    I then moved it back to the original spot, and it went back to being broken.

    I finally offset it a tiny bit from the original spot and the results are now correct.



    It looks like some part of the cache isn't actually cleared when I clear lightmap data +GI cache, and I have to "jiggle" my lights to fix the issue.
     
  46. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    I can rebake lighting and get totally different probe results, nothing seems consistent. Is there any other additional cache or file I should be aware of?
     
  47. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    I fix it in one area, it breaks in another- I must be missing a piece of this puzzle.
     
  48. SteveKouts

    SteveKouts

    Joined:
    Aug 23, 2012
    Posts:
    79
    clear baked data in lighting panel Build dropdown menu then clear gi cache then rebuild lighting
     
  49. Futurerobot

    Futurerobot

    Joined:
    Jul 13, 2011
    Posts:
    179
    @KEngelstoft Any comment/tips on the light opposite light direction?

    Here's an image from a simple testcase.
    Create a lightprobe group at 0,0,0
    Create a light at 0,0,0
    Bake the light wiht Baked Gi
    All probes get significant lighting opposite the light direction. Simpletest.png
     
  50. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Hi @Futurerobot! The fixed light probes are now matching Unity 4.x behavior. I have recreated your scene and baked it using Unity 4.7.2.

    Unity 4.7.2 gamma color space:
    Unity_2016-06-17_10-20-58.png

    Unity 4.7.2 linear color space:
    Unity_2016-06-17_10-26-25.png

    The bright spot is caused by the intense direct lighting causing a ringing artefact on the opposite side. This is an inherent limitation of spherical harmonics. We can't fix this easily without going for a different reconstruction algorithm.

    You can try the fancy L1 reconstruction code that I posted earlier in this thread and perhaps you can get rid of most of the ringing but the shading cost is much higher so it might not be suitable for all platforms. Keep in mind that the light probe SH axes is now swapped around so you have to swizzle them in the shader.

    We might implement the fancy L1 reconstruction code into Unity at some point, if the demand is there (vote on feedback if you need this).
     
    Deleted User likes this.