Search Unity

Need some knowledge on Realtime Lightmaps

Discussion in 'Global Illumination' started by Only4gamers, Jul 21, 2020.

  1. Only4gamers

    Only4gamers

    Joined:
    Nov 8, 2019
    Posts:
    327
    Hello everyone,
    I am new in Unity and I need some clarification on how lightmaps work. I am creating a game with Realtime lights and shadows only, nothing is baked. And my game is running smoothly and everything is good, but i want to decrease my game size. So, for this I am removing some unimportant objects from lightmap by setting 0 in "Scale in Lightmap". So my questions are:
    1) What will happen if I don't add an object in lightmap?
    2) is that object will look bad
    3) What is the Pros and Cons of lightmapping an object?
    4) Is not lightmapping will increase memory usage or GPU/CPU load?
    or anything else you think I should know, then please explain that too.
    Thanks.
     
  2. ADufay

    ADufay

    Unity Technologies

    Joined:
    Jan 2, 2020
    Posts:
    30
    Hello,

    If you are using only realtime lights and no baking at all there is no point in removing objects by using a 0 scale in lightmap as you don't have any lightmaps anyway.

    2) No that object will not look bad since you are not using baking.

    Regarding 3), you can have a look at https://docs.unity3d.com/Manual/Lightmappers.html There is a pretty good amount of knowledge in there that can help you.

    Cheers
     
    Only4gamers likes this.
  3. Only4gamers

    Only4gamers

    Joined:
    Nov 8, 2019
    Posts:
    327
    Thank you so much for reply. But what texture things are appearing in Realtime Lightmaps? Like index: 0, index: 1 etc in
    Window>Rendering>Lighting Settings>Realtime Lightmaps.
    When I am removing objects from Lightmap these index files are decreasing. Like previously I have 30 index files and after removing some objects index decreased to 18.
     
  4. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    Hi,

    I do not fully understand the actual problem. So you do not want the Realtime lightmaps at all?
    If that is the case: Realtime lightmaps are only used by Enlighten (Realtime GI). If you do not want this feature, simply disable "Realtime GI" under the Lighting tab in your scene. You can also strip the Realtime Lightmap Mode shaders from your build.

    If you do not want some of your game objects have realtime lightmaps, then untick their "Contribute Global Illumination" setting in Mesh Renderer component.

    If you do not want any lighting precomputed at all, so neither Realtime GI or Baked, then just untick "Realtime GI" plus "Mixed Lighting".

    But if you already have Realtime lightmaps, I assume this was not computed by accident and you want this feature? :)
     

    Attached Files:

    Last edited: Jul 24, 2020
  5. Doraemon231

    Doraemon231

    Joined:
    Dec 18, 2018
    Posts:
    22
    so.. why appears baked light texture data after realtime GI
    upload_2021-10-25_14-38-55.png
     
  6. Only4gamers

    Only4gamers

    Joined:
    Nov 8, 2019
    Posts:
    327
    Yes, I was talking about these things in my question.
    You are using Built In Pipeline? Because these things don't appear in URP. I switch to URP and these things gone. If you want to decrease build size then you should try URP. With URP build size decreased a lot.
     
  7. Doraemon231

    Doraemon231

    Joined:
    Dec 18, 2018
    Posts:
    22
    So why should I use real-time lightmaps...
    Progressive Lightmapper also creates real-time lightmaps when checking real-time GI.
    Can someone please explain in one sentence?
    Searching the internet, I can't find any documentation.
     
  8. jiaozi158

    jiaozi158

    Joined:
    May 24, 2020
    Posts:
    23
    Hi, the real-time GI in (current) Unity is provided by a middleware called Enlighten. All real-time lightmaps are generated and updated by Enlighten.

    Progressive Lightmapper (using path tracing) is only available in editor and it's not designed to be a real-time GI tool.