Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Baked GI produces unusable lighting on LOD's

Discussion in 'Global Illumination' started by mgc90403, Oct 24, 2015.

  1. mgc90403

    mgc90403

    Joined:
    Dec 24, 2013
    Posts:
    20
    I'm getting horrendous atlasing issues on baked lightmaps, when combined with LOD's. Various elements are coincident across lightmaps, and are inconsistent from LOD to LOD.



    I've read that there are persistent bugs with Directional Specular, so am trying a fresh bake with that disabled. Beyond that though, I'm a bit stumped. Would appreciate any thoughts on the matter.

    Thanks very much.
     
  2. mgc90403

    mgc90403

    Joined:
    Dec 24, 2013
    Posts:
    20
    switching off Directional Specular doesn't fix the problem. It also seems I *don't* have overlapping uv's in the lightmaps. Rather, it appears that unity is deriving wacko light values during the render, and baking those in. Makes no sense to me.

    Am I meant to switch off all LOD geometry except for the top level, then bake, then lock those maps, and re-bake with other geo on...?? That would seem needlessly circuitous - though at this point I'll take a solution that works, even if it's inelegant.
     
  3. mgc90403

    mgc90403

    Joined:
    Dec 24, 2013
    Posts:
    20
    Since it seems to be an issue with the way the renderer is working, I'm trying to get a better handle on what enlighten is doing. I'm attaching here a screen grab of my scene in-editor (brightened a bit to show the triangular artifact more clearly) as well as the corresponding lightmap in uv-space. This light map shows the "baked intensity" of the image:
    Screen Shot 2015-10-24 at 2.01.14 PM.jpg Screen Shot 2015-10-24 at 2.01.07 PM.png

    So how on earth does enlighten arrive at this bake??There's no other geometry in the scene that'd suggest this kind of result. Nor does the mesh of the geometry suggest any kind of shape like this:

    Screen Shot 2015-10-24 at 2.07.49 PM.jpg

    Lastly, here's a snap of the next LOD of the same object. The lighting artifacts seem to relate in no meaningful way. Would dearly love some explanation as to the logic here.
    Screen Shot 2015-10-24 at 2.10.37 PM.jpg
     
  4. mgc90403

    mgc90403

    Joined:
    Dec 24, 2013
    Posts:
    20
    As I've dug more into this problem, it's become clear the problem is with the sampling or rasterization of the indirect portion of the baked light. I've produced another video that clearly exemplifies the problem - - and sent it along to Unity via bug report.



    I must be doing something wrong that I'm just not grasping, since this seems to be a terribly simple issue, and easily fixed either by mapping each LOD into the base LOD's lightmap, or by doing a full GI sample for each LOD. Would love opinions from folks who've gotten this to work (either with Unity or via 3rd party workflows.)
     
  5. mgc90403

    mgc90403

    Joined:
    Dec 24, 2013
    Posts:
    20
    After a lot of tests and debugging, it appears that Final Gather is corrupting the bake. Here're two lightmaps of the same scene, one baked with FinalGather OFF, and the other baked with it ON. Notice that with Final Gather on, the indirect lighting becomes faceted and loses most detail.

    Conclusion: Don't use Final Gather when baking in Unity - at least til this is fixed. :p

    I've sent along an updated bug report to the Unity dev's which hilights the issue.

    Screen Shot 2015-10-25 at 12.53.22 PM.png Screen Shot 2015-10-25 at 12.53.08 PM.png
     
  6. OllyNicholson

    OllyNicholson

    Unity Technologies

    Joined:
    Jun 17, 2011
    Posts:
    142
    If you drop the bug ref numbers here we can add a link to this thread if you've not done so already and try and get some traction.
     
  7. mgc90403

    mgc90403

    Joined:
    Dec 24, 2013
    Posts:
    20
    Fantastico - the bugs I've reported in the last couple days:
    739181 739241 739359 - the latter two are flavors of 739181, where I've attached example projects that show different facets of the problem.
    Case 739221- crash on generate lightmap uv's - tangentially related. Made debugging things harder ;)
     
    shkar-noori likes this.
  8. mgc90403

    mgc90403

    Joined:
    Dec 24, 2013
    Posts:
    20
    Just checking on this. Did I need to do anything beyond listing the case numbers here? Thanks for any guidance.
     
  9. mgc90403

    mgc90403

    Joined:
    Dec 24, 2013
    Posts:
    20
    Ping!
     
  10. SpiriTx

    SpiriTx

    Graphics QA Unity Technologies

    Joined:
    Apr 12, 2012
    Posts:
    252
    Looking into them right now.

    Forwarded the LOD one to devs
     
    Last edited: Nov 9, 2015
unityunity