Ray Tracing
Ray tracing is a complex method of displaying lighting. Essentially, what ray tracing does is calculate the path of light rays from the viewer back to the source. This is a simplistic way of breaking it down, but realize that in this process, we are talking quite a large number of calculations. How do we get so many? Well, the main calculations are called ray-object insertion tests, which are the actual calculations of the light rays bouncing around off of objects. Obviously, a scene with more objects and more light sources is going to take more power to compute. Only a few rays actually make it to the user, but it is their interaction with other objects that is traced back to the source of the light. On top of these tests, we have to consider that there are shadows and reflections, in addition to the typical things that must be rendered, like the objects and the textures.
All this together yields photorealistic images. However, current hardware can't support it in real-time, because it is way too computationally intense. Ray tracing allows for beautiful graphics, but its main downside is the slow speed that it takes to process. Ray tracing is a powerful algorithm, though, and can depict such illuminations as shadows, specular reflections, and refraction of light traveling through transparent materials. The time that it takes to complete a ray tracing process is a factor of how many light sources you have. The more light sources there are, the more light we have bouncing around the scene, and thus the more calculations that have to be made.
![FS 3D Guide: Filtering and Lighting [ Ray tracing @ 640 x 480 ] > View Full-Size in another window.](images/raytracing-s.jpg) Ray tracing
|
There is another way to trace light as well, called photon tracing. Photon tracing calculates the path of light rays from the source, and is way more computationally prohibitive than ray tracing. Why is that? This is because there are so many light rays that come from a source, and very few of them actually make it to the viewer. Tracing all of the light rays from the source involves billions and trillions of computations, and since only a few of the light rays makes it to the viewers eyes, this overhead is not what we want to process!