Running Render

There are many switches, and a default value is provided for each one. See the description of the a1defaults mechanism for the general instructions on setting switches and flags.

To render an image into a compressed RLE image file, one can use the following:

render file1 file2 file3 > out.rle.Z &
Any options set by the user before invoking this command are automatically passed as defaults to the program.

The render program can be quite slow for images of complex models. If render is started as a background process (as indicated by the "ampersand" symbol in the example above), its progress can be checked periodically by running getx11, or one of the related RLE decoding programs even before the image is finished. This will not interfere with the successful completion of the picture.

Render Options

This section describes the meaning and use of the various switches for the render program. The options are divided into three major categories: switches that affect the shading, switches the control more general graphics utilities, and switches that affect the form of the output.

Shading Switches for Render

The following switches affect the shading and lighting which is applied as the image is being generated.
render.shader
(cornell) Selects the lighting model to be used. The other possible values are "cosine"and "blinn".
render.shademode
(normal) The render.shademode switch specifies the type of interpolation that is used across each polygon rendered. A value of "normal" chooses a linear interpolation of the polygon normal vectors, while "flat" chooses flat shading of each polygon. Finally, "smooth" uses shade interpolation to color the polygon. The special value "dynamic" sets up an image to be used with the shade program, writing normals to the output file rather than RGB values.
render.flip
(off) Reverse the orientation of all polygons. (This is not recommended -- it is far more desirable to fix the geometry.)
render.goodhilights
(off) The viewer (eye) is usually assumed to be at infinity which means that the vector from the object to the viewer is constant. This works in most cases; but problems can occur when objects are viewed close to edge-on. The render.goodhilights flag forces a vector to be computed from every pixel to a viewer at a finite distance. This gives better results but causes a considerable slowdown in computing the image.
render.whitehilight
(off) The highlights of the image can be colored in two ways: one is the color of the object, and the other is to color the highlights white. The render.whitehilight flag has no effect unless render.shademode is set to "normal" and render.shader is "cornell".
render.twolight
(on) The light sources, which are input parameters (see section Shading Parameters), can be interpreted as single sources of light in the given directions, or as double sources with light coming from two opposite directions. The double light sources, while not as realistic, are useful for getting the maximum amount of information from a single image, since no areas will face completely away from both lights.
render.transparency
(off) Transparent objects can be rendered by turning on this flag. Transparent rendering should be done with normal interpolation (render.shademode) and the cornell shading model (render.shader). Note that opacity values must be set for each surface in the data file (see section Shading Parameters).
render.vopacity
(off) The opacity of transparent objects can be held constant or can be varied according to the normal vectors to simulate light passing through more material near the silhouettes of the object. This is, of course, a more costly computation. The render.transparency option is automatically selected when the render.vopacity option is in effect.
render.pseudocolor
(off) Indicates that color interpolation is to be used across polygons (with no shading).
render.colorinterp
(off) Enable color interpolation for psuedocolor rendering.
The following is a possible transcription of a rendering session to illustrate the use of some of the shading options.
aset render.twolight off
aset render.whitehilight on
render vase.a1 > vase.rle

Graphic Utility Switches for Render

The following switches and flags control other graphics options associated with the rendering process.
render.imageresolution
(1.0) The default subdivision resolution for surfaces which do not have a resolution set individually. This value produces fairly high-quality images; higher values (say 5.0 to 20.0) produce coarser images.
render.background
(0,0,0) Objects can be rendered on a black background or a colored background. The value of render.background three integer numbers in the range 0--255 for the values of the red, green and blue channels. Setting a background color prohibits the use of the alpha output channel (render.alphaout).
render.perspective
(on) Normally, objects are rendered with a perspective projection applied. Turning off this switch will result in images with orthographic projection.
render.cull
(off) The render.cull option speeds up the rendering process by eliminating all back-facing polygons. If a scene is composed of only closed opaque surfaces, all back-facing polygons will be hidden and the render.cull option can be used without any change in the resulting image.
render.neatcorners
(off) When lines or curves are drawn with render, the program normally attempts to "miter" the corners between adjacent line segments. In some cases (where the line segments are very nearly parallel) this is undesirable, so the option is turned off by default. The effect will only be visible for relatively wide lines anyway.
render.quilt
(off) The render.quilt flag helps visualize the subdivision pattern that results from converting a B-spline surface into polygons. This option overrides the colors assigned the surfaces in the input files and assigns individual colors to each polygon by groups of four (i.e., there are four different colors). This results in a quilt-like pattern over the surface which clearly shows the subdivision pattern.
render.timenow
(0.0) Set the current time for rendering a frame of an animated sequence.
render.twoperflat
(off) Render usually makes four triangles from each (nearly) flat surface region produced by the subdivision. It is possible to specify that only two polygons be formed, although this may result in shading that is not as smooth as usual.
render.dsurf
(off)
render.split
(off)
render.spltrace
(off)
render.edgetrace
(off)
render.scantrace
(off)
render.objtrace
(off)
render.adj
(off)

Output Switches for Render

The only form for the output of render is the run-length-encoded (RLE) file. This is a device independent format that can be used with various displays, as well as with an assortment of other programs for manipulating RLE files, as part of the Utah Raster Toolkit. The Utah Raster Toolkit is distributed with Alpha_1 and documentation is included in a separate section of the (hardcopy) manuals. The image can be checked while it is being computed without any harm to the on-going render process. While redirecting the output of render to a file is required, the use of pipes for render output is not generally recommended. It is better to create the RLE file and use that as the basis for further display or computation.

The following set of flags control other output options of render.

render.pixwidth
(512) Set the X resolution for the resulting image.
render.pixheight
(512) Set the Y resolution for the resulting image.
render.aspect
(1.0) Set the aspect ratio. This is determined by the monitor on which the image will be displayed. Most modern displays have a "square" aspect ratio, meaning that the length of a horizontal line 10 pixels long is the same as the length of a vertical line 10 pixels long. Unfortunately, this is not true with most older monitors, and so the distortion must be compensated for in the software before display.
render.usealpha
(off) Render image with a-buffer filtering at each pixel. This is fairly sophisticated filter and generally takes comparable time. Usually, render.alphaout is also selected.
render.alphaout
(on) Render will output red, green, blue, and alpha channels to the RLE file. The alpha channel represents the percentage of coverage for each pixel. This channel is necessary for compositing images together, but may not be desired for a test render, because the RLE will be slightly larger with alpha. When using render.transparency, it is a good idea to have alpha output, because the image can be composited over other images nicely. Background colors should not be set (render.background) when using the alpha channel output.
render.zout
(off) Turns on "Z output mode" in render. The scanline Z buffer values are placed in the output RLE file, with the high byte of the 16-bit Z value in channel 0 and the low byte in channel 1. Render puts out zeros in the third channel, to make it easy to use image tools expecting RGB images. (Other programs use the third channel of Z-RLE files for their own scalar data, such as NC tool deflection or gouge depth.)
render.minzbuf
(off) Inverts the sense of the Z comparison in the scanline Z buffer. The "bottom" surface is emitted, rather than the "top" surface. One place this is used is in generating tool images for NC simulation, where the surface of interest is at the tip of the tool solid, rather than the end closest to the viewer.
render.visual
(direct24) Type of output from the rendering program. Other possible values are "pseudo8" and "grey8".
render.outputname
(stdout) Specifies the name of the file for the ray rendered output. If you forget to specify a file, the output will end up going to stdout unless you redirect the output to a file (i.e. render mat.a1 file.a1 > file.rle.Z). The output file is an RLE file.
render.backcolor
(on)

Shading Parameters

This section discusses the input parameters to the render program that affect the shading process. These include light sources, surface qualities, and textures.

In most cases, appropriate render switches must be set in order for the shading parameters to be used. These switches are mentioned here but are described in detail in the section on render options

The following, however, are attributes that can (but need not) be specific to a given surface:

"color"
The color (in red, green, blue coordinates from 0 to 255) of an object. The default if none is specified is a dull grey.
"back_color"
The color of the "back" side of an object (recall that all surfaces and polygons are oriented). The default if none is specified is a hot pink. (It is intended as a diagnostic tool for getting surface orientation correct.)
"surface_quality"
The surface quality of an object. This includes the specular and diffuse components, transparency, refaction index, and so forth, of the object.
"texture"
Texture file name (ray only). RLE files can be used to specify textures on objects. If the RLE file has only one channel (black and white) the color attribute of the object is used. If the RLE file has three channels (color) the color of the texture is used.
"image_resolution"
The value used for deciding whether enough surface subdivision has been done to approximate the surface by polygons. The default value is 1.0, which is (very) roughly a measurement of straightness in screen space. This value produces images that look very good, and it should probably never be set lower than 1.0. For rougher images, values between 5.0 and 8.0 are normal, and for extremely coarse images, values up to 20.0 are reasonable.
"width"
If rendering polylines, the width parameter says how wide to make them. The default is 1.0, meaning one pixel wide lines.

Lighting

Light sources are specified as three dimensional points in space. In render, light sources are considered to be at infinity in the direction of the vector pointing to the given position of the light source. Thus, the vector from the object to the light source becomes a constant. This greatly decreases the amount of computation involved. Up to five light sources may be specified in the input.

The light sources are interpreted in one of two ways by the render program. The render.twolight option to the render program treats the light sources as double light sources with the second source in the opposite direction of the specified light source. Turning off render.twolight treats the light sources as single sources.

Light sources are specified using the lightSource command in c_shape_edit.

If no light source is found in the input a default vector of (1,1,1) is used which is above, to the right and behind the viewer (that is, back over your right shoulder).

Surface Qualities

The first control of the reflectance model is the percentage of contribution that each type of reflection makes to the total reflection. For example, the specular reflection is a large percentage of the total reflection for a metallic surface. These values, as well as some additional optical characteristics, are specified using the using the surfaceQuality command in shape_edit. The fields of interest to the render program are the color, the index of refraction, the specular component, the diffuse component, and the transmit field.

In order to attach a given surface quality to an object, the "surface_quality" attribute of the object can be set to the name of the surface quality. For example,

Dull = surfaceQuality( 1.2, 0.0, 0.96, 0.0, 0.0, 1.0, 0.0 );
setAttr( Object, "surface_quality", Dull );
If an object has no surface_quality attribute, it is given a default flat white surface quality.

Rendering Animated Objects

An Alpha_1 data file with animated data can be rendered or raytraced as usual. The render.timenow defaults flag in render and ray specifies the time at which the picture is made. The raytracer has additional defaults flags which make it possible to produce motion-blurred pictures.

Ray-Tracing Options

This section describes the meaning and use of the various switches for the ray program. The options are divided into three major categories: switches that affect the shading, switches the control more general graphics utilities, and switches that affect the form of the output.

Shading Switches for Ray

The following switches affect the shading and lighting which is applied as the image is being generated.
ray.ambient_light
(0.2) Specify the level of ambient light in the scene.
ray.max_depth
(4) Maximum recursion depth for the ray tracer. (The maximum number of bounces a ray of light may take). Smaller values will run faster, but might not look as realistic because the light may only bounce a few times and might not create good highlights and shadows.
ray.max_atten
(1000.0) Maximum distance for attenuation. Used for cheap 'fog' effects. Uses simple distance check to check if attenuation is on.
ray.min_atten
(1000.0) Minimum distance for attenuation. Used for cheap 'fog' effects. Uses simple distance check to check if attenuation is on. Should be < 5.0 or so to work very well.
ray.shadow_eps
(0.0001) Shadow epsilon. Self-intersection tolerance, determines if a polygon is being occluded by another polygon which is 'too close' to really be occluding it. Standard ray tracers use a fixed epsilon, we decided to add some user control over it.

Graphic Utility Switches for Ray

The following switches and flags control other graphics options associated with the ray-tracing process.
ray.filterwidth
(1.0) The width of the sampling area in pixel units. A sampling width of 1.0 (the default) places the samples evenly over the pixel. A width of 2.0 places the samples over an area ranging from the centers of the adjoining pixels. Values much larger than 2.0 will cause the image to blur.
ray.threshlines
(1) Specifies number of lines used by the pixel thresher. Ray keeps a buffer with the specified number of scanlines of previously rendered pixels. When adjacent pixels are different, ray uses super-sampling on these pixels to try and find more detail. If this causes the pixel values to change, it compares other pixels --- including those in previous scanlines --- to look for more possible changes. The ray.thresh switch allows you to specify how many scanlines it searches back. The default is one lines; more may be needed if small, isolated details are present in the image.
ray.jitter
(off) Enables spatial jittering. This is useful for penumbras and diffuse reflections to avoid contouring. The results from jittering are usually rather distracting unless a large number of samples are taken. Note: Jittering in the time domain is controlled by the frames program, not by ray (see the section on motion blur below).
ray.subsamplegrid
(5) Specifies the per-pixel sampling grid size. A grid size of N performs N-squared samples per pixel.
ray.timenow
(0.0) Set the current time for ray-tracing a frame from an animated sequence.
ray.rlepixmax
(1.0) Set the exponent (maximum pixel value) for the output. The RLE file produced is a normal one rather than the default in "exponential" format.
ray.motion_blur
(off) Turns motion blurring on.
ray.blur_interval
(1.0) The length of time over which to blur the picture. The ray.timenow flag should be set to the time at the end of the blur interval.
ray.blur_samples
(1) Motion blurring is performed over the subsample grid. Additional subsampling is specified with this flag. It usually does not need to be changed.
ray.blur_jitter
(off) By default, rays are distributed uniformly in time over the blur interval. This flag specifies a random distribution of rays in time.

Output Switches for Ray

The output ray generates is normally an RLE image stored in "exponential" format. These files contain a fifth channel to store the exponent for the red, green and blue channels. This expands the dynamic range of the possible pixel values. The unexp program converts this exponential file to a straight RLE file. This program is part of the Utah Raster Toolkit, so refer to the documentation (at the back of this manual) for a full description.

The following set of flags control other output options of ray.

ray.outputname
(stdout) Specifies the name of the file for the ray traced output. If you forget to specify a file, the output will end up going to stdout unless you redirect the output to a file (i.e. ray mat.a1 file.a1 > file.exp). The file is an RLE file, but it is in "exponential" format. This format stores an extra fifth channel (in addition to R, G, B and coverage) containing an "exponent" for the red, green and blue values. This allows a larger dynamic range. Conversion from the ".exp" file to a normal RLE file is done with unexp (see the Raster Toolkit documentation at the end of this manual). Output from ray always has a proper coverage channel.
ray.rleformat
(off) If on, the output will be in straight RLE rather than exponential format. The ray.rlepixmax value should be set appropriately whenever this is turned on.
ray.talkative
(off) When this is on, ray generates log messages to stderr showing its progress. (See below for more details.)
ray.filtering
(off) Enable filtering. Without this flag, no filtering or pixel threshing is done. You must specify ray.filtering in order to use ray.jitter, ray.thresh, ray.gauss, ray.grid, or ray.sample.
ray.gauss
(off) Use a gaussian filter instead of a box filter. This is most useful when a very high quality image is made with a large number of samples. The "bell curve" of the gaussian is 2.0 pixels wide, ranging from the centers of the adjacent pixels. It helps reduce "roping" effects on nearly horizontal or vertical edges. For best results, the sampling width (ray.sample) should be about 1.5 to 2.0.
ray.aspect_ratio
(1.0) Sets the aspect ratio (width vs. height) of the pixels, as for the render program.
ray.rastersize_x
(512) Sets the raster size in x for the image (number of pixels wide).
ray.rastersize_y
(512) Sets the raster size in y for the image (number of pixels high).
ray.startx
(0) Specifies the starting x coordinate for the image (so that the processing of a single image can be divided among various ray processes, presumably on different machines).
ray.endx
(511) Specifies the ending x coordinate for the image.
ray.starty
(0) Specifies the starting scanline for the image.
ray.endy
(511) Specifies the ending scanline for the image.
ray.renaissance
(off) Translates output of an Alpha-1 model into a renaissance model for use in the renaissance rendering system.

Alpha_1 User's Manual Home Page
Alpha_1 User's Manual. Version 98.01.
Copyright © 1998, University of Utah
a1-web@gr.cs.utah.edu