Procedural Primitive DSO

What's on this page:


There are two different kinds of DSOs that one can use. One kind is used to create procedural primitives, which allows the renderer to create geometry on they fly. The other kind is used to create C/C++ functions to be called from within the Shading Language.

First a Makefile for making DSO under Linux or SGI. In short. A DSO for Linux is made with:

   cc -fPIC -c foo.c
   ld -shared foo.o -o

or more sincintly:

   cc -fPIC -shared -o foo.c
Under SGI:
   cc -c foo.c
   ld -shared -B dynamic -o foo.o
Of course the compiler will need to be told where to find any include files that are being used, such as ri.h. This Makefile assumes that ri.h is located at /usr/local/prman/include, if this isn't the case then the Makefile will need to be changed.

Red Hat Linux users DSOs are now working under version starting with prman3.8c and greater.
prman3.8c was built under RH5.1. If you are still using Red Hat 5.0 you will need the following: libstdc++-2.8.0-8.i386.rpm and libstdc++-devel-2.8.0-8.i386.rpm.
prman3.8d was built under RH5.2 and so you may need the appropriate libraries that version to work, if you are running under an older version. Also, prman3.8.0.10 has worked fine for me under RH6.0. But I have had problems with the shader compiler with prman3.8.0.11 under RH6.0. If anybody has any further information let me know.
prman3.9, I suspect will be built under RH6.0 so if you have an older version you may want to start thinking about upgrading soon.

SGI may need to set the -n32 flag when compiling and linking

Procedural Primitives

The concept of Procedural Primitives was introduced in the RenderMan Companion, chapter __12. But it wasn't until prman3.7 in which they were actually available.

AppNote#23 goes into detail describing procedural primitives and gives some example code.

So far I have only two examples here, describing procedural primitives. One example is from the appnote and the second is an example posted by Tom Burge's

As usual, if you have other examples that you would like posted, please send them onto me.


a_sphere.c Sample RIB

Corrected code from Application Note #23.


dsoproc.c Sample RIB

Corrected version of Thomas Burge's dsoproc.

Shader Function DSOs

The second type of DSO is used to create functions that are called within the Shading Language itself. Don't like the prman noise function? Now it is straightforward to implement your own, in either C or C++.

More information on Shader Function DSOs, can be found at: Adding C Functions to Shading Language

box.c shader DSO for giving the bounding box. example shader that calls box.c.
bbox.rib example RIB.

A Makefile.

RenderMan is a registered trademark of Pixar. The RenderMan Repository is maintained by Pixar's RenderMan Products Group

Last modified: Sat Oct 2 19:44:42 PDT 1999