Original Post
Hi I am having some difficulty getting a shadow map displayed on top of a normally textured object. It seems the shader just refuses to display both the texture and the shadow together despite doing either one fine. Could someone take a look at my frag shader and give me a reason why this would not be working? Any help much appreciated!
uniform sampler2D sTexture;
uniform sampler2DShadow shadowMap;
varying vec4 projCoord;
varying vec2 texCoord;
varying float LightIntensity;
void main ()
{
vec3 color = texture2D(sTexture, texCoord).stp;
color *= shadow2DProj(shadowMap, projCoord).r;
color *= LightIntensity;
gl_FragColor = vec4(color, 1.0);
}