[ LiB ] |
Now let's do a simple visual example of backward ray tracing. Take a look at Figure 5.12.
If you subdivide the image plane into a 4x4 grid of pixels you would have a total of 16 pixels (4x4=16). Now all you have to do is generate a ray from the center point to leave in the direction of each pixel on the image plane. The ray leaves the eye and passes through each pixel on the image plane. The ray is then sent out into the world, its job is to return with color information about whatever surface it interacts with first. See Figure 5.13 for an example of ray pixel plotting.
Here's the general idea in six easy steps:
Traverse from left-to-right on the view plane.
Traverse from top-to-bottom on the view plane.
Set up a ray.
Trace the ray.
Compute the pixel color.
Save the pixel color.
It's as simple as that. Try to imagine the process as putting a sheet of paper in front of you and shooting holes in the paper with a gun. The bullets of the gun would be the rays. As each bullet leaves the gun and moves through space it will hit something. Now try to imagine each intersection of the bullet as a token to return color information of each point it hits. Whatever the bullet hits first is what the pixels on the image planethe holes in the paper record. The image plane is typically much larger (640x480, 800x600, or 1024x768) to accommodate the monitor and also because I certainly don't want to strain my eyes looking at a 16x16 render. It's important to point out that the smaller the image plane is the faster it will render and that's why many applications perform a low-resolution render before they conduct the final render.
NOTE
NOTE
Photon mapping was invented by Henrik Wann Jensen.The first con cepts for the photon mapping algorithm were introduced in 1994.
[ LiB ] |