Hello,
I am doing a texture coordinate calculation in my vertex shader for a projective lighting. Therefore I need to multiply the gl_ModelViewMatrix with my lightViewingMatrix, but no matter which values this matrix contains, it doesn’t change my results.
I hope anybody can help me…
here is what i’m doing:
"varying vec4 projPos;"//projected light-texture coord
"void main(void)"
"{"
// light projection matrix
" mat4 lightProjMat= (0.68,0.0,0.0,0.0, "
" 0.0,2.85,0.0,0.0, "
" 0.0,0.0,-0.04,0.0, "
" 0.0,0.0,-1.04,1.0); "
//light ViewTransformation Matrix:
" mat4 lightViewMat= (1.0,0.0,0.0,0.0, "//column 1: x-axis light-CS
" 0.0,1.0,0.0,0.0, "//column 2: y-axis light-CS
" 0.0,0.0,1.0,0.0, "//column 3: z-axis light-CS
" 8.35,-1.48,-0.5,1.0);"//column 4: translation light
// Scale and translate
" mat4 scaleTranslMat= (0.5,0.0,0.0,0.0, "
" 0.0,0.5,0.0,0.0, "
" 0.0,0.0,0.5,0.0, "
" 0.5,0.5,0.5,1.0); "
" projPos = scaleTranslMat * lightProjMat * lightViewMat * gl_ModelViewMatrix * gl_Vertex;"
" gl_TexCoord[0] = gl_MultiTexCoord0;"
" gl_Position = ftransform();"
"}"
the problem is, that none of my matrices takes effect
Can anyone tell me what’s wrong here? I think it’s a general problem, because as I mentioned it doesn’t matter what the matrices contain…
thanks
Simon