This is another extreme old one; from before NaN days even!
Issue is that shadowbuffers have a bias to prevent faces shadowing itself.
To make bias smarter, code was added to adjust bias based on light angle.
This correction allowed a factor of 10 times smaller bias, being in many
cases much too strong, causing frontally lighted faces becoming too dark.

New correction only halves the bias on frontal light, which looks quite
more convincing and pretty.
This commit is contained in:
Ton Roosendaal
2004-07-27 11:29:45 +00:00
parent db7566fa98
commit 031b39521a

View File

@@ -472,8 +472,9 @@ float testshadowbuf(struct ShadBuf *shb, float *rco, float inp) /* return 1.0:
num= shb->samp*shb->samp;
fac= shb->soft;
bias= (1.1-inp*inp)*shb->bias;
/* with inp==1.0, bias is half the size. correction value was 1.1, giving errors
on cube edges, with one side being almost frontal lighted (ton) */
bias= (1.5-inp*inp)*shb->bias;
if(num==1) {
return readshadowbuf(shb,(int)xs1, (int)ys1, zs);