@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
package/docs/api/ui.md
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
id: api/ui
|
|
3
|
-
title:
|
|
4
|
-
status: experimental
|
|
5
|
-
since: "0.2"
|
|
3
|
+
title: Labels that follow objects
|
|
6
4
|
summary: "ui.trackLabel in the sketch; engine.labels.bind on the page."
|
|
7
5
|
---
|
|
8
6
|
|
|
9
|
-
#
|
|
10
|
-
|
|
11
|
-
> Roadmap step 0.2, first released in null3D 0.1.0. The API is experimental, so it can still change between versions.
|
|
7
|
+
# Labels that follow objects
|
|
12
8
|
|
|
13
9
|
A label is an HTML element that follows a scene object, such as a name tag or a health bar above a unit. The sketch tracks a label on an object under an id, and the page binds an element to the same id. The engine then moves the element over the object in every frame on screen. No message goes between the sketch and the page per frame.
|
|
14
10
|
|
|
@@ -78,7 +74,14 @@ The engine holds 4,096 labels at once by default, and 256 labels that are planes
|
|
|
78
74
|
|
|
79
75
|
`engine.labels.bind(id, element)` binds an element to the label with the same id. The sketch can track the label before or after the bind. The element stays hidden until the label's first frame reaches the screen. The code that moves the elements downloads with the first bind, so a page without labels never downloads it.
|
|
80
76
|
|
|
81
|
-
The engine places the element's center over the label
|
|
77
|
+
The engine places the element's center over the label through its CSS `transform`, and sets its `position` to `absolute` at the top left of its container. So:
|
|
78
|
+
|
|
79
|
+
- Put the elements in a container that covers the canvas exactly, as the example above does.
|
|
80
|
+
- Give the container `pointer-events: none`, so the canvas still gets the pointer.
|
|
81
|
+
- Do not set the element's `transform`: the engine owns it.
|
|
82
|
+
- To anchor another point of the element on the label, offset the content inside the element with CSS.
|
|
83
|
+
|
|
84
|
+
The elements of labels flat on the screen stack in the order of the page, whatever their distance to the camera.
|
|
82
85
|
|
|
83
86
|
The engine sets `visibility: hidden` on the element while:
|
|
84
87
|
|
|
@@ -101,40 +104,33 @@ ui.trackLabel(panel, 'card', { transform: 'world', offset: [0, 1.4, 0] });
|
|
|
101
104
|
ui.trackLabel(crown, 'title', { transform: 'billboard', rotation: 0.1 });
|
|
102
105
|
```
|
|
103
106
|
|
|
104
|
-
The scene's units are the element's CSS pixels for these labels
|
|
107
|
+
The scene's units are the element's CSS pixels for these labels. An element 160 pixels wide is 160 units wide, so the scene around it needs units of the same size.
|
|
105
108
|
|
|
106
109
|
The browser scales the element with the perspective, and keeps its text sharp. The element covers about `w × focal ÷ d` pixels of the canvas, where `w` is its width and `d` its distance. The focal length is half the canvas height in pixels, divided by the tangent of half the vertical field of view.
|
|
107
110
|
|
|
108
111
|
What the page does for such a label:
|
|
109
112
|
|
|
110
113
|
- The engine moves the element into a container of its own, inside the element's parent. The container covers its parent and holds the camera's view. Put the element in a container that covers the canvas, as for any label.
|
|
111
|
-
- The engine sets the element's `user-select` to `none`, and leaves the pointer to your CSS. Give the element `pointer-events: auto` when it takes clicks
|
|
114
|
+
- The engine sets the element's `user-select` to `none`, and leaves the pointer to your CSS. Give the element `pointer-events: auto` when it takes clicks. Keep its `transform-origin` at its center.
|
|
112
115
|
- The engine writes the element's `transform` only when its matrix changes. Its size, its text and its style stay yours.
|
|
113
116
|
- The element hides with `visibility: hidden` for the reasons listed above. The engine tests the label's anchor, so the whole element hides at once.
|
|
114
117
|
|
|
115
118
|
## Which frame the labels follow
|
|
116
119
|
|
|
117
|
-
The engine draws a frame on one thread while the sketch computes the next one on another. A label placed from the sketch's current camera would run ahead of the image during a fast camera move.
|
|
120
|
+
The engine draws a frame on one thread while the sketch computes the next one on another. A label placed from the sketch's current camera would run ahead of the image during a fast camera move. So the sketch places every label with the camera of each frame, as part of the frame's work.
|
|
118
121
|
|
|
119
|
-
|
|
122
|
+
The thread that draws keeps the places of the frame it shows, and the page moves the elements to them. Each element therefore sits over its object in the frame on screen, in every thread mode. Where the page itself draws, it moves the elements right after it draws each frame, in the same update of the page.
|
|
120
123
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
## Compared with three.js
|
|
124
|
+
<details>
|
|
125
|
+
<summary>Technical details: how labels stay in step with the frame</summary>
|
|
124
126
|
|
|
125
|
-
|
|
127
|
+
The page writes a screen label's element only when the label moved by half a CSS pixel or more, or when it shows or hides. It writes a 3D element's transform only when its matrix changed. It reads every label before it writes any style, so the browser runs no layout between them. While no element is bound, the labels cost the page nothing.
|
|
126
128
|
|
|
127
|
-
|
|
128
|
-
- A label with `transform: 'world'` takes a `CSS3DObject`'s matrix, and `'billboard'` takes a `CSS3DSprite`'s, with its `rotation2D` as `rotation`.
|
|
129
|
-
- The offset works like a `CSS2DObject`'s or `CSS3DObject`'s position under its parent.
|
|
130
|
-
- `CSS2DRenderer` and `CSS3DRenderer` hide an element with `display: none`; null3D uses `visibility: hidden`, which keeps the page's layout as it is.
|
|
131
|
-
- null3D does not set `z-index` from the distance to the camera. Elements stack in the order of the page. `CSS2DObject`'s `center` has no counterpart: move the content inside the element with CSS.
|
|
132
|
-
- null3D hides a plane whose anchor lies behind the camera, or outside the near and far planes. three.js's `CSS3DRenderer` draws such an element anyway.
|
|
133
|
-
- `CSS3DRenderer` writes every element's style in every frame. null3D writes an element's transform only when its matrix changes.
|
|
129
|
+
</details>
|
|
134
130
|
|
|
135
131
|
## Related pages
|
|
136
132
|
|
|
137
|
-
- [UI
|
|
133
|
+
- [HTML UI around the scene](../guides/ui-overlays.md): HTML UI around the canvas, and labels in a full app.
|
|
138
134
|
- [Cameras](cameras.md): `worldToScreen` places a single point on the canvas.
|
|
139
135
|
- [Engine](engine.md): `createEngine` and its label options.
|
|
140
136
|
- [Sketch](sketch.md): the sketch's context, which holds `ui`.
|
package/docs/api/vertex-draws.md
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
---
|
|
2
2
|
id: api/vertex-draws
|
|
3
3
|
title: Draws from a vertex count
|
|
4
|
-
status: experimental
|
|
5
|
-
since: "0.2"
|
|
6
4
|
summary: "scene.createVertexDraw: a custom material and a vertex count with no mesh data, the vertex and instance index in the shader, a bounds sphere, and helpers that wrap positions around the camera."
|
|
7
5
|
---
|
|
8
6
|
|
|
9
7
|
# Draws from a vertex count
|
|
10
8
|
|
|
11
|
-
> Roadmap step 0.2, first released in null3D 0.1.0. The API is experimental, so it can still change between versions.
|
|
12
|
-
|
|
13
9
|
```mermaid
|
|
14
10
|
flowchart LR
|
|
15
|
-
shader["Your WGSL<br/>@builtin(vertex_index)<br/>@builtin(instance_index)"] -->
|
|
16
|
-
counts["vertices: 6<br/>instances: 50,000"] -->
|
|
17
|
-
bounds["bounds: a sphere"] -->
|
|
18
|
-
|
|
11
|
+
shader["Your WGSL<br/>@builtin(vertex_index)<br/>@builtin(instance_index)"] --> create["scene.createVertexDraw"]
|
|
12
|
+
counts["vertices: 6<br/>instances: 50,000"] --> create
|
|
13
|
+
bounds["bounds: a sphere"] --> create
|
|
14
|
+
create --> object["A scene object<br/>place, layers, culling sphere"]
|
|
19
15
|
object --> list["The frame's draw list<br/>one draw, no buffers"]
|
|
20
16
|
```
|
|
21
17
|
|
|
22
18
|
A draw from a vertex count has a material and two numbers instead of a mesh. The numbers say how many vertices make one shape, and how many copies of the shape to draw. The shader makes every vertex itself, from the vertex index and the instance index. So the draw needs no vertex buffer, no index buffer and no per-instance data. A frame uploads nothing for it, whatever the number of copies.
|
|
23
19
|
|
|
24
|
-
Use it for rain, streaks, sparks, card effects and shapes that a formula makes.
|
|
20
|
+
Use it for rain, streaks, sparks, card effects and shapes that a formula makes. Every copy has the same vertex count and no data of its own: the shader makes each one from its index. You cannot hit-test the shapes, and the whole draw sorts as one object in the transparent pass.
|
|
25
21
|
|
|
26
22
|
## Rain around the camera
|
|
27
23
|
|
|
24
|
+

|
|
25
|
+
|
|
26
|
+
Fifty thousand rain streaks from one vertex draw.
|
|
27
|
+
|
|
28
28
|
```ts
|
|
29
29
|
import { defineSketch } from '@null3d/engine';
|
|
30
30
|
|
|
@@ -107,7 +107,7 @@ A draw's WGSL declares no texture, and the engine writes no values for a `struct
|
|
|
107
107
|
draw.setCounts(6, 80_000);
|
|
108
108
|
```
|
|
109
109
|
|
|
110
|
-
A frame reads the counts from engine memory, so a change uploads nothing.
|
|
110
|
+
A frame reads the counts from engine memory, so a change uploads nothing. A scene holds up to 256 vertex draws, and one more throws E1108.
|
|
111
111
|
|
|
112
112
|
## The bounds
|
|
113
113
|
|
|
@@ -147,7 +147,7 @@ A copy that leaves one side of the box comes back on the other side. The field t
|
|
|
147
147
|
|
|
148
148
|
- A draw sorts as one object. Per-copy sorting is not available: give several draws when copies must sort against each other.
|
|
149
149
|
- A draw casts no shadow and receives none.
|
|
150
|
-
-
|
|
150
|
+
- Raycasts and picks never hit a vertex draw, so do not use one to hit-test.
|
|
151
151
|
- The pick pass and the depth prepass draw no vertex draw, so it is no occluder.
|
|
152
152
|
- A draw has one shape and one material. For add-on draws with a feature description, use [scene.addFeatureDraw](feature-draws.md).
|
|
153
153
|
|
|
@@ -155,12 +155,13 @@ A copy that leaves one side of the box comes back on the other side. The field t
|
|
|
155
155
|
|
|
156
156
|
| Code | Cause |
|
|
157
157
|
| --- | --- |
|
|
158
|
-
| E1108 | A count that is not a whole number from 1 up, a sphere radius that is not above 0, or more draws
|
|
158
|
+
| E1108 | A count that is not a whole number from 1 up, a sphere radius that is not above 0, or more than 256 draws in a scene |
|
|
159
159
|
| E1215 | WGSL that the plugin did not compile, or one whose `@vertex` entry point is not the draw shader's |
|
|
160
160
|
| E1217 | An alpha mode other than `blend`, or the weighted blending |
|
|
161
161
|
|
|
162
162
|
## Related pages
|
|
163
163
|
|
|
164
|
+
- [The rain demo](https://github.com/null3d-engine/null3d/tree/main/examples/rain): 50,000 rain streaks from one draw with a vertex count and no mesh data.
|
|
164
165
|
- [Custom shaders](../guides/custom-shaders.md): the WGSL that the plugin compiles, and full shaders.
|
|
165
166
|
- [Built-in shader inputs](../shaders/builtins.md): `frame`, `camera` and `object`, which `fill_builtins` fills.
|
|
166
167
|
- [Shader library and imports](../shaders/library.md): `null3d::wrap` and the other modules.
|
package/docs/api/water.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
id: api/water
|
|
3
3
|
title: "Water (@null3d/water)"
|
|
4
|
-
|
|
5
|
-
since: "0.3"
|
|
6
|
-
summary: "createWater: a river and a lake from one shape, with waves that the current carries, ripples, caustics, foam, a soft shore that reads the scene's depth or the shape's bed, a reflection whose cadence follows the preset, and createUnderwater for the view from below the surface. createOcean: an open sea of spectra transformed on the GPU."
|
|
4
|
+
summary: "createWater: a river and a lake from one shape, with waves that the current carries, ripples, caustics, foam, rain rings, a soft shore that reads the scene's depth or the shape's bed, a reflection whose cadence follows the preset, and createUnderwater for the view from below the surface. createWaterfall: a fall from a river's lip, with spray and mist. createOcean: an open sea of spectra transformed on the GPU."
|
|
7
5
|
---
|
|
8
6
|
|
|
9
7
|
# Water (@null3d/water)
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
The water demo.
|
|
12
12
|
|
|
13
13
|
```mermaid
|
|
14
14
|
flowchart LR
|
|
@@ -18,24 +18,31 @@ flowchart LR
|
|
|
18
18
|
mirror["A reflection pass"] --> material
|
|
19
19
|
bed["The scene's depth,<br/>or the shape's bed"] --> material
|
|
20
20
|
material --> screen["The water"]
|
|
21
|
-
spectrum["Wave spectra,<br/>a layer for each band"] --> chain["The transform:<br/>14 butterfly passes,<br/>then the heights in meters"]
|
|
22
|
-
chain --> sea["The sea's material:<br/>heights, slopes, foam"]
|
|
23
|
-
mirror --> sea
|
|
24
|
-
sea --> ocean["The sea"]
|
|
25
21
|
preset["The quality preset"] --> mirror
|
|
26
22
|
camera["A camera under the surface"] --> under["createUnderwater"]
|
|
27
23
|
```
|
|
28
24
|
|
|
29
|
-
`@null3d/water` draws the water in a scene. A river follows a line, and a lake fills an outline, and both come from one description. The surface has long waves that the current carries downstream, and finer ripples in its normal. It draws caustics on the bed, foam around what breaks the surface, and a shore that fades where the bed rises to meet it.
|
|
25
|
+
`@null3d/water` draws the water in a scene. A river follows a line, and a lake fills an outline, and both come from one description. The surface has long waves that the current carries downstream, and finer ripples in its normal. It draws caustics on the bed, foam around what breaks the surface, and a shore that fades where the bed rises to meet it.
|
|
30
26
|
|
|
31
|
-
|
|
27
|
+
A reflection pass mirrors the banks and the sky, and redraws as often as the quality preset affords. The mirror softens where the waves lie finer than a pixel covers, since their tilt still scatters the light. A bank seen through ripples meets the surface on a soft edge, while water close to the camera stays glassy. The same surface draws from below, and `createUnderwater` gives the view from under the water its color, its bend and its caustics.
|
|
32
28
|
|
|
33
|
-
|
|
29
|
+
`createWaterfall` draws a fall from a river's lip, with spray at the lip, mist down the fall and a plume of mist at its foot.
|
|
30
|
+
|
|
31
|
+
`createOcean` draws an open sea instead. Its waves come from wave spectra, and the GPU transforms them into heights in every frame. The bands of swell and chop then move on their own, and the surface reads the slopes that the transform writes. Its reflection takes the same cadence as the river's: the preset's and the governor's at rest, and every frame while the camera that `update()` follows moves or turns.
|
|
32
|
+
|
|
33
|
+
The package is built on the engine's public API. Its surface and underwater shaders ship compiled, so your build does not compile them, and the package needs no extra setup for them. A waterfall's spray comes from `@null3d/particles`, which the package lists as a peer dependency. It loads with the first fall that makes spray.
|
|
34
34
|
|
|
35
35
|
```sh
|
|
36
|
-
bun add @null3d/water
|
|
36
|
+
bun add @null3d/water @null3d/particles
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
+
The surface draws these:
|
|
40
|
+
|
|
41
|
+
- A river and a lake from one shape, with waves and ripples that the current carries.
|
|
42
|
+
- Caustics on the bed, and foam around what breaks the surface.
|
|
43
|
+
- A shore that fades, and a reflection whose cadence follows the preset.
|
|
44
|
+
- The view from below the surface, through `createUnderwater`.
|
|
45
|
+
|
|
39
46
|
```ts
|
|
40
47
|
// sketch.ts
|
|
41
48
|
import { defineSketch } from '@null3d/engine';
|
|
@@ -79,10 +86,16 @@ export default defineSketch(async (ctx) => {
|
|
|
79
86
|
Each body has a mesh of its own, so where a river runs into a lake the two meshes overlap. There
|
|
80
87
|
each point of the surface belongs to one body. A lake owns the water inside its shore, and a river
|
|
81
88
|
the water outside every lake. The other mesh skips the point, so the water never draws twice there.
|
|
89
|
+
|
|
90
|
+
<details>
|
|
91
|
+
<summary>Technical details: how the meeting blends</summary>
|
|
92
|
+
|
|
82
93
|
The river's waves give way to the lake's still water over about 3 m on each side of the meeting.
|
|
83
94
|
The surface lies flat within a few meters of it. Both meshes carry the river's current there, so
|
|
84
|
-
their waves agree on every pixel and leave no seam. A small map over each meeting
|
|
85
|
-
|
|
95
|
+
their waves agree on every pixel and leave no seam. A small map over each meeting holds these
|
|
96
|
+
values, which the add-on makes once, when it builds the meshes.
|
|
97
|
+
|
|
98
|
+
</details>
|
|
86
99
|
|
|
87
100
|
### A river
|
|
88
101
|
|
|
@@ -127,11 +140,35 @@ the bed at a point, and the current there.
|
|
|
127
140
|
| `reflectionEvery` | A frame count from 1 to 16 for each preset | 2 on Low and Medium, 1 on High and Ultra | The frames between two draws of the reflection. The frame-budget governor doubles it while frames take too long |
|
|
128
141
|
| `reflectionFollowsBudget` | `true` or `false` | `true` | Whether the frame-budget governor may raise `reflectionEvery`. Between draws the water shows the reflection of an older camera, so on a moving camera a raised count reads as a lag. `false` keeps the count |
|
|
129
142
|
| `layers` | A 32-bit mask | The camera's layers | The layers that the reflection draws. Leave out what lies on or under the water |
|
|
130
|
-
| `reflectionScale` | `1`, `0.5` or `0.25` | 1 | The reflection's size as a share of the render size each way |
|
|
143
|
+
| `reflectionScale` | `1`, `0.5` or `0.25` | The quality preset's `reflectionScale`: 0.25 on Low, 0.5 on Medium and High, 1 on Ultra | The reflection's size as a share of the render size each way |
|
|
131
144
|
| `mesh` | `{ step, across, cell, reach }` | 2, 16, 2 and 1.36 | The meters between two cross sections along a river, the sections across it, a lake's grid cell, and how far past a river's half width its mesh reaches as a factor |
|
|
132
145
|
| `bed` | `'scene'` or `'shape'` | `'scene'` | Where the surface reads the depth of the bed: the copy of the scene's depth behind each pixel, or the depth that each shape describes |
|
|
133
|
-
| `material` | The standard material values | None | The surface's material, such as its volume's tint
|
|
146
|
+
| `material` | The standard material values | None | The surface's material, such as its volume's tint. The surface works its own thickness and transmission out, so it takes no value for those |
|
|
147
|
+
| `camera` | A `Camera` | None | The camera that the reflection follows. While it moves or turns, the reflection draws in every frame, so a moving view shows no mirror of an older one; a still camera keeps the cadence above. Without one, the cadence holds whatever the view does |
|
|
134
148
|
| `wind` | A wind field's `texture`, `size` and `air` | None | The wind that lifts the surface's short waves and carries their crests. The surface reads it once for each vertex |
|
|
149
|
+
| `windRipple` | A number from 0 | 0 | The slope that the wind raises in short crests of its own, at a feature of a few tenths of a meter. At 0 the surface's waves run with their clocks alone |
|
|
150
|
+
| `rain` | A number from 0 to 1 | 0 | How hard rain falls on the surface. Each drop rings the surface where it lands. 0 draws no rings and costs nothing |
|
|
151
|
+
|
|
152
|
+
## The foam around what breaks the water
|
|
153
|
+
|
|
154
|
+
`foamMap(ctx, obstacles, options)` makes the map that the surface breaks into flecks. Each obstacle
|
|
155
|
+
is a mark `{ x, z, r }` at the water's surface. The map holds how near every point lies to a mark,
|
|
156
|
+
from 1 at its edge to 0 a little way off. It stretches that reach toward +x, so the foam trails
|
|
157
|
+
there: the map takes the water to run along +x.
|
|
158
|
+
|
|
159
|
+
| Option | Takes | Default | What it sets |
|
|
160
|
+
| --- | --- | --- | --- |
|
|
161
|
+
| `origin`, `size` | Two numbers each, in meters | Required | The world area that the map covers |
|
|
162
|
+
| `width`, `height` | Texels | 1024, 224 | The map's texels along x and along z |
|
|
163
|
+
| `reach` | A finite number above 0, in meters | 0.35 | How far the foam reaches around a mark that gives no reach of its own |
|
|
164
|
+
| `trail` | A number, in meters | 1.6 | How far the foam trails toward +x behind a mark. 0 or less leaves a ring |
|
|
165
|
+
|
|
166
|
+
A mark takes a `reach` of its own, in meters, in place of the map's. So one water can foam further
|
|
167
|
+
around some of its stones than around others. A mark without one keeps the map's reach. A reach
|
|
168
|
+
on the map or on a mark that is not a finite number above 0 stops the call.
|
|
169
|
+
|
|
170
|
+
The foam reaches `trail × (1 + r / reach)` meters toward +x from a mark, so a mark with a shorter
|
|
171
|
+
reach trails further in proportion to its radius.
|
|
135
172
|
|
|
136
173
|
## Wind on the surface
|
|
137
174
|
|
|
@@ -155,18 +192,56 @@ return {
|
|
|
155
192
|
|
|
156
193
|
`waveAmplitude` scales the lift that the wind gives the surface, along with the long waves. A slow stream can therefore keep a nearly flat surface, with fine ripples. Its wind field still moves the plants and the leaves around it.
|
|
157
194
|
|
|
195
|
+
A field's lift rides on a long swell, which suits a lake or a river. A pool, a basin or a fountain is small beside that swell, so the lift reads there as one flat tilt of the whole surface. Give such a body a `windRipple` and the surface takes the air in short crests of its own, a few tenths of a meter apart, so its reflection moves with the gusts that sway the trees. It is 0 by default, which leaves every other surface as it was.
|
|
196
|
+
|
|
197
|
+
The crests cost one read of the field for each pixel, so a wide lake keeps the default and lets its swell answer the wind.
|
|
198
|
+
|
|
199
|
+
```ts
|
|
200
|
+
const pool = createWater(ctx, {
|
|
201
|
+
shapes,
|
|
202
|
+
wind: wind.field,
|
|
203
|
+
windRipple: 1,
|
|
204
|
+
ripple: 0,
|
|
205
|
+
});
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## Rain on the surface
|
|
209
|
+
|
|
210
|
+
Give `createWater` a `rain` amount, or call `water.setRain(amount)` while the scene runs, and each
|
|
211
|
+
raindrop rings the surface where it lands. A ring grows and fades in about a second, and the rings
|
|
212
|
+
drift downstream with the current. They bend the surface's mirror and its highlights, as real rain
|
|
213
|
+
does. A light rain rings a few of the surface's cells, and a downpour rings all of them.
|
|
214
|
+
|
|
215
|
+

|
|
216
|
+
|
|
217
|
+
Rain on the surface.
|
|
218
|
+
|
|
219
|
+
```ts
|
|
220
|
+
const water = createWater(ctx, { shapes, rain: 0 });
|
|
221
|
+
|
|
222
|
+
// When a storm starts:
|
|
223
|
+
water.setRain(1);
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
The rings follow the wet surface of the weather example add-on in `examples/addons/weather`. Each cell of a grid about a meter
|
|
227
|
+
wide takes one drop at a time, with its place and its moment from the cell's hash. They give way where
|
|
228
|
+
one pixel covers more than a ring's line, so far water does not shimmer. Rain is off by default.
|
|
229
|
+
While it is off, the surface skips the rings' work.
|
|
230
|
+
|
|
158
231
|
## The water object
|
|
159
232
|
|
|
160
233
|
`createWater` returns an object:
|
|
161
234
|
|
|
162
235
|
| Member | What it does |
|
|
163
236
|
| --- | --- |
|
|
164
|
-
| `update()` |
|
|
165
|
-
| `
|
|
237
|
+
| `update()` | Call it once in each frame. It follows the camera, so the reflection draws in every frame while the view moves or turns. It applies the lowest quality tier's reflection cadence, and passes the wind field's gusts to the surface. Call it after the wind's `update()` |
|
|
238
|
+
| `level` | The height of the water's surface, in meters |
|
|
239
|
+
| `reflectionEvery` | The frames between two draws of the reflection, as the preset and the governor set it. A moving camera draws in every frame, whatever this says |
|
|
166
240
|
| `waveAmplitude` | The height of the long waves and of the wind's lift, as a factor of their base height |
|
|
167
241
|
| `surfaceHeight(x, z, t)` | The height of the surface at a point and a sketch time, in meters, from its long waves |
|
|
168
242
|
| `currentAt(x, z, out)` | The current at a point, as a velocity in meters a second, written into `out` |
|
|
169
243
|
| `setCaustics(light)` | Sets the light that the ripples focus on the bed, as a linear color |
|
|
244
|
+
| `setRain(amount)` | Sets how hard rain falls on the surface, from 0 to 1 |
|
|
170
245
|
| `bodies` | The resolved bodies: their bounds, `depthAt`, `contains` and `currentAt` |
|
|
171
246
|
| `destroy()` | Removes the surface, its reflection pass and its material |
|
|
172
247
|
|
|
@@ -174,6 +249,22 @@ return {
|
|
|
174
249
|
swimmer floats and drifts with the water under it. Where a river meets a lake, `currentAt` gives the
|
|
175
250
|
current of the body that owns the point, and `surfaceHeight` follows the flat, mixed surface there.
|
|
176
251
|
|
|
252
|
+
## The tint of the water
|
|
253
|
+
|
|
254
|
+
The surface lets the bed's light through. The attenuation then takes a share of that light, for
|
|
255
|
+
each meter that it travels. The surface measures the travel as the depth of the bed under the
|
|
256
|
+
point. The water's own volume reaches from its surface down to that bed. So the tint of a shallow
|
|
257
|
+
creek follows its depth, and the caller sets how fast the tint gathers.
|
|
258
|
+
|
|
259
|
+
`attenuationColor` is the color that the light takes after `attenuationDistance` meters. A clear
|
|
260
|
+
creek takes a pale color over a distance of several meters. Most of the bed's light then reaches
|
|
261
|
+
the eye at every point, and a little more of it over the shallows. A dark color over a distance
|
|
262
|
+
shorter than the bed is deep takes most of that light away.
|
|
263
|
+
|
|
264
|
+
The water then reads as an opaque slab
|
|
265
|
+
of its color, with no bed under it. The surface works out its own thickness and transmission, so
|
|
266
|
+
those two values do not apply here.
|
|
267
|
+
|
|
177
268
|
## The view from under the water
|
|
178
269
|
|
|
179
270
|
`createUnderwater(ctx, camera, water, options)` adds an effect while the camera is near or under the
|
|
@@ -194,8 +285,124 @@ Call `update(t, air, caustics)` in each frame with the sketch's time, the light
|
|
|
194
285
|
horizon, and the light of the caustics. The surface seen from below shows the world above through a
|
|
195
286
|
window overhead, and turns the light back past that window's edge.
|
|
196
287
|
|
|
288
|
+
## Waterfalls
|
|
289
|
+
|
|
290
|
+

|
|
291
|
+
|
|
292
|
+
A waterfall.
|
|
293
|
+
|
|
294
|
+
```mermaid
|
|
295
|
+
flowchart LR
|
|
296
|
+
lip["A river's lip,<br/>its current and a drop"] --> path["The path of<br/>falling water"]
|
|
297
|
+
path --> sheet["A column of water:<br/>streaks that ride the water"]
|
|
298
|
+
path --> spray["Spray, mist<br/>and a plume"]
|
|
299
|
+
sheet --> fall["The waterfall"]
|
|
300
|
+
spray --> fall
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
`createWaterfall(ctx, options)` makes a waterfall that falls from a river's lip. Over its first meters it draws in to about a quarter of the lip's width, so a notch as wide as the lip shows rock beside it. It hangs close to the rock under the brink, and fades where it nears a wall or a ledge behind it.
|
|
304
|
+
|
|
305
|
+
The sheet's material moves each streak with the water from the sketch's time alone, so the fall costs the CPU nothing in a frame. Spray froths at the lip, and a plume of mist rises at its foot.
|
|
306
|
+
|
|
307
|
+
<details>
|
|
308
|
+
<summary>Technical details: how the fall is shaped and lit</summary>
|
|
309
|
+
|
|
310
|
+
The water rolls over the lip as a smooth glassy tongue and arcs out. It then drops almost straight, as falling water does while the air slows it.
|
|
311
|
+
|
|
312
|
+
Below the tongue it turns white: a solid column of rough round ropes, with soft gray shade between them and clumps of froth that ride down with the water. Its outline tears into lobes and wisps, and its sides wander and break into separate ropes as it falls. Over its lower half it breaks up into clumps and dissolves into a broad mist, about four times its width, that draws over its foot, so it never lands and never ends in a line.
|
|
313
|
+
|
|
314
|
+
A streak rides down at the water's own speed, and it stretches as the water speeds up. The fall is one closed column with an oval section. It is thin under the brink and deepens out from the cliff over its first few meters as it falls, so the fall has a solid body from the side as well as from the front. Its outline thins and tears wherever the view grazes it, so no side shows a clean edge. Small drops fly off the column.
|
|
315
|
+
|
|
316
|
+
White water scatters the light that reaches it from all round. So the column takes the sky's light as a surface facing up does, and gives back a share of the air's light that `setLight` names, as the mist beside it does, so it reads as the lightest thing beside it. The scene's light lights the column.
|
|
317
|
+
|
|
318
|
+
</details>
|
|
319
|
+
|
|
320
|
+
The spray and the mist are systems of [`@null3d/particles`](particles.md), which the water package depends on.
|
|
321
|
+
|
|
322
|
+
```ts
|
|
323
|
+
// sketch.ts
|
|
324
|
+
import { defineSketch } from '@null3d/engine';
|
|
325
|
+
import { createWater, createWaterfall } from '@null3d/water';
|
|
326
|
+
|
|
327
|
+
export default defineSketch(async (ctx) => {
|
|
328
|
+
const { scene } = ctx;
|
|
329
|
+
const camera = scene.createPerspectiveCamera({ position: [17, 5, 18], target: [0, -6, 0] });
|
|
330
|
+
scene.setActiveCamera(camera);
|
|
331
|
+
scene.createDirectionalLight({ direction: [0.35, -0.8, 0.5], intensity: 1.6 });
|
|
332
|
+
scene.setEnvironment(await ctx.assets.skyEnvironment());
|
|
333
|
+
|
|
334
|
+
// The creek runs along +x and ends at the lip.
|
|
335
|
+
const water = createWater(ctx, {
|
|
336
|
+
shapes: { kind: 'river', middle: [[-40, 0], [0, 0]], halfWidth: 2.8, depth: 0.7, speed: 1.4 },
|
|
337
|
+
});
|
|
338
|
+
const fall = await createWaterfall(ctx, {
|
|
339
|
+
lip: [0, 0],
|
|
340
|
+
direction: [1, 0],
|
|
341
|
+
halfWidth: 2.8,
|
|
342
|
+
speed: 1.4,
|
|
343
|
+
drop: 18,
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
return {
|
|
347
|
+
onUpdate() {
|
|
348
|
+
water.update();
|
|
349
|
+
},
|
|
350
|
+
onLateUpdate() {
|
|
351
|
+
fall.update();
|
|
352
|
+
},
|
|
353
|
+
};
|
|
354
|
+
});
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
End the river's own surface at the lip. The sheet starts a meter upstream of it, on the river's
|
|
358
|
+
surface, and fades in there. So the river and the fall meet without a seam.
|
|
359
|
+
|
|
360
|
+
| Option | Takes | Default | What it sets |
|
|
361
|
+
| --- | --- | --- | --- |
|
|
362
|
+
| `lip` | `[x, z]` in meters | Required | The middle of the lip, where the river's surface ends and the water falls |
|
|
363
|
+
| `direction` | `[x, z]` | Required | The way the water runs over the lip. Its length does not matter |
|
|
364
|
+
| `halfWidth` | A number above 0, in meters | Required | Half the river's width at the lip |
|
|
365
|
+
| `level` | A number, in meters | 0 | The height of the water's surface at the lip |
|
|
366
|
+
| `speed` | A number above 0, in meters a second | 1.2 | The current at the lip. 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 that leans out further meets the water, and the column fades near the rock. Give the speed at the lip itself |
|
|
367
|
+
| `drop` | A number above 0, in meters | Required | How far the fall drops below the lip. The sheet thins into mist over the lower half of the drop |
|
|
368
|
+
| `spread` | A number from 0 | 0.3 | How far each side of the sheet widens for each meter that the water falls, once it has fallen a few meters: while it still falls as a stream it spreads little, and lower down it opens into a veil. At 0.3 a creek 5 m wide that falls 13 m is about three quarters as wide as the creek halfway down, and half as wide again at its foot |
|
|
369
|
+
| `apron` | A number above 0, in meters | 1 | How far up the river the fall's water starts, lying on the river's surface. It fades in at uneven distances and covers the river's square end, so the water runs into the fall with no straight edge at the lip. Give the reach of the broken water before the brink |
|
|
370
|
+
| `fadeBelow` | A number, in meters | None | The world height of a cloud sea, a fog bank or a mist that the fall drops into. A cloud that draws before the fall does not hide it, so below this height the fall vanishes itself over 2.5 m, each clump at its own depth. The water breaks up and bursts into mist over the part of the drop above it |
|
|
371
|
+
| `spray` | A number from 0 to 3 | 1 | The spray and the mist, as a factor of the fall's own. At 0 the fall makes no particles, and neither `@null3d/particles` nor the engine's particle code loads |
|
|
372
|
+
| `mist` | A number from 0 to 3 | 1 | The mist round the fall's foot and the plume that rises from it, as a factor of the fall's own, which `spray` scales too. 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 draw a gray patch over it |
|
|
373
|
+
| `layers` | A 32-bit mask | Layer 0 | The layers that the sheet and the spray draw on |
|
|
374
|
+
| `wind` | A wind field, such as `createWind`'s `field` | None | The air that carries the mist |
|
|
375
|
+
| `material` | The standard material values | None | The sheet's material, such as the color of its white water |
|
|
376
|
+
| `mesh` | `{ across, down }` | 24 and 40 | The sections round the column, and its rows from the lip to the foot |
|
|
377
|
+
|
|
378
|
+
`createWaterfall` returns a promise of a waterfall object, since the particle code downloads on
|
|
379
|
+
first use:
|
|
380
|
+
|
|
381
|
+
| Member | What it does |
|
|
382
|
+
| --- | --- |
|
|
383
|
+
| `update()` | Steps the spray and the mist. Call it once in each frame, in `onLateUpdate`, after the wind steps |
|
|
384
|
+
| `setLight(color)` | Sets the air's light on the spray and the mist, as a linear color. Particles are not lit, so give them the scene's light in each mood. The column's white water gives back a share of it too |
|
|
385
|
+
| `setSpray(amount)` | Sets the spray and the mist, from 0 to 3. A storm raises it |
|
|
386
|
+
| `fallTime` | The seconds that the water takes from the lip to the foot |
|
|
387
|
+
| `destroy()` | Removes the sheet, its material and its particles |
|
|
388
|
+
|
|
389
|
+
A fall that lies past the edge of a water's surface does not show in that water's mirror. Put it on
|
|
390
|
+
a layer that the water's `layers` option leaves out, so the reflection pass skips it.
|
|
391
|
+
|
|
197
392
|
## The ocean
|
|
198
393
|
|
|
394
|
+

|
|
395
|
+
|
|
396
|
+
The water add-on fills the sea's heights with compute passes every frame.
|
|
397
|
+
|
|
398
|
+
```mermaid
|
|
399
|
+
flowchart LR
|
|
400
|
+
spectrum["Wave spectra,<br/>a layer for each band"] --> chain["The transform:<br/>14 butterfly passes,<br/>then the heights in meters"]
|
|
401
|
+
chain --> sea["The sea's material:<br/>heights, slopes, foam"]
|
|
402
|
+
reflection["A reflection pass"] --> sea
|
|
403
|
+
sea --> ocean["The sea"]
|
|
404
|
+
```
|
|
405
|
+
|
|
199
406
|
`createOcean(ctx, { camera })` makes an open sea. Its waves come from two or three bands of wave
|
|
200
407
|
spectra. A band is a square tile of the sea whose waves are a sum of plane waves. A spectrum gives
|
|
201
408
|
each wave an amplitude from the wind, and a seeded random number gives its phase.
|
|
@@ -238,8 +445,9 @@ export default defineSketch(async (ctx) => {
|
|
|
238
445
|
| `foam` | A number above 0, in meters | 1.1 | The height at which foam breaks on a crest |
|
|
239
446
|
| `softness` | A number above 0, in meters | 0.12 | The gap to the bed over which the water fades at a shore |
|
|
240
447
|
| `reflectionEvery` | A frame count from 1 to 16 for each preset | 2 on Low and Medium, 1 on High and Ultra | The frames between two draws of the reflection |
|
|
448
|
+
| `reflectionFollowsBudget` | `true` or `false` | `true` | Whether the frame-budget governor may raise `reflectionEvery`. Between draws the sea shows the reflection of an older camera, so on a moving camera a raised count reads as a lag. `false` keeps the count |
|
|
241
449
|
| `layers` | A 32-bit mask | The camera's layers | The layers that the reflection draws |
|
|
242
|
-
| `reflectionScale` | `1`, `0.5` or `0.25` | 1 | The reflection's size as a share of the render size each way |
|
|
450
|
+
| `reflectionScale` | `1`, `0.5` or `0.25` | The quality preset's `reflectionScale`: 0.25 on Low, 0.5 on Medium and High, 1 on Ultra | The reflection's size as a share of the render size each way |
|
|
243
451
|
| `material` | The standard material values | None | The surface's material, such as the water's tint and its thickness |
|
|
244
452
|
|
|
245
453
|
`OCEAN_BANDS` holds the default bands. Give a band of your own to change the sea: a wider tile
|
|
@@ -251,8 +459,8 @@ holds longer waves, and a taller significant height lifts them further.
|
|
|
251
459
|
|
|
252
460
|
| Member | What it does |
|
|
253
461
|
| --- | --- |
|
|
254
|
-
| `update()` | Moves the mesh about the camera
|
|
255
|
-
| `reflectionEvery` | The frames between two draws of the reflection
|
|
462
|
+
| `update()` | Moves the mesh about the camera, and follows it for the reflection's cadence, which draws in every frame while the view moves. Call it once in each frame, after the camera moves |
|
|
463
|
+
| `reflectionEvery` | The frames between two draws of the reflection, as the preset and the governor set it. A moving camera draws in every frame, whatever this says |
|
|
256
464
|
| `heightAt(x, z)` | The height of the sea at a world place, in meters, 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 |
|
|
257
465
|
| `bands` | The bands, in the order that they sum |
|
|
258
466
|
| `level` | The height of the sea's surface |
|
|
@@ -268,31 +476,43 @@ near the eye and spends its vertices far away.
|
|
|
268
476
|
the call with E1217. The depth gives the water its depth behind each pixel, so a shore fades
|
|
269
477
|
against the bank. With `bed: 'shape'`, the mesh carries each vertex's bed depth in its vertex
|
|
270
478
|
colors and the surface reads that instead, for a bed that the scene states rather than draws.
|
|
271
|
-
- **The reflection.** The pass draws the scene a second time. It draws every other frame on Low and
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
overlay shows the cadence as `reflectionEvery`. It shows the pass's GPU time and its share of a
|
|
275
|
-
frame as the water row's budget. It also shows the memory of the mesh arrays, the map of where bodies
|
|
276
|
-
meet, and the foam texture that the add-on made. The reflection target is the render graph's. `reflectionEvery` replaces the
|
|
277
|
-
preset's cadence. The pass costs no pipeline of its own, and its texture goes with `destroy`.
|
|
479
|
+
- **The reflection.** The pass draws the scene a second time. It draws every other frame on Low and Medium, and every frame on High and Ultra, and every frame while the camera moves or turns. A moving view never shows a mirror of an older one, and the cadence returns when the view settles.
|
|
480
|
+
- **The reflection's limits.** When frames take too long, the frame-budget governor doubles the wait, up to every 16th frame. While the lowest quality tier applies, a still camera draws the reflection every 16th frame whatever the preset and the governor give; leaving the tier gives the budget back.
|
|
481
|
+
- **The reflection's cost in the overlay.** The stats overlay shows the cadence as `reflectionEvery`, the pass's GPU time and its share of a frame as the water row's budget, and its memory. The pass costs no pipeline of its own, and its texture goes with `destroy`.
|
|
278
482
|
- **Levels of detail.** The river, lake and ocean meshes take `levels: false`, because the waves
|
|
279
483
|
move their vertices in the shader. The engine plans no levels for them.
|
|
280
484
|
- **Transmission.** The surface lets light through, so the engine copies the scene's colors in the
|
|
281
485
|
frame that the water draws. The water draws both faces.
|
|
282
486
|
- **Nothing before its first use.** A page that never creates water downloads none of the add-on.
|
|
487
|
+
- **A waterfall.** It draws one blended mesh, a closed column of just over 2,000 triangles at the
|
|
488
|
+
default detail. For a fall 2.5 m wide that drops 10 m, each of its particle systems holds a few
|
|
489
|
+
hundred large puffs at most; a taller or wider fall makes more. The column reads the copy
|
|
490
|
+
of the scene's depth. The puffs blend over the pixels that they cover, so lower `spray` where a
|
|
491
|
+
phone's frame is short.
|
|
283
492
|
- **One way to make water.** Use this package rather than a hand-written custom material, so a
|
|
284
493
|
scene's water has one owner.
|
|
285
494
|
- **One water a page.** The add-on registers one water feature, so a page makes its water with one
|
|
286
495
|
`createWater` call. Give that call every body that shares the surface and the reflection. An
|
|
287
496
|
ocean is a feature of its own, so a page may draw a river and a sea.
|
|
288
|
-
- **The ocean's transform.** A sea
|
|
289
|
-
|
|
290
|
-
room for the sketch's own. Each pass runs on a 128 by 128 grid, with a band
|
|
291
|
-
|
|
292
|
-
transform's share.
|
|
497
|
+
- **The ocean's transform.** A sea adds 14 butterfly passes, one pass that puts the heights in
|
|
498
|
+
meters and one reflection pass. Those 16 passes take 16 of the 31 passes that a sketch may add,
|
|
499
|
+
so leave room for the sketch's own. Each transform pass runs on a 128 by 128 grid, with a band
|
|
500
|
+
to a layer, and the reflection draws at the reflection scale. The stats overlay names the
|
|
501
|
+
add-on's ocean row and its budget, and the frame's GPU time holds the transform's share.
|
|
502
|
+
|
|
503
|
+
<details>
|
|
504
|
+
<summary>Technical details: the reflection's memory</summary>
|
|
293
505
|
|
|
294
|
-
|
|
295
|
-
|
|
506
|
+
The overlay's memory figure holds the mesh arrays, the map of where bodies meet, and the foam texture that the add-on made. The reflection target is the render graph's.
|
|
507
|
+
|
|
508
|
+
</details>
|
|
509
|
+
|
|
510
|
+
<details>
|
|
511
|
+
<summary>Technical details: the fall's particle systems</summary>
|
|
512
|
+
|
|
513
|
+
The fall adds four particle systems: a froth at the lip, the drops thrown off the column, the mist that the fall dissolves into, and the plume at its foot.
|
|
514
|
+
|
|
515
|
+
</details>
|
|
296
516
|
|
|
297
517
|
## Related pages
|
|
298
518
|
|
|
@@ -301,3 +521,10 @@ description. The engine's doc comments make it.
|
|
|
301
521
|
- [Surface functions](../shaders/surface-functions.md#the-scenes-depth): the scene's depth in a
|
|
302
522
|
custom material.
|
|
303
523
|
- [Quality API](quality.md): the preset and the frame-budget governor.
|
|
524
|
+
- [Rivers and lakes](https://github.com/null3d-engine/null3d/tree/main/examples/water): a river winds down a valley into a lake, and the camera dives under it.
|
|
525
|
+
- [The ocean](https://github.com/null3d-engine/null3d/tree/main/examples/ocean): three bands of wave spectra, transformed by compute passes every frame.
|
|
526
|
+
- [Waterfalls](https://github.com/null3d-engine/null3d/tree/main/examples/showcase/creek): the fall is one part of the Creek showcase, which also runs a creek, a spring pool and an underwater view.
|
|
527
|
+
|
|
528
|
+
## API reference
|
|
529
|
+
|
|
530
|
+
[The API reference](reference/water.md) lists every export of this page with its type and description. The engine's doc comments make it.
|