Since my first post about Softimage and OpenVDB was more of a brief overview than a tutorial, I decided to create a step-by-step guide on how to create a .vdb cloud-like grid with Softimage ICE using Mr.Core's (Oleg Bliznuk's) compounds and explain how they work on the way.
To follow the tutorial, download the compounds and connect the extracted workgroup in Softimage (File -> Plugin Manager -> Workgroups -> File -> Connect):
Time to make some clouds!
Create a sphere and a cube in a new scene:
Create an ICE-tree on the cube:
Add the following nodes to the tree:
- Drag a sphere polymesh reference into the tree from the Explorer
- Connect it as a reference to the VDB Voxelize Geometry node
- Use a Set VDB grid to create an attribute to store the grid on the object as self.vdbgrid
- Use a VDB Display Grid Info node to actually see what results you're getting
Time to store this magnificent cloud in a file:
- Use a Get VDB grid node to reference the very same grid we stored on the object
- Pipe it into the VDB File Grid IO node and set it to Write mode with a path to where yoju want to store the resulting .vdb file
- To execute the write node use the already created VDB Display Grid Info node as a pass-through:
Create a Redshift Volume Grid primitive
Apply a Redshift Volume Material to it:
Create a Physical Sun and Sky for pretty lighting and enable Global Illumination in the Redshift render settings:
Change visibility settings for the cube and the sphere to only display them in the viewport and not render:
Point Redshift Primitive to the .vdb file you created in the previous steps:
Set the following material settings for the Redshift Volume material (note the density reference in the scatter channel attribute field):
Let's render!
Hm. Looks strange. As if the cloud is void. Well, it is! We need to solidify it with the VDB Solidify Level Set node:
Check it out!
Much better. Time to add some irregularity with the VDB Add Noise node:
Check out the render:
Looks like a cloudlet! Let's keep going. Let's add an Advection node (move the grid mass as if it were, well... a cloud). Note three new nodes piped to the VDB Solidify Level Set node:
Render!
Looks like a small cloud already. But it's spherical, so let's squash it with a VDB Transform node:
Time to make the cloud a little bit more dense with a VDB Resample Grid node:
Now if you render you'll notice the cloud lost a lot of mass:
To fix this:
- Change VDB Resample Grid Exterior Width to 30
- Add a VDB Add Noise node to add more irregularity to the resampled grid
Ok, good. Looks a bit too even and fragmented though:
Let's fix this:
- Change settings of the VDB Transform node
- Change VDB Add Noise values
Render!
There you go! You now have a basic VDB cloud generator. You can go further by adding more modifiers to it or by replacing the mesh used as a generator input:
Note: avoid making the cloud too thick because at the moment Redshift doesn't do multiple light scattering in volumes which will cause your cloud to become very dark in denser areas.