Search Unity

LOD Group Baked Lighting - How To Use?

Discussion in 'Global Illumination' started by ruj, Aug 20, 2015.

  1. ruj

    ruj

    Joined:
    Feb 28, 2013
    Posts:
    113
    I am seeing that in Unity 5 my LOD1 group is NOT using the same(or similar) lightmaps as LOD0, also it seems forced to use light probes instead, which is resulting is some VERY low quality results. There is a huge "pop" to totally different lighting when changing LOD levels. In 4.6 these same LODs transitioned almost invisibly. The option to turn off light probes on the LOD is grayed out, does anyone know what is going on here?


    Thanks.
     
  2. RyuMaster

    RyuMaster

    Joined:
    Sep 13, 2010
    Posts:
    468
    It is normal, that LODGroup creates different lightmap for very group lod, as those have different uv sets and are downscaled properly.

    But its either not baked properly, not applied properly, or I don't know. I have similar thread in here:

    http://forum.unity3d.com/threads/baked-lightmap-is-transparent.349056/

    Maybe I should file bug report, but wanted to confirm firstly that it is not my own mistake.
     
  3. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Hi! This is by design - you have to light your lightmap static LODs using lightprobes.
     
  4. RyuMaster

    RyuMaster

    Joined:
    Sep 13, 2010
    Posts:
    468
    Alright, after many tests, I am confused now. LODGroup produces more ligthmaps, which means, that lower LOD levels are using the maps, not the probes; But, as I see it now, we are using light probes to give information for the lower lods, like where do we want them to be lit. Why not use downsample, as we had before? What is the logic behind this?

    Maybe I am doing it all wrong, but have you ever tried littling LODGroup with lightprobes yourself? I had to put probes manually in the grid pattern around the objects, and still I could not get smooth transition - in some places visual difference is just too dramatic. Which means, that I just need to place more probes in the grid-pattern everywhere around the object? What kind of workflow is that?

    Basically, all I can do now, is render LOD0 myself, then downsample it, and assign to lower LODs, as they have similar UV layout, coming out from simplygon. Which also save me map space. I just don't get any kind of logic behind the decision to use lightprobes and different UV maps for lower lods.
     
    Exustus likes this.
  5. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    You have to use more light probes if you aren't getting a smooth result. Can you post a screenshot of the quality issue? Perhaps we can make this probe placement automatic...
    We never used resampling/downsampling of lightmaps in Unity 4. The lightmapper did change completely from 4 to 5 so the way we have to solve lighting for LODs also had to change.
    This is how it works behind the scenes now: The direct light for a LOD object is baked into a lightmap and the indirect light is sampled from light probes and then gets added into the lightmap for the LOD. I have notified Jesper about the LOD scale, maybe we have a bug there.
     
    OfficialHermie likes this.
  6. RyuMaster

    RyuMaster

    Joined:
    Sep 13, 2010
    Posts:
    468
    Thank you for explanation. I think workflow is a bit troublesome at the moment, so I've switched to manually assigning lower LOD's based on the LOD0 lightmap; But I guess what you did here is somehow needed to interact with realtime GI, which is I am not using.

    I'm not sure if there is a bug, but it is really hard to place lightprobes properly, at least from the first time, that is for sure.
     
    Exustus and OfficialHermie like this.
  7. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Yeah it is not optimal, we will look into improving this (I have added this to our TODO list).
     
    NGC6543 and OfficialHermie like this.
  8. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,325
    So to summarize:
    1. LODs don't get lightmapped, only probe-lit so you won't get AO on them
    2. LODs don't affect the lightmap around them so if you use LOD for large buildings the terrain they sit on, or nearby rocks will not be affected by the building (ao, gi, baked shadow).
    3. Probes are per object, not per vertex of per pixel so you cannot re-create detailed lighting
    Correct?
     
    Last edited: Sep 9, 2015
  9. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    No.
    1. LODs do get lightmapped. LOD0 get lightmapped using the full resolution indirect lighting. LOD1 and higher get lightmapped and the indirect lighting is sampled from lightprobes during baking.
    2. Only LOD0 will affect the surrounding geometry. This shouldn't be a problem since the LODs are usually same size as LOD0.
    3. The probe SH coefficients are generated per object by interpolating between the nearest 4 probes, and evaluation of the lighting is done either per pixel or per vertex using the interpolated probe coefficients so you should be able to get detailed lighting.
     
    cqarthur likes this.
  10. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,325
    Thanks for clarifying, still fuzzy on 1.
    1. are you saying LOD0 gets lightmap (AO, shadows)+GI map but LOD1+ get lightmap (AO, shadows) but the GI doesn't use LOD0 map but instead it is GI lit like other dynamic objects?
     
  11. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    They will both get a lightmap. The only difference is the two ways of sampling the indirect illumination during the lightmap baking before its gets stored into the lightmap.
     
    cqarthur likes this.
  12. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,325
    Gotcha, now the pop makes sense.
    So need to increase probe density around static LOD? That's bad workflow that should be fixed in 5.3
     
    Exustus likes this.
  13. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Yeah, the workflow could be improved but 5.3 is feature locked already and only bugs will be fixed, so it will be in a later release.
     
  14. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Sorry for bringing up an Old Post. But for this point.
    It's somehow kinda confusing how is this gonna work for large object, say a building since unity doesn't have deffered irradiance lightprobe? with the current setup the lighting difference is quite big between LOD. the current lightprobe is only approximation right?
     
  15. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    We have something coming soon that will improve lighting on large probelit objects - probably in Unity 5.4.
     
  16. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,325
    Per vertex probe sampling?
     
  17. NGC6543

    NGC6543

    Joined:
    Jun 3, 2015
    Posts:
    228
    Hi @KEngelstoft, I placed the Light Probes around the static LODed objects, but it keeps 'popping' when the LOD changes. I increased the probe density but not improved.
    I have no directional light(only baked for Ambient Occlusion purpose), only one realtime point light and the point light is following the player position (closely positioned to a camera). Is this setting might cause the popping problem??
    ++
    Should I have to enable "Use Light probes" in the higher LODs? It's strange, when I bake a lightmap the "Use Light probes" is disabled(but its value can be modified by acript).
     
    Last edited: Jan 11, 2016
  18. Dee Va

    Dee Va

    Joined:
    Jul 5, 2012
    Posts:
    11
    I'm experiencing with the same problem and with the huge scenes, it is also quite painful process to manually place the light probes.
    This seems like a good idea.
     
  19. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Light Probe Proxy Volumes (it is in 5.4).
     
  20. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    You shouldn't have to, that's why the option is greyed out. Is it popping because of a change in brightness, shape or something else? Please try and describe it in more detail, screenshots would also be nice.
     
  21. Arkhham

    Arkhham

    Joined:
    May 7, 2016
    Posts:
    167
    I had similar LODs Popping issue...Decreasing the bounce boost value to 1 solved the problem for me.. It only appears from 3 above(bug?), See if that's the case for you.
     
  22. NGC6543

    NGC6543

    Joined:
    Jun 3, 2015
    Posts:
    228
    Thanks @DeeMudhham, unfortunately that wasn't my problem. I didn't modifiy bounce boost... I just ended up increasing the LOD0 distance.. Thanks for your reply!
     
  23. Arkhham

    Arkhham

    Joined:
    May 7, 2016
    Posts:
    167
    Anyone? Does LODs in your scene work as you intended with GI?
    I just want to know if am the one who is doing something wrong here or it's a unity's bug.
     
  24. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Might want to keep in mind that light probe at the moment are bugged, and the lightprobe result are "bit" different with lightmapped object
     
    Arkhham likes this.
  25. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Light probes are used to light the baked LODs during the lightmapping phase. Light probes fix will be in 5.3.5 Patch 3 so please try that build.
     
    Arkhham likes this.
  26. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    5.3.5 Patch 3, but atm it's 5.3.5 Patch 1??
     
  27. Arkhham

    Arkhham

    Joined:
    May 7, 2016
    Posts:
    167
    Thank you, looking forward to that patch!:)
     
  28. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Yes, the 5.3.5 patch 2 was already built when I merged the fix, so patch 3 will be the first build to contain the fix. 5.4 beta 21 will also contain a fixed Enlighten version, and that might be available sooner.
     
    NGC6543 and Reanimate_L like this.
  29. Arkhham

    Arkhham

    Joined:
    May 7, 2016
    Posts:
    167
    Tried it, there is an improvement but the problem still persists.
     
  30. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Why it is not in the docs ?
    Or when Unity will decide to wake up and make video tutorials about baking and light probes giving all this usefull explanation information ?
     
    Jonas-Neuston likes this.
  31. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    It is in the manual. http://docs.unity3d.com/Manual/LODForBakedGI.html

    I added some more information to that page that should be available in the next docs release.
     
    Lex4art and zenGarden like this.
  32. mgc90403

    mgc90403

    Joined:
    Dec 24, 2013
    Posts:
    20
    So I've tried light probe proxy quite extensively now, and while the tool does have it's uses, it's really not adequate to reconcile lighting between the top-level LOD and lower LOD's. The following images from LOD0 and LOD1 of a precomputed realtime GI setup, using very high-resolution light probe proxy settings and very dense root light probe settings - as you can see, the lighting switch between LOD's is totally unacceptable.

    LOD 0


    LOD 1


    The same issue occurs in a baked GI pipeline, since the lower level LODs appear to ONLY look at the probe array for lighting data.
    Having looked into this extensively over the last several months, it sure seems to me that Unity is currently incapable of avoiding these kinds of artifacts in a LOD-reliant pipeline.

    Kengelstoft - I hope I'm wrong, since baked lighting with LOD's is a really really basic concept, and Unity used to easily support such stuff. Could you please tell us how to make these transitions far less noticeable? Relying purely on probe data for lower-level LOD sampling just doesn't cut it.
     
  33. Arkhham

    Arkhham

    Joined:
    May 7, 2016
    Posts:
    167
    nxtboyIII and laurentlavigne like this.
  34. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
  35. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Same problem here. It should just use the same process as LOD0 for LOD1, LOD2 and so on, so that we can get rid of this problem.

    What's the catch with modifying the bake mode for LOD1/LOD2? Is there any serious reason for doing so? Just use the irradiance or whatever from the LOD0 but lightmap the other lods properly.
     
  36. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    No update here? The problem still persist in 5.5. Can you implement the same process for LOD1+ just the same as LOD0? I still get with tons and tons of light probes the same problem.
     
  37. StudioEvil

    StudioEvil

    Joined:
    Aug 28, 2013
    Posts:
    66
    Same here, any news on that?
     
    Assembler-Maze likes this.
  38. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Still issues in 5.6beta.
     
    Assembler-Maze likes this.
  39. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Even in 5.6? Unbelievable...
     
    Exustus and GoGoGadget like this.
  40. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Dudes, this makes the whole precomputed realtime GI stuff completely unusable with LODs.

    Seriously now, are your really thinking hard when you implement something, and try to make it usable in a real scenario, or are you just ticking a checkbox in a feature list?

    If you ask me one of unity's big issues with games is that the company does not develop it's own games (unlike unreal) therefore never having to face real scenarios. It's like the difference between school projects and real industry projects... The unity guys are a bunch of high-school-level programmers,or else I really cant understand another explanation for monstrous issues like this.

    Personally I really don't care about mobile games, Unity presents itself as a top-level AAA-capable engine. But from my experience with it, this is a big lie. At least stop lying about it and stop making demos like adam or whatever and present it as a 100% grade mobile-only game engine!
     
  41. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    don't bother, people have told them about this over and over again.

    edit : oh even though at least they made a demo, everything is custom tools/components that most user doesn't have access to / don't know how to use them (no documentation since those are custom tools) / unmaintained assets or tools.
    But yeah those are still custom stuff, not built in native features/tools.
     
    Last edited: Jan 30, 2017
    Exustus, Arkhham and Assembler-Maze like this.
  42. StrogaBeef

    StrogaBeef

    Joined:
    Mar 1, 2017
    Posts:
    7
    is there a way to manually pick what lightprobes to sample from or increase the number of sampled probes?
    I try to place probes around objects but Unity refuse to pick the closest ones, I dont know how to tackle this -.-
     
  43. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
  44. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    I don't know if this solves the problem with anyone, but from what I have talked with the Unity guys this seems more of a problem of communication rather than an engine problem.

    I am not 100% sure, but I would require some people to check on this one to see if the following solution might solve the problem:

    1. Set up your lighting environment
    2. Bake everything
    3. For objects that are marked static and therefore lightmapped DISABLE the blend probes, set it to off

    They will stop using blend probes and 'theoretically' should only used the realtime lightmaped GI. I have tested this inside a test scene and there is no visual difference between the LODs and they are still realtime lighmapped. I am not 100% sure that it solves the issue for all the cases, I am also testing inside my other more complicated scenes and will post here with feedback.

    I also posted this here so that people can try it out in their particular scenes.
     
    DanjelRicci and GoGoGadget like this.
  45. DanjelRicci

    DanjelRicci

    Joined:
    Mar 8, 2010
    Posts:
    310
    I am having this same problem. I have the feeling that this is how it's supposed to work, but honestly it's just pretty mad. Either you need to fill up your scene with dozens of probes in a grid array (like mgc90403 did), or you just move the probes one by one until the probes wireframe sets in the way you need.
     
  46. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Replying to myself here, I have tried on multiple scenes and the problems seems to still persists. We can't force the subsequent lods to use the baked realtime GI even if we force the 'blend probes' to off.

    I would recommend to visit this link: https://issuetracker.unity3d.com/issues/lod-objects-does-not-receive-realtime-ambient-gi and vote for the fixing of this bug. If there is interest from the community on a certain issue I'm sure Unity's team will take action faster.
     
  47. wynott

    wynott

    Joined:
    Nov 16, 2016
    Posts:
    29
    Assembler-Maze likes this.
  48. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
  49. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    The chairs are black in long distance, it looks like lightmapping didn't worked for the distant LOD.

    Anyway, perhaps a solution could be to make LODs carefully in a way all could use the same lightmap UVs, and each LOD could use one and same lightmaping texture ? This would save texture memory and would avoid lightening inconsistency keeping one lightmap texture only for all LOD.
     
  50. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    isn't that how beast handle LODs? man i missed beast :D