Original Post
Hello, I have a question concerning shadow maps and GLSL. I have setup my shadow maps and want to use them in my shader. To hand them over as a uniform variable I have used glUniform1f(glGetUniformLocation(progID,"shadowMap1"),shadowMap1->shadowDepthMap); glUniform1f(glGetUniformLocation(progID,"shadowMap2"),shadowMap2->shadowDepthMap); The shadowMap is created in a separate class using: glGenTextures(1, &shadowDepthMap); glBindTexture(GL_TEXTURE_2D, shadowDepthMap); ..... I know my shadowMap is computed correctly because I can use it without a shader, but I somehow can't access the map in my shader.. here is my shader code: uniform sampler2DShadow shadowMap1; uniform sampler2DShadow shadowMap2; varying vec4 ProjShadow; float calcValue1() { // gives a float that is 0 if the object is in shadow in 1 if it is not in shadow. float depth=shadow2DProj(shadowMap1, ProjShadow).r; // return coefficient for shadow if(depth !=1.0) { return 0.5; } else { return 1.0; } } This method always returns 0.5, so my guess is that the shadow map is not handed over correctly in the sahder... Any suggestions what I am doing wrong? THX