Why use the Render Cache?
The short answer is to get interactive performance from renderers that
aren't quite fast enough for interactive use. Ray based renderers
have the advantages of being able to work with a wide range of geometry,
scale well with high scene complexity, and can compute non-local effects
such as shadows, reflection, refraction, and general global illumination
accurately. While interactive performance has been shown for some
highly optimized ray tracers in some cases(generally involving sacrifices
in image resolution, lighting complexity, scene complexity, and/or number
of effects simulated), they are generally considered too slow for interactive
use. So if you want to get the accurate illumination of a ray tracer,
but need interactive performance, what do you do?
One approach is to figure out exactly which effects you need where and
substitute particular approximations that are compatible with standard hardware-assisited
scan-conversion rendering (eg, reflection maps, shadow maps, etc.) This
approach requires considerable expertise on the part of the user to find
the right tradeoffs in these approximation, and I will not discuss it further
here.
Another approach is to only compute a sub-set of the pixel for each frame.
By reducing the amount of work done per frame, this allows for higher
framerates, but also causes objectionable visual artifacts as we show below.
A better option is to use a more adaptive approach. There is usually
a large amount of similarity between one frame and the next, so it seems
wasteful to compute each frame from scratch. If we can figure out how
to extrapolate from one frame to the next, we should be able to produce new
frames at a much lower cost. The render cache is one approach for achieving
this. By caching and reusing shading results from one frame to the
next, it can estimate subsequent frames with much better fidelity even though
only a tiny fraction of the pixels are recomputed from scratch (by the underlying
ray tracer) per frame.
Instructions
- Start the render cache program from the button on the main page. It will start by showing a simple
environment with 7 spheres.
- Select "Ray Trace Only Mode" from the Mode menu. This
disables the render cache and just uses a ray tracer to compute 1/16th of
the pixels each frame (otherwise the framerate would be too low for interactive
use).
- Position your mouse over the middle of the image and press the
spacebar to start rotation mode. Now moving your mouse away from
the center will cause the camera to rotate. Note the visual artifacts
causes by only updating 1/16 of the pixels per frame.
- Press the spacebar again to disable rotation mode and select
"Single Processor Mode" from the Mode menu. This switches back
to using the render cache. The processing time is now split between
the render cache and the underlying ray tracer, so even fewer new shading
results can be computed, but the frame extrapolation algorithm is much more
sophisticated.
- Postion your mouse over the center of image and press the spacebar
to enable rotation mode, and try rotating the camera again. Even
though fewer new eye rays are being computed, the visual quality is improved
during camera motion. Now let's try an example where the eye rays are
more expensive to compute.
- Select "Load Lotus Model" from the Scene menu. This
brings up a more complicated scene.
- Choose "+Reflections" from the Display pull-down box. This
selects a more expensive shading model that includes shadows and mirror
reflections.
- Select "Ray Trace Only Mode" from the Mode menu to disable
the render cache. Notice that the framerate is much lower in this scene
because the shading is more expensive to compute. Try rotating the
camera again.
- Select "Single Processor Mode" from the Mode menu to re-enable
the render cache and try rotating. Notice that although the image
quality is not perfect, during camera motions, it is much better than the
ray trace only mode and the framerate is higher too.
Sample Images
Camera rotation example without the Render Cache (1/16th of the
pixels computed per frame by ray tracer)
Camera rotation example with Render Cache (1/211th of the pixels
computed per frame by ray tracer, the rest extrapolated by the render cache
from prior results and frames)