Where should I look to understand it? I own the Real Time Rendering 2nd Edition book, but it does’t help me understand this code!
Have you any suggestion?
What’s the difference between that code and something like:
gl_TexCoord[0] = gl_MultiTexCoord0;
If you had googled for “texture coordinate generation”, you would have see several thousand sources explaining this in detail. For instance, Nvidia has a presentation on this topic.
The above code simply takes the gl_Vertex and basically multiplies it with a matrix which is stored in the gl_ObjectPlane* variables (hence the 4 dot produts) to generate a texture coordinate. This is exactly what the fixed function pipeline would do if you had texture coordinate generation enabled and did’t use shaders.