Jump to content
  • Advertisement
Sign in to follow this  
Quat

D3D11_RASTERIZER_DESC DepthClipEnable

This topic is 2743 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, does anyone know what the DepthClipEnable 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
Advertisement

Hi, does anyone know what the DepthClipEnable 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.


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.


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.


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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!