Search Unity

I'm new to baked lighting but baking process is taking too long to learn anything.

Discussion in 'Editor & General Support' started by CloudyVR, Jul 13, 2017.

  1. CloudyVR

    CloudyVR

    Joined:
    Mar 26, 2017
    Posts:
    715
    I have a simple scene that I was hoping to use to try to learn how to setup baked lightning.

    My issue is when I make any change to lighting in my scene and hit bake I have to wait an hour to get any results back.

    My scene is a Terrain and a simple building (stadium). I have one point light with a 100m radius.

    I have reduced the Lightmap Size to 32.
    I have reduced Lightmap Resolution to 10.
    I have tried disabling that Enlighten option and currently only use Progressive (Preview).

    No matter what I do it's slow (hours). and I haven't learned anything and am afraid to add any complexity to my scene in fear it will only contribute to making the process slower.

    Often I see weird shadow lines or even no lighting at all and things appear black (or even all white I guess due to too much light?). I just can not figure out how to make baked lights look the same as my realtime lights.

    Lamp set for bake mode, mesh is static (Strange lines appear, light is very bright).


    The mesh created in blender


    Lamp set to realtime mode, mesh is not static (No weird lines, much dimmer)


    How do you learn baking lightmaps in Unity with such high demand for downtime? I thought starting with a simple scene was the key but now I'm not so sure.

    Maybe my stadium is too large of scale? But the only part that is "Static" (the section where the bleachers would be) consists of roughly 30 faces which measures roughly W=200m H=35m L=375m.

    I have tried segmenting it into individual meshes (planes) but that made the whole model look bad and blocky (I don't think it helped reduce the bake time by much either).

    Is there anything I can adjust to make the development less painful (I am ok with overnighters for final bakes but really need a way to just see some (low res) results quickly)?

    [EDIT]

    I went into blender and selected the faces where I was seeing dark lines, then explicitely instructed blender to create triangles using Crtl+t.


    After that I turned up Lightmap Size to 1024 and the Lightmap Resolution to 40.

    Now I see it immediately looks better but still takes a while to finish and is still sitting at 5/11 Clustering (but I see results preview).


    But the baked light is still much brighter than the realtime light. Are baked and realtime lights always different in intensity?
     
    Last edited: Jul 13, 2017
  2. jviruss

    jviruss

    Joined:
    Oct 4, 2016
    Posts:
    48
    Change the lightmap resolution to 1.if you have no shadows increase to ten,if you have good shadows decrease to lower value.the result depends of your scene scale.for that test it with the minimal value and increase after the value.put the lightmap size to 1024,the result are n textures with this size,no only one.if you have one texture,take a look,you have more free space in the texture,increase then the resolution.if you have 26 textures of 1024,this is the reason for your wait time.change the lightmap parameters to low.you must decide how many textures of 1024 you can render for shadows.the trick is start with low values and increment this.
     
  3. jviruss

    jviruss

    Joined:
    Oct 4, 2016
    Posts:
    48
    The system is a little crazy,the result in editor is not the final result.you must test and fix.the shadows are better than realtime.
     
  4. jviruss

    jviruss

    Joined:
    Oct 4, 2016
    Posts:
    48
    I dont use progressive and i have good results in 5 minuts aprox,if you set well the values
     
  5. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,799
    Leave that at 1024.

    Then please also disable mixed and realtime lighting, since those are not supported by the progressive lightmapper.

    That's true in Gamma. In Linear they should be almost identical.
     
    CloudyVR likes this.
  6. Adam-Bailey

    Adam-Bailey

    Joined:
    Feb 17, 2015
    Posts:
    232
    Baking on a big terrain is always going to take a while, but down the bottom set the Lightmap Parameters to the lowest setting, and set the lightmap resolution to something small like 1. It should bake quite quickly and then you can try turning up the resolution until you reach a nice balance for quality/time.
     
  7. CloudyVR

    CloudyVR

    Joined:
    Mar 26, 2017
    Posts:
    715
    After some time trying different things I came to discover that (as stated by AcidArrow) mixed lighting doesn't work with progressive. And I think it was that which caused my misunderstanding. I'm now back to using the Enlighten engine.

    I downloaded the Lighting Optimization Tutorial from the assets store and have been using it as a test bed. I truly hope to learn good techniques and habits so I may optimize my lighting and shadows as much as possible. Thank you all for great tips I will give many of them a try!

    Also thank you for that hint. After reading this about Unity's color space it states "With the alternative, ‘Gamma’ Color Space, brightness will quickly begin to turn to white as values go up, which is detrimental to image quality."

    That alone is reason enough to use linear color space instead.
     
    Last edited: Jul 13, 2017