Limitations GL_DOT3_RGB

I use texture DOT3 lighting to match terrain on older iPhones, and I wonder if there is a hidden way to make it right, even if the point of view changes.

In "real" lighting, the normals are transformed using the inverse matrix of the model. Thanks to the texture DOT3-lighting there is no conversion.

With shader mapping, the normal map is in tangent space. When lighting DOT3, the normal map should be in the space for the eyes. This is normal only if you have a fixed viewpoint or your geometry is flat.

Should I just accept this as another limitation of DOT3 lighting? Since he cannot handle the mirror either, I begin to doubt how useful he is.

+3
source share
1 answer

Your normal map should not be in any particular space if the light vector is in the same coordinate space. For DOT3 lighting on equipment with fixed functionality, it is probably best to keep a normal map in the space of objects, rather than in the space for the eyes. From here you just need to make sure that when rendering each object, you use the appropriate transformation to move the directional light vector from the space of the world to the space of the object.

+5
source

Source: https://habr.com/ru/post/1729469/


All Articles