i trying configure frame buffer object depth buffer has 32 bits, render , merely copy resulting color buffer system color buffer.
can me how code this?
you can attach texture:
glteximage2d(gl_texture_2d, 0, gl_depth_component24, width, height, 0, gl_depth_component, gl_float, 0); glframebuffertexture2d(gl_framebuffer, gl_depth_attachment, gl_texture_, textureid, level);
to fbo , use texture draw full-screen quad on screen.
rendering texture , using fullscreen quad: http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-14-render-to-texture/
by using gl_depth_component24
have max depth precision hardware uses. in fragment shader (for fullscreen quad) can read such texture , use gray scale image.
here related question: how visualize depth texture in opengl?
on other hand if want have 32 bit buffer... maybe easier use gl_r32f texture , calculate depth values in fragment shader. way have better control on process.
Comments
Post a Comment