Ray Tracing Optimizations in 3D Rendering
Although it is true that ray tracer can dramatically slow down rendering speeds, there are also some ways that you can maximize the usage of built-in optimizations of the Ray tracing engine itself.
You see, out of the gate, the Ray tracer is designed to work optimally for every scene that you throw at it.
This means that the default settings are general enough so that no one scene is all that much faster than another- or slower for that matter.
Just as you have to set up your own preferences in 3D Application, however, you will probably need to alter various settings of the Ray tracer to get the best possible performance out of each and every scene.
Although it is not absolutely critical that you know every setting for optimizing the Ray tracer, the next few sections will give you an idea of when you might use them.
When a Ray tracer processes the scene before rendering, it breaks the scene into small, cubical areas called voxels.
Pixel is short for pixel element; voxel is short for volume area.
As mentioned before, the Ray tracer relies on faces to determine where the rays will hit.
The problem is that if every ray were tested against every face in the scene, processing times would go through the roof.
Instead, the Ray tracer breaks down the scene into smaller areas, the voxels.
A voxel first starts out by encasing an object-much like a bounding box.
Next, depending on where the detail is on an object, the voxel can be broken down further to isolate small, concentrated packs of faces.
The result is something that's much like a tree of addresses.
The easiest comparison to think of is a state-city-street-street number relationship.
An object is the state.
Areas of concentrations of faces are broken down into cities.
If there is enough detail to break a city down into streets, the city will be subdivided, and so on.
This elaborate system of breaking down a scene by objects and faces helps the Ray tracer isolate where a ray travels during the course of its life.
This in turn eliminates unnecessary hit testing where the ray does not travel.
it is much easier to say that the ray will travel through these cities and hit these streets rather than just saying it will travel somewhere in the world.
Tracking it down would just be a pain.
Voxel trees help eliminate this problem.
Many Ray tracers use what's known as octrees.
As its name implies, the tree is divided eight times.
Although this works for some scenes, it can often lead to voxels that vary in size a great deal.
If a small object is left in a large voxels, there's quite a bit of hit testing to do by the Ray tracer to see where the object lies within the voxel.
In 3D Applications, voxels are adaptive.
This means that you can determine how far the voxel trees are divided by setting up limits-much like the Ray Depth control discussed earlier.
In the next section, you will see how to control the usage of voxels trees.