Using the Krakatoa PRT Cloner Modifier

Available in Krakatoa MX v2.0.0 and higher

Overview

The Krakatoa PRT Cloner modifier lets you replace each particle of a PRT object with all particles of one or more PRT objects.

Basic Setup

Let’s take a look at the PRT Cloner modifier using two very simple PRT Volume objects:

  • Create a Plane Primitive with Length of 100 and Width of 100 units.
  • With the Plane selected, press the VOL icon or select “Create PRT Volume object(s)…” from the Krakatoa menu.
  • Uncheck the Jitter Position option.
  • Set the Spacing to 20.0 unots and uncheck the Viewp.Spacing to use the same spacing in the renderer and in the viewports.
  • Check the Seed in Surface Shell to create only one row of particles on the Plane.
  • Create a Teapot at the side, set Radius to 10.0 and Segments to 8.
  • Press the VOL icon or select “Create PRT Volume object(s)…” from the Krakatoa menu.
  • Set the Spacing to 0.5 and uncheck Viewp.Spacing. Make sure Jitter is also unchecked.

At this point, we have two independent PRT Volume objects - one planar with 25 particles, another in the shape of a Teapot with 25,548 particles. Let’s clone the Teapot particles on each particle of the Plane system.

../../../_images/KRA2_PRTC_BasicSetup_Plane_Teapot_Viewport.png
  • Select the Plane-shaped PRT Volume object and add a Krakatoa PRT Cloner Modifier from the 3ds Max Modifiers list.
  • Press the Add button in the Krakatoa PRT Cloner modifier and select the Teapot-shaped PRT Volume.
  • Set the Percentage to 100.0 in order to see all particles in the viewport (by default it will be set to 10 for performance reasons)
At this point we have 638,700 particles in the viewport, each of the 25 particles in the Planar PRT Volume is now replaced by the Teapot-shaped point cloud:
../../../_images/KRA2_PRTC_BasicSetup_ClonedTeapotOnPlane_Viewport.png

Controlling the Color Channels

  • Let’s add a Magma Modifier to the Distribution object (the one with the PRT Cloner on the Modifier Stack) above the PRT Clone modifier.
  • In the Modifier, we set the Output to Color and the Input to Normal.
../../../_images/KRA2_PRTC_BasicSetup_NormalToColor_KCM.png

Since the Normal channel of the Teapot PRT Volume is present in each cloned particle, we get all Cloned teapot particles shaded according to the surface normals of the Teapot:

../../../_images/KRA2_PRTC_BasicSetup_NormalColorOnPlane_Viewport.png

Had we moved the Magma Modifier below the PRT Cloner Modifier, the result would have been blue color because all normals of the original Plane PRT Volume particles before the cloning are pointing up!

../../../_images/KRA2_PRTC_BasicSetup_PlaneNormals_Viewport.png
  • Let’s hold SHIFT and Drag&Drop the Magma modifier from the Distribution object (the Plane’s PRT Volume) to the Clone object (the Teapot’s PRT Volume)

Now the Color channel of the Clone system is set to the Normal vector, and since the Distribution object has no color channel, white is assumed as the color. The two channels are multiplied and all particles look the same as before:

../../../_images/KRA2_PRTC_BasicSetup_NormalColorOnTeapot_Viewport.png

To demonstrate that the colors of the two systems are multiplied, let’s set the Color channel of the Distribution system to new values based on the particles’ Position channel:

  • Select the Plane’s PRT Volume and add a Magma Modifier.
  • Move the Magma Modifier below the PRT Cloner Modifier.
  • Open the MagmaFlow Editor.
  • Press Ctrl+O to create an Output node and set it to Color channel.
  • Select the Output node again.
  • Press SHIFT+P to create a new InputChannel > Position node. It will be wired to the Output automatically.
  • With the Position channel selected, press [A] and then [B] to insert an Absolute operator into the flow.
  • With the Absolute operator selected, press * to insert a Multiply node.
  • Enter 0.02 in the Default value for the second input.
../../../_images/KRA2_PRTC_BasicSetup_PositionToColor_KCM.png

At this point, the color of each of the 25 particles in the Distribution PRT Volume is set to a value based on that particle’s absolute position, scaled down a by a factor of 0.02:

../../../_images/KRA2_PRTC_BasicSetup_MultiplyColorNormalPosition_Viewport.png

In the above image, the Normal Color from the Teapot’s PRT Volume is multiplied by the scaled Position color from the Plane’s PRT Volume.

We could disable the Normal to Color Magma Modifier in the Teapot’s PRT Volume to see the actual color of each of the 25 particles in the Plane’s PRT Volume:

../../../_images/KRA2_PRTC_BasicSetup_MultiplyColorPosition_Viewport.png

Note that since the Plane’s particles have a Z position of 0, there is absolutely no Blue component in them, so the Blue color of the Teapot plays no role. This is also obvious from the previous image where the Blue component of the Normal To Color Magma was also completely lost.

  • If we would move the Position To Color Magma Modifier above the PRT Clone Modifier, the color of each particle cloned from the Teapot’s PRT Volume in place of each Plane’s PRT Volume particle will be set individually according to its object space position without any multiplication - the Multiplication of Color channels happens in the PRT Cloner Modifier, any Magma modifier above it will override the Channels!
../../../_images/KRA2_PRTC_BasicSetup_PlaneColorPosition_Viewport.png

As you can see, the Color channels of the Clone and Distribution object are multiplied inside the PRT Cloner Modifier, and the Modifier Stack is evaluated as one would expect with any 3ds Max objects and modifiers!

Controlling The Orientation Of Particles

The Orientation channel of the Distribution object (if available) will be used to control the orientation of the whole Cloned particle cloud.

  • Create a Cone Primitive - it will be used as the Orientation reference.
  • Add a new Magma Modifier to the Distribution (Plane’s PRT Volume) object.
  • Drag the modifier before the PRT Clone Modifier since we want to provide the Orientation channel before the cloning happens.
  • Open the MagmaFlow Editor and press Ctrl+O to create an Output node. Set it to Orientation channel.
  • Deselect all nodes by clicking in the editor.
  • Press [I] for Inputs and [O] for Object to create an InputObject node. Pick the Cone primitive created earlier.
  • Drag a wire from the Output socket of the InputObject into an empty area of the editor - a PropertyQuery operator will be created automatically (because it is the only operator that makes sense after an InputObject!)
  • Select the Rotation channel from the list of channels and press the Add button to expose it as an Output. Optionally, select the Pos channel and press Remove…
  • Connect the Rotation output socket to the Orientation Output Node.
  • Press the UPDATE button.
  • Rotate the Cone in the viewport - all particles will inherit the same orientation!
../../../_images/KRA2_PRTC_RotationToOrientation_KCM.png ../../../_images/KRA2_PRTC_BasicSetup_RotationToOrientation_Viewport.png

Controlling The Scale

Similarly to the Orientation, the Scale of the Particle Clones will be affected by the Scale channel of the Distribution object.

  • Add another Magma Modifier below the PRT Cloner Modifier.
  • Open the Magma Editor, press Ctrl+O and set the Output Channel to Scale.
  • Select the Output node again.
  • Press SHIFT+P to create a Position Input.
  • Press [V] and [M] to create a Vector > Magnitude operator.
  • Press [*] to create a Multiply operator, enter 0.02 in the second input’s default.
  • Press [C] for Convert and [V] for ToVector to insert after the Multiplication.
  • Select the Multiply node, Ctrl+Select the ToVector node and press SPACEBAR twice to connect the output of the Multiply to the other two input sockets of the ToVector.
../../../_images/KRA2_PRTC_BasicSetup_Scale_KCM.png ../../../_images/KRA2_PRTC_BasicSetup_PositionToScale_Viewport.png

Note that connecting only the first and second input sockets of the ToVector operator will flatten the Teapots since the Z Scale would default to 0.0:

../../../_images/KRA2_PRTC_BasicSetup_PositionToScaleZZero_Viewport.png

Similarly, changing the Default value of the third ToVector input to 1.0 will only scale the X and Y according to the distance to the center of the object, while keeping Z always 1.0:

../../../_images/KRA2_PRTC_BasicSetup_PositionToScaleZOne_Viewport.png

Automatic Scaling Based On Interparticle Spacing

The PRT Cloner Modifier provides an option to set the Scale channel automatically based on the distance of each particle to its closest neighbor. This mode is useful when using a generic shape like a Sphere to be distributed on a dynamic system (like Smoke) and you want your particles to change scale as the smoke dissipates.

  • Disable the Magma_Ori modifier that sets the Orientation, as well as the Magma_Sca modifier setting the Scaling from the previous example.
  • Select the PRT Cloner Modifier and check the “Enable” option in the Set ‘Scale’ Channel group of controls.
../../../_images/KRA2_PRTC_BasicSetup_SetScaleChannel1_Viewport.png

As you can see, since the dimensions of the teapot are not the same along all 3 axes, the particles were scaled down along the X to make each Clone approximately spherical. The Clones touch slightly.

  • Try changing the Multiply by value to see the Clones scaling up and down.
  • Uncheck the Enabled option again and go down to the base PRT Volume object.
  • Check the Jitter options and uncheck the Seed in Surface Shell option.
../../../_images/KRA2_PRTC_BasicSetup_NoScaleJitterNoShell_Viewport.png
  • Now check the Enabled option in the PRT Cloner Modifier again to set the Scale of the Clones based on their distance to their neighbors:
../../../_images/KRA2_PRTC_BasicSetup_ScaleJitterNoShell_Viewport.png

Follow the link below for an advanced tutorial showing how to apply these and other techniques to an actual animated particle sequence. See Also:

  • Assigning Particle Shape Using PRT Cloner Modifier