8. The Distributed Part - Getting the cool effects to work
Distributed ray tracing essentially uses stochastic methods to generate
various cool effects like soft shadows, glossy reflection, translucency,
depth of field & motion blur. The basics of three of these are discussed here.
The last two have yet to be implemented.
- Soft Shadows & Area Lights -
Soft shadows are the shadows we see in the real world i.e. the shadow
boundaries are not hard but soft or blurred. This happens beacuse we
do not have point light souces in the real world but area light sources.
So a point in shadow typically gets rays from another part of the same light
source making the shadow there soft. This is called the penumbra.
Points which do not get the light rays from any points on the light source lie
in the region of complete darkness called the umbra. This is shown below
in figure 8.1.
|
|
Figure 8.1 |
Figure 8.2 |
To simulate this effect in ray tracing we send out a number of shadow feelers,
which are stochastically distributed at the point of intersection.
Shadow feelers were shot at the area light from the point p on the
surface of interest. Let cen & rad are the center & radius of the area light.
We distribute rays around the vector cen - p. A pair of random values
(u,v) are generated. We then calculate a pair of angles theta
& phi
using the formulas given below.
theta = arccos(1 - u + u * sqrt(1 - (rad / abs(x-cen)^2 )
phi = 2 * PI * v
The formula for theta restricts the maximum angle to that subtended by
the area-light. The ray is then generated by offsetting the vector cen-p
by theta & then rotating this vector by phi about cen-p.
The generated ray is shot toward the area-light & the first point of
intersection p' is
used as the sample point on the area-light. We also attenuate the
light intensity by the cosine of the angle between the radial vector at p'
& the
vector p-p'. Soft shadows are generated when we specify the
number of shadow feelers
more than 1 and define area lights. Area lights are
defined as shown.
area_light
{
  position x y z 1
  radius r
  color R,G,B
}
Some examples of soft shadows are given below -
Soft Shadows
- Glossy reflections -
Glossy reflections are a property of surfaces which do not reflect light with
perfect specularity like plastics. To simulate this effect reflected rays
are distributed about the specular reflection direction. A pair of random
values (u,v) are generated. We then generate a pair of angles theta
& phi as follows -
theta = arcos(u ^ (1/n) )
phi = 2 * PI * v
A new direction for the reflected ray is obtained by offseting the specular
reflection direction by theta and then rotating this ray about the specular
direction by phi.
Glossy Relflections
- Translucency -
Translucency is a property of the surface which are neither fully transparent
nor fully opaque. Frosted glass is an example of such a material.
Translucency was simulated by generating several perturbed versions of the
transmitted ray by using a n x n grid around the point of intersection.
Translucency
[ Back ]
Page last updated on 04 October, 2005.
|
AT cse.iitd.ac.in
|
© Parag Chaudhuri , 2009
|
|