In this tutorial we will go through how to setup and use the Volume Sample Float shader to adjust the color temperature effect of an OpenVDB file, using the temperature and density VDB grids.
|The scene file can be downloaded here.|
A tutorial on how to write volumes to OpenVDB from Houdini can be found here.
- Start off by downloading this VDB file which contains an explosion with VDB grids for density and temperature. You can find more VDB files available on the OpenVDB download page.
- Create a Volume from the Arnold shelf.
Select the Volume and select the Volume Tab. Make sure the Type is set to OpenVDB.
Under the Filename attribute, open the .vdb file.
- Enter 'density' and 'temperature' into the Grids field.
Arnold volume settings. Grids set to 'density' and 'temperature'.
- Create an Arnold Shader Network. Inside that, create a Standard Volume shader and connect it to Volume of the OUT_material.
- Change the Emission Mode to Density and the Emission Channel to temperature as this is the grid that we want to change.
- Create a Ramp RGB and connect it to the Emission Color input of the Standard Volume shader.
- Change the colors of the ramp to look like the color temperature of an explosion.
Ramp RGB recreate's color temperature of explosion
We can use a Volume Sample Float shader to control the appearance of our fire volume effect. This shader will remap the values of the 3D voxel grid in the same manner as tone-mapping and remapping filters to an image in Photoshop, which operates in a 2D grid.
- Create a Volume Sample Float shader and connect it to the input of the Ramp RGB.
- Select the Sampling tab of the Volume Sample Float shader and enter 'temperature' in the Channel field. This will remap the temperature grid of the Volume using the colors from the Ramp RGB.
- Select the Remap tab. Change the values of the Volume Sample Float shader to that in the image below:
Final Volume Sample Float attributes
Final shader network
We can use the Volume Sample Float shader to alter the appearance of the explosion. The following images show different adjustment attributes and their effect on the explosion volume.