supagu
1
trying to replicate the OGL fixed function pipeline for projective textures:
vert shader:
void main()
{
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_Vertex;
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
}
frag shader:
uniform sampler2D shadowMap;
void main()
{
vec4 shadowValue = texture2D(shadowMap, vec2(gl_TexCoord[0]));
gl_FragColor = shadowValue;
}
the vertex shader is actually causing my PC to crash! i run it in window mode, and it causes my screen to go blank and i have to reboot :-/
am i doing something wrong? i think i have to do something with model matrix and texture matrix?
Corrail
2
hm…
Your shader source code seems to be correct. I think there’s a problem with your OpenGL commands.
jra101
3
You probably want to do a projective texture lookup:
vec4 shadowValue = texture2DProj(shadowMap, gl_TexCoord[0]));
supagu
4
the actual line causing the problem is:
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_Vertex;
is this line correct btw?
yeah i have temporarily used a texture2D sample instead of proj. sample just to see if that was possibly the problem
system
Closed
5
This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.