RSL
|
Shading Language Data TypesThe Shading Language uses the following data types:
Notice that integers are not supported by the language, therefore, all single values must be declared as a float. Also local variables cannot use the string data type. |
Writing and Compiling a Shading Language FileWriting a shader in the Shading Language is similiar to writing an application in the 'C' language. Like a 'C' language source file (.c), code in the Shading Language is written with a text editor, but named with a .sl file extension. The easiest way to write a shader is to use the Cutter text editor because it has the following facilities.
Successful compilation produces a shading language object file ie. a shader. The
extension of the shader file will vary from one RenderMan complient system to
another. For example, Pixar's system uses ".slo" as the file extension for
shaders compiled with their "shader" compiler. The name of the shader file will match the name of the shader
defined by the code rather than the name of the .sl file. When using Cutter,
shader files will be saved to a "shaders" directory specified by the user
in Cutter's preferences.
(prompt%) shader test.sl |
A Basic Rib File For Testing a Shader
Once a shader has successfully compiled you will want to test it. This can
be accomplished using Maya (plus a Pixar's mtor or Rfm plugin) or Houdini
(does not require a plugin). Alternatively, a sample rib file might be edited
so that it uses your new shader. Again, Cutter speeds up development
by generating and rendering either single frame or multiple frame rib files.
|
Listing 1
When this rib file is rendered via Cutter a dialog box will prompt the user to add three Options to the beginning of the document. The Options will be automatically added to the users rib file. For example, |
Option "searchpath" "texture" "../../textures" Option "searchpath" "shader" "@:../../shaders" Option "searchpath" "archive" "../archives:Cutter_Help/templates/Rib:custom_templates/Rib" |
Without these |
© 2002- Malcolm Kesson. All rights reserved.