Backward Ray Tracing Illustration

[ LiB ]

Backward Ray Tracing Illustration

Now let's do a simple visual example of backward ray tracing. Take a look at Figure 5.12.

Figure 5.12. Four by four view/image plane.

graphic/05fig12.gif


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.

Figure 5.13. Ray pixel plotting.

graphic/05fig13.gif


Here's the general idea in six easy steps:

  1. Traverse from left-to-right on the view plane.

  2. Traverse from top-to-bottom on the view plane.

  3. Set up a ray.

  4. Trace the ray.

  5. Compute the pixel color.

  6. 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 ]


Focus On Photon Mapping
Focus On Photon Mapping (Premier Press Game Development)
ISBN: 1592000088
EAN: 2147483647
Year: 2005
Pages: 128
Authors: Marlon John

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net