Search Unity

Baked lighting issue in Unity 2018.3

Discussion in 'Global Illumination' started by RabidRabit81, Feb 7, 2019.

  1. RabidRabit81

    RabidRabit81

    Joined:
    May 16, 2015
    Posts:
    6
    Hey Everyone. I've been having a hard time really nailing down exactly what is going on with my light bakes in Unity and that may just derive from my lack of understanding of what all the light settings are meant to achieve.

    I have posted an example below to "illuminate" exactly what is happening. Notice the left image where my normals seem very defined and my roughness responding as expected. When I bake that light the normals turn flat and black while I appear to lose the roughness effect entirely.

    My meshes are marked as lightprobe and lightmap static while my directional is set to mixed and my point light is set to baked. I am using the point light here for illustration but I would expect my baked lights to be acting more like the preview light but obviously baked in.

    Other settings:

    Deferred Rendering.
    Linear Color space.

    Lighting Tab:

    Realtime GI (checked)
    Baked GI (Checked)
    Mode: Baked indirect.

    Lightmapper: Progressive.
    Lightmap size: (1024)
    Directional Mode: Directional.
    AO (Checked)

    Reflection probes are also set to baked.
    lightingissue.png
     
  2. uy3d

    uy3d

    Unity Technologies

    Joined:
    Aug 16, 2016
    Posts:
    187
    The glossiness calculation needs a view vector. You can tell by the highlight changing shape based the viewing angle of the camera. This information is not there anymore after the light has been baked, as there's not a pre-defined point of view in the scene when baking the lightmap. If you want this effect, you'll have to use either realtime lights, or mixed lights. For mixed lights indirect bounces are baked, but direct lighting is still calculated at runtime. You need to pay the cost of realtime lighting, but you get the view dependent specular effects. You can't move the light anymore, though.
     
    RabidRabit81 likes this.
  3. RabidRabit81

    RabidRabit81

    Joined:
    May 16, 2015
    Posts:
    6
    To clarify: If I want my PBR materials to look how I expect them to look, I can't rely on 100% baked lighting and light probes/reflection probes, I need mixed lighting otherwise I get the flat and matte look due to a lack of light vectors (which are produced by realtime/mixed lights)?
     
  4. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,791
    That's about right, yes.

    Although sometimes using just reflection probes could be "close enough", but that's on a case by case basis.
     
    RabidRabit81 likes this.
  5. RabidRabit81

    RabidRabit81

    Joined:
    May 16, 2015
    Posts:
    6
    Thanks acid! I'll take this into account from now on.