Finalgather Map Copy: fg_copy

The finalgather map copying and merging utility fg_copy is started as

   fg_copy [options] infile1 infileN outfile

It reads finalgather map files infile* created with finalgather file statements in the options block in the .mi scene file, and merges them into a single finalgather file outfile. Each file is a collection of finalgather points that represent the irradiance at a specific 3D coordinate.

Optionally, only points in a given region are considered and written. Points that are very close and have similar orientation can optionally be merged to eliminate redundancy and reduce the size of the generated map.

This tool is helpful when rendering animations. Flickering is reduced with moderate computational effort if several key frames are rendered with final gathering saved to files. The -finalgather only command-line of mental ray option allows rendering these files quickly without rendering color images. When all the finalgather map files for the key frames are finished, the fg_copy tool can combine them into a single finalgather map file that can be used for beauty-rendering the entire animation. (This does not work for detail shadowmaps files.)

This method works well with render farms, where different hosts create finalgather maps for different frames simultaneously.

If the same file is specified several times as an input file, its points appear multiple times in the output map. If point merging is enabled, the points are not duplicated but their importance weights are adjusted.

The following options are supported:


Print a brief option summary.

-f F

Merge finalgather points with similar normals within distance F into a single one. The value of F is related to the minimum radius of the finalgather accuracy statement in the .mi scene file. All finalgather points are tested against all other finalgather points regardless of which file they came from. In particular, fg_copy can be used to reduce the redundancy and size of a single input file.

-b xmin ymin zmin xmax ymax zmax

Select and copy finalgather points within the specified voxel only. This may be used for reducing the finalgather map size if only a part of the scene is required.

-B xmin ymin zmin xmax ymax zmax3.5

Select and copy finalgather points outside of the specified voxel only. Using fg_copy utility twice with -B and -b options allows splitting a finalgather file.


Verbose output prints messages showing what fg_copy is doing, and a version banner.

Note that the finalgather file statement in the options block of the .mi scene file also allows specifying multiple finalgather map files, enclosed in angle brackets, which will be merged at render time. Using fg_copy to precompute a merged map for a list of keyframes for the entire animation is more efficient.

Copyright © 1986-2011 by mental images GmbH