Bruno
04-21-2007, 02:12 PM
Hello,
I'm having a hard time understanding this in CG.
I had this line in GLSL,
projCoord = gl_TextureMatrix[0] * realPos;and converting it to CG, it should be something like this :
output.projCoord = mul( texture_matrix, realPos ) ;My question is, how do i send my texture matrix from inside the C++ code, into the shader code ??
I was tryng something like this :
float Tex_MAT[16];
glActiveTextureARB(GL_TEXTURE0_ARB);
glGetFloatv(GL_TEXTURE_MATRIX, Tex_MAT);
cgGLSetStateMatrixParameter(shadow.texture_matrix, CG_GL_TEXTURE_MATRIX,Tex_MAT);But obvioulst, i can't do this..,
Can anyone help ?
thanks,
Bruno
I'm having a hard time understanding this in CG.
I had this line in GLSL,
projCoord = gl_TextureMatrix[0] * realPos;and converting it to CG, it should be something like this :
output.projCoord = mul( texture_matrix, realPos ) ;My question is, how do i send my texture matrix from inside the C++ code, into the shader code ??
I was tryng something like this :
float Tex_MAT[16];
glActiveTextureARB(GL_TEXTURE0_ARB);
glGetFloatv(GL_TEXTURE_MATRIX, Tex_MAT);
cgGLSetStateMatrixParameter(shadow.texture_matrix, CG_GL_TEXTURE_MATRIX,Tex_MAT);But obvioulst, i can't do this..,
Can anyone help ?
thanks,
Bruno