Archived

This topic is now archived and is closed to further replies.

Depth Buffer

This topic is 5141 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Does anyone know of a way to write back to the depth buffer? The problem is that using glDrawPixels, you can only write to the colour buffer. eg; glReadPixels(0,0,width,height,GL_DEPTH_COMPONENT,GL_FLOAT,pixels); glDrawPixels(0,0,GL_DEPTH_COMPONENT,GL_FLOAT,pixels); will give you a greyscale image of your depth map. It doesn''t send the data into the depth buffer. Thanks in advance

Share this post


Link to post
Share on other sites
no problem.


basically I''m using it to pre-render backgrounds in a program where the camera spends half of its time in the same position.
Mine''s an animation, but I''m also planning on using it in an RTS so I can add alot more detail to the terrain (tree''s and the ground don''t usually walk away)

I''ve found a way to render to get the depth into it and still keep the previous image, but it''s not as simple (save-load) as I had hoped.

Thanks for the input anyway!

Share this post


Link to post
Share on other sites