FX particles and dynamics in 3ds Max
Learn to create FX Particles and Dynamics in 3ds Max with this sample chapter from the eBook available for purchase in our shop now!
3ds Max is a powerful 3D, animation and visual effects tool where a wide variety of content can be created. Generally its good practice and also economical to try and keep your project work confined to a select number of applications, such as 3ds Max for the 3D work and Photoshop for texturing etc. However, there are times where the content we wish to create is either limited within our application of choice, or perhaps absent altogether. In this case we are going to go over a beginner to intermediate project that includes some fluid simulation.
In the same way that two modeling artists may model the same head, but each use different tools and/or methods to create it, effects such as fluid simulations (water, molten lava, paint, etc.,) can also be created with a variety of techniques, and we can usually make an educated guess as to which method we should use to complete the effect. A typical example of such a scenario would be to create the surface of the ocean; would we use a simple plane with appropriate deformers and animation to create the illusion of a rolling surface? Or would we simulate a huge data set within fluid simulation software, using a vast amount of system resources, when the end result for both may end up looking the same? This depends entirely on many contributing factors to a VFX shot and sometimes you may end up combining multiple methods.
In the accompanying video to this tutorial (which can be downloaded by clicking on the free resources tab) I briefly go over some options for pseudo fluid FX directly inside 3ds Max, which may be applied to a wide variety of VFX shots. There are times, however, where faking it simply won't be good enough and so we must spend some time using more complex methods or software to achieve more realistic results.
In this tutorial we will be doing this by taking a cached scene from 3ds Max and importing it into RealFlow to create some believable fluid simulations. RealFlow has become somewhat the industry standard application for CGI fluids/particle simulations and allows us to create anything from raindrops to rolling ocean waves.
Let's get started. You'll need to open the provided 3ds Max scene file (Fluid_scene.max) that is available when you purchase the eBook. This will work with 3ds Max 2010 versions and later. The scene contains a low resolution mesh/figure and some rock geometry. You may need to reload/redirect the point cache file to see the animation. You will find the PC file in the Assets folder.
As the figure rises from the ground, rocks are pulled towards him, colliding with each other, spinning and then falling to the ground as if our character can perhaps control his surroundings.
I created the rocks with Rigidbody dynamics and the figure is an altered and reverse motion capture file (Fig.01).
Tip: It's very important to work at the appropriate scale when exchanging data to and from another application. To make sure your scene will import and export correctly into RealFlow, switch the units in 3ds Max to Meters.
Now make a 1,1,1 meter cube and export it as an OBJ or a RF SD file. Each grid/square in the RealFlow viewport represents 1 meter in scale, so by importing the cube you can ensure your geometry is importing correctly, or make some adjustments in your 3ds Max scene to help RealFlow import at the desired size/scale.
Export the scene as an SD file as the scene contains animation and deformation. Under the SD file export settings menu (you should find this in your 3ds Max toolbar) ensure you have selected the objects you want to export, that Deformation is on auto/checked, the frame range is correct and that you have set a path to export to. Click Export and you will see a progress bar informing you that it has been successfully exported (Fig.02).
Now in RealFlow, import the SD file you have just created. It's good practice to keep the SD file inside the Objects folder that RealFlow will create when you start a new project. Scrub the timeline to ensure the file has come across correctly.
There are many fluid emitters within RealFlow and we will use the powerful Object Emitter to have our character emit fluids from his body/surface. Create an object emitter from the Particle Emitters menu.
On the left side of RealFlow are the Nodes and Links tabs, which list everything that is currently in your scene and what is affecting what. So far we have rocks, the figure and our newly created Object01 fluid emitter node.
Select the node and look over at the parameters on the right side of RealFlow. Whatever node or object you select from your nodes list, the parameters and controls should appear on the right side by default (Fig.03).
Leave all the fluid settings at their defaults for now. Scroll down until you see the Object tab.
We need to add our figure so particles know where and what to emit from. Click on the object list and add the figure. If you hit Simulate now you will see particles flying out in random directions and lines from the figure mesh. If you don't, ensure there is a value under the Speed tab otherwise the particles will not appear. Let's now add some gravity to our scene. Go to the Daemons menu and select Gravity (Fig.04).
There are a wide variety of Daemons within RealFlow, and interesting and powerful effects can be created when combining them. Note there is now a Gravity01 listed under the Nodes tab and within the Global Links tab. Hit Simulate again and you will see the particles are now affected by gravity and fall downwards (Fig.05).
We now need to define the boundaries of our simulation by creating some additional geometry to stop the particles falling and flying off into infinity. You could prepare some geometry within 3ds Max with your scene and import it, or we could create some basic shapes within RealFlow itself.
Create a cylinder from the Geometry menu within RealFlow. Use the Transform and Scale tools to position and resize it. Note the cylinder appears in the Nodes and Global Links tabs.
Whatever objects appear in the Global Links tab do just that – they are all globally linked – meaning that they will all interact and participate in the simulation. The cylinder will act as a ground place and container to the particles. Also note the options available under Parameters when the cylinder is selected. You can adjust tolerances and behaviors such as friction and how sticky the cylinder surface might be (Fig.06).
Let's add a new daemon called K Volume to our scene. This is a simple container daemon that will further help to keep our particles under control. Any particles that escape boundaries/volume of this daemon are killed off. Use the Translate and Scale tools to move the K Volume daemon into place (Fig.07). Hit Simulate again.
The fluid is emitted from the figure and is interacting with the ground and other geometry in the scene. Now the basic scene is set we can start altering some parameters and refining the fluid simulation. To speed up testing the simulation, select the object emitter node and, under Resolution, reduce this number to 1 or less. Resolution is an important parameter that defines how many particles are emitted into the scene. Generally the more particles you have, the more realistic and detailed the simulation will be.
Let's add another daemon called Surface Tension. This daemon will help to keep the particles together and stop them separating too much. Run the simulation again for a few frames to see the results. Also try altering the Emission speed under the object emitter node to get different results. Enter a value under Randomness to encourage a more random emission pattern from the figure. Set Randomness to 1 and Jitter to 0.6, then hit Simulate (Fig.07).
Now let's animate the emitter as we want the figure to stop emitting fluids. By right-clicking on the desired parameter whilst the emitter is selected you will bring up a menu where we can add animation keys. To set the speed to 0 at frame 0 – right-click on the Speed tab and add a key. At frame 30 – set the speed to 2, right-click and add a key. Go to frame 180 and add another key. Move to frame 190 and set the speed to 0 and add a final key.
Hit Simulate and see how the fluids emit and then stop. You may wish to alter the key frames or values. Right-click on the Speed tab again and select Curves. This opens a typical animation curves rollout/graph where we can see animation keys and interpolation. Adjust the curves to your liking.
Select the object emitter again and raise the Resolution to 1. Let's also change the Internal and External Pressure values; set Internal to 1 or .98 and set External Pressure to 3.
You may also wish to try different values for Viscosity depending on what effect you are after. The default of 3 or 4 will behave like water – something like 8 will begin to move much more like slime or lava.
Some of the particles during the simulation may appear to shoot off occasionally due to high speeds/velocities. We can keep our scene clean by adding a K Speed daemon to it. This daemon has some tolerance parameters that will evaluate how fast particles are travelling and kill them should they be going too fast! We need to find out how fast our particles are travelling to be able to put a useful value into the K Speed daemon. Select the object emitter and under the Node parameters, look under the Display menu for the total.
By default you will see the velocity and as you scrub the timeline you can see the particle min and max speeds (Fig.08).
If your particles have an average speed of 15, for example, enter 20 or more under the K Speed daemon Max Speed value and hit Simulate. There should be a visible reduction of stray single particles that leave the main body of fluid. The particles' speed is tested and if they exceed the max value, they are deleted.
Other daemons you could add are Drag and perhaps a Noise daemon. Drag is a useful feature that adds a level of resistance and dampening to the speed of the simulation, as if the particles are being affected by air resistance. The Noise daemon can be useful in creating some randomness to the shapes and flow of the fluid over time. Again, these daemons can be animated to only affect the particles at the desired time in the simulation.
Let's now increase the resolution of the object emitter to 8. This will mean a much larger amount of particles will be created in the scene so we can get better detail and a clean surface/mesh. The simulation time will also now increase. Hit Simulate and allow the sim to complete. How long this takes can depend heavily on your system/hardware. The more processors and RAM you have available, the faster your RealFlow simulation will go.
However, there are some optimizations we can make within RealFlow to help speed things up.
Click on the arrow next to the Simulate button and select Options from the drop down menu. This menu has a min and max Substeps value, which defines how accurately the simulation will perform. By default, the maximum value is often too large a value for many simulations. Lower the maximum Substeps to 166.
Note: In this menu you can also alter the frame rate of your fluid simulation. Setting higher FPS values can make fluids move more slowly and appear larger when played back at more conventional frame rates such as 24p (Fig.09).
Review the completed simulation. Now let's create a mesh within RealFlow that can be brought into 3ds Max. Click on the meshing and select Particle Mesh. This will add a mesh node to the Nodes tab. RealFlow will automatically assign the object fluid emitter in the scene to the particle mesh. Right-click on the particle mesh node and select Build.
After a few seconds the mesh will appear around the particles. Meshing within RealFlow can be somewhat an art in itself and it's a matter of playing around with the values and node parameters to get a good result. Of course, there are also alternate methods for meshing the particles within 3ds Max, such as third party plugins like Frost and Glu3D, both of which I take a more detailed look at in the accompanying video.
Once you are happy with your mesh and have created the mesh for the sequence, each frame of the mesh, as well as the particles, will be saved out to disk and ready to load into 3ds Max. Hit F12 to bring up the RealFlow Export menu. Here you can see a list of all data that can be exported from your scene. If you have created additional emitters and data, ensure you enable the appropriate check boxes in this rollout to ensure it is saved out to disk.
Back inside the 3ds Max scene let's import the fluid mesh sequence. Under the RealFlow Import menu select Create BIN Mesh object and a dialog box will open to allow you to select the mesh BIN files. Select a file from the sequence
and hit OK.
You should now see your mesh that was generated in RealFlow appear inside 3ds Max and be at the correct scale in relation to the other objects in the scene. This mesh can now be assigned materials and even other modifiers, like any other 3ds Max object.
I hope you enjoyed the tutorial and introduction to getting scene data into RealFlow, creating a simulation and exporting it back into 3ds Max. Of course there are numerous other options for bringing in the data, both the mesh and raw particles, some of which I briefly look at within the downloadable video (Fig.10).
To see more by Matt Chandler, check out 3ds Max Projects