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.
A tutorial on how to write volumes to OpenVDB from Houdini can be found here.
- Start off by downloading a VDB file such as the explosion.vdb or fire.vbd file, for example, from the OpenVDB download page.
- Create an Arnold Volume - Arnold> Volume
Select the Volume and in the attribute editor change the Type to OpenVDB.
Under the Filename attribute, open the .vdb file.
Arnold volume settings. Grids set to 'density'.
- Assign a Standard shader to the volume. Select the shading group engine of the Standard shader and connect a Volume Collector to the Volume material attribute.
- Select the Volume Collector shader and change the following.
- Set the Scattering Source to channel (this will allow us to change the name of the scattering channel).
- Add 'density' to the Scattering Channel. This is the name of the grid that the volume was saved with.
- Change the Attenuation Source to scattering. This will give us a realistic light scattering within the volume.
- Change the Attenuation Mode to absorption. In this case the volume looks better using absorption.
Volume Collector Scattering and Attenuation settings
- Render the scene. It should look like the following image.
Now we want to use a colored ramp to affect the emission parameter to give the smoke some fire.
- Connect a Maya ramp texture to the Emission and Emission Color attributes of the Volume Collector shader.
Volume Collector Emission attributes
- Change the Type of ramp to a 'U Ramp'.
- Change the colors of the ramp to look like fire.
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.
- Break the connection of the 2D texture node to the UV Coordinates in the ramp texture attributes near the bottom.
- Create a Volume Sample Float shader and drag and drop it onto the U attribute of the UV Coord as indicated in the image below.
Volume Sample Float shader connected to Uv Coord (U) attribute
- The Connection Editor will open. Connect the outValue of the Volume Sample Float to the uCoord of the ramp.
- The final shader network should look like the image below.
Final shader network
- Select the Volume Sample Float shader and add density to the Channel attribute.
- Render the scene. You should see that the emission attribute is rendering with the colored ramp texture. However, it may look a little dull initially. Try increasing the Emission attribute in the Volume Collector to make the colors of the fire appear brighter.
We can use the Volume Sample Float shader to alter the appearance of the fire. The following images show different adjustment attributes and their effect on the fire volume.