| Previous Topic (Basic Particle Rendering Tutorial) | Up (Contents) | Next Topic (Matte Objects and Shadows Tutorial) |
Saving Particles to File
You have seen how Krakatoa caches the current frame in order to minimize repeated particle system calculations. This process can be taken a step farther, allowing you to store the entire animated sequence to disk files.
Once particles are rendered to disk, you can turn off or even delete the particle system from your 3ds Max scene, and simply focus on settings specific to improving your rendering: cameras, lighting, density settings and matte objects.
To save particles to disk:
- In the Krakatoa GUI > Main Controls rollout, right-click the QUICK RENDER button and select the item "Active Segment [0-100] Nth:1" (Alternatively, in the Render Scene dialog, you can choose the Common tab and set the Time Output to the desired frame range as with any 3ds Max renderer).
- Set Particle Render Mode drop-down list to "Save Particles To File Sequence" - the QUICK RENDER button will change its caption to "SAVE PARTICLES" and the file sequence fields at the bottom of the Main Controls rollout will be enabled.
- In the "Save Particles To File Sequence" group of controls, type a path and name for your file. More conveniently, you can click the [...] button and browse to a path for your file.
- Click the SAVE PARTICLES button to begin processing particles. Upon completion, all particles will be cached to disk files. This example, containing 1,000,000 particles and 100 frames takes approximately 1.8 Gigabytes of disk storage space and about 10 minutes to save (the time can vary depending on your system).
Once particles are cached to disk, you can render them without the memory or processing overhead of Particle Flow. Removing this overhead will also allow more particles to fit into memory. See the topic High Particle Counts for details on loading multiple particle files for rendering.
To reuse particles cached to disk:
- In Particle View, click the light bulb icon for PF Source 01 to turn off the particle system.
- In the Krakatoa: Particle Loaders rollout, click the button "Create New Loader...". (Alternatively, you can use the default 3ds Max creation method via Create Tab > Geometry > Krakatoa > PRT Loader).
- A new Krakatoa Particle Loader object "PRT Loader 01" will be created at the origin. By default, it will automatically pop up a file picker to select a particle file sequence to load. Since you have a valid saving path in the "Save Particles To File Sequence" fields, the Particle Loader will assume correctly you intend to load the particles you just saved and will display the content of the same directory automatically.
- Select any of the numbered particle files, for example, the one with number 0000, and press Open. The saved particles will appear in the viewport and should be displayed in the saved color. Try moving the time slider - notice that the cached particles display in real time, loading by default only 1% of the saved particles (10,000 particles instead of a million).
Advanced Tip:The Loader lets you pick any of the files in the sequence because the option "Load Single Frame" allows you to show the exact numbered frame you picked on every scene frame. This means that it is technically possible to load multiple frames of the same sequence and render them as a static cloud of time-offset particles.
- Switch the Particle Render Mode drop-down list back to "Render Scene Particles". Note that both >PFlow Geometry and >Particle Loaders are checked by default in the "User Particles From" group of controls, so you can render immediately without changing any settings there.
- Set the renderer to Single Frame by right-clicking the QUICK RENDER button and selecting the "Single Frame" menu item. Drag the time slider to frame 50 and click QUICK RENDER. Compare your results to previous tests. Even though Particle Flow has been disabled, Krakatoa renders exactly the same result from the disk-based particle files.
- Adjust your lighting, camera placement, matte objects and particle density settings to further refine your render quality.
- Optionally, you can override particle colors loaded from the files. Select the PRT Loader 01 object in the scene and in the Modify Panel, scroll down to the "Rendering and Display" rollout. A drop-down list in the "Render:" group of controls reads "Saved Particle Colors". Select "Loader's Wireframe Color" and the particles will turn the same color as the object wireframe color of the loader (found next to the object's name in the 3ds Max Command Panel). You can even assign a material to the Particle Loader like to any other 3ds Max object - set the drop-down list to "Loader's Material Color" and assign a standard material from the Material Editor. The particles will show the diffuse color of the material. Play with the diffuse color to get the particle appearance you like. Also try assigning a Noise Map to the Diffuse Map slot and check the "Show Map In Viewport" icon in the Material Editor - if you move the time slider or press the UPDATE VIEW CACHE button in the PRT Loader, the Noise Map will appear on the particles in the viewport.
- When satisfied with your image quality, begin rendering the final sequence. Right-click the QUICK RENDER button and set the frame range to "Active Segment [0-100] Nth:1". In the same right-click menu, select "Set Render Output Filename" and choose your filename and output file format settings. Note that the option "Save Render Output" will be checked automatically if you selected a valid output path. Click QUICK RENDER to begin rendering all particles to final image files.
- When the sequence is complete, load the rendered image sequence into the RAM Player and view the animation.
Using this relatively simple example, we have stepped through the fundamental features of Krakatoa. At only a million particles, you can begin to see the advantages of Krakatoa, but you will want to push quantities even higher.
See the tutorials entitled High Particle Counts and Using Krakatoa with Deadline for additional techniques for pushing Krakatoa to the next level. There are additional settings to refine your image quality and alter the results of your rendering. For detailed instructions on Krakatoa features, see the Feature Reference topics.