Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Let us know your feedback about the Global Illumination changes in the 2023.2 beta.
    Dismiss Notice
  3. Dismiss Notice

Question regaurding lightmap atlas

Discussion in 'Unity 5 Pre-order Beta' started by kurylo3d, Jan 16, 2015.

  1. kurylo3d

    kurylo3d

    Joined:
    Nov 7, 2009
    Posts:
    1,123
    I have a question. Does the lightmapping know to put objects that utilize the same reflection probe and same material into the same lightmap for draw call minimizing?
     
  2. kurylo3d

    kurylo3d

    Joined:
    Nov 7, 2009
    Posts:
    1,123
    any of you guys over at unity have an answer to this?
     
  3. kurylo3d

    kurylo3d

    Joined:
    Nov 7, 2009
    Posts:
    1,123
  4. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    relfection probes and lightmaps are seperate systems. Currently we do not do this optimization.

    It is a good idea though.
     
  5. kurylo3d

    kurylo3d

    Joined:
    Nov 7, 2009
    Posts:
    1,123
    Thanks for the reply. Any idea how i can choose what goes on what lightmap?
     
  6. kurylo3d

    kurylo3d

    Joined:
    Nov 7, 2009
    Posts:
    1,123
    is there a process for that?
     
  7. Jde

    Jde

    Joined:
    Oct 2, 2011
    Posts:
    139
    Grouping lightmap UV atlas islands by reflection probe would be good but a more generalised solution based on world position would be really useful too.

    If the lightmapped objects within my current view frustum were all using the same lightmap then batching would be more efficient.

    It would be trade off between lightmap UV packing efficiency (fewer lightmaps) and batching efficiency (potentially more lightmaps but fewer draw calls).
     
  8. kurylo3d

    kurylo3d

    Joined:
    Nov 7, 2009
    Posts:
    1,123
    Is there a way to manually attempt this? grouping objects to a lightmap atlas per location?
     
  9. Jde

    Jde

    Joined:
    Oct 2, 2011
    Posts:
    139
    In Unity 4 you could probably implement a hacky workaround by atlasing the scene in chunks, using Lock Atlas, then manually specifying the lightmap index used for every object in each chunk. Not pretty though.

    Unity 5 doesn't have the Lock Atlas option.
     
  10. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    You can create a collection of Lightmap Parameters with different Baked Tag and use those to group the instances. It will not work exactly as the Lock Atlas of 4.x but it will guarantee that instances with different Baked Tag doesn't end up in the same atlas.
     
    kurylo3d likes this.
  11. Jde

    Jde

    Joined:
    Oct 2, 2011
    Posts:
    139
    Ah interesting! So is that tag a kind of 'hint' for which lightmap to atlas on to? Presumably if there's no room left on a particular lightmap it will create a new one? Or does it start to scale down the UV islands until they fit on to the specified one?
     
  12. kurylo3d

    kurylo3d

    Joined:
    Nov 7, 2009
    Posts:
    1,123
    Heres a question.. if 2 reflection probes fade into each other.... what happens to the geometry in probe A , probe B, and points of blending geometry...

    The question is in regaurds to draw calls. Would they all still be batched together with the same material.. or divided up between whats in probe A and whats in probe B... or.... divided up for probe A, probe B, and blend areas?