Original Post
Hi all, I''m attempting to implement my own type of fogging system (Not using hardware fog because of blending issues) so I would like to use a vertex''s distance from the camera as the T texture coordinate. (S coordinate is manually specified)
Im currently using the following code:
float gls[] = {0.0f, 0.0f, -1.0f, 0.0f}; //-Z axis is into the screen.
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
glTexGenfv(GL_T, GL_EYE_PLANE, gls);
glEnable(GL_TEXTURE_GEN_T);
Now this gives horrible shearing and banding of my texture.
What I was wondering is: Is my glTexGen correct for getting distance of vertex to camera?
And, do I use glTexCoord2f(S_Coord, 0.0) per vertex, or should I use glTexCoord1f because the T coordinate is automatically generated?
Thank you for any advice you may have.
Waramp.
"Before you insult a man, walk a mile in his shoes.
That way, when you do insult him, you''ll be a mile away, and you''ll have his shoes."