Upgraded project from Unity 4 to Unity 5 and all our lightmaps are trashed. What happened?

Here’s what an upgraded, lightmapped scene looks like now:

Here’s what a scene without lightmaps looks like (still in Unity 5):

You’re seeing the same shaders in both screenshots, and we are NOT using the new Standard Shader. The only difference is the first shot is a scene with lightmaps and the second shot is a scene without.

Here’s an example of one of the lightmap textures; as you can see, it looks perfectly fine:

So, something must’ve changed, but I didn’t see anything helpful in the upgrade guide. There’s mention that shaders must now account for non-uniform mesh scale, but even when I switch from our custom shader to any built-in shader that uses lighting, I still see this issue. (Switching to a built-in unlit shader clears it up, but then of course we just don’t have any lightmapping at all.)

Wat is happen? :cry:

Ok, I figured this out. In the lightmapping panel, under General GI, there’s a setting called Directional Mode, which is set to Directional by default. However, we don’t have any directional maps, so we’re just getting garbage. Changing this mode to NonDirectional fixed the issue.

I overlooked it initially because I assumed that panel was just bake settings, but they’re apparently also runtime settings for the scene. I actually wrote a little piece of code in my World.Start() to enforce the correct setting:

void Start() {
    LightmapSettings.lightmapsMode = LightmapsMode.NonDirectional;
}
1 Like