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. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

Different affecting group of objects using static realtime gi baked

Discussion in 'Global Illumination' started by Jakub_Machowski, Sep 27, 2018.

  1. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    637
    Hello :

    I have a question
    I'm using Realtime gi lightmap baking for static objects. And I have a question

    Is there something like lightmap layer? What I mean:
    I have one small object inside other bigger, I would to have it realtime static lightmap baked but I dont won't to affect each other Cause I would to disable enable them, So then Object inside will be black if I deactivate object outside. Is there any way to set lightmap objects groups or layers that dont affect each other? So when baking light unity will not take account one group oclussion etc on other group, but both groups still have lightmaps

    Second way of using it:
    If there are mult scene settings where static objects overlap each other, We have Seasonal varation scenes, and one main scene with lightprobes. I put all scenes in editor and bake light d
    ata asset together, it works... but if on scene 1 and scene 2 are objects that are in the same position and are static, then when we load scenes in single mode, the objects have bugs cause from light baked together. Light have to be baked together on multi scene setup cause in other case lightprobes dont affect other scenes.


    Is there something layer affection lightmap thing in unity?

    Best Regards
     
  2. DavidLlewelyn

    DavidLlewelyn

    Unity Technologies

    Joined:
    Aug 14, 2012
    Posts:
    29
    Hi Jakub,

    Nothing like you describe is possible in Unity right now, but the idea of baking layers does make a lot of sense. Something for us to consider. However, you can achieve much of what you need using Scenes and Multi-Scene Editing.

    To solve your first use case, I would suggest breaking your problem geometry into two Scenes and move lighting into a third lighting Scene. This can be done fairly easily, while preserving your settings. Duplicate the first Scene. Delete all of the contents. Save.

    No reopen your first Scene and drag the newly created, blank Scene into the Hierarchy. Move your occluded "interior" geometry into this Scene by simply dragging on the Hierarchy. If it's not already set up this way, now repeat the above process to move lighting into the lighting Scene.

    With this configuration, it is possible to bake the two problem geometry sets independently, such that they don't see each other. When it comes to baking lighting. Unload one geometry Scene. Set the remaining Scene as the Active Scene (right click the Scene in the Hierarchy, then Set Active Scene). Ensure Auto is off. Generate lighting and then save before repeating the process with the other Scene. Save.

    With this approach, both Scenes can be lit so that they match the environment without affecting each other. This approach will also work for your second use case.

    Hope that helps!
     
    kristijonas_unity likes this.
  3. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    637
    Hello

    Thanks for help. Yes some layers of lightmaps would be very usefull.

    What about second case I descriped, I noticed that I could bake scenes individually but problem was that I had lightprobes only on one scene and after connecting it ightprobes dont affected objects on different scenes, So I divided lightprobes, and set it on every of my scene I load additive way, Now it work. I just cant find no where any information in documentation, how to handle lightprobes in multi scene. I was thinking that lighprobes from one scene affect different even if they are loaded additive way. They won't. Thanks for help
     
  4. DavidLlewelyn

    DavidLlewelyn

    Unity Technologies

    Joined:
    Aug 14, 2012
    Posts:
    29
  5. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    637
    Thanks thats great! I could find it anywhere in docs, or unity tuts. Really helpfull. I get that knowlege by my try and mistake method, Thanks that finnally there is something that clarify this.

    One thing lack in this project only - reflection probes. Why unity bakes it even if they are realtime etc.
     
  6. DavidLlewelyn

    DavidLlewelyn

    Unity Technologies

    Joined:
    Aug 14, 2012
    Posts:
    29
    Hi Jakub. Reflection Probes default to Baked in both Realtime GI and Baked GI. This isn't something specific to Additive Loading which is why we have not mentioned the topic in this tutorial.

    The reason that we use Baked as a default is that Realtime reflection probes come with a very high performance cost. It is highly advisable to not use them in your project if they can be avoided.

    Instead, it would be preferable to use the technique explained in the Reflection Probe section of the project linked above. Reflection Probes have an Importance value which can be weighted. Using this, Scenes loaded later should have Importance values higher than earlier Scenes so that they will blend over the top of those probes from earlier Scenes.

    This needs to be setup and hidden from the user in a way which is sympathetic to your particular project, so hard to give more specific advice.
     
  7. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    637
    Thanks for that info about importance of relfection probes! I didnt know that it has also influence when loading scenes additive way. What about realtime reflection probes, What if we use realtime but only on awake? Is that still very consuming?
     
    Last edited: Oct 4, 2018
  8. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    637
    Hello David I have a question Cause i Made exactly as you said but there is a problem, Mur Rocks are on different scene and mu terrain is on different scene, I bake every scene independently but after loading it together, Scene with rocks have darker indirect lightning, Both have the same skybox set to none and other lightmaps settigns the same, when baked together everything is ok. Could you help with that?