Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Lightmapping + normal maps not working.

Discussion in 'Editor & General Support' started by ThomHurks, Mar 13, 2012.

  1. ThomHurks

    ThomHurks

    Joined:
    Jul 27, 2010
    Posts:
    22
    Hey,

    I'm having some problems with lightmapping in combination with normal maps.

    I have a scene where I have a "terrain" plane with a normal map on it and a few buildings with normal maps. I'm using the Mobile/Bumped Specular shader for all this. I have marked all these objects as static and I have a directional light marked as static. The project has been set to Android by using "switch project", but I also tried extensively on PC/Mac.

    If I bake lightmaps the bake does get executed and completes without errors, but the generated lightmaps are not used. I tried setting all materials to a diffuse material and then the lightmaps did work. So, there seems to be a problem with using lightmaps in combination with normal maps; if you use normal maps, the lightmaps will not be used at all.

    I have the graphics level (both in Player Settings and Editor emulation) set to OpenGL 2.0
    Besides that, I tried to use both Single, Dual and Directional Lightmaps and they're all not working when I have a material with normal maps in my scene. When I remove all materials with normal maps (mobile/bumped specular shader) it works.

    I tried this with both Android and PC/Mac to see if it was platform specific, but had it on both platforms.

    This is very strange, since dual lightmaps and directional lightmaps should work with normal maps, in fact they are made for this! Can anyone explain what's happening here?

    I'm using Unity 3.5 Pro Trial, project set to Android (also tried PC/Mac), testing this all in the editor (not on device yet)

    Thanks!

    (also posted this in Android subforum, but reposted here because likely not Android specific since it also happens on PC/Mac for me)
     
  2. ThomHurks

    ThomHurks

    Joined:
    Jul 27, 2010
    Posts:
    22
    Slight bump, since I almost drifted to the third page without answer :(
     
  3. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,481
    Maybe they do work, but you don`t really see it? That`s dependand of your light setup.

    When in doubt simply file a bug report. That`s a good idea anyways. Normalmaps should work much better in Unity.
     
  4. ThomHurks

    ThomHurks

    Joined:
    Jul 27, 2010
    Posts:
    22
    If I use diffuse materials and a single lightmap, I can see that the lightmaps are working because if I toggle the lights on/off the scene lighting doesn't change. The lighting only changes when I toggle Use Lightmaps on/off in the scene view. When I use lightmaps with normal maps it's reversed; toggling the lights does change the scene lighting and toggling Use Lightmaps changes nothing. This means the lightmaps are not used then, right?
     
  5. ThomHurks

    ThomHurks

    Joined:
    Jul 27, 2010
    Posts:
    22
  6. Zomby138

    Zomby138

    Joined:
    Nov 3, 2009
    Posts:
    659
    Have you tried it with a regular bump mapped shader, rather than a mobile one? I've never used the mobile stuff and it's always worked for me.
     
  7. ThomHurks

    ThomHurks

    Joined:
    Jul 27, 2010
    Posts:
    22
    Yes, as in the bug report it seems normal maps + lightmaps do work when you're using a normal shader, but not when you're using a mobile shader. This is strange, since lightmaps are particularly useful on mobile platforms!