Skip to content

3D engine that AI agents drive

Say webgpu draws mesh volumes in the native error and the capability topic (#2004)

Nguyen Xuan Ane18e1d36ea1c
diff --git a/src/agent-scene-capabilities.js b/src/agent-scene-capabilities.js
index 58cef613..1c10ed84 100644
--- a/src/agent-scene-capabilities.js
+++ b/src/agent-scene-capabilities.js
@@ -315,7 +315,7 @@ export const AGENT_SCENE_CAPABILITIES = Object.freeze({
localShadows: Object.freeze({ lights: Object.freeze(['pointLights', 'spotLights']), atlasTiles: 24, pointLightTiles: 6, spotLightTiles: 1, tileSize: 512 }),
lightLinking: Object.freeze({ fields: Object.freeze(['environment.keyAffects', 'pointLights[].affects', 'spotLights[].affects', 'areaLights[].affects']), unlisted: 'a light without affects lights every node', unknownNode: 'rejected', bake: 'honoured', pathTracer: 'ignored, named in report.ignored' }),
lightPortals: Object.freeze({ field: 'environment.areaLights[].portal', note: 'true marks a window: emits nothing, direction points into the room; Cook, CPU and WebGPU sample the sky through it, raster and WebGL ignore it (diagnostic portal-ignored-by-raster)' }),
- localVolumes: Object.freeze({ field: 'environment.localVolumes', maximum: 8, shapes: Object.freeze(['box', 'sphere', 'mesh', 'grid']), fields: 'shape, center, size (box) or radius (sphere) or part + fit bounds|mesh (mesh: the named part, bounds by default; fit mesh fills a closed part, ignoring falloff, noise and steps), density 0-100 (1), falloff 0-1 (0.5), absorption rgb 0-1 (1,1,1), emission rgb 0-1, emissionStrength 0-1000 (1), scatter 0-1 (0; lit by the key light and the sky, not with fit mesh), lightsScene true adds a point light at the emission so the volume lights the scene (false; not for mesh), emissionRamp {kelvin [cool,hot] 300-30000 | stops 2-8 colours, source density (grid: temperature or flame), range [low,high] (0,1), exposure 0-1000 (1)} grades the glow by the source through a blackbody or a colour ramp, not for mesh volumes, drawn by the rasterizer and the cpu tracer only, shadowDetail true makes the sun shadow inside a scattering box or sphere follow its noise (false), castShadow true makes a box, sphere or grid shade the surfaces under it from the sun (false; dims a glowing surface under it too), scatterOctaves 1-4 adds multiple scattering to the key light of a scattering volume (1), blur 0-1 (1; softens the light behind it by optical depth, max 24 px at 540 rows), noiseAmount 0-1 (0; also ripples the faded edge, so use falloff 0.8 to 0.9 for a round cloud), noiseScale (1), noiseOctaves 1-5 (1; whole number, adds finer noise on the large lumps for a ragged smoke or fire edge, each octave at twice the scale and half the weight; raise steps with it; not on the WebGPU tracer), steps 4-32 (16); grid: center, size (taken from the grid file when omitted), grid (a name.67vg in the grid folder or a registered name; scripts/vdb-to-grid.py makes it from a VDB) or frames (a list of up to 512 such names for an animation; one resolution, 256 MiB in all by the loader and at most 64 MiB of grid files in one MCP call) with fps 0.01-240 (24) and loop (true), the frame following the motion time, density scales the grid density, emission and emissionStrength light the flame channel, temperatureScale kelvin per grid unit (1), blackbodyIntensity 0-1 (0; lights the temperature channel with the physical blackbody of Blender, 0.09 at 1500 K and 1.5 at 3000 K times emissionStrength), anisotropy -0.9-0.9 (0), steps 4-128 (64); one grid per scene, no falloff or noise', note: 'Absorb and emit; scatter above 0 lights the volume with the key light (shadow map, own depth toward the sun) and the sky term, 0 draws as before; density is extinction per metre times absorption, light behind = exp(-density * absorption * metres): about 0.3 is a thin haze (half shows through), 3 is thick smoke (under 3 percent); needs hdr and depth like volumeFog; noise is the same field in the rasterizer and the CPU path tracer; path tracer: backend cpu, webgpu for box and sphere (gpu and native throw); a bake leaves them out, so an emissive volume lights no baked surface (bake report: skippedLocalVolumes, warnings).' }),
+ localVolumes: Object.freeze({ field: 'environment.localVolumes', maximum: 8, shapes: Object.freeze(['box', 'sphere', 'mesh', 'grid']), fields: 'shape, center, size (box) or radius (sphere) or part + fit bounds|mesh (mesh: the named part, bounds by default; fit mesh fills a closed part, ignoring falloff, noise and steps), density 0-100 (1), falloff 0-1 (0.5), absorption rgb 0-1 (1,1,1), emission rgb 0-1, emissionStrength 0-1000 (1), scatter 0-1 (0; lit by the key light and the sky, not with fit mesh), lightsScene true adds a point light at the emission so the volume lights the scene (false; not for mesh), emissionRamp {kelvin [cool,hot] 300-30000 | stops 2-8 colours, source density (grid: temperature or flame), range [low,high] (0,1), exposure 0-1000 (1)} grades the glow by the source through a blackbody or a colour ramp, not for mesh volumes, drawn by the rasterizer and the cpu tracer only, shadowDetail true makes the sun shadow inside a scattering box or sphere follow its noise (false), castShadow true makes a box, sphere or grid shade the surfaces under it from the sun (false; dims a glowing surface under it too), scatterOctaves 1-4 adds multiple scattering to the key light of a scattering volume (1), blur 0-1 (1; softens the light behind it by optical depth, max 24 px at 540 rows), noiseAmount 0-1 (0; also ripples the faded edge, so use falloff 0.8 to 0.9 for a round cloud), noiseScale (1), noiseOctaves 1-5 (1; whole number, adds finer noise on the large lumps for a ragged smoke or fire edge, each octave at twice the scale and half the weight; raise steps with it; not on the WebGPU tracer), steps 4-32 (16); grid: center, size (taken from the grid file when omitted), grid (a name.67vg in the grid folder or a registered name; scripts/vdb-to-grid.py makes it from a VDB) or frames (a list of up to 512 such names for an animation; one resolution, 256 MiB in all by the loader and at most 64 MiB of grid files in one MCP call) with fps 0.01-240 (24) and loop (true), the frame following the motion time, density scales the grid density, emission and emissionStrength light the flame channel, temperatureScale kelvin per grid unit (1), blackbodyIntensity 0-1 (0; lights the temperature channel with the physical blackbody of Blender, 0.09 at 1500 K and 1.5 at 3000 K times emissionStrength), anisotropy -0.9-0.9 (0), steps 4-128 (64); one grid per scene, no falloff or noise', note: 'Absorb and emit; scatter above 0 lights the volume with the key light (shadow map, own depth toward the sun) and the sky term, 0 draws as before; density is extinction per metre times absorption, light behind = exp(-density * absorption * metres): about 0.3 is a thin haze (half shows through), 3 is thick smoke (under 3 percent); needs hdr and depth like volumeFog; noise is the same field in the rasterizer and the CPU path tracer; path tracer: backend cpu or webgpu for every shape, native for grid only (gpu throws); a bake leaves them out, so an emissive volume lights no baked surface (bake report: skippedLocalVolumes, warnings).' }),
shadowCascades: Object.freeze({ field: 'environment.shadowCascades', counts: Object.freeze([0, 1, 2, 3, 4]), zero: 'one shadow map', automatic: 'three cascades when shadow.extent is above 40 and the field is unset', maximumDistance: 150, note: 'volume fog and water read the single map' }),
lineArt: Object.freeze({ field: 'environment.lines', fields: 'width px 0.25-16 (1.5), color, boundaries, creaseAngle deg (35), depthJump (0.08), toon steps 0-8, polylines [{points [x,y,z] 2-256, color, width, depthTest, closed}] max 64, nodes {id:{lines,silhouetteOnly,color}}; {} turns on, null clears; material toon 0-8', note: 'docs/line-art.md' }),
viewTransform: Object.freeze({
diff --git a/src/path-tracer-native-volumes.js b/src/path-tracer-native-volumes.js
index 4bfd7dd3..26e19fdc 100644
--- a/src/path-tracer-native-volumes.js
+++ b/src/path-tracer-native-volumes.js
@@ -16,7 +16,7 @@ function halfFloatsOf(values) {
function requireNativeGridVolume(volume, index) {
const label = `environment.localVolumes[${index}]`;
if (volume.shape !== 'grid' || volume.part || !volume.gridData) {
- throw new RangeError(`${label} is a ${volume.part ? 'mesh' : volume.shape} volume; the native path tracer draws grid volumes only. Use backend "cpu" for box, sphere and mesh volumes (backend "webgpu" draws box, sphere and grid volumes), or make the volume a grid.`);
+ throw new RangeError(`${label} is a ${volume.part ? 'mesh' : volume.shape} volume; the native path tracer draws grid volumes only. Use backend "cpu" or "webgpu" for box, sphere and mesh volumes, or make the volume a grid.`);
}
if (volume.emissionRamp) {
throw new RangeError(`${label}.emissionRamp is not drawn by the native path tracer: Cook colours a grid by emission and blackbody only. Use backend "cpu", or remove emissionRamp and set emission and blackbodyIntensity.`);