Caching Render Results
Quick Start
From an empty scene, do the following:
Create an animation in Timeline, for example: by referring to Creating Keyframed Animation in Timeline tutorial.
Open the Timeline window and add a RenderCacheTrack.
Right click on the RenderCacheTrack and click Add Render Cache Playable Asset
Adjust the length of the RenderCachePlayableAsset according to the length of the animation.
Create a GameObject and add CameraRenderCapturer component.
Drag and drop the GameObject to the object property of the RenderCacheTrack.
Select the RenderCachePlayableAsset and click Update Render Cache in the inspector.
FrameMarker
Each frame has a FrameMarker, which can be used to skip capturing the image for that particular frame, and to lock the frame in order to prevent it from being overwritten.
Right clicking on a FrameMarker will bring up a popup menu.
- Copy: unused
- Paste: unused
- Duplicate: unused
- Delete: unused
- Lock and Edit
Lock the frame and open the image using the assigned image application.
The default shortcut is Alt + E and can be configured via the ShortCuts Manager.
Refer to FrameMarkers for more details.
RenderCachePlayableAsset
RenderCachePlayableAsset is a type of PlayableAsset which is used for caching render results to image files for playback by StreamingImageSequencePlayableAsset.
RenderCachePlayableAsset works together with RenderCapturer components, which execute the actual capturing process and decide what gets rendered into image files. Currently, StreamingImageSequence provides:
- CameraRenderCapturer component.
Caches the render result of a Camera component. - BaseRenderCapturer class.
An extensible abstract class, which is used to customize the capturing process.
We can view or modify the following properties through the inspector.
- Resolution (Read Only)
The resolution of the output images. Modify the size of the Game window to change this property. - Cache Output folder
Where the cached render results are stored. - Output Format
The format of the output images. - Show Frame Markers
FrameMarkers are used to customize which frames to capture. - Lock Frames
Turn the FrameMarkers's edit mode to lock mode in order to prevent certain frames from being rewritten, which is useful to maintain custom manipulation to previous cached images. - Background Colors.
- In Game window (Update)
The background color of the Game window when updating RenderCache. - In Timeline Window
The background color of the preview images in the Timeline window.
- In Game window (Update)
- Update Render Cache
Render and cache the results as images.
If Capture All Frames is unchecked, then the capturing will only be performed for the specified frames.