RSS< Twitter< etc

Stoke Particle Simulator And FumeFX

Last Edited March 23, 2014 

Overview

The following tutorial discusses the use of Sitni Sati's FumeFX fluid simulator both as a Velocity Field and Distribution Source in the Stoke Particle Simulator.

The Base Scene 

We will create the test scene from scratch: 

  • Start a new 3ds Max scene.
  • Create a Teapot with Radius 15.0 units at the world origin [0,0,0]
  • Move the Teapot up to 10.0 to ensure it is not in the XY plane.
  • Create a FumeFX grid at [0,0,0] with Width and Length of 120.0 and Height of 300.0 units. Leave all other parameters at their default values.
  • Open the FumeFX UI and in the "Output" rollout, click Set and add "Velocity" and "Temperature" to the list of Exported Channels.
  • Create a FumeFX ObjSource Helper and pick the Teapot.
  • Pick the ObjSource Helper as source in the Objects rollout of the FumeFX UI.
  • Run the FumeFX Simulation.
  • Check the Velocity display option.

RESULT: The resulting Velocities will be shown as colored lines in the viewport - below is frame 100:

Simple Stoke Simulation

Now let's advect some Stoke particles using the FumeFX velocities: 

  • Select the FumeFX grid object
  • Click the Stoke menu on the 3ds Max Main Menu, select the "Create Stoke Particle Reflow Simulator..." item, then click anywhere in the ground plane to create a Stoke object.

RESULT: The new Stoke object will have the FumeFX simulation set as both Distribution Source and Velocity Source.

We will leave all settings at their default values, which means that 100 particles will be emitted per frame based on the Source channel of the FumeFX simulation, and will be advected by the FumeFX Velocities. 

  • Click the SIMULATE button and wait for the simulation to finish. On a Quad-Core i7 machine it should take around 2 seconds.

RESULT: The particles will follow the FumeFX simulation and on frame 100 we get a cloud very similar in shape to the Velocity Field we saw earlier:

  • Change the Display mode from "Large Dots" to "Velocity" - note that particles with velocity of zero will disappear because the lines with zero length are not drawn.

Emitting From The Source Geometry

In the previous step, we used the Source channel for FumeFX itself to create new particles. This is great when the only source we have is the simulation itself, and the emitter object is not there anymore. The drawback of this approach is that we have no access to any other channels the source object might have had.

Since we still have the Teapot used by the FumeFX simulation as emitter, we could uncheck the FumeFX on the Distribution Sources list and pick the Teapot as Geometry Distribution Source instead. 

  • Uncheck the checkbox in front of the FumeFX001 entry in the Distribution Sources list.
  • Click the By Name... button and select the Teapot001 object as Distribution Source - it will be checked by default.
  • Note that the Channels list now displays a large number of geometry channels, including TextureCoord and many more.
  • Simulate again - the resulting particle cloud will be very similar! 

Below is a comparison between a PRT Loader displaying the particles emitted from the Teapot's Surface in red, and the particles emitted from the FumeFX Source channel displayed in yellow. While the distribution is obviously different, the general shape of the cloud is approximately the same:

Emitting From Krakatoa PRT FumeFX Object

So far we have been using the built-in Distrubution Source features of Stoke which support particle emission from both geometries, particles and FumeFX simulations.

An advanced approach that provides a lot more flexibility to users of Krakatoa MX (including the free evaluation version!) is to use a PRT FumeFX object as an intermediate source in case the seeding within the FumeFX simulation requires more control. 

  • Select the FumeFX grid and click the FFX icon on the Krakatoa toolbar, or select "Create PRT FumeFX object..." from the Krakatoa menu.
  • Check "Seed in Smoke" as well as "Seed in Fire" and set both Minimum values to 0.0.
  • Add a Krakatoa Magma modifier to the stack and set a flow that reads the Temperature channel, compares to 285.0 using Less logical operator, and outputs the result as Selection channel.
  • Add a Krakatoa Delete modifier to delete the particles whose temperature is less than the threshold. 

  • Select the Stoke object
  • Pick the PRT FumeFX object as Distribution Source.
  • Uncheck the Teapot so it does not emit
  • Click the SIMULATE button and wait for the simulation to complete 

RESULT: A flame-shaped set of particles based on the FumeFX Temperature channel will be created by the PRT FumeFX, and the Stoke particles will be seeded from these particlles:

  • Select the PRT FumeFX on the Distribution Sources list and check the option "Use Seed Count As Rate" 
  • Press SIMULATE again. 

RESULT: In each frame, exactly one Stoke particle will be created for each PRT FumeFX seed particle, producing a much denser cloud:

 

At this point, save the scene to be used for the next FumeFX-related tutorial.

 

Sampling FumeFX Channels On Emission

While Stoke MX itself does not expose any FumeFX channels when emitting directly, all channels available in the PRT FumeFX object are of course accessible to Stoke when emitting indirectly via the method outlined above. 

  • Disable the Magma modifier on the PRT FumeFX object.
  • Uncheck the "Seed In Smoke" checkbox in the PRT FumeFX base object, leave "Seed In Fire" checked.
  • Check the "Temperature" channel in the list of available channels in Stoke
  • Click the SIMULATE button - the Stoke particles will now contain the value of the Temperature channel at their time of birth and will keep that value throughout the animation
  • Add a Magma modifier to the Stoke object itself and set up a flow that reads the Temperature channel, divides by a scale factor of 300.0, clamps the result between 0.0 and 1.0, converts the value to Vector and outputs it as a TextureCoord channel (Mapping channel 1)
  • Assign a Standard material to the Stoke object and set a Gradient Ramp with Blue|Yellow|Red colors to be mapped according to the Temperature-based mapping coordinates. 

RESULT: The particles will now reflect the Temperature of their birth point and keep it throghout the animation: