Migrating from 0.1 to 0.2
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').
Removed names
Renamed or removed members
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
VDBVolumeMaterialdefaults changed: a material made without options now draws a lit volume on any grid.densityScaledefaults to 0, which means "useopticalDepth" (6 optical depths across the grid's longest index side at its mean density);sunIntensitydefaults to 16 (was 3); the shadow ray spansshadowReach(0.3) of the longest side instead ofshadowSteps × stepSizevoxels. 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 owndensityScaleandsunIntensity, plusshadowReach: 0). SettingdensityScaleto 0 no longer hides a volume: hide its mesh. See The default look.ambientOcclusionis 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 = falserestores 0.1's unshadowed ambient exactly.- The default phase is
'dual-lobe'(forward lobephaseG0.8, back lobephaseBackG−0.3 of weightphaseBackWeight0.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 setsettings.phaseor a measured medium (setMedium) do not change. - Meshes shadow volumes: three's light shadow maps are passed to the core as occluders (
settings.occlusion, defaulttrue). 0.1 had no mesh → volume shadows, so a volume behind a shadow-casting mesh gets darker.settings.occlusion = falserestores 0.1's frames. three draws a light's map only when the scene has a lit mesh withreceiveShadow. - 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) andmultipleScatteringfalseor'octaves'; scenes with the default'neural'do not change. In'frame'lighting it costs 8 bytes per shadow-grid voxel (24 withspectral), allocated only in those scenes. It has no public switch;ambientOcclusion = falseturns 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 withspectralon than off. Now the two match. multipleScatteringstill 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_TYPESnow includes'half': a module orVDBGridNodemade 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.
vdbQuantizenow keeps a level set's inactive interior tiles, so re-quantize level sets made with 0.1. - An
.nvdbfrom another NanoVDB major version throwsVDBUnsupportedError, notNvdbFormatError. CatchVDBToolsError(or checkcode) 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 fitmaxTextureDimension3DandmaxBufferSize) andcastShadowMapSize. - 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?.shadowGridResolutionreports the side in use.