Moveable Light - Lighting Channel Error

Hi guys!

We encountered an issue with the lighting channels.

We use multiple lighting channels for lighting the interior of a moving vehicle and for the exterior environment. The environment use fully baked lighting, and the moving vehicle has some movable point lights attached to it which light the interior but should not affect the exterior (and vice vers).

Lighting channels is obviously a solution for this, and it works as well, but there is one mesh in the vehicle, that has some errors in the shading, when we set its lighting channel to 1. When we set it back to 0, the error goes away. But we would need to somehow get channel 1 working correctly, so we can have consistent errorless lighting in the vehicle interior. So our question is, where is this error coming from, and how to fix it.

Some quick notes:

  • it has two materials
  • one of the materials uses UV channel 1 for the normalmap
  • when we apply a material which does not have the said normalmap, the issue is not present
  • other meshes with the same material do show up the error
  • other meshes of similar kind, with exact same technique produced do not produce the issue
  • the normalmap is baked from a highpoly

Thanks!

Most likely your issue is down to the fact that tangent space is determined by UV0. Consider using local space normal map, if you need UV channel other than 0 for your normal map.

We managed to fix the error by swapping uv channel 0 and 1 so now the normal map use uv 0. But the question remains, why the errors appears when you use a normal map with uv channel 1?

Tangent space is defined by UV coordinates. Tangent space basis is only calculated for UV0 for performance reasons. You can read up more here.

There is a material function called Derive Tangent Basis that allows you to compute tangent space for UV sets other than 0, but as I mentioned in the answer above, you should use a local space normal map in your case.

Your issue is also covered here

Awesome! Thanks!