RManNotes

Contents:

Introduction

An Emacs editing mode, "rsl-mode" (source), exists for RenderMan Shading Language source files which makes editing, compiling, and testing shaders more convenient.

RSL-Mode provides the following:

RSL-Mode Keyboard Command Extensions
CommandDescription
Ctrl-c Ctrl-csave & compile the shader in the current Emacs buffer for PRMan
Ctrl-c Shift-Csave & compile the shader in the current Emacs buffer for BMRT
Ctrl-c Ctrl-rrender the current RIB file using PRMan
Ctrl-c Shift-Rrender the current RIB file using BMRT
Ctrl-c Ctrl-sset the current RIB file filename (the default is "rman.rib")
Ctrl-c Ctrl-iset the list of directories included by the -I flag in both PRMan's and BMRT's shader compiler. This is specified, at the prompt, as a LISP list of strings where each string corresponds to one directory name.
Ctrl-c Ctrl-lload the most recently loaded AL file (via Emacs) back into the AL interpreter

Changing the Defaults

There are two global variables defined by rsl-mode which specify default settings. These variables can be defined in your own .emacs file or site files to specify new defaults.

rsl-mode-rib-file
A string corresponding to the default filename of the RIB file loaded by the rendering commands. The default is "rman.rib."
rsl-mode-inc-list
A list containing strings where each string is a directory included by the compile commands. The default is nil (i.e. no directories).

The values can also be changed interactively by the Ctrl-c Ctrl-s and Ctrl-c Ctrl-i keystrokes shown in the table above.

Examples:

(setq rsl-mode-rib-file "myrib.rib")
Changes the default RIB file to "myrib.rib."
(setq rsl-mod-inc-list (list "/usr/local/shaders" "~/shaders"))
Specifies two directories which will be "included" using the -I flag with either shader compiler. (The tilde will be expanded to the user's home directory.)

Using AL & OX With RSL Mode

The Ctrl-c Ctr-l keyboard command in rsl-mode attempts to load an AL file into the AL interpreter (Ox). The interpreter must be running of course. It determines the name of the AL file to load in the following manner:

Here are example scripts, one version for PRMan and the other for BMRT, which render a bilinear path with the plastic shader and two light sources. These sample files can be copied and edited to use the shader and/or geometry that you're testing. They can also be further optimized for faster rendering.

RManNotes is Copyright © 1995, 1996 Stephen F. May

Any comments or suggestions appreciated.

Steve May (smay@pixar.com)

Last Modified: 3/27/96