@null3d/engine 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/wasm/single/null3d.js +10 -8
- package/dist/wasm/single/null3d_bg.wasm +0 -0
- package/dist/wasm/threaded/null3d.js +10 -8
- package/dist/wasm/threaded/null3d_bg.wasm +0 -0
- package/docs/api/animation.md +96 -24
- package/docs/api/assets.md +99 -29
- package/docs/api/cameras.md +38 -7
- package/docs/api/controls.md +47 -23
- package/docs/api/debug.md +105 -35
- package/docs/api/engine.md +108 -32
- package/docs/api/feature-draws.md +21 -15
- package/docs/api/feature-effects.md +8 -8
- package/docs/api/feature-instances.md +68 -17
- package/docs/api/features.md +68 -37
- package/docs/api/geometry.md +83 -14
- package/docs/api/grass.md +55 -13
- package/docs/api/impostors.md +92 -50
- package/docs/api/input.md +22 -9
- package/docs/api/lights.md +67 -16
- package/docs/api/lines.md +38 -13
- package/docs/api/materials.md +187 -59
- package/docs/api/math.md +6 -6
- package/docs/api/objects.md +40 -15
- package/docs/api/page.md +58 -7
- package/docs/api/particles.md +36 -11
- package/docs/api/points.md +18 -8
- package/docs/api/post.md +57 -23
- package/docs/api/quality.md +36 -16
- package/docs/api/raycast.md +57 -24
- package/docs/api/reference/animation.md +1 -2
- package/docs/api/reference/assets.md +7 -4
- package/docs/api/reference/cameras.md +3 -2
- package/docs/api/reference/controls.md +59 -2
- package/docs/api/reference/debug.md +58 -6
- package/docs/api/reference/engine.md +39 -10
- package/docs/api/reference/feature-draws.md +3 -4
- package/docs/api/reference/feature-effects.md +2 -3
- package/docs/api/reference/feature-instances.md +5 -4
- package/docs/api/reference/features.md +7 -4
- package/docs/api/reference/geometry.md +132 -21
- package/docs/api/reference/grass.md +62 -2
- package/docs/api/reference/impostors.md +120 -16
- package/docs/api/reference/input.md +1 -2
- package/docs/api/reference/lights.md +4 -3
- package/docs/api/reference/lines.md +3 -4
- package/docs/api/reference/materials.md +7 -6
- package/docs/api/reference/math.md +13 -2
- package/docs/api/reference/objects.md +2 -3
- package/docs/api/reference/particles.md +31 -6
- package/docs/api/reference/points.md +2 -3
- package/docs/api/reference/post.md +4 -3
- package/docs/api/reference/quality.md +1 -2
- package/docs/api/reference/raycast.md +1 -2
- package/docs/api/reference/render.md +4 -3
- package/docs/api/reference/scene.md +24 -5
- package/docs/api/reference/sketch.md +11 -11
- package/docs/api/reference/sound.md +33 -2
- package/docs/api/reference/splats.md +42 -3
- package/docs/api/reference/sprites.md +2 -3
- package/docs/api/reference/tasks.md +16 -3
- package/docs/api/reference/terrain.md +26 -5
- package/docs/api/reference/textures.md +1 -2
- package/docs/api/reference/three-compat.md +18 -7
- package/docs/api/reference/time.md +1 -2
- package/docs/api/reference/ui.md +10 -7
- package/docs/api/reference/vertex-draws.md +2 -3
- package/docs/api/reference/water.md +78 -5
- package/docs/api/reference/wind.md +15 -2
- package/docs/api/render.md +67 -25
- package/docs/api/scene.md +129 -36
- package/docs/api/sketch.md +45 -19
- package/docs/api/sound.md +48 -12
- package/docs/api/splats.md +42 -15
- package/docs/api/sprites.md +8 -6
- package/docs/api/tasks.md +31 -22
- package/docs/api/terrain.md +44 -12
- package/docs/api/textures.md +61 -12
- package/docs/api/three-compat.md +15 -7
- package/docs/api/time.md +3 -5
- package/docs/api/ui.md +18 -10
- package/docs/api/vertex-draws.md +13 -12
- package/docs/api/water.md +111 -67
- package/docs/api/wind.md +61 -15
- package/docs/cli/null3d.md +90 -15
- package/docs/concepts/architecture.md +69 -23
- package/docs/concepts/assets.md +57 -16
- package/docs/concepts/backends.md +65 -25
- package/docs/concepts/color-management.md +42 -13
- package/docs/concepts/culling.md +68 -47
- package/docs/concepts/handles.md +14 -5
- package/docs/concepts/instances.md +72 -23
- package/docs/concepts/large-worlds.md +17 -7
- package/docs/concepts/lighting.md +117 -44
- package/docs/concepts/lod.md +128 -33
- package/docs/concepts/materials.md +43 -12
- package/docs/concepts/particle-buffer.md +48 -35
- package/docs/concepts/post-processing.md +77 -14
- package/docs/concepts/quality-preset-tables.md +3 -2
- package/docs/concepts/quality-presets.md +122 -39
- package/docs/concepts/render-graph.md +56 -21
- package/docs/concepts/render-layers.md +9 -5
- package/docs/concepts/shadows.md +96 -25
- package/docs/concepts/static-dynamic.md +22 -7
- package/docs/cookbook/index.md +163 -119
- package/docs/data/threejs-mapping.json +301 -340
- package/docs/errors/E1101.md +23 -5
- package/docs/errors/E1102.md +11 -3
- package/docs/errors/E1103.md +11 -3
- package/docs/errors/E1104.md +11 -3
- package/docs/errors/E1105.md +13 -5
- package/docs/errors/E1106.md +11 -3
- package/docs/errors/E1107.md +15 -5
- package/docs/errors/E1108.md +11 -3
- package/docs/errors/E1109.md +32 -6
- package/docs/errors/E1110.md +23 -5
- package/docs/errors/E1111.md +11 -3
- package/docs/errors/E1112.md +11 -3
- package/docs/errors/E1203.md +12 -4
- package/docs/errors/E1204.md +11 -3
- package/docs/errors/E1205.md +11 -3
- package/docs/errors/E1206.md +28 -6
- package/docs/errors/E1207.md +11 -3
- package/docs/errors/E1208.md +12 -3
- package/docs/errors/E1209.md +11 -3
- package/docs/errors/E1213.md +27 -5
- package/docs/errors/E1214.md +11 -3
- package/docs/errors/E1215.md +31 -6
- package/docs/errors/E1216.md +31 -6
- package/docs/errors/E1217.md +29 -6
- package/docs/errors/E1218.md +22 -6
- package/docs/errors/E1219.md +11 -3
- package/docs/errors/E1220.md +24 -5
- package/docs/errors/E1221.md +24 -5
- package/docs/errors/E1222.md +11 -3
- package/docs/errors/E1223.md +39 -6
- package/docs/errors/E1224.md +11 -3
- package/docs/errors/E1225.md +11 -3
- package/docs/errors/E1301.md +11 -3
- package/docs/errors/E1302.md +11 -3
- package/docs/errors/E1303.md +11 -3
- package/docs/errors/E1304.md +11 -3
- package/docs/errors/E1305.md +13 -3
- package/docs/errors/E1306.md +11 -3
- package/docs/errors/E1307.md +23 -6
- package/docs/errors/E1401.md +11 -3
- package/docs/errors/E1402.md +13 -5
- package/docs/errors/E1403.md +11 -3
- package/docs/errors/E1404.md +13 -3
- package/docs/errors/E1405.md +15 -4
- package/docs/errors/E1406.md +31 -5
- package/docs/errors/E1407.md +11 -3
- package/docs/errors/E1408.md +11 -3
- package/docs/errors/E1409.md +11 -3
- package/docs/errors/E1410.md +13 -5
- package/docs/errors/E1411.md +11 -3
- package/docs/errors/E1412.md +29 -6
- package/docs/errors/E1413.md +11 -3
- package/docs/errors/E1414.md +11 -3
- package/docs/errors/E1415.md +11 -3
- package/docs/errors/E1416.md +27 -6
- package/docs/errors/E1417.md +11 -3
- package/docs/errors/E1418.md +12 -3
- package/docs/errors/E1419.md +13 -5
- package/docs/errors/E1420.md +11 -3
- package/docs/errors/E1421.md +11 -3
- package/docs/errors/E1422.md +12 -3
- package/docs/errors/E1423.md +12 -3
- package/docs/errors/E1424.md +24 -5
- package/docs/errors/E1425.md +11 -3
- package/docs/errors/E1426.md +11 -3
- package/docs/errors/E1430.md +11 -3
- package/docs/errors/E1431.md +11 -3
- package/docs/errors/E1432.md +11 -3
- package/docs/errors/E1433.md +11 -3
- package/docs/errors/E1434.md +15 -6
- package/docs/errors/E1435.md +11 -3
- package/docs/errors/E1436.md +11 -3
- package/docs/errors/E1437.md +14 -6
- package/docs/errors/E1501.md +41 -6
- package/docs/errors/E1502.md +13 -3
- package/docs/errors/E1503.md +11 -3
- package/docs/errors/E1504.md +11 -3
- package/docs/errors/E1505.md +23 -5
- package/docs/errors/E1506.md +11 -3
- package/docs/errors/index.md +52 -29
- package/docs/getting-started/cdn.md +15 -9
- package/docs/getting-started/first-scene.md +20 -12
- package/docs/getting-started/hosting.md +111 -63
- package/docs/getting-started/install.md +39 -24
- package/docs/getting-started/network-use.md +31 -21
- package/docs/getting-started/project-structure.md +20 -8
- package/docs/getting-started/third-party-notices.md +6 -10
- package/docs/guides/accessibility.md +4 -4
- package/docs/guides/add-ons.md +83 -13
- package/docs/guides/agents.md +2 -6
- package/docs/guides/assets-pipeline.md +248 -72
- package/docs/guides/audio.md +17 -15
- package/docs/guides/baked-light-data.md +44 -23
- package/docs/guides/car-paint.md +37 -31
- package/docs/guides/content-pages.md +53 -29
- package/docs/guides/custom-passes.md +59 -17
- package/docs/guides/custom-shaders.md +54 -37
- package/docs/guides/debugging.md +31 -41
- package/docs/guides/deploying.md +6 -27
- package/docs/guides/deterministic-simulation.md +23 -16
- package/docs/guides/first-use-shaders.md +83 -45
- package/docs/guides/lens-kit.md +29 -26
- package/docs/guides/loading-screens.md +70 -30
- package/docs/guides/multiple-views.md +22 -11
- package/docs/guides/performance.md +188 -37
- package/docs/guides/phones.md +71 -19
- package/docs/guides/physics.md +6 -10
- package/docs/guides/screens.md +41 -29
- package/docs/guides/start-time.md +120 -85
- package/docs/guides/testing.md +137 -98
- package/docs/guides/ui-overlays.md +17 -12
- package/docs/guides/video-textures.md +14 -13
- package/docs/images/api/animation/character.webp +0 -0
- package/docs/images/api/animation/look-at-ring.webp +0 -0
- package/docs/images/api/animation/morph-tulips.webp +0 -0
- package/docs/images/api/animation/skeleton-lines.webp +0 -0
- package/docs/images/api/controls/gizmo-handles.webp +0 -0
- package/docs/images/api/controls/walk-and-fly.webp +0 -0
- package/docs/images/api/debug/debug-shapes.webp +0 -0
- package/docs/images/api/debug/levels-view.webp +0 -0
- package/docs/images/api/engine/transparent-canvas.webp +0 -0
- package/docs/images/api/feature-draws/feature-draw-clouds.webp +0 -0
- package/docs/images/api/feature-instances/compute-instances.webp +0 -0
- package/docs/images/api/feature-instances/instances-shadow.webp +0 -0
- package/docs/images/api/geometry/extra-shapes.webp +0 -0
- package/docs/images/api/geometry/generators.webp +0 -0
- package/docs/images/api/geometry/mesh-arrays.webp +0 -0
- package/docs/images/api/geometry/vertex-updates.webp +0 -0
- package/docs/images/api/grass/grass-grove.webp +0 -0
- package/docs/images/api/grass/grass-presets.webp +0 -0
- package/docs/images/api/grass/grass-shadow.webp +0 -0
- package/docs/images/api/impostors/impostor-handover.webp +0 -0
- package/docs/images/api/impostors/impostor-shadow.webp +0 -0
- package/docs/images/api/impostors/impostors-forest.webp +0 -0
- package/docs/images/api/lights/spot-cookies.webp +0 -0
- package/docs/images/api/lines/lines-lit.webp +0 -0
- package/docs/images/api/lines/lines-widths.webp +0 -0
- package/docs/images/api/materials/coat-and-sheen.webp +0 -0
- package/docs/images/api/materials/decals.webp +0 -0
- package/docs/images/api/materials/iridescence-and-anisotropy.webp +0 -0
- package/docs/images/api/materials/relief.webp +0 -0
- package/docs/images/api/materials/shader-inputs.webp +0 -0
- package/docs/images/api/materials/standard-grid.webp +0 -0
- package/docs/images/api/materials/subsurface.webp +0 -0
- package/docs/images/api/materials/translucency.webp +0 -0
- package/docs/images/api/objects/objects-turntable.webp +0 -0
- package/docs/images/api/particles/campfire.webp +0 -0
- package/docs/images/api/points/galaxy.webp +0 -0
- package/docs/images/api/reference/textures/texture-wrap.webp +0 -0
- package/docs/images/api/render/fullscreen-glow.webp +0 -0
- package/docs/images/api/render/reflection-mirror.webp +0 -0
- package/docs/images/api/render/security-camera.webp +0 -0
- package/docs/images/api/scene/aurora-sky-layer.webp +0 -0
- package/docs/images/api/sound/sound-demo.webp +0 -0
- package/docs/images/api/splats/splats-demo.webp +0 -0
- package/docs/images/api/sprites/sprites-lines.webp +0 -0
- package/docs/images/api/terrain/terrain-demo.webp +0 -0
- package/docs/images/api/textures/canvas-screen.webp +0 -0
- package/docs/images/api/textures/mipmaps.webp +0 -0
- package/docs/images/api/vertex-draws/rain.webp +0 -0
- package/docs/images/api/water/ocean.webp +0 -0
- package/docs/images/api/water/water-demo.webp +0 -0
- package/docs/images/api/water/water-rain.webp +0 -0
- package/docs/images/api/water/waterfall.webp +0 -0
- package/docs/images/concepts/assets/gltf-model.webp +0 -0
- package/docs/images/concepts/color-management/tone-mapped.webp +0 -0
- package/docs/images/concepts/culling/far-from-origin.webp +0 -0
- package/docs/images/concepts/instances/instances.webp +0 -0
- package/docs/images/concepts/instances/per-row-colors.webp +0 -0
- package/docs/images/concepts/large-worlds/large-world.webp +0 -0
- package/docs/images/concepts/lighting/area-lights.webp +0 -0
- package/docs/images/concepts/lighting/atmosphere.webp +0 -0
- package/docs/images/concepts/lighting/environment.webp +0 -0
- package/docs/images/concepts/lighting/light-shafts.webp +0 -0
- package/docs/images/concepts/lighting/reflection-probes.webp +0 -0
- package/docs/images/concepts/lod/forest.webp +0 -0
- package/docs/images/concepts/materials/weighted-transparency.webp +0 -0
- package/docs/images/concepts/post-processing/auto-exposure.webp +0 -0
- package/docs/images/concepts/post-processing/bounce-light.webp +0 -0
- package/docs/images/concepts/post-processing/depth-of-field.webp +0 -0
- package/docs/images/concepts/post-processing/post-effects-alley.webp +0 -0
- package/docs/images/concepts/post-processing/sharpen.webp +0 -0
- package/docs/images/concepts/post-processing/ssr-wet-street.webp +0 -0
- package/docs/images/concepts/render-layers/layers-cottages.webp +0 -0
- package/docs/images/concepts/shadows/hero-shadow.webp +0 -0
- package/docs/images/cookbook/index/picking.webp +0 -0
- package/docs/images/cookbook/index/time-of-day.webp +0 -0
- package/docs/images/errors/E1431/area-lights-no-tables.webp +0 -0
- package/docs/images/guides/custom-passes/reflection-water.webp +0 -0
- package/docs/images/guides/deterministic-simulation/replay-demo.webp +0 -0
- package/docs/images/guides/multiple-views/split-screen.webp +0 -0
- package/docs/images/guides/performance/overdraw-view.webp +0 -0
- package/docs/images/guides/testing/hold-mode-frame.webp +0 -0
- package/docs/images/index/showcase-island.webp +0 -0
- package/docs/images/porting/threejs-shaders/dissolve.webp +0 -0
- package/docs/images/shaders/builtins/builtins.webp +0 -0
- package/docs/images/shaders/surface-functions/custom-surface.webp +0 -0
- package/docs/images/shaders/surface-functions/vertex-offset.webp +0 -0
- package/docs/images/shots.json +2231 -0
- package/docs/index.md +14 -23
- package/docs/moves.json +1 -0
- package/docs/nav.json +300 -0
- package/docs/pages.md +230 -212
- package/docs/porting/react-three-fiber.md +2 -6
- package/docs/porting/threejs-loop-and-threads.md +1 -5
- package/docs/porting/threejs-mapping.md +1248 -234
- package/docs/porting/threejs-materials.md +10 -5
- package/docs/porting/threejs-overview.md +26 -6
- package/docs/porting/threejs-postprocessing.md +2 -6
- package/docs/porting/threejs-shaders.md +16 -14
- package/docs/porting/threejs-unsupported.md +6 -6
- package/docs/porting/verification.md +0 -4
- package/docs/shaders/builtins.md +15 -4
- package/docs/shaders/library.md +9 -6
- package/docs/shaders/surface-functions.md +51 -16
- package/docs/shaders/wgsl-rules.md +12 -5
- package/lib/debug/debug.d.ts +2 -2
- package/lib/debug/draw.d.ts +2 -2
- package/lib/debug/draw.js +8 -4
- package/lib/debug/overlay-look.d.ts +6 -0
- package/lib/debug/overlay-look.js +29 -7
- package/lib/debug/overlay.js +15 -11
- package/lib/debug/stats-options.d.ts +13 -0
- package/lib/debug/stats-panel.d.ts +21 -6
- package/lib/debug/stats-panel.js +80 -13
- package/lib/errors/codes.d.ts +17 -3
- package/lib/errors/codes.js +111 -105
- package/lib/errors/fixes.js +18 -18
- package/lib/gpu/variants.d.ts +8 -2
- package/lib/gpu/variants.js +39 -7
- package/lib/gpu/webgl2/programs.js +1 -1
- package/lib/gpu/webgpu/pipelines.js +13 -13
- package/lib/index.d.ts +1 -1
- package/lib/page/capabilities.d.ts +1 -1
- package/lib/page/engine.d.ts +14 -5
- package/lib/page/engine.js +18 -2
- package/lib/page/label-loop.js +9 -4
- package/lib/page/stats-switch.js +2 -0
- package/lib/page/switches.d.ts +6 -4
- package/lib/page/switches.js +20 -4
- package/lib/scene/baked-light.d.ts +2 -2
- package/lib/scene/fake-call-values.js +2 -2
- package/lib/scene/frame-cameras.d.ts +16 -4
- package/lib/scene/frame-cameras.js +28 -10
- package/lib/scene/gltf.d.ts +1 -1
- package/lib/scene/level-rule.d.ts +6 -5
- package/lib/scene/level-rule.js +2 -2
- package/lib/scene/particles.d.ts +7 -3
- package/lib/scene/particles.js +3 -1
- package/lib/scene/post.d.ts +3 -2
- package/lib/scene/resources.d.ts +15 -9
- package/lib/scene/scene.d.ts +18 -2
- package/lib/scene/scene.js +47 -5
- package/lib/scene/time-of-day.d.ts +10 -5
- package/lib/scene/time-of-day.js +11 -7
- package/lib/shader-artifact.json +1 -1
- package/lib/shared/labels.d.ts +5 -2
- package/lib/shared/labels.js +5 -2
- package/lib/shared/permutation-words.d.ts +2 -0
- package/lib/shared/permutation-words.js +8 -0
- package/lib/shared/recording.d.ts +13 -5
- package/lib/shared/recording.js +31 -10
- package/lib/shared/sketch-data.d.ts +9 -0
- package/lib/shared/sketch-data.js +57 -0
- package/lib/shared/version.d.ts +1 -1
- package/lib/shared/version.js +1 -1
- package/lib/sketch/define-sketch.d.ts +16 -7
- package/lib/sketch/define-sketch.js +2 -1
- package/lib/sketch/runner.d.ts +4 -0
- package/lib/sketch/runner.js +5 -0
- package/lib/sketch/ui.js +4 -2
- package/lib/stats.d.ts +1 -0
- package/lib/workers/protocol.d.ts +10 -0
- package/lib/workers/render-worker.js +4 -1
- package/lib/workers/sketch-worker.js +4 -1
- package/package.json +1 -1
package/lib/errors/fixes.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Each error code's fix: the text that ends every EngineError message, and the only part of the
|
|
2
|
-
// error table that runtime code needs.
|
|
3
|
-
//
|
|
4
|
-
//
|
|
2
|
+
// error table that runtime code needs. A thread loads the table when it first reports an error, so
|
|
3
|
+
// the text does not weigh on a page's start. The rest of each code's docs text is in codes.ts,
|
|
4
|
+
// which only the docs generator and the tests import. Codes group by area: 11xx objects
|
|
5
5
|
// and handles, 12xx values, 13xx browsers and GPUs, 14xx setup and loading, 15xx rendering.
|
|
6
6
|
export const ERROR_FIXES = {
|
|
7
7
|
E1101: 'Stop using an object after you call destroy() on it. Look for places that still keep a reference, such as arrays of enemies or selection state.',
|
|
@@ -12,28 +12,28 @@ export const ERROR_FIXES = {
|
|
|
12
12
|
E1106: 'Fix the call that created the object. When the frame applied that call, the engine logged why it failed, such as E1101 for a parent that was already destroyed.',
|
|
13
13
|
E1107: 'This is an engine bug. Report it with the code that created the object.',
|
|
14
14
|
E1108: 'Pass a value inside the range that the message gives. For an instance batch, keep counts and indices within the capacity you created it with, or create a larger batch.',
|
|
15
|
-
E1109: '
|
|
15
|
+
E1109: 'Measure how near the scene comes to its limit with `engine.measure()`. Compare its `memory.wasmBytes` with `engine.mode.memoryMaximumMiB`, and add `?direct=on` to read the path that needs the most. Use less: share meshes, draw fewer rows, size each batch for its rows, and destroy batches you no longer draw. A scene that still needs more can ask for a larger maximum with the `memory` option of `createEngine()`.',
|
|
16
16
|
E1110: 'Change a static object with setPosition(), setRotation(), setScale() or another setter: each one marks the object for the engine to update. Code that writes values straight into engine memory needs a dynamic object, which the engine updates in every frame. For a row of a static batch, call markDirty(start, count) on the batch after you write its arrays, or create the batch with dynamic: true. If your code writes no engine memory, this is an engine bug: report it with the message.',
|
|
17
17
|
E1111: 'Destroy the objects and instance batches that use the mesh or model first, with destroy() on each. Then destroy the mesh or model, in the same frame or later. Destroying the group that scene.instantiate() returned takes the whole copy of a model. To keep an object and drop its mesh, give it another mesh with setMesh() first.',
|
|
18
18
|
E1112: 'Give a still 2D texture, such as one that assets.loadTexture, textures.fromImageBitmap or textures.fromData makes. A texture that changes every frame needs a cookie of its own, copied in each frame.',
|
|
19
|
-
E1203: 'Check the value computed before this call
|
|
19
|
+
E1203: 'Check the value computed before this call: NaN often comes from dividing zero by zero, or from normalizing a zero-length vector. Most calls check their numbers only in development builds, and a release build leaves the check out. The bad value then reaches the scene, and the frame draws wrong, or not at all, with no error. Scene queries such as raycasts check in every build.',
|
|
20
20
|
E1204: "Pass a hex string such as '#4a8cff', a number such as 0x4a8cff, or three linear components from 0 to 1, such as [0.07, 0.26, 1].",
|
|
21
21
|
E1205: "Use a KeyboardEvent.code name such as 'KeyW' or 'ArrowLeft', or a mouse button from 'Mouse0' to 'Mouse4'. Gamepad names start with 'Gamepad', such as 'GamepadA' or 'GamepadLeftStickUp'. Define an action with input.actions.define() before you use it, and give it a name that no key or button has. Objects take the pointer events 'click', 'pointerdown', 'pointerup', 'pointermove', 'pointerenter' and 'pointerleave'.",
|
|
22
|
-
E1206: 'Give positions and normals three numbers per vertex, uvs and uvs1 two, colors three or four, and tangents four. Give three indices per triangle, each below the vertex count
|
|
22
|
+
E1206: 'Give positions and normals three numbers per vertex, uvs and uvs1 two, colors three or four, and tangents four. Give three indices per triangle, each below the vertex count, or no indices and a vertex count that is a multiple of three. Pass normals or `computeNormals: true`, and pass uvs with `computeTangents: true`. Replace NaN and Infinity values.',
|
|
23
23
|
E1207: 'Pass a whole number whose bits name the layers: 1 << n is layer n. The operator | joins layers, so (1 << 0) | (1 << 3) is layers 0 and 3. Layers run from 0 to 31.',
|
|
24
24
|
E1208: "Give options from the texture's docs page, such as wrap: 'repeat', filter: 'nearest' or anisotropy: 8. Give fromDatafour numbers per texel: a Uint8Array for rgba8unorm, and a Uint16Array of half floats or a Float32Array for rgba16float. Resize images larger than textures.maxSize, and decode a closed image again. Encode a KTX2 file flipped instead of passing flipY: true, and load it again instead of updating its texture.",
|
|
25
25
|
E1209: "Give the material fewer textures. WebGL2 gives each shader stage at least 16 texture units, as many as the device reports, and the engine's lit shader reads most of them, so a custom material's own textures must fit in what is left. Use the standard material's own maps where they draw the effect.",
|
|
26
26
|
E1213: "Pass only the settings that the call has, each with a value that it takes. The call's docs page lists them.",
|
|
27
27
|
E1214: "Give fixedRate the fixed steps per second, a number above 0 such as 60 or 120. Give maxFixedSteps a whole number of 1 or more, such as 8. Give downloads an array of the files that the setup loads, each a URL or an address string such as 'models/ship.glb'.",
|
|
28
|
-
E1215: 'Add the null3D Vite plugin to vite.config.ts
|
|
29
|
-
E1216: 'Use the names of the fields of struct Uniforms in the WGSL
|
|
30
|
-
E1217: "Give alphaMode 'opaque', 'mask', 'hash' or 'blend', and blending 'normal', 'additive', 'multiply' or 'weighted'. three.js's transparent: true is alphaMode: 'blend', and its alphaTest is alphaMode: 'mask' with alphaCutoff.
|
|
31
|
-
E1218: "Use the names in animator.clips
|
|
28
|
+
E1215: 'Add the null3D Vite plugin to `vite.config.ts`. Write the WGSL in a template literal right after a `/* wgsl */` comment, or import it from a `.wgsl` file. Give each call the WGSL that its kind declares: the table on this page lists each declaration.',
|
|
29
|
+
E1216: 'Use the names of the fields of `struct Uniforms` in the WGSL, and the names of its texture declarations. Give each value the type that its declaration takes. Rename a field that has the name of a standard value, such as `color`. Give `post.setEffectUniform()` an effect that `post.addEffect()` returned.',
|
|
30
|
+
E1217: "Give alphaMode 'opaque', 'mask', 'hash' or 'blend', and blending 'normal', 'additive', 'multiply' or 'weighted'. three.js's transparent: true is alphaMode: 'blend', and its alphaTest is alphaMode: 'mask' with alphaCutoff. For a conflict between two options, follow the message, or read the rule for each kind of material on the E1217 docs page.",
|
|
31
|
+
E1218: "Use the names in `animator.clips`, and the joint names of the model's skeleton. Call `animator()` only on an object that a glTF file with animations created, and name clip events anything but `loop` and `finished`. Give `setMorphWeight` a target number below its geometry's `morphTargets`, or a name in its `morphTargetNames`. Trim or split a clip that holds keys hours apart, and keep layers, weights and fades inside the range that the message gives.",
|
|
32
32
|
E1219: "Give each label an id of its own, such as 'hp-12', and pass the same id to engine.labels.bind on the page. Give transform one of 'screen', 'world' or 'billboard', and a rotation only to a billboard label. Untrack labels that you no longer show with ui.untrackLabel. To track more labels at once, raise createEngine's maxLabels option, or maxLabels3d for labels that are planes of the scene.",
|
|
33
33
|
E1220: "Give render.addPass the options of its kind, such as { kind: 'scene', camera, writes: 'minimap', size: [256, 256] }. Give a compute pass a workgroup size that the shader declares and that a device runs, and a fallback for WebGL2. Give each pass a name and a texture name of its own. Remove passes that no longer draw before you add more.",
|
|
34
34
|
E1221: 'List the levels from the most detailed down, each with a larger error, a farther distance or a smaller coverage than the one before, at most 15 of them. Make each level from the same kind of arrays as the base mesh, with the same attributes, such as the same texture coordinates and tangents. Give a mesh that poses or moves its levels with setLevels, not buildLevels.',
|
|
35
35
|
E1222: "Make the grid's texture with LightProbeGridData.toTexture(), which a 3D texture alone holds, or with textures.fromVolumeData(). An image texture, or one made with textures.fromData() and a depth, is a texture array, which the probe grid cannot bind.",
|
|
36
|
-
E1223:
|
|
36
|
+
E1223: 'Give each feature and output a name of its own. Give a frame point and a kind that go together, and keep the order inside its band. Name resources, lighting slots and views from the lists, and give every output a neutral default. One feature provides each lighting slot, and a setting takes the values that its range allows.',
|
|
37
37
|
E1224: 'Give scene.overrideMaterial a material that draws meshes, from materials.standard(), materials.unlit(), materials.shader() or materials.decal(), or null to draw each mesh with its own material.',
|
|
38
38
|
E1225: "Give each add-on a namespace of its own: one name at declareAddonNamespace(), claimed once where the add-on's module loads, with the package that owns it. Let its shader library default to that name, keep its error codes inside 2000 to 9999, and give its quality keys names that the engine's table lacks. Give each feature, output and lighting slot a name that no other add-on registers. Two add-ons that share a name cannot load together.",
|
|
39
39
|
E1301: 'Remove a ?gpu= switch or createEngine gpu option that forces a path this browser lacks. Update the browser, or turn on hardware acceleration in its settings.',
|
|
@@ -42,23 +42,23 @@ export const ERROR_FIXES = {
|
|
|
42
42
|
E1304: 'Lower the quality preset, use smaller or compressed textures, and share meshes and textures between objects. Destroy objects and textures that the scene no longer shows.',
|
|
43
43
|
E1305: "Read the message: it quotes the GPU path. A buffer or texture past the device's limits names the limit: make the scene smaller there. Otherwise this is an engine bug: report it with the message and the browser.",
|
|
44
44
|
E1306: 'Update Safari to version 18 or later. On iPhone and iPad, update iOS or iPadOS to 18 or later, which updates the engine of every browser there.',
|
|
45
|
-
E1307: "
|
|
45
|
+
E1307: "Read the message: it names the pipeline and quotes the driver. If it names a custom material, shorten that material's WGSL, with fewer texture reads, loops and calls. On a device with little memory, use a lower quality preset, smaller textures and fewer objects. Update the browser and the device's system software, and report an engine template with the device.",
|
|
46
46
|
E1401: 'End the sketch module with export default defineSketch(...), and pass that module to createEngine.',
|
|
47
47
|
E1402: 'Reinstall the engine package so all of its parts come from one version. If you build the engine from source, run bun run build again.',
|
|
48
48
|
E1403: 'Create objects in the setup function you pass to defineSketch, or later, never when the sketch module loads.',
|
|
49
49
|
E1404: 'This is an engine bug. Report it with the message and the browser, then destroy the engine and start it again.',
|
|
50
|
-
E1405: "Read the message: it names the worker that did not start, and why. The sketch worker also reports an error that your sketch's setup function threw
|
|
50
|
+
E1405: "Read the message: it names the worker that did not start, and why. The sketch worker also reports an error that your sketch's setup function threw: fix the setup function. Otherwise, check that the page is served with the isolation headers and that the engine files load. Allow the workers in the `worker-src` of a Content-Security-Policy, and report the error if it repeats.",
|
|
51
51
|
E1406: "Check that the host serves every file that the build wrote, at the paths that the build gave them. The engine's .wasm files, the KTX2 transcoder's files, the glTF loader's files, the meshopt decoder and the level planner's simplifier are among them. If the page loads at other times, the network dropped: reload the page.",
|
|
52
52
|
E1407: 'Give the sketch time to hold at in seconds, such as ?hold=1.5 or hold: 1.5. A bare ?hold holds at the time of the hold option, or at 0 without one.',
|
|
53
53
|
E1408: 'Fix the error that the message quotes. When the message gives a sketch time, the sketch failed at that time, and the console shows the error with its stack.',
|
|
54
54
|
E1409: 'Give memory.maximumMiB a whole number of MiB from 256 to 4096, such as 2048, or leave the option out for the default of 1024.',
|
|
55
55
|
E1410: "Pass the sketch as new URL('./sketch.ts', import.meta.url), so that the bundler ships the module and the engine finds it. When the download worked, the module's own code threw the error that the message quotes while the module loaded: fix that error.",
|
|
56
56
|
E1411: "Check the file's address: a relative address resolves against the page's address, and new URL('./file.png', import.meta.url) resolves against the sketch module's. Check that the server sends the file, and handle the error where the file is optional.",
|
|
57
|
-
E1412: 'Give loadTexture and loadImageBitmap a PNG, JPEG or WebP file, or an AVIF file in
|
|
57
|
+
E1412: 'Give `loadTexture` and `loadImageBitmap` a PNG, JPEG or WebP file, or an AVIF file in a browser that decodes AVIF. Give `loadTexture` KTX2 files of 2D ETC1S or UASTC data, as basisu writes them. Give `loadJson` valid JSON, and check that the server sends the file itself, not an error page. Save KTX2 textures no larger than `textures.maxSize` on each side.',
|
|
58
58
|
E1413: "Serve the file from the same origin as the page, or have its server send Access-Control-Allow-Origin with the page's origin or *. On a page with Cross-Origin-Embedder-Policy: require-corp, the file needs that header too.",
|
|
59
59
|
E1414: 'Call engine.capture() while the engine runs, before destroy(). When the message names a GPU failure, wait for the engine to recover from it and call capture() again. When it says that the worker did not answer, the thread that draws is stuck, often inside a GPU call that never returned: reload the page, or start another engine on another canvas.',
|
|
60
60
|
E1415: "Stop the other engine with destroy() and wait for its promise before you start this one. To run both at once, leave out sketchThread: 'main' on one of them, so that its sketch runs in a worker.",
|
|
61
|
-
E1416: 'Check that the file is a glTF 2.0 model
|
|
61
|
+
E1416: 'Check that the file is a glTF 2.0 model: a .glb file, or a .gltf file with its buffers and images beside it. For a broken file, open it in the Khronos glTF Validator and export it again. For a skeleton that is too large, export each character to its own file. For a file over a size limit, split it or simplify its meshes.',
|
|
62
62
|
E1417: 'Export the model again without the extension that the message names, or import the add-on that the message names and register its handler on assets. Call createInstances with a model that has meshes and no instancing of its own, or with one of its meshes and a material.',
|
|
63
63
|
E1418: "Add 'wasm-unsafe-eval' to the script-src of the page's Content-Security-Policy, for example script-src 'self' 'wasm-unsafe-eval'. It allows WebAssembly and no JavaScript eval. The hosting page of the docs gives the whole policy that the engine needs.",
|
|
64
64
|
E1419: "Wait for the other engine's destroy() promise before you start a new engine on its canvas. In React, call destroy() in the effect's cleanup. When the message says that no engine can draw on the canvas again, put a new canvas element in its place.",
|
|
@@ -73,11 +73,11 @@ export const ERROR_FIXES = {
|
|
|
73
73
|
E1431: "Serve the engine's area-light-tables.bin file at the address that the message names. A build with the null3D Vite plugin copies it beside the engine's code: deploy it with the rest of the build. When the engine's files come from another origin, that server must send Access-Control-Allow-Origin, and the page's connect-src must allow the origin.",
|
|
74
74
|
E1432: "Run bunx @null3d/cli upgrade in the project's folder, then bun install, so that every null3D package takes one version. An add-on that the project builds itself names the engine version that the project develops against.",
|
|
75
75
|
E1433: "Install the release of the add-on that matches this engine's plugin interface, or run the project on an engine whose plugin interface the add-on declares. The engine's own add-ons need no range: run bunx @null3d/cli upgrade, then bun install, so that each one takes the engine's version.",
|
|
76
|
-
E1434: "Read the fault that the message names in the baked light file. Write version 1 of the format, which docs/guides/baked-light-data.md describes: a JSON object with the marker null3d.baked-light, the version, the kind, and the base64 payloads that its kind needs. Make each payload's length match the counts or the size that the same file gives. Read the file to its end, since a file cut short has no complete JSON.",
|
|
76
|
+
E1434: "Read the fault that the message names in the baked light file. Write version 1 of the format, which https://github.com/null3d-engine/null3d/blob/generated/docs/guides/baked-light-data.md describes: a JSON object with the marker null3d.baked-light, the version, the kind, and the base64 payloads that its kind needs. Make each payload's length match the counts or the size that the same file gives. Read the file to its end, since a file cut short has no complete JSON.",
|
|
77
77
|
E1435: "Record the session again with the engine that recorded it, or update the engine that reads the file. When the message names a sketch, open the page with that sketch: a replay runs the file's frames on the scene that recorded them. When it names a key or a fixed step rate, the recording came from a sketch that this engine cannot run as it ran. A replay starts at the file's first frame, so a file must come from a session that started at the page's first frame.",
|
|
78
78
|
E1436: 'Ask for the pick again: the engine started a new GPU device, which answers a new pick. A pick that waits when the device is lost is rejected rather than repeated, because the frame that recorded it drew on the lost device.',
|
|
79
|
-
E1437: "Run the command again
|
|
80
|
-
E1501: 'Share meshes and
|
|
79
|
+
E1437: "Run the command again: a download that broke off, or that something changed on the way, fails the check. If the check fails again, a proxy or a mirror between this computer and Google's storage changes the file, so download without it. A refused archive is a warning, and stops the command only when `NULL3D_CHROME=testing` asks for Chrome for Testing alone. A platform with no Chrome for Testing build draws with the installed Google Chrome, or with Playwright's Chromium when `CI=1` is set.",
|
|
80
|
+
E1501: 'Share meshes, materials and textures between objects instead of creating them per object. Draw many copies of one mesh with an instance batch, and size each batch for the rows it uses. For a large crowd of skinned characters on WebGPU, use models with fewer vertices or fewer copies. The crowd draws again once it fits.',
|
|
81
81
|
E1502: "Name in reads only the textures that your other passes write, as their writes option spells them. Add the pass that writes a texture before a pass that reads it, and remove a pass that reads a texture before the pass that writes it. If the message names only the engine's own passes, report it with the message, the browser and the quality preset.",
|
|
82
82
|
E1503: "Give each pass's texture a name that no other pass writes. The engine's own passes write sceneColor, sceneDepth, outlineMask and the other names that render.dumpGraph() shows, so pick another name.",
|
|
83
83
|
E1504: 'Break the loop: a pass cannot read its own texture. To show a mirror in a mirror, add a pass for the inner mirror first, and let the outer pass read its texture.',
|
package/lib/gpu/variants.d.ts
CHANGED
|
@@ -10,7 +10,13 @@ export declare function variantFor<Pipeline extends string>(shader: ShaderVarian
|
|
|
10
10
|
/**
|
|
11
11
|
* The message for a pipeline whose variant no loaded module holds. A variant that loads on first
|
|
12
12
|
* use is absent until its module arrives, so only a caller that has waited for every module calls
|
|
13
|
-
* this. A set narrowed to a
|
|
14
|
-
* that its manifest cannot make.
|
|
13
|
+
* this. A set narrowed to a project's list names the word to add, as the list writes it, without
|
|
14
|
+
* the bits that a device fixes. A full set names the word that its manifest cannot make.
|
|
15
15
|
*/
|
|
16
16
|
export declare function missingVariant(permutation: number, listed?: boolean): string;
|
|
17
|
+
/**
|
|
18
|
+
* The message for an engine pass whose shader, which the device's modules hold from the start, no
|
|
19
|
+
* module holds with the word `permutation`. A set narrowed to a project's list names the word
|
|
20
|
+
* that the list lacks, as `missingVariant` does.
|
|
21
|
+
*/
|
|
22
|
+
export declare function missingShader(name: string, permutation: number, listed?: boolean): string;
|
package/lib/gpu/variants.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// backend builds a render pipeline from the variant that the pipeline's permutation word names.
|
|
4
4
|
import { PERMUTATION_DRAW_INDEX, PERMUTATION_HALF, PERMUTATION_TONE_MAP } from '../generated/gpu.js';
|
|
5
5
|
import { LISTED_PERMUTATIONS } from '../generated/shader-permutations.js';
|
|
6
|
+
import { DEV } from '../shared/dev.js';
|
|
6
7
|
/** The variant built with exactly the bits of `permutation`, with output for `target`. */
|
|
7
8
|
function exactly(shader, permutation, target) {
|
|
8
9
|
for (const name in shader) {
|
|
@@ -36,6 +37,20 @@ export function stopRecordingPermutations() {
|
|
|
36
37
|
recorded = undefined;
|
|
37
38
|
return words;
|
|
38
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* In a development build, the words that this thread has reported, and where it reports each new
|
|
42
|
+
* one. The dev server compares them with the project's shader list, so a word that a production
|
|
43
|
+
* build with the list lacks shows while the page runs, not first in the built page.
|
|
44
|
+
*/
|
|
45
|
+
let reporting;
|
|
46
|
+
/**
|
|
47
|
+
* @internal In a development build, hands `report` each permutation word that a pipeline finds
|
|
48
|
+
* from now on, once per word, as a recording lists it. A production build reports nothing.
|
|
49
|
+
*/
|
|
50
|
+
export function reportPermutations(report) {
|
|
51
|
+
if (DEV)
|
|
52
|
+
reporting = { words: new Set(), report };
|
|
53
|
+
}
|
|
39
54
|
/**
|
|
40
55
|
* The variant of a shader for a pipeline's permutation word, with output for `target`, or
|
|
41
56
|
* undefined when the shader has none. The word never holds the half precision bit, which the
|
|
@@ -49,19 +64,36 @@ export function variantFor(shader, permutation, target) {
|
|
|
49
64
|
const found = exactly(shader, half, target) ?? exactly(shader, permutation, target);
|
|
50
65
|
// A recording lists the words that the scene draws with, so a narrowed build builds them. The
|
|
51
66
|
// bits a device fixes are left out, so one list holds the words of every device module.
|
|
52
|
-
|
|
53
|
-
|
|
67
|
+
// A development build reports the same words to the dev server.
|
|
68
|
+
if (found !== undefined) {
|
|
69
|
+
const word = (permutation & ~DEVICE_BITS) >>> 0;
|
|
70
|
+
recorded?.add(word);
|
|
71
|
+
if (DEV && reporting !== undefined && !reporting.words.has(word)) {
|
|
72
|
+
reporting.words.add(word);
|
|
73
|
+
reporting.report(word);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
54
76
|
return found;
|
|
55
77
|
}
|
|
56
78
|
/**
|
|
57
79
|
* The message for a pipeline whose variant no loaded module holds. A variant that loads on first
|
|
58
80
|
* use is absent until its module arrives, so only a caller that has waited for every module calls
|
|
59
|
-
* this. A set narrowed to a
|
|
60
|
-
* that its manifest cannot make.
|
|
81
|
+
* this. A set narrowed to a project's list names the word to add, as the list writes it, without
|
|
82
|
+
* the bits that a device fixes. A full set names the word that its manifest cannot make.
|
|
61
83
|
*/
|
|
62
84
|
export function missingVariant(permutation, listed = LISTED_PERMUTATIONS !== null) {
|
|
63
|
-
|
|
85
|
+
if (!listed)
|
|
86
|
+
return `the shader set has no variant for the permutation word 0x${(permutation >>> 0).toString(16)}.`;
|
|
87
|
+
const word = `0x${((permutation & ~DEVICE_BITS) >>> 0).toString(16).padStart(8, '0')}`;
|
|
88
|
+
return `the shader set holds only the permutation words of the project's shader list, and this pipeline asks for ${word}, which the list lacks. Record the pages again with bunx @null3d/cli shaders record so that the word reaches the list, or add ${word} to the list by hand, and build again.`;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* The message for an engine pass whose shader, which the device's modules hold from the start, no
|
|
92
|
+
* module holds with the word `permutation`. A set narrowed to a project's list names the word
|
|
93
|
+
* that the list lacks, as `missingVariant` does.
|
|
94
|
+
*/
|
|
95
|
+
export function missingShader(name, permutation, listed = LISTED_PERMUTATIONS !== null) {
|
|
64
96
|
return listed
|
|
65
|
-
? `the
|
|
66
|
-
: `the shader
|
|
97
|
+
? `the ${name} shader is missing: ${missingVariant(permutation, true)}`
|
|
98
|
+
: `the device's shader modules have no ${name} shader`;
|
|
67
99
|
}
|
|
@@ -289,7 +289,7 @@ export function createProgram(gl, template, permutation) {
|
|
|
289
289
|
const shading = variantFor(template.shader, build, 'glsl')?.glsl?.[template.pipeline];
|
|
290
290
|
const source = shading && build !== permutation ? { ...shading, fragment: PREPASS_FRAGMENT } : shading;
|
|
291
291
|
if (!source)
|
|
292
|
-
throw new Error(`a render pipeline template: ${missingVariant(
|
|
292
|
+
throw new Error(`a render pipeline template: ${missingVariant(build)}`);
|
|
293
293
|
const { program, shaders } = link(gl, source, '');
|
|
294
294
|
return {
|
|
295
295
|
program,
|
|
@@ -8,7 +8,7 @@ import { DEBUG_LINES_SHADER, DEBUG_VIEW_SHADER, MOTION_VIEW_SHADER, } from '../.
|
|
|
8
8
|
import { LINE_VERTICES } from '../line-vertices.js';
|
|
9
9
|
import { PARTICLE_RECORDS } from '../particle-records.js';
|
|
10
10
|
import { pipelineName } from '../pipeline-name.js';
|
|
11
|
-
import { missingVariant, variantFor } from '../variants.js';
|
|
11
|
+
import { missingShader, missingVariant, variantFor } from '../variants.js';
|
|
12
12
|
import { plainScale, variantLocations, vertexAttribute, vertexStride, } from '../vertex-format.js';
|
|
13
13
|
/**
|
|
14
14
|
* True in development builds, which add the debug views' templates. This file reads the constant
|
|
@@ -1693,7 +1693,7 @@ export class Pipelines {
|
|
|
1693
1693
|
const build = ownPrepass && !cutoutPrepass ? (permutation & ~PERMUTATION_PREPASS) >>> 0 : permutation;
|
|
1694
1694
|
const shader = variantFor(t.shader, build, 'wgsl')?.wgsl;
|
|
1695
1695
|
if (!shader)
|
|
1696
|
-
throw new Error(`render template ${template}: ${missingVariant(
|
|
1696
|
+
throw new Error(`render template ${template}: ${missingVariant(build)}`);
|
|
1697
1697
|
const module = this.module(t.label, shader);
|
|
1698
1698
|
const entryPoints = shader.pipelines[t.pipeline];
|
|
1699
1699
|
const skins = (permutation & PERMUTATION_SKIN) !== 0;
|
|
@@ -1837,7 +1837,7 @@ export class Pipelines {
|
|
|
1837
1837
|
mipDescriptor(format, entry) {
|
|
1838
1838
|
const shader = this.mipmap;
|
|
1839
1839
|
if (!shader)
|
|
1840
|
-
throw new Error(
|
|
1840
|
+
throw new Error(missingShader('mip level', 0));
|
|
1841
1841
|
const module = this.module('mipmaps', shader);
|
|
1842
1842
|
const entryPoints = shader.pipelines[entry];
|
|
1843
1843
|
return {
|
|
@@ -1895,7 +1895,7 @@ export class Pipelines {
|
|
|
1895
1895
|
const color = (permutation & PERMUTATION_VERTEX_COLOR) !== 0 ? ' color' : '';
|
|
1896
1896
|
const shader = variantFor(this.skin, permutation, 'wgsl')?.wgsl;
|
|
1897
1897
|
if (!shader)
|
|
1898
|
-
throw new Error(
|
|
1898
|
+
throw new Error(missingShader('skinning', permutation));
|
|
1899
1899
|
const constants = this.floatSkinnedDirections ? { [NARROW_DIRECTIONS_ID]: 0 } : undefined;
|
|
1900
1900
|
return {
|
|
1901
1901
|
label: `skin${tangent}${color}`,
|
|
@@ -1906,7 +1906,7 @@ export class Pipelines {
|
|
|
1906
1906
|
if (template === TEMPLATE_CULL && permutation & PERMUTATION_MOTION) {
|
|
1907
1907
|
const shader = variantFor(this.cullMotion, permutation, 'wgsl')?.wgsl;
|
|
1908
1908
|
if (!shader)
|
|
1909
|
-
throw new Error(
|
|
1909
|
+
throw new Error(missingShader('motion culling', permutation));
|
|
1910
1910
|
return {
|
|
1911
1911
|
label: 'cull motion',
|
|
1912
1912
|
layout: this.cullLayout,
|
|
@@ -1915,7 +1915,7 @@ export class Pipelines {
|
|
|
1915
1915
|
}
|
|
1916
1916
|
if (template === TEMPLATE_CULL) {
|
|
1917
1917
|
if (!this.cull)
|
|
1918
|
-
throw new Error(
|
|
1918
|
+
throw new Error(missingShader('culling', 0));
|
|
1919
1919
|
return {
|
|
1920
1920
|
label: 'cull',
|
|
1921
1921
|
layout: this.cullLayout,
|
|
@@ -1926,7 +1926,7 @@ export class Pipelines {
|
|
|
1926
1926
|
if (phase) {
|
|
1927
1927
|
const shader = variantFor(this.occlusion, 0, 'wgsl')?.wgsl;
|
|
1928
1928
|
if (!shader)
|
|
1929
|
-
throw new Error(
|
|
1929
|
+
throw new Error(missingShader('occlusion culling', 0));
|
|
1930
1930
|
return {
|
|
1931
1931
|
label: `occlusion ${phase}`,
|
|
1932
1932
|
layout: this.cullLayout,
|
|
@@ -1936,7 +1936,7 @@ export class Pipelines {
|
|
|
1936
1936
|
if (template === TEMPLATE_CLUSTER) {
|
|
1937
1937
|
const shader = this.cluster ? variantFor(this.cluster, 0, 'wgsl')?.wgsl : undefined;
|
|
1938
1938
|
if (!shader)
|
|
1939
|
-
throw new Error(
|
|
1939
|
+
throw new Error(missingShader('cluster', 0));
|
|
1940
1940
|
return {
|
|
1941
1941
|
label: 'cluster cull',
|
|
1942
1942
|
layout: this.clusterLayout,
|
|
@@ -1946,7 +1946,7 @@ export class Pipelines {
|
|
|
1946
1946
|
if (template === TEMPLATE_DEPTH_PYRAMID) {
|
|
1947
1947
|
const shader = variantFor(this.pyramid, 0, 'wgsl')?.wgsl;
|
|
1948
1948
|
if (!shader)
|
|
1949
|
-
throw new Error(
|
|
1949
|
+
throw new Error(missingShader('depth pyramid', 0));
|
|
1950
1950
|
return {
|
|
1951
1951
|
label: 'depth pyramid',
|
|
1952
1952
|
layout: this.pyramidLayout,
|
|
@@ -1956,7 +1956,7 @@ export class Pipelines {
|
|
|
1956
1956
|
if (template === TEMPLATE_FEATURE_ROWS) {
|
|
1957
1957
|
const shader = variantFor(this.featureRows, 0, 'wgsl')?.wgsl;
|
|
1958
1958
|
if (!shader)
|
|
1959
|
-
throw new Error(
|
|
1959
|
+
throw new Error(missingShader('feature rows', 0));
|
|
1960
1960
|
this.featureRowsLayout ??= this.device.createPipelineLayout({
|
|
1961
1961
|
bindGroupLayouts: [this.layout(LAYOUT_FEATURE_ROWS)],
|
|
1962
1962
|
});
|
|
@@ -1970,7 +1970,7 @@ export class Pipelines {
|
|
|
1970
1970
|
if (exposureEntry) {
|
|
1971
1971
|
const shader = variantFor(this.exposureHistogram, 0, 'wgsl')?.wgsl;
|
|
1972
1972
|
if (!shader)
|
|
1973
|
-
throw new Error(
|
|
1973
|
+
throw new Error(missingShader('exposure histogram', 0));
|
|
1974
1974
|
this.exposureLayout ??= this.device.createPipelineLayout({
|
|
1975
1975
|
bindGroupLayouts: [this.layout(LAYOUT_EXPOSURE)],
|
|
1976
1976
|
});
|
|
@@ -1988,7 +1988,7 @@ export class Pipelines {
|
|
|
1988
1988
|
const clear = template === TEMPLATE_LIGHT_DEPTH_CLEAR || template === TEMPLATE_LIGHT_DEPTH_CLEAR_MS;
|
|
1989
1989
|
const shader = multisampled ? this.lightDepthMs : this.lightDepth;
|
|
1990
1990
|
if (!shader)
|
|
1991
|
-
throw new Error(
|
|
1991
|
+
throw new Error(missingShader('light depth', 0));
|
|
1992
1992
|
return {
|
|
1993
1993
|
label: clear ? 'light depth clear' : 'light depth',
|
|
1994
1994
|
layout: multisampled ? this.lightDepthMsLayout : this.lightDepthLayout,
|
|
@@ -2003,7 +2003,7 @@ export class Pipelines {
|
|
|
2003
2003
|
throw new Error(`unknown compute template ${template}`);
|
|
2004
2004
|
const shader = this.lightClusters;
|
|
2005
2005
|
if (!shader)
|
|
2006
|
-
throw new Error(
|
|
2006
|
+
throw new Error(missingShader('light clustering', 0));
|
|
2007
2007
|
return {
|
|
2008
2008
|
label: entryPoint,
|
|
2009
2009
|
layout: this.lightLayout,
|
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type { Debug, DebugGridOptions, DebugLightOptions, DebugView, DebugViewName, } from './debug/debug.js';
|
|
2
2
|
export type { FrameStats, FrameStatsStep, FrameStatsThread } from './debug/stats.js';
|
|
3
|
-
export type { StatsOverlayOptions } from './debug/stats-options.js';
|
|
3
|
+
export type { StatsCorner, StatsOverlayOptions } from './debug/stats-options.js';
|
|
4
4
|
export type { EngineDebugView } from './debug/view-names.js';
|
|
5
5
|
export { EngineError } from './errors/engine-error.js';
|
|
6
6
|
export type { ErrorCode } from './errors/fixes.js';
|
|
@@ -31,7 +31,7 @@ export interface WebGPUReport {
|
|
|
31
31
|
* True when the start-up probe measured the device drawing a bucket faster with direct draws
|
|
32
32
|
* than with the engine's indirect draws, so the engine draws directly. The probe runs on a
|
|
33
33
|
* worker's device, and only on an Apple GPU in WebKit, whose validation of each indirect draw
|
|
34
|
-
* the direct path removes
|
|
34
|
+
* the direct path removes. False on WebGL2.
|
|
35
35
|
*/
|
|
36
36
|
directDraws: boolean;
|
|
37
37
|
/** Why the probe chose that draw path, or why it did not measure. */
|
package/lib/page/engine.d.ts
CHANGED
|
@@ -33,6 +33,15 @@ export interface EngineOptions {
|
|
|
33
33
|
canvas: HTMLCanvasElement;
|
|
34
34
|
/** The sketch module, which runs in the sketch worker; `new URL('./sketch.ts', import.meta.url)`. */
|
|
35
35
|
sketch: URL | string;
|
|
36
|
+
/**
|
|
37
|
+
* Start data for the sketch, which its setup reads as `ctx.data`: the state that the page knows
|
|
38
|
+
* before the scene starts, such as the section that the address names, a saved color mode or a
|
|
39
|
+
* level number. It reaches the setup before the first frame, also in hold mode, where no message
|
|
40
|
+
* can. It takes plain JSON data: objects, arrays, strings, finite numbers, booleans and null, up
|
|
41
|
+
* to 64 KiB as JSON. Another value fails with E1213. A recording keeps it, and a replay gives
|
|
42
|
+
* the sketch the recorded data.
|
|
43
|
+
*/
|
|
44
|
+
sketchData?: unknown;
|
|
36
45
|
/**
|
|
37
46
|
* The quality preset: `auto`, the default, lets the engine choose one for the device, and
|
|
38
47
|
* `low`, `medium`, `high` or `ultra` names one. The GPU path caps it: WebGL2 and WebGPU's
|
|
@@ -200,8 +209,8 @@ export interface EngineOptions {
|
|
|
200
209
|
transparent?: boolean;
|
|
201
210
|
/**
|
|
202
211
|
* False draws the scene into 8-bit color, where each material's shader applies the output
|
|
203
|
-
* transform, instead of HDR color, which the final pass tone maps. Both paths
|
|
204
|
-
* material's `toneMapped: false`, and the 8-bit path also
|
|
212
|
+
* transform, instead of HDR color, which the final pass tone maps. Both paths honor a
|
|
213
|
+
* material's `toneMapped: false`, and the 8-bit path also honors it on a blended surface. The
|
|
205
214
|
* default lets the engine pick the path from the device, which draws HDR color wherever it
|
|
206
215
|
* can. The `?hdr=off` switch takes the 8-bit path too.
|
|
207
216
|
*/
|
|
@@ -640,12 +649,12 @@ export interface Engine {
|
|
|
640
649
|
*/
|
|
641
650
|
inspect?(call: string, args?: unknown): Promise<unknown>;
|
|
642
651
|
/**
|
|
643
|
-
* Shows an overlay of figures over
|
|
652
|
+
* Shows an overlay of figures over a right-hand corner of the canvas, or hides it with
|
|
644
653
|
* `false`: the GPU path, the frame rates, CPU time per frame of each thread, GPU time, draw
|
|
645
654
|
* calls, triangles and objects drawn, memory, and the page thread's long tasks and input delay.
|
|
646
655
|
* Its header is a button with the frame rate, which shows and hides the other figures. Options
|
|
647
|
-
* pick whether the overlay starts collapsed to its header
|
|
648
|
-
* the options it names. The page draws the overlay and updates it a few times a second, and its
|
|
656
|
+
* pick whether the overlay starts collapsed to its header, and its corner: the top right by
|
|
657
|
+
* default, or the bottom right. A call on a shown overlay changes the options it names. The page draws the overlay and updates it a few times a second, and its
|
|
649
658
|
* code downloads at the first call. While the other figures show, the engine times one frame in
|
|
650
659
|
* eleven on the GPU and reads back the counts of the objects that the GPU culls, which costs a
|
|
651
660
|
* little GPU time. The sketch's `debug.stats` shows and hides the same overlay, and the last
|
package/lib/page/engine.js
CHANGED
|
@@ -15,7 +15,7 @@ import { EngineError, errorFixesReady, errorOfMessage } from '../errors/engine-e
|
|
|
15
15
|
import { messageOf } from '../errors/message.js';
|
|
16
16
|
import { FORMAT_CANVAS, PERMUTATION_HALF } from '../generated/gpu.js';
|
|
17
17
|
import { SHADER_FEATURES } from '../generated/shader-features.js';
|
|
18
|
-
import { recordPermutations, stopRecordingPermutations } from '../gpu/variants.js';
|
|
18
|
+
import { recordPermutations, reportPermutations, stopRecordingPermutations } from '../gpu/variants.js';
|
|
19
19
|
import { maxTargetFps, } from '../quality/check.js';
|
|
20
20
|
import { choosePreset, crashLowest, crashTier, deviceKind, gpuOcclusionChoice, memoryPreset, textureMemoryCap, withinTier, } from '../quality/chooser.js';
|
|
21
21
|
import { readDeviceHints } from '../quality/device-hints.js';
|
|
@@ -32,6 +32,8 @@ import { KEY_CODES } from '../shared/key-codes.js';
|
|
|
32
32
|
import { memoryBytes } from '../shared/memory-views.js';
|
|
33
33
|
import { createMetricsBuffer, MetricsReader, threadRoles } from '../shared/metrics.js';
|
|
34
34
|
import { addMeasurementRelease } from '../shared/page-measurement.js';
|
|
35
|
+
import { PERMUTATION_WORD_EVENT } from '../shared/permutation-words.js';
|
|
36
|
+
import { sketchDataText } from '../shared/sketch-data.js';
|
|
35
37
|
import { clearJobTasks, jobAsker, setJobTasks } from '../shared/task-host.js';
|
|
36
38
|
import { hearAddonsEarly, onAddonChecked } from '../shared/version.js';
|
|
37
39
|
import { VIDEO_FOLLOW } from '../shared/videos.js';
|
|
@@ -277,6 +279,10 @@ export class EngineWorker {
|
|
|
277
279
|
// frame has built the scene's pipelines.
|
|
278
280
|
this.recording?.answered(reply.role, reply.permutations);
|
|
279
281
|
return;
|
|
282
|
+
case 'permutation':
|
|
283
|
+
if (DEV)
|
|
284
|
+
announcePermutationWord(reply.word);
|
|
285
|
+
return;
|
|
280
286
|
case 'sketch-message':
|
|
281
287
|
events.sketchMessage(reply.name, reply.data);
|
|
282
288
|
return;
|
|
@@ -866,6 +872,7 @@ export async function createEngine(options) {
|
|
|
866
872
|
};
|
|
867
873
|
try {
|
|
868
874
|
checkPreload(options.preload);
|
|
875
|
+
const sketchData = sketchDataText(options.sketchData);
|
|
869
876
|
const hold = holdSeconds(options.hold, switches.hold);
|
|
870
877
|
// A test tool may set a timed script before the page loads. Only hold mode performs it, so a
|
|
871
878
|
// live engine ignores one left on the page.
|
|
@@ -881,7 +888,7 @@ export async function createEngine(options) {
|
|
|
881
888
|
}, () => new EngineError('E1419', 'createEngine() got a canvas that another engine draws on, which has not stopped.'));
|
|
882
889
|
if (canvas.dead)
|
|
883
890
|
throw new EngineError('E1419', `createEngine() got a canvas that no engine can draw on again: ${canvas.dead}.`);
|
|
884
|
-
return await startEngine(options, switches, { hold, holdScript, replay: switches.replay, record: switches.record }, place, canvas, holder, release);
|
|
891
|
+
return await startEngine(options, switches, { hold, holdScript, replay: switches.replay, record: switches.record, sketchData }, place, canvas, holder, release);
|
|
885
892
|
}
|
|
886
893
|
catch (error) {
|
|
887
894
|
release();
|
|
@@ -914,6 +921,10 @@ function placement(options, switches) {
|
|
|
914
921
|
const main = !threaded || (switches.sketchThread ?? options.sketchThread) === 'main';
|
|
915
922
|
return { threaded, sketchThread: main ? 'main' : 'worker' };
|
|
916
923
|
}
|
|
924
|
+
/** Fires the event that hands a permutation word that the page draws with to the dev server. */
|
|
925
|
+
function announcePermutationWord(word) {
|
|
926
|
+
globalThis.dispatchEvent?.(new CustomEvent(PERMUTATION_WORD_EVENT, { detail: word }));
|
|
927
|
+
}
|
|
917
928
|
/**
|
|
918
929
|
* Starts the engine with the page's switches. With a hold time or a replay, it resolves once the
|
|
919
930
|
* last frame is read back, and publishes it.
|
|
@@ -1717,6 +1728,9 @@ async function startEngine(options, switches, modes, { threaded, sketchThread },
|
|
|
1717
1728
|
globalThis.__null3dStopRecording = stopRecording;
|
|
1718
1729
|
if (recording && renderThread === 'main')
|
|
1719
1730
|
recordPermutations();
|
|
1731
|
+
// The dev server compares each word that the page draws with against the project's list.
|
|
1732
|
+
if (DEV && renderThread === 'main')
|
|
1733
|
+
reportPermutations(announcePermutationWord);
|
|
1720
1734
|
// What the thread that draws needs besides its canvas, whichever thread that is.
|
|
1721
1735
|
const rendererSetup = {
|
|
1722
1736
|
tier,
|
|
@@ -2017,6 +2031,7 @@ async function startEngine(options, switches, modes, { threaded, sketchThread },
|
|
|
2017
2031
|
...senders,
|
|
2018
2032
|
pageUrl: pageUrl ?? sketchUrl,
|
|
2019
2033
|
sketchUrl,
|
|
2034
|
+
data: modes.sketchData,
|
|
2020
2035
|
maxTargetFps: maxTarget,
|
|
2021
2036
|
threads: engineThreads,
|
|
2022
2037
|
twoStepProbe: DEV && switches.twoStep,
|
|
@@ -2063,6 +2078,7 @@ async function startEngine(options, switches, modes, { threaded, sketchThread },
|
|
|
2063
2078
|
...handoff,
|
|
2064
2079
|
sketchUrl,
|
|
2065
2080
|
pageUrl: pageUrl ?? sketchUrl,
|
|
2081
|
+
data: modes.sketchData,
|
|
2066
2082
|
keyCodes: KEY_CODES,
|
|
2067
2083
|
jobWorkers,
|
|
2068
2084
|
capabilities,
|
package/lib/page/label-loop.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// scene: it sits in a container of its own, which holds the camera's perspective and turn, and its
|
|
12
12
|
// transform is the element's world matrix. The browser then turns it as it turns the scene.
|
|
13
13
|
import { controlLabels, Slot } from '../shared/control.js';
|
|
14
|
-
import { CAMERA_CENTER_X, CAMERA_CENTER_Y, CAMERA_HALF_HEIGHT, CAMERA_ORTHO, GENERATION_SHIFT, LABEL_SHOWN, LABEL_STATE, LABEL_WORDS, LABEL_X, LABEL_Y, LABEL3D_STATE, LABEL3D_WORDS, labelSequence, PRESENTED_TABLE, presentedCount, presentedCount3d, presentedFrame, presentedTable3d, TABLE_3D, } from '../shared/labels.js';
|
|
14
|
+
import { CAMERA_CENTER_X, CAMERA_CENTER_Y, CAMERA_FLOATS, CAMERA_HALF_HEIGHT, CAMERA_ORTHO, CAMERA_SHIFT_X, CAMERA_SHIFT_Y, GENERATION_SHIFT, LABEL_SHOWN, LABEL_STATE, LABEL_WORDS, LABEL_X, LABEL_Y, LABEL3D_STATE, LABEL3D_WORDS, labelSequence, PRESENTED_TABLE, presentedCount, presentedCount3d, presentedFrame, presentedTable3d, TABLE_3D, } from '../shared/labels.js';
|
|
15
15
|
/** How many times an update reads the labels again when the thread that draws changed them meanwhile. */
|
|
16
16
|
const READ_TRIES = 3;
|
|
17
17
|
/** The smallest move, in CSS pixels, that moves a screen label's element. */
|
|
@@ -23,7 +23,7 @@ const STATE_Y = 1;
|
|
|
23
23
|
const STATE_SHOWN = 2;
|
|
24
24
|
const STATE_MATRIX = 3;
|
|
25
25
|
/** The camera record that the containers show, then the canvas size they were made for. */
|
|
26
|
-
const CAMERA_STATE =
|
|
26
|
+
const CAMERA_STATE = CAMERA_FLOATS + 2;
|
|
27
27
|
/** The smallest number of a matrix that counts as zero, so a turn of the camera writes no noise. */
|
|
28
28
|
const EPSILON = 1e-10;
|
|
29
29
|
/** The bound elements, and the loop that moves them. */
|
|
@@ -406,10 +406,15 @@ export function cameraTransform(camera, width, height) {
|
|
|
406
406
|
`${number(camera[1])},${number(-camera[4])},${number(camera[7])},0,` +
|
|
407
407
|
`${number(camera[2])},${number(-camera[5])},${number(camera[8])},0,` +
|
|
408
408
|
`${number(tx)},${number(-ty)},${number(tz)},1)`;
|
|
409
|
-
const
|
|
409
|
+
const lens = camera[CAMERA_ORTHO] !== 0
|
|
410
410
|
? `scale(${number(focal)}) translate(${number(-camera[CAMERA_CENTER_X])}px,${number(camera[CAMERA_CENTER_Y])}px) `
|
|
411
411
|
: `perspective(${number(focal)}px) translateZ(${number(focal)}px) `;
|
|
412
|
-
|
|
412
|
+
// A lens shift moves the whole image after the projection, left and down for a view shifted
|
|
413
|
+
// right and up.
|
|
414
|
+
const shiftX = camera[CAMERA_SHIFT_X] * width;
|
|
415
|
+
const shiftY = camera[CAMERA_SHIFT_Y] * height;
|
|
416
|
+
const shift = shiftX === 0 && shiftY === 0 ? '' : `translate(${number(-shiftX)}px,${number(shiftY)}px) `;
|
|
417
|
+
return `${shift}${lens}${matrix} translate(${number(width / 2)}px,${number(height / 2)}px)`;
|
|
413
418
|
}
|
|
414
419
|
/** A number as CSS takes it, with the noise of a turn that did not move it set to zero. */
|
|
415
420
|
function number(value) {
|
package/lib/page/stats-switch.js
CHANGED
|
@@ -27,6 +27,8 @@ export class StatsSwitch {
|
|
|
27
27
|
if (show !== true) {
|
|
28
28
|
if (show.collapsed !== undefined)
|
|
29
29
|
this.options.collapsed = show.collapsed;
|
|
30
|
+
if (show.corner !== undefined)
|
|
31
|
+
this.options.corner = show.corner;
|
|
30
32
|
this.overlay?.configure(show);
|
|
31
33
|
}
|
|
32
34
|
this.load ??= import('../debug/overlay.js');
|
package/lib/page/switches.d.ts
CHANGED
|
@@ -34,8 +34,9 @@ export type LatencyMode = 'pipelined' | 'low';
|
|
|
34
34
|
export type SketchThread = 'worker' | 'main';
|
|
35
35
|
/**
|
|
36
36
|
* How the GPU path stores depth. In `reversed` depth, the near plane stores 1 and the far plane 0,
|
|
37
|
-
* in a 32-bit float depth buffer. That keeps depth precise far from the camera.
|
|
38
|
-
*
|
|
37
|
+
* in a 32-bit float depth buffer. That keeps depth precise far from the camera.
|
|
38
|
+
*
|
|
39
|
+
* WebGPU always draws it. WebGL2 draws it where the browser has the `EXT_clip_control` extension, which gives
|
|
39
40
|
* WebGL2 the depth range from 0 to 1 that WebGPU has. The `reversed-gl` mode keeps the same
|
|
40
41
|
* order, but in WebGL2's own depth range from -1 to 1, which loses most of the precision. In
|
|
41
42
|
* `standard` depth, the near plane stores 0 and the far plane 1.
|
|
@@ -311,8 +312,9 @@ export interface Switches {
|
|
|
311
312
|
view: string | undefined;
|
|
312
313
|
/**
|
|
313
314
|
* True when a bare ?stats or ?stats=on shows the stats overlay, false when ?stats=off hides it,
|
|
314
|
-
*
|
|
315
|
-
*
|
|
315
|
+
* and undefined without the switch. Options when the switch names a start state, `collapsed` or
|
|
316
|
+
* `open`, a corner, `top-right` or `bottom-right`, or one of each with a comma between, such as
|
|
317
|
+
* ?stats=collapsed,bottom-right. It wins over the page's option.
|
|
316
318
|
*/
|
|
317
319
|
stats: StatsRequest | undefined;
|
|
318
320
|
/**
|
package/lib/page/switches.js
CHANGED
|
@@ -55,11 +55,27 @@ function oneOf(value, allowed) {
|
|
|
55
55
|
function onOff(value) {
|
|
56
56
|
return value === 'on' ? true : value === 'off' ? false : undefined;
|
|
57
57
|
}
|
|
58
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* ?stats: on for a bare switch or `on`, off for `off`, or options from a comma-separated list of a
|
|
60
|
+
* start state, `collapsed` or `open`, and a corner, `top-right` or `bottom-right`. A word that none
|
|
61
|
+
* of these is leaves the switch out.
|
|
62
|
+
*/
|
|
59
63
|
function statsSwitch(value) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
64
|
+
if (value === '')
|
|
65
|
+
return true;
|
|
66
|
+
const on = onOff(value);
|
|
67
|
+
if (on !== undefined || value === null)
|
|
68
|
+
return on;
|
|
69
|
+
const options = {};
|
|
70
|
+
for (const word of value.split(',')) {
|
|
71
|
+
if (word === 'collapsed' || word === 'open')
|
|
72
|
+
options.collapsed = word === 'collapsed';
|
|
73
|
+
else if (word === 'top-right' || word === 'bottom-right')
|
|
74
|
+
options.corner = word;
|
|
75
|
+
else
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
return options;
|
|
63
79
|
}
|
|
64
80
|
/** A number above 0, or undefined for a missing or unusable value. */
|
|
65
81
|
function positive(value) {
|