Jump to content
  • Advertisement
Sign in to follow this  
The_Grand_User

Copy one depth buffer to another

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

Hello, I'm attempting to draw some expensive geometry to a seperate render target and depth buffer, and then use that to draw most frames with. I can get the image alright, but I'm not sure how to copy over the second depth buffer to the primary one. I've tried setting them both to D3DFMT_D16_LOCKABLE and LockRect(), but that only causes an error (because I'm using a Nvidai card I believe). I've thought of using a shader, but am unsure how to go about it that way. Let me know if you need any more info. Thanks, Andrew

Share this post


Link to post
Share on other sites
Advertisement
Quote:
but that only causes an error

What's the error?

EDIT: Can you just use SetDepthStencilSurface?
EDIT2: Ignore that question. I see what you're apparently trying to do - preserve the expensive render and reuse it.

[Edited by - Buckeye on July 18, 2008 3:35:00 PM]

Share this post


Link to post
Share on other sites
When I try to use D3DFMT_D16_LOCKABLE I get the D3DERR_NOTAVAILABLE error; if I don't use that, when I try to lock the surface I get the D3DERR_INVALIDCALL error.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!