Jump to content
  • Advertisement

Archived

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

rahaydenuk

Reading the depth buffer for a given x, y?

This topic is 6133 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

Is there a way in DirectX 8.1 to read the value in the depth buffer for given x, y pixel co-ordinates? I know in OpenGL, there is a function ''Unproject()'' or similar, which would achieve the desired results, but I need this for DirectX 8.1. Thanks & HNY, Richard Hayden.

Share this post


Link to post
Share on other sites
Advertisement
Well.. I don''t really use DX8, only DX7, but I guess you can lock the Z-buffer and get a pointer to it. Once you got that, you just have to read the appropriate value directly from memory. However, be aware that reading FROM video memory is VERY SLOW. If you just read 2-3 pixels per frame it''s ok but don''t hope to read big chunks.

Note : and please do not double post. Thanks.

Share this post


Link to post
Share on other sites
Sorry about the double posting.

I don''t think you can do this in DX 8 (locking the z-buffer and then reading the vals from memory). Even if you could, as you mentioned it is incredibly slow.

Does anyone know of another possible way?

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!