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:

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:

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:

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.