Depth Bias?

About Truespace Archives

These pages are a copy of the official truespace forums prior to their removal somewhere around 2011.

They are retained here for archive purposes only.

Depth Bias? // Archive: Tech Forum

1  |  

Post by Asem // Apr 12, 2006, 12:03am

Asem
Total Posts: 255
I was going over the shadows from the spot light and I see bias at 64. I set the light so the pillars I have cast a shadow but it seems that they will be literally moved but when I see the bias to 2 they are in the right spot. Is it supposed to do that and why is it that I make the bias 2 I get a grainy effect?

1st pic -> depth bias = 2
2nd pic -> depth bias = 64

It's worse if I set the depth bias to 0.

Post by parva // Apr 12, 2006, 1:02am

parva
Total Posts: 822
pic
depth bias and shadow map size are in a conjunction.


the depth bias value set the details of the objects which cast shadows.

If you want that all little/small detail of a mesh cast a shadow you need a very low value.

at the same time (if you set a low depth bias value) you need a larger shadow map size or you get the effects you have in picture 1 (stripes, dots etc.).


It's worth to play with these settings as well as the far and near clip plane.

Post by tomasb // Apr 12, 2006, 6:55am

tomasb
Total Posts: 261
To be more technical... Depth bias is used to solve self shadowing issue that is occuring with shadow map. When you discretly sample scene depths from light point of view, than in the case you are sampling too steep faces one pixel in shadow map covers big area. Usualy center point is sampled.

Then when you calculate shadows thru shadow mapping, you go thru scene and compare depths from shadow map and real depth. Here you can sample points that were in the same shadow map pixel but with bigger distance than center point - center point casts shadow on you.. This is of course wrong and is solved (usualy) by adding small bias - which says how to offset depth when comparing values from shadow map and calculated distance from light during rendering.

This means that if you have smaller resolution, you need to have bigger depth bias since bigger area is sampled into one shadow map pixel and vice versa..
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2024. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn