Table of Contents

There are so many ways you can color your simulated fluids. Here is an overview of the different ways you can do it.

Coloring that does not depend on the simulation


This is the simplest way, but also the least flexible. Once your liquid or fire/smoke simulation has completed, you can map textures over it.

There are 3 ways to render your fluids - as a Mesh, as a volume, and using the Particle Shader.

Each of these can be mapped with textures:

  • you can plug textures in your mesh's material;
  • you can modulate or replace your fire or smoke color with textures;
  • you can color your particles by plugging a texture in the Color Map slot of the Particle Shader.

However, these textures will not follow the fire/smoke or the liquid as it moves. You can animate them, but the fluid will "swim" through them.

This is why this type of coloring works mostly for static images, or for applying simple color gradients or adding color noise to the fluid.

Coloring based on the simulated data


You can get the colors from the actual simulated fluid which creates much more natural looks.

Have colors or materials flow with the fluid simulation


You can setup your simulation to carry colors or texture coordinates around and you can use them to shade the simulation.

The simulation voxels or particles can mix fire/smoke colors or liquid colors and materials as well.

You can also make textured models melt or recolor simulations after they are finished.

Phoenix offers two workflows which have pros and cons for different situations.

RGB workflow


This workflow is good for mixing colors, creating new colors in the mix, and having colors dissipate over time.

You color the simulation grid voxels or the simulation particles with certain RGB color, and as they flow in the simulation, their colors mix.

There are 3 stages in this workflow:

  • Set up how the RGB will appear in the simulation:
    • You can emit them from Sources in many different ways - you can set up different Sources to emit different RGB, or even a single Source can emit different RGB based on a texture or on the vertex color of the emitter geometry. If you emit from particles, you can even use the Particle Texture to read particle data such as sizes, colors or speeds and emit fluid with colors remapped from this data.
    • You can create color using a Phoenix Mapper as well. See the How-To's section at the bottom of the Mapper page for ways of using it.
    • You can also create color using the Voxel Tuner or the Particle Tuner. They resemble the Mapper, but allow you much more per-voxel or per-particle control.
    • If you use Initial Fill Up from a Liquid Simulator's Dynamics rollout, or Initial Liquid Fill from a node's Phoenix properties, the created liquid would be colored using the Default RGB color from the Liquid rollout.
  • As the RGB flows through voxels or gets carried around by particles, you can control how it mixes. If you want it to mix more, you can increase the RGB Diffusion option for liquids or use the Backtrace advection method for fire/smoke, or the Multi-pass advection otherwise.
  • The RGB of the completed simulation frames can be rendered by mapping your Fire or Smoke Color to the RGB channel, or by reading the RGB channel using the Particle Texture or Grid Texture and plugging it into your Particle Shader or your liquid mesh's material. This workflow also allows for more complex scenarios, where you could simulate black and white RGB, read it via a Grid Texture and use it as a mask for a Blend material - this way the parts of the mesh with black RGB can get one material, and the ones with white can get a completely different material - here is a tutorial that uses this technique.

Here is a tutorial showing you step by step how to use different possible RGB workflows.

Using RGB has some limitations though. If you decide to change the simulation colors, you have to set them up and start the simulation all over again.

Also, if you want to use very detailed textures, they will be reduced to the grid resolution of the fire/smoke simulation or to the resolution of the particle simulation. You would need a very high resolution grid in order to capture very small details and this means longer simulation and rendering time.

TexUVW workflow


In Phoenix 4.0 we added the new TexUVW channel to voxels and particles. This way they don't carry specific colors around, but instead just drag texture UVW coordinates with them.

This way you can change the textures you want mapped over your fluid even after the simulation has ended, without the need to simulate again.

Using TexUVW also means that your texture resolution is no longer limited by the grid resolution of the simulation and you can use textures with infinitely small details.

Using texture coordinates means that you cannot create new colors by mixing - simply put, each voxel or particle carries a piece of the assigned texture around with it and they don't ever mix.

The TexUVW workflow has 3 stages, just like the RGB workflow:

  • Set up how the RGB will appear in the simulation - currently you can emit TexUVW from a Source, and it can be inherited from the emitter geometry's UV mapping. You don't have to plug any textures in the Phoenix Source in order for TexUVW to work.
  • During simulation, TexUVW will get smudged and twisted, so you can control or counter this from the TexUVW Dynamics settings.
  • Rendering TexUVW happens the same way as in the first section of this page - when colors do not depend on the simulated content. Just having the TexUVW channel present in the simulation caches is enough to fit over the fluid any textures you map in the Fire/Smoke Color options, or over the Mesh material. Note that for the Fire/Smoke rendering these textures need to be connected the the simulator through a Maya Projection node in Perspective mode.

TexUVW is very versatile and it can be used where any textures would go in Phoenix. You can also use it for displacement mapping over the Phoenix Mesh or the Fire/Smoke shader. And you can also use it to map not just the Fire/Smoke Color, but also their opacity.

Here is a tutorial where TexUVW is used for mapping the opacity of a smoke simulation, making the opacity map flow with the fluid.