Jump to content
  • Advertisement

Archived

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

Dredge-Master

Depth Buffer

This topic is 5394 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
Advertisement
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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!