Jump to content

View more

Image of the Day

#ld38 #screenshotsaturday Mimosa Fizz action gif #2 https://t.co/TUzdppvfUL
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

XNA/HLSL- 2D Deferred Rendering Depth Map

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
No replies to this topic

#1 OutrageousBobIV   Members   

110
Like
0Likes
Like

Posted 08 June 2012 - 05:37 PM

Hello,
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 :)

Attached Thumbnails

  • 1.jpg





Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.