How to use the UHD Cache for animations and stills in Corona for 3ds Max?

Old youtube tutorial (Corona 1.4): QUICK TIP: Saving the UHD Cache


Traditionally, users had to choose to either use unbiased algorithms without any caching and wait long time for all renders, or use biased caching algorithms, and deal with splotches, missing shadows, and sensitive input parameters. Corona merges the best of both worlds. Its cached solution, called “UHD Cache”, is significantly faster than plain path tracing, but does not suffer from artifacts, missing contact shadows, or complicated UI controls.

 

See also: How to fix flickering in animations?

 

What is the UHD Cache?

The UHD Cache is a secondary global illumination solver. Corona lets you combine two different GI solvers in order to render scenes efficiently and with high quality - path tracing as the primary GI solver and the UHD or 4K Cache as the secondary GI solver. 

 

1. Path Tracing - an unbiased solution - it should always be used as the primary GI solver. As a secondary GI solver, it is useful mainly in exterior scenes, where the cached solutions would require longer precomputation times and wouldn't be able to improve the rendering speed. 

 

 

2. UHD Cache - a slightly biased, cached solution, which speeds up rendering - should be used (but doesn't have to) as the secondary GI solver in scenes where GI is dominant (e.g. interiors, scenes with many light bounces). In such scenarios it greatly improves the render speed at the cost of subtle bias.

 

The UHD Cache may be used for both still images and animations, even with moving geometry or light sources. However, it is usually required to use UHD Cache settings adequate to the current scenario.

 

Note: without getting too technical, we can assume that the UHD Cache is not camera-dependent and that is is always generated for the whole scene. This means that if you are rendering a fly-through animation with no moving objects or lights, it is fine to render the cache only once for the whole scene, without having to repeat the cache rendering for small areas separated from each other, such as multiple rooms in a large house. 

 

 

What are the different precomputation modes? 

1. Calculate from scratch - when using this mode, the cache will be always calculated independently for each frame, and either discarded after the rendering stops, or saved, depending on the "After render" setting. The single saved cache file can then be re-used.

 

Note: when using the "Calculate from scratch" mode, only one file will be saved, containing information about the lighting calculated based on a single frame. In this mode, you cannot collect lighting information from multiple frames of the animation and merge them. Considering that, it makes sense to calculate this file only once and it does not make sense to calculate it for multiple frames. In case of using "Calculate from scratch" mode and rendering multiple frames, the cache file will be calculated from scratch and overwritten every time a new frame is rendered. 

 

Typical use cases:

  • Rendering a single, static image:
    • Calculate from scratch + Discard
  • Rendering a fly-through animation with no moving objects or lights:
    • Calculate from scratch + Save to file (render one frame of the animation only and reuse the resulting cache file for all other frames)
    • Then switch to "Load from file" (see below) and render the whole animation

 

 

2. Load from file - this will load a previously saved cache file specified in the "Filename" field. No precomputation will be done. If the file is not found - a new one will be computed from scratch, and a notification will appear. 

 

Note: when rendering a sequence, the single cache file will be loaded and used for the whole sequence. The cache file may contain information about only a single frame (if Calculate from scratch + Save to file combination was used) or it may contain information about multiple frames (if Try to load + append option is used). 

 

Typical use cases:

  • Rendering a fly-through animation with objects or lights which are moving just a little bit (e.g. a curtain on the wind)
    • Use the Try to load + append option and render every n-th frame (for example every 30th frame of the animation). Then switch to Load from file mode and render the whole sequence. The cache file will contain information from multiple frames (because the Try to load + append mode was used to generate it) and Corona will smartly use the available data for all animation frames. This can save time when rendering long animations since the cache does not have to be calculated from scratch for every frame. 
  • Rendering a fly-through animation with no moving objects or lights:
    • Calculate from scratch + Save to file (render one frame of the animation only and reuse the resulting cache file for all other frames)
    • Then switch to "Load from file" (see below) and render the whole animation
  • This option can be used for static images to save the UHD Cache calculation time, for example when re-rendering, if the cache file is already calculated and saved, but this is not a common scenario.  

 

3. Try to load + append - this will first load a previously saved cache file specified in the "Filename" field and then the precomputation pass will run on top of it. The loaded and computed caches will be merged. If the file to load is not found - the precomputation will begin anyway. 

 

Note: this mode stores information about multiple frames inside a single cache file. It does not generate multiple cache files. 

 

Typical use case:

  • Rendering a fly-through animation with objects or lights which are moving just a little bit (e.g. a curtain on the wind)
    • Use the Try to load + append option and render every n-th frame (for example every 30th frame of the animation). Then switch to Load from file mode and render the whole sequence. The cache file will contain information from multiple frames (because the Try to load + append mode was used to generate it) and Corona will smartly use the available data for all animation frames. This can save time when rendering long animations since the cache does not have to be calculated from scratch for every frame. 

 

 

Which UHD Cache precomputation settings should I use?

For still images:

You should use the default settings. Generally, "splotches" should not appear when using the UHD Cache. If you encounter them, they should be considered a bug and reported to us along with the problematic scene. 

See: 

 

 

 

For animations:

1. Camera fly-through, without any moving lights or objects:

Always use the "Animation (flicker-free)" preset. If you want to save the time required for precomputation of each frame, you can render the UHD Cache for one frame from the middle of the animation and then re-use it for all the other frames. You can also use combination of "Try to Load + Append" and "Save to file" options to render the cache incrementally. This should be done for several frames of the animation. For example for 400-frames animation, you can set 3ds Max to render every 50th frame to render the UHD Cache only for 8 frames.

 

Step-by-step:

  • Rendering a fly-through without any moving lights or objects:
    • Go to the middle of your animation (e.g. frame 50 in case of a 100-frame sequence)
    • Enable "Animation (flicker-free)" preset
    • Set Precomputation to "Calculate from scratch" and After render to "Save to file"
    • Specify the path to save your cache file
    • Set your rendering to 1 second only (see: How to set limit for rendering?)
    • Set your rendering to render only 1 frame (not a sequence)
    • Render - this will render your image for only 1 second so almost no actual rendering will be done, but the cache file will be calculated and saved
    • Set Precomputation to "Load from file"
    • Set your desired render limit (for example 5 minutes per frame, 100 passes, or 2% noise limit)
    • Set your rendering to full sequence
    • Render
    • Your full sequence will be rendered using the cache file generated from a single frame. The same cache will be used for every frame of the animation. 

 

2. With moving lights/objects: 

Using the "Animation (flicker-free)" preset and calculating UHD Cache from scratch for each frame is the safest solution. However, you may try using the precomputed UHD Cache solution, as it may also perform well in some scenarios.

 

Step-by-step:

  • Rendering an animation with lights or objects moving quickly and frequently:
    • Enable "Animation (flicker-free)" preset
    • Set Precomputation to "Calculate from scratch" and After render to "Discard"
    • Set your desired render limit (for example 5 minutes per frame, 100 passes, or 2% noise limit; see: How to set limit for rendering?)
    • Set your rendering to full sequence
    • Render
    • Corona will calculate a new cache file for each frame of your animation that starts rendering
  • Rendering an animation where the lights or objects are moving just a little bit, or slowly:
    • Enable "Animation (flicker-free)" preset
    • Set Precomputation to "Try to load + append" and After render to "Save to file" 
    • Specify the path to save your cache file
    • Set your rendering to 1 second only (see: How to set limit for rendering?)
    • Go to the first frame of your animation (e.g. frame 0)
    • Set your host application to render every n-th frame
      • for example, in case of a 400-frames animation, you can set it to render every 50th frame to render the UHD Cache only for 8 frames
      • the specific n-th frame number depends on the length of the animation and the pace at which the objects are moving - this requires a trial and error approach
      • the more frames are rendered, the better the quality of the cache will be
    • Render - this will render n-th frame for only 1 second so almost no actual rendering will be done, but each time new data will be calculated and added to the existing cache 
    • Once the process of calculating the cache for all frames is done, set Precomputation to "Load from file"
    • Set your desired render limit (for example 5 minutes per frame, 100 passes, or 2% noise limit)
    • Set your rendering to full sequence and disable the option to render every n-th frame (be sure to render all frames)
    • Render
    • Your full sequence will be rendered using the cache file generated from multiple frames. Corona will smartly use all available data. 

 

Troubleshooting

Q: How to render cache only, without rendering the actual image?

A: To emulate the "do not render final image" option, set "time limit" to 1 second in Render Setup > Scene > General Settings > Progressive rendering limits. 

 

 

 

Q: How to create a cache file for an animation that will be rendered on a render farm? 

A: Save the cache file in a location accessible for the render nodes using "calculate from scratch" + "After render: Save to file" option. Then use the "load from file" precomputation mode. The cache file can be treated like any other asset (e.g. proxies, textures). 


uhd-network.jpg
 

 

Q: My UHD Cache calculation is very slow!

A: Make sure that your Precision value is set to the default value of 1. Setting it to a higher value may result in much slower calculation without any benefit. If you are sure that the precision is set to 1 and there is still some problem such as splotches or flickering, please contact us

 

 

Examples

1. Image rendered with Path Tracing as primary and UHD Cache as secondary solver.
50 passes
Render time: 05:35 - notice the image quality in comparison to other examples, especially in the areas where GI is dominant


2. Image rendered with Path Tracing as both primary and secondary solver.
50  passes
Render time: 11:42




3. Image rendered with Path Tracing as primary solver only.
50 passes
Render time: 07:20



4. Image rendered with both primary and secondary solvers set to "None (biased)".
50 passes
Render time: 04:34


 

 

Was this article helpful?
4 out of 4 found this helpful