Jump to content
• Advertisement

# SlopeScaledDepthBias

This topic is 2679 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

Hello,

I was using a constant shadow bias for shadow acne, but the same constant didn't work well for all angles of the light. So I looked into using SlopeScaledDepthBias to bias the depth value based on the slope with respect to the light when building the shadow map.

Setting SlopeScaledDepthBias = 2.0 seems to fix my problem. However, I do not understand the other two values:

0,//INT DepthBias;
0.0,//FLOAT DepthBiasClamp;

First, why is DepthBias an INT? What if I want to bias a fractional amount? I tried various values for DepthBias and did not notice any changes.

Second, if DepthBiasClamp is set to 0.0, why am I getting any bias at all with SlopeScaledDepthBias?

When the hardware does the biasing, is it done in NDC space?

#### Share this post

##### Share on other sites
Advertisement
This same question was asked back in march, with no responses.

According to the MSDN, the units of the integer depth-bias are "the minimum representable value > 0 in the depth-buffer format".
e.g. for a 24-bit integer depth-buffer, a bias of 7 would be equal to 7/(2[sup]^24[/sup])

#### Share this post

##### Share on other sites
You will get better results if you ignore depth bias and slope scale depth bias, and come up with another approach. Depth value distribution are non-linear and going down the path of using these settings causes endless tweaking, as in the end they just end up adding some linear offset into what is an exponential distribution of values.

#### Share this post

##### Share on other sites

• Advertisement
• Advertisement

• ### Popular Contributors

1. 1
Rutin
32
2. 2
3. 3
4. 4
5. 5
• Advertisement

• 13
• 9
• 9
• 9
• 14
• ### Forum Statistics

• Total Topics
633328
• Total Posts
3011376
• ### Who's Online (See full list)

There are no registered users currently online

×

## 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!