|
Hello,
I am using OpenGL ES and I want to transfer from the framebuffer, the depth component to a RGB texture.
1. I create the texture trying several modes:
gl.glTexImage2D(GL.GL_TEXTURE_2D, 0, GL.GL_INTENSITY, width, height, 0,
GL.GL_INTENSITY, GL.GL_UNSIGNED_BYTE, null);
tryed also with GL.GL_DEPTH_COMPONENT and GL_FLOAT pixel format.
2.after render to the frameBuffer i fill the texture with:
gl.glEnable(GL.GL_TEXTURE_2D);
gl.glBindTexture(GL.GL_TEXTURE_2D, dstTexture.getID());
gl.glCopyTexImage2D(GL.GL_TEXTURE_2D, 0, GL.GL_DEPTH_COMPONENT, 0, 0, 512, 512, 0);
3. when i use the texture it is poor defined, i've created a plane that comes from the camera far away and i don't see black colour when it is near the camera.
Do somebody have working code to make it work?
|