Siren is run from a DOS command shell. For this tutorial we will use the mechtoy.rib file included with the distribution of Siren.
Change directories to the directory containing mechtoy.rib
When first started, Siren will look for the file Siren.rib in both its
home directory (defined by the SIRENHOME environment variable) and in the
current directory, and parse those files if present. You can use
these files to set default options and attributes. You will probably
at least want to set a default resolution and to specify pathes for textures,
shaders, and rib archive files. This tutorial relies on the settings
in Siren.rib which we will selectively override.
To begin type:
Siren mechtoy.ribYou should see a low-resolution (320x200 pixel) 256-color image of a simple mechanical toy. After the image is drawn, pressing W will save it to a file named "Siren.tif"
Depending on your video card, you may be able to render higher resolution pictures. Try:
Siren -res 640 480 mechtoy.ribYou should see a finer-grain image. Siren can render "true color" 24-bit images on displays that support those video modes using the -tc option. Try:
Siren -tc -res 640 480 mechtoy.ribYou can use the -samples option to set the number of pixel samples. For example:
Siren -res 640 480 -samples 2 2 mechtoy.ribSiren will also accept any RIB statement enclosed in quotes. You can use this feature to set options not provided among the command line options. Example:
Siren -res 640 480 -samples 2 2 "PixelFilter gaussian 2 2" mechtoy.ribSiren provides ray-traced shadows via an option switch. The -shadows option turns ray-traced shadows on:
Siren -shadows mechtoy.rib
Siren -anim 20 -phong 0 mechtoy.ribYou should see 20 frames of animation rapidly drawn in succession. On a fast machine the rendering should be in real time.
The -phong option sets the limits for phong shading, with 0 disabling shading on a per-pixel basis. This produces flat-shaded or Gouraud-shaded polygons which render more quickly. Try the above line without -phong 0 for a comparison.
Using the -loops option you can cause the animation to loop:
Siren -anim 20 -loops 2 -phong 0 mechtoy.ribYou can also animate in higher resolutions::
Siren -anim 20 -phong 0 -res 640 480 mechtoy.ribA sequence of frames can be recorded as a FLI animation file. The following line will make a 20 frame flic:
Siren -anim 20 -file mechtoy.fli mechtoy.ribYou can press the spacebar at any time to interrupt rendering.
The -frames option restricts the range of frames that are rendered.
Siren -anim 20 -frames 0 9 mechtoy.ribwill render only the first 10 frames of the animation.
You can also easily render a sequence of still frames. Siren supports wildcard expansion of the display filename. #f is replaced with the current frame number. So:
Siren -anim 20 -file m#f.tif mechtoy.ribwill produce 20 image files named m001.tif, m002.tif, etc.
(Note for BMRT users: The limbo.rib file included as an example with BMRT animates just dandily. Remember to compile the shaders first!)
Siren "Shutter .4 .42" mechtoy.ribwill produce a single blurred frame.
To animate with motion blur, use the extended form of the -anim switch, which is:
-anim nframes starttime endtime fractionshutteropennframes is the number of frames to create, starttime and endtime are the starting and ending time for the series of shutter times, and fractionshutteropen is the fraction of time between frames the shutter is open. Try:
Siren -anim 20 0 1 .5 -phong 0 mechtoy.rib
Siren -strips 2 "depthoffield 8 2 7" mechtoy.ribDepth of field also works with animation, motion blur, and flat and Gouraud shading:
Siren -anim 20 0 1 .5 -phong 0 -strips 2 "DepthOfField 9 2 7" mechtoy.ribThat's it for the introduction.
Keep in mind that resolution, pixel samples, and motion samples were all kept to a minimum for this tutorial. Higher-quality images can be produced by increasing any or all of these parameters.
Good luck, and have fun!
Send questions, comments, and bug reports to: jiverson782@earthlink.net