I am confused. I am trying to use a FBO with Shadow Mapping.
If I use a renderbuffer for my depth storage, e.g.
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT32, maxTexSize, maxTexSize);
then how do I read it from a glsl shader for the comparison? glReadPixels into a texture? glCopyTexImage2D?
On the other hand, it appears I can simply attach a depth texture directly, e.g.
GL_TEXTURE_2D, depth_tex, 0);
and then bind it and use it in glsl. This sounds better - it is example 7 in the spec.
Is this a better approach? Why would one ever use a renderbuffer for shadow mapping?
Thanks for any insight