I have a texture with GL_DEPTH_COMPONENT and retrieved the values via glCopyTexture function, in debugger everything is fine and depth can be seen properly. I can’t figure out how to read the depth in a fragment shader since on the web some suggest texture2D function while others say it will return undefined results and shadow2D is the only way. Also the compare texture mode is confusing. Help and source examples are welcome.
Edit: Should have posted in GLSL forums.