From BlenderWiki

Jump to: navigation, search
Note: This is an archived version of the Blender Developer Wiki. The current and active wiki is available on wiki.blender.org.

Results - Rendering VDB Volumes

This project was necessarily experimental since volume shading isn't available yet for the Cycles renderer. However, the project envisioned considerably more than was delivered, so here's a summary:

The promise: What we hoped we'd have
  • Reading from and writing to VDB files - basically, importing and exporting volumetric data;
  • 3D texture lookup on the VDB volumetric data, to be rendered by Cycles;
  • Creation of a Cycles node for the handling of VDB data and metadata;
  • Tentative motion blur support (filtered lookup);
The reality: What actually got done
  • Reading from a VDB file - file path must be provided to an OSL shader, so it can be passed for lookup;
  • 3D texture lookup, with some interpolation woes, as discussed below;


Texture Lookup: Interpolation and Sampling

Two modes of texture lookup on VDB structures were implemented:

(i) a naive one, obtaining the value of an individual voxel at a time, with no cache, without a choice of interpolation method, in which the queried point is transformed to the nearest discrete coordinates in the volume space (essentially, a neearest neighbor approach). Problems are the lookup is slower, and the resulting image is significantly blocky, but otherwise, the lookup works as expected.

(ii) a more sophisticated alternative, obtaining values with the help of an accessor class, which has a cache, and supports three interpolation methods, namely nearest neighbor, trilinear and quadratic. Results are smoother, but for reasons I don't yet fully understand, the sampling process isn't incremental as I expected, and, as a result, the final image is often worse than unfinished renders. I'm still working on a solution, and will comment on my findings even after the program is over.


One example is shown below, rendering the Smoke.vdb texture (file can be found here) on a plane. In effect, what we see is a slice of the volumetric data. On the left, the texture is shown against a plane using the VDB Viewer utility, and on the right, the same file, as rendered on the Blender viewport.

Smoke texture viewed from VDB Viewer app. Smoke texture viewed from Blender viewport.

What's Next

Despite the end of the Summer of Code program, I will continue working on volumetric rendering with the Cycles renderer, and I intend to complete the integration of the OpenVDB, adding the missing features, so it can be usable when shading also gets done.