Shader-driven compilation of rendering assets
Paul Lalonde, Eric A. Schenk · 2002
Rendering performance of consumer graphics hardware benefits from pre-processing geometric data into a form targeted to the un-derlying API and hardware. The various elements of geometric data are then coupled with a shading program at runtime to draw the as-set. In this paper we describe a system in which pre-processing is done in a compilation process in which the geometric data are pro-cessed with knowledge of their shading programs. The data are converted into structures targeted directly to the hardware, and a code stream is assembled that describes the manipulations required to render these data structures. Our compiler is structured like a traditional code compiler, with a front end that reads the geomet-ric data and attributes (hereafter referred to as an art asset) output from a 3D modeling package and shaders in a platform indepen-dent form and performs platform-independent optimizations, and a back end that performs platform-specific optimizations and gener-ates platform-targeted data structures and code streams. Our compiler back-end has been targeted to four platforms, three of which are radically different from one another. On all platforms the rendering performance of our compiled assets, used in real sit-uations, is well above that of hand-coded assets.