Search Unity

about light maps and objects scaling

Discussion in 'General Discussion' started by Emile97, Nov 29, 2018.

  1. Emile97

    Emile97

    Joined:
    May 28, 2017
    Posts:
    105
    Hello everyone ,
    I would like to know something :
    Suppose i have a baked scene (like a city) and i want to scale that city to maybe (10,10,10) . Will scaling these buildings affect the baked light or will the light-map adjust itself with the new scale or will i have to re-bake the whole scene ? If yes , can you please explain me why ? i do not understand yet how light mapping works.
    Thank you.
     
  2. JustColorado

    JustColorado

    Joined:
    Dec 19, 2012
    Posts:
    89
    Calculating shadows is a very time consuming operation for game engines. Lightmaps are precalculated shadows which are converted into textures so that when Unity engine is trying to render all of your models, particles, animations, characters, user interface, zombies, dragons etc. within 16 milliseconds so that you can hit 60 frames per second. It does not need to keep figuring out shadows for lights and meshes that unity already knows will never move.

    Good light maps free processing resources and speed up performance so that you can do more with the engine, like make bigger maps, better detail, more enemies etc. Also baked can be high quality and more detailed than you would be able to achieve at in a few milliseconds so a nice lighting bake improves the whole look of your game.

    If the only light you had in the entire scene is a directional light and you scaled every single thing in the scene evenly you might not have to rebake. (Why because all of the shadows would most likely be exactly the same in this case.) But I would rebake anyway.

    If you had any other lights beyond one directional light, then changing the scale would almost certainly change how the lights used in the scene cast shadows on the models. Even if you scaled the lights too, their settings would not scale automatically. And you would have to rebake.
     
    Emile97 likes this.
  3. Emile97

    Emile97

    Joined:
    May 28, 2017
    Posts:
    105
    Hey :)
    Thank you so much for the answer