Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...


UI Text Box
typeinfo

This is an Entry Level tutorial which requires no previous knowledge of Phoenix. A basic understanding of 3ds Max would be helpful but is not a prerequisite for being able to follow along.

Section
Column
width40%

Requires Phoenix 3.10.00 Official Release and V-Ray Next Official Release for 3ds Max 2015 +at least. If you notice a major difference between the results shown here and the behavior of your setup, please reach us using the Support Form.

The instructions on this page guide you through the different workflows available for controlling the RGB Grid Channel of the Phoenix Simulator in 3ds Max.

The tutorial is divided in chapters covering different topics such as:

  1. Using a Phoenix Source to emit a uniform RGB color.
  2. Using a Phoenix Source to emit RGB from a texture.
  3. Using a Phoenix Source to emit RGB from the vertex colors of the source geometry.
  4. Using a Phoenix Source in Brush mode to change the RGB color of Simulations while the simulation is running.
  5. Using a Phoenix Mapper in conjunction with a V-Ray Distance Texture to change the RGB based on the proximity of an object in the scene while the simulation is running.

All these workflows are suitable for both Fire/Smoke and Liquid simulations.

The Download button below provides you with an archive containing example scenes based on the instructions on this page.

 

UI Button
sizelarge
icondownload
titleDownload Project Files
urlhttps://drive.google.com/uc?export=download&id=1nNSfQDutMC6a-gd350Nl9kz1BnFXMAwh

Column
width60%

 

Units Setup


Section
Column
width40%

Scale is crucial for the behavior of any simulation. The real-world size of the Simulator in units is important for the simulation dynamics. Large-scale simulations appear to move more slowly, while mid-to-small scale simulations have lots of vigorous movement. When you create your Simulator, you must check the Grid rollout where the real-world extents of the Simulator are shown. If the size of the Simulator in the scene cannot be changed, you can cheat the solver into working as if the scale is larger or smaller by changing the Scene Scale option in the Grid rollout.

The Phoenix solver is not affected by how you choose to view the Display Unit Scale - it is just a matter of convenience.

Go to Customize → Units Setup and set Display Unit Scale to Metric Centimeters.

Also, set the System Units such that 1 Unit equals 1 Centimeter.

Column
width60%

 

...

Section
Column
width40%

Hit Phoenix Simulator → Simulation → Start to run the sim.

The color of the Smoke should now be based on the texture you applied to the Source. This holds true for all textures, not just the Noise. For example, you could manually paint a texture in Photoshop and use that in the source.

Column
width60%
videoautoplayloop
Align
0pb_co2_finalSeq.mp4
1100%
2100%
3true
4false
5true
aligncenter
HTML
<iframe width="800" height="450" src="https://www.youtube.com/embed/Xy8dFjV3tWk?version=3&loop=1&playlist=Xy8dFjV3tWk" frameborder="0" allowfullscreen></iframe>



Chapter 3: Emitting RGB based on the Vertex Color Chapter 3: Emitting RGB based on the Vertex Color of the Source Geometry


Section
Column
width40%

Continuing with the scene from Chapter 2, delete the cache files or hide the Phoenix Simulator so it doesn't get in the way.

We will quickly go over painting vertex color on our source geometry with the VertexPaint modifier.

We will then use that in the Phoenix Source for RGB emission. There are 2 ways to do this:

  1. Use a V-Ray Vertex Color texture in the same workflow as described in Chapter 2 or
  2. Set the RGB Map parameter of the Phoenix Source to Vertex Color (it is set to Texmap by default).

Both options should produce the same result.

Column
width60%

...

Section
Column
width40%

Chapters 1 through 3 covered the basics - how to set up the export, preview and rendering of the RGB channel, and how to emit into the RGB channel from a piece of geometry using the Phoenix Fire/Smoke Source.

In this chapter and the next, we go over 2 separate workflows which allow you to modify the RGB channel after emission. We will first take a look at the simpler of the two - using a Phoenix Source in Brush Mode.

To start off, re-create the setup from Chapter 1, or open the provided project file called Chapter04_Brush_RGB_Only.max.

UI Text Box
typetip
  1. Create a source geometry, a Phoenix Simulator and a Phoenix Source.
  2. Add your source geometry to the Emitter Nodes list of the Phoenix Source.
  3. Enable GPU Preview on the Phoenix Simulator.
  4. Open the Volumetric Option from the Rendering rollout of the Simulator.
  5. Disable Fire and set the Smoke Color Based on to RGB so the Smoke color is based on the RGB Grid Channel.
  6. Enable the export of RGB channel from the Output rollout and disable Temperature to save some disk space.
  7. Set the desired emission color on the Phoenix Source. Don't forget to enable RGB from the tickboxcheckbox.
Column
width60%

 

...

 

Section
Column
width40%

Set the RGB on the Source to mid-gray (RGB on the Fire Source is green by default).

Also, rename the Source to phx_source_smoke or something along those lines. In the next step we add a second one so keeping organized will be quite helpful.

UI Text Box
typeinfo

As the Smoke comes out of the Sphere, its color should now be gray because we set the RGB on the source as such. What if we could somehow change the color once the smoke reaches a certain area of the simulator, or touches a certain object? For that to happen, you need to find a way to modify the RGB channel.

Remember - the Smoke does not magically carry the color by itself - there is an entirely separate RGB Grid Channel being simulated and the color of the smoke is being based on it. If you set the RGB Channel for the entire bounding box of the simulator to 3 separate colors, the Smoke will happily travel through and inherit them.

Column
width60%

...

Section
Column
width40%

The methods discussed in Chapters 1-3 can be applied here as well - you can modify the RGB emission of phx_source_rgb with a regular texture or a Vertex Color map. Try it out!

Column
width60%
videoautoplayloop
Align
0pb_co4_texSeq.mp4
1100%
2100%
3true
4false
5true
aligncenter
HTML
<iframe width="800" height="450" src="https://www.youtube.com/embed/-oMXzZ4MgFE?version=3&loop=1&playlist=-oMXzZ4MgFE" frameborder="0" allowfullscreen></iframe>

 

...

 

UI Text Box
typetip
Section
Column
width40%

Instead of using the Smoke channel as the middle-man, you can preview the RGB Channel directly. To do so, go to Simulator → Preview rollout and disable GPU Preview.

Then, in the Voxel Preview section, enable RGB at the bottom and disable all the other channels.

You should now be able to see the values in the RGB channel even before the Smoke comes into contact with it.

The voxel preview can be quite useful for debugging your setup.

Column
width60%

 

 

Chapter 5: Changing the RGB color of

Fire/Smoke and Liquid

simulations after emission with a Mapper and a V-Ray Distance Texture


Section
Column
width40%

In this final chapter, we will re-create the setup from Chapter 4 using a Phoenix Mapper and a V-Ray Distance Texture.

The Distance Texture will be used as a Mask for the Mapper which will constrain the Mapper to setting the values of the RGB Channel only in proximity of the object specified in the Distance Texture Objects list.

As this setup can be a bit harder to wrap your head around, here's a detailed explanation:

  1. The V-Ray Distance Texture has 4 parameters to pay close attention to: the Objects list, Far Color, Near Color and Distance. When you apply the texture to object A, it returns a color value between Near Color and Far Color based on the distance between object A and the objects in the Objects list. This is done for each shading point of the object A - the texture will calculate the distance between the shading point and the objects in the list and return a certain value.
  2. The Phoenix Mapper is used to set the values for each individual cell/voxel of the Simulator. This is an important distinction - it doesn't simply flood the entire container - you can specify where (Mask) the value (Map) is applied.
  3. You can think of the Phoenix Mapper as an object that you're applying the Distance Texture to. Instead of shading points, we now work with the cells/voxels of the Simulator. The texture will return a value based on the distance between each individual voxel and the geometry objects in the list.
  4. The result of this can be used as a Mask to feed to the Mapper. You can then give it a Map and its color will only be applied to those voxels where the Distance Texture evaluates to a value greater than 0 (black).
Column
width60%

...

Section
Column
width40%

If you're looking at the voxel preview, you will notice that the RGB is correctly set up at the start of the simulation but once the smoke reaches it, it gets diluted and disappears.

The reason is the Mapper settings. By default, the Initializer option is enabled. This means that the Mapper will set the specified channel (RGB in our case) to whatever value is provided by the Map on the first frame of the simulation and then it will become inactive.

Disable the Initializer option, so the Mapper would affect the entire duration of the simulation.

Lastly, the Time Constant parameter at the bottom controls how quickly the Mapper will set the affected cells of the simulator to the specified Map value. Time Constant is in seconds - the default value of 1 means that the Mapper will gradually set the RGB channel for the affected voxels over 1 second.

Set Time Constant to 0 so the effect is instantaneous. If you want the colors to mix on contact instead of being outright overwritten, setting this to 0.1 or so should be a good starting point.

That is all. You can hit Start to run the simulation.

Column
width60%

Div
stylevisibility: hidden; display:none;

 

true

Section
Column
width40%

That is all. You can hit Start to run the simulation.

It's worth pointing out that this setup is quite robust - you can animate the box geometry, the textures going into the Mapper's slots and the V-Ray Distance texture. You could use multiple Mapper nodes with multiple distance textures and different objects, and so on.

Here's a Liquid simulation using this setup: the geometry is set to solid (so the liquid collides with it) and a V-Ray Color is applied to the Map slot of the Phoenix Mapper, overriding the RGB channel on contact. A Grid texture is used to read the RGB channel and drive a V-Ray Blend Material based on the RGB values. You can find more information about this workflow in the Milk & Chocolate tutorial for 3ds Max.

The scene file is also provided in the Download as Chapter05_FINAL_Liquid.max.

Column
width60%
Videoautoplayloop
0PHX_TUT_smokeColor_ch05_liquid_change_color.mp4
1100%
2100%
3true
4false
5