Graphics Reference
In-Depth Information
p'
p c
n
p d
β
β
dA
p r
p
p p
Figure 1.9. Geometric construction of point p d .
After evaluating many test cases and several functions of various complex-
ity, we noticed that intersecting a simple halfway vector between pp c and pp r
with the light plane to create p d (see Figure 1.9) works reasonably well in the
majority of our cases, having a statistical error less than 0.05 against best-point
approximating the integral.
After visual assessment we decided it works well enough in our use case
(see Figure 1.10) and is visually indifferent from the raytaced solution (see Fig-
ure 1.11). It also proves simple enough for real-time per-pixel calculation on
modern GPUs.
As another level of simplification, we used the halfway vector between pp
and −→
pp . It allowed the important optimization of skipping the closest point to
the shape calculation. Unfortunately, it yields a statistical error of more than
0.15. However, the disparity is mostly visible in an edge case scenario, where the
light shape is pointing away from surface normal. There are no visual artifacts
noticeable, and our artists decided it is good enough for our needs.
Area diffuse approximation algorithm. Our final approximation for diffuse integral
can therefore be expressed by the following pseudo code:
For point p with normal n :
Intersect a ray from p in direction n with light plane, creating new
point p .
Project point p on the light plane, creating point p .
Create halfway vector d h between pp and −→
pp :
pp + −→
d h =
pp
pp + −→
.
pp
Search WWH ::




Custom Search