Jump to content
  • Advertisement
Sign in to follow this  

XNA/HLSL- 2D Deferred Rendering Depth Map

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

I am trying to implement a depth map in my 2D game, so that I can use deferred rendering. My problem is, that when sprites are drawn on top of eachother, I cannot get the last z-value stored in that pixel. I am not using the vertex part of the pipeline, instead relying on spritebatch to do layering for me. Is there a way I can easily retireve the previous depth value in the texture? I am using alpha transparency for my sprites, and am not sure if this will cause problems.

This picture is the depth map, where white -> closer to the front. Therefore the white sprite should appear on top of the darker sprite, but it doesn't (the darker sprite is drawn after the lighter one).

Thanks in advance :)

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.

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!