Sign in to follow this  
Quat

D3D11_RASTERIZER_DESC DepthClipEnable

Recommended Posts

Hi, does anyone know what the [b]DepthClipEnable[/b] property does? The documentation says: "Enable clipping based on distance."

So it almost sounds like this enables/disables far plane clipping. However, an experiment shows that far plane clipping is enabled whether I set this property to true or false. So I don't get it.

Share this post


Link to post
Share on other sites
[quote name='Quat' timestamp='1302459461' post='4796755']
Hi, does anyone know what the [b]DepthClipEnable[/b] property does? The documentation says: "Enable clipping based on distance."

So it almost sounds like this enables/disables far plane clipping. However, an experiment shows that far plane clipping is enabled whether I set this property to true or false. So I don't get it.
[/quote]

As i remember this, that parameter tells the gpu to draw the pixels behind another one..
so if triangel A´s pixel two is on 2,2,1
then the triangel B´s pixel one on 2,2,2 wont be drawn, since it´s behind A´s pixel two.


Im not 110% sure of this, but that is as i remember it!


Share this post


Link to post
Share on other sites
Tordin, I believe what you're talking about is the DepthEnable value in the depth/stencil description structure used to describe depth/stencil state.

The value in question here is part of rasterization state. At first I thought it might be talking about so-called "guard band clipping", but that generally refers to clipping things off the sides and not via the near/far planes as would be inferred by clipping against depth. I checked my D3D9 pipeline diagram and didn't find this state by an earlier name, so it appears to be a new thing.

Share this post


Link to post
Share on other sites
I found a GDC07 slide that vaguely mentions it : http://developer.amd.com/assets/Riguer-DX10_tips_and_tricks_for_print.pdf

Depth Clamping/Clipping

Back-end always clamps depth
Both interpolated and from PS
Viewport can enable/disable depth clipping before it gets to clamping
// enable depth clipping
D3D10_RASTERIZER_DESC rd;
rd.DepthClipEnable= true;
Also, W < 0 will clip

Share this post


Link to post
Share on other sites
If you set this to false, you can have things beyond your far-plane still drawn. It can be used for example with stencil shadows when extruding them to infinity with your normal projection matrix. For feature level 9 it must be set to true.

Share this post


Link to post
Share on other sites
Thanks for the replies.

[quote]
If you set this to false, you can have things beyond your far-plane still drawn. It can be used for example with stencil shadows when extruding them to infinity with your normal projection matrix. For feature level 9 it must be set to true.
[/quote]

Can you explain this a bit more? I have set DepthClipEnable = false, but far plane clipping is still performed, so maybe there is more to it than just setting DepthClipEnable = false to disable far plane clipping.

[quote]
Back-end always clamps depth
Both interpolated and from PS
Viewport can enable/disable depth clipping before it gets to clamping
[/quote]

What does depth clamping refer to? I thought pixels outsize [0, 1] always get clipped. So after clipping all z in [0,1], so what is there to clamp?

Share this post


Link to post
Share on other sites
OK, I looked at that GDC presentation and I think I have an idea of where you might see a difference here.

By default, the viewport covers the entire with and height of the render target as well as the entire range of Z values in the interval [0,1].

Try changing to a non-default viewport that covers only a portion of the depth range, say [0,0.5]. Then toggle the DepthClipEnable flag in the rasterizer state. Do you get different results for primitives that have depth values in the interval [0.5,1]?

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