 
Summary: The Shader Cache: A Rendering
Pipeline Accelerator
James Arvo and Cary Scofield
1 Introduction
This gem describes a caching strategy to accelerate shading calculations in any tra
ditional polygon rendering pipeline, such as that defined by PHIGS+. The purpose
of the cache is to reduce the number of redundant shading calculations performed
on behalf of adjacent polygons sharing at least one vertex and associated surface
normal. Such polygons frequently result from applications that tesselate trimmed or
implicit surfaces. Because implementations of these algorithms often do not perform
the necessary bookkeeping to record polygon adjacency, large numbers of autonomous
polygons may be emitted in lieu of more efficient organizations such as a triangle strips
or quad meshes. Given that some applications will always choose to generate streams
of independent polygons, we wish to do what we can ``on the fly'' to mitigate the cost
of such redundancy without impacting the performance in other circumstances.
Our approach is to augment the shading module with a cache to store the results
of recentlyperformed shading calculations. Then, with reasonable probability, these
results can be reused for adjacent polygons that share one or more vertices with
identical data and attributes. If we view the shader as a function that computes a
color based on the position P , normal N , and color index k of a polygon vertex, that
