RSS< Twitter< etc

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

Introduction

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.

  1. Create a Particle Flow generating 1000 particles over 100 frames.
  2. Move the Emitter above the ground plane and rotate it a bit.
  3. Create a Gravity Force and add it to the Particle Flow using a Force operator set to Infuence of 500.0
  4. Create a Drag Force and add it to the same Force operator as the Gravity.
  5. Create a Deflector Space Warp in the ground plane and add it to the Particle Flow system using a Collision test.
  6. Set the Deflector to Bounce 0.9, Variation 50.0%, Chaos 50.0%.
  7. Open the Krakatoa GUI Dialog
  8. Check >Override Color
  9. Check >Motion Blur
  10. Check >Jittered Motion Blur
  11. Set Passes to 8 
  12. Set Shutter Angle to 360.0
  13. Check the Iterative button above the RENDER button.
  14. 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.

  1. Create a FROST object.
  2. Add the Particle Flow created in the previous step to the Particle Objects list.
  3. Switch the Meshing mode to Metaballs
  4. Change the Radius to 3.0
  5. Change to Absolute Spacing, set both Viewport and Render to 2.0
  6. 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

  1. With the FROST object selected, click the PRT Volume icon in the Krakatoa toobar (or select from the Krakatoa menu).
  2. Check the Subdivide Region option and make sure the Subdivisions spinner is set to 1
  3. From the Krakatoa menu, select "Add Krakatoa Channels Modifier..." to add a Magma modifier to the PRT Volume.
  4. Press the "Open Magma Editor" button.
  5. 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.
  6. Change the Output channel to Velocity.
  7. Select the Output node in the editor again and press the [I] key for Inputs, [C] for Channels, [M] for Mapping and [2] 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.
  8. Close the Editor.
  9. In the Krakatoa GUI > Main Controls, disable all sources except for PRT Volumes.
  10. 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:

  1. Open the MagmaFlow Editor
  2. Press [Ctrl]+[O] to add another Output node.
  3. Set the channel in the Output node to "Density".
  4. 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.
  5. 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.
  6. With the Absolute node selected, hit the [/] key on the numeric keypad to add a Divide operator node.
  7. With the Divide operator selected, press [Ctrl]+[3] to create a Float Input with value of 3.0
  8. 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.
  9. 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.

  1. Save the 3ds Max scene at this point so you can return back to it later.
  2. Select the FROST object and increase the Radius value from 3.0 to 5.0.
  3. Change the Meshing mode to Zhu/Bridson.
  4. In the Zhu/Bridson rollout, change the Blend Distance to 2.5.
  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.

  1. Save the current 3ds Max scene to a new file.
  2. Load the scene saved before the previous step (the one using Metaballs and Radius 3)
  3. Select the PRT Volume and disable the Magma Modifier on the stack.
  4. Add a new Magma Modifier and press the "Open Magma Editor" button.
  5. Press [Ctrl]+[O] to add a new Output node.
  6. Change the Output node to Velocity channel.
  7. Select the Output node again and press [SHIFT]+[N] to create and connect a Normal InputChannel node.
  8. Press [Ctrl]+[R] to enable Auto-Reorder mode.
  9. With the Normal InputChannel node selected, press the [*] key on the numeric keypad to insert a Multiply operator.
  10. With the Multiply operator selected, press [Ctrl]+[1] to create a Float Input node with value of 1.0.
  11. 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.

  1. Create a camera from the active view (Ctrl+C)
  2. Enable the MultiPass Camera Effect and select Motion Blur from the list of effects.
  3. Change the number of passes to 8.
  4. Render.

 

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.

 

Conclusion

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...