Implementing the Renderman Shader Language with the GNU Compiler Collection


Abstract:

Pixar's Renderman renderer supports a native language used for controlling the look of surfaces and lights within a given 3D scene. The syntax is simillar to that of "C", but with a few extensions.

The Shader Language supports a minimal form of polymorphism; Functions may exist with the same name but differing parameter lists and/or return types. Also, certain "objects" within the Shader Language operate like C++ classes wherein they contain constructors and can overload the assignment ("=") operator.

My goal is to implement the Shader Language compiler using C and the inherant constraints of the C language (C99) while implementing the "object oriented"-ness of the Shader Language features. The compiler will not simply be a parser that translates Shader Language files into C, to then be compiled by a native C compiler. Rather, machine code will be produced directely from the Shader Language, producing a faster executable, and opening the door to expansion.

Notes:

My object codes will not be compatible with those of Pixar's implementation of the Renderman Shader Language compiler. That would involve a lot of reverse engineering, which I am not particularaly interested in. Rather, I would like to create my own framework for creating compiled shader files (".o") and DSOs (".so"). If this project is a success, then my next goal is to implement a Renderman framework, that allows other programmers to plug-in their rendering engines at run time. As a feature of the framework, any shader files compiled with my front-end would be binary compatable with any third-party renderer that can interface with my frame-work. Am I being naive? Perhaps. But it will be fun to try.


Milestone Description Date
Drew up plan for compiler. After pouring over as much documentation as I could find regarding front end GCC programming, I mapped out the requirements of the Shader Language and how I would implement the language in RTL. April 02, 2004

Renderman Links:

GCC Links:




Pixar & RenderMan are registered trademarks of Pixar.
GCC is copyright the Free Software Foundation.