Tools Based on the RenderMan Standard

The Affine Toolkit is published to provide some useful tools to folks using the RenderMan Standard. Even those with a full-blown setup that includes Pixar's RenderMan Artist Tools and an inexpensive Alias AutoStudio license should find the toolkit to be useful. Those with a slightly cheaper setup such as a system running Amapi, Sketch! or other PC/Mac based applications that export RIBs should also find the tools to be extremely helpful.


[Worley Noise] [Cell Noise DSO] [RMan Procedural DSO]
[Light Shader Examples] [Lens Flare Example] [Curvature Shader] [Solid Quadrics Example]
[Changing Basis to Support RiBasis] [c.g.r.r posting on RiOrientation] [Endian]
[RMan Pixel Filter Information] [RMan Pixel Filters Examples]

What Is Included With the Toolkit

August 19, 2000
Version 3C-12

Fixed bug with -binary option in affine/ributil and affine/readrib/streamio.c code that prevented it from doing binary output using Pixar's 3.9 librib.a library. Added a comment on how to link to the 3.9 library in affine/ributil/Makefile just after the typerib make section. If there are any problems send me e-mail.

This release supports RIB file extensions that have been added upto PRMan 3.8. The RibOpen() function takes as a second parameter the number of functions listed in the RI Table -- simply use the constant kRIB_LAST_RI as shown in affine/ributil/typerib.c line 193. This added parameter is for those wishing to compile the toolkit libraries as shared objects. It allows the libraries to determine the version level of the calling program and avoid accessing beyond a table's length.

The newer libz.a library (version 1.1.3) can be used with the toolkit without modification. A special libz.a is no longer needed.

Included in the Affine Toolkit is a set of libraries for reading and writing RIB files. Also included are some handy conversion tools and RIB utilities and filters.

The following utilities are included in the Affine Toolkit:

ribbish    -- Filter RIB files for certain RIB calls.
ribdump    -- Dump binary or ASCII uncompressed RIBs.  Useful for seeing 
              how the encoding is done.
ribfixer   -- Touch-up and fix some problems with exported RIB files.
ribobjmod  -- Convert NuPatch statements into WaveFront OBJ format.  
ribtree    -- Little demo program that creates toy-like trees.
typerib    -- Print RIB files as ASCII, binary, gzipped RIB files.

normfptiff -- Adjust the min to max range of values in an IEEE TIFF file 
              to be from 0 to 1.  
pix2tiff   -- Convert Alias PIX files into TIFF.
pixinfo    -- Print size information of Alias PIX files.
showbits   -- Displays Alias PIX, TIFF and TGA files.  Showbits will try
              to figure out the file format if the user doesn't indicate which.
tga2tga    -- Test program to convert TGA uncompressed/compressed to 
              TGA compressed.
tga2tiff   -- Convert TGA to TIFF.
tgainfo    -- Print size information of TGA files.
tif2tif    -- Test program to convert TIFF uncompressed/compressed to 
              TIFF compressed files.
tiff2X     -- Convert a black and white TIFF into X Window's ASCII format.
tiff2fp    -- Print IEEE values in an IEEE TIFF file.
tiff2pix   -- Convert TIFF to Alias PIX.
tiff2tga   -- Convert TIFF to TGA compressed.
tiffedge   -- Composite TIFF images of constant surface shaded objects, 
              normal-variance shaded object, and depth maps into a Sobel
              filtered image that looks like the ink lines of a cartoon.
z2tiff     -- Takes Pixar's Z format and converts the data into a TIFF image.

bin2hex    -- Convert binary characters into ASCII printed hex numbers.
bin2oct    -- Convert binary characters into ASCII printed octal numbers.
dbl2oct    -- Convert ASCII printed floating point values into RIB encoded
              IEEE double precision form.
dec2hex    -- Convert ASCII printed decimal numbers into ASCII printed 
              hex numbers.
flt2oct    -- Convert ASCII printed floating point values into RIB encoded
              IEEE floats.
fp2tiff    -- Store ASCII printed floating point values into an IEEE TIFF
              file of a user specified size.
hex2bin    -- Convert ASCII printed hex numbers into binary characters.
hex2dec    -- Convert ASCII printed hex numbers into ASCII printed decimal
              numbers.
ibm2unix   -- Remove DOS, NT and OS/2 two byte carriage returns in favor 
              of UNIX version of '\n'.
mac2unix   -- Remove Mac carriage returns in favor of UNIX version of '\n'.
oct2bin    -- Convert ASCII printed octal numbers into binary characters.
str2oct    -- Convert given ASCII strings into RIB encoded strings printed
              out as a series of ASCII octal numbers.
tokentbl   -- Creates a table that can be used to find tokens in a string
              or file.
untab      -- Remove tabs from ASCII files.

The following libraries are included in the Affine Toolkit:

libribconst.a -- Contains only the RI_ exported variables with the values
                 defined by the RI Specification.
libriberror.a -- Contains a default error message handler.
libribhash.a  -- Hash library for reading and writing RIB files.  Contains
                 the RI_ constants, since they are needed for setting up
                 the initial hash table.
libribmsg.a   -- Contains error messages listed in RI specification.
libribnop.a   -- Provides a Ri table with functions that do nothing but
                 return.  NOP is a abbreviation for No Operation.  This is
                 useful for filters that are only looking for one or two
                 types of RIB statements.
libribrdr.a   -- RIB Reader library.  RI_ constants and error messages 
                 included.
libribtable.a -- A table that lists all the Ri calls in the order given in
                 ribrdr.h.
libributil.a  -- Contains the RIB reader and writer functions.  Basically
                 it's libribrdr.a, libribwrtr.a and libsribhash.a put 
                 together (also libz.a thrown in as of 7-15-97).
libsribhash.a -- Simple ribhash, basically libribhash.a but without the
                 RI_ constants.
libsribrdr.a  -- Simple RIB Reader, basically libribrdr.a but without the 
                 Ri table (libribtable.a) and error messages (libribmsg.a).
libsribw.a    -- Simple RIB writer.  Has the RI_ constants and all the
                 Ri calls listed by the RI specification and the RenderMan
                 Artist's Toolkit 3.7 additions.  It is called simple 
                 because it's basically just a bunch of printf()s, only ASCII 
                 RIB output is supported, and the pixel filter functions just 
                 return zero.

Downloading the Toolkit

At present the toolkit is tested to build and run under IRIX and Solaris. But others have used it on NT, Linux, Dec Alpha, MacOS and probably other platforms, but that is what I know has been used because of e-mails from the people doing projects on these platforms.

Several utilities and libraries are provided that work with RIB files and various bitmap formats. The following sections provide an overview of what is included in the toolkit:

Updates to Toolkit as of 4-25-98

Code was added to handle matching Frame, World and Attribute Begin/End statements in separate RIB files. RiReadArchive() is documented as acting like an inline function, so statements that begin a Frame, World, or Attribute block could -- and with an very odd RIB structure -- have their matching end block statements inside a RIB's subfile read by RiReadArchive(). Note that this matching scheme would cause problems with tools such as catrib and typerib that normally just read a RIB and do not expand given subfiles.

The following calls were added to handle querying the number of uniform, varying and vertex parameters there are based on what the Reader library has calculated:

History Behind the Affine Toolkit

The Affine Toolkit is based on only published materials regarding the RenderMan Standard and the general subject of computer graphics. I developed the code without reference to any proprietary code from Pixar -- inshort this code is mine and is the result of some research, e-mails and also experimentation with the Pixar and BMRT tools such as prman, rendrib and catrib.

Feed back on the toolkit is appreciated. I will check e-mail at the Affine domain name probably on a weekly basis depending on work. If you have found a bug or have a suggestion, send e-mail to teb@affine.com. Please do not send "junk e-mail" to this account.

Hopefully this work will provide some answers to those developing code to export RIB files. It would be great to see more modeling packages support the RenderMan Standard and export good valid RIB files. Also hopefully, some folks will write some cool utilities that the rest of us can use.

I have tried to give credit to where credit is due. You'll find that each C file has a header that lists books, articles and e-mails that were referred to or provided inspiration in writing the code. Many books give a huge list of books and articles, the ones listed in the C code are the actual references that were used not just an endless list. One or two books are out of print, but are accessible through inter-library loans. You should still be able to assemble a good reference library based on the references listed.

Please follow the copyright rules given in the license file included in the Affine Toolkit.

How to Write Programs Using the Affine Toolkit

Several libraries are included for reading, altering, and writing RIB files. Some of the libraries simply provide different ways of packaging the code that provides the reading and writing functionality of the Affine Toolkit. To know which library is right for your tool and to see some examples using the Affine Toolkit refer to the following link: Developing Tools Using the Affine Toolkit.

For reading and writing various image formats refer to the section Reading and Writing Various 2D Image Formats. This section covers the functions that can be called for handling Alias's PIX, TIFF, TGA, Pixar's zfile and X Windows file formats.

Notices and Other Legal Stuff

Copyright (c) 1996, 1997, 1998 Thomas E. Burge. All rights reserved.

Affine is a trademark of Thomas E. Burge

THIS SOFTWARE IS DISTRIBUTED "AS-IS" WITHOUT WARRANTY OF ANY KIND AND WITHOUT ANY GUARANTEE OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

In no event shall Thomas E. Burge be liable for any indirect or consequential damages or loss of data resulting from use or performance of this software.

Permission is granted to include compiled versions of this code in noncommercially sold software provided the following copyrights and notices appear in all software and any related documentation:

The Affine Libraries and Tools are
Copyright (c) 1996, 1997, 1998 Thomas E. Burge
All rights reserved.

Also refer to any additional requirements presently required by Pixar in regards to the RenderMan (R) Interface Procedures and Protocol.

Those wishing to distribute this software commercially and those wishing to redistribute the source code must get written permission from the author, Thomas E. Burge.

Basically for now, I would like folks to get the source code directly from me rather than to have a bunch of different versions circulating about.

The RenderMan (R) Interface Procedures and Protocol are:
Copyright 1988, 1989, Pixar
All Rights Reserved

RenderMan (R) is a registered trademark of Pixar


[Affine Toolkit]
[RIB Utilities] [Bitmap Utilities] [Handy Little Utilities]
[Libraries] [Using the Libraries]