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.
  2. Dismiss Notice

Baked lightmap not being used?

Discussion in 'Editor & General Support' started by gecko, Mar 4, 2015.

  1. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,238
    I'm experimenting with Unity5 lightmaps. This is for WebGL export, so I am not using Realtime GI. I baked a lightmap of the scene, and in the "Baked" view of the scene, I can see that it worked -- there are shadowy areas behind things like a wall-mounted TV. But when I switch back to Shaded view, there's no evidence that the lightmaps are being used. The only thing I can see that makes a difference in how the static modles in the scene look is the Exposure setting on the skybox. That brings the lighting up or down --- completely evenly (which makes sense since the skybox surrounds the scene from all sides). How do I get the lightmaps to be applied to the static models in the scene?
     
  2. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,238
    Still can't figure this out. Attached screenshots show one corner of the scene, post-bake: The shaded view shows no ambient occlusion, while the Baked view shows plenty of it. (Precomputed GI is disabled; this is for WebGL.) Also attached are my Lighting settings. What am I doing wrong?

    lighting.png baked.jpg
     
  3. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,238
    Figured it out. I had the material for those surfaces set to maximum metallic. If I slide that down toward zero, then all the shadows appear on the walls. D'oh!. Makes perfect sense now.
     
  4. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,238
    Not so fast, gecko! So it looks great in the scene now, but in a webGL build, it appears that no lightmaps are being used. The directional light on non-static objects (mainly NPCs) is being used, as I can see shadows that it casts, but the room walls definitely do not use the lightmaps. Is there some limitation of WebGL and lightmapping? (Again, I have Precomputed GI disabled, as well as Continuous Bake.)
     
  5. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    hmmmmm WebGL may have an issue or two with respect to these types of issues. (I am being generous).

    Bottom line I think I would ask a admin to help me find a better place for this post.

    The UT are red hot at the moment (or were) on the WebGL push. You may well get some actual company interaction if you could provide maybe an example URL with the problem outlined. and possibly the logs.

    Be careful when sharing anything log based not to give anything too "IP" away, of course I mean in public. UT can be trusted to dig through anything.

    Long story short getting the shaders to work exactly as expected in WebGL atm is a tad hit and miss (this is my personal opinion based on circa 10 test projects, including two cloud build efforts).

    Best fortune, ( I asked an admin to get the post moved for you)
     
  6. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,238
    Thanks, twobob. I can replicate this issue with a very simple scene, so I'm going to create a new thread in the WebGL, since this has turned into an issue with that build platform.
     
    twobob likes this.
  7. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    that is a good call.
    I did ask an admin to shift the post... They must have been busy...