Render the depth buffer into a texture using a frame buffer
问题 I am using JOGL, but this question applies to OpenGL in general. There seem to be similar questions lying around, but they are either directed at GLSL code, have to do with copying the contents of a frame buffer, or are a general advice - use frame buffer objects instead of glCopyTexSubImage2D . Question I am doing some shadow mapping. How do I render the depth channel directly to a texture using a frame buffer object? Can you please post a block of code that initializes the texture and the