Sign in to follow this  
lomateron

how to control the deph stencil in the pixel shader

Recommended Posts

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

Share this post


Link to post
Share on other sites
lomateron    491
I just discovered
[source lang="java"]http://msdn.microsoft.com/en-us/library/windows/desktop/bb509647[/source]


there is the answer Edited by lomateron

Share this post


Link to post
Share on other sites
Ashaman73    13715
[quote name='lomateron' timestamp='1348631781' post='4983869']
the depth is normally determined in the vertex shader, is there any way to do it on the pixel shader?
[/quote]
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this