@null3d/engine 0.0.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/README.md +109 -0
- package/THIRD-PARTY-NOTICES.txt +0 -1
- package/dist/wasm/single/null3d.js +25 -10
- package/dist/wasm/single/null3d_bg.wasm +0 -0
- package/dist/wasm/threaded/null3d.js +25 -10
- package/dist/wasm/threaded/null3d_bg.wasm +0 -0
- package/docs/api/animation.md +114 -86
- package/docs/api/assets.md +135 -49
- package/docs/api/cameras.md +45 -12
- package/docs/api/controls.md +88 -62
- package/docs/api/debug.md +116 -41
- package/docs/api/engine.md +117 -35
- package/docs/api/feature-draws.md +23 -17
- package/docs/api/feature-effects.md +11 -11
- package/docs/api/feature-instances.md +70 -19
- package/docs/api/features.md +77 -47
- package/docs/api/geometry.md +132 -82
- package/docs/api/grass.md +55 -13
- package/docs/api/impostors.md +175 -22
- package/docs/api/input.md +24 -18
- package/docs/api/lights.md +78 -51
- package/docs/api/lines.md +41 -33
- package/docs/api/materials.md +248 -121
- package/docs/api/math.md +12 -13
- package/docs/api/objects.md +47 -22
- package/docs/api/page.md +58 -7
- package/docs/api/particles.md +33 -20
- package/docs/api/points.md +19 -31
- package/docs/api/post.md +75 -42
- package/docs/api/quality.md +42 -17
- package/docs/api/raycast.md +65 -51
- package/docs/api/reference/animation.md +10 -11
- package/docs/api/reference/assets.md +25 -22
- package/docs/api/reference/cameras.md +8 -4
- package/docs/api/reference/controls.md +134 -25
- package/docs/api/reference/debug.md +81 -14
- package/docs/api/reference/engine.md +58 -17
- 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 +287 -97
- package/docs/api/reference/grass.md +63 -3
- package/docs/api/reference/impostors.md +208 -13
- package/docs/api/reference/input.md +4 -5
- package/docs/api/reference/lights.md +13 -12
- package/docs/api/reference/lines.md +10 -11
- package/docs/api/reference/materials.md +54 -53
- package/docs/api/reference/math.md +35 -24
- package/docs/api/reference/objects.md +11 -12
- package/docs/api/reference/particles.md +31 -6
- package/docs/api/reference/points.md +6 -7
- package/docs/api/reference/post.md +21 -20
- package/docs/api/reference/quality.md +8 -5
- package/docs/api/reference/raycast.md +7 -8
- package/docs/api/reference/render.md +5 -4
- package/docs/api/reference/scene.md +52 -30
- package/docs/api/reference/sketch.md +15 -11
- package/docs/api/reference/sound.md +234 -0
- package/docs/api/reference/splats.md +42 -3
- package/docs/api/reference/sprites.md +7 -8
- package/docs/api/reference/tasks.md +16 -3
- package/docs/api/reference/terrain.md +27 -5
- package/docs/api/reference/textures.md +5 -6
- package/docs/api/reference/three-compat.md +18 -7
- package/docs/api/reference/time.md +1 -2
- package/docs/api/reference/ui.md +12 -9
- package/docs/api/reference/vertex-draws.md +5 -6
- package/docs/api/reference/water.md +153 -9
- package/docs/api/reference/wind.md +17 -4
- package/docs/api/render.md +73 -29
- package/docs/api/scene.md +164 -60
- package/docs/api/sketch.md +102 -15
- package/docs/api/sound.md +205 -0
- package/docs/api/splats.md +46 -12
- package/docs/api/sprites.md +10 -24
- package/docs/api/tasks.md +33 -24
- package/docs/api/terrain.md +42 -22
- package/docs/api/textures.md +68 -19
- package/docs/api/three-compat.md +15 -7
- package/docs/api/time.md +3 -5
- package/docs/api/ui.md +19 -23
- package/docs/api/vertex-draws.md +13 -12
- package/docs/api/water.md +262 -35
- package/docs/api/wind.md +63 -17
- package/docs/cli/null3d.md +177 -27
- package/docs/concepts/architecture.md +73 -27
- package/docs/concepts/assets.md +57 -33
- package/docs/concepts/backends.md +69 -27
- package/docs/concepts/color-management.md +54 -36
- package/docs/concepts/culling.md +68 -47
- package/docs/concepts/handles.md +14 -5
- package/docs/concepts/instances.md +74 -25
- package/docs/concepts/large-worlds.md +18 -8
- package/docs/concepts/lighting.md +155 -87
- package/docs/concepts/lod.md +126 -44
- package/docs/concepts/materials.md +58 -27
- package/docs/concepts/particle-buffer.md +48 -35
- package/docs/concepts/post-processing.md +84 -43
- package/docs/concepts/quality-preset-tables.md +56 -52
- package/docs/concepts/quality-presets.md +164 -52
- package/docs/concepts/render-graph.md +69 -29
- package/docs/concepts/render-layers.md +11 -21
- package/docs/concepts/shadows.md +105 -52
- package/docs/concepts/static-dynamic.md +22 -7
- package/docs/cookbook/index.md +164 -120
- package/docs/data/threejs-mapping.json +362 -367
- 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 +14 -6
- 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 +40 -0
- 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 +14 -6
- 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 +54 -30
- package/docs/getting-started/cdn.md +32 -10
- package/docs/getting-started/first-scene.md +21 -13
- package/docs/getting-started/hosting.md +152 -63
- package/docs/getting-started/install.md +44 -28
- package/docs/getting-started/network-use.md +33 -15
- package/docs/getting-started/project-structure.md +33 -12
- package/docs/getting-started/third-party-notices.md +12 -14
- package/docs/guides/accessibility.md +5 -5
- package/docs/guides/add-ons.md +86 -15
- package/docs/guides/agents.md +16 -9
- package/docs/guides/assets-pipeline.md +259 -82
- package/docs/guides/audio.md +115 -128
- package/docs/guides/baked-light-data.md +44 -23
- package/docs/guides/car-paint.md +38 -32
- package/docs/guides/content-pages.md +63 -35
- package/docs/guides/custom-passes.md +65 -22
- package/docs/guides/custom-shaders.md +59 -39
- package/docs/guides/debugging.md +74 -10
- package/docs/guides/deploying.md +85 -6
- package/docs/guides/deterministic-simulation.md +24 -17
- package/docs/guides/first-use-shaders.md +83 -45
- package/docs/guides/lens-kit.md +29 -26
- package/docs/guides/loading-screens.md +132 -47
- package/docs/guides/multiple-views.md +63 -13
- package/docs/guides/performance.md +192 -38
- package/docs/guides/phones.md +78 -15
- package/docs/guides/physics.md +7 -11
- package/docs/guides/screens.md +47 -33
- package/docs/guides/start-time.md +363 -0
- package/docs/guides/testing.md +152 -95
- package/docs/guides/ui-overlays.md +19 -14
- 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 +18 -23
- package/docs/moves.json +1 -0
- package/docs/nav.json +300 -0
- package/docs/pages.md +230 -209
- package/docs/porting/react-three-fiber.md +225 -6
- package/docs/porting/threejs-loop-and-threads.md +217 -7
- package/docs/porting/threejs-mapping.md +1249 -233
- package/docs/porting/threejs-materials.md +218 -6
- package/docs/porting/threejs-overview.md +240 -7
- package/docs/porting/threejs-postprocessing.md +4 -8
- package/docs/porting/threejs-shaders.md +301 -6
- package/docs/porting/threejs-unsupported.md +83 -7
- package/docs/porting/verification.md +178 -6
- package/docs/shaders/builtins.md +15 -4
- package/docs/shaders/library.md +72 -45
- package/docs/shaders/surface-functions.md +59 -23
- package/docs/shaders/wgsl-rules.md +12 -5
- package/lib/debug/channel.d.ts +103 -0
- package/lib/debug/channel.js +269 -0
- package/lib/debug/debug.d.ts +11 -9
- package/lib/debug/draw.d.ts +11 -2
- package/lib/debug/draw.js +57 -6
- package/lib/debug/inspector.d.ts +60 -0
- package/lib/debug/inspector.js +475 -0
- 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 +22 -7
- package/lib/debug/stats-panel.js +80 -13
- package/lib/debug/stats.d.ts +2 -3
- package/lib/errors/codes.d.ts +17 -3
- package/lib/errors/codes.js +117 -105
- package/lib/errors/engine-error.js +25 -10
- package/lib/errors/fixes.d.ts +1 -0
- package/lib/errors/fixes.js +20 -19
- package/lib/generated/core.d.ts +1 -1
- package/lib/generated/core.js +1 -1
- package/lib/gpu/early-builds.d.ts +68 -0
- package/lib/gpu/early-builds.js +158 -0
- package/lib/gpu/pipeline-name.d.ts +6 -0
- package/lib/gpu/pipeline-name.js +23 -0
- package/lib/gpu/variants.d.ts +8 -2
- package/lib/gpu/variants.js +39 -7
- package/lib/gpu/webgl2/backend.d.ts +63 -2
- package/lib/gpu/webgl2/backend.js +226 -8
- package/lib/gpu/webgl2/programs.d.ts +18 -0
- package/lib/gpu/webgl2/programs.js +5 -2
- package/lib/gpu/webgpu/backend.d.ts +89 -2
- package/lib/gpu/webgpu/backend.js +255 -8
- package/lib/gpu/webgpu/pipelines.d.ts +13 -0
- package/lib/gpu/webgpu/pipelines.js +28 -14
- package/lib/index.d.ts +7 -5
- package/lib/index.js +3 -2
- package/lib/math/color.d.ts +5 -5
- package/lib/math/color.js +5 -5
- package/lib/math/mat4.d.ts +6 -12
- package/lib/math/mat4.js +6 -12
- package/lib/math/namespaces/quat.d.ts +3 -3
- package/lib/math/namespaces/quat.js +3 -3
- package/lib/math/quat.d.ts +8 -12
- package/lib/math/quat.js +8 -12
- package/lib/math/random.d.ts +2 -3
- package/lib/math/random.js +2 -3
- package/lib/math/types.d.ts +4 -4
- package/lib/math/vec3.d.ts +3 -6
- package/lib/math/vec3.js +3 -6
- package/lib/page/capabilities.d.ts +8 -8
- package/lib/page/capabilities.js +39 -25
- package/lib/page/check-store.d.ts +14 -2
- package/lib/page/check-store.js +34 -11
- package/lib/page/engine.d.ts +117 -31
- package/lib/page/engine.js +438 -99
- package/lib/page/first-frame.d.ts +16 -0
- package/lib/page/first-frame.js +35 -0
- package/lib/page/frame-stats.d.ts +34 -1
- package/lib/page/frame-stats.js +15 -0
- package/lib/page/label-loop.d.ts +7 -3
- package/lib/page/label-loop.js +26 -14
- package/lib/page/labels.d.ts +3 -3
- package/lib/page/pipeline-store.d.ts +25 -0
- package/lib/page/pipeline-store.js +84 -0
- package/lib/page/start-marker.d.ts +4 -1
- package/lib/page/start-marker.js +5 -2
- package/lib/page/stats-switch.js +2 -0
- package/lib/page/switches.d.ts +38 -6
- package/lib/page/switches.js +29 -5
- package/lib/quality/check.d.ts +24 -3
- package/lib/quality/check.js +21 -7
- package/lib/quality/chooser.d.ts +6 -0
- package/lib/quality/chooser.js +8 -0
- package/lib/quality/governor.d.ts +98 -6
- package/lib/quality/governor.js +250 -20
- package/lib/quality/preset-docs.d.ts +16 -1
- package/lib/quality/preset-docs.js +3 -0
- package/lib/quality/presets.d.ts +84 -7
- package/lib/quality/presets.js +94 -2
- package/lib/render/draw.d.ts +3 -2
- package/lib/render/draw.js +15 -5
- package/lib/render/load-draw.d.ts +7 -5
- package/lib/render/load-draw.js +7 -5
- package/lib/render/loss.d.ts +28 -10
- package/lib/render/loss.js +50 -22
- package/lib/render/recovery.d.ts +20 -0
- package/lib/render/recovery.js +44 -4
- package/lib/render/renderer.d.ts +85 -9
- package/lib/render/renderer.js +181 -42
- package/lib/render/scene-renderer.d.ts +19 -1
- package/lib/render/scene-renderer.js +25 -1
- package/lib/render/webgl2-renderers.js +8 -5
- package/lib/render/webgpu-renderers.js +5 -4
- package/lib/scene/animation.d.ts +28 -32
- package/lib/scene/animation.js +12 -15
- package/lib/scene/assets.d.ts +61 -86
- package/lib/scene/assets.js +103 -236
- package/lib/scene/background.d.ts +14 -18
- package/lib/scene/background.js +5 -2
- package/lib/scene/baked-light.d.ts +2 -2
- package/lib/scene/color.d.ts +3 -3
- package/lib/scene/downloads.d.ts +2 -0
- package/lib/scene/downloads.js +371 -0
- package/lib/scene/environment.d.ts +7 -7
- package/lib/scene/environment.js +1 -1
- package/lib/scene/fake-call-values.js +3 -3
- package/lib/scene/fog.d.ts +11 -4
- package/lib/scene/fog.js +8 -2
- package/lib/scene/frame-cameras.d.ts +35 -4
- package/lib/scene/frame-cameras.js +86 -10
- package/lib/scene/gltf.d.ts +33 -3
- package/lib/scene/gltf.js +78 -49
- package/lib/scene/grading.d.ts +2 -2
- package/lib/scene/grading.js +3 -3
- package/lib/scene/ktx2.d.ts +9 -1
- package/lib/scene/ktx2.js +3 -2
- package/lib/scene/level-rule.d.ts +121 -0
- package/lib/scene/level-rule.js +130 -0
- package/lib/scene/lines.d.ts +13 -17
- package/lib/scene/lines.js +3 -3
- package/lib/scene/lut.d.ts +1 -2
- package/lib/scene/lut.js +1 -2
- package/lib/scene/particles.d.ts +7 -3
- package/lib/scene/particles.js +3 -1
- package/lib/scene/picks.d.ts +2 -2
- package/lib/scene/pointer-events.d.ts +4 -7
- package/lib/scene/post.d.ts +39 -43
- package/lib/scene/post.js +4 -1
- package/lib/scene/prefab.d.ts +7 -8
- package/lib/scene/prefab.js +7 -8
- package/lib/scene/property-animation.d.ts +1 -1
- package/lib/scene/property-animation.js +1 -1
- package/lib/scene/queries.d.ts +7 -13
- package/lib/scene/resources.d.ts +238 -261
- package/lib/scene/resources.js +179 -81
- package/lib/scene/scene.d.ts +167 -120
- package/lib/scene/scene.js +243 -103
- package/lib/scene/serial-loads.d.ts +29 -0
- package/lib/scene/serial-loads.js +68 -0
- package/lib/scene/shader-preloads.d.ts +34 -0
- package/lib/scene/shader-preloads.js +38 -0
- package/lib/scene/sprites.d.ts +14 -17
- package/lib/scene/sprites.js +5 -6
- package/lib/scene/textures.d.ts +11 -12
- package/lib/scene/textures.js +9 -10
- package/lib/scene/time-of-day.d.ts +11 -7
- package/lib/scene/time-of-day.js +11 -8
- package/lib/scene/vertex-draws.d.ts +5 -4
- package/lib/scene/vertex-draws.js +7 -5
- package/lib/shader-artifact.json +1 -0
- package/lib/shared/core.d.ts +5 -0
- package/lib/shared/core.js +1 -0
- package/lib/shared/import-once.d.ts +6 -0
- package/lib/shared/import-once.js +19 -0
- package/lib/shared/labels.d.ts +5 -2
- package/lib/shared/labels.js +5 -2
- package/lib/shared/metrics.d.ts +38 -0
- package/lib/shared/metrics.js +62 -1
- 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/run-task.js +7 -1
- package/lib/shared/sketch-data.d.ts +9 -0
- package/lib/shared/sketch-data.js +57 -0
- package/lib/shared/task-pending.d.ts +12 -0
- package/lib/shared/task-pending.js +61 -1
- package/lib/shared/tasks.js +79 -32
- package/lib/shared/version.d.ts +17 -1
- package/lib/shared/version.js +19 -1
- package/lib/shared/wasm.d.ts +12 -4
- package/lib/shared/wasm.js +50 -27
- package/lib/shared/worker-start.d.ts +7 -0
- package/lib/shared/worker-start.js +27 -0
- package/lib/sketch/define-sketch.d.ts +51 -7
- package/lib/sketch/define-sketch.js +2 -1
- package/lib/sketch/input.d.ts +2 -2
- package/lib/sketch/preset-check.d.ts +20 -6
- package/lib/sketch/preset-check.js +42 -17
- package/lib/sketch/quality.d.ts +69 -11
- package/lib/sketch/quality.js +54 -13
- package/lib/sketch/runner.d.ts +80 -9
- package/lib/sketch/runner.js +390 -52
- package/lib/sketch/ui.d.ts +5 -8
- package/lib/sketch/ui.js +4 -2
- package/lib/stats.d.ts +1 -0
- package/lib/workers/probe-worker.d.ts +5 -0
- package/lib/workers/probe-worker.js +13 -4
- package/lib/workers/protocol.d.ts +71 -13
- package/lib/workers/protocol.js +4 -0
- package/lib/workers/render-worker.js +29 -5
- package/lib/workers/sketch-worker.js +108 -16
- package/package.json +2 -2
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
id: api/reference/three-compat
|
|
3
|
-
title: "three.js
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
summary: "Every export of the three.js compatibility (@null3d/three-compat) API, from the engine's doc comments."
|
|
3
|
+
title: "three.js looks (@null3d/three-compat): API reference"
|
|
4
|
+
generated: true
|
|
5
|
+
summary: "Every export of the three.js looks (@null3d/three-compat) API, from the engine's doc comments."
|
|
7
6
|
---
|
|
8
7
|
|
|
9
|
-
# three.js
|
|
8
|
+
# three.js looks (@null3d/three-compat): API reference
|
|
10
9
|
|
|
11
|
-
> [three.js
|
|
10
|
+
> [three.js looks (@null3d/three-compat)](../three-compat.md) explains these exports. The engine's doc comments make this page.
|
|
12
11
|
|
|
13
12
|
## `cineon`
|
|
14
13
|
|
|
@@ -16,6 +15,8 @@ summary: "Every export of the three.js compatibility (@null3d/three-compat) API,
|
|
|
16
15
|
const cineon: ToneCurve
|
|
17
16
|
```
|
|
18
17
|
|
|
18
|
+
Import from `@null3d/three-compat`.
|
|
19
|
+
|
|
19
20
|
Cineon's tone curve, with three.js's `CineonToneMapping` formula, the filmic operator of Jim Hejl and Richard Burgess-Dawson. Give it to `post.set({ toneMapping })` where the three.js scene sets `CineonToneMapping`.
|
|
20
21
|
|
|
21
22
|
## `createOutlinePass`
|
|
@@ -24,12 +25,18 @@ Cineon's tone curve, with three.js's `CineonToneMapping` formula, the filmic ope
|
|
|
24
25
|
function createOutlinePass(ctx: SketchContext, options: OutlinePassOptions = {}): OutlinePass
|
|
25
26
|
```
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
Import from `@null3d/three-compat`.
|
|
29
|
+
|
|
30
|
+
Draws an outline with three.js's `OutlinePass` look: a soft edge around the meshes that `mesh.setOutlined(true)` marks, its glow, and its pulse. Settings turn it on, and the core draws the mask that it reads.
|
|
31
|
+
|
|
32
|
+
The edge is soft, and the core's crisp line is off. A scene that also wants the crisp line sets `post.set({ outline: { width } })` after this call.
|
|
28
33
|
|
|
29
34
|
## `OutlinePass`
|
|
30
35
|
|
|
31
36
|
Interface `OutlinePass`.
|
|
32
37
|
|
|
38
|
+
Import from `@null3d/three-compat`.
|
|
39
|
+
|
|
33
40
|
An outline that `createOutlinePass` made. A call to `set` changes its settings from the next frame on.
|
|
34
41
|
|
|
35
42
|
| Member | Description |
|
|
@@ -40,6 +47,8 @@ An outline that `createOutlinePass` made. A call to `set` changes its settings f
|
|
|
40
47
|
|
|
41
48
|
Interface `OutlinePassOptions`.
|
|
42
49
|
|
|
50
|
+
Import from `@null3d/three-compat`.
|
|
51
|
+
|
|
43
52
|
The settings of an outline, with three.js's `OutlinePass` names and defaults. A setting that a call leaves out keeps its value.
|
|
44
53
|
|
|
45
54
|
| Member | Description |
|
|
@@ -57,4 +66,6 @@ The settings of an outline, with three.js's `OutlinePass` names and defaults. A
|
|
|
57
66
|
const reinhard: ToneCurve
|
|
58
67
|
```
|
|
59
68
|
|
|
69
|
+
Import from `@null3d/three-compat`.
|
|
70
|
+
|
|
60
71
|
Reinhard's tone curve, with three.js's `ReinhardToneMapping` formula. Give it to `post.set({ toneMapping })` where the three.js scene sets `ReinhardToneMapping`.
|
package/docs/api/reference/ui.md
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
id: api/reference/ui
|
|
3
|
-
title: "
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
summary: "Every export of the UI overlays and labels API, from the engine's doc comments."
|
|
3
|
+
title: "Labels that follow objects: API reference"
|
|
4
|
+
generated: true
|
|
5
|
+
summary: "Every export of the Labels that follow objects API, from the engine's doc comments."
|
|
7
6
|
---
|
|
8
7
|
|
|
9
|
-
#
|
|
8
|
+
# Labels that follow objects: API reference
|
|
10
9
|
|
|
11
|
-
> [
|
|
10
|
+
> [Labels that follow objects](../ui.md) explains these exports. The engine's doc comments make this page.
|
|
12
11
|
|
|
13
12
|
## `EngineLabels`
|
|
14
13
|
|
|
@@ -18,7 +17,7 @@ The page's labels, as `engine.labels` gives them.
|
|
|
18
17
|
|
|
19
18
|
| Member | Description |
|
|
20
19
|
| --- | --- |
|
|
21
|
-
| `bind(id: string, element: HTMLElement): () => void` | Binds `element` to the label that the sketch tracks under `id` with `ui.trackLabel`. The engine then moves the element's center over the label's place on the canvas, in each frame on screen, through its CSS `transform`. It sets the element's `position` to `absolute` at the top left of its container, so put the element in a container that covers the canvas. It hides the element with `visibility: hidden` while the label's object is hidden, outside the camera's near and far planes, or not tracked. Binding another element to an id replaces the first. Returns a function that unbinds the element, which then stays where it is. A label that the sketch tracks with `transform: 'world'` or `'billboard'` is a plane of the scene: the engine moves the element into a container of its own inside the element's parent, and turns it with the scene's perspective
|
|
20
|
+
| `bind(id: string, element: HTMLElement): () => void` | Binds `element` to the label that the sketch tracks under `id` with `ui.trackLabel`. The engine then moves the element's center over the label's place on the canvas, in each frame on screen, through its CSS `transform`. It sets the element's `position` to `absolute` at the top left of its container, so put the element in a container that covers the canvas. It hides the element with `visibility: hidden` while the label's object is hidden, outside the camera's near and far planes, or not tracked. Binding another element to an id replaces the first. Returns a function that unbinds the element, which then stays where it is. A label that the sketch tracks with `transform: 'world'` or `'billboard'` is a plane of the scene: the engine moves the element into a container of its own inside the element's parent, and turns it with the scene's perspective. Leave the element's `transform-origin` at its center, and size the element in CSS pixels, which are the scene's units at the distance where the view is one pixel per unit. |
|
|
22
21
|
|
|
23
22
|
## `LabelOptions`
|
|
24
23
|
|
|
@@ -30,7 +29,7 @@ Options for `ui.trackLabel`.
|
|
|
30
29
|
| --- | --- |
|
|
31
30
|
| `offset?: Vec3Like` | Where the label sits relative to the object, in the object's own space, so the offset turns and scales with it. The default is the object's origin, `[0, 0, 0]`. |
|
|
32
31
|
| `transform?: LabelTransform` | How the element sits in the scene. The default is `'screen'`. |
|
|
33
|
-
| `rotation?: number` | The element's turn in its own plane, in radians, for `'billboard'`. It turns the content
|
|
32
|
+
| `rotation?: number` | The element's turn in its own plane, in radians, for `'billboard'`. It turns the element's content counterclockwise, while the element keeps facing the camera. |
|
|
34
33
|
|
|
35
34
|
## `LabelTransform`
|
|
36
35
|
|
|
@@ -38,7 +37,11 @@ Options for `ui.trackLabel`.
|
|
|
38
37
|
type LabelTransform = 'screen' | 'world' | 'billboard';
|
|
39
38
|
```
|
|
40
39
|
|
|
41
|
-
How a label's element sits in the scene.
|
|
40
|
+
How a label's element sits in the scene.
|
|
41
|
+
|
|
42
|
+
- `'screen'` keeps the element flat on the screen at the label's place, always the same size.
|
|
43
|
+
- `'world'` makes the element a plane of the scene: it turns and scales with the object.
|
|
44
|
+
- `'billboard'` makes the element a plane of the scene that always faces the camera.
|
|
42
45
|
|
|
43
46
|
## `Ui`
|
|
44
47
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
id: api/reference/vertex-draws
|
|
3
3
|
title: "Draws from a vertex count: API reference"
|
|
4
|
-
|
|
5
|
-
since: "0.2"
|
|
4
|
+
generated: true
|
|
6
5
|
summary: "Every export of the Draws from a vertex count API, from the engine's doc comments."
|
|
7
6
|
---
|
|
8
7
|
|
|
@@ -14,12 +13,12 @@ summary: "Every export of the Draws from a vertex count API, from the engine's d
|
|
|
14
13
|
|
|
15
14
|
Class `VertexDraw`.
|
|
16
15
|
|
|
17
|
-
A draw that has a material and a vertex count but no mesh data. Its shader makes every vertex of every copy from the indices, so the draw uploads nothing per frame.
|
|
16
|
+
A draw that has a material and a vertex count but no mesh data. Its shader makes every vertex of every copy from the indices, so the draw uploads nothing per frame. The engine writes no uniforms for its WGSL, so `frame.time` moves its shapes. Change its counts and its sphere with the calls here, and free it with `destroy`.
|
|
18
17
|
|
|
19
18
|
| Member | Description |
|
|
20
19
|
| --- | --- |
|
|
21
20
|
| `readonly object: Mesh` | The scene object that gives the draw its place, its layers and its culling sphere. |
|
|
22
|
-
| `readonly material: Material<ShaderValues<Wgsl>>` | The draw's custom material
|
|
21
|
+
| `readonly material: Material<ShaderValues<Wgsl>>` | The draw's custom material. |
|
|
23
22
|
| `readonly vertices: number` | The vertices of one shape. |
|
|
24
23
|
| `readonly instances: number` | The copies of the shape. |
|
|
25
24
|
| `setCounts(vertices: number, instances: number): this` | Sets the vertices of one shape and the copies of the shape, from the next frame on. Each is a whole number from 1 to the most that the draw holds. |
|
|
@@ -39,9 +38,9 @@ The sphere that culls a draw. The engine draws the whole draw or none of it, so
|
|
|
39
38
|
|
|
40
39
|
## `VertexDrawOptions`
|
|
41
40
|
|
|
42
|
-
Interface `VertexDrawOptions`, which extends `Omit
|
|
41
|
+
Interface `VertexDrawOptions`, which extends `Omit<ShaderOptions<Wgsl>, 'wgsl'>`.
|
|
43
42
|
|
|
44
|
-
Options of `scene.createVertexDraw`: the shader, its two counts, its bounds, and every option of `materials.shader`, such as the
|
|
43
|
+
Options of `scene.createVertexDraw`: the shader, its two counts, its bounds, and every option of `materials.shader`, such as the blending and `doubleSided`. A draw blends, so its material draws in the transparent pass, where its sphere culls it and one shape covers the ones behind it.
|
|
45
44
|
|
|
46
45
|
| Member | Description |
|
|
47
46
|
| --- | --- |
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
id: api/reference/water
|
|
3
3
|
title: "Water (@null3d/water): API reference"
|
|
4
|
-
|
|
5
|
-
since: "0.3"
|
|
4
|
+
generated: true
|
|
6
5
|
summary: "Every export of the Water (@null3d/water) API, from the engine's doc comments."
|
|
7
6
|
---
|
|
8
7
|
|
|
@@ -16,6 +15,8 @@ summary: "Every export of the Water (@null3d/water) API, from the engine's doc c
|
|
|
16
15
|
type BedDepth = (x: number, z: number) => number;
|
|
17
16
|
```
|
|
18
17
|
|
|
18
|
+
Import from `@null3d/water`.
|
|
19
|
+
|
|
19
20
|
The depth of a bed at a point, in meters below the water's surface. A shape gives one where its bed does not follow the profile that the shape's width and depth describe.
|
|
20
21
|
|
|
21
22
|
## `createOcean`
|
|
@@ -24,6 +25,8 @@ The depth of a bed at a point, in meters below the water's surface. A shape give
|
|
|
24
25
|
function createOcean(ctx: SketchContext, options: OceanOptions): Ocean
|
|
25
26
|
```
|
|
26
27
|
|
|
28
|
+
Import from `@null3d/water`.
|
|
29
|
+
|
|
27
30
|
Makes a sea of waves in a scene: the transform's passes, the material that reads them, and the reflection that mirrors the sky and the far shore. The sea's mesh follows the camera, and the surface moves its vertices and lights its slopes from the transform's heights.
|
|
28
31
|
|
|
29
32
|
## `createUnderwater`
|
|
@@ -32,6 +35,8 @@ Makes a sea of waves in a scene: the transform's passes, the material that reads
|
|
|
32
35
|
function createUnderwater({ post }: SketchContext, camera: PerspectiveCamera, water: Water, options: UnderwaterOptions = {}): Underwater
|
|
33
36
|
```
|
|
34
37
|
|
|
38
|
+
Import from `@null3d/water`.
|
|
39
|
+
|
|
35
40
|
Makes the view from under the water whose surface the `water` object draws, for `camera`. The waterline follows the same long waves as the surface, and the effect fades the light at the same current, so a camera that dips under the water sees the world through it.
|
|
36
41
|
|
|
37
42
|
## `createWater`
|
|
@@ -40,14 +45,30 @@ Makes the view from under the water whose surface the `water` object draws, for
|
|
|
40
45
|
function createWater(ctx: SketchContext, options: WaterOptions): Water
|
|
41
46
|
```
|
|
42
47
|
|
|
48
|
+
Import from `@null3d/water`.
|
|
49
|
+
|
|
43
50
|
Makes the water that a scene draws, and the reflection pass that mirrors the scene in it. The bodies come from one description: a river that follows a line, or a lake that fills an outline. The surface reads the copy of the opaque scene's depth, or the bed that the shapes describe, so its shores fade against the bed, and the reflection redraws as often as the quality preset affords.
|
|
44
51
|
|
|
52
|
+
## `createWaterfall`
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
function createWaterfall(ctx: SketchContext, options: WaterfallOptions): Promise<Waterfall>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Import from `@null3d/water`.
|
|
59
|
+
|
|
60
|
+
Makes a waterfall that falls from a river's lip: a sheet of water that curves over the lip and drops almost straight, glassy at the lip and white lower down, with spray at the lip, a cloud of mist that it bursts into lower down and a plume of mist at its foot.
|
|
61
|
+
|
|
62
|
+
Give it the lip, the way the water runs, the river's half width, its surface height and its current there, and the drop. End the river's own surface at the lip: the sheet starts a short way upstream, on the river's surface, and fades in over it.
|
|
63
|
+
|
|
45
64
|
## `FlowAt`
|
|
46
65
|
|
|
47
66
|
```ts
|
|
48
67
|
type FlowAt = (x: number, z: number) => WaterPoint;
|
|
49
68
|
```
|
|
50
69
|
|
|
70
|
+
Import from `@null3d/water`.
|
|
71
|
+
|
|
51
72
|
The current at a point, as a velocity in meters a second: its x and z components. A river gives one where its current does not follow its middle line.
|
|
52
73
|
|
|
53
74
|
## `foamMap`
|
|
@@ -56,12 +77,16 @@ The current at a point, as a velocity in meters a second: its x and z components
|
|
|
56
77
|
function foamMap({ textures }: SketchContext, obstacles: readonly FoamObstacle[], options: FoamMapOptions): FoamMap
|
|
57
78
|
```
|
|
58
79
|
|
|
80
|
+
Import from `@null3d/water`.
|
|
81
|
+
|
|
59
82
|
Makes the map of the foam around `obstacles`, over the `origin` and `size` area that the water covers. The water samples it as its `foam` map, and the surface breaks it into flecks that drift downstream.
|
|
60
83
|
|
|
61
84
|
## `FoamMap`
|
|
62
85
|
|
|
63
86
|
Interface `FoamMap`.
|
|
64
87
|
|
|
88
|
+
Import from `@null3d/water`.
|
|
89
|
+
|
|
65
90
|
A map of the foam around things that break the water's surface, such as stones.
|
|
66
91
|
|
|
67
92
|
| Member | Description |
|
|
@@ -74,6 +99,8 @@ A map of the foam around things that break the water's surface, such as stones.
|
|
|
74
99
|
|
|
75
100
|
Interface `FoamMapOptions`.
|
|
76
101
|
|
|
102
|
+
Import from `@null3d/water`.
|
|
103
|
+
|
|
77
104
|
Options of `foamMap`.
|
|
78
105
|
|
|
79
106
|
| Member | Description |
|
|
@@ -82,13 +109,15 @@ Options of `foamMap`.
|
|
|
82
109
|
| `readonly size: readonly [x: number, z: number]` | The world area that the map covers, as [x, z] in meters. |
|
|
83
110
|
| `readonly width?: number` | The map's texels along x. It is 1024 by default. |
|
|
84
111
|
| `readonly height?: number` | The map's texels along z. It is 224 by default. |
|
|
85
|
-
| `readonly reach?: number` | How far the foam reaches around an obstacle, in meters. It is 0.35 by default. |
|
|
112
|
+
| `readonly reach?: number` | How far the foam reaches around an obstacle, in meters. It is 0.35 by default, and every obstacle that gives no reach of its own takes it. |
|
|
86
113
|
| `readonly trail?: number` | How far downstream, toward +x, the foam trails behind an obstacle, in meters. It is 1.6 by default, and 0 leaves a ring. |
|
|
87
114
|
|
|
88
115
|
## `FoamObstacle`
|
|
89
116
|
|
|
90
117
|
Interface `FoamObstacle`.
|
|
91
118
|
|
|
119
|
+
Import from `@null3d/water`.
|
|
120
|
+
|
|
92
121
|
Something that breaks the water's surface: its middle and its radius at the surface.
|
|
93
122
|
|
|
94
123
|
| Member | Description |
|
|
@@ -96,6 +125,7 @@ Something that breaks the water's surface: its middle and its radius at the surf
|
|
|
96
125
|
| `readonly x: number` | The x of the obstacle's middle, in meters. |
|
|
97
126
|
| `readonly z: number` | The z of the obstacle's middle, in meters. |
|
|
98
127
|
| `readonly r: number` | The obstacle's radius at the water's surface, in meters. |
|
|
128
|
+
| `readonly reach?: number` | How far this obstacle's foam reaches from its edge, in meters, in place of the map's `reach`. It suits a scene whose parts of one water carry different foam, such as a creek whose arms break the surface by different amounts. |
|
|
99
129
|
|
|
100
130
|
## `LakeDepth`
|
|
101
131
|
|
|
@@ -103,12 +133,16 @@ Something that breaks the water's surface: its middle and its radius at the surf
|
|
|
103
133
|
type LakeDepth = number | ((x: number, z: number, fromShore: number) => number);
|
|
104
134
|
```
|
|
105
135
|
|
|
136
|
+
Import from `@null3d/water`.
|
|
137
|
+
|
|
106
138
|
The depth of a lake's bed, in meters below the surface: the deepest point, or a function of the point and its distance from the shore.
|
|
107
139
|
|
|
108
140
|
## `LakeShape`
|
|
109
141
|
|
|
110
142
|
Interface `LakeShape`.
|
|
111
143
|
|
|
144
|
+
Import from `@null3d/water`.
|
|
145
|
+
|
|
112
146
|
A lake: the water that fills the area inside an outline.
|
|
113
147
|
|
|
114
148
|
| Member | Description |
|
|
@@ -124,6 +158,8 @@ A lake: the water that fills the area inside an outline.
|
|
|
124
158
|
|
|
125
159
|
Interface `MeshDetail`.
|
|
126
160
|
|
|
161
|
+
Import from `@null3d/water`.
|
|
162
|
+
|
|
127
163
|
How fine a mesh is: the meters along a river, the sections across it, and a lake's grid cell.
|
|
128
164
|
|
|
129
165
|
| Member | Description |
|
|
@@ -137,6 +173,8 @@ How fine a mesh is: the meters along a river, the sections across it, and a lake
|
|
|
137
173
|
|
|
138
174
|
Interface `Ocean`.
|
|
139
175
|
|
|
176
|
+
Import from `@null3d/water`.
|
|
177
|
+
|
|
140
178
|
The sea that `createOcean` made.
|
|
141
179
|
|
|
142
180
|
| Member | Description |
|
|
@@ -144,7 +182,7 @@ The sea that `createOcean` made.
|
|
|
144
182
|
| `readonly level: number` | The height of the sea's surface, in meters. |
|
|
145
183
|
| `readonly bands: readonly OceanBand[]` | The bands of the sea, in the order that they sum. |
|
|
146
184
|
| `readonly reflectionEvery: number` | The frames between two draws of the reflection now. |
|
|
147
|
-
| `update(): void` | Moves the sea's mesh about the camera
|
|
185
|
+
| `update(): void` | Moves the sea's mesh about the camera, and draws the reflection in every frame while that camera moves or turns. Call once in each frame, after the camera moves and before the engine draws. |
|
|
148
186
|
| `heightAt(x: number, z: number): number` | The height of the sea at a world place, in meters, as the bands sum at the sketch time. It runs the bands' transforms on this thread, and transforms again only when the sketch time moves, so several reads in a frame share one transform. |
|
|
149
187
|
| `destroy(): void` | Removes the surface, the transform's passes, the reflection and the material. |
|
|
150
188
|
|
|
@@ -154,17 +192,21 @@ The sea that `createOcean` made.
|
|
|
154
192
|
const OCEAN_BANDS: readonly OceanBand[]
|
|
155
193
|
```
|
|
156
194
|
|
|
195
|
+
Import from `@null3d/water`.
|
|
196
|
+
|
|
157
197
|
The bands that the sea holds when a page names none: a long swell, a wind sea and the chop on top.
|
|
158
198
|
|
|
159
199
|
## `OceanBand`
|
|
160
200
|
|
|
161
201
|
Interface `OceanBand`.
|
|
162
202
|
|
|
203
|
+
Import from `@null3d/water`.
|
|
204
|
+
|
|
163
205
|
One band of the ocean: a tile of sea of its own, whose waves run at its own scale.
|
|
164
206
|
|
|
165
207
|
| Member | Description |
|
|
166
208
|
| --- | --- |
|
|
167
|
-
| `readonly tile: number` | The
|
|
209
|
+
| `readonly tile: number` | The meters that one tile covers each way. |
|
|
168
210
|
| `readonly height: number` | The significant wave height of the band, in meters: about four times its own spread. |
|
|
169
211
|
| `readonly wind: number` | The wind's speed in meters a second. |
|
|
170
212
|
| `readonly direction: number` | The wind's heading in radians, where 0 blows toward +x and pi/2 toward +z. |
|
|
@@ -176,12 +218,16 @@ One band of the ocean: a tile of sea of its own, whose waves run at its own scal
|
|
|
176
218
|
type OceanMaterialOptions = { wireframe?: boolean | undefined; transmission?: number | undefined; castsStill?: boolean | undefined; swayDistance?: number | undefined; flatShading?: boolean | undefined; lightMapOffset?: readonly [number, number] | undefined; lightMapRepeat?: readonly [number, number] | undefined; lightMapDecode?: 'srgb' | 'rgbm' | undefined; lightMapDirection?: Texture | undefined; contactShadows?: boolean | undefined; metalness?: number | undefined; roughness?: number | undefined; emissive?: ColorInput | undefined; emissiveIntensity?: number | undefined; normalScale?: readonly [number, number] | undefined; bumpScale?: number | undefined; displacementScale?: number | undefined; displacementBias?: number | undefined; aoMapIntensity?: number | undefined; lightMapIntensity?: number | undefined; ior?: number | undefined; specularIntensity?: number | undefined; specularColor?: ColorInput | undefined; envIntensity?: number | undefined; uvTransform?: UvTransform | undefined; mapUvTransforms?: Partial<Record<'lightMap' | 'transmissionMap' | 'thicknessMap' | 'map' | 'metalnessRoughnessMap' | 'normalMap' | 'bumpMap' | 'displacementMap' | 'aoMap' | 'emissiveMap' | 'specularIntensityMap' | 'specularColorMap' | 'diffuseTransmissionMap' | 'diffuseTransmissionColorMap' | 'clearcoatMap' | 'clearcoatRoughnessMap' | 'clearcoatNormalMap' | 'sheenColorMap' | 'sheenRoughnessMap' | 'iridescenceMap' | 'iridescenceThicknessMap' | 'anisotropyMap', UvTransform>> | undefined; thickness?: number | undefined; attenuationColor?: ColorInput | undefined; attenuationDistance?: number | undefined; dispersion?: number | undefined; diffuseTransmission?: number | undefined; diffuseTransmissionColor?: ColorInput | undefined; subsurfaceRadius?: number | undefined; subsurfaceColor?: ColorInput | undefined; clearcoat?: number | undefined; clearcoatRoughness?: number | undefined; clearcoatNormalScale?: readonly [number, number] | undefined; sheenColor?: ColorInput | undefined; sheenRoughness?: number | undefined; iridescence?: number | undefined; iridescenceIor?: number | undefined; iridescenceThicknessRange?: readonly [number, number] | undefined; anisotropy?: number | undefined; anisotropyRotation?: number | undefined; color?: ColorInput | undefined; opacity?: number | undefined; alphaCutoff?: number | undefined; doubleSided?: boolean | undefined; vertexColors?: boolean | undefined; fog?: boolean | undefined; toneMapped?: boolean | undefined; alphaMode?: AlphaMode | undefined; alphaToCoverage?: boolean | undefined; forceSinglePass?: boolean | undefined; blending?: Blending | undefined; depthWrite?: boolean | undefined; depthTest?: boolean | undefined; colorWrite?: boolean | undefined; depthBias?: DepthBias | undefined; };
|
|
177
219
|
```
|
|
178
220
|
|
|
221
|
+
Import from `@null3d/water`.
|
|
222
|
+
|
|
179
223
|
The standard material values that the ocean's surface takes.
|
|
180
224
|
|
|
181
225
|
## `OceanOptions`
|
|
182
226
|
|
|
183
227
|
Interface `OceanOptions`.
|
|
184
228
|
|
|
229
|
+
Import from `@null3d/water`.
|
|
230
|
+
|
|
185
231
|
Options of `createOcean`.
|
|
186
232
|
|
|
187
233
|
| Member | Description |
|
|
@@ -194,8 +240,9 @@ Options of `createOcean`.
|
|
|
194
240
|
| `readonly foam?: number` | The height at which foam breaks on a crest, in meters. It is 1.1 by default. |
|
|
195
241
|
| `readonly softness?: number` | The meters of the gap to the bed over which the water fades at a shore. It is 0.12 by default. |
|
|
196
242
|
| `readonly reflectionEvery?: Partial<Record<QualityPreset, number>>` | The frames between two draws of the reflection at each preset, which replaces the add-on's own cadence for the presets that it names. |
|
|
243
|
+
| `readonly reflectionFollowsBudget?: boolean` | False keeps the frame-budget governor from raising the frames between two draws of the reflection. Between draws the sea shows the reflection of an older camera, so on a moving camera a raised count reads as a reflection that lags behind what it mirrors. The default, true, lets the governor trade that for time. |
|
|
197
244
|
| `readonly layers?: number` | The layers that the reflection pass draws, as a 32-bit mask. It is the camera's by default. |
|
|
198
|
-
| `readonly reflectionScale?: 1 \| 0.5 \| 0.25` | The reflection's size as a share of the render size each way: 1, 0.5 or 0.25.
|
|
245
|
+
| `readonly reflectionScale?: 1 \| 0.5 \| 0.25` | The reflection's size as a share of the render size each way: 1, 0.5 or 0.25. By default it follows the quality preset's `reflectionScale`. |
|
|
199
246
|
| `readonly material?: OceanMaterialOptions` | The standard material values, such as the water's tint and its thickness. |
|
|
200
247
|
|
|
201
248
|
## `RiverDepth`
|
|
@@ -204,12 +251,16 @@ Options of `createOcean`.
|
|
|
204
251
|
type RiverDepth = number | readonly number[] | ((x: number, z: number, along: number) => number);
|
|
205
252
|
```
|
|
206
253
|
|
|
254
|
+
Import from `@null3d/water`.
|
|
255
|
+
|
|
207
256
|
The depth of a river's bed under its middle line, in meters below the surface: one number for the whole river, one number for each point of the middle line, or a function of the point and the distance along the river from its first point.
|
|
208
257
|
|
|
209
258
|
## `RiverShape`
|
|
210
259
|
|
|
211
260
|
Interface `RiverShape`.
|
|
212
261
|
|
|
262
|
+
Import from `@null3d/water`.
|
|
263
|
+
|
|
213
264
|
A river: the water that follows a line, with a width and a depth along it.
|
|
214
265
|
|
|
215
266
|
| Member | Description |
|
|
@@ -227,6 +278,8 @@ A river: the water that follows a line, with a width and a depth along it.
|
|
|
227
278
|
|
|
228
279
|
Interface `Underwater`.
|
|
229
280
|
|
|
281
|
+
Import from `@null3d/water`.
|
|
282
|
+
|
|
230
283
|
The view from under the water, which the scene drives in each frame.
|
|
231
284
|
|
|
232
285
|
| Member | Description |
|
|
@@ -238,6 +291,8 @@ The view from under the water, which the scene drives in each frame.
|
|
|
238
291
|
|
|
239
292
|
Interface `UnderwaterOptions`.
|
|
240
293
|
|
|
294
|
+
Import from `@null3d/water`.
|
|
295
|
+
|
|
241
296
|
Options of `createUnderwater`.
|
|
242
297
|
|
|
243
298
|
| Member | Description |
|
|
@@ -251,6 +306,8 @@ Options of `createUnderwater`.
|
|
|
251
306
|
|
|
252
307
|
Interface `Water`.
|
|
253
308
|
|
|
309
|
+
Import from `@null3d/water`.
|
|
310
|
+
|
|
254
311
|
Water that `createWater` made.
|
|
255
312
|
|
|
256
313
|
| Member | Description |
|
|
@@ -263,6 +320,7 @@ Water that `createWater` made.
|
|
|
263
320
|
| `surfaceHeight(x: number, z: number, t: number): number` | The height of the water's surface at a point and a sketch time, in meters, as its long waves move it. It uses the current of the body that the point lies over. Where two bodies meet, it follows the surface there, which lies flat and mixes the river's waves into the lake's. |
|
|
264
321
|
| `currentAt(x: number, z: number, out: [x: number, z: number]): void` | The current of the body that a point lies over, as a velocity in meters a second, written into `out`. It is zero for still water and outside every body. Where a river runs into a lake, the lake owns the water inside its shore. |
|
|
265
322
|
| `setCaustics(light: readonly [x: number, y: number, z: number]): void` | Sets the light that the ripples focus on the bed, as a linear color. |
|
|
323
|
+
| `setRain(amount: number): void` | Sets how hard rain falls on the surface, from 0 for none to 1 for a downpour. |
|
|
266
324
|
| `destroy(): void` | Removes the surface, its reflection pass and its material. |
|
|
267
325
|
|
|
268
326
|
## `waterBody`
|
|
@@ -271,12 +329,16 @@ Water that `createWater` made.
|
|
|
271
329
|
function waterBody(shape: WaterShape): WaterBody
|
|
272
330
|
```
|
|
273
331
|
|
|
332
|
+
Import from `@null3d/water`.
|
|
333
|
+
|
|
274
334
|
Resolves a shape into the water body that the add-on draws: its bounds, the depth of its bed at a point, and the current there.
|
|
275
335
|
|
|
276
336
|
## `WaterBody`
|
|
277
337
|
|
|
278
338
|
Interface `WaterBody`.
|
|
279
339
|
|
|
340
|
+
Import from `@null3d/water`.
|
|
341
|
+
|
|
280
342
|
A water body that a shape resolved to: its bounds, the depth of its bed at a point and the current there. The add-on builds its surface from this, and a scene reads it to place what floats.
|
|
281
343
|
|
|
282
344
|
| Member | Description |
|
|
@@ -290,18 +352,89 @@ A water body that a shape resolved to: its bounds, the depth of its bed at a poi
|
|
|
290
352
|
| `contains(x: number, z: number): boolean` | True when the point lies over the water, where its depth is above 0. |
|
|
291
353
|
| `currentAt(x: number, z: number, out: [x: number, z: number]): void` | The current at a point, as a velocity in meters a second, written into `out`. It is zero for still water. A river carries its current along its middle line, or along the `current` function that it gives. |
|
|
292
354
|
|
|
355
|
+
## `Waterfall`
|
|
356
|
+
|
|
357
|
+
Interface `Waterfall`.
|
|
358
|
+
|
|
359
|
+
Import from `@null3d/water`.
|
|
360
|
+
|
|
361
|
+
A waterfall that `createWaterfall` made.
|
|
362
|
+
|
|
363
|
+
| Member | Description |
|
|
364
|
+
| --- | --- |
|
|
365
|
+
| `readonly fallTime: number` | The seconds that the water takes to fall from the lip to the foot. |
|
|
366
|
+
| `update(): void` | Steps the spray and the mist by the frame's time. Call it once in each frame, in `onLateUpdate`, after the wind's field steps, as a particle system's `update` is called. |
|
|
367
|
+
| `setLight(color: readonly [red: number, green: number, blue: number]): void` | Sets the air's light on the spray and the mist, as a linear color. Particles are not lit, so a scene gives them its light in each mood. The sheet takes the scene's own light, and its white water gives back a share of this one too, as the mist round it does. |
|
|
368
|
+
| `setSpray(amount: number): void` | Sets the spray and the mist, as a factor of the fall's own, from 0 to 3. A storm raises it. |
|
|
369
|
+
| `destroy(): void` | Removes the sheet, its material and its particles. |
|
|
370
|
+
|
|
371
|
+
## `WaterfallMaterialOptions`
|
|
372
|
+
|
|
373
|
+
```ts
|
|
374
|
+
type WaterfallMaterialOptions = { wireframe?: boolean | undefined; transmission?: number | undefined; castsStill?: boolean | undefined; swayDistance?: number | undefined; flatShading?: boolean | undefined; lightMapOffset?: readonly [number, number] | undefined; lightMapRepeat?: readonly [number, number] | undefined; lightMapDecode?: 'srgb' | 'rgbm' | undefined; lightMapDirection?: Texture | undefined; contactShadows?: boolean | undefined; metalness?: number | undefined; roughness?: number | undefined; emissive?: ColorInput | undefined; emissiveIntensity?: number | undefined; normalScale?: readonly [number, number] | undefined; bumpScale?: number | undefined; displacementScale?: number | undefined; displacementBias?: number | undefined; aoMapIntensity?: number | undefined; lightMapIntensity?: number | undefined; ior?: number | undefined; specularIntensity?: number | undefined; specularColor?: ColorInput | undefined; envIntensity?: number | undefined; uvTransform?: UvTransform | undefined; mapUvTransforms?: Partial<Record<'lightMap' | 'transmissionMap' | 'thicknessMap' | 'map' | 'metalnessRoughnessMap' | 'normalMap' | 'bumpMap' | 'displacementMap' | 'aoMap' | 'emissiveMap' | 'specularIntensityMap' | 'specularColorMap' | 'diffuseTransmissionMap' | 'diffuseTransmissionColorMap' | 'clearcoatMap' | 'clearcoatRoughnessMap' | 'clearcoatNormalMap' | 'sheenColorMap' | 'sheenRoughnessMap' | 'iridescenceMap' | 'iridescenceThicknessMap' | 'anisotropyMap', UvTransform>> | undefined; thickness?: number | undefined; attenuationColor?: ColorInput | undefined; attenuationDistance?: number | undefined; dispersion?: number | undefined; diffuseTransmission?: number | undefined; diffuseTransmissionColor?: ColorInput | undefined; subsurfaceRadius?: number | undefined; subsurfaceColor?: ColorInput | undefined; clearcoat?: number | undefined; clearcoatRoughness?: number | undefined; clearcoatNormalScale?: readonly [number, number] | undefined; sheenColor?: ColorInput | undefined; sheenRoughness?: number | undefined; iridescence?: number | undefined; iridescenceIor?: number | undefined; iridescenceThicknessRange?: readonly [number, number] | undefined; anisotropy?: number | undefined; anisotropyRotation?: number | undefined; color?: ColorInput | undefined; opacity?: number | undefined; alphaCutoff?: number | undefined; doubleSided?: boolean | undefined; vertexColors?: boolean | undefined; fog?: boolean | undefined; toneMapped?: boolean | undefined; alphaMode?: AlphaMode | undefined; alphaToCoverage?: boolean | undefined; forceSinglePass?: boolean | undefined; blending?: Blending | undefined; depthWrite?: boolean | undefined; depthTest?: boolean | undefined; colorWrite?: boolean | undefined; depthBias?: DepthBias | undefined; };
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
Import from `@null3d/water`.
|
|
378
|
+
|
|
379
|
+
The standard material values that a waterfall's sheet takes, such as the color of its white water.
|
|
380
|
+
|
|
381
|
+
## `WaterfallMesh`
|
|
382
|
+
|
|
383
|
+
Interface `WaterfallMesh`.
|
|
384
|
+
|
|
385
|
+
Import from `@null3d/water`.
|
|
386
|
+
|
|
387
|
+
How fine a waterfall's mesh is.
|
|
388
|
+
|
|
389
|
+
| Member | Description |
|
|
390
|
+
| --- | --- |
|
|
391
|
+
| `across?: number` | The sections round the column. It is 24 by default. |
|
|
392
|
+
| `down?: number` | The rows from the lip to the foot of the fall. It is 40 by default. |
|
|
393
|
+
|
|
394
|
+
## `WaterfallOptions`
|
|
395
|
+
|
|
396
|
+
Interface `WaterfallOptions`.
|
|
397
|
+
|
|
398
|
+
Import from `@null3d/water`.
|
|
399
|
+
|
|
400
|
+
Options of `createWaterfall`.
|
|
401
|
+
|
|
402
|
+
| Member | Description |
|
|
403
|
+
| --- | --- |
|
|
404
|
+
| `readonly lip: WaterPoint` | The middle of the lip, where the river's surface ends and the water falls, as [x, z] in meters. |
|
|
405
|
+
| `readonly direction: WaterPoint` | The way the water runs over the lip, as [x, z]. Its length does not matter. |
|
|
406
|
+
| `readonly halfWidth: number` | Half the river's width at the lip, in meters. |
|
|
407
|
+
| `readonly level?: number` | The height of the water's surface at the lip, in meters. It is 0 by default. |
|
|
408
|
+
| `readonly speed?: number` | The current's speed at the lip, in meters a second. It sets how far the water leaps out from the lip's line: at 1.2 m/s the back of the column is 0.6 m out 2 m down and 1.3 m out 13 m down. A wall below the lip that leans out further than that meets the water, and the column fades where it nears the rock. A river runs faster as it nears a brink, so give the speed at the lip itself. It is 1.2 by default. |
|
|
409
|
+
| `readonly drop: number` | How far the fall drops below the lip, in meters. The sheet thins into mist over the lower half of the drop, and never lands. |
|
|
410
|
+
| `readonly spread?: number` | How far each side of the sheet widens for each meter that the water falls, once it has fallen a few meters: it spreads little at first, and opens into a veil lower down. It is 0.3 by default. |
|
|
411
|
+
| `readonly apron?: number` | How far upstream of the lip the fall's water starts, lying on the river's surface, in meters. There it fades in at uneven distances and takes the place of the river's own surface, so the river's square end at the lip is covered and the water runs into the fall with no straight edge. Give the reach of the broken water before the brink. It is 1 by default. |
|
|
412
|
+
| `readonly fadeBelow?: number` | The world height of a cloud sea, a fog bank or a mist that the fall drops into, in meters. A cloud that draws before the fall does not hide it, so below this height the fall vanishes itself over `SINK_DEPTH`, 2.5 m, each clump at its own depth. The water then breaks up and bursts into mist over the part of the drop above the cloud. By default it never vanishes. |
|
|
413
|
+
| `readonly spray?: number` | The spray and the mist, as a factor of the fall's own, from 0 to 3. It is 1 by default. At 0 the fall makes no particles, neither the particles add-on nor the engine's particle code loads, and `setSpray` has nothing to raise. |
|
|
414
|
+
| `readonly mist?: number` | The mist round the fall's foot and the plume that rises from it, as a factor of the fall's own, from 0 to 3, which `spray` scales too. It is 1 by default. At 0 the fall makes neither, for a scene whose own cloud draws the mist at the fall's foot: puffs lit apart from that cloud would draw a gray patch over it. |
|
|
415
|
+
| `readonly layers?: number` | The layers that the sheet and its spray draw on, as a 32-bit mask. It is layer 0 by default. Leave out the layers that a water's reflection draws when the fall lies past the water's edge. |
|
|
416
|
+
| `readonly wind?: ParticleWindField` | A field of air that carries the mist, such as the wind add-on's field. |
|
|
417
|
+
| `readonly material?: WaterfallMaterialOptions` | The sheet's standard material values, such as the color of its white water. |
|
|
418
|
+
| `readonly mesh?: WaterfallMesh` | How fine the sheet's mesh is. |
|
|
419
|
+
|
|
293
420
|
## `WaterMaterialOptions`
|
|
294
421
|
|
|
295
422
|
```ts
|
|
296
423
|
type WaterMaterialOptions = { wireframe?: boolean | undefined; transmission?: number | undefined; castsStill?: boolean | undefined; swayDistance?: number | undefined; flatShading?: boolean | undefined; lightMapOffset?: readonly [number, number] | undefined; lightMapRepeat?: readonly [number, number] | undefined; lightMapDecode?: 'srgb' | 'rgbm' | undefined; lightMapDirection?: Texture | undefined; contactShadows?: boolean | undefined; metalness?: number | undefined; roughness?: number | undefined; emissive?: ColorInput | undefined; emissiveIntensity?: number | undefined; normalScale?: readonly [number, number] | undefined; bumpScale?: number | undefined; displacementScale?: number | undefined; displacementBias?: number | undefined; aoMapIntensity?: number | undefined; lightMapIntensity?: number | undefined; ior?: number | undefined; specularIntensity?: number | undefined; specularColor?: ColorInput | undefined; envIntensity?: number | undefined; uvTransform?: UvTransform | undefined; mapUvTransforms?: Partial<Record<'lightMap' | 'transmissionMap' | 'thicknessMap' | 'map' | 'metalnessRoughnessMap' | 'normalMap' | 'bumpMap' | 'displacementMap' | 'aoMap' | 'emissiveMap' | 'specularIntensityMap' | 'specularColorMap' | 'diffuseTransmissionMap' | 'diffuseTransmissionColorMap' | 'clearcoatMap' | 'clearcoatRoughnessMap' | 'clearcoatNormalMap' | 'sheenColorMap' | 'sheenRoughnessMap' | 'iridescenceMap' | 'iridescenceThicknessMap' | 'anisotropyMap', UvTransform>> | undefined; thickness?: number | undefined; attenuationColor?: ColorInput | undefined; attenuationDistance?: number | undefined; dispersion?: number | undefined; diffuseTransmission?: number | undefined; diffuseTransmissionColor?: ColorInput | undefined; subsurfaceRadius?: number | undefined; subsurfaceColor?: ColorInput | undefined; clearcoat?: number | undefined; clearcoatRoughness?: number | undefined; clearcoatNormalScale?: readonly [number, number] | undefined; sheenColor?: ColorInput | undefined; sheenRoughness?: number | undefined; iridescence?: number | undefined; iridescenceIor?: number | undefined; iridescenceThicknessRange?: readonly [number, number] | undefined; anisotropy?: number | undefined; anisotropyRotation?: number | undefined; color?: ColorInput | undefined; opacity?: number | undefined; alphaCutoff?: number | undefined; doubleSided?: boolean | undefined; vertexColors?: boolean | undefined; fog?: boolean | undefined; toneMapped?: boolean | undefined; alphaMode?: AlphaMode | undefined; alphaToCoverage?: boolean | undefined; forceSinglePass?: boolean | undefined; blending?: Blending | undefined; depthWrite?: boolean | undefined; depthTest?: boolean | undefined; colorWrite?: boolean | undefined; depthBias?: DepthBias | undefined; };
|
|
297
424
|
```
|
|
298
425
|
|
|
299
|
-
|
|
426
|
+
Import from `@null3d/water`.
|
|
427
|
+
|
|
428
|
+
The standard material values that the water's surface takes. The surface works two of them out for each pixel, so a value that a call gives for them does not apply: the volume's thickness, which is the depth of the bed under the surface there, and the transmission, which falls away where the foam covers the water.
|
|
429
|
+
|
|
430
|
+
Give `attenuationColor` and `attenuationDistance` to tint the water: the bed's light keeps the share that the attenuation leaves over the bed's depth, so a shallow, clear creek needs a pale color over a distance far above its own depth, and a short distance with a dark color turns it into an opaque slab that hides the bed.
|
|
300
431
|
|
|
301
432
|
## `WaterOptions`
|
|
302
433
|
|
|
303
434
|
Interface `WaterOptions`.
|
|
304
435
|
|
|
436
|
+
Import from `@null3d/water`.
|
|
437
|
+
|
|
305
438
|
Options of `createWater`.
|
|
306
439
|
|
|
307
440
|
| Member | Description |
|
|
@@ -312,15 +445,18 @@ Options of `createWater`.
|
|
|
312
445
|
| `readonly ripple?: number` | The water's ripples, as a factor of their base height, from 0. It is 1 by default. |
|
|
313
446
|
| `readonly waveAmplitude?: number` | The height of the long waves and of the wind's lift, as a factor of their base height, from 0. It is 1 by default. The fine ripples keep the strength that `ripple` gives them, so a small value gives a nearly flat surface that still ripples. |
|
|
314
447
|
| `readonly softness?: number` | The meters of the gap to the bed over which the water fades at a shore. It is 0.12 by default. |
|
|
448
|
+
| `readonly windRipple?: number` | The slope that the wind raises in short crests of its own, from 0, at a feature of a few tenths of a meter. It is 0 by default: the water's waves then run with their clocks alone. A surface that asks for it moves with the field's air as the scene's trees do, which suits a body small enough that a long swell would read as one flat tilt. |
|
|
315
449
|
| `readonly colorAlongView?: number` | The share of the water's color at a low view, from 0 to 1, that reads the whole way the view runs through the water, as a wide sea's does: a low view then shows no sharp outline of the bed in the distance. A view from above keeps the depth. At 0, the default, it reads the depth at every view. |
|
|
316
450
|
| `readonly reflectionEvery?: Partial<Record<QualityPreset, number>>` | The frames between two draws of the reflection at each preset, which replaces the add-on's own cadence for the presets that it names. The frame-budget governor may still double it while frames take too long. It is 2 on Low and Medium and 1 on High and Ultra. |
|
|
317
451
|
| `readonly reflectionFollowsBudget?: boolean` | False keeps the frame-budget governor from raising the frames between two draws of the reflection. Between draws the water shows the reflection of an older camera, so on a moving camera a raised count reads as a reflection that lags behind what it mirrors. The default, true, lets the governor trade that for time. |
|
|
318
452
|
| `readonly layers?: number` | The layers that the reflection pass draws, as a 32-bit mask. It is the camera's layers by default. Give the layer of the objects that the water mirrors to leave out the things that lie on or under its surface. |
|
|
319
|
-
| `readonly reflectionScale?: 1 \| 0.5 \| 0.25` | The reflection's size as a share of the render size each way: 1, 0.5 or 0.25.
|
|
453
|
+
| `readonly reflectionScale?: 1 \| 0.5 \| 0.25` | The reflection's size as a share of the render size each way: 1, 0.5 or 0.25. By default it follows the quality preset's `reflectionScale`. A smaller share softens the reflection and costs less. |
|
|
320
454
|
| `readonly mesh?: MeshDetail` | How fine the surface's mesh is, for the bodies that give no detail of their own. |
|
|
321
455
|
| `readonly bed?: 'scene' \| 'shape'` | Where the surface reads the depth of the bed: `'scene'`, the copy of the opaque scene's depth behind each pixel, or `'shape'`, the depth that each shape describes, carried in the mesh's vertex colors. It is `'scene'` by default. `'shape'` suits a bed that the scene states rather than draws, or one whose drawn shape differs from the depth that the water should read. |
|
|
322
456
|
| `readonly material?: WaterMaterialOptions` | The standard material values, such as the volume's tint and its thickness. |
|
|
457
|
+
| `readonly camera?: Camera` | The camera that the reflection follows. While it moves or turns, the reflection draws in every frame, so a moving view never shows a mirror of an older one; a still camera keeps the cadence that the preset and the frame-budget governor give. Without one the reflection keeps that cadence whether the view moves or not. |
|
|
323
458
|
| `readonly wind?: WaterWind` | The wind field that lifts the surface's short waves and carries their crests. A page gives the wind add-on's field here, and the surface reads it once for each vertex. |
|
|
459
|
+
| `readonly rain?: number` | How hard rain falls on the surface, from 0 for none to 1 for a downpour. Each drop rings the surface where it lands, and the rings drift with the current. It is 0 by default, and dry water pays nothing for the rings. |
|
|
324
460
|
|
|
325
461
|
## `WaterPoint`
|
|
326
462
|
|
|
@@ -328,6 +464,8 @@ Options of `createWater`.
|
|
|
328
464
|
type WaterPoint = readonly [x: number, z: number];
|
|
329
465
|
```
|
|
330
466
|
|
|
467
|
+
Import from `@null3d/water`.
|
|
468
|
+
|
|
331
469
|
A point on the ground plane, in meters: its x and its z.
|
|
332
470
|
|
|
333
471
|
## `WaterShape`
|
|
@@ -336,12 +474,16 @@ A point on the ground plane, in meters: its x and its z.
|
|
|
336
474
|
type WaterShape = RiverShape | LakeShape;
|
|
337
475
|
```
|
|
338
476
|
|
|
477
|
+
Import from `@null3d/water`.
|
|
478
|
+
|
|
339
479
|
The shape of one water body: a river or a lake.
|
|
340
480
|
|
|
341
481
|
## `WaterWind`
|
|
342
482
|
|
|
343
483
|
Interface `WaterWind`.
|
|
344
484
|
|
|
485
|
+
Import from `@null3d/water`.
|
|
486
|
+
|
|
345
487
|
The wind that a water surface reads: a plain field texture and its box, so that a page connects the wind add-on to the water without either add-on importing the other.
|
|
346
488
|
|
|
347
489
|
| Member | Description |
|
|
@@ -356,4 +498,6 @@ The wind that a water surface reads: a plain field texture and its box, so that
|
|
|
356
498
|
function waveHeight(x: number, z: number, t: number, level: number, current: readonly [x: number, z: number], ripple: number, waveAmplitude = 1): number
|
|
357
499
|
```
|
|
358
500
|
|
|
359
|
-
|
|
501
|
+
Import from `@null3d/water`.
|
|
502
|
+
|
|
503
|
+
The height of a water surface at a point and a sketch time, in meters, as its long waves move it. A `current` carries the whole set downstream, with each wave's direction turned into the current's frame, in two copies that take turns as the surface's shader draws them; still water keeps the authored directions and each wave's own speed. `ripple` scales them, and `waveAmplitude` scales the surface's height above the level.
|