Jump to content

View more

Image of the Day

Inventory ! Va falloir trouver une autre couleur pour le cadre D: #AzTroScreenshot #screenshotsaturday https://t.co/PvxhGL7cOH
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

Setting Depth Buffer Values

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
1 reply to this topic

#1 Endemoniada   Members   

427
Like
0Likes
Like

Posted 16 January 2012 - 06:23 PM

Hi guys, please take a look at the image below. I want to set the purple area to z=0 and the green area to z=1, then render like normal. I was thinking I could call Clear() with z=0 then render a quad for the green area and set the z=1 values that way, I need to specify the green area in world coordinates (at a specific world z) so I don't know how I would do that.

Any help would be appreciated. Thank you.

Posted Image

#2 Adam_42   Members   

3586
Like
0Likes
Like

Posted 16 January 2012 - 07:08 PM

If it's always a rectangle you could just transform your world coordinates to screen coordinates on the CPU, and use Clear() to clear that rectangle.

Otherwise you'll probably want to create a pixel shader that simply writes 1.0 out to the DEPTH semantic (it may need to write a colour too, but you can easily disable colour writes with D3DRS_COLORWRITEENABLE).

Depending on the result you're trying to achieve, you may be able to do the same thing with the stencil buffer, which doesn't need a special shader.




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.