Migrating from 0.1 to 0.2

What 0.2.0 renamed, removed or changed by default, and what to do about each.

In 0.2.0 the froxel renderer moved into the core: @pmndrs/vdb draws every frame with WGSL compute kernels (vdbCreateFrameRenderer, see Rendering without three), and @pmndrs/vdb/three's VDBFrameRenderer is a thin adapter over it. The TSL pass materials, their shader chunks and the internal backend switch are gone. Frames match 0.1's TSL path closely (57–70 dB on mjurczyk's scenes in the K6 A/Bs; the 'outward' environment irradiance, about 47 dB, differs most), and volume silhouettes can differ by a pixel. The full list is in the changelog.

Beyond the froxel renderer, 0.2 renames the core's GPU names and the tools' CPU readers (below), takes three helpers out of the tools' public API, and changes a few outputs (Behaviour to check). VDBGridPool, VDBGridNode, VDBVolumeMaterial, the level sets and the points keep their 0.1 API; VDBVolumeMaterial's defaults changed (Behaviour to check).

Of the names in the first table, 0.1.0 published vdbGridStatsGpu, vdbDecodeToAtlasGpu, VDBBoxPyramidGpu, VDBBoxPyramidGpuOptions, VDBFrameLoader (from @pmndrs/vdb/three) and the tools rows. The other …Gpu names existed only on main between the two releases.

Core names lose the Gpu suffix

The GPU is the default, so a name carries no Gpu; a Cpu suffix marks the CPU twin of a GPU function. @pmndrs/vdb (the core) and @pmndrs/vdb/three can now export one name each (vdbGridStats, vdbDecodeToAtlas, vdbSparseSource, VDBFrameRenderer, VDBFrameVolume, VDBSparseLod, VDBSparseSourceOptions): the core's takes a GPUDevice and an encoder, the ./three one a three renderer or object. Import by path; alias when you use both (import { VDBFrameRenderer as VDBCoreFrameRenderer } from '@pmndrs/vdb').

0.1 / pre-release (@pmndrs/vdb)0.2 (@pmndrs/vdb)
vdbGridStatsGpuvdbGridStats
vdbDecodeToAtlasGpuvdbDecodeToAtlas
VDBBoxPyramidGpu, VDBBoxPyramidGpuOptionsVDBBoxPyramid, VDBBoxPyramidOptions
vdbSparseSourceGpu, VDBSparseSourceGpu, VDBSparseSourceGpuOptionsvdbSparseSource, VDBSparseSource, VDBSparseSourceOptions
VDBSparseVolumeGpu, VDBSparseVolumeGpuOptions, VDBSparseLodGpuVDBSparseVolume, VDBSparseVolumeOptions, VDBSparseLod
VDBFrameRendererGpu, VDBFrameRendererGpuOptions, VDBFrameVolumeGpuVDBFrameRenderer, VDBFrameRendererOptions, VDBFrameVolume
vdbCreateLevelSetPassGpu, VDBLevelSetPassGpu, VDBLevelSetPassGpuOptionsvdbCreateLevelSetPass, VDBLevelSetPass, VDBLevelSetPassOptions
vdbCreatePointPassGpu, VDBPointPassGpu, VDBPointPassGpuOptionsvdbCreatePointPass, VDBPointPass, VDBPointPassOptions
VDBFrameRendererGpu (type, from @pmndrs/vdb/three)removed: it would collide with the ./three class. frameRenderer.core is typed by the core's VDBFrameRenderer
VDBFrameLoader (core and ./three)VDBSequenceFrameLoader
wvdbPrefixLength, nvdbResponseLength, vdbMakeFpNLeafCodec (@pmndrs/vdb/tools)not public API (tools/internal)
vdbSampleTrilinear, vdbSampleNearest, vdbSampleTrilinearVec3 (@pmndrs/vdb/tools)vdbSampleTrilinearCpu, vdbSampleNearestCpu, vdbSampleTrilinearVec3Cpu
vdbReadValueF32, vdbReadValueVec3 (@pmndrs/vdb/tools)vdbReadValueF32Cpu, vdbReadValueVec3Cpu

Removed names

0.1 (@pmndrs/vdb/three)0.2
VDBFrameRendererSettingsVDBFrameSettings (the core's, re-exported). It adds occlusion, multiScaleLevels, ambientOcclusion, ambientOcclusionPairs and ambientOcclusionSteps
VDBFramePhaseVDBFramePhaseName
VDBFrameMultipleScatteringVDBFrameMultipleScatteringMode
vdbFrameLights, vdbFrameAllLightsVDB_FRAME_LIGHT_BITS (ambient, point, directional, spot, hemisphere, environment), VDB_FRAME_ALL_LIGHTS
vdbFrameBlackbodyEmission(spectrum, exponent), VDBFrameBlackbodyHookemissionColor: { spectrum, exponent } (a VDBEmissionColor: 'white', { spectrum: 'planck' | 'soot', exponent? }, { lut } or { wgsl }). A TSL hook throws VDB_BAD_OPTION
VDBFramePasspassHook is { timestampWrites?, begin?(), end?(update) }: the timestamps bracket each core update (VDBFrameTimestamps, VDBFrameUpdate)

Renamed or removed members

0.10.2
VDBFrameRenderer.neuralNetworkVDBFrameRenderer.mlp (VDBFrameMlp, EXPERIMENTAL; our trained weights by default; null runs 'neural' / 'mlp' as 1D diffusion)
VDBFrameRenderer.renderFroxels(), holdFroxelsVDBFrameRenderer.froxels (false keeps the last froxels)
VDBFrameRenderer.environment, environmentLights (a readback)none: the core extracts the environment lights on the GPU
VDBFrameRenderer.redrawStatsthe core's VDBFrameRedrawStats (adds volumeShadows)
noneVDBFrameRenderer.core: the VDBFrameRenderer (core) (its outputs), after the first render
VDBFrameVolume.volumes[0].matrixVDBFrameVolume.boxMatrix
VDBFrameVolume.sourceUniforms, volumes, the pass-material fieldsnone
vdbVolumeUniforms, vdbVolumeNodes, VDBVolumeNodes, VDBVolumeNodesOptions, VDBVolumeUniforms, VDBVolumeUniformParameters, VDBThreeSourceFactorydeleted in 0.2.0 (no deprecation cycle). A custom TSL material samples a pooled grid through VDBGridNode (vdbSample, vdbReadValue, the helpers); custom WGSL or compute uses the core's vdbSparseSource / vdbDenseSource wgsl(); the full look is VDBFrameRenderer
VDBThreeDenseSource.textures, VDBDenseChannelTexturesnone: vdbDenseTextures(volume) is a handle with no GPU object (the core's vdbDenseSource uploads the texels)
VDBThreeSparseSource.pyramid, pyramidBuilds, refreshPyramid(), nodeAverageFn(), skipEmptyFn(), createUniforms(), createNodes(), VDBSparsePyramid, VDBSparseVolumeUniforms; the pyramidBuild optionnone: the frame renderer's core source builds its own pyramid on the GPU (pyramidMax still sizes it). gpuBytes is { pool }; nothing calls refreshStats() for you now (VDBFrameRenderer copies a changed stats into its core slot)
the draw-order "over" blend of overlapping volumes (and froxelMix: 'mixture' | 'over', a setting of the 0.2 previews)none: overlapping volumes in a froxel always combine order-independently. Frames change only where two volumes share a froxel
ambientProbe: 'irradiance' | 'radiance' (an internal A/B setting of the 0.2 previews, VDBFrameInternalSettings)none (deleted, no deprecation): the light probe's sky terms are three's irradiance along ± the sky, the former default. 'radiance' moved the path-traced reference by 2 points at most
ambientOcclusionRing: 'turn' | 'fixed' (an internal A/B setting of the 0.2 previews, VDBFrameInternalSettings)none (deleted, no deprecation): the shadowed ambient's direction ring is fixed, also with jitter and temporal (the former 'fixed'). Turning it moved the path-traced reference by 0.1 points at most
ambientPhaseFrame, ambientPhase: 'dipole-ms' (internal A/B settings of the 0.2 previews, VDBFrameInternalSettings)none (deleted, no deprecation): one internal ambientPhase: 'isotropic' | 'dipole' serves both lightings, default 'dipole'. 'dipole-ms' moved every multiple-scattering row 5 to 12 points away from the path-traced reference
VDBSequence from @pmndrs/vdb/threethe core's VDBSequence (@pmndrs/vdb); @pmndrs/vdb/three re-exports it
import { VDB_FRAME_LIGHT_BITS, type VDBFrameRenderer, type VDBFrameSettings, type VDBFrameVolume } from '@pmndrs/vdb/three';

// 0.1: frameRenderer.neuralNetwork = weights;   0.2: the generic MLP data (null: 1D diffusion)
frameRenderer.mlp = null;
// 0.1: frameRenderer.holdFroxels = true;   0.2: false keeps the last froxels
frameRenderer.froxels = false;
// 0.1: vdbFrameBlackbodyEmission('planck', 1.5);   0.2: plain data
volume.emissionColor = { spectrum: 'planck', exponent: 1.5 };
// 0.1: vdbFrameLights.directional | vdbFrameLights.ambient
volume.lights = VDB_FRAME_LIGHT_BITS.directional | VDB_FRAME_LIGHT_BITS.ambient;
// 0.1: VDBFrameRendererSettings;   0.2: the core's VDBFrameSettings
const settings: VDBFrameSettings = frameRenderer.settings;
// the core renderer itself, after the first render (its outputs: shadow maps, emission probes)
console.log(frameRenderer.core?.outputs);

Behaviour to check

  • VDBVolumeMaterial defaults changed: a material made without options now draws a lit volume on any grid. densityScale defaults to 0, which means "use opticalDepth" (6 optical depths across the grid's longest index side at its mean density); sunIntensity defaults to 16 (was 3); the shadow ray spans shadowReach (0.3) of the longest side instead of shadowSteps × stepSize voxels. 0.1's default of 40 per index voxel made every real grid an opaque, ambient-only silhouette. Explicit values keep their meaning; for 0.1's frames pass { densityScale: 40, sunIntensity: 3, shadowReach: 0 } (or your own densityScale and sunIntensity, plus shadowReach: 0). Setting densityScale to 0 no longer hides a volume: hide its mesh. See The default look.
  • ambientOcclusion is on by default (4 direction pairs): ambient, hemisphere, light-probe and environment-irradiance light is now attenuated by the medium, so scenes with such lights get darker (single scattering was 35 to 148 % too bright against a path-traced reference with it off). Frames without those lights do not change. settings.ambientOcclusion = false restores 0.1's unshadowed ambient exactly.
  • The default phase is 'dual-lobe' (forward lobe phaseG 0.8, back lobe phaseBackG −0.3 of weight phaseBackWeight 0.2), not 'henyey-greenstein' g 0.8. A volume lit from the camera's side gets brighter (the back lobe returns light toward the light), and every frame drawn with the default phase changes. Against a path-traced reference the dual-lobe default is closer on most scenes (worst case 32 % off, against 194 % with one forward lobe). settings.phase = 'henyey-greenstein' restores 0.1's phase. Scenes that set settings.phase or a measured medium (setMedium) do not change.
  • Meshes shadow volumes: three's light shadow maps are passed to the core as occluders (settings.occlusion, default true). 0.1 had no mesh → volume shadows, so a volume behind a shadow-casting mesh gets darker. settings.occlusion = false restores 0.1's frames. three draws a light's map only when the scene has a lit mesh with receiveShadow.
  • The shadowed ambient-class light is weighted by the phase function (a dipole fit of the ambient-occlusion pairs), in both lightings. It moves frames only with ambient, hemisphere or light-probe light (in 'frame' lighting also the 'outward' environment) and multipleScattering false or 'octaves'; scenes with the default 'neural' do not change. In 'frame' lighting it costs 8 bytes per shadow-grid voxel (24 with spectral), allocated only in those scenes. It has no public switch; ambientOcclusion = false turns the whole term off (0.1's unshadowed light), and there is no supported way to get the unweighted shadowed light of the 0.2 previews.
  • With settings.spectral, 'neural' runs once per colour channel in 'frame' lighting; 0.1 fell back to 1D diffusion there and rendered a grey medium darker with spectral on than off. Now the two match.
  • multipleScattering still defaults to 'neural' (our network, trained on procedural media; 0.1 shipped his weights). It runs the core's generic MLP, which is EXPERIMENTAL: its data shape may change before 1.0.
  • VDB_ALL_SCALAR_TYPES now includes 'half': a module or VDBGridNode made with it is larger and decodes Half grids. List the types you add to keep 0.1's module bytes.
  • Bytes of grids the tools build, quantize or write differ from 0.1's (the values do not): version 32.11.0 in the headers, native NanoVDB's node order and node statistics, the file's name key. Retake stored hashes and golden files. vdbQuantize now keeps a level set's inactive interior tiles, so re-quantize level sets made with 0.1.
  • An .nvdb from another NanoVDB major version throws VDBUnsupportedError, not NvdbFormatError. Catch VDBToolsError (or check code) to cover every format error.
  • Settings out of the device's range clamp with a one-time console warning instead of failing: shadowResolution (the transmittance stack must fit maxTextureDimension3D and maxBufferSize) and castShadowMapSize.
  • New in 0.2: settings.shadowResolutionMax (default 0, off) grows the 'frame' shadow grid for large or dense clouds (a cell spans at most 16 of a caster's voxels and 2 optical depths at its mean density). A 64³ grid can leave a large sparse cloud 20 % too bright; the grid's memory grows with the cube of its side, so it is opt-in. frameRenderer.core?.shadowGridResolution reports the side in use.