Jump to content

View more

Image of the Day

The beast has a mighty searchlight of evil! #screenshotsaturday https://t.co/bzKepOojDL
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

how to control the deph stencil in the pixel shader

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
2 replies to this topic

#1 lomateron   Members   

491
Like
0Likes
Like

Posted 25 September 2012 - 09:56 PM

the depth is normally determined in the vertex shader, is there any way to do it on the pixel shader?

Edited by lomateron, 25 September 2012 - 11:04 PM.


#2 lomateron   Members   

491
Like
0Likes
Like

Posted 25 September 2012 - 11:07 PM

I just discovered
[source lang="java"]http://msdn.microsoft.com/en-us/library/windows/desktop/bb509647[/source]


there is the answer

Edited by lomateron, 25 September 2012 - 11:24 PM.


#3 Ashaman73   Members   

13714
Like
0Likes
Like

Posted 25 September 2012 - 11:39 PM

the depth is normally determined in the vertex shader, is there any way to do it on the pixel shader?

You can change the depth value in the shader, but this is not really recommented due to killing almost any hardware optimization available (early-z-rejection etc.) and the stencil test is already performed before the fragment stage.

Best to tell us what you want to archieve, there are often many other options available.

Ashaman

 

Gnoblins: Website - Facebook - Twitter - Youtube - Steam Greenlit - IndieDB - Gamedev Log





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.