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. Skolstvo

    Skolstvo

    Joined:
    Dec 21, 2015
    Posts:
    107
    Would it be possible for Unity to release a equirectangular image to spherical harmonics coefficient converter? Some of use use functional programs for lightmap baking like Blender for instance, instead of suffering with Enlighten.

    I see that the coefficients are accessible with the API, what would be the best way to input these values of a HDR render? If I could get this working, you could throw Enlighten in the garbage can for all I care.
     
  2. bluescrn

    bluescrn

    Joined:
    Feb 25, 2013
    Posts:
    642
    There's some open-source SH code from D3DX that includes a cubemap-to-SH function (SHProjectCubeMap):

    https://github.com/walbourn/directxmathsh

    If that does the job, I guess it could be translated to C#?

    Then maybe we could automate the process of rendering cubemaps within the editor from each lightprobe position in the editor, and use shader replacement, to render those cubemaps with a flat white diffuse material on everything, so that you're capturing the lighting rather than the lit material colours....
     
  3. frankiecavanagh

    frankiecavanagh

    Joined:
    Dec 13, 2015
    Posts:
    11
    still not resolved in the new patch today, any news of an eta?
     
  4. Skolstvo

    Skolstvo

    Joined:
    Dec 21, 2015
    Posts:
    107
    I'll bet that the patch will never make it into 5.3. No web player builds with functional light probes ever.
     
  5. bluescrn

    bluescrn

    Joined:
    Feb 25, 2013
    Posts:
    642
    I'm getting a little worried about there being no mention of lightprobes at all when the upcoming new lightmapping system was announced...
     
  6. Xanthius

    Xanthius

    Joined:
    Aug 20, 2012
    Posts:
    28
    Any update would be appreciated. This is not a little bug but rather a serious and fundamental flaw and we need more frequent updates.
     
    Dee Va, Pixeldamage, Tinovdk and 3 others like this.
  7. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    707
    We had few problems with lightning in the scene. Also light probes was way too dark. We did copy all gameobjects from old scene, to new one and that fixed our problems with probes and lightning. Even after applying all settings into Lightning from old scene.

    One thing to mention - we are not using directional lights (indoor). Its a fast way to check - maybe it will fix your problems with light probes too.
     
  8. MvdLaar

    MvdLaar

    Joined:
    Dec 27, 2012
    Posts:
    21
    Not using the directional light is why it works in your case - the black spot problem only appears on the side opposite to a directional light.
     
  9. Futurerobot

    Futurerobot

    Joined:
    Jul 13, 2011
    Posts:
    179
    The black spot appears on the opposite side of any sufficiently strong light source, point, directional, spot or emissive mesh. It's a precision problem and not related to the type of light.

    If the lightprobes are only affected by weak lightsources like low ambient bounce light, they do not get the dark spot. Like indoors GI lighting without any light objects baked into them. Which is why the problems first seemed related to light objects, when it's actually about intensity.
     
    MrXee, popupAsylum and MvdLaar like this.
  10. frankiecavanagh

    frankiecavanagh

    Joined:
    Dec 13, 2015
    Posts:
    11
    5.3.4p4 issue still happening
     
  11. chi.phuong

    chi.phuong

    Joined:
    Jan 4, 2016
    Posts:
    1
    Anyone tried the 5.4 beta 15? Enlighten 3.03 is in there and was just wondering if it's fixed the issue?
     
  12. frankiecavanagh

    frankiecavanagh

    Joined:
    Dec 13, 2015
    Posts:
    11
    just tested and it has the same issue
     
  13. Pixeldamage

    Pixeldamage

    Joined:
    Sep 6, 2010
    Posts:
    52
    This
     
    Dee Va, _M_S_D_, MrXee and 1 other person like this.
  14. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    why this is not fixed already? seriously i'm just curious what the reason for this problem still exist even in the latest 5.4 beta.
    because in this article http://www.geomerics.com/blogs/authoring-performance-in-the-seastack-bay-showcase/
    their lightprobe are normal and totally match with the lighting around it, and it stated that the lightprobe are the result of enlighten light transport so it's shouldn't be engine side isn't?
     
    Xanthius likes this.
  15. MvdLaar

    MvdLaar

    Joined:
    Dec 27, 2012
    Posts:
    21
    I would usually never 'whine', because I understand how hard it is to release features and what a hussle it is to get new builds out, but please Unity, this is not a minor bug for a handful of people - the entire lighting system is broken, for everyone...
     
    Arkhham, bluescrn, Dee Va and 3 others like this.
  16. frankiecavanagh

    frankiecavanagh

    Joined:
    Dec 13, 2015
    Posts:
    11
    still no fix with the new patch, this is getting a little crazy, considering it was promised months ago
     
  17. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Sorry unity, but i'm with the other this time. This lightprobe problem are getting bad since it's not getting fixed after months, i'm kinda disappointed for this one :(
     
  18. Deleted User

    Deleted User

    Guest

    I see that this post was made 1. of april, was it all a april fools joke?
     
  19. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    TL;DR;
    It wasn't a cruel joke but an unfortunately optimistic estimate. We have worked closely with Geomerics on identifying the issue (see below), we have correct output using a custom Enlighten version accounting for the differences we found and we are now waiting for a full build so we can get this into a Unity patch release.

    The longer version:
    In Unity 4.x we could output L2 spherical harmonics for light probes. Life was easy back then.
    Starting with version 5.0 we had to use L1 spherical harmonics provided by Enlighten because L2 output wasn't supported for baked probes (L1 looks more blurry than L2 because of fewer coefficients to represent lighting and the big jump to 5.0 made it hard to see if anything was off).
    In 5.3 we fixed some bugs in our spherical harmonics code that made it more visible that L1 output was insufficient. We got a new build of Enlighten that supports outputting L2 coefficients but the scaling and axes were off so the lighting was still incorrect.
    After fixing scaling and matching the coefficient order it turned out that the fact that Unity and Enlighten use different coordinate spaces (Y and Z are swapped compared to what Unity uses, so the handedness is different) makes the final step tricky. No amount of swizzling and scaling could make the L2 output mathematically correct. There are ways for rotating SH representations, but they would not be feasible for realtime light probes.Geomerics has kindly provided us a library that takes the axis swap and coefficient order differences into account, which means that there are no changes to the runtime handling of SH data and all your existing data (e.g. ambient probes) will continue to work. It will however be recommended to rebuild the lighting to get the L2 coefficients for the light probes.
     
    Last edited: Apr 29, 2016
    crudeMe, rrsimon, Reanimate_L and 3 others like this.
  20. a_tarerra

    a_tarerra

    Joined:
    Nov 7, 2012
    Posts:
    16
    Thanks for the update! I've been expecting to rebuild the lighting, but am getting dangerously close to our release date... could I ask for a conservative estimate on when this will be available in a patch? Any chance of a beta build?:) My only other alternative is to revert to 5.2.
     
  21. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    I expect the new Enlighten library beginning of next week and a few days to get it into a the patch release branch. It is probably too close to get it into the patch releasing on the 4th of may, but the week after seems realistic. Again, no promises on that date but I will do my best.
     
  22. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Thank you for the update man, let's hope everything goes well and the fix can go into patch release at 4th may,
    may the 4th be with you. . .
     
    MvdLaar likes this.
  23. Haagndaaz

    Haagndaaz

    Joined:
    Feb 20, 2013
    Posts:
    232
    Finally, I'll be able to use lightprobes again!
     
  24. ArchVizPRO

    ArchVizPRO

    Joined:
    Apr 27, 2014
    Posts:
    457
    Good good news!
    Thank you Unity!
     
  25. Tinovdk

    Tinovdk

    Joined:
    Nov 28, 2013
    Posts:
    83
    Thanks for the update! It seems that everyone here is understanding of problems, issues, delays, and even life getting in the way. As long as it is communicated it's all good. :)
     
  26. frankiecavanagh

    frankiecavanagh

    Joined:
    Dec 13, 2015
    Posts:
    11
    Thanks for the update :)
     
  27. Skolstvo

    Skolstvo

    Joined:
    Dec 21, 2015
    Posts:
    107
    Any hope for getting functional light probes for the Webplayer?
     
  28. Futurerobot

    Futurerobot

    Joined:
    Jul 13, 2011
    Posts:
    179
  29. Skolstvo

    Skolstvo

    Joined:
    Dec 21, 2015
    Posts:
    107
    @Futurerobot

    I am aware of that. It's just a shame that the Webplayer never had any functional light probes. The Unity WebGL implementation isn't even close to ready for prime-time as far as graphics are concerned. WebGL 2 is pointless to use if no standard build browsers support it.
     
  30. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    What do you mean webplayer lightprobe never functional, i never had any problem with lightprobe when we still using webplayer
     
  31. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    @KEngelstoft so. . . how is it going? just asking for any info update
     
  32. MvdLaar

    MvdLaar

    Joined:
    Dec 27, 2012
    Posts:
    21
    Heads-up: latest patch does not have the fix, according to the patch notes.
     
  33. Howard-Day

    Howard-Day

    Joined:
    Oct 25, 2013
    Posts:
    137
    As expected and predicted, no - Soonest it could be released would be next weeks patch.
     
  34. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    bummer. . . .
     
  35. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    nothing guys. . . .really???
     
  36. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Hello rea! Sorry for not getting a fix into the patch! We still haven't received a fully working SDK release with the fix. We are working with Geomerics on ironing out the remaining issue (direct light is correct now, indirect is still not correctly axes-swapped).
     
    Tinovdk, crudeMe, rrsimon and 2 others like this.
  37. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Ah i see alright no worries, i guess we have to wait for now. We are working on gearVR stuff which rely heavily on lightprobe for lighting dynamic objects could be great if we have the fix soon :(
     
  38. Haagndaaz

    Haagndaaz

    Joined:
    Feb 20, 2013
    Posts:
    232
    @KEngelstoft thanks for the info! Any info on possible timeline?
     
  39. YourUncleBob

    YourUncleBob

    Joined:
    Jun 11, 2012
    Posts:
    55
    Or how about a temporary hack? With careful probe placement, we've been able to mostly avoid these corrupt probes, but it's hit or miss. I'd like to be able to run a script and go through and identify and fix, or even just remove, the probes that have gone bad.

    Yes, a real fix would be fantastic, but in the meantime anything to limit the severity of the problem would be great. We have levels where everything looks good until a character wanders near one of the bad probes. Anything short of a complete negative color on the far side of the probe would be an improvement.
     
  40. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Yeah this kind of stuff is what make third party plugins sometimes becoming a bad idea since unity are depending to geomerics.

    @KEngelstoft : this is not a request but i'm mostly curious what your opinion regarding this, why not using separate lightprobe&reflection probe system which is can run independently from enlighten you guys did this before with beast isn't? even thought it gonna be tricky to make it compatible with precomputed GI but separate system can be usefull especially if user are using external baked lightmap.
     
  41. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Try using the fancy L1-only reconstruction shader code, I posted that on the forum earlier in the thread http://forum.unity3d.com/threads/un...of-the-directional-light.378516/#post-2538912
     
    Tinovdk likes this.
  42. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Beast computed the lightprobes so it wasn't an independent system before. With our progressive lightmapper we will have full control over the probe generation code.
     
    Tinovdk likes this.
  43. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Hi! We have made a lot of progress today and now have way better estimates... Guess which sphere is lightmapped and which is probe lit:
    vs.png vs2.png
    Looking at our patch release schedule I am hoping we can get it into 5.3.5 patch 3 and into 5.4 beta 20.
     
    Futurerobot, Tinovdk, crudeMe and 9 others like this.
  44. Haagndaaz

    Haagndaaz

    Joined:
    Feb 20, 2013
    Posts:
    232
    Thanks for keeping us informed! :)
     
  45. forestrf

    forestrf

    Joined:
    Aug 28, 2010
    Posts:
    231
    That looks really good. We didn't know you were not only fixing it but also making it look better.
    Thank you!
     
  46. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Part of the fix involves adding support for L2 spherical harmonics :)
     
    forestrf, Xanthius and Tinovdk like this.
  47. YourUncleBob

    YourUncleBob

    Joined:
    Jun 11, 2012
    Posts:
    55
    Tinovdk likes this.
  48. SteveKouts

    SteveKouts

    Joined:
    Aug 23, 2012
    Posts:
    79
    Cant wait for this fix! Is there another release coming soon? We are working on final lighting for our project!
     
  49. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    The fix is in 5.3.5 patch 3 which will release on 8th of June.
     
  50. Skolstvo

    Skolstvo

    Joined:
    Dec 21, 2015
    Posts:
    107
    Is there any hope to have functional lightprobes in the webplayer. I know it is deprecated, but maybe there is a way. We are still using the WebPlayer for archvis, and it's a damn shame that light probes simply do not work with the last webplayer Unity version.