OpenVDB
A hierarchical, sparse volume data structure with a shallow B+tree-like layout, fast random access and a toolkit for level sets, fluids, smoke and clouds.
Also known as VDB
In the family Atmosphere, water & volumes, sparse volumes
Where it runs
Built inOfficial add-onPluginNone foundNot researched
| Engine | Support | How |
|---|---|---|
| three.js r187 | None found | |
| Babylon.js 9.38.0 | None found | No built-in OpenVDB loader or sparse volume renderer. |
| Godot 4.7 | None found | |
| Unity | None found | |
| Unreal 5.7 | Built in | Import .vdb files as Sparse Volume Textures; render with Heterogeneous Volume docs |
| Blender 5.2 | Built in | Add > Volume > Import OpenVDB docs |
| WebGPU W3C | None found | |
| Metal | None found |
How it works
A VDB grid is a tree with a small fixed depth and large branching factors (typically 5-4-3 log2 per level giving 4096-wide, 128-wide and 8-wide cubes). Voxels outside the narrow band or at background value are not allocated: inactive space is represented by a single tile value at a coarse level. Because the tree is shallow, any voxel is reached in at most three hops, and an accessor caches the last-visited nodes so coherent access (stencil loops, ray marching) is effectively constant time. A transform maps the index space to world space, and the same structure stores floats, vectors, level sets and masks. Tools include resampling, CSG on level sets, fluid advection, meshing and fast ray tracing with a hierarchical DDA.
When to choose it
Reach for it when
- need to store smoke, fire or cloud volumes efficiently
- dense voxel grids waste memory
- exchange volumes between houdini and blender
- sparse level sets and fluid caches need a standard format
Choose it as the interchange and storage format for production volumes (smoke, fire, clouds, SDFs) and for offline or interactive CPU tools such as Houdini and Blender.
Prefer NanoVDB when you need to render the same grids on the GPU, as it is a flattened read-only variant. Prefer a dense 3D texture for small volumes that fit in memory and are sampled by Ray-marched Participating Media in a shader.
Field marks
- Pointer-based tree does not map directly onto GPUs; needs conversion
- Insertion and deletion of nodes during parallel updates need care (topology changes are not thread-safe)
- Trilinear sampling across tile boundaries can show seams if the background value is not consistent
- Very dense volumes lose the memory advantage and can be slower than a flat array
- Level-set values outside the narrow band are clamped, so distances far from the surface are not meaningful
Presets
OpenVDB — sparse narrow-band level-set B+tree tiles & SDF slice (left) vs smooth CSG level-set surface (right)
{
"P_BAND_WIDTH": 0.16,
"P_MORPH_AMT": 0.55,
"P_SLICE_POS": 0,
"P_SPLIT": 0.48
}Show GLSL (132 lines)
const float P_BAND_WIDTH = 0.16; // P Narrow Band Width [0.06, 0.32, 0.02]
const float P_MORPH_AMT = 0.55; // P CSG Morph [0.0, 1.0, 0.05]
const float P_SLICE_POS = 0.00; // P Slice Plane Z [-0.45, 0.45, 0.03]
const float P_SPLIT = 0.48; // P Narrow-Band / Mesh [0.0, 1.0, 0.02]
float smin(float a, float b, float k) {
float h = clamp(0.5 + 0.5 * (b - a) / max(k, 1e-4), 0.0, 1.0);
return mix(b, a, h) - k * h * (1.0 - h);
}
// Organic OpenVDB CSG morphing level-set: torus blended with orbiting spheres & gyroid carving
float mapLevelSet(vec3 p, float morph) {
vec2 q = vec2(length(p.xz) - 0.52, p.y);
float dTorus = length(q) - 0.22;
float ang = iTime * 0.75;
vec3 s1 = vec3(0.42 * cos(ang), 0.20 * sin(ang * 1.4), 0.42 * sin(ang));
vec3 s2 = vec3(-0.38 * cos(ang * 0.8), -0.18 * cos(ang), -0.38 * sin(ang * 0.8));
float dBlobs = smin(length(p - s1) - 0.24, length(p - s2) - 0.22, 0.22);
float dBase = smin(dTorus, dBlobs, 0.18 + 0.16 * morph);
// Subtle gyroid subtraction
float gyr = (sin(p.x * 11.0) * cos(p.y * 11.0) + sin(p.y * 11.0) * cos(p.z * 11.0) + sin(p.z * 11.0) * cos(p.x * 11.0)) * 0.045;
return max(dBase, -(gyr + 0.065 * (1.2 - morph * 0.5)));
}
vec3 calcNormal(vec3 p, float morph) {
vec2 e = vec2(0.0022, 0.0);
return normalize(vec3(
mapLevelSet(p + e.xyy, morph) - mapLevelSet(p - e.xyy, morph),
mapLevelSet(p + e.yxy, morph) - mapLevelSet(p - e.yxy, morph),
mapLevelSet(p + e.yyx, morph) - mapLevelSet(p - e.yyx, morph)
));
}
vec3 aces(vec3 x) {
x = max(x, 0.0);
return (x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14);
}
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
float sx = fragCoord.x / max(iResolution.x, 1.0);
float split = clamp(P_SPLIT, 0.0, 1.0);
bool showSurface = sx >= split;
float band = clamp(P_BAND_WIDTH, 0.04, 0.4);
float morph = clamp(P_MORPH_AMT, 0.0, 1.0);
float sliceZ = clamp(P_SLICE_POS, -0.5, 0.5);
vec3 col = mix(vec3(0.04, 0.055, 0.085), vec3(0.10, 0.14, 0.21), uv.y + 0.5);
if (!showSurface) {
// Left: 2D cross-section slice through OpenVDB sparse narrow-band level-set & 3-tier B+tree tile hierarchy!
vec2 sp = (uv + vec2(0.24, 0.0)) * 1.95;
vec3 p3 = vec3(sp.x, sp.y, sliceZ);
float phi = mapLevelSet(p3, morph);
// Check active narrow-band voxel & 8^3 leaf tile occupancy
float tileRes = 8.0;
vec3 tileCenter = (floor(p3 * tileRes) + 0.5) / tileRes;
float phiTile = mapLevelSet(tileCenter, morph);
bool activeTile = abs(phiTile) < band + 0.10;
bool activeVoxel = abs(phi) < band;
// Background inactive space (constant +/- background value, zero memory allocated!)
col = (phi < 0.0) ? vec3(0.05, 0.08, 0.14) : vec3(0.035, 0.045, 0.065);
// Active B+tree internal/leaf tile highlight
vec2 tg = abs(fract(sp * tileRes) - 0.5);
float tileEdge = smoothstep(0.05, 0.012, min(0.5 - tg.x, 0.5 - tg.y));
vec2 rootG = abs(fract(sp * 2.0) - 0.5);
float rootEdge = smoothstep(0.025, 0.006, min(0.5 - rootG.x, 0.5 - rootG.y));
if (activeTile) {
col = mix(col, vec3(0.10, 0.18, 0.28), 0.72);
col = mix(col, vec3(0.24, 0.78, 0.98), tileEdge * 0.52);
} else {
col = mix(col, vec3(0.12, 0.16, 0.22), rootEdge * 0.35);
}
// Active narrow-band SDF values with iso-distance contours
if (activeVoxel) {
float tBand = clamp(phi / max(band, 1e-4), -1.0, 1.0);
vec3 bandCol = (phi < 0.0) ? mix(vec3(0.98, 0.55, 0.18), vec3(0.42, 0.16, 0.48), -tBand)
: mix(vec3(0.18, 0.88, 0.96), vec3(0.10, 0.34, 0.58), tBand);
float contours = smoothstep(0.12, 0.02, abs(fract(phi * 28.0) - 0.5));
col = mix(bandCol * 0.88, vec3(1.0), contours * 0.28);
}
// Crisp zero-crossing iso-surface contour (phi == 0)
float zeroLine = smoothstep(0.018, 0.004, abs(phi));
col = mix(col, vec3(1.0, 0.98, 0.85), zeroLine);
} else {
// Right: Full 3D raymarched smooth OpenVDB CSG level-set surface
float orb = iTime * 0.36;
vec3 ro = vec3(2.05 * sin(orb), 0.58, 2.05 * cos(orb));
vec3 fw = normalize(-ro);
vec3 ri = normalize(cross(fw, vec3(0.0, 1.0, 0.0)));
vec3 up = cross(ri, fw);
vec3 rd = normalize(fw * 1.44 + ri * (uv.x - 0.14) + up * uv.y);
float t = 0.05;
bool hit = false;
for (int i = 0; i < 64; i++) {
float d = mapLevelSet(ro + rd * t, morph);
if (d < 0.002) { hit = true; break; }
t += d * 0.82;
if (t > 6.5) break;
}
if (hit) {
vec3 p = ro + rd * t;
vec3 n = calcNormal(p, morph);
vec3 v = -rd;
vec3 L1 = normalize(vec3(0.62, 0.78, 0.55));
vec3 L2 = normalize(vec3(-0.72, -0.25, -0.58));
vec3 H1 = normalize(L1 + v);
float ndl1 = max(dot(n, L1), 0.0);
float ndl2 = max(dot(n, L2), 0.0);
float spec = pow(max(dot(n, H1), 0.0), 48.0);
float fres = pow(1.0 - max(dot(n, v), 0.0), 3.0);
// Subtle translucent ceramic + subsurface warmth
vec3 baseC = mix(vec3(0.14, 0.58, 0.72), vec3(0.92, 0.46, 0.22), smoothstep(-0.35, 0.35, p.y));
col = baseC * (vec3(1.25, 1.15, 0.98) * ndl1 + vec3(0.32, 0.52, 0.85) * ndl2 * 0.55 + vec3(0.14, 0.18, 0.24))
+ vec3(1.0, 0.95, 0.88) * spec * 0.85 + vec3(0.38, 0.88, 1.0) * fres * 0.38;
}
}
float sep = smoothstep(0.0035, 0.0008, abs(sx - split));
col = mix(col, vec3(0.95, 0.97, 1.0), sep);
fragColor = vec4(pow(clamp(aces(col), 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);
}Attribution: MIT — written for this index.
Measured GPU weight & timing
| Preset | GPU | Weight / p50 / p95 | Method |
|---|---|---|---|
| openvdb-live | Tesla T4 1920x1080 | 13.0× baseline (moderate) · 0.428 ms / 0.451 ms | opengl-timer-query · 32 frames · GPU Weight Atlas · Colab T4 sweep |
| openvdb-live | NVIDIA L4 1920x1080 | 11.7× baseline (moderate) · 0.186 ms / 0.189 ms · 2.3× faster on L4 | opengl-timer-query · Cross-architecture validation |
| openvdb-live | NVIDIA A100-SXM4-40GB 1920x1080 | 8.72× baseline (moderate) · 0.251 ms / 0.256 ms · 1.7× faster on A100 | opengl-timer-query · Cross-architecture validation |
Lineage
From the citation graph (Crossref reference lists): its primary source cites Dual Contouring; cited by Delta (Woodcock) Tracking, Instant NGP (Multiresolution Hash Encoding), Multiple-Scattering Approximation by Octaves, Radiance Cascades, Ray-marched Participating Media.
Crosses
- NanoVDB: Convert an OpenVDB grid to a flat NanoVDB buffer for GPU rendering.
- Delta (Woodcock) Tracking: Provides density and a max-grid used as the majorant.
Sources
- primaryKen Museth (2013). VDB. ACM Transactions on Graphics.Verified via crossref · 2026-11-29doi:10.1145/2487228.2487235
- implementationAcademySoftwareFoundation (2013). AcademySoftwareFoundation/openvdb. OpenVDB - Sparse volume data structure and toolsGitHub API · license Apache-2.0 · 2026-11-29