I have one small problem (math I guess)…
If I’m rendering 1st person shooter, I have a weapon or smthn like that in front of me…
gluLookAt(x,y,z,lx,ly,lz,ux,uy,uz);
renderworld();
glPushMatrix();
glDepthRange(0,0.01);
glLoadIdentity();
DrawModel1stpass();//Cubemap on Texgen (normal map) on, color 1,1,1,1
glDepthFunc(GL_EQUAL);
Drawmodel2ndpass();//Cubemp off, blend on, color 1,1,1,0.8, tex2d on
glDepthFunc(GL_LEQUAL);
glDepthRange(0,1);
glPopMatrix();
The problem is that even when I look around, (gluLookAt) reflections stays static, what can I do about that??
…in other words, the texture matrix should be the inverse of the rotational part of the modelview matrix. I did this yesterday, and the delphi code looks like this:
Yes, thanks, I solved this problem.
But ther’s another one. I must calculate custom lightning on the same weapon model, so it comes that I must mul all light, eye, normal vectors, with inverse transpose gluLookAt matrix?
If it should be high quality, maybe.
Else do modelspace lighting (no weather ) by transforming the light into the model coordinate system. Works best with directional light and infinite viewer.