1.15k likes | 1.17k Views
Efficient PCF shadowmap filtering. Kees van Kooten. Virtual Proteins. Aliasing. Aliasing. PCF. PCF. 40%. PCF. PCF. PCF. nearest. PCF. nearest. 1. 1. 1. 1. 1. 0. 1. 1. 1. 1. 1. 0. 1. 1. 1. 1. 1. 0. 1. 1. 1. 1. 1. 0. 1. 1. 1. 1. 1. 0. 0. 0. 0. 0. 0.
E N D
Efficient PCF shadowmap filtering Kees van Kooten Virtual Proteins
PCF 40%
PCF nearest
PCF nearest 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 0 0 0 0 0 0 0
PCF bilinear 0.56 0.19 0.19 0.06
PCF bilinear 0.56 0.75 0.19 0.19 0.38 0.06
PCF bilinear 0.56 0.75 0.75 0.19 0.19 0.38 0.38 0.06
PCF bilinear 0.56 0.75 0.75 0.75 0.75 0.19 0.75 1 1 1 1 0.25 0.75 1 1 1 1 0.25 0.75 1 1 1 1 0.25 0.75 1 1 1 1 0.25 0.19 0.25 0.25 0.25 0.25 0.06
PCF bilinear
0.56 0.19 0.56 0.19 0.56 0.19 0.19 0.06 0.19 0.06 0.19 0.06 0.56 0.19 0.56 0.19 0.56 0.19 0.19 0.06 0.19 0.06 0.19 0.06 0.56 0.75 0.75 0.75 0.75 0.19 0.56 0.19 0.56 0.19 0.56 0.19 0.75 1 1 1 1 0.25 0.19 0.06 0.19 0.06 0.19 0.06 0.75 1 1 1 1 0.25 0.75 1 1 1 1 0.25 0.75 1 1 1 1 0.25 0.19 0.25 0.25 0.25 0.25 0.06
PCF efficient bilinear
0.75 1 1 1 1 0.25
a b c d e f F1 F2 F3 F4 F5 F6 S = aF1 + bF2 + cF3 + dF4 + eF5 + fF6
aF1 + bF2 lerp(F1,F2,o)
aF1 + bF2 lerp(F1,F2,o) s∙lerp(F1,F2,o)
(a+b) s = b o = s aF1+bF2 = s∙lerp(F1,F2,o)
F1 0 F2
aF1 0 bF2
aF1+bF2 0
aF1+bF2 0 lerp(F1,F2,o)
aF1+bF2 0 s∙lerp(F1,F2,o)
aF1+bF2 0 s∙(1-o)F1+ s∙oF2
s = a+b 0
b o = a+b 0
d b f a+b c+d e+f a b c d e f F1 F2 F3 F4 F5 F6 s = (a+b)lerp(F1,F2, ) + (c+d)lerp(F1,F2, ) + (e+f)lerp(F1,F2, )
aF1 bF2 cF3 dF4 PCF in 2D
s1∙lerp(F1,F2,o1) aF1 bF2 cF3 dF4 s2∙lerp(F3,F4,o2)
s1∙G1 aF1 bF2 cF3 dF4 s2∙lerp(F3,F4,o2)
s1∙G1 aF1 bF2 cF3 dF4 s2∙G2
s2 (s1+s2)lerp(G1,G2, ) s1+s2 = s∙lerp( G1, G2, y) s∙lerp(lerp(F1,F2,x), lerp(F3,F4,x), y)
s2 (s1+s2)lerp(G1,G2, ) s1+s2 = s∙lerp(s1∙lerp(F1,F2,o1), s2∙lerp(F3,F4,o2), y) = s∙lerp(lerp(F1,F2,x), lerp(F3,F4,x), y)
Doomed? 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1