Setting Up Before you Render


Tgl Render Status

The Render menu provides tools for creating various types of 2D images from 3D scenes, as well as some output formats.

Hints and Tips

There have been a few questions about shadow maps and some of the optimization options available in the command line renderer.

RENDERING - Shadow Casting and Spotlights

The process of shadow casting in the renderer requires that each spotlight in the scene tessellate the visible geometry (from the spotlight's point of view) into triangles and vertices.

From this triangulated geometry the renderer will then cast rays into the spotlight's viewport to acquire z-depth information. The resolution of this array (which is set in the Resolution option found in the Multi-lister's Shadow Parameters Shadow Casting section) will determine the quality of the shadow AND the amount of memory used in the rendering.

This is when the options become important. If you type renderer -H in the shell window, you will get the command line usage of the renderer.

Rendering - No Options

By default, during an animation the system will perform this tessellation and shadow cast operation on EVERY frame of animation. This is working under the assumption that objects and lights may be animating in the scene. But what if only the camera moves and the geometry and models are static? It could mean that you're wasting a lot of time recalculating z-depth information on a static scene (from the spotlight's point of view).

If you execute a rendering in a shell window you will see the process of z-depth casting occurring on each frame. And with each frame you will probably notice that the frame time is fairly consistent with the next consecutive frames.

Rendering -With the -k option

When the -k option is used in the command line, the renderer will perform the z-depth once per spotlight at the first frame in the animation. For each following frame, the renderer simply uses the stored information that is in memory and avoids the triangulating step altogether.

You can also set the Depth Maps in Memory option interactively in the Miscellaneous section of the Render Globals window (Render Render globals).

In one particular test case, we were able to cut the rendering time in HALF for the second frame and all others to follow. Once again, this process is only useful if the spotlights see static objects. But there are other nifty tricks. Read on.

Rendering -With the -k1 option

The -K1 option can be specified in the interactive package. By setting the Spotlight Depth Maps to ON in the Miscellaneous section of the Render Globals window (Render Render globals), the renderer will use and create a depth map file for each shadowing spotlight in the scene. If a depth map file of the same name already exists in the depth directory, that depth map will be used.

Rendering -With the -K1 option

The -K1 option will write out and re-use shadow maps.The shadow maps will be written out in the order that the shadowing spotlights appear in the SDL file. They will be named the same name as the light.

Similar to the preceding example, this option performs the z-depth operation once and uses the stored data for the next frames. The difference is that it stores the z-depth arrays in onto the disk, and reads them in for each frame.

If you perform tests using this option you will notice a slight decrease in rendering performance compared to the -k1 option due to the overhead of disk usage. So why use this option? Well, you can save the depth information on disk and use it again in subsequent renders and avoid re-calculating the shadow information when doing successive rendering tests.

The depth_input option

By editing the SDL file and adding the depth_input directive, you can tell the renderer which disk file stores the depth information for each particular spotlight. For example,

light foo (type=spot, depth_input="depth/depth_map#2")
If you make a mistake in the order of the depth files and respective spotlights, you will get some pretty interesting results. There is also a depth_output directive with the same syntax that allows you to specify the name of the file you want to save the depthmap to. The output will be identical in format as the output automatically generated with the -K1 option except that you can control the naming of the depth files.

The depth_input directive can be enabled for each spotlight in the Multi-lister. If Use Depth Map is ON in the Shadow Casting section of the Multi-lister (Light Shadow Parameters Shadow Casting), a depth map (named the same as the light) will be generated and used.

Other usages for the depth files

One interesting application of depth maps involves substituting custom built depth maps into a spotlight for special effects. For example, it is possible to have an object (like a chair on a ground plane), cast a shadow of a lamp. A more elaborate example may be to have a series of spotlights lighting a city, and having limited sets of buildings appearing to the specific lights-limiting any possibility of multiple shadow sources bleeding into each other.

Or ... similar to texture mapping a lightsource, it is possible to expose geometry into the depth map that could serve as a kind of scrim.

Or ... this technique can be used to provide shadows for transparent objects (transparent object don't cast shadows in the renderer).

The shadow_output Option

Another option rarely mentioned is the shadow_output directive. By editing the SDL file and adding the shadow_output into the light description, a ALIAS RLE matte/mask file is generated from the z-depth information. For example,

light foo ( type = spot, shadow_output = "mask/depth.pix"
Since it is created from z-depth information it is possible to use these output images as bump or displacement maps. A simple example would be to retrieve a wire file of a face, then use a very narrow light to reduce the perspective of the exposure. Then take the shadow_output information from the spotlight and map it onto a coin.

Getting things to run faster with the Alias renderers

Memory problems

If memory is the bottleneck (for instance, swapping and paging constantly):

Batch Render speedups, common to all renderers

Specific Raytracing/Powertracing speedups

Specific Raycasting/Powercasting speedups

Try to make as many surfaces single-sided as possible (see Windows Render stats).

How to lower memory usage

To reduce the memory used by file textures, two things can be done:

  1. In the Multi-lister in the File Texture Parameters section, set the FILTER type to OFF. This avoids allocating extra memory when filtering for the texture map. However, this can produce aliasing artifacts.

  2. On the command line for the renderer, there is a -l option. The value specified after -l indicates the amount of TMPDIR disk space the renderer can use for file textures. This frees up some RAM for the renderer. (TMPDIR is the environment variable set to indicate the temporary disk space location.)




aliasdocs@aw.sgi.com
Copyright © 1997, Alias|Wavefront, a Silicon Graphics Company. All rights reserved.