Hello guys,

I try implement projective texgen (for spot lighting) with ARB vertex program and i have some problems.

I can’t set perspective to texgen.

There is my prog :

“!!ARBvp1.0”

“OPTION ARB_position_invariant;”

“PARAM matrix[4] = { state.matrix.program[0] };”

“ATTRIB iPos = vertex.position;”

“ATTRIB iCol = vertex.color;”

“OUTPUT oCol = result.color;”

“OUTPUT oTex = result.texcoord[0];”

“MOV oCol, iCol;”

“DP4 oTex.x, matrix[0], iPos;

DP4 oTex.y, matrix[1], iPos;

DP4 oTex.z, matrix[2], iPos;

DP4 oTex.w, matrix[3], iPos;”

“END”;

in code i load matrix:

glMatrixMode(GL_MATRIX0_ARB);

glLoadIdentity();

glTranslatef(0.5f,0.5f,0.5f);

glScalef(0.5f,0.5f,0.5f);

glLoadMatrixd(MyMatrix);

work fine but without FOV , zNear, ZFar and bias. How do i set this?

Thanks

Vasbin