With FBO’s are you still forced to have a color attachment if you only want to have a depth texture for shadow mapping? I am not getting any values to show up in the depth texture when having just a depth texture assigned to the FBO?
You do not need to have the color attachment. I am using code very similar to the one mentioned in the extension specification and it works. You might try another depth format. I am using the GL_DEPTH_COMPONENT16 one. I am also not using the mipmaps on the shadowmap texture.
SIgh, I been at this for two days, I have a texture array version working fine with no color attachments or render buffers.
THis is bugging the hell out of me.
I tried the 16bit depth and no mipmapping still nothing. I a using GLSL to show the values I am using sampler2DShadow, shadow2DProj, is there a state I am missing on the CPU side?
I am calling this when I goto a FFP mode to try and see the depthmap… glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_NONE);
I call glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE); when I call the shader.
By the “I a using GLSL to show the values” you mean that you are attempting to show the result of the depth comparison? If yes, is the depth in the depth component of the texture coordinate calculated properly?
About the depth buffers in the GLUT. It seems that the GLUT asks for 32bit depth format for the main framebuffer however what it gets depends on the HW, driver and combination of other parameters (e.g. presence of stencil). What is supported as shadowmap texture is different thing. For example, if I remember correctly, the ATI HW before X1600 only supports sampling from 16bit depth textures.