Reuse (FG and GI Caching) Rollout (mental ray Renderer)
 
 
 
Command entry:Render Setup dialog Indirect Illumination panel Caustics and Global Illumination rollout
NoteThe Indirect Illumination panel appears only when the mental ray renderer is the active renderer.

The Reuse rollout gathers together all controls for generating and using final gather map (FGM) and photon map (PMAP) files, and adds the ability to reduce or eliminate flickering in rendered animations by interpolating among final gather map files.

Calculating final gather and photon map solutions often requires extensive calculation, so, when appropriate, caching the solutions as separate files can save a great deal of rendering time, especially when re-rendering an animation after, for example, adjusting the camera. Using cached solutions can also save time when rendering over a network; you can generate the cache files once, and then make them accessible to all machines on the network so they can dedicate themselves to the work of simply rendering the frames.

For FGM files, you can choose to accumulate all final gather map points into a single file, or generate separate files for individual animation frames. With the latter method, you can then reduce animation flicker by interpolating among the map files when rendering.

Procedures

To generate and then use a final gather solution when rendering a still image or walkthrough animation:

This method uses a single final gather map file and is best for when objects don’t move in the scene.

  1. On the Reuse rollout, set Mode to Single File Only.
  2. Set the Final Gather Map method to Incrementally Add FG Points To Map Files.

    This automatically sets the default file name and path. You can use those, or change them by clicking the [...] (browse) button next to the file name field.

  3. Click Generate Final Gather Map File Now.

    3ds Max calculates the final gather solution for all frames and saves it to the specified file.

  4. Set the Final Gather Map method to Read FG Points Only From Existing Map Files, and then render the scene.

    Now, as long as you don’t change the lighting or move objects in the scene, you can re-render as many times as you like without having to recalculate the final gather solution, thus saving a significant amount of rendering time.

To generate and then use a final gather solution when rendering an animation with moving objects:

This method uses multiple final gather map files and is best for when objects in the scene move during the animation. You can minimize final gather flickering by interpolating among the final gather solutions.

When rendering an animation that contains both a moving camera and moving objects/lights, a special option is available for projecting final-gather points from regular intervals along the camera path; see step 1.

  1. If the camera does not move during the animation, skip to step 2. However, if the camera moves through the scene during the animation, on the Final Gather rollout, choose Project Points from Positions Along Camera Path and set Divide Camera Path by Num. Segments to an appropriate value, based on the length of the camera path. Also, if you're using a large number of segments, increase the Initial FG Point Density setting.
  2. On the Reuse rollout, set Mode to One File Per Frame.
  3. Set the Final Gather Map method to Incrementally Add FG Points To Map Files.

    This automatically sets the default file name and path. You can use those, or change them by clicking the [...] (browse) button next to the file name field.

  4. Click Generate Final Gather Map File Now.

    3ds Max calculates the final gather solution for each frame and saves it in a separate numbered file (for example: temp0000.fgm, temp0001.fgm, and so on).

  5. Set the Final Gather Map method to Read FG Points Only From Existing Map Files.
  6. To reduce final-gather flicker, set a value greater than 0 for Interpolate Over N Frames.

    This value determines the number of frames before and after the current frame over which the interpolation occurs. For example, the interpolation for frame 5 with Interpolate=2 uses the cached final gather solutions for frames 3 to 7, inclusive.

    The higher the Interpolate value, the greater the flicker reduction. However, if objects and/or lights move very quickly during the animation, a high interpolation value can reduce the accuracy of the final gather solution.

  7. Render the animation.

    Now, as long as you don’t change the lighting or the way objects move in the scene, you can re-render as many times as you like without having to recalculate the final gather solution, thus saving a significant amount of rendering time.

Interface

Mode

Choose the method by which 3ds Max generates the cache files. The choices are:

  • Single File Only (Best for Walkthrough and Stills)Creates one FGM file that contains all final gather map points, whether you use Generate Final Gather Map File Now or the accompanying drop-down that lets you generate every Nth frame within the current range. Use this method when rendering a still image, or an animation in which only the camera moves.

    Typically the single FGM file generated with this method is significantly larger than the files created with the One File Per Frame method (see following).

  • One File Per Frame (Best for Animated Objects)Creates a separate FGM file for each animation frame. Use this method when objects in the scene move around during the animation, which can cause the final-gather solution to vary from frame to frame.

    For best results with this method, generate the FGM files first, then, before rendering, choose the Read FG Points Only ... option and specify an interpolation value.

Calculate FG/GI and Skip Final Rendering

When on and you render the scene, mental ray calculates final gather and global illumination solutions when render the scene, but does not perform the actual rendering.

This saves FGM files only if the Final Gather Map Incrementally Add FG Points ... option is active, and PMAP files only if the Caustics And Global Illumination Photon Map Read/Write Photons option is active.

Alternatively, use the respective Generate ... Map File Now buttons.

Final Gather Map group

[method]

Choose the method for generating and/or using final gather map files:

  • OffRendering with Enable Final Gather does not generate final gather map files.
  • Incrementally Add FG Points to Map FilesCreates cache files as necessary when rendering or generating FGM files. Uses data from existing files and updates them as necessary with new final-gather points generated while rendering.
  • Read FG Points Only from Existing Map FilesUses final gather data previously saved in FGM files for rendering without generating any new data. To create the FGM files, use Generate Final Gather Map Nowor the drop-down list next to it ().
    NoteIf any final gather map files are unavailable when you render using this method, the software issues warnings via the mental ray Messages window, but proceeds with the rendering.

    This setting is available on the Rendered Frame Window as Reuse Lock Final Gather.

    To reduce or eliminate final-gather flickering in rendered animations, use this method with the interpolation option (see following).

NoteIf you choose the Incrementally Add FG Points To Map File or Read FG Points Only From Existing Map Files option or turn on Rendered Frame Window Reuse group Final Gather without first generating final gather map files, the software specifies the default map-file base name temp.fgm in the \sceneassets\renderassets\ path in the current project folder. You can change the path and file name by clicking the Browse [...] button to the left of the file name field.
Interpolate Over N Frames

The number of FGM files before and after the current frame to use for interpolation. Use this with the Read FG Points Only ... method (see preceding).

For example, if this setting is 2, then mental ray uses for the current frame the average of the final gather solutions from five final gather map files: the two frames preceding the current frame, the current frame, and the two frames following the current frame.

TipWhen preparing for rendering using interpolation of FGM files, keep the required frame range in mind. For example, if you use the default Interpolate Over N Frames value of 2, and start rendering at frame 0, for best results you’ll need FGM files starting at -2. So before you generate the FGM files, set the start of the output frame range to -2, and then set it back to 0 for rendering.
... [Browse]

Click to display a file selector dialog, which lets you specify a name for the final gather map (FGM) file, and the folder where it is saved.

If Final Gather Map is set to Off (Do Not Cache Map to Disk), specifying a map file name automatically chooses the Incrementally Add FG Points To Map Files option.

[file name]

After you specify a final gather map file using the browse control (see preceding), the name field displays its name and path.

If no file name is currently specified, the software fills in this field automatically with the default path and the file name temp.fgm when you choose the Incrementally Add FG Points To Map File or Read FG Points Only From Existing Map Files option (see preceding), or by turning on the Rendered Frame Window Reuse group Final Gather check box.

Delete File

Click to delete the current FGM file(s). If no files exist, you’re notified; if files do exist, you’re prompted to confirm the deletion.

Generate Final Gather Map Now

Processes the final gather pass for all animation frames (as specified in the Common Parameters rollout Time Output group). Generates the maps to the specified file without rendering the scene. Available only when the method is set to Incrementally Add FG Points to Map Files or Read FG Points Only from Existing Map FilesU.

If Mode is set to Single File Only, mental ray saves all final gather points to the same file. If Mode is set to One File Per Frame, however, clicking this button generates a separate FGM file for each animation frame.

TipTo generate, instead, a single frame or a noncontinuous range of FGM files at regular intervals, click the button next to this button (see following).

To reduce flicker when rendering an animation, use this function first to generate a separate final gather map file for each frame, choose Read FG Points Only from Existing Map Files, and specify an interpolation amount greater than 0 before rendering.

[drop-down list]

This drop-down list offers a choice of frame ranges to use for generating final gather maps without rendering. Choosing an item from the list begins the map-generation process immediately.

The choices are as follows:

  • The active frame output setting, reflected from the Common Parameters rollout Time Output group choice. For example: Frame 0 to 100; Frames: 1,3,5-12.
  • Current Frame: Generates one frame only
  • [The active time segment] Every N Frame(s), where N can be 1, 3, 5, 10, or 20.

    For example, if the active time segment is 0 to 100 (the default), and you choose Every 5 Frame(s), the output is [file name]000.fgm, [file name]005.fgm, [file name]010.fgm, ... [file name]100.fgm.

    This option is most useful when Mode is set to Single File Only, for example, to bake every fifth frame into one file. Alternatively, you can use it to generate FGM files for interpolating final gather solutions in an animation, but the scene doesn’t change very much throughout the animation.

Caustics and Global Illumination Map group

These controls tell mental ray how to calculate and use photon map files for indirect illumination. These controls are available only if Caustics or Global Illumination is enabled on the Caustics and Global Illumination Rollout (mental ray Renderer).

NoteIf you've specified a photon map here, mental ray continues to use that map instead of generating a new one. To cause the photon map file to be rebuilt, delete the existing file.
[method]

Choose the method for generating caustics and photon map files:

  • Off (Do not Cache Map to Disk)Photon maps are calculated as necessary while rendering; cached maps are not written or read.
  • Read/Write FileIf the specified (photon map (PMAP) file does not yet exist, mental ray generates a new map file when rendering. If the specified file does exist, mental ray loads and uses the file.

    Before using this option, click Browse (“...”) and provide a name for the PMAP file.

  • Read Photons Only from Existing Map FilesUses cached photon maps from a PMAP file while rendering. No calculation of photon maps takes place.

    Before using this option, click Browse (“...”) and provide a name for the PMAP file.

... [browse]

Click to display a file selector dialog, which lets you specify a name and path for the photon map (PMAP) file. This automatically turns on Read/Write File.

[file name]

After you use the [...] button to specify a photon map file, this field displays its name and path.

Delete File

Click to delete the current PMAP file.

Generate Photon Map Now

Processes the photon-mapping pass for all animation frames (as specified in the Common Parameters rollout Time Output group). Generates the photon maps to the specified file without rendering the scene. To reduce flicker when rendering an animation with a networked render farm, use this function first to generate the GI solution for all frames, and then make sure Read/Write File or Read Photons Only from Existing Map Files (see preceding) is on before rendering.

See Also