このチュートリアルに従って、3D シーンでシャドウ マッピングを実行しています。ここで、ARB 拡張を使用してこれを適用する前に、 shadowMapTexture (以下の抜粋を参照)の生のテクセル データを操作したいと考えています。
//Textures
GLuint shadowMapTexture;
...
...
**CopyTexSubImage2D** is used to copy the contents of the frame buffer into a
texture. First we bind the shadow map texture, then copy the viewport into the
texture. Since we have bound a **DEPTH_COMPONENT** texture, the data read will
automatically come from the depth buffer.
//Read the depth buffer into the shadow map texture
glBindTexture(GL_TEXTURE_2D, shadowMapTexture);
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, shadowMapSize, shadowMapSize);
- 注意: OpenGL 2.1 のみを使用しています。