Graphics Reference
In-Depth Information
(a)
(b)
(c)
Figure 3.14. (a) Scene using 3D scattering amount lookup. (b) Front view of the scattering amount 3D
texture. (c) Top view of the middle scan-line of the 3D texture. Bottom of the image is close to the
camera.
The amount value of each depth slice will be incremented by the value the
GetAmountValue function returns. When all particles have been rendered, we end
up having a 3D lookup texture that gives us an approximation of the scattering
amount for each pixel on the screen over depth. In the ray-march loop we sample
the 3D texture for each ray-march step at the proper view-space depth using the
function from Listing 3.1 to get the scattering amount. The scattering amount
is then scaled by the world-space distance traveled by each ray-march step. Al-
though the depth representation of the amount of scattering is not very accurate,
it does give us a lot of control over the amount of volumetric light at different
locations in the scene. The slight variations in the intensity make the effect look
much more natural (Figures 3.14-3.17).
Figure 3.15. Test scene that shows how a particle effect can be used to cause light
scattering in different locations in the scene. In the left image a particle effect is placed
close to the camera to cause the light of the nearest spotlight to scatter. In the right
image the same particle effect is moved farther away from the camera to cause light
scattering for the spotlight in the back.
Search WWH ::




Custom Search