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.

Question Lighting for scene that disables / enabled objects from drop down list

Discussion in 'Global Illumination' started by flakesofhope, Mar 31, 2023.

  1. flakesofhope


    Mar 28, 2022
    So i have a scene where the user selects a car from a drop down list and then it enables that object in the game, if they select another car it removes the previous car ( by disabling it ) and enables the next car ( I'm using modern ui pack to handle that part of it ). along with some other assets from the store and sketchfab.

    If i disable Realtime lighting :
    when i disable all the cars in scene view, it starts generating new maps, it will generate 3 or so of them. Then when i enable a car, it has to regenerate the light maps and replaces the previous 3, when i press play mode is it using all the light maps or only the last set of maps it generated? This worked ok and the scene looks ok but im not sure if its really doing what i want it to, it generates the maps pretty fast though.

    Am currently testing the below
    Mode : Shadowmask
    Realtime Lighting Enabled.
    Receive Global Illumination on objects set to : Light Maps ( should it be blend probes? )
    Reflection Probes and Lighting Probes are setup
    the directional light is Realtime
    all the other lights including spot lights and point lights are set to mixed.
    all objects are set to static as they do not move, but the camera pans around them.

    With none of the cars are enabled in scene view with the settings above it gives me a 6 hour time for preparing bake...Ill leave it over night to see how it goes but i don't know if its going to keep all these maps it creates when i enable a car or if it will scrap the maps to create new ones.

    video for context of size of the scene and how many objects are in it with Realtime lighting disabled :

    System specs ( pretty dated ) :
    Ryzon 2600
    Gtx 1070
    32gb ram
  2. Pema-Malling


    Unity Technologies

    Jul 3, 2020
    Whenever a bake happens, previous data associated with the scenes you are baking is cleared or invalidated. So yes, when you bake new lightmaps, they replace the old ones. Are you trying to light these cars with lightmapping? You might want to try using light probes instead. Place a few probes around where the car will spawn, and set each to blend probes.

    Other than that, it sounds like you are using auto mode baking - I'd suggest switching to on-demand mode by disabling the "Auto Generate" checkbox. That way, you are in complete control of when bakes happen.