@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/lib/scene/resources.d.ts
CHANGED
|
@@ -7,9 +7,11 @@ import type { TextureValues, UniformValues } from './wgsl-uniforms.js';
|
|
|
7
7
|
* A lower level of detail of a mesh: a simpler mesh that draws in the base mesh's place. Give its
|
|
8
8
|
* `error`, the `distance` at which it switches in, or the screen `coverage` under which it draws.
|
|
9
9
|
* A level with a measured error, which the asset tool writes, changes the picture by under a pixel
|
|
10
|
-
* at a small threshold and switches at once.
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* at a small threshold and switches at once.
|
|
11
|
+
*
|
|
12
|
+
* When the governor raises the threshold above about one and a half pixels, that switch shows, and
|
|
13
|
+
* such a level then fades too. A level given by a distance, by a coverage or by a hand-set error
|
|
14
|
+
* fades over a short band, so its switch does not pop.
|
|
13
15
|
*
|
|
14
16
|
* @category api/geometry
|
|
15
17
|
*/
|
|
@@ -73,8 +75,8 @@ export interface MeshLevelOptions {
|
|
|
73
75
|
/**
|
|
74
76
|
* The vertical field of view, in degrees, that checks the order of the levels when the mesh
|
|
75
77
|
* takes them. Each frame compares a level's error or coverage with the field of view of the
|
|
76
|
-
* view that draws it, so this option moves no switch. The default is 50,
|
|
77
|
-
*
|
|
78
|
+
* view that draws it, so this option moves no switch. The default is 50, a perspective
|
|
79
|
+
* camera's default.
|
|
78
80
|
*/
|
|
79
81
|
fov?: number;
|
|
80
82
|
}
|
|
@@ -110,8 +112,10 @@ export interface BuildLevelsOptions {
|
|
|
110
112
|
* The levels of detail that a mesh made in code plans on its own. By default it plans them the
|
|
111
113
|
* first time the scene draws it, when it holds `geometry.automaticLevelTriangles` triangles or
|
|
112
114
|
* more, or when it holds at least `geometry.automaticCopyTriangles` triangles and its copies hold `geometry.automaticDrawnTriangles` together; `false` plans none,
|
|
113
|
-
* and `true` or options plan them when the mesh is made, at any size.
|
|
114
|
-
*
|
|
115
|
+
* and `true` or options plan them when the mesh is made, at any size.
|
|
116
|
+
*
|
|
117
|
+
* `'pieces'` plans no lower levels, and sorts a mesh of 32,768 triangles or more into pieces by
|
|
118
|
+
* space at its first draw, as
|
|
115
119
|
* a merged far cell or a large ground whose levels come from elsewhere gains from.
|
|
116
120
|
*
|
|
117
121
|
* @category api/geometry
|
|
@@ -131,8 +135,8 @@ export declare class MeshGeometry {
|
|
|
131
135
|
/** How many morph targets the mesh has. 0 for a mesh without any. */
|
|
132
136
|
readonly morphTargets: number;
|
|
133
137
|
/**
|
|
134
|
-
* The morph targets' names,
|
|
135
|
-
*
|
|
138
|
+
* The morph targets' names, in target order, or none when the mesh's arrays named none.
|
|
139
|
+
* `mesh.setMorphWeight` takes a name too.
|
|
136
140
|
*/
|
|
137
141
|
readonly morphTargetNames: readonly string[];
|
|
138
142
|
/** The geometry that made the mesh, whose scene says which objects use it. */
|
|
@@ -185,26 +189,24 @@ export declare class MeshGeometry {
|
|
|
185
189
|
get center(): readonly [number, number, number];
|
|
186
190
|
private boundsCenter;
|
|
187
191
|
/**
|
|
188
|
-
* Destroys the mesh
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
* throw E1101.
|
|
192
|
+
* Destroys the mesh. The engine frees its GPU memory and its other data at once, and later
|
|
193
|
+
* meshes take its room. Destroy the objects and instance batches that use it first, in the same
|
|
194
|
+
* frame or before. Its lower levels go with it, since a level draws its base's vertices. Throws
|
|
195
|
+
* E1111 while one still uses it, and E1101 for a mesh that is destroyed already. Later calls
|
|
196
|
+
* that pass the mesh throw E1101.
|
|
194
197
|
*/
|
|
195
198
|
destroy(): void;
|
|
196
199
|
/**
|
|
197
|
-
* Writes new values into one attribute of the mesh's vertices
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
*
|
|
202
|
-
* alpha. The mesh keeps the bounding sphere it was made with, so give objects that draw
|
|
200
|
+
* Writes new values into one attribute of the mesh's vertices. `values` holds the attribute's
|
|
201
|
+
* values of every vertex, in the array type the mesh was made with, as `geometry.fromArrays`
|
|
202
|
+
* takes them. Only vertices `start` to `start + count - 1` change, which the next frame uploads.
|
|
203
|
+
* The defaults update every vertex. Colors take three or four values per vertex: three keep each
|
|
204
|
+
* vertex's alpha. The mesh keeps the bounding sphere it was made with, so give objects that draw
|
|
203
205
|
* vertices outside it bounds with `setBounds`. The four-number vertex record takes updates as
|
|
204
206
|
* `targets`. Joints, weights, and a mesh with joints or morph targets take no updates. A level
|
|
205
|
-
* that draws its base mesh's vertices writes them, so the base and every level of it draw the
|
|
206
|
-
*
|
|
207
|
-
*
|
|
207
|
+
* that draws its base mesh's vertices writes them, so the base and every level of it draw the new
|
|
208
|
+
* values. The levels that `buildLevels` or the automatic default planned measured the old shape,
|
|
209
|
+
* so the first update takes them away, and the mesh plans no automatic levels again;
|
|
208
210
|
* `buildLevels` plans them for the new shape. Throws E1206 for values that do not fit the mesh,
|
|
209
211
|
* and E1101 for a destroyed mesh. Allocates nothing, so a call in every frame makes no garbage.
|
|
210
212
|
*/
|
|
@@ -215,19 +217,19 @@ export declare class MeshGeometry {
|
|
|
215
217
|
*/
|
|
216
218
|
get levels(): readonly MeshLevel[];
|
|
217
219
|
/**
|
|
218
|
-
* Gives the mesh lower levels of detail, from the most detailed down
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
* more cheaply; a level without one draws with the level before's material. A bound that
|
|
223
|
-
*
|
|
224
|
-
*
|
|
225
|
-
*
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
*
|
|
220
|
+
* Gives the mesh lower levels of detail, from the most detailed down. A mesh takes at most 15
|
|
221
|
+
* lower levels. Every object and instance batch that draws the mesh then picks one level per
|
|
222
|
+
* frame. It draws the coarsest level whose error covers fewer pixels on the screen than the
|
|
223
|
+
* `lodThreshold` quality setting. A level may name a material of its own, so a far level shades
|
|
224
|
+
* more cheaply; a level without one draws with the level before's material. A bound that covers
|
|
225
|
+
* fewer pixels than the threshold draws nothing, so the mesh's last level holds no geometry. The
|
|
226
|
+
* shadow maps pick their own levels, by each map's texel size, so a caster's shadow shows the
|
|
227
|
+
* detail that the map can hold. An empty list takes the levels away. Morphed objects, and
|
|
228
|
+
* materials that blend or let light through, draw the base mesh. A skinned object draws a level
|
|
229
|
+
* while the level names the base mesh's own vertices. Destroying a level's mesh takes every level
|
|
230
|
+
* away. Levels set here win over the ones that `buildLevels` or the automatic default plans: a
|
|
231
|
+
* plan that runs ends, and the planned levels go. Throws E1221 for levels the mesh cannot take,
|
|
232
|
+
* and E1101 for a destroyed mesh.
|
|
231
233
|
*/
|
|
232
234
|
setLevels(levels: readonly MeshLevel[], options?: MeshLevelOptions): void;
|
|
233
235
|
/**
|
|
@@ -531,9 +533,9 @@ export type UpdatableAttribute = 'positions' | 'normals' | 'uvs' | 'uvs1' | 'col
|
|
|
531
533
|
*/
|
|
532
534
|
export type IntegerArray = Int8Array | Uint8Array | Int16Array | Uint16Array;
|
|
533
535
|
/**
|
|
534
|
-
* One attribute's numbers with a note on how its integers read
|
|
535
|
-
*
|
|
536
|
-
*
|
|
536
|
+
* One attribute's numbers with a note on how its integers read. Normalized integers read as
|
|
537
|
+
* fractions: from 0 to 1 when unsigned, and from -1 to 1 when signed. Plain integers read as whole
|
|
538
|
+
* numbers.
|
|
537
539
|
*
|
|
538
540
|
* @category api/geometry
|
|
539
541
|
*/
|
|
@@ -541,9 +543,9 @@ export interface VertexArray {
|
|
|
541
543
|
/** The numbers, as `MeshArrays` takes them. */
|
|
542
544
|
array: Float32Array | IntegerArray | readonly number[];
|
|
543
545
|
/**
|
|
544
|
-
* True when the integers are normalized. The default is false, as in
|
|
545
|
-
*
|
|
546
|
-
*
|
|
546
|
+
* True when the integers are normalized. The default is false, as in glTF. It applies to
|
|
547
|
+
* positions and texture coordinates. The other attributes read integers one way only, so they
|
|
548
|
+
* refuse a value that says otherwise.
|
|
547
549
|
*/
|
|
548
550
|
normalized?: boolean;
|
|
549
551
|
}
|
|
@@ -556,29 +558,28 @@ export interface VertexArray {
|
|
|
556
558
|
*/
|
|
557
559
|
export type VertexValues = Float32Array | IntegerArray | readonly number[] | VertexArray;
|
|
558
560
|
/**
|
|
559
|
-
* A mesh's morph targets,
|
|
560
|
-
*
|
|
561
|
-
*
|
|
562
|
-
*
|
|
563
|
-
*
|
|
564
|
-
* `setMorphWeight`, and clips animate.
|
|
561
|
+
* A mesh's morph targets, as glTF stores them. Each list holds one array per target, of three
|
|
562
|
+
* numbers per vertex, or for colors as many as the mesh's `colors` hold. They say how far the
|
|
563
|
+
* target moves the vertex's position, normal, tangent or color at weight 1. Every list has the same
|
|
564
|
+
* number of targets, from 1 to 256. A mesh's targets move its vertices by their weights, which each
|
|
565
|
+
* object sets with `setMorphWeight`, and clips animate.
|
|
565
566
|
*
|
|
566
567
|
* @category api/geometry
|
|
567
568
|
*/
|
|
568
569
|
export interface MorphTargets {
|
|
569
|
-
/** For each target, how far it moves each position.
|
|
570
|
+
/** For each target, how far it moves each position. */
|
|
570
571
|
positions?: readonly (Float32Array | readonly number[])[];
|
|
571
|
-
/** For each target, how far it turns each normal.
|
|
572
|
+
/** For each target, how far it turns each normal. */
|
|
572
573
|
normals?: readonly (Float32Array | readonly number[])[];
|
|
573
574
|
/**
|
|
574
|
-
* For each target, how far it turns each tangent's direction: three numbers per vertex, as
|
|
575
|
-
*
|
|
575
|
+
* For each target, how far it turns each tangent's direction: three numbers per vertex, as glTF
|
|
576
|
+
* gives them.
|
|
576
577
|
*/
|
|
577
578
|
tangents?: readonly (Float32Array | readonly number[])[];
|
|
578
579
|
/**
|
|
579
580
|
* For each target, how far it changes each vertex color: three or four numbers per vertex, as
|
|
580
|
-
* many as the mesh's `colors` hold, in linear color.
|
|
581
|
-
*
|
|
581
|
+
* many as the mesh's `colors` hold, in linear color. A morphed color is clamped to the range 0 to
|
|
582
|
+
* 1, as the glTF specification asks. Needs `colors`.
|
|
582
583
|
*/
|
|
583
584
|
colors?: readonly (Float32Array | readonly number[])[];
|
|
584
585
|
/** The targets' names, one per target, which `setMorphWeight` takes in place of numbers. */
|
|
@@ -586,8 +587,7 @@ export interface MorphTargets {
|
|
|
586
587
|
}
|
|
587
588
|
/**
|
|
588
589
|
* The arrays of a mesh for `geometry.fromArrays`. Each array holds its values for vertex 0, then
|
|
589
|
-
* vertex 1, and so on
|
|
590
|
-
* them.
|
|
590
|
+
* vertex 1, and so on. The engine copies them.
|
|
591
591
|
*
|
|
592
592
|
* An attribute can come as 32-bit floats, or as the 8-bit and 16-bit integers that glTF's
|
|
593
593
|
* `KHR_mesh_quantization` allows for it. The mesh keeps that type on the GPU. Smaller types take
|
|
@@ -599,48 +599,44 @@ export interface MorphTargets {
|
|
|
599
599
|
*/
|
|
600
600
|
export interface MeshArrays {
|
|
601
601
|
/**
|
|
602
|
-
* Three numbers per vertex: x, y and z.
|
|
603
|
-
*
|
|
602
|
+
* Three numbers per vertex: x, y and z. Takes floats, or 8-bit or 16-bit integers, normalized or
|
|
603
|
+
* plain.
|
|
604
604
|
*/
|
|
605
605
|
positions: VertexValues;
|
|
606
606
|
/**
|
|
607
|
-
* Three numbers per vertex: a direction of length 1 away from the surface.
|
|
608
|
-
* `
|
|
609
|
-
*
|
|
607
|
+
* Three numbers per vertex: a direction of length 1 away from the surface. Pass normals, or set
|
|
608
|
+
* `computeNormals` instead. Takes floats, or an `Int8Array` or `Int16Array`, whose integers read
|
|
609
|
+
* as fractions from -1 to 1.
|
|
610
610
|
*/
|
|
611
611
|
normals?: VertexValues;
|
|
612
612
|
/**
|
|
613
|
-
* Texture coordinates: two numbers per vertex, u and v.
|
|
614
|
-
*
|
|
613
|
+
* Texture coordinates: two numbers per vertex, u and v. Takes floats, or 8-bit or 16-bit
|
|
614
|
+
* integers, normalized or plain.
|
|
615
615
|
*/
|
|
616
616
|
uvs?: VertexValues;
|
|
617
617
|
/**
|
|
618
618
|
* A second set of texture coordinates, two numbers per vertex, such as those of a light map.
|
|
619
|
-
*
|
|
619
|
+
* Takes the same types as `uvs`.
|
|
620
620
|
*/
|
|
621
621
|
uvs1?: VertexValues;
|
|
622
622
|
/**
|
|
623
|
-
* Linear colors, three numbers per vertex from 0 to 1, or four with alpha.
|
|
624
|
-
* `
|
|
625
|
-
* fractions from 0 to 1.
|
|
623
|
+
* Linear colors, three numbers per vertex from 0 to 1, or four with alpha. Takes floats, or a
|
|
624
|
+
* `Uint8Array` or `Uint16Array`, whose integers read as fractions from 0 to 1.
|
|
626
625
|
*/
|
|
627
626
|
colors?: VertexValues;
|
|
628
627
|
/**
|
|
629
|
-
* Four numbers per vertex: the direction in which u grows along the surface, then 1 or -1 for
|
|
630
|
-
*
|
|
631
|
-
* `normals`.
|
|
628
|
+
* Four numbers per vertex: the direction in which u grows along the surface, then 1 or -1 for the
|
|
629
|
+
* direction in which v grows. Takes the same types as `normals`.
|
|
632
630
|
*/
|
|
633
631
|
tangents?: VertexValues;
|
|
634
632
|
/**
|
|
635
633
|
* The joints that move each vertex of a skinned mesh: four joint indices per vertex, in a
|
|
636
|
-
* `Uint8Array`, a `Uint16Array` or a plain array.
|
|
637
|
-
* `weights` with them.
|
|
634
|
+
* `Uint8Array`, a `Uint16Array` or a plain array. Give `weights` with them.
|
|
638
635
|
*/
|
|
639
636
|
joints?: VertexValues;
|
|
640
637
|
/**
|
|
641
|
-
* How much each of a vertex's four joints moves it: four numbers per vertex, which add up to
|
|
642
|
-
*
|
|
643
|
-
* whose integers read as fractions from 0 to 1.
|
|
638
|
+
* How much each of a vertex's four joints moves it: four numbers per vertex, which add up to 1.
|
|
639
|
+
* Takes floats, or a `Uint8Array` or `Uint16Array`, whose integers read as fractions from 0 to 1.
|
|
644
640
|
*/
|
|
645
641
|
weights?: VertexValues;
|
|
646
642
|
/**
|
|
@@ -654,17 +650,16 @@ export interface MeshArrays {
|
|
|
654
650
|
/**
|
|
655
651
|
* Three vertex indices per triangle, counter-clockwise when you look at its front. 16-bit and
|
|
656
652
|
* 32-bit indices both work. Without indices, each three vertices in a row make a triangle.
|
|
657
|
-
* Like three.js's `setIndex`.
|
|
658
653
|
*/
|
|
659
654
|
indices?: Uint16Array | Uint32Array | readonly number[];
|
|
660
655
|
/**
|
|
661
|
-
* Computes the normals from the triangles
|
|
662
|
-
*
|
|
656
|
+
* Computes the normals from the triangles: each vertex gets the average of its triangles'
|
|
657
|
+
* normals, weighted by their areas.
|
|
663
658
|
*/
|
|
664
659
|
computeNormals?: boolean;
|
|
665
660
|
/**
|
|
666
|
-
* Computes the tangents from the positions, the normals and `uvs`,
|
|
667
|
-
*
|
|
661
|
+
* Computes the tangents on the job workers, from the positions, the normals and `uvs`, with Eric
|
|
662
|
+
* Lengyel's method.
|
|
668
663
|
*/
|
|
669
664
|
computeTangents?: boolean;
|
|
670
665
|
/**
|
|
@@ -687,8 +682,7 @@ export interface MeshArrays {
|
|
|
687
682
|
levels?: LevelsOption;
|
|
688
683
|
}
|
|
689
684
|
/**
|
|
690
|
-
* Mesh generators
|
|
691
|
-
* from arrays.
|
|
685
|
+
* Mesh generators for common shapes, and meshes from arrays.
|
|
692
686
|
*
|
|
693
687
|
* @category api/geometry
|
|
694
688
|
*/
|
|
@@ -722,32 +716,31 @@ export declare class Geometry {
|
|
|
722
716
|
* number.
|
|
723
717
|
*/
|
|
724
718
|
private shape;
|
|
725
|
-
/** A box,
|
|
719
|
+
/** A box, centered on its origin. */
|
|
726
720
|
box(options?: BoxOptions): MeshGeometry;
|
|
727
|
-
/** A sphere,
|
|
721
|
+
/** A sphere with its poles on the Y axis, or a part of one. */
|
|
728
722
|
sphere(options?: SphereOptions): MeshGeometry;
|
|
729
|
-
/** A flat rectangle
|
|
723
|
+
/** A flat rectangle in the XY plane that faces +Z. */
|
|
730
724
|
plane(options?: PlaneOptions): MeshGeometry;
|
|
731
|
-
/** A cylinder,
|
|
725
|
+
/** A cylinder on the Y axis, closed at each end unless `openEnded` is true. */
|
|
732
726
|
cylinder(options?: CylinderOptions): MeshGeometry;
|
|
733
|
-
/** A cone
|
|
727
|
+
/** A cone on the Y axis: a cylinder whose top is a point. */
|
|
734
728
|
cone(options?: ConeOptions): MeshGeometry;
|
|
735
|
-
/** A torus
|
|
729
|
+
/** A torus: a tube bent into a ring around the Z axis. */
|
|
736
730
|
torus(options?: TorusOptions): MeshGeometry;
|
|
737
|
-
/** A capsule
|
|
731
|
+
/** A capsule: a cylinder on the Y axis with a half sphere on each end. */
|
|
738
732
|
capsule(options?: CapsuleOptions): MeshGeometry;
|
|
739
|
-
/** A flat circle,
|
|
733
|
+
/** A flat circle in the XY plane that faces +Z, or a slice of one. */
|
|
740
734
|
circle(options?: CircleOptions): MeshGeometry;
|
|
741
|
-
/** A flat ring,
|
|
735
|
+
/** A flat ring: a disc with a hole, in the XY plane, that faces +Z. */
|
|
742
736
|
ring(options?: RingOptions): MeshGeometry;
|
|
743
737
|
/**
|
|
744
|
-
* A mesh from arrays of vertex attributes and triangle indices
|
|
745
|
-
*
|
|
746
|
-
*
|
|
747
|
-
*
|
|
748
|
-
*
|
|
749
|
-
*
|
|
750
|
-
* do not fit the vertices or whose lists hold different numbers of targets.
|
|
738
|
+
* A mesh from arrays of vertex attributes and triangle indices. The mesh keeps the attributes it
|
|
739
|
+
* gets, each in the type of number it came in, and meshes whose attributes have the same types
|
|
740
|
+
* share GPU buffers. A mesh can have any number of vertices. Throws E1206 when an array's length
|
|
741
|
+
* does not fit the vertex count, when its attribute does not take its type of number, when an
|
|
742
|
+
* index names no vertex, for a value that is not a finite number, and for morph targets whose
|
|
743
|
+
* arrays do not fit the vertices or whose lists hold different numbers of targets.
|
|
751
744
|
*/
|
|
752
745
|
fromArrays(arrays: MeshArrays): MeshGeometry;
|
|
753
746
|
}
|
|
@@ -775,11 +768,12 @@ export interface MaterialOptions {
|
|
|
775
768
|
/**
|
|
776
769
|
* How a material uses its alpha: its opacity, times its base color map's alpha, and times its
|
|
777
770
|
* mesh's vertex alpha with `vertexColors`. The `opaque` mode ignores the alpha. The `mask` mode
|
|
778
|
-
* draws nothing where the alpha falls below `alphaCutoff`, and draws the rest opaque
|
|
779
|
-
*
|
|
780
|
-
*
|
|
781
|
-
*
|
|
782
|
-
*
|
|
771
|
+
* draws nothing where the alpha falls below `alphaCutoff`, and draws the rest opaque.
|
|
772
|
+
*
|
|
773
|
+
* The `hash` mode draws each point of the surface opaque or not at all, by a pattern that stays on
|
|
774
|
+
* the mesh.
|
|
775
|
+
* The alpha then sets how much of the surface draws. The `blend` mode blends the surface over what
|
|
776
|
+
* lies behind it. Blended objects draw after the opaque ones, farthest first.
|
|
783
777
|
*
|
|
784
778
|
* @category api/materials
|
|
785
779
|
*/
|
|
@@ -788,29 +782,27 @@ export type AlphaMode = 'opaque' | 'mask' | 'hash' | 'blend';
|
|
|
788
782
|
* How a blended surface meets what lies behind it. The `normal` blending covers it as far as the
|
|
789
783
|
* alpha says. The `additive` blending adds the surface's light, for glows and fire. The `multiply`
|
|
790
784
|
* blending tints it, for stains and tinted glass. The `weighted` blending covers it as `normal`
|
|
791
|
-
* does, but blends the surfaces of this blending in any order, by a weighted average
|
|
792
|
-
*
|
|
793
|
-
*
|
|
785
|
+
* does, but blends the surfaces of this blending in any order, by a weighted average. Use it for
|
|
786
|
+
* smoke, dense particles and many overlapping panes, where sorting by object leaves surfaces in the
|
|
787
|
+
* wrong order.
|
|
794
788
|
*
|
|
795
789
|
* @category api/materials
|
|
796
790
|
*/
|
|
797
791
|
export type Blending = 'normal' | 'additive' | 'multiply' | 'weighted';
|
|
798
792
|
/**
|
|
799
|
-
* A depth bias
|
|
800
|
-
*
|
|
801
|
-
* toward the camera, as in three.js.
|
|
793
|
+
* A depth bias. It moves a surface's depth before the depth test, so a decal on a wall wins the
|
|
794
|
+
* depth test and does not fight with the wall. Negative values pull the surface toward the camera.
|
|
802
795
|
*
|
|
803
796
|
* @category api/materials
|
|
804
797
|
*/
|
|
805
798
|
export interface DepthBias {
|
|
806
799
|
/**
|
|
807
|
-
* Steps of the depth buffer's smallest difference
|
|
808
|
-
*
|
|
800
|
+
* Steps of the depth buffer's smallest difference. A fraction rounds to the nearest whole
|
|
801
|
+
* number, as WebGPU takes it. The default is 0.
|
|
809
802
|
*/
|
|
810
803
|
constant?: number;
|
|
811
804
|
/**
|
|
812
|
-
* A factor of how steeply the surface's depth changes across the screen
|
|
813
|
-
* `polygonOffsetFactor`. The default is 0.
|
|
805
|
+
* A factor of how steeply the surface's depth changes across the screen. The default is 0.
|
|
814
806
|
*/
|
|
815
807
|
slopeScale?: number;
|
|
816
808
|
}
|
|
@@ -837,20 +829,18 @@ export interface StandardValues extends MaterialOptions {
|
|
|
837
829
|
*/
|
|
838
830
|
normalScale?: readonly [number, number];
|
|
839
831
|
/**
|
|
840
|
-
* How strongly the bump map bends normals
|
|
841
|
-
*
|
|
842
|
-
* default is 1.
|
|
832
|
+
* How strongly the bump map bends normals: the change of its red channel from one pixel to the
|
|
833
|
+
* next times this. Negative values turn bumps into dents. The default is 1.
|
|
843
834
|
*/
|
|
844
835
|
bumpScale?: number;
|
|
845
836
|
/**
|
|
846
|
-
* How far the displacement map's white moves each vertex along its normal, in the mesh's units
|
|
847
|
-
*
|
|
837
|
+
* How far the displacement map's white moves each vertex along its normal, in the mesh's units.
|
|
838
|
+
* The default is 1.
|
|
848
839
|
*/
|
|
849
840
|
displacementScale?: number;
|
|
850
841
|
/**
|
|
851
842
|
* How far the displacement map moves every vertex along its normal, added to its texel's
|
|
852
|
-
* share of `displacementScale`, in the mesh's units
|
|
853
|
-
* default is 0.
|
|
843
|
+
* share of `displacementScale`, in the mesh's units. The default is 0.
|
|
854
844
|
*/
|
|
855
845
|
displacementBias?: number;
|
|
856
846
|
/** How much the occlusion map darkens ambient light, from 0 to 1. The default is 1. */
|
|
@@ -858,30 +848,27 @@ export interface StandardValues extends MaterialOptions {
|
|
|
858
848
|
/** The factor of the light map's light: 0 or more. The default is 1. */
|
|
859
849
|
lightMapIntensity?: number;
|
|
860
850
|
/**
|
|
861
|
-
* The index of refraction of the surface's non-metallic part, 1 or more
|
|
862
|
-
*
|
|
863
|
-
*
|
|
864
|
-
* model does.
|
|
851
|
+
* The index of refraction of the surface's non-metallic part, 1 or more. It sets how much
|
|
852
|
+
* light the surface reflects when seen head on: `((ior - 1) / (ior + 1))^2`. The default is
|
|
853
|
+
* 1.5, which reflects 4%, as glTF's metallic-roughness model does.
|
|
865
854
|
*/
|
|
866
855
|
ior?: number;
|
|
867
856
|
/**
|
|
868
|
-
* The strength of the specular reflection of the surface's non-metallic part, from 0 to 1
|
|
869
|
-
*
|
|
870
|
-
*
|
|
857
|
+
* The strength of the specular reflection of the surface's non-metallic part, from 0 to 1. It
|
|
858
|
+
* scales the reflection at every angle, so 0 leaves only diffuse light. Metals ignore it. The
|
|
859
|
+
* default is 1.
|
|
871
860
|
*/
|
|
872
861
|
specularIntensity?: number;
|
|
873
862
|
/**
|
|
874
863
|
* The color that tints the specular reflection of the surface's non-metallic part when seen head
|
|
875
|
-
* on
|
|
876
|
-
*
|
|
877
|
-
*
|
|
878
|
-
* light. The default is white.
|
|
864
|
+
* on. At grazing angles the reflection stays white, and metals ignore it. It takes the forms
|
|
865
|
+
* that `color` takes, and its three linear components may also exceed 1, as glTF allows, to
|
|
866
|
+
* reflect more than the index of refraction gives, up to all the light. The default is white.
|
|
879
867
|
*/
|
|
880
868
|
specularColor?: ColorInput;
|
|
881
869
|
/**
|
|
882
|
-
* The factor of the scene environment's light on the surface, 0 or more
|
|
883
|
-
*
|
|
884
|
-
* default is 1.
|
|
870
|
+
* The factor of the scene environment's light on the surface, 0 or more. It multiplies the
|
|
871
|
+
* intensity that `scene.setEnvironment` gives. The default is 1.
|
|
885
872
|
*/
|
|
886
873
|
envIntensity?: number;
|
|
887
874
|
/** Where the maps sit on the texture coordinates. The default leaves them as they are. */
|
|
@@ -893,40 +880,36 @@ export interface StandardValues extends MaterialOptions {
|
|
|
893
880
|
mapUvTransforms?: MapUvTransforms;
|
|
894
881
|
/**
|
|
895
882
|
* How much of the light behind the surface passes through it, from 0 to 1, for glass and clear
|
|
896
|
-
* water
|
|
897
|
-
*
|
|
898
|
-
*
|
|
899
|
-
*
|
|
900
|
-
*
|
|
901
|
-
*
|
|
902
|
-
* pixels that remain, as three.js's `alphaTest` does. The default is 0.
|
|
883
|
+
* water. That share of the diffuse light becomes the light from behind, and the reflections
|
|
884
|
+
* stay. Roughness blurs what shows through. Give it when you create the material, even as 0, to
|
|
885
|
+
* change it later. A material created without it lets no light through. Such a material draws
|
|
886
|
+
* after the opaque objects, with the blended ones, and only opaque objects show through it. It
|
|
887
|
+
* takes the `opaque`, `mask` or `blend` alpha mode. A mask decides which pixels draw, and the
|
|
888
|
+
* light from behind fills the pixels that remain. The default is 0.
|
|
903
889
|
*/
|
|
904
890
|
transmission?: number;
|
|
905
891
|
/**
|
|
906
|
-
* The thickness of the volume under the surface, in the mesh's own units, 0 or more
|
|
907
|
-
*
|
|
908
|
-
*
|
|
892
|
+
* The thickness of the volume under the surface, in the mesh's own units, 0 or more. Light that
|
|
893
|
+
* passes through bends by `ior` over this distance, and the volume's color absorbs part of it.
|
|
894
|
+
* 0 is a thin wall, which bends no light. The default is 0.
|
|
909
895
|
*/
|
|
910
896
|
thickness?: number;
|
|
911
897
|
/**
|
|
912
898
|
* The color that white light takes after it travels `attenuationDistance` through the
|
|
913
|
-
* volume,
|
|
914
|
-
* white, which absorbs nothing.
|
|
899
|
+
* volume, in the forms that `color` takes. The default is white, which absorbs nothing.
|
|
915
900
|
*/
|
|
916
901
|
attenuationColor?: ColorInput;
|
|
917
902
|
/**
|
|
918
903
|
* The distance in world units over which light in the volume takes `attenuationColor`, above
|
|
919
|
-
* 0
|
|
920
|
-
* `Infinity`.
|
|
904
|
+
* 0. `Infinity` absorbs nothing. The default is `Infinity`.
|
|
921
905
|
*/
|
|
922
906
|
attenuationDistance?: number;
|
|
923
907
|
/**
|
|
924
|
-
* The strength of the volume's dispersion, 0 or more, as
|
|
925
|
-
*
|
|
926
|
-
*
|
|
927
|
-
*
|
|
928
|
-
*
|
|
929
|
-
* `transmission`, and the default is 0.
|
|
908
|
+
* The strength of the volume's dispersion, 0 or more, as glTF's `KHR_materials_dispersion`
|
|
909
|
+
* gives it: 20 divided by the Abbe number, so a diamond's 0.36 is weak and rutile's 2.04 is
|
|
910
|
+
* strong. The light from behind bends by a slightly different index of refraction for each
|
|
911
|
+
* color, so a prism or a gem separates it into colors at its edges. 0 bends every color alike.
|
|
912
|
+
* It shows only with `transmission`, and the default is 0.
|
|
930
913
|
*/
|
|
931
914
|
dispersion?: number;
|
|
932
915
|
/**
|
|
@@ -964,67 +947,63 @@ export interface StandardValues extends MaterialOptions {
|
|
|
964
947
|
*/
|
|
965
948
|
subsurfaceColor?: ColorInput;
|
|
966
949
|
/**
|
|
967
|
-
* How much of a clear coat covers the surface, from 0 to 1, as
|
|
968
|
-
*
|
|
969
|
-
*
|
|
970
|
-
*
|
|
971
|
-
* change it later. The default is 0.
|
|
950
|
+
* How much of a clear coat covers the surface, from 0 to 1: a thin, shiny layer, as on car
|
|
951
|
+
* paint, varnish or a wet stone, with its own highlights and reflection. It dims what lies
|
|
952
|
+
* below it where it reflects light. Give it, or another option of a clear coat or a sheen, when
|
|
953
|
+
* you create the material, to change it later. The default is 0.
|
|
972
954
|
*/
|
|
973
955
|
clearcoat?: number;
|
|
974
|
-
/** How rough the clear coat is, from 0 (a mirror) to 1
|
|
956
|
+
/** How rough the clear coat is, from 0 (a mirror) to 1. The default is 0. */
|
|
975
957
|
clearcoatRoughness?: number;
|
|
976
958
|
/**
|
|
977
|
-
* How strongly the coat normal map bends the coat's normals along u and along v
|
|
978
|
-
* `
|
|
959
|
+
* How strongly the coat normal map bends the coat's normals along u and along v. The default is
|
|
960
|
+
* `[1, 1]`, and negative values flip a direction.
|
|
979
961
|
*/
|
|
980
962
|
clearcoatNormalScale?: readonly [number, number];
|
|
981
963
|
/**
|
|
982
|
-
* The color of a sheen, the soft glow at grazing angles of velvet, cloth and fuzz,
|
|
983
|
-
*
|
|
984
|
-
*
|
|
985
|
-
*
|
|
964
|
+
* The color of a sheen, the soft glow at grazing angles of velvet, cloth and fuzz, in the forms
|
|
965
|
+
* that `color` takes. The color alone sets the sheen's strength, so black gives none. Give it,
|
|
966
|
+
* or another option of a clear coat or a sheen, when you create the material, to change it
|
|
967
|
+
* later. The default is black.
|
|
986
968
|
*/
|
|
987
969
|
sheenColor?: ColorInput;
|
|
988
|
-
/** How rough the sheen is, from 0 to 1
|
|
970
|
+
/** How rough the sheen is, from 0 to 1: rougher sheens spread wider. The default is 1. */
|
|
989
971
|
sheenRoughness?: number;
|
|
990
972
|
/**
|
|
991
|
-
* How much a thin film above the surface tints its reflection, from 0 to 1,
|
|
992
|
-
*
|
|
993
|
-
*
|
|
994
|
-
* The default is 0.
|
|
973
|
+
* How much a thin film above the surface tints its reflection, from 0 to 1: soap bubbles, oil
|
|
974
|
+
* and beetle shells show the colors of the film's thickness. Give it, or another option of
|
|
975
|
+
* iridescence, when you create the material, to change it later. The default is 0.
|
|
995
976
|
*/
|
|
996
977
|
iridescence?: number;
|
|
997
978
|
/**
|
|
998
|
-
* The thin film's index of refraction, 1 or more
|
|
999
|
-
*
|
|
1000
|
-
* default is 1.3.
|
|
979
|
+
* The thin film's index of refraction, 1 or more: 1 makes the film reflect as the surface does,
|
|
980
|
+
* and a value near 2 shows its colors most strongly. The default is 1.3.
|
|
1001
981
|
*/
|
|
1002
982
|
iridescenceIor?: number;
|
|
1003
983
|
/**
|
|
1004
|
-
* The thinnest and thickest parts of the film, in nanometers
|
|
1005
|
-
*
|
|
1006
|
-
* `[100, 400]`.
|
|
984
|
+
* The thinnest and thickest parts of the film, in nanometers: the map's green channel mixes
|
|
985
|
+
* between them. The default is `[100, 400]`.
|
|
1007
986
|
*/
|
|
1008
987
|
iridescenceThicknessRange?: readonly [number, number];
|
|
1009
988
|
/**
|
|
1010
989
|
* How far the specular reflection stretches along one direction of the surface, from 0 (round)
|
|
1011
|
-
* to 1
|
|
1012
|
-
*
|
|
1013
|
-
*
|
|
1014
|
-
*
|
|
1015
|
-
* The default is 0.
|
|
990
|
+
* to 1: brushed metal shows a highlight across its grooves rather than around. A material with
|
|
991
|
+
* a map takes the stretch's direction from the mesh's tangents or from the map's coordinates; a
|
|
992
|
+
* material without one takes a frame square to the surface. Give it, or `anisotropyRotation`,
|
|
993
|
+
* when you create the material, to change it later. The default is 0.
|
|
1016
994
|
*/
|
|
1017
995
|
anisotropy?: number;
|
|
1018
996
|
/**
|
|
1019
|
-
* The direction along which the reflection stretches, in radians from the surface's tangent
|
|
1020
|
-
*
|
|
997
|
+
* The direction along which the reflection stretches, in radians from the surface's tangent.
|
|
998
|
+
* The default is 0.
|
|
1021
999
|
*/
|
|
1022
1000
|
anisotropyRotation?: number;
|
|
1023
1001
|
}
|
|
1024
1002
|
/**
|
|
1025
|
-
* Where a material's maps sit on the texture coordinates
|
|
1026
|
-
*
|
|
1027
|
-
*
|
|
1003
|
+
* Where a material's maps sit on the texture coordinates. The engine turns the coordinates by
|
|
1004
|
+
* `rotation` about their origin, scales them by `repeat`, and then adds `offset`:
|
|
1005
|
+
* u' = repeat.u × (u cos r + v sin r) + offset.u, and v' = repeat.v × (v cos r − u sin r) + offset.v.
|
|
1006
|
+
* A transform that leaves a value out takes its default.
|
|
1028
1007
|
*
|
|
1029
1008
|
* @category api/materials
|
|
1030
1009
|
*/
|
|
@@ -1056,18 +1035,17 @@ export interface StandardMaps {
|
|
|
1056
1035
|
/** Normals in tangent space, in linear color, which `normalScale` scales. */
|
|
1057
1036
|
normalMap?: Texture;
|
|
1058
1037
|
/**
|
|
1059
|
-
* Heights in red, in linear color, which bend the normals
|
|
1060
|
-
* `bumpScale`. A normal map wins over it,
|
|
1038
|
+
* Heights in red, in linear color, which bend the normals by the change of the height from one
|
|
1039
|
+
* pixel to the next, times `bumpScale`. A normal map wins over it, and so does a wireframe.
|
|
1061
1040
|
*/
|
|
1062
1041
|
bumpMap?: Texture;
|
|
1063
1042
|
/**
|
|
1064
1043
|
* Heights in red, in linear color, which move each vertex along its normal by
|
|
1065
|
-
* `displacementScale` and `displacementBias
|
|
1066
|
-
*
|
|
1067
|
-
*
|
|
1068
|
-
*
|
|
1069
|
-
*
|
|
1070
|
-
* outlines and debug views see the mesh before it moves.
|
|
1044
|
+
* `displacementScale` and `displacementBias`. Shadows and the depth prepass follow the moved
|
|
1045
|
+
* vertices, and culling grows each object's bounds to hold them. Without a normal or bump map,
|
|
1046
|
+
* the map's slope also bends the normals, so the light follows the new shape. The vertex shader
|
|
1047
|
+
* reads the map at its full size, so the mesh needs vertices about as dense as the detail it
|
|
1048
|
+
* should show. Raycasts, outlines and debug views see the mesh before it moves.
|
|
1071
1049
|
*/
|
|
1072
1050
|
displacementMap?: Texture;
|
|
1073
1051
|
/**
|
|
@@ -1111,8 +1089,8 @@ export interface StandardMaps {
|
|
|
1111
1089
|
/**
|
|
1112
1090
|
* The thickness of the volume under the surface, in green, in linear color. Its green
|
|
1113
1091
|
* multiplies `thickness`. Only a material created with `transmission` takes it. It keeps a row
|
|
1114
|
-
* slot of its own and samples the specular color map's texture array at its own layer, so
|
|
1115
|
-
* specular color map
|
|
1092
|
+
* slot of its own and samples the specular color map's texture array at its own layer, so it
|
|
1093
|
+
* takes no specular color map, whose sRGB texture never shares that array. A material with
|
|
1116
1094
|
* layers keeps it unless a layer map fills that slot: the sheen's maps and an anisotropy map do.
|
|
1117
1095
|
*/
|
|
1118
1096
|
thicknessMap?: Texture;
|
|
@@ -1171,30 +1149,28 @@ export interface MaterialFeatures {
|
|
|
1171
1149
|
/** Takes the scene's fog. False keeps the material's color at every distance. The default is true. */
|
|
1172
1150
|
fog?: boolean;
|
|
1173
1151
|
/**
|
|
1174
|
-
*
|
|
1175
|
-
*
|
|
1176
|
-
*
|
|
1177
|
-
*
|
|
1178
|
-
*
|
|
1179
|
-
*
|
|
1180
|
-
* default is true.
|
|
1152
|
+
* False keeps the color as the display shows it. The tone curve leaves it alone: the 8-bit path
|
|
1153
|
+
* decides that in the shader of the material's own build, and the HDR path's final pass reads a
|
|
1154
|
+
* mask of these surfaces and skips the curve where one draws. A blended surface keeps the curve
|
|
1155
|
+
* on the HDR path, since a blended pixel mixes two surfaces. The vignette and the sRGB encoding
|
|
1156
|
+
* still apply, and the exposure already scales the material's colors, so the color shows
|
|
1157
|
+
* brighter than the same color tone mapped. The default is true.
|
|
1181
1158
|
*/
|
|
1182
1159
|
toneMapped?: boolean;
|
|
1183
1160
|
/** How the material uses its alpha. The default is `opaque`. */
|
|
1184
1161
|
alphaMode?: AlphaMode;
|
|
1185
1162
|
/**
|
|
1186
|
-
* With the `mask` alpha mode, smooths the cut edges with MSAA
|
|
1187
|
-
* `
|
|
1188
|
-
*
|
|
1189
|
-
*
|
|
1190
|
-
*
|
|
1163
|
+
* With the `mask` alpha mode, smooths the cut edges with MSAA: the alpha fades over about one
|
|
1164
|
+
* pixel above `alphaCutoff`, and covers that share of the pixel. Without MSAA the mask cuts as
|
|
1165
|
+
* without it. False gives hard cut edges. A custom material takes it where its WGSL sets or
|
|
1166
|
+
* reads the surface's `alpha`, and a development build throws E1217 otherwise. The default is
|
|
1167
|
+
* true.
|
|
1191
1168
|
*/
|
|
1192
1169
|
alphaToCoverage?: boolean;
|
|
1193
1170
|
/**
|
|
1194
1171
|
* With the `blend` alpha mode and `doubleSided`, draws both faces in one draw, in the mesh's
|
|
1195
|
-
* order
|
|
1196
|
-
*
|
|
1197
|
-
* false.
|
|
1172
|
+
* order. By default such a surface draws its back faces first and then its front faces, so its
|
|
1173
|
+
* near side always covers its far side. The default is false.
|
|
1198
1174
|
*/
|
|
1199
1175
|
forceSinglePass?: boolean;
|
|
1200
1176
|
/** With the `blend` alpha mode, how the surface meets what lies behind it. The default is `normal`. */
|
|
@@ -1202,25 +1178,25 @@ export interface MaterialFeatures {
|
|
|
1202
1178
|
/** False to write no depth, so the surface hides nothing behind it. The default is true. */
|
|
1203
1179
|
depthWrite?: boolean;
|
|
1204
1180
|
/**
|
|
1205
|
-
* False to draw the surface whatever lies in front of it. It then writes no depth either
|
|
1206
|
-
*
|
|
1181
|
+
* False to draw the surface whatever lies in front of it. It then writes no depth either. The
|
|
1182
|
+
* default is true.
|
|
1207
1183
|
*/
|
|
1208
1184
|
depthTest?: boolean;
|
|
1209
1185
|
/**
|
|
1210
|
-
* False to write no color, so the surface shows nothing itself and hides what lies behind it
|
|
1211
|
-
*
|
|
1212
|
-
*
|
|
1213
|
-
*
|
|
1214
|
-
*
|
|
1215
|
-
*
|
|
1186
|
+
* False to write no color, so the surface shows nothing itself and hides what lies behind it by
|
|
1187
|
+
* the depth it writes. Its objects draw before the opaque objects that write color, so nothing
|
|
1188
|
+
* behind it shows through. With the `mask` or `hash` alpha mode, the parts that the alpha drops
|
|
1189
|
+
* write no depth either, so the surface cuts a shape out of the space it holds. A blended
|
|
1190
|
+
* surface keeps its place among the blended objects, which `setRenderOrder` orders. The default
|
|
1191
|
+
* is true.
|
|
1216
1192
|
*/
|
|
1217
1193
|
colorWrite?: boolean;
|
|
1218
|
-
/** Moves the surface's depth
|
|
1194
|
+
/** Moves the surface's depth before the depth test. The default is no bias. */
|
|
1219
1195
|
depthBias?: DepthBias;
|
|
1220
1196
|
/**
|
|
1221
|
-
* Draws the edges of each triangle as lines one pixel wide, with the material's own shading
|
|
1222
|
-
*
|
|
1223
|
-
*
|
|
1197
|
+
* Draws the edges of each triangle as lines one pixel wide, with the material's own shading.
|
|
1198
|
+
* Edges that two triangles share draw twice. Its shadows draw lines too. Flat shading and bump
|
|
1199
|
+
* maps have no effect on it. The default is false.
|
|
1224
1200
|
*/
|
|
1225
1201
|
wireframe?: boolean;
|
|
1226
1202
|
}
|
|
@@ -1245,14 +1221,15 @@ export interface StandardBaseOptions extends StandardValues, MaterialFeatures {
|
|
|
1245
1221
|
*/
|
|
1246
1222
|
flatShading?: boolean;
|
|
1247
1223
|
/**
|
|
1248
|
-
* Where a light map's texture coordinates start
|
|
1249
|
-
* each light map on a mesh with its own scale and
|
|
1250
|
-
* two numbers, and needs a `lightMap`. The default
|
|
1224
|
+
* Where a light map's texture coordinates start: the engine adds it to the coordinates after
|
|
1225
|
+
* `lightMapRepeat` scales them. A bake places each light map on a mesh with its own scale and
|
|
1226
|
+
* offset, apart from the other maps. It takes two numbers, and needs a `lightMap`. The default
|
|
1227
|
+
* leaves the coordinates alone.
|
|
1251
1228
|
*/
|
|
1252
1229
|
lightMapOffset?: readonly [number, number];
|
|
1253
1230
|
/**
|
|
1254
|
-
* How a light map's texture coordinates stretch
|
|
1255
|
-
* numbers, and needs a `lightMap`. The default is `[1, 1]`.
|
|
1231
|
+
* How a light map's texture coordinates stretch: the engine multiplies the coordinates by it.
|
|
1232
|
+
* It takes two numbers, and needs a `lightMap`. The default is `[1, 1]`.
|
|
1256
1233
|
*/
|
|
1257
1234
|
lightMapRepeat?: readonly [number, number];
|
|
1258
1235
|
/**
|
|
@@ -1348,8 +1325,7 @@ export interface UnlitOptions extends UnlitValues, MaterialFeatures {
|
|
|
1348
1325
|
export interface ShadowCatcherValues extends MaterialOptions {
|
|
1349
1326
|
}
|
|
1350
1327
|
/**
|
|
1351
|
-
* Options of `materials.shadowCatcher`, a material that draws only the shadows that fall on it
|
|
1352
|
-
* three.js's `ShadowMaterial`.
|
|
1328
|
+
* Options of `materials.shadowCatcher`, a material that draws only the shadows that fall on it.
|
|
1353
1329
|
*
|
|
1354
1330
|
* @category api/materials
|
|
1355
1331
|
*/
|
|
@@ -1438,9 +1414,10 @@ export interface ShaderOptions<Wgsl extends string | CompiledWgsl = string | Com
|
|
|
1438
1414
|
* the WGSL calls `sceneDepth(uv)` or `sceneDistance(uv)`, and the engine binds the copy of the
|
|
1439
1415
|
* opaque scene's depth. A material that declares it draws after that copy exists, so it reads
|
|
1440
1416
|
* it in the transparent pass; a surface that draws earlier reads 0, the far plane. A material
|
|
1441
|
-
* that declares it
|
|
1442
|
-
*
|
|
1443
|
-
* sampled textures. The engine checks that the declaration and
|
|
1417
|
+
* that declares it samples at most six textures of its own, as every custom material does. Its
|
|
1418
|
+
* maps' group gives the copy a slot that those textures leave free, under WebGPU's limit of
|
|
1419
|
+
* sixteen sampled textures in the fragment stage. The engine checks that the declaration and
|
|
1420
|
+
* the WGSL agree.
|
|
1444
1421
|
*/
|
|
1445
1422
|
sceneInputs?: readonly SceneInput[];
|
|
1446
1423
|
/**
|
|
@@ -1490,6 +1467,11 @@ export declare class Material<Values extends MaterialOptions = MaterialOptions>
|
|
|
1490
1467
|
private bump;
|
|
1491
1468
|
/** The displacement map's scale and bias, which `set` changes one at a time, where it has one. */
|
|
1492
1469
|
private displacement;
|
|
1470
|
+
private inspectorNumbersGiven;
|
|
1471
|
+
private inspectorEmissive;
|
|
1472
|
+
private inspectorColorGiven;
|
|
1473
|
+
private inspectorEmissiveGiven;
|
|
1474
|
+
private inspectorBlending;
|
|
1493
1475
|
/**
|
|
1494
1476
|
* Where each map sits on the texture coordinates, as `set` last gave them: for every slot, the
|
|
1495
1477
|
* offset's two numbers, the scale's two and the rotation, so an animation can change one pair
|
|
@@ -1525,20 +1507,18 @@ export declare class Material<Values extends MaterialOptions = MaterialOptions>
|
|
|
1525
1507
|
/** Each map's transform, which a value makes where the material has none. */
|
|
1526
1508
|
private uvValues;
|
|
1527
1509
|
/**
|
|
1528
|
-
* Destroys the material
|
|
1529
|
-
*
|
|
1530
|
-
*
|
|
1531
|
-
*
|
|
1532
|
-
*
|
|
1533
|
-
* pass it, throw E1101.
|
|
1510
|
+
* Destroys the material. Objects and instance batches that still use it draw nothing until
|
|
1511
|
+
* `setMaterial` gives them another material. Once no object uses it, its place in the engine's
|
|
1512
|
+
* table of materials goes to the next material. When the last material of a custom material's
|
|
1513
|
+
* WGSL goes, the engine frees that WGSL's pipelines. The material's textures stay, so destroy
|
|
1514
|
+
* them apart. Later calls on the material, and calls that pass it, throw E1101.
|
|
1534
1515
|
*/
|
|
1535
1516
|
destroy(): void;
|
|
1536
1517
|
}
|
|
1537
1518
|
/**
|
|
1538
1519
|
* Material factories. The standard material follows glTF's metallic-roughness model and shades
|
|
1539
|
-
* with
|
|
1540
|
-
*
|
|
1541
|
-
* light's shadows, as three.js's `ShadowMaterial`.
|
|
1520
|
+
* with Lambert diffuse light and a GGX highlight. The unlit material shows its color whatever the
|
|
1521
|
+
* lights. The shadow-catcher material shows only the main directional light's shadows.
|
|
1542
1522
|
*
|
|
1543
1523
|
* @category api/materials
|
|
1544
1524
|
*/
|
|
@@ -1555,33 +1535,30 @@ export declare class Materials {
|
|
|
1555
1535
|
*/
|
|
1556
1536
|
private createId;
|
|
1557
1537
|
/**
|
|
1558
|
-
* A lit material with glTF's metallic-roughness model
|
|
1559
|
-
* `MeshStandardMaterial`.
|
|
1538
|
+
* A lit material with glTF's metallic-roughness model.
|
|
1560
1539
|
*/
|
|
1561
1540
|
standard(options?: StandardOptions): Material<StandardValues>;
|
|
1562
1541
|
/**
|
|
1563
1542
|
* A decal's material: the standard material, projected onto every opaque surface inside the
|
|
1564
|
-
* box of each object that it draws
|
|
1565
|
-
*
|
|
1566
|
-
*
|
|
1567
|
-
*
|
|
1568
|
-
*
|
|
1569
|
-
*
|
|
1543
|
+
* box of each object that it draws. Give it to a mesh of `geometry.box()`: the object's
|
|
1544
|
+
* position, rotation and scale place the box, and the material's maps stretch over the box's x
|
|
1545
|
+
* and y sides, seen along its z axis. The surfaces inside take its color, roughness, metalness,
|
|
1546
|
+
* normal map and emissive light, lit by the scene's lights, and blend with them as far as its
|
|
1547
|
+
* alpha says. A decal draws after the opaque objects, and marks no blended surface. It casts no
|
|
1548
|
+
* shadow.
|
|
1570
1549
|
*/
|
|
1571
1550
|
decal(options?: DecalOptions): Material<DecalValues>;
|
|
1572
1551
|
/**
|
|
1573
|
-
* A material that ignores lights and shows its color unlit
|
|
1574
|
-
*
|
|
1575
|
-
* them to that material.
|
|
1552
|
+
* A material that ignores lights and shows its color unlit. The exposure and the tone mapping
|
|
1553
|
+
* still apply to it.
|
|
1576
1554
|
*/
|
|
1577
1555
|
unlit(options?: UnlitOptions): Material<UnlitValues>;
|
|
1578
1556
|
/**
|
|
1579
|
-
* A material that draws only the shadows that fall on it
|
|
1580
|
-
*
|
|
1581
|
-
*
|
|
1582
|
-
*
|
|
1583
|
-
*
|
|
1584
|
-
* three.js's. The material blends, so it draws in the transparent pass after the opaque
|
|
1557
|
+
* A material that draws only the shadows that fall on it: its `color` where the main
|
|
1558
|
+
* directional light's shadow falls, and nothing where the light reaches it, at `opacity`. The
|
|
1559
|
+
* mesh must receive shadows (`setReceiveShadows(true)`). Every shadow that falls on the surface
|
|
1560
|
+
* comes from the main directional light; point and spot lights cast none onto it. The default
|
|
1561
|
+
* color is black. The material blends, so it draws in the transparent pass after the opaque
|
|
1585
1562
|
* objects, and the scene's fog leaves it alone. It takes no texture maps.
|
|
1586
1563
|
*/
|
|
1587
1564
|
shadowCatcher(options?: ShadowCatcherOptions): Material<ShadowCatcherValues>;
|