RenderMan Shading Language
Encyclopedia
Renderman Shading Language (abbreviated RSL) is a component of the RenderMan Interface Specification
RenderMan Interface Specification
The RenderMan Interface Specification, or RISpec in short, is an open API developed by Pixar Animation Studios to describe three-dimensional scenes and turn them into digital photorealistic images...

, and is used to define shader
Shader
In the field of computer graphics, a shader is a computer program that is used primarily to calculate rendering effects on graphics hardware with a high degree of flexibility...

s. The language syntax is C-like.

A shader written in RSL can be used without changes on any RenderMan-compliant renderer, such as Pixar's PhotoRealistic RenderMan
PhotoRealistic RenderMan
PhotoRealistic RenderMan, or PRMan for short, is a proprietary photorealistic RenderMan-compliant renderer.It primarily uses the Reyes algorithm but is also fully capable of doing ray tracing and global illumination....

, DNA Research's 3Delight
3Delight
3Delight is a proprietary, photorealistic, RenderMan-compliant offline renderer.It is developed by DNA Research, or DNA in short, a subsidiary of Taarna Studios.-Features:...

, Sitexgraphics' Air or an open source solution such as Pixie
Pixie (renderer)
Pixie is a free , photorealistic raytracing renderer for generating photorealistic images, developed by Okan Arikan in the Department of Computer Science at The University of Texas At Austin...

 or Aqsis
Aqsis
Aqsis is a free rendering suite compliant with the RenderMan standard. It is available under the GPL, with some parts under the LGPL. Its main author and project manager is Paul Gregory....

.

RenderMan Shading Language defines standalone functions and five types of shaders: surface, light, volume, imager and displacement shaders.

An example of a surface shader that defines a metal surface is:

surface metal(float Ka = 1; float Ks = 1; float roughness = 0.1;)
{
normal Nf = faceforward(normalize(N), I);
vector V = - normalize(I);
Oi = Os;
Ci = Os * Cs * (Ka * ambient + Ks * specular(Nf, V, roughness));
}

Shaders do the work by reading and writing special variables such as Cs (surface color), N (normal at given point), and Ci (final surface color).
The arguments to the shaders are global parameters that are attached to objects of the model (so one metal shader can be used for different metals and so on). Shaders have no return values, but functions can be defined which take arguments and return a value. For example, the following function computes vector length using the dot product
Dot product
In mathematics, the dot product or scalar product is an algebraic operation that takes two equal-length sequences of numbers and returns a single number obtained by multiplying corresponding entries and then summing those products...

 operator ".":

float length(vector v) {
return sqrt(v . v); /* . is a dot product */
}

Further reading

  • Steve Upstill: The RenderMan Companion: A Programmer's Guide to Realistic Computer Graphics, Addison-Wesley, ISBN 0-201-50868-0
  • Anthony A. Apodaca
    Anthony Apodaca
    Anthony A. Apodaca is Director of Graphics Research and Development at Pixar Animation Studios. He is co-creator of the RenderMan Interface Specification . His film credits include almost all of the titles produced by Pixar.-Bibliography:*Anthony A...

    , Larry Gritz: Advanced RenderMan: Creating CGI for Motion Pictures, Morgan Kaufmann Publishers, ISBN 1-55860-618-1
  • Ian Stephenson: Essential RenderMan Fast, Springer, ISBN 1-85233-608-0
  • Saty Raghavachary: Rendering for Beginners: Image synthesis using RenderMan, Focal Press
    Focal Press
    Focal Press is a publisher of media technology books and it is an imprint of Elsevier. It was founded in 1938 by Andor Kraszna-Krausz, a Hungarian photographer who immigrated to England in 1937 and eventually published over 1,200 books on photography....

    , ISBN 0-240-51935-3
  • Rudy Cortes and Saty Raghavachary: The RenderMan Shading Language Guide, Course Technology PTR, 1 edition (December 27, 2007), ISBN 1-598-63286-8

RenderMan knowledge

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK