Combining Frost and Krakatoa
The following chapter is intended for users of Thinkbox Software's Krakatoa Particle Rendering, Manipulation and Management Toolkit that want to extend their pipeline by adding FROST to their workflow.
The basic approaches described here are also applicable to the free Evaluation version of Krakatoa MX which provides nearly all features of the full version minus network rendering. Rendering resolutions below 480x360 with the Evaluation version will also add no watermark to the final image.
So go ahead, download Krakatoa and enjoy the following tutorials!
This page was originally written for Krakatoa 1.6, but was updated to reflect the advanced Krakatoa MX 2 workflows on September 19, 2012.
Increasing Particle Count Using Frost and PRT Volume
One of the most often asked question on the Krakatoa support forums is: How do I partition particles coming from 3rd party sources, e.g. RealFlow?
The other most often asked question about Krakatoa is: How do I change the particle shape to render larger than a pixel?
The one problem is that the Partitioning feature of Krakatoa requires access to the simulation parameters in order to manipulate the Random Seed values and produce minor variations in the particle distribution and behavior and thus generate slightly different versions of the same simulation. Unfortunately, a BIN file saved from RealFlow cannot be manipulated easily to produce a denser cloud.
The other problem is that Krakatoa renders every particle as a pixel-sized point, which means that low particle counts usually don't have enough spatial density to produce good results when seen in a close up (the Voxel Rendering only partially solves the problem).
The following approach uses Frost to generate an arbitrary number of new particles to render in Krakatoa by filling a metaballs volume with particles. This produces a lot more particles than in the original source particle system, and can also turn each particle into a whole spherical cloud of particles, while preserving velocities for motion blur and allowing for density falloff and some more advanced effects...
Setting Up A Simple Example
Let's use a simple Particle Flow to demonstrate the basic principle - the same approach is applicable to RealFlow files loaded using the Krakatoa PRT Loader and any other particle system.
- Create a Particle Flow generating 1000 particles over 100 frames.
- Move the Emitter above the ground plane and rotate it a bit.
- Create a Gravity Force and add it to the Particle Flow using a Force operator set to Infuence of 500.0
- Create a Drag Force and add it to the same Force operator as the Gravity.
- Create a Deflector Space Warp in the ground plane and add it to the Particle Flow system using a Collision test.
- Set the Deflector to Bounce 0.9, Variation 50.0%, Chaos 50.0%.
- Open the Krakatoa GUI Dialog
- Check >Override Color
- Check >Motion Blur
- Check >Jittered Motion Blur
- Set Passes to 8
- Set Shutter Angle to 360.0
- Check the Iterative button above the RENDER button.
- Move the time slider to frame 100 and render.
RESULT: Here is the Krakatoa Particle rendering of the basic scene on frame 100 - it contains 1000 particles with 8 passes motion blur.
Creating The Frost Object
Let's create a FROST object to convert the particle system to a mesh.
- Create a FROST object.
- Add the Particle Flow created in the previous step to the Particle Objects list.
- Switch the Meshing mode to Metaballs
- Change the Radius to 3.0
- Change to Absolute Spacing, set both Viewport and Render to 2.0
- In the Frost rollout, check the option Velocity to Map Channel, set Map Channel to 2 .
RESULT: A Metaball Mesh will be created around the source particles.
Creating the PRT Volume
- With the FROST object selected, click the PRT Volume icon in the Krakatoa toobar (or select from the Krakatoa menu).
- Check the Subdivide Region option and make sure the Subdivisions spinner is set to 1
- From the Krakatoa menu, select "Add Krakatoa Channels Modifier..." to add a Magma modifier to the PRT Volume.
- Press the "Open Magma Editor" button.
- Press [Ctrl]+[O] to create a new Output node. Alternatively, right-click anywhere in the editor's grid and select "Create Output Node" from the context menu.
- Change the Output channel to Velocity.
- Select the Output node in the editor again and press the [I] key for Inputs, [C] for Channels, [M] for Mapping and  for "Mapping2". It will be connected to the Output node automatically. If it is not, drag a connection from the Mapping2 InputChannel node's output socket to the Output node's input socket.
- Close the Editor.
- In the Krakatoa GUI > Main Controls, disable all sources except for PRT Volumes.
- Press the RENDER FRAME button and render frame 100 again.
RESULT: 389,000 motion blurred particles render instead of 1,000 (your count may vary)
Adding Linear Denisty Falloff
In the above image, it is obvious that the density of all particles in each blob is uniform, making them to appear as more or less solid spheres. In fact, enabling Phong Shading would make the particles render like a shiny surface.
Let's add expand the Magma modifier to modulate the Density based on its distance from the surface of the FROST mesh:
- Open the MagmaFlow Editor
- Press [Ctrl]+[O] to add another Output node.
- Set the channel in the Output node to "Density".
- Select the Output node again and press [I] for Input, [C] for Channels and select "SignedDistance" from the list (it has no letter assigned). This will create and connect a new "SignedDistance" InputChannel node.
- With the SignedDistance InputChannel selected, press [A] and [B] to add an Absolute node - this will remove the sign of the SignedDistance which is generally negative when a particle is INSIDE a mesh. But we want it to be positive, hence the Absolute operator.
- With the Absolute node selected, hit the [/] key on the numeric keypad to add a Divide operator node.
- With the Divide operator selected, press [Ctrl]+ to create a Float Input with value of 3.0
- Select the Divide operator and press [F] and [C] to add a Function>Clamp operator. Its second and third inputs default to 0.0 and 1.0, just what we want.
- Render again in Krakatoa.
RESULT: Now the Density of the particles will be 0 at the surface of the FROST mesh and 1.0 in the center at a distance of 3.0 units.
Creating Exponential Density Falloff
We can change the look of the Density Falloff by adding a Power operator to calculate the Power of 2 of the Distance value and this change its curvature. Alternatively, we could connect a Curve node and define an arbitrary falloff curve for the Density!
Zhu/Bridson Meshing Mode And The Fluid Look
Let's modify the FROST settings a bit and see if we can get a more fluid-like look from the 1000 source particles.
- Save the 3ds Max scene at this point so you can return back to it later.
- Select the FROST object and increase the Radius value from 3.0 to 5.0.
- Change the Meshing mode to Zhu/Bridson.
- In the Zhu/Bridson rollout, change the Blend Distance to 2.5.
- Render frame 100
RESULT: The image shows a stream of particles that resembles the output of an SPH fluid simulation despite being a simple Particle Flow setup. The same settings would work even better if the particles were actually coming from a simulator like RealFlow.
Using Motion Blur For Advanced Rendering Effects
In the above example, the Velocity of all PRT Volume particles is taken from the Mapping Channel 2 generated by FROST out of the Velocity of the source particles.
We could abuse the Velocity channel by setting it to the Normal channel multiplied by an arbitrary Float value. This will cause the particles to be drawn in multiple passes moving away from the center, producing a Star Glow-like effect.
- Save the current 3ds Max scene to a new file.
- Load the scene saved before the previous step (the one using Metaballs and Radius 3)
- Select the PRT Volume and disable the Magma Modifier on the stack.
- Add a new Magma Modifier and press the "Open Magma Editor" button.
- Press [Ctrl]+[O] to add a new Output node.
- Change the Output node to Velocity channel.
- Select the Output node again and press [SHIFT]+[N] to create and connect a Normal InputChannel node.
- Press [Ctrl]+[R] to enable Auto-Reorder mode.
- With the Normal InputChannel node selected, press the [*] key on the numeric keypad to insert a Multiply operator.
- With the Multiply operator selected, press [Ctrl]+ to create a Float Input node with value of 1.0.
- Change the value of the Float Input node from 1.0 to 500.0
We multiply the Normal because the length of the Normal vector is one unit, but the Velocity has to be a lot higher to produce a visible result. You can play with the Float Input multiplier to produce different effects.
If we would render now, the result would look like this:
Combining Motion Blur Glow and MultiPass Motion Blur
The Krakatoa documentation warns against using the Krakatoa Native Motion Blur and the 3ds Max Camera MultiPass Motion Blur at the same time, but this is one case where combining the two can produce a useful result!
The Krakatoa Motion Blur will produce the Glow effect, while the Camera MultiPass Motion Blur will produce sub-samples of the FROST object and thus cause some motion blur of the already blurred particles.
- Create a camera from the active view (Ctrl+C)
- Enable the MultiPass Camera Effect and select Motion Blur from the list of effects.
- Change the number of passes to 8.
Practical Application Using RealFlow Data
As already shown in the pre-release FROST teasers, the above approach works even better when used with actual SPH fluid simulation data, for example when loading BIN particle files from RealFlow using the Krakatoa PRT Loader.
You can see the example images by following this link.
This tutorial demonstrated a way to combine FROST and Krakatoa in order to increase the particle count of the original simulation without using the Partitioning approach which requires access to the simulation parameters of the source particle system. This new workflow allows Krakatoa to render few particles as denser clouds of particle "blobs" created using the Krakatoa PRT Volume, and thus increase the final particle count arbitrarily.
It also demonstrated how the velocity information can survive a round-trip from source particles through FROST mesh to PRT Volume particles and produce correct Motion Blur in Krakatoa, and also how the MagmaFlow operators could be used to create advanced rendering effects by providing user-defined velocities.
For a related tutorial showing the advancements of Krakatoa MX 2 in this area, be sure to see this tutorial.
The next tutorial will expand on the idea of combining FROST and the Krakatoa PRT Volume object, but this time in order to convert geometry volumes into grids of geometry shapes...