Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Lightmap appears in "Baked Lightmap" view, not in "Shaded" view

Discussion in 'Global Illumination' started by cassius, May 11, 2020.

  1. cassius

    cassius

    Joined:
    Aug 5, 2012
    Posts:
    125
    I haven't come across this before but I'm working on a scene that uses Lightmapping for Global Illumination. While looking at the scene in the Editor Scene window in "Baked Lightmap" mode, I noticed a lot more (wanted) shading than when I'm in "Shaded" mode. Sure enough switching back and forth between the two shows that in "Shaded" mode in the Scene view (as well as when in play mode) a lot of my Lighmapping isn't actually working on multiple meshes. Doubt this matters but I'm using URP.

    I've made a YouTube video which will hopefully present what I'm trying to describe.


    Note the shading behind the door in Baked Lightmap view both before and after I disable the GameObject. However that same shading is not present in "Shaded" view.

    I've confirmed the usual stuff like Static, Contribute GI etc. Does anyone have any ideas what's happening here?

    Thanks!
    Cassius
     
  2. uy3d

    uy3d

    Unity Technologies

    Joined:
    Aug 16, 2016
    Posts:
    187
    Are you using URP's default shader or a custom shader for the materials?
     
  3. cassius

    cassius

    Joined:
    Aug 5, 2012
    Posts:
    125
    Thanks for the reply, @uy3d. I'm using the URP Lit shader, no customizations.

    It's possible that after years of using Unity (purchased Pro back around 2012) that I fundamentally misunderstand something about baked GI. When I reduce light on my "sun", I start to see some of the shading provided by the bake. The scene in my video is in direct "sunlight", so is the intended functionality with "Baked Indirect"?
    Bake-Settings.jpg
     
  4. ADufay

    ADufay

    Unity Technologies

    Joined:
    Jan 2, 2020
    Posts:
    30
    Hello, can you try increasing indirect samples and environment samples to see if that helps ?
     
  5. cassius

    cassius

    Joined:
    Aug 5, 2012
    Posts:
    125
    Thanks @ADufay. I'll try that and report back.
     
  6. cassius

    cassius

    Joined:
    Aug 5, 2012
    Posts:
    125
    That didn't appear to have any effect whatsoever. I bumped both Indirect Samples and Environment Samples up to 200 each.

    Is it possible this is caused by the area being in direct sunlight? When I disable the sun to reveal only ambient light from Lightmap, the shading appears as expected. Of course then I don't have my sun light.
     
  7. ADufay

    ADufay

    Unity Technologies

    Joined:
    Jan 2, 2020
    Posts:
    30
    Ok, so it's not a bug then, that just means that in your setup your sun contribution is really high and you can't really see the contribution of indirect lighting.