A system and method for high-speed execution of graphics application
programs, including shading language instructions, that utilize 3D
graphics hardware. The method involves expressing a graphics computation
in a platform-independent procedural shading expression, converting the
expression (i.e., user application program) into an intermediate
representation such as a tree, and then translating it into a sequence of
parametric shading expressions. The method can alternatively processes the
intermediate tree representation using a cost-based, tree-grammar
recognizer such as iburg. The result is a platform-specific and
least-cost, in terms of the underlying hardware, sequence of parametric
shading expressions that realizes the graphics computation. The system and
method is useful in translating platform-independent RenderMan.TM. Shading
Language programs into fast-executing, platform-specific OpenGL.TM. or
Direct3D.TM. executable code.