@null3d/engine 0.0.0-stage → 0.0.0
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/LICENSE-APACHE +176 -0
- package/LICENSE-MIT +21 -0
- package/THIRD-PARTY-NOTICES.txt +638 -0
- package/dist/wasm/single/null3d.js +3959 -0
- package/dist/wasm/single/null3d_bg.wasm +0 -0
- package/dist/wasm/threaded/null3d.js +3975 -0
- package/dist/wasm/threaded/null3d_bg.wasm +0 -0
- package/docs/api/animation.md +536 -0
- package/docs/api/assets.md +384 -0
- package/docs/api/cameras.md +159 -0
- package/docs/api/controls.md +317 -0
- package/docs/api/debug.md +445 -0
- package/docs/api/engine.md +248 -0
- package/docs/api/feature-draws.md +172 -0
- package/docs/api/feature-effects.md +137 -0
- package/docs/api/feature-instances.md +154 -0
- package/docs/api/features.md +324 -0
- package/docs/api/geometry.md +326 -0
- package/docs/api/grass.md +114 -0
- package/docs/api/impostors.md +163 -0
- package/docs/api/input.md +245 -0
- package/docs/api/lights.md +290 -0
- package/docs/api/lines.md +180 -0
- package/docs/api/materials.md +876 -0
- package/docs/api/math.md +130 -0
- package/docs/api/objects.md +155 -0
- package/docs/api/page.md +97 -0
- package/docs/api/particles.md +217 -0
- package/docs/api/points.md +152 -0
- package/docs/api/post.md +495 -0
- package/docs/api/quality.md +195 -0
- package/docs/api/raycast.md +288 -0
- package/docs/api/reference/animation.md +158 -0
- package/docs/api/reference/assets.md +335 -0
- package/docs/api/reference/cameras.md +135 -0
- package/docs/api/reference/controls.md +411 -0
- package/docs/api/reference/debug.md +571 -0
- package/docs/api/reference/engine.md +635 -0
- package/docs/api/reference/feature-draws.md +94 -0
- package/docs/api/reference/feature-effects.md +32 -0
- package/docs/api/reference/feature-instances.md +63 -0
- package/docs/api/reference/features.md +361 -0
- package/docs/api/reference/geometry.md +777 -0
- package/docs/api/reference/grass.md +131 -0
- package/docs/api/reference/impostors.md +277 -0
- package/docs/api/reference/input.md +121 -0
- package/docs/api/reference/lights.md +257 -0
- package/docs/api/reference/lines.md +84 -0
- package/docs/api/reference/materials.md +375 -0
- package/docs/api/reference/math.md +229 -0
- package/docs/api/reference/objects.md +103 -0
- package/docs/api/reference/particles.md +336 -0
- package/docs/api/reference/points.md +57 -0
- package/docs/api/reference/post.md +244 -0
- package/docs/api/reference/quality.md +209 -0
- package/docs/api/reference/raycast.md +94 -0
- package/docs/api/reference/render.md +238 -0
- package/docs/api/reference/scene.md +540 -0
- package/docs/api/reference/sketch.md +121 -0
- package/docs/api/reference/splats.md +214 -0
- package/docs/api/reference/sprites.md +71 -0
- package/docs/api/reference/tasks.md +92 -0
- package/docs/api/reference/terrain.md +160 -0
- package/docs/api/reference/textures.md +153 -0
- package/docs/api/reference/three-compat.md +60 -0
- package/docs/api/reference/time.md +25 -0
- package/docs/api/reference/ui.md +52 -0
- package/docs/api/reference/vertex-draws.md +55 -0
- package/docs/api/reference/water.md +359 -0
- package/docs/api/reference/wind.md +106 -0
- package/docs/api/render.md +497 -0
- package/docs/api/scene.md +595 -0
- package/docs/api/sketch.md +170 -0
- package/docs/api/splats.md +257 -0
- package/docs/api/sprites.md +185 -0
- package/docs/api/tasks.md +106 -0
- package/docs/api/terrain.md +130 -0
- package/docs/api/textures.md +272 -0
- package/docs/api/three-compat.md +102 -0
- package/docs/api/time.md +134 -0
- package/docs/api/ui.md +146 -0
- package/docs/api/vertex-draws.md +171 -0
- package/docs/api/water.md +303 -0
- package/docs/api/wind.md +375 -0
- package/docs/cli/null3d.md +528 -0
- package/docs/concepts/architecture.md +174 -0
- package/docs/concepts/assets.md +145 -0
- package/docs/concepts/backends.md +195 -0
- package/docs/concepts/color-management.md +145 -0
- package/docs/concepts/culling.md +227 -0
- package/docs/concepts/handles.md +93 -0
- package/docs/concepts/instances.md +285 -0
- package/docs/concepts/large-worlds.md +126 -0
- package/docs/concepts/lighting.md +592 -0
- package/docs/concepts/lod.md +254 -0
- package/docs/concepts/materials.md +128 -0
- package/docs/concepts/particle-buffer.md +201 -0
- package/docs/concepts/post-processing.md +442 -0
- package/docs/concepts/quality-preset-tables.md +91 -0
- package/docs/concepts/quality-presets.md +312 -0
- package/docs/concepts/render-graph.md +217 -0
- package/docs/concepts/render-layers.md +125 -0
- package/docs/concepts/shadows.md +466 -0
- package/docs/concepts/static-dynamic.md +113 -0
- package/docs/cookbook/index.md +664 -0
- package/docs/data/threejs-mapping.json +2118 -0
- package/docs/errors/E1101.md +23 -0
- package/docs/errors/E1102.md +23 -0
- package/docs/errors/E1103.md +23 -0
- package/docs/errors/E1104.md +23 -0
- package/docs/errors/E1105.md +23 -0
- package/docs/errors/E1106.md +23 -0
- package/docs/errors/E1107.md +23 -0
- package/docs/errors/E1108.md +23 -0
- package/docs/errors/E1109.md +23 -0
- package/docs/errors/E1110.md +23 -0
- package/docs/errors/E1111.md +23 -0
- package/docs/errors/E1112.md +23 -0
- package/docs/errors/E1203.md +23 -0
- package/docs/errors/E1204.md +23 -0
- package/docs/errors/E1205.md +23 -0
- package/docs/errors/E1206.md +23 -0
- package/docs/errors/E1207.md +23 -0
- package/docs/errors/E1208.md +23 -0
- package/docs/errors/E1209.md +23 -0
- package/docs/errors/E1213.md +23 -0
- package/docs/errors/E1214.md +23 -0
- package/docs/errors/E1215.md +23 -0
- package/docs/errors/E1216.md +23 -0
- package/docs/errors/E1217.md +23 -0
- package/docs/errors/E1218.md +23 -0
- package/docs/errors/E1219.md +23 -0
- package/docs/errors/E1220.md +23 -0
- package/docs/errors/E1221.md +23 -0
- package/docs/errors/E1222.md +23 -0
- package/docs/errors/E1223.md +23 -0
- package/docs/errors/E1224.md +23 -0
- package/docs/errors/E1225.md +23 -0
- package/docs/errors/E1301.md +23 -0
- package/docs/errors/E1302.md +23 -0
- package/docs/errors/E1303.md +23 -0
- package/docs/errors/E1304.md +23 -0
- package/docs/errors/E1305.md +23 -0
- package/docs/errors/E1306.md +23 -0
- package/docs/errors/E1401.md +23 -0
- package/docs/errors/E1402.md +23 -0
- package/docs/errors/E1403.md +23 -0
- package/docs/errors/E1404.md +23 -0
- package/docs/errors/E1405.md +23 -0
- package/docs/errors/E1406.md +23 -0
- package/docs/errors/E1407.md +23 -0
- package/docs/errors/E1408.md +23 -0
- package/docs/errors/E1409.md +23 -0
- package/docs/errors/E1410.md +23 -0
- package/docs/errors/E1411.md +23 -0
- package/docs/errors/E1412.md +23 -0
- package/docs/errors/E1413.md +23 -0
- package/docs/errors/E1414.md +23 -0
- package/docs/errors/E1415.md +23 -0
- package/docs/errors/E1416.md +23 -0
- package/docs/errors/E1417.md +23 -0
- package/docs/errors/E1418.md +23 -0
- package/docs/errors/E1419.md +23 -0
- package/docs/errors/E1420.md +23 -0
- package/docs/errors/E1421.md +23 -0
- package/docs/errors/E1422.md +23 -0
- package/docs/errors/E1423.md +23 -0
- package/docs/errors/E1424.md +23 -0
- package/docs/errors/E1425.md +23 -0
- package/docs/errors/E1426.md +23 -0
- package/docs/errors/E1430.md +23 -0
- package/docs/errors/E1431.md +23 -0
- package/docs/errors/E1432.md +23 -0
- package/docs/errors/E1433.md +23 -0
- package/docs/errors/E1434.md +23 -0
- package/docs/errors/E1435.md +23 -0
- package/docs/errors/E1436.md +23 -0
- package/docs/errors/E1437.md +23 -0
- package/docs/errors/E1501.md +23 -0
- package/docs/errors/E1502.md +23 -0
- package/docs/errors/E1503.md +23 -0
- package/docs/errors/E1504.md +23 -0
- package/docs/errors/E1505.md +23 -0
- package/docs/errors/E1506.md +23 -0
- package/docs/errors/index.md +92 -0
- package/docs/getting-started/cdn.md +219 -0
- package/docs/getting-started/first-scene.md +129 -0
- package/docs/getting-started/hosting.md +359 -0
- package/docs/getting-started/install.md +111 -0
- package/docs/getting-started/network-use.md +88 -0
- package/docs/getting-started/project-structure.md +69 -0
- package/docs/getting-started/third-party-notices.md +92 -0
- package/docs/guides/accessibility.md +96 -0
- package/docs/guides/add-ons.md +159 -0
- package/docs/guides/agents.md +66 -0
- package/docs/guides/assets-pipeline.md +504 -0
- package/docs/guides/audio.md +163 -0
- package/docs/guides/baked-light-data.md +176 -0
- package/docs/guides/car-paint.md +121 -0
- package/docs/guides/content-pages.md +234 -0
- package/docs/guides/custom-passes.md +585 -0
- package/docs/guides/custom-shaders.md +290 -0
- package/docs/guides/debugging.md +162 -0
- package/docs/guides/deploying.md +15 -0
- package/docs/guides/deterministic-simulation.md +226 -0
- package/docs/guides/first-use-shaders.md +57 -0
- package/docs/guides/lens-kit.md +134 -0
- package/docs/guides/loading-screens.md +218 -0
- package/docs/guides/multiple-views.md +83 -0
- package/docs/guides/performance.md +402 -0
- package/docs/guides/phones.md +127 -0
- package/docs/guides/physics.md +202 -0
- package/docs/guides/screens.md +123 -0
- package/docs/guides/testing.md +227 -0
- package/docs/guides/ui-overlays.md +182 -0
- package/docs/guides/video-textures.md +110 -0
- package/docs/index.md +45 -0
- package/docs/pages.md +239 -0
- package/docs/porting/react-three-fiber.md +15 -0
- package/docs/porting/threejs-loop-and-threads.md +15 -0
- package/docs/porting/threejs-mapping.md +295 -0
- package/docs/porting/threejs-materials.md +15 -0
- package/docs/porting/threejs-overview.md +15 -0
- package/docs/porting/threejs-postprocessing.md +256 -0
- package/docs/porting/threejs-shaders.md +15 -0
- package/docs/porting/threejs-unsupported.md +15 -0
- package/docs/porting/verification.md +15 -0
- package/docs/shaders/builtins.md +129 -0
- package/docs/shaders/library.md +1350 -0
- package/docs/shaders/surface-functions.md +625 -0
- package/docs/shaders/wgsl-rules.md +126 -0
- package/levels/pieces.d.ts +178 -0
- package/levels/pieces.js +759 -0
- package/levels/planner.d.ts +126 -0
- package/levels/planner.js +682 -0
- package/lib/debug/debug.d.ts +178 -0
- package/lib/debug/debug.js +4 -0
- package/lib/debug/draw.d.ts +137 -0
- package/lib/debug/draw.js +672 -0
- package/lib/debug/frame-target.d.ts +11 -0
- package/lib/debug/frame-target.js +31 -0
- package/lib/debug/overlay-look.d.ts +162 -0
- package/lib/debug/overlay-look.js +1365 -0
- package/lib/debug/overlay.d.ts +68 -0
- package/lib/debug/overlay.js +195 -0
- package/lib/debug/page-meters.d.ts +139 -0
- package/lib/debug/page-meters.js +267 -0
- package/lib/debug/sketch-debug.d.ts +41 -0
- package/lib/debug/sketch-debug.js +86 -0
- package/lib/debug/stats-options.d.ts +15 -0
- package/lib/debug/stats-options.js +3 -0
- package/lib/debug/stats-panel.d.ts +94 -0
- package/lib/debug/stats-panel.js +123 -0
- package/lib/debug/stats-text.d.ts +169 -0
- package/lib/debug/stats-text.js +126 -0
- package/lib/debug/stats.d.ts +196 -0
- package/lib/debug/stats.js +252 -0
- package/lib/debug/view-names.d.ts +15 -0
- package/lib/debug/view-names.js +22 -0
- package/lib/errors/checks.d.ts +24 -0
- package/lib/errors/checks.js +38 -0
- package/lib/errors/codes.d.ts +15 -0
- package/lib/errors/codes.js +483 -0
- package/lib/errors/core-failure.d.ts +19 -0
- package/lib/errors/core-failure.js +127 -0
- package/lib/errors/engine-error-core.d.ts +21 -0
- package/lib/errors/engine-error-core.js +39 -0
- package/lib/errors/engine-error.d.ts +38 -0
- package/lib/errors/engine-error.js +117 -0
- package/lib/errors/fixes.d.ts +88 -0
- package/lib/errors/fixes.js +85 -0
- package/lib/errors/message.d.ts +4 -0
- package/lib/errors/message.js +10 -0
- package/lib/generated/core.d.ts +657 -0
- package/lib/generated/core.js +659 -0
- package/lib/generated/gpu.d.ts +412 -0
- package/lib/generated/gpu.js +414 -0
- package/lib/generated/shader-features.d.ts +8 -0
- package/lib/generated/shader-permutations.d.ts +6 -0
- package/lib/generated/shader-permutations.js +9 -0
- package/lib/generated/shaders-environment-glsl.d.ts +11 -0
- package/lib/generated/shaders-environment-wgsl.d.ts +11 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-coverage-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-coverage.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-displacement-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-displacement.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-hash-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-hash.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-lod-fade-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-lod-fade.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-displacement-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-displacement.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-lod-fade-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-lod-fade.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-hash-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-hash.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-hash-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-hash-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-hash-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-hash-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-hash-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-hash-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-hash-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-hash-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-hash-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-hash.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-lod-fade-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-lod-fade-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-lod-fade-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-lod-fade-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-lod-fade-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-lod-fade.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-morph-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-morph-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-morph-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-morph-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-morph-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-morph-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-morph-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-morph-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-row-values-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-row-values-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-row-values-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-row-values-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-skinning-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-skinning-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-skinning-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-skinning-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-skinning-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-skinning-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-and-displacement-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-and-displacement.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-and-lod-fade-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-and-lod-fade.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-and-hash-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-and-hash.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-hash-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-hash-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-hash-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-hash-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-hash-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-hash-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-hash-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-hash.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-lod-fade-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-lod-fade-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-lod-fade-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-lod-fade.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-morph-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-morph-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-morph-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-morph-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-morph-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-morph-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-row-values-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-row-values-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-skinning-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-skinning-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-skinning-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-skinning-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-displacement-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-displacement-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-displacement-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-displacement-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-displacement-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-displacement-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-displacement-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-displacement-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-displacement-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-displacement-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-displacement-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-displacement.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-lod-fade-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-lod-fade-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-lod-fade-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-lod-fade-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-lod-fade-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-lod-fade.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-morph-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-morph-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-morph-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-morph-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-morph-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-morph-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-row-values-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-row-values-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-skinning-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-skinning-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-skinning-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-skinning-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-hash-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-hash-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-hash-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-hash-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-hash-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-hash-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-hash-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-hash-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-hash-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-hash.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-moment-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-moment-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-moment-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-moment-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-moment-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-moment-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-moment-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-moment-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-moment-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-moment.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-morph-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-morph-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-morph-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-morph-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-morph-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-morph-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-morph-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-morph-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-row-values-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-row-values-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-row-values-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-row-values-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-skinning-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-skinning-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-skinning-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-skinning-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-skinning-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-skinning-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-morph-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-morph-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-morph-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-morph-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-row-values-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-row-values-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-skinning-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-skinning-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-hash-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-hash.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-lines.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-lod-fade-and-row-values-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-lod-fade-and-row-values-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-lod-fade-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-lod-fade-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-lod-fade-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-lod-fade-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-lod-fade-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-lod-fade.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-morph-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-morph-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-morph-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-morph-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-row-values-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-row-values-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-skinning-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-skinning-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-moment-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-moment.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-skinning-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-skinning-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-skinning-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-skinning-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-skinning-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-skinning-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-row-values-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-row-values-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-row-values-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-row-values-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-skinning-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-skinning-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-skinning-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-skinning-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-skinning-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-skinning-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-coverage-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-coverage.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-displacement-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-displacement.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-hash-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-hash.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-lod-fade-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-lod-fade.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-displacement-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-displacement.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-lod-fade-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-lod-fade.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coverage-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coverage.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-hash-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-hash.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-displacement-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-displacement.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-hash-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-hash-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-hash-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-hash-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-hash-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-hash-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-hash-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-hash-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-hash-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-hash.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-lod-fade-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-lod-fade-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-lod-fade-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-lod-fade-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-lod-fade-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-lod-fade.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-morph-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-morph-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-morph-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-morph-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-morph-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-morph-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-morph-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-morph-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-row-values-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-row-values-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-row-values-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-row-values-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-skinning-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-skinning-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-skinning-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-skinning-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-skinning-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-skinning-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coat-sheen-and-coverage-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coat-sheen-and-coverage.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coat-sheen-and-displacement-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coat-sheen-and-displacement.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coat-sheen-and-hash-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coat-sheen-and-hash.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coat-sheen-and-lod-fade-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coat-sheen-and-lod-fade.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coat-sheen-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coat-sheen-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coat-sheen-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coat-sheen-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coat-sheen-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coat-sheen-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coat-sheen-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coat-sheen-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coat-sheen-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coat-sheen-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coverage-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coverage.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-cutout.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-decals-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-decals.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-displacement-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-displacement.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-hash-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-hash.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-lod-fade-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-lod-fade.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-moment-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-moment.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-motion.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-picking.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-probe-grid-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-probe-grid.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-sprites.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-subsurface-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-subsurface.d.ts +3 -0
- package/lib/generated/shaders-probe-glsl.d.ts +11 -0
- package/lib/generated/shaders-probe-wgsl.d.ts +11 -0
- package/lib/generated/shaders-sky-volume-env-glsl.d.ts +11 -0
- package/lib/generated/shaders-sky-volume-env-wgsl.d.ts +11 -0
- package/lib/generated/shaders-sky-volume-panorama-glsl.d.ts +11 -0
- package/lib/generated/shaders-sky-volume-panorama-wgsl.d.ts +11 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-bump-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-bump.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-coat-sheen-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-coat-sheen.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-coverage-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-coverage.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-displacement-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-displacement.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-hash-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-hash.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-instance-index-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-instance-index.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-lines.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-lod-fade-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-lod-fade.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-moment-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-moment.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-bump-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-bump.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-coat-sheen-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-coat-sheen.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-coverage-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-coverage.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-cutout.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-decals-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-decals.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-displacement-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-displacement.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-hash-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-hash.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-instance-index-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-instance-index.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-lod-fade-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-lod-fade.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-moment-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-moment.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-motion.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-picking.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-probe-grid-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-probe-grid.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-row-values.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-skinning.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-sprites.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-subsurface-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-subsurface.d.ts +3 -0
- package/lib/generated/shaders.d.ts +1146 -0
- package/lib/gpu/canvas-release.d.ts +20 -0
- package/lib/gpu/canvas-release.js +67 -0
- package/lib/gpu/completion.d.ts +35 -0
- package/lib/gpu/completion.js +256 -0
- package/lib/gpu/device-shaders.d.ts +69 -0
- package/lib/gpu/device-shaders.js +177 -0
- package/lib/gpu/effect-join.d.ts +83 -0
- package/lib/gpu/effect-join.js +134 -0
- package/lib/gpu/effect-joiner.d.ts +14 -0
- package/lib/gpu/effect-joiner.js +165 -0
- package/lib/gpu/environment-steps.d.ts +135 -0
- package/lib/gpu/environment-steps.js +210 -0
- package/lib/gpu/environment-words.d.ts +14 -0
- package/lib/gpu/environment-words.js +19 -0
- package/lib/gpu/environment.d.ts +4 -0
- package/lib/gpu/environment.js +8 -0
- package/lib/gpu/float-bits.d.ts +2 -0
- package/lib/gpu/float-bits.js +9 -0
- package/lib/gpu/line-vertices.d.ts +1 -0
- package/lib/gpu/line-vertices.js +14 -0
- package/lib/gpu/memory.d.ts +19 -0
- package/lib/gpu/memory.js +50 -0
- package/lib/gpu/particle-records.d.ts +1 -0
- package/lib/gpu/particle-records.js +15 -0
- package/lib/gpu/probe-steps.d.ts +22 -0
- package/lib/gpu/probe-steps.js +43 -0
- package/lib/gpu/readback.d.ts +32 -0
- package/lib/gpu/readback.js +163 -0
- package/lib/gpu/variants.d.ts +16 -0
- package/lib/gpu/variants.js +67 -0
- package/lib/gpu/vertex-format.d.ts +46 -0
- package/lib/gpu/vertex-format.js +111 -0
- package/lib/gpu/webgl2/backend.d.ts +653 -0
- package/lib/gpu/webgl2/backend.js +2746 -0
- package/lib/gpu/webgl2/call-timing.d.ts +34 -0
- package/lib/gpu/webgl2/call-timing.js +143 -0
- package/lib/gpu/webgl2/context.d.ts +31 -0
- package/lib/gpu/webgl2/context.js +111 -0
- package/lib/gpu/webgl2/depth.d.ts +25 -0
- package/lib/gpu/webgl2/depth.js +30 -0
- package/lib/gpu/webgl2/environment.d.ts +65 -0
- package/lib/gpu/webgl2/environment.js +572 -0
- package/lib/gpu/webgl2/gpu-timer.d.ts +25 -0
- package/lib/gpu/webgl2/gpu-timer.js +93 -0
- package/lib/gpu/webgl2/probes.d.ts +38 -0
- package/lib/gpu/webgl2/probes.js +117 -0
- package/lib/gpu/webgl2/programs.d.ts +220 -0
- package/lib/gpu/webgl2/programs.js +484 -0
- package/lib/gpu/webgpu/backend.d.ts +373 -0
- package/lib/gpu/webgpu/backend.js +1565 -0
- package/lib/gpu/webgpu/buffer-reads.d.ts +42 -0
- package/lib/gpu/webgpu/buffer-reads.js +95 -0
- package/lib/gpu/webgpu/culled-counts.d.ts +79 -0
- package/lib/gpu/webgpu/culled-counts.js +259 -0
- package/lib/gpu/webgpu/draw-path-probe.d.ts +37 -0
- package/lib/gpu/webgpu/draw-path-probe.js +187 -0
- package/lib/gpu/webgpu/environment.d.ts +36 -0
- package/lib/gpu/webgpu/environment.js +735 -0
- package/lib/gpu/webgpu/first-pass.d.ts +13 -0
- package/lib/gpu/webgpu/first-pass.js +61 -0
- package/lib/gpu/webgpu/gpu-timer.d.ts +67 -0
- package/lib/gpu/webgpu/gpu-timer.js +328 -0
- package/lib/gpu/webgpu/indirect-arguments.d.ts +42 -0
- package/lib/gpu/webgpu/indirect-arguments.js +156 -0
- package/lib/gpu/webgpu/pipelines.d.ts +251 -0
- package/lib/gpu/webgpu/pipelines.js +1999 -0
- package/lib/gpu/webgpu/probes.d.ts +27 -0
- package/lib/gpu/webgpu/probes.js +190 -0
- package/lib/gpu/webgpu/reusable.d.ts +74 -0
- package/lib/gpu/webgpu/reusable.js +212 -0
- package/lib/gpu/webgpu/staging.d.ts +79 -0
- package/lib/gpu/webgpu/staging.js +238 -0
- package/lib/gpu/webgpu/upload-routes.d.ts +55 -0
- package/lib/gpu/webgpu/upload-routes.js +128 -0
- package/lib/index.d.ts +119 -0
- package/lib/index.js +53 -0
- package/lib/math/color.d.ts +18 -0
- package/lib/math/color.js +71 -0
- package/lib/math/create-math.d.ts +101 -0
- package/lib/math/create-math.js +207 -0
- package/lib/math/hex.d.ts +8 -0
- package/lib/math/hex.js +38 -0
- package/lib/math/index.d.ts +2 -0
- package/lib/math/index.js +11 -0
- package/lib/math/mat4.d.ts +28 -0
- package/lib/math/mat4.js +212 -0
- package/lib/math/math.d.ts +16 -0
- package/lib/math/math.js +42 -0
- package/lib/math/namespaces/math.d.ts +7 -0
- package/lib/math/namespaces/math.js +14 -0
- package/lib/math/namespaces/quat.d.ts +20 -0
- package/lib/math/namespaces/quat.js +30 -0
- package/lib/math/namespaces/vec3.d.ts +4 -0
- package/lib/math/namespaces/vec3.js +8 -0
- package/lib/math/quat.d.ts +40 -0
- package/lib/math/quat.js +228 -0
- package/lib/math/random.d.ts +17 -0
- package/lib/math/random.js +58 -0
- package/lib/math/types.d.ts +43 -0
- package/lib/math/types.js +4 -0
- package/lib/math/vec3.d.ts +46 -0
- package/lib/math/vec3.js +190 -0
- package/lib/page/abortable.d.ts +2 -0
- package/lib/page/abortable.js +19 -0
- package/lib/page/browser-check.d.ts +8 -0
- package/lib/page/browser-check.js +23 -0
- package/lib/page/canvas-watch.d.ts +34 -0
- package/lib/page/canvas-watch.js +141 -0
- package/lib/page/capabilities.d.ts +201 -0
- package/lib/page/capabilities.js +395 -0
- package/lib/page/check-store.d.ts +42 -0
- package/lib/page/check-store.js +146 -0
- package/lib/page/display.d.ts +2 -0
- package/lib/page/display.js +25 -0
- package/lib/page/early-core.d.ts +1 -0
- package/lib/page/early-core.js +23 -0
- package/lib/page/engine.d.ts +865 -0
- package/lib/page/engine.js +2136 -0
- package/lib/page/frame-stats.d.ts +369 -0
- package/lib/page/frame-stats.js +374 -0
- package/lib/page/gamepads.d.ts +37 -0
- package/lib/page/gamepads.js +123 -0
- package/lib/page/held-input.d.ts +19 -0
- package/lib/page/held-input.js +54 -0
- package/lib/page/hold.d.ts +186 -0
- package/lib/page/hold.js +49 -0
- package/lib/page/input-ring.d.ts +13 -0
- package/lib/page/input-ring.js +25 -0
- package/lib/page/input.d.ts +6 -0
- package/lib/page/input.js +159 -0
- package/lib/page/isolation-check.d.ts +14 -0
- package/lib/page/isolation-check.js +21 -0
- package/lib/page/label-loop.d.ts +76 -0
- package/lib/page/label-loop.js +410 -0
- package/lib/page/labels.d.ts +56 -0
- package/lib/page/labels.js +102 -0
- package/lib/page/limits.d.ts +321 -0
- package/lib/page/limits.js +323 -0
- package/lib/page/loader.d.ts +78 -0
- package/lib/page/loader.js +149 -0
- package/lib/page/main-thread.d.ts +10 -0
- package/lib/page/main-thread.js +41 -0
- package/lib/page/memory-pool.d.ts +26 -0
- package/lib/page/memory-pool.js +69 -0
- package/lib/page/ownership.d.ts +65 -0
- package/lib/page/ownership.js +166 -0
- package/lib/page/permutation-recording.d.ts +26 -0
- package/lib/page/permutation-recording.js +32 -0
- package/lib/page/pointer-lock.d.ts +14 -0
- package/lib/page/pointer-lock.js +60 -0
- package/lib/page/preferences.d.ts +2 -0
- package/lib/page/preferences.js +11 -0
- package/lib/page/record-button.d.ts +5 -0
- package/lib/page/record-button.js +60 -0
- package/lib/page/start-marker.d.ts +44 -0
- package/lib/page/start-marker.js +116 -0
- package/lib/page/stats-switch.d.ts +16 -0
- package/lib/page/stats-switch.js +38 -0
- package/lib/page/stop-jobs.d.ts +37 -0
- package/lib/page/stop-jobs.js +87 -0
- package/lib/page/switches.d.ts +317 -0
- package/lib/page/switches.js +142 -0
- package/lib/page/videos.d.ts +70 -0
- package/lib/page/videos.js +244 -0
- package/lib/quality/budget.d.ts +14 -0
- package/lib/quality/budget.js +25 -0
- package/lib/quality/check.d.ts +98 -0
- package/lib/quality/check.js +70 -0
- package/lib/quality/chooser.d.ts +92 -0
- package/lib/quality/chooser.js +100 -0
- package/lib/quality/device-hints.d.ts +8 -0
- package/lib/quality/device-hints.js +18 -0
- package/lib/quality/governor.d.ts +479 -0
- package/lib/quality/governor.js +1063 -0
- package/lib/quality/preset-docs.d.ts +387 -0
- package/lib/quality/preset-docs.js +176 -0
- package/lib/quality/presets.d.ts +744 -0
- package/lib/quality/presets.js +586 -0
- package/lib/render/direct-loop.d.ts +4 -0
- package/lib/render/direct-loop.js +52 -0
- package/lib/render/draw.d.ts +65 -0
- package/lib/render/draw.js +101 -0
- package/lib/render/load-draw.d.ts +10 -0
- package/lib/render/load-draw.js +16 -0
- package/lib/render/loop.d.ts +241 -0
- package/lib/render/loop.js +566 -0
- package/lib/render/loss.d.ts +35 -0
- package/lib/render/loss.js +99 -0
- package/lib/render/pacer.d.ts +24 -0
- package/lib/render/pacer.js +51 -0
- package/lib/render/recovery.d.ts +62 -0
- package/lib/render/recovery.js +120 -0
- package/lib/render/refresh.d.ts +38 -0
- package/lib/render/refresh.js +111 -0
- package/lib/render/renderer.d.ts +116 -0
- package/lib/render/renderer.js +156 -0
- package/lib/render/scene-renderer.d.ts +117 -0
- package/lib/render/scene-renderer.js +192 -0
- package/lib/render/shader-salt.d.ts +5 -0
- package/lib/render/shader-salt.js +31 -0
- package/lib/render/webgl2-renderers.d.ts +11 -0
- package/lib/render/webgl2-renderers.js +224 -0
- package/lib/render/webgpu-renderers.d.ts +10 -0
- package/lib/render/webgpu-renderers.js +253 -0
- package/lib/scene/addon-debug-views.d.ts +30 -0
- package/lib/scene/addon-debug-views.js +63 -0
- package/lib/scene/animation.d.ts +551 -0
- package/lib/scene/animation.js +1428 -0
- package/lib/scene/area-light-tables.d.ts +32 -0
- package/lib/scene/area-light-tables.js +89 -0
- package/lib/scene/assets.d.ts +400 -0
- package/lib/scene/assets.js +869 -0
- package/lib/scene/background.d.ts +242 -0
- package/lib/scene/background.js +467 -0
- package/lib/scene/baked-light.d.ts +60 -0
- package/lib/scene/baked-light.js +300 -0
- package/lib/scene/builtin-environments.d.ts +36 -0
- package/lib/scene/builtin-environments.js +43 -0
- package/lib/scene/chunk-rows.d.ts +81 -0
- package/lib/scene/chunk-rows.js +146 -0
- package/lib/scene/color.d.ts +22 -0
- package/lib/scene/color.js +45 -0
- package/lib/scene/derived-cache.d.ts +139 -0
- package/lib/scene/derived-cache.js +547 -0
- package/lib/scene/effects.d.ts +193 -0
- package/lib/scene/effects.js +476 -0
- package/lib/scene/environment-file.d.ts +22 -0
- package/lib/scene/environment-file.js +81 -0
- package/lib/scene/environment.d.ts +57 -0
- package/lib/scene/environment.js +131 -0
- package/lib/scene/fake-call-values.d.ts +8 -0
- package/lib/scene/fake-call-values.js +51 -0
- package/lib/scene/feature-draws.d.ts +169 -0
- package/lib/scene/feature-draws.js +269 -0
- package/lib/scene/feature-effects.d.ts +42 -0
- package/lib/scene/feature-effects.js +155 -0
- package/lib/scene/feature-host.d.ts +129 -0
- package/lib/scene/feature-host.js +299 -0
- package/lib/scene/feature-instances.d.ts +130 -0
- package/lib/scene/feature-instances.js +326 -0
- package/lib/scene/features.d.ts +412 -0
- package/lib/scene/features.js +550 -0
- package/lib/scene/file-limits.d.ts +70 -0
- package/lib/scene/file-limits.js +224 -0
- package/lib/scene/fog.d.ts +94 -0
- package/lib/scene/fog.js +142 -0
- package/lib/scene/frame-cameras.d.ts +156 -0
- package/lib/scene/frame-cameras.js +434 -0
- package/lib/scene/gltf-animation.d.ts +129 -0
- package/lib/scene/gltf-animation.js +887 -0
- package/lib/scene/gltf-draco.d.ts +9 -0
- package/lib/scene/gltf-draco.js +224 -0
- package/lib/scene/gltf-extensions.d.ts +31 -0
- package/lib/scene/gltf-extensions.js +92 -0
- package/lib/scene/gltf-json.d.ts +49 -0
- package/lib/scene/gltf-json.js +94 -0
- package/lib/scene/gltf-math.d.ts +16 -0
- package/lib/scene/gltf-math.js +129 -0
- package/lib/scene/gltf-meshopt.d.ts +3 -0
- package/lib/scene/gltf-meshopt.js +48 -0
- package/lib/scene/gltf-parse.d.ts +600 -0
- package/lib/scene/gltf-parse.js +1854 -0
- package/lib/scene/gltf.d.ts +159 -0
- package/lib/scene/gltf.js +1560 -0
- package/lib/scene/grade-table.d.ts +9 -0
- package/lib/scene/grade-table.js +23 -0
- package/lib/scene/grade-task.d.ts +12 -0
- package/lib/scene/grade-task.js +11 -0
- package/lib/scene/grading.d.ts +110 -0
- package/lib/scene/grading.js +142 -0
- package/lib/scene/half-float.d.ts +4 -0
- package/lib/scene/half-float.js +42 -0
- package/lib/scene/ktx2-cache.d.ts +32 -0
- package/lib/scene/ktx2-cache.js +62 -0
- package/lib/scene/ktx2-file.d.ts +57 -0
- package/lib/scene/ktx2-file.js +207 -0
- package/lib/scene/ktx2-transcode.d.ts +15 -0
- package/lib/scene/ktx2-transcode.js +94 -0
- package/lib/scene/ktx2.d.ts +34 -0
- package/lib/scene/ktx2.js +178 -0
- package/lib/scene/lens.d.ts +61 -0
- package/lib/scene/lens.js +101 -0
- package/lib/scene/level-meshopt.d.ts +20 -0
- package/lib/scene/level-meshopt.js +122 -0
- package/lib/scene/level-pieces.d.ts +24 -0
- package/lib/scene/level-pieces.js +138 -0
- package/lib/scene/level-words.d.ts +19 -0
- package/lib/scene/level-words.js +34 -0
- package/lib/scene/levels-task.d.ts +51 -0
- package/lib/scene/levels-task.js +132 -0
- package/lib/scene/light-images.d.ts +36 -0
- package/lib/scene/light-images.js +88 -0
- package/lib/scene/light-probes.d.ts +240 -0
- package/lib/scene/light-probes.js +644 -0
- package/lib/scene/lines.d.ts +192 -0
- package/lib/scene/lines.js +257 -0
- package/lib/scene/lut-files.d.ts +41 -0
- package/lib/scene/lut-files.js +399 -0
- package/lib/scene/lut.d.ts +56 -0
- package/lib/scene/lut.js +48 -0
- package/lib/scene/memory.d.ts +72 -0
- package/lib/scene/memory.js +159 -0
- package/lib/scene/mesh-arrays.d.ts +110 -0
- package/lib/scene/mesh-arrays.js +701 -0
- package/lib/scene/mesh-levels.d.ts +10 -0
- package/lib/scene/mesh-levels.js +52 -0
- package/lib/scene/namespaces.d.ts +125 -0
- package/lib/scene/namespaces.js +313 -0
- package/lib/scene/panorama-files.d.ts +71 -0
- package/lib/scene/panorama-files.js +1103 -0
- package/lib/scene/panorama.d.ts +23 -0
- package/lib/scene/panorama.js +108 -0
- package/lib/scene/particles.d.ts +452 -0
- package/lib/scene/particles.js +814 -0
- package/lib/scene/pass-reads.d.ts +70 -0
- package/lib/scene/pass-reads.js +220 -0
- package/lib/scene/picks.d.ts +69 -0
- package/lib/scene/picks.js +208 -0
- package/lib/scene/pointer-events.d.ts +205 -0
- package/lib/scene/pointer-events.js +500 -0
- package/lib/scene/post.d.ts +572 -0
- package/lib/scene/post.js +925 -0
- package/lib/scene/prefab.d.ts +110 -0
- package/lib/scene/prefab.js +167 -0
- package/lib/scene/probes.d.ts +71 -0
- package/lib/scene/probes.js +169 -0
- package/lib/scene/property-animation.d.ts +160 -0
- package/lib/scene/property-animation.js +276 -0
- package/lib/scene/queries.d.ts +182 -0
- package/lib/scene/queries.js +393 -0
- package/lib/scene/render.d.ts +487 -0
- package/lib/scene/render.js +829 -0
- package/lib/scene/resources.d.ts +1627 -0
- package/lib/scene/resources.js +2745 -0
- package/lib/scene/rotation.d.ts +6 -0
- package/lib/scene/rotation.js +12 -0
- package/lib/scene/scene.d.ts +1827 -0
- package/lib/scene/scene.js +4582 -0
- package/lib/scene/shader-preloads.d.ts +40 -0
- package/lib/scene/shader-preloads.js +78 -0
- package/lib/scene/shader-templates.d.ts +60 -0
- package/lib/scene/shader-templates.js +156 -0
- package/lib/scene/sprites.d.ts +265 -0
- package/lib/scene/sprites.js +293 -0
- package/lib/scene/stale-calls-scenario.d.ts +20 -0
- package/lib/scene/stale-calls-scenario.js +175 -0
- package/lib/scene/textures.d.ts +324 -0
- package/lib/scene/textures.js +954 -0
- package/lib/scene/time-of-day.d.ts +146 -0
- package/lib/scene/time-of-day.js +645 -0
- package/lib/scene/unmarked-writes.d.ts +118 -0
- package/lib/scene/unmarked-writes.js +283 -0
- package/lib/scene/unread-extensions-scenario.d.ts +6 -0
- package/lib/scene/unread-extensions-scenario.js +26 -0
- package/lib/scene/vertex-draws.d.ts +81 -0
- package/lib/scene/vertex-draws.js +83 -0
- package/lib/scene/wgsl-uniforms.d.ts +167 -0
- package/lib/scene/wgsl-uniforms.js +12 -0
- package/lib/shared/await-later.d.ts +5 -0
- package/lib/shared/await-later.js +10 -0
- package/lib/shared/control.d.ts +94 -0
- package/lib/shared/control.js +150 -0
- package/lib/shared/core-sources.d.ts +2 -0
- package/lib/shared/core-sources.js +7 -0
- package/lib/shared/core.d.ts +1249 -0
- package/lib/shared/core.js +380 -0
- package/lib/shared/counter.d.ts +52 -0
- package/lib/shared/counter.js +55 -0
- package/lib/shared/dev.d.ts +8 -0
- package/lib/shared/dev.js +13 -0
- package/lib/shared/feature-stats.d.ts +16 -0
- package/lib/shared/feature-stats.js +27 -0
- package/lib/shared/frame-image.d.ts +13 -0
- package/lib/shared/frame-image.js +32 -0
- package/lib/shared/gpu-clock.d.ts +14 -0
- package/lib/shared/gpu-clock.js +38 -0
- package/lib/shared/gpu-counter.d.ts +12 -0
- package/lib/shared/gpu-counter.js +15 -0
- package/lib/shared/gpu-scope.d.ts +14 -0
- package/lib/shared/gpu-scope.js +104 -0
- package/lib/shared/helper-workers.d.ts +4 -0
- package/lib/shared/helper-workers.js +23 -0
- package/lib/shared/images.d.ts +255 -0
- package/lib/shared/images.js +450 -0
- package/lib/shared/key-codes.d.ts +2 -0
- package/lib/shared/key-codes.js +69 -0
- package/lib/shared/labels.d.ts +94 -0
- package/lib/shared/labels.js +172 -0
- package/lib/shared/memory-area.d.ts +6 -0
- package/lib/shared/memory-area.js +21 -0
- package/lib/shared/memory-figure.d.ts +14 -0
- package/lib/shared/memory-figure.js +18 -0
- package/lib/shared/memory-views.d.ts +48 -0
- package/lib/shared/memory-views.js +90 -0
- package/lib/shared/metrics.d.ts +315 -0
- package/lib/shared/metrics.js +738 -0
- package/lib/shared/page-measurement.d.ts +9 -0
- package/lib/shared/page-measurement.js +37 -0
- package/lib/shared/phase.d.ts +17 -0
- package/lib/shared/phase.js +20 -0
- package/lib/shared/policy.d.ts +20 -0
- package/lib/shared/policy.js +46 -0
- package/lib/shared/recording.d.ts +100 -0
- package/lib/shared/recording.js +378 -0
- package/lib/shared/role.d.ts +10 -0
- package/lib/shared/role.js +13 -0
- package/lib/shared/run-task.d.ts +39 -0
- package/lib/shared/run-task.js +63 -0
- package/lib/shared/slot.d.ts +218 -0
- package/lib/shared/slot.js +221 -0
- package/lib/shared/software.d.ts +24 -0
- package/lib/shared/software.js +22 -0
- package/lib/shared/stats.d.ts +62 -0
- package/lib/shared/stats.js +86 -0
- package/lib/shared/task-failure.d.ts +24 -0
- package/lib/shared/task-failure.js +36 -0
- package/lib/shared/task-host.d.ts +42 -0
- package/lib/shared/task-host.js +60 -0
- package/lib/shared/task-load-error.d.ts +10 -0
- package/lib/shared/task-load-error.js +13 -0
- package/lib/shared/task-modules.d.ts +2 -0
- package/lib/shared/task-modules.js +8 -0
- package/lib/shared/task-pending.d.ts +12 -0
- package/lib/shared/task-pending.js +41 -0
- package/lib/shared/tasks.d.ts +54 -0
- package/lib/shared/tasks.js +379 -0
- package/lib/shared/tier.d.ts +7 -0
- package/lib/shared/tier.js +3 -0
- package/lib/shared/version.d.ts +56 -0
- package/lib/shared/version.js +85 -0
- package/lib/shared/videos.d.ts +15 -0
- package/lib/shared/videos.js +11 -0
- package/lib/shared/wake.d.ts +38 -0
- package/lib/shared/wake.js +76 -0
- package/lib/shared/wasm-limits.d.ts +13 -0
- package/lib/shared/wasm-limits.js +75 -0
- package/lib/shared/wasm.d.ts +26 -0
- package/lib/shared/wasm.js +128 -0
- package/lib/shared/webkit.d.ts +33 -0
- package/lib/shared/webkit.js +59 -0
- package/lib/shared/wgsl-updates.d.ts +9 -0
- package/lib/shared/wgsl-updates.js +8 -0
- package/lib/shared/worker-start.d.ts +49 -0
- package/lib/shared/worker-start.js +159 -0
- package/lib/sketch/clock.d.ts +61 -0
- package/lib/sketch/clock.js +98 -0
- package/lib/sketch/define-sketch.d.ts +234 -0
- package/lib/sketch/define-sketch.js +103 -0
- package/lib/sketch/input-off-scenario.d.ts +7 -0
- package/lib/sketch/input-off-scenario.js +24 -0
- package/lib/sketch/input-off.d.ts +16 -0
- package/lib/sketch/input-off.js +38 -0
- package/lib/sketch/input.d.ts +243 -0
- package/lib/sketch/input.js +554 -0
- package/lib/sketch/preset-check.d.ts +28 -0
- package/lib/sketch/preset-check.js +95 -0
- package/lib/sketch/quality.d.ts +334 -0
- package/lib/sketch/quality.js +314 -0
- package/lib/sketch/random.d.ts +13 -0
- package/lib/sketch/random.js +25 -0
- package/lib/sketch/runner.d.ts +507 -0
- package/lib/sketch/runner.js +1826 -0
- package/lib/sketch/ui.d.ts +97 -0
- package/lib/sketch/ui.js +391 -0
- package/lib/stats.d.ts +4 -0
- package/lib/stats.js +8 -0
- package/lib/workers/drawing-host.d.ts +24 -0
- package/lib/workers/drawing-host.js +48 -0
- package/lib/workers/gltf-worker.d.ts +35 -0
- package/lib/workers/gltf-worker.js +210 -0
- package/lib/workers/job-worker.d.ts +1 -0
- package/lib/workers/job-worker.js +102 -0
- package/lib/workers/panorama-worker.d.ts +15 -0
- package/lib/workers/panorama-worker.js +21 -0
- package/lib/workers/probe-worker.d.ts +29 -0
- package/lib/workers/probe-worker.js +49 -0
- package/lib/workers/protocol.d.ts +329 -0
- package/lib/workers/protocol.js +53 -0
- package/lib/workers/render-worker.d.ts +1 -0
- package/lib/workers/render-worker.js +82 -0
- package/lib/workers/sketch-worker.d.ts +1 -0
- package/lib/workers/sketch-worker.js +206 -0
- package/lib/workers/task-worker.d.ts +1 -0
- package/lib/workers/task-worker.js +5 -0
- package/lib/workers/tasks.d.ts +65 -0
- package/lib/workers/tasks.js +85 -0
- package/package.json +106 -5
- package/vendor/basis/LICENSE +201 -0
- package/vendor/basis/LICENSE-zstd +30 -0
- package/vendor/basis/NOTICE +15 -0
- package/vendor/basis/basis_transcoder.d.mts +36 -0
- package/vendor/basis/basis_transcoder.mjs +2 -0
- package/vendor/basis/basis_transcoder.wasm +0 -0
- package/vendor/draco/LICENSE +252 -0
- package/vendor/draco/draco_decoder_gltf.wasm +0 -0
- package/vendor/draco/draco_wasm_wrapper_gltf.d.ts +71 -0
- package/vendor/draco/draco_wasm_wrapper_gltf.js +116 -0
- package/vendor/ltc/LICENSE +31 -0
- package/vendor/ltc/area-light-tables.bin +0 -0
- package/vendor/meshopt/LICENSE.md +21 -0
- package/vendor/meshopt/meshopt_clusterizer.wasm +0 -0
- package/vendor/meshopt/meshopt_decoder.wasm +0 -0
- package/vendor/meshopt/meshopt_encoder.wasm +0 -0
- package/vendor/meshopt/meshopt_simplifier.wasm +0 -0
- package/README.md +0 -3
|
@@ -0,0 +1,876 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: api/materials
|
|
3
|
+
title: Materials
|
|
4
|
+
status: experimental
|
|
5
|
+
since: "0.1"
|
|
6
|
+
summary: "standard, unlit, shader, shadowCatcher; every option."
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Materials
|
|
10
|
+
|
|
11
|
+
> Roadmap step 0.1, first released in null3D 0.1.0. Step 0.2 adds typed uniforms, custom material textures, `destroy`, the specular and index of refraction values, transmission, light through thin surfaces and under the surface, decals, the weighted blending, the clear coat and sheen layers, the shadow catcher, bump maps, displacement maps, parallax and wireframes. The API is experimental, so it can still change between versions. `materials.shader` takes no standard texture maps. Coding agents must not use the parts that are not built.
|
|
12
|
+
|
|
13
|
+
A material sets how the surfaces of the objects that use it look. `materials.standard` makes a lit material, and `materials.unlit` makes one that ignores lights. Create materials in the setup, and share each one between the objects that look alike.
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { defineSketch } from '@null3d/engine';
|
|
17
|
+
|
|
18
|
+
export default defineSketch(({ scene, geometry, materials, page }) => {
|
|
19
|
+
// A camera and lights, as on the Scene page, go here.
|
|
20
|
+
const paint = materials.standard({ color: '#e8554e', roughness: 0.35 });
|
|
21
|
+
const chrome = materials.standard({ color: '#d8dce4', metalness: 1, roughness: 0.2 });
|
|
22
|
+
const lamp = materials.unlit({ color: '#ffd35c' });
|
|
23
|
+
const car = scene.createMesh({ mesh: geometry.box({ width: 2, height: 1, depth: 4 }), material: paint });
|
|
24
|
+
scene.createMesh({ mesh: geometry.box({ width: 2.1, height: 0.2, depth: 0.2 }), material: chrome, parent: car, position: [0, -0.3, 2] });
|
|
25
|
+
scene.createMesh({ mesh: geometry.sphere({ radius: 0.2 }), material: lamp, parent: car, position: [0, 0.6, 2] });
|
|
26
|
+
|
|
27
|
+
// The page picks a color: every object that uses the material changes.
|
|
28
|
+
page.onMessage((type, data) => {
|
|
29
|
+
if (type === 'paint') paint.set({ color: data as string });
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## The materials
|
|
35
|
+
|
|
36
|
+
| Factory | How it looks |
|
|
37
|
+
| --- | --- |
|
|
38
|
+
| `materials.standard(options)` | Lit by the scene's lights with glTF's metallic-roughness model and the formulas of three.js's `MeshStandardMaterial` |
|
|
39
|
+
| `materials.unlit(options)` | Its color as it is, whatever the lights, like three.js's `MeshBasicMaterial`. The exposure and the tone mapping still apply to it. |
|
|
40
|
+
| `materials.shader(options)` | A standard material whose WGSL changes its look before the engine lights it, or moves its vertices |
|
|
41
|
+
| `materials.shadowCatcher(options)` | Only the shadows that fall on it, as three.js's `ShadowMaterial` |
|
|
42
|
+
| `materials.decal(options)` | A standard material that a box projects onto the surfaces inside it, like three.js's `DecalGeometry` ([Decals](#decals)) |
|
|
43
|
+
|
|
44
|
+
Without lights, a standard material draws black, apart from its emissive color. [Lights](lights.md) explains how light colors and intensities shade it.
|
|
45
|
+
|
|
46
|
+
## Shadow catchers
|
|
47
|
+
|
|
48
|
+
`materials.shadowCatcher({ color, opacity })` draws a surface that shows only the shadows that fall on it, as three.js's `ShadowMaterial`. It shows its `color` where the main directional light's shadow falls, and nothing at all where the light reaches it. The shadows of point and spot lights do not show on it. The mesh must receive shadows with `setReceiveShadows(true)`, as three.js's `receiveShadow` must be set.
|
|
49
|
+
|
|
50
|
+
The default color is black and the default opacity is 1. The material blends, so it draws in the transparent pass after the opaque objects, and the scene's fog leaves it alone. It takes no texture maps. Its shadows are the main directional light's, so a scene needs a directional light that casts shadows.
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
const FLAT = [-Math.SQRT1_2, 0, 0, Math.SQRT1_2] as const;
|
|
54
|
+
const ground = scene.createMesh({
|
|
55
|
+
mesh: geometry.plane({ width: 20, height: 20 }),
|
|
56
|
+
material: materials.shadowCatcher({ opacity: 0.6 }),
|
|
57
|
+
position: [0, 0.01, 0],
|
|
58
|
+
rotation: FLAT,
|
|
59
|
+
});
|
|
60
|
+
ground.setReceiveShadows(true);
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Put the catcher a little above the surface it lies on, so its shadows show over that surface. [Shadows](../concepts/shadows.md) explains the light's shadow settings.
|
|
64
|
+
|
|
65
|
+
## Standard values
|
|
66
|
+
|
|
67
|
+
| Option | Range | Default | What it does |
|
|
68
|
+
| --- | --- | --- | --- |
|
|
69
|
+
| `color` | A [color](#color) | White | The base color: the color of diffuse light, and of a metal's reflections |
|
|
70
|
+
| `opacity` | 0 to 1 | 1 | How opaque the surface is. The `mask` alpha mode tests it, and the `blend` alpha mode blends with it |
|
|
71
|
+
| `alphaCutoff` | 0 to 1 | 0.5 | With the `mask` alpha mode, the alpha below which the surface draws nothing |
|
|
72
|
+
| `metalness` | 0 to 1 | 0 | 0 is a surface such as paint or plastic, and 1 is a metal |
|
|
73
|
+
| `roughness` | 0 to 1 | 1 | 0 is a mirror finish with a small, sharp highlight, and 1 is fully matte |
|
|
74
|
+
| `emissive` | An sRGB color | Black | Light that the surface gives off itself, whatever the lights |
|
|
75
|
+
| `emissiveIntensity` | 0 or more | 1 | The factor of the emissive color |
|
|
76
|
+
| `normalScale` | Two numbers | `[1, 1]` | How strongly the normal map bends normals along u and v |
|
|
77
|
+
| `bumpScale` | A number | 1 | How strongly the bump map bends normals. Negative values turn bumps into dents |
|
|
78
|
+
| `displacementScale` | A number | 1 | How far the displacement map's white moves a vertex, in the mesh's units |
|
|
79
|
+
| `displacementBias` | A number | 0 | How far the displacement map moves every vertex, added to its height's share |
|
|
80
|
+
| `aoMapIntensity` | 0 to 1 | 1 | How much the occlusion map darkens ambient light |
|
|
81
|
+
| `lightMapIntensity` | 0 or more | 1 | The factor of the light map's light |
|
|
82
|
+
| `lightMapOffset` | Two numbers | `[0, 0]` | Where the light map's texture coordinates start. It is fixed when the material is created |
|
|
83
|
+
| `lightMapRepeat` | Two numbers | `[1, 1]` | How the light map's texture coordinates stretch. It is fixed when the material is created |
|
|
84
|
+
| `lightMapDecode` | `srgb` or `rgbm` | `srgb` | How the engine reads the light map's texels. `rgbm` decodes Needle's light maps. It is fixed when the material is created |
|
|
85
|
+
| `ior` | 1 or more | 1.5 | The index of refraction of the non-metallic part. It sets how much light the surface reflects head on |
|
|
86
|
+
| `specularIntensity` | 0 to 1 | 1 | The strength of the non-metallic part's specular reflection, at every angle |
|
|
87
|
+
| `specularColor` | A [color](#color), or linear components of 0 or more | White | Tints the non-metallic part's specular reflection head on |
|
|
88
|
+
| `envIntensity` | 0 or more | 1 | The factor of the scene environment's light on the surface, as three.js's `envMapIntensity` |
|
|
89
|
+
| `transmission` | 0 to 1 | 0 | How much of the light behind the surface passes through it, for glass and clear water. See "Transmission" |
|
|
90
|
+
| `thickness` | 0 or more | 0 | The thickness of the volume under a surface that lets light through, in the mesh's own units |
|
|
91
|
+
| `attenuationColor` | A [color](#color) | White | The color that white light takes inside the volume over `attenuationDistance` |
|
|
92
|
+
| `attenuationDistance` | Above 0 | `Infinity` | The distance in world units over which light inside the volume takes `attenuationColor` |
|
|
93
|
+
| `diffuseTransmission` | 0 to 1 | 0 | How much of the surface's diffuse light passes through to its other side, for leaves, petals and ears. See "Light through thin surfaces" |
|
|
94
|
+
| `diffuseTransmissionColor` | A [color](#color) | White | Tints the light that passes through to the other side |
|
|
95
|
+
| `subsurfaceRadius` | 0 or more, in meters | 0 | How far light spreads under the surface, for skin, wax, jade and marble. See "Light under the surface" |
|
|
96
|
+
| `subsurfaceColor` | A [color](#color) | White | Each color channel's share of `subsurfaceRadius` |
|
|
97
|
+
| `clearcoat` | 0 to 1 | 0 | How much of a thin, shiny coat covers the surface, as on car paint or varnish. See "Clear coat and sheen" |
|
|
98
|
+
| `clearcoatRoughness` | 0 to 1 | 0 | How rough the coat is |
|
|
99
|
+
| `clearcoatNormalScale` | Two numbers | `[1, 1]` | How strongly the coat normal map bends the coat's normals along u and v |
|
|
100
|
+
| `sheenColor` | A [color](#color) | Black | The color of the soft glow of cloth and velvet at grazing angles. Black gives none |
|
|
101
|
+
| `sheenRoughness` | 0 to 1 | 1 | How wide the sheen spreads |
|
|
102
|
+
| `iridescence` | 0 to 1 | 0 | How much a thin film above the surface tints its reflection, as on a soap bubble or a beetle's shell. See "Iridescence and anisotropy" |
|
|
103
|
+
| `iridescenceIor` | 1 or more | 1.3 | The thin film's index of refraction |
|
|
104
|
+
| `iridescenceThicknessRange` | Two thicknesses in nanometers | `[100, 400]` | The film's thinnest and thickest parts, which its map mixes between |
|
|
105
|
+
| `anisotropy` | 0 to 1 | 0 | How far the specular reflection stretches along one direction, as on brushed metal. See "Iridescence and anisotropy" |
|
|
106
|
+
| `anisotropyRotation` | Radians | 0 | The direction along which the reflection stretches |
|
|
107
|
+
| `uvTransform` | An offset, a repeat and a rotation | None | Where every map sits on the texture coordinates |
|
|
108
|
+
| `mapUvTransforms` | A transform for a map, by the map's option name | None | Where one map sits, where it differs from the others |
|
|
109
|
+
|
|
110
|
+
The values have the meaning and the defaults of three.js's `MeshStandardMaterial`. `ior`, `specularIntensity`, `specularColor`, the four transmission values and the ten layer values have those of three.js's `MeshPhysicalMaterial`, as the next sections explain. three.js has no diffuse transmission, so its two values take the names and defaults of glTF's `KHR_materials_diffuse_transmission`. A metal takes its color from what it reflects. Without an environment, a smooth metal shows little more than its highlights, so give the scene one with [`scene.setEnvironment`](scene.md#the-environment). three.js uses `scene.environmentIntensity` in place of `envMapIntensity` under a scene environment. The engine multiplies the two.
|
|
111
|
+
|
|
112
|
+
## Specular reflection and index of refraction
|
|
113
|
+
|
|
114
|
+
A surface reflects some light like a mirror, blurred by its roughness. This is its specular reflection. A metal's reflection takes its base color. A non-metal's reflection is white, and weak when you look at the surface head on: 4% of the light with the defaults. It grows to all the light at grazing angles. Three values change the non-metallic part, as glTF's `KHR_materials_ior` and `KHR_materials_specular` extensions do. The engine draws them with the formulas of three.js's `MeshPhysicalMaterial`, in the standard material's own lighting and shaders.
|
|
115
|
+
|
|
116
|
+
| Value | Head on | At grazing angles |
|
|
117
|
+
| --- | --- | --- |
|
|
118
|
+
| `ior` | Reflects `((ior - 1) / (ior + 1))^2` of the light: 4% at 1.5, as for glass and plastic, 11% at 2, and none at 1 | No change |
|
|
119
|
+
| `specularColor` | Multiplies the reflection, up to all the light. Components above 1 raise it past what `ior` gives | No change: the reflection stays white |
|
|
120
|
+
| `specularIntensity` | Multiplies the reflection | Multiplies it too, so 0 leaves only diffuse light |
|
|
121
|
+
|
|
122
|
+
Light that the surface reflects does not reach its diffuse color, so a stronger reflection darkens the diffuse part. Metals ignore the three values, and a material with a `metalness` between 0 and 1 blends both parts. The defaults draw exactly as a material without them.
|
|
123
|
+
|
|
124
|
+
```ts
|
|
125
|
+
// sketch.ts
|
|
126
|
+
// Paint that reflects more than plastic does, and cloth that reflects little.
|
|
127
|
+
const paint = materials.standard({ color: '#8a1020', roughness: 0.25, ior: 1.8 });
|
|
128
|
+
const cloth = materials.standard({ color: '#4a5a70', roughness: 0.8, specularIntensity: 0.3 });
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Transmission
|
|
132
|
+
|
|
133
|
+
A surface with `transmission` lets the light behind it through, as three.js's `MeshPhysicalMaterial` does. Use it for glass, ice, gems and clear water. The `blend` alpha mode only mixes the surface's color over what lies behind it. Light that passes through a surface bends, blurs and takes the color of the volume under it:
|
|
134
|
+
|
|
135
|
+
| Value | What it does |
|
|
136
|
+
| --- | --- |
|
|
137
|
+
| `transmission` | How much light passes through. That share of the surface's diffuse light becomes the light from behind it, times the base color. The surface's reflections stay, so glass still shows its highlights and the environment |
|
|
138
|
+
| `transmissionMap` | The same share, per texel, in red. Its red multiplies `transmission`. It samples the specular intensity slot's texture array at a layer of its own, so a specular intensity map may draw beside it |
|
|
139
|
+
| `ior` | How far the light bends where it enters the volume. Glass is 1.5, water 1.33 |
|
|
140
|
+
| `dispersion` | How strongly the light that passes through separates into colors, 0 or more: 20 divided by the Abbe number, as glTF's `KHR_materials_dispersion` gives it. A diamond's 0.36 is weak and rutile's 2.04 is strong. Each color bends by its own index of refraction, so the edges of a prism or a gem show a rainbow. 0 bends every color alike |
|
|
141
|
+
| `thickness` | How deep the volume is. The light leaves it this far along the bent direction, so a thicker volume shows what lies behind it farther away. 0 is a thin wall, such as a window pane, which bends nothing |
|
|
142
|
+
| `thicknessMap` | The thickness, per texel, in green. Its green multiplies `thickness`. It samples the specular color slot's texture array at a layer of its own, so a specular color map may draw beside it when the two textures share an array |
|
|
143
|
+
| `roughness` | How much the light from behind blurs: none at 0, and very blurred at 1. An `ior` of 1 blurs nothing |
|
|
144
|
+
| `attenuationColor`, `attenuationDistance` | The color of the volume. White light takes `attenuationColor` after `attenuationDistance` inside it, and a deeper color farther in. The default absorbs nothing |
|
|
145
|
+
|
|
146
|
+
```ts
|
|
147
|
+
// sketch.ts: a smooth glass ball, a frosted one, and a ball of blue tinted glass.
|
|
148
|
+
const glass = materials.standard({ transmission: 1, roughness: 0, thickness: 1.4 });
|
|
149
|
+
const frosted = materials.standard({ transmission: 1, roughness: 0.4, thickness: 1.4 });
|
|
150
|
+
const tinted = materials.standard({
|
|
151
|
+
transmission: 1, roughness: 0.05, thickness: 1.4,
|
|
152
|
+
attenuationColor: '#3d9be0', attenuationDistance: 0.8,
|
|
153
|
+
});
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Give `transmission` when you create the material, even as 0, to change it later with `set`. The option picks the shader that samples what lies behind the surface. A material created without it lets no light through. `dispersion` needs no such choice: `set` changes it at any time, and it shows on a material that `transmission` lets light through.
|
|
157
|
+
|
|
158
|
+
### How it draws
|
|
159
|
+
|
|
160
|
+
After the camera's view draws its opaque objects, the engine copies their colors into a texture with a chain of smaller, blurred copies. Surfaces that let light through then draw with the blended objects, farthest first. Each one samples the copy where its bent light ray leaves the volume, at a blur that its roughness picks. three.js draws its transmission the same way.
|
|
161
|
+
|
|
162
|
+
- Only opaque objects show through. Another surface that lets light through, or a blended one, does not show through glass in front of it.
|
|
163
|
+
- The copy keeps the opaque objects' depth too. A bent ray can land on an opaque object in front of the surface, such as a flower on the bank of a stream. The surface then shows what lies straight behind it instead. three.js shows the flower's color in the water there.
|
|
164
|
+
- The volume is a model, not a ray through the real shape. A ball with `thickness` set to its diameter looks right through its middle. three.js uses the same model.
|
|
165
|
+
- With `dispersion`, light follows three rays, one per color, each bent by a slightly different index of refraction. Red takes the lowest index, as three.js draws it. Each color keeps the light that its own ray reaches, so a gem's edges separate white light into colors.
|
|
166
|
+
- `thickness` is in the mesh's own units, and the object's scale multiplies it.
|
|
167
|
+
- Such a surface takes the `opaque`, `mask` or `blend` alpha mode. A mask decides which pixels draw, and the light from behind fills the pixels that remain. `hash` throws E1217.
|
|
168
|
+
- Views other than the camera's, such as [scene passes](render.md#scene-passes) and [reflection passes](render.md#reflection-passes), have no copy. There the surface shows the environment's light along the bent ray.
|
|
169
|
+
- A material with `transmissionMap` or `thicknessMap` may also give the specular maps. Each volume map samples a specular slot's texture array at a layer of its own, so the two maps of a slot draw together when their images have one size and format. A thickness map never shares a specular color map's array, because one is linear and the other sRGB: a development build throws E1217 for that pair.
|
|
170
|
+
- A layered material keeps the two maps beside a clear coat, a sheen, iridescence or anisotropy, as long as no layer map fills the array that one of them samples: `clearcoatNormalMap` and `iridescenceThicknessMap` fill the array that the transmission map samples, and the sheen's maps and `anisotropyMap` fill the array that the thickness map samples. A development build throws E1217 for each such clash.
|
|
171
|
+
|
|
172
|
+
### Cost of transmission
|
|
173
|
+
|
|
174
|
+
Nothing of it runs, and none of its code or shaders download, until the first surface that lets light through draws. Then each frame copies the camera's opaque colors once and makes the blurred copies. The camera's opaque and see-through objects then draw in two render passes instead of one. The shaders of such surfaces load on their first use. To load them before the first frame instead, list `'transmission'` in `createEngine`'s `preload` option. A material with `dispersion` samples the copy three times, once for each color; a material without it samples the copy once.
|
|
175
|
+
|
|
176
|
+
## Light through thin surfaces
|
|
177
|
+
|
|
178
|
+
A surface with `diffuseTransmission` lets the light that reaches its back through to its front, as glTF's `KHR_materials_diffuse_transmission` describes. A leaf, a petal, a lampshade or an ear then glows where the sun or a lamp shines behind it. The light from behind spreads out evenly, as the diffuse light does, so the surface does not show what lies behind it. For glass and water, which do, use `transmission`.
|
|
179
|
+
|
|
180
|
+
| Value | What it does |
|
|
181
|
+
| --- | --- |
|
|
182
|
+
| `diffuseTransmission` | The share of the surface's diffuse light that passes through to the other side. The front keeps the rest, and the specular reflection stays. 0 lets nothing through, and 1 lets all the diffuse light through, as a sheet of paper does |
|
|
183
|
+
| `diffuseTransmissionColor` | Tints the light that passes through. The base color does not tint it, so give a leaf its green here |
|
|
184
|
+
| `thickness`, `attenuationColor`, `attenuationDistance` | A volume under the surface, which takes the volume's color over its thickness, as for transmission |
|
|
185
|
+
|
|
186
|
+
```ts
|
|
187
|
+
// sketch.ts: leaves that glow yellow green against a low sun, and a red lampshade.
|
|
188
|
+
const leaves = materials.standard({
|
|
189
|
+
color: '#3f7a2a', roughness: 0.6, doubleSided: true, alphaMode: 'mask', map: leafTexture,
|
|
190
|
+
diffuseTransmission: 0.35, diffuseTransmissionColor: '#c8e070',
|
|
191
|
+
});
|
|
192
|
+
const shade = materials.standard({
|
|
193
|
+
color: '#f4e6d0', doubleSided: true,
|
|
194
|
+
diffuseTransmission: 0.5, diffuseTransmissionColor: '#ff9a5c',
|
|
195
|
+
});
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
A measured leaf reflects about 7 to 11 per cent of visible light and transmits about 4 to 6 per
|
|
199
|
+
cent of it, and almost all of that comes out diffuse. The share of its diffuse light that passes
|
|
200
|
+
through therefore sits near a third: 0.25 to 0.45. Its gloss is a dielectric's, with a reflectance
|
|
201
|
+
at normal incidence of about 0.03 to 0.04 and a perceptual roughness of 0.35 to 0.6. Give a leaf
|
|
202
|
+
material values from these ranges. Petals and paper are
|
|
203
|
+
thinner than leaves and let more through, so the translucency demo keeps its petals at 0.7 and its
|
|
204
|
+
paper lantern at 0.85; the measured range is for leaves.
|
|
205
|
+
|
|
206
|
+
Give `diffuseTransmission` when you create the material, even as 0, to change it later with `set`. The option picks the shaders that light the back. A material created without it lets no light through to its other side.
|
|
207
|
+
|
|
208
|
+
- Shadows fall on the light from behind. A leaf in the shade of another leaf shows no sun through it.
|
|
209
|
+
- The sun, the lamps, the ambient and hemisphere lights and the scene's environment all shine through from the surface's far side.
|
|
210
|
+
- Thin surfaces such as leaves and paper usually draw both faces, so give them `doubleSided`. A closed mesh, such as an ear or a candle, lets the light through the face that the light reaches. Give it a `thickness` with `attenuationColor` and `attenuationDistance` to tint the light by how deep it goes.
|
|
211
|
+
- A surface with both `transmission` and `diffuseTransmission` lets light through by transmission alone.
|
|
212
|
+
- `diffuseTransmissionMap` and `diffuseTransmissionColorMap` vary the two values across the surface. They take the places of the specular maps, which such a material does not take. See "Texture maps".
|
|
213
|
+
- A material with a clear coat, a sheen, iridescence or anisotropy, or with the `weighted` blending, takes no `diffuseTransmission`. Development builds throw E1217 for it. A glTF file's layers win over its diffuse transmission.
|
|
214
|
+
|
|
215
|
+
### Cost of light through thin surfaces
|
|
216
|
+
|
|
217
|
+
Nothing of it runs, and none of its shaders download, until the first material with `diffuseTransmission` exists. Its shaders then load on first use. To load them before the first frame instead, list `'translucency'` in `createEngine`'s `preload` option. Each pixel of such a surface adds one product per light, and one more reading of the ambient light and the environment, from behind. The sun's shadow lookup runs on both faces of such a surface, where other surfaces skip it on the side away from the sun.
|
|
218
|
+
|
|
219
|
+
## Light under the surface
|
|
220
|
+
|
|
221
|
+
Light that enters skin, wax or marble leaves it a little way from where it entered, redder the further it went. A material with `subsurfaceRadius` draws that: the subsurface blur spreads the surface's diffuse light over the radius. The edges of its shadows, the light at the side of a nose and the detail of its maps then go soft. Its highlights stay sharp, since only the diffuse light spreads.
|
|
222
|
+
|
|
223
|
+
| Value | Meaning |
|
|
224
|
+
| --- | --- |
|
|
225
|
+
| `subsurfaceRadius` | How far light spreads under the surface, in world units taken as meters. Skin takes about 0.01, wax about 0.02, and marble a few millimeters |
|
|
226
|
+
| `subsurfaceColor` | How far each channel spreads, as a share of the radius: its linear red, green and blue. Skin's red spreads furthest, about `[1, 0.4, 0.25]`. White spreads every channel as far |
|
|
227
|
+
|
|
228
|
+
```ts
|
|
229
|
+
const skin = materials.standard({
|
|
230
|
+
color: '#e0b49c', roughness: 0.45,
|
|
231
|
+
subsurfaceRadius: 0.012, subsurfaceColor: [1, 0.4, 0.25],
|
|
232
|
+
});
|
|
233
|
+
const wax = materials.standard({
|
|
234
|
+
color: '#f3e3c8', roughness: 0.4,
|
|
235
|
+
subsurfaceRadius: 0.025, subsurfaceColor: [1, 0.55, 0.32],
|
|
236
|
+
diffuseTransmission: 0.35, diffuseTransmissionColor: '#ffb070',
|
|
237
|
+
});
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
Give `subsurfaceRadius` when you create the material, even as 0, to change it later with `set`. A material created without it draws no blur. With `diffuseTransmission` too, light from behind glows through the surface's thin parts, as through an ear or a candle's rim. The blur spreads that light as well.
|
|
241
|
+
|
|
242
|
+
- The blur draws on the High and Ultra quality presets, where the quality setting `subsurfaceSamples` gives it 17 or 25 taps. Low and Medium give it 0. So do WebGL2 and WebGPU's compatibility mode, which run Medium at most. There the material draws as without a radius. `quality.set({ subsurfaceSamples: 11 })` turns it on wherever the engine draws HDR color.
|
|
243
|
+
- It draws on the HDR path only. Compatibility mode with MSAA starts on the 8-bit path. A `subsurfaceSamples` setting above 0 that the page or the sketch gives moves it to HDR color with FXAA, as bloom does. A preset's taps alone do not move it. `engine.capabilities.hdr` says which path the engine started on.
|
|
244
|
+
- Materials that blend or let light through by `transmission`, custom materials and instance batches take no blur. Development builds throw E1217 for `subsurfaceRadius` on `materials.shader`.
|
|
245
|
+
- A blur narrower than a pixel draws nothing, so distant objects cost nothing more.
|
|
246
|
+
- The glTF loader reads the draft `KHR_materials_volume_scatter`: each channel spreads `attenuationDistance` times its `multiscatterColor`. See [Assets](assets.md).
|
|
247
|
+
|
|
248
|
+
### Cost of light under the surface
|
|
249
|
+
|
|
250
|
+
Nothing of it runs, and none of its shaders download, while no material has `subsurfaceRadius` or the quality setting gives it no taps. Its shaders then load on first use. To load them before the first frame, list `'subsurface'` in `createEngine`'s `preload` option. While it draws, the objects with a radius draw a second time, in a skin pass that shades their diffuse light into a target of their own. Two full-screen steps then blur it across and down. Each reads its taps only at skin pixels whose blur covers a pixel or more, and every other pixel reads one texel. The targets take 36 bytes per pixel of the render size.
|
|
251
|
+
|
|
252
|
+
## Clear coat and sheen
|
|
253
|
+
|
|
254
|
+
Two layers can lie over the standard material's surface, as three.js's `MeshPhysicalMaterial` and glTF's `KHR_materials_clearcoat` and `KHR_materials_sheen` extensions draw them:
|
|
255
|
+
|
|
256
|
+
- A **clear coat** is a thin, clear, shiny film, such as the lacquer of car paint, varnish on wood, or water on a stone. It has highlights and a reflection of its own, at its own roughness. Where it reflects light, it dims what lies under it. So a rough red paint under a smooth coat shows a sharp reflection over a soft color.
|
|
257
|
+
- A **sheen** is the soft glow that cloth, velvet and fuzz take at grazing angles, where the light catches the tips of their fibers. Its color tints the glow. Light that the sheen reflects does not reach the surface under it.
|
|
258
|
+
|
|
259
|
+
| Value | What it does |
|
|
260
|
+
| --- | --- |
|
|
261
|
+
| `clearcoat` | How much of the coat covers the surface, from none at 0 to all at 1 |
|
|
262
|
+
| `clearcoatRoughness` | How rough the coat is. 0 is a mirror finish |
|
|
263
|
+
| `clearcoatNormalScale` | How strongly `clearcoatNormalMap` bends the coat's normals. Without a coat normal map, the coat lies smooth over the mesh, whatever the `normalMap` does to the surface under it |
|
|
264
|
+
| `sheenColor` | The color of the sheen. Black, the default, gives no sheen |
|
|
265
|
+
| `sheenRoughness` | How wide the sheen spreads, from a narrow rim at 0 to a soft glow across the surface at 1 |
|
|
266
|
+
|
|
267
|
+
```ts
|
|
268
|
+
// sketch.ts: car paint, a wet stone and red velvet, in an environment's light.
|
|
269
|
+
scene.setEnvironment(await assets.builtinEnvironment('room'));
|
|
270
|
+
const paint = materials.standard({
|
|
271
|
+
color: '#a3131b', metalness: 0.5, roughness: 0.5,
|
|
272
|
+
clearcoat: 1, clearcoatRoughness: 0.03,
|
|
273
|
+
});
|
|
274
|
+
const wetStone = materials.standard({
|
|
275
|
+
color: '#4a4844', roughness: 0.9, clearcoat: 0.8, clearcoatRoughness: 0.05,
|
|
276
|
+
});
|
|
277
|
+
const velvet = materials.standard({
|
|
278
|
+
color: '#4a0613', roughness: 0.9, sheenColor: '#ff7a8f', sheenRoughness: 0.4,
|
|
279
|
+
});
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
Give any of these values, or a layer map, when you create the material, to change the layers later with `set`. The option picks the shader that lights the layers. A material created without them has no layers, and pays nothing for them. A coat of 0 and a black sheen draw exactly as no layers.
|
|
283
|
+
|
|
284
|
+
### Maps of the layers
|
|
285
|
+
|
|
286
|
+
| Option | Channels | What it does |
|
|
287
|
+
| --- | --- | --- |
|
|
288
|
+
| `clearcoatMap` | R, linear | Multiplies `clearcoat` |
|
|
289
|
+
| `clearcoatRoughnessMap` | G, linear | Multiplies `clearcoatRoughness` |
|
|
290
|
+
| `clearcoatNormalMap` | RGB, linear | Bends the coat's normals in tangent space, scaled by `clearcoatNormalScale` |
|
|
291
|
+
| `sheenColorMap` | RGB, sRGB | Multiplies `sheenColor` |
|
|
292
|
+
| `sheenRoughnessMap` | A | Multiplies `sheenRoughness` |
|
|
293
|
+
|
|
294
|
+
The layers' maps take the places of the light map and the specular maps. So a material with a clear coat, a sheen, iridescence or anisotropy takes no `lightMap`, `specularIntensityMap` or `specularColorMap`, and no `diffuseTransmission`. Development builds throw E1217 for them, and production builds draw the material without them. Its `specularIntensity` and `specularColor` values still apply. Give `clearcoatMap` and `clearcoatRoughnessMap` as one texture, with the coat in red and its roughness in green, and `sheenColorMap` and `sheenRoughnessMap` as one texture, with the roughness in alpha. glTF packs them this way, and two textures for a pair throw E1217. An sRGB texture keeps its alpha linear, so one sRGB texture holds the sheen's color and roughness.
|
|
295
|
+
|
|
296
|
+
A material with `transmission` keeps its `transmissionMap` and `thicknessMap` beside the layers, as long as no layer map fills the texture array that one of them samples. `clearcoatNormalMap` and `iridescenceThicknessMap` fill the array that the transmission map samples, and `sheenColorMap`, `sheenRoughnessMap` and `anisotropyMap` fill the array that the thickness map samples. A development build throws E1217 for a material that asks for two maps of one array.
|
|
297
|
+
|
|
298
|
+
### How the layers draw
|
|
299
|
+
|
|
300
|
+
The engine uses the formulas of three.js's `MeshPhysicalMaterial`:
|
|
301
|
+
|
|
302
|
+
- The coat is a second GGX highlight, which reflects 4% of the light head on and all of it at grazing angles. It reflects the scene's environment at its own roughness, and the occlusion map and ambient occlusion darken that reflection.
|
|
303
|
+
- The sheen is the Charlie highlight of cloth (Estevez and Kulla), lit by each light, and by the ambient light and the environment. How much light the sheen keeps from the surface under it comes from three.js's curve fit of the sheen's reflectance, which needs no lookup table. At grazing angles the fit gives a little less than the exact value, so the surface under a strong sheen shows slightly brighter there than the extension's reference. three.js draws the same.
|
|
304
|
+
- Emitted light lies under the coat too, so a coat dims a glowing surface where it reflects.
|
|
305
|
+
|
|
306
|
+
### Cost of the layers
|
|
307
|
+
|
|
308
|
+
The layers' shaders load the first time you create a material with layers. To load them before the first frame instead, list `'coat_sheen'` in `createEngine`'s `preload` option. A layered material costs each of its pixels, per light, one more highlight for the coat and one for the sheen, and one more environment read for the coat. A layer that a material does not use costs almost nothing. Materials without layers draw as before, with no new texture and no change to their shaders.
|
|
309
|
+
|
|
310
|
+
## Iridescence and anisotropy
|
|
311
|
+
|
|
312
|
+
Two more effects sit in the same shaders as the clear coat and the sheen, and a material takes them with the same options:
|
|
313
|
+
|
|
314
|
+
- **Iridescence** is the color that a thin film adds to a reflection, as on a soap bubble, an oil slick, a beetle's shell or a pearl. The film reflects each wavelength by its own phase, so the color depends on the film's thickness and on the angle you see it from. The engine uses the formulas of three.js's `MeshPhysicalMaterial`, after Belcour and Barla.
|
|
315
|
+
- **Anisotropy** stretches the surface's highlight along one direction, as the grain of brushed metal spreads it across the grooves instead of around them. The engine uses the anisotropic GGX lobe of three.js's `MeshPhysicalMaterial`, after Filament.
|
|
316
|
+
|
|
317
|
+
| Value | What it does |
|
|
318
|
+
| --- | --- |
|
|
319
|
+
| `iridescence` | How much of the film's color shows, from none at 0 to all at 1 |
|
|
320
|
+
| `iridescenceIor` | The film's index of refraction. A value near 2 shows the colors most strongly, and 1 leaves the reflection as it was |
|
|
321
|
+
| `iridescenceThicknessRange` | The film's least and greatest thickness, in nanometers. Thinner films show blue and violet, and thicker ones show red and green |
|
|
322
|
+
| `anisotropy` | How far the highlight stretches, from a round lobe at 0 to a line at 1 |
|
|
323
|
+
| `anisotropyRotation` | The direction along which it stretches, in radians from the surface's tangent |
|
|
324
|
+
|
|
325
|
+
```ts
|
|
326
|
+
// sketch.ts: a beetle's shell and a brushed disc, in an environment's light.
|
|
327
|
+
scene.setEnvironment(await assets.builtinEnvironment('room'));
|
|
328
|
+
const shell = materials.standard({
|
|
329
|
+
color: '#0d3a24', metalness: 1, roughness: 0.22,
|
|
330
|
+
iridescence: 1, iridescenceIor: 1.9, iridescenceThicknessRange: [180, 620],
|
|
331
|
+
});
|
|
332
|
+
const brushed = materials.standard({
|
|
333
|
+
color: '#c9ced8', metalness: 1, roughness: 0.28,
|
|
334
|
+
anisotropy: 0.85, anisotropyMap: grainMap,
|
|
335
|
+
});
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
Give any of these values, or a map, when you create the material, to change the values later with `set`. The option picks the shaders that light the layers above the surface, which load on first use.
|
|
339
|
+
|
|
340
|
+
### Maps of iridescence and anisotropy
|
|
341
|
+
|
|
342
|
+
| Option | Channels | What it does |
|
|
343
|
+
| --- | --- | --- |
|
|
344
|
+
| `iridescenceMap` | R, linear | Multiplies `iridescence` |
|
|
345
|
+
| `iridescenceThicknessMap` | G, linear | Mixes `iridescenceThicknessRange` between its two values |
|
|
346
|
+
| `anisotropyMap` | RG direction, B strength, linear | Red and green give the direction in the tangent plane, and blue multiplies `anisotropy` |
|
|
347
|
+
|
|
348
|
+
A material with these maps takes no `lightMap` and no specular maps, since the maps take their places. A material takes the maps of a clear coat and a sheen, or the maps of iridescence and the anisotropy: the coat's and the sheen's maps fill every place. Development builds throw E1217 for a material that asks for both families. Production builds keep the coat's and the sheen's maps and draw the others' values alone. The glTF loader keeps the coat's and the sheen's maps and notes the others. A material with `transmission` keeps its `transmissionMap` and `thicknessMap` beside these maps where the array of one stays free: `iridescenceThicknessMap` fills the array that the transmission map samples and `anisotropyMap` the one that the thickness map samples, so a material takes one of each pair.
|
|
349
|
+
|
|
350
|
+
A material with `anisotropy` draws with or without a map. The direction that it stretches along comes from the surface's tangent frame. The frame is the mesh's tangents where it has them, else the texture coordinates, else the normal map's coordinates where the material also has a normal map. A material without a map and with no texture coordinates takes any frame square to the surface. Three.js builds the frame the same way from the tangents or the coordinates.
|
|
351
|
+
|
|
352
|
+
### How the film and the stretch draw
|
|
353
|
+
|
|
354
|
+
- The film's Fresnel term takes the place of the surface's own where `iridescence` applies. So the highlight and the reflection both take the film's colors, and a metal shows them over its base color.
|
|
355
|
+
- The film does not change the shape of the highlight, the diffuse light or the light that passes through the surface.
|
|
356
|
+
- The stretched lobe changes how each light's highlight spreads. The reflection of the environment about the surface bends away from the normal across the stretched direction, as three.js bends it, so brushed metal shows a long reflection rather than a dot.
|
|
357
|
+
- Rectangles and tubes of light shade the surface without the stretch, as three.js's rectangle lights do.
|
|
358
|
+
|
|
359
|
+
### Cost of iridescence and anisotropy
|
|
360
|
+
|
|
361
|
+
These effects add nothing to a material without them. They run in the shaders of the layers above the surface, which load the first time you create a material with a clear coat, a sheen, iridescence or anisotropy. To load them before the first frame, list `'coat_sheen'` in `createEngine`'s `preload` option. A film costs one short series of cosines per pixel, and a stretched lobe costs a few more terms per light.
|
|
362
|
+
|
|
363
|
+
## Decals
|
|
364
|
+
|
|
365
|
+
A decal material projects a standard material onto every opaque surface inside a box, as three.js's `DecalGeometry` places a decal. Use decals for scorch marks, mud, puddles, road paint, moss, cracks and posters. Give the material to a mesh of `geometry.box()`: the object's position, rotation and scale place the box.
|
|
366
|
+
|
|
367
|
+
```ts
|
|
368
|
+
// sketch.ts: a scorch mark on the ground, and cracks on a wall. The maps come from textures.
|
|
369
|
+
const box = geometry.box();
|
|
370
|
+
const scorch = materials.decal({ map: scorchColors, normalMap: scorchBumps, roughness: 0.95 });
|
|
371
|
+
// Turned so that the box's z axis points up, out of the ground: the decal looks down onto it.
|
|
372
|
+
const down: Quat = [-Math.SQRT1_2, 0, 0, Math.SQRT1_2];
|
|
373
|
+
scene.createMesh({ mesh: box, material: scorch, position: [2, 0, 1], rotation: down, scale: [3, 3, 1] });
|
|
374
|
+
// A wall that faces +z takes a box that is not turned.
|
|
375
|
+
const cracks = materials.decal({ map: crackColors, normalMap: crackBumps });
|
|
376
|
+
scene.createMesh({ mesh: box, material: cracks, position: [0, 1.5, -2], scale: [2, 2, 0.5] });
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
The box's z axis is the decal's direction: it points out of the surfaces that the decal marks. The maps lie across the box's x and y sides, with u along x and v along y, as `DecalGeometry` lays them. The box's z size sets how far into and out of a surface the decal reaches, so a deep box marks a bumpy or curved surface all over.
|
|
380
|
+
|
|
381
|
+
A decal takes the standard material's values and maps. They light it as they light any surface, at the place where the decal lies:
|
|
382
|
+
|
|
383
|
+
| Values | What they do |
|
|
384
|
+
| --- | --- |
|
|
385
|
+
| `map`, `color`, `opacity` | The decal's color. The map's alpha times the opacity sets how much of the decal covers the surface |
|
|
386
|
+
| `metalnessRoughnessMap`, `metalness`, `roughness` | How the decal reflects light. A puddle is smooth, and scorch is rough |
|
|
387
|
+
| `normalMap`, `normalScale` | Bumps of the decal, such as the edges of a crack or the grain of moss |
|
|
388
|
+
| `aoMap`, `aoMapIntensity`, `emissive`, `emissiveMap`, `emissiveIntensity` | Occlusion and light of the decal's own, such as glowing paint |
|
|
389
|
+
| `angleFade` | The angles from the decal's direction at which it starts to fade and past which it shows nothing, in radians. The default, 60 and 80 degrees, keeps a decal on the ground from smearing up a wall |
|
|
390
|
+
| `edgeFade` | The share of the box's depth, from 0 to 1, over which the decal fades toward each end along z. The default is 0.2 |
|
|
391
|
+
|
|
392
|
+
A batch of boxes with one decal material draws in one draw. With `colors: true`, each row's color tints its decal, and the row's alpha fades it, as for bullet holes that fade with time.
|
|
393
|
+
|
|
394
|
+
### Objects that show no decals
|
|
395
|
+
|
|
396
|
+
`scene.setDecalLayers(mask)` sets the layers whose objects decals mark. An object that is also on a layer outside the mask shows no decals, so a character on a layer of its own walks through mud and puddles clean.
|
|
397
|
+
|
|
398
|
+
```ts
|
|
399
|
+
const PEOPLE = 1 << 1;
|
|
400
|
+
scene.setDecalLayers(~PEOPLE); // decals mark every layer but the people's
|
|
401
|
+
const walker = scene.createMesh({ mesh: body, material: coat, layers: 1 | PEOPLE });
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
Such objects draw a second time after the decals, over their own pixels. That costs one more draw of them in each frame that shows decals, so keep the layers that decals skip to the objects that need it. The mask is the same for every decal.
|
|
405
|
+
|
|
406
|
+
### How decals draw
|
|
407
|
+
|
|
408
|
+
After the camera's view draws its opaque objects, the decals draw in a pass of their own. For each pixel of its box, a decal reads the scene's depth there and finds the surface that the pixel shows. It lights its own material at that surface, with the scene's lights, shadows, ambient occlusion, environment and fog. Then it covers the surface as far as its alpha says.
|
|
409
|
+
|
|
410
|
+
- Decals mark opaque surfaces only. Blended surfaces and surfaces that let light through draw after the decals.
|
|
411
|
+
- A decal covers the surface below it with its own color. It cannot only darken or smooth the surface and keep the surface's own map. So give a puddle a dark color and a low roughness of its own.
|
|
412
|
+
- Under a decal, the surface's normal comes from the scene's depth. A curved mesh of few triangles shows its flat faces there.
|
|
413
|
+
- Decals of one render order draw in the order you made them. `setRenderOrder` puts one decal over another.
|
|
414
|
+
- Only the camera's view shows decals. [Scene passes](render.md#scene-passes) and [reflection passes](render.md#reflection-passes) show none.
|
|
415
|
+
- A decal casts no shadow. Raycasts and pointer events hit its box, as they hit any mesh. Put decals on a layer of their own, and leave that layer out of the raycast's `layers`.
|
|
416
|
+
|
|
417
|
+
### Cost of decals
|
|
418
|
+
|
|
419
|
+
Nothing of it runs, and none of its shaders download, until the first decal material. Then each frame culls the decals on the engine's workers and draws them in one render pass, with one draw for each run of decals that share their maps. Each pixel that a decal covers reads five depths and lights the surface once more. A decal's shaders load on first use. To load them before the first frame instead, list `'decals'` in `createEngine`'s `preload` option.
|
|
420
|
+
|
|
421
|
+
## Texture maps
|
|
422
|
+
|
|
423
|
+
Maps are textures that vary a material across a surface. `assets.loadTexture` and the `textures` calls make them, as [Textures](textures.md) explains. Give color maps the `srgb` color space and data maps the `linear` one.
|
|
424
|
+
|
|
425
|
+
```ts
|
|
426
|
+
// sketch.ts
|
|
427
|
+
const [color, packed, bumps] = await Promise.all([
|
|
428
|
+
assets.loadTexture('/brick-color.png'),
|
|
429
|
+
assets.loadTexture('/brick-orm.png', { colorSpace: 'linear' }),
|
|
430
|
+
assets.loadTexture('/brick-normal.png', { colorSpace: 'linear' }),
|
|
431
|
+
]);
|
|
432
|
+
const brick = materials.standard({
|
|
433
|
+
map: color,
|
|
434
|
+
metalnessRoughnessMap: packed,
|
|
435
|
+
aoMap: packed,
|
|
436
|
+
normalMap: bumps,
|
|
437
|
+
uvTransform: { repeat: [4, 2] },
|
|
438
|
+
});
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
| Option | Material | Channels | What it does |
|
|
442
|
+
| --- | --- | --- | --- |
|
|
443
|
+
| `map` | Both | RGBA, sRGB | Multiplies `color`, and its alpha multiplies `opacity` |
|
|
444
|
+
| `metalnessRoughnessMap` | Standard | G and B, linear | Green multiplies `roughness`, and blue multiplies `metalness`, as glTF packs them |
|
|
445
|
+
| `normalMap` | Standard | RGB, linear | Bends normals in tangent space, scaled by `normalScale` |
|
|
446
|
+
| `bumpMap` | Standard | R, linear | Bends normals by the change of its heights, scaled by `bumpScale`. See "Relief" |
|
|
447
|
+
| `displacementMap` | Standard | R, linear | Moves each vertex along its normal, by `displacementScale` and `displacementBias`. See "Relief" |
|
|
448
|
+
| `aoMap` | Standard | R, linear | Darkens ambient light, by `aoMapIntensity` |
|
|
449
|
+
| `emissiveMap` | Standard | RGB, sRGB | Multiplies `emissive` times `emissiveIntensity` |
|
|
450
|
+
| `lightMap` | Standard | RGB | Adds baked light to the ambient light, times `lightMapIntensity` |
|
|
451
|
+
| `lightMapDirection` | Standard with `lightMap` | RGB, linear | The direction of the light at each texel of a directional light map, which bends the light with the normal. It is fixed when the material is created |
|
|
452
|
+
| `specularIntensityMap` | Standard | A, linear | Its alpha multiplies `specularIntensity` |
|
|
453
|
+
| `specularColorMap` | Standard | RGB, sRGB | Multiplies `specularColor` |
|
|
454
|
+
| `diffuseTransmissionMap` | Standard with `diffuseTransmission` | A, linear | Its alpha multiplies `diffuseTransmission` |
|
|
455
|
+
| `diffuseTransmissionColorMap` | Standard with `diffuseTransmission` | RGB, sRGB | Multiplies `diffuseTransmissionColor` |
|
|
456
|
+
| `transmissionMap` | Standard with `transmission` | R, linear | Its red multiplies `transmission`, sampling the specular intensity slot's texture array at a layer of its own |
|
|
457
|
+
| `thicknessMap` | Standard with `transmission` | G, linear | Its green multiplies `thickness`, sampling the specular color slot's texture array at a layer of its own |
|
|
458
|
+
| `clearcoatMap`, `clearcoatRoughnessMap`, `clearcoatNormalMap`, `sheenColorMap`, `sheenRoughnessMap` | Standard | See "Maps of the layers" | The maps of the clear coat and the sheen, in place of the light map and the specular maps |
|
|
459
|
+
| `iridescenceMap`, `iridescenceThicknessMap`, `anisotropyMap` | Standard | See "Maps of iridescence and anisotropy" | The maps of the thin film and the stretched lobe, in the same places |
|
|
460
|
+
|
|
461
|
+
A material with `diffuseTransmission` takes the two diffuse transmission maps in the places of the specular maps, and takes no specular maps. A material without it, or with a clear coat, a sheen, iridescence or anisotropy, takes no diffuse transmission maps. Development builds throw E1217 for either.
|
|
462
|
+
|
|
463
|
+
A material with `transmission` may take `transmissionMap` and `thicknessMap` beside the specular maps. Each volume map samples a specular slot's texture array at a layer of its own, so the two maps of a slot draw together when their images have one size and format. A thickness map never shares a specular color map's array, because one is linear and the other sRGB: a development build throws E1217 for that pair. A layered material keeps both maps beside its layers, unless a layer map fills the array that one of them samples. Development builds throw E1217 for the two maps without `transmission`.
|
|
464
|
+
|
|
465
|
+
The maps of a material are fixed when you create it. A mesh needs texture coordinates to show them, and a mesh without them draws the material without its maps. A map reads the set of coordinates that its texture's `uvSet` names. Light maps usually use the second set, so load them with `uvSet: 1`. A mesh without a second set gives its first set to such a map.
|
|
466
|
+
|
|
467
|
+
A light map adds baked light to the ambient light. A bake often places its light map on each mesh with its own scale and offset, which `lightMapOffset` and `lightMapRepeat` give; the other maps keep their coordinates. A directional light map also stores the light's direction at each texel: give its `lightMapDirection` and the material's normal map bends the baked light, so relief faces the light of the bake and turns away from it. `assets.loadLightMap` reads a directional map from a [baked light file](../guides/baked-light-data.md). A material made from a model for Needle's viewer takes that model's light maps with their RGBM decode.
|
|
468
|
+
|
|
469
|
+
A normal map takes its frame from the mesh's tangents when the mesh has them, as `geometry.fromArrays` with `computeTangents` makes them. Otherwise the shader finds the frame from how the positions and the coordinates change between pixels, as three.js does.
|
|
470
|
+
|
|
471
|
+
Until a map's image reaches the GPU, the material draws as without that map.
|
|
472
|
+
|
|
473
|
+
On WebGL2, the maps of one material share at most six textures on the GPU. Maps with the same size, format and sampling count once, so a material rarely reaches the limit. [Texture arrays](textures.md#texture-arrays) says which maps a material drops past it.
|
|
474
|
+
|
|
475
|
+
## Relief
|
|
476
|
+
|
|
477
|
+
Three maps give a surface relief. Each reads heights from its red channel, in the `linear` color space. They follow three.js's options of the same names.
|
|
478
|
+
|
|
479
|
+
```ts
|
|
480
|
+
// sketch.ts
|
|
481
|
+
const [color, normal, height] = await Promise.all([
|
|
482
|
+
assets.loadTexture('/rock-color.png'),
|
|
483
|
+
assets.loadTexture('/rock-normal.png', { colorSpace: 'linear' }),
|
|
484
|
+
assets.loadTexture('/rock-height.png', { colorSpace: 'linear' }),
|
|
485
|
+
]);
|
|
486
|
+
const rock = materials.standard({
|
|
487
|
+
map: color,
|
|
488
|
+
normalMap: normal,
|
|
489
|
+
displacementMap: height,
|
|
490
|
+
displacementScale: 0.4,
|
|
491
|
+
displacementBias: -0.2,
|
|
492
|
+
});
|
|
493
|
+
scene.createMesh({ mesh: geometry.sphere({ radius: 1, widthSegments: 128, heightSegments: 64 }), material: rock });
|
|
494
|
+
```
|
|
495
|
+
|
|
496
|
+
| Option | What it does | Cost |
|
|
497
|
+
| --- | --- | --- |
|
|
498
|
+
| `bumpMap` | Bends the normals by the change of its heights from one pixel to the next, times `bumpScale`, as three.js's bump map does. The shape stays flat | Three texture reads per pixel |
|
|
499
|
+
| `displacementMap` | Moves each vertex along its normal by its height times `displacementScale`, plus `displacementBias`, in the mesh's units. The shape changes | One texture read per vertex in each pass that draws it, and three per pixel where it bends the normals |
|
|
500
|
+
| `parallax: true` | With a displacement map, shifts where each pixel reads the maps, so relief finer than the vertices hides and shows the surface behind it as the view turns | 8 to 32 texture reads per pixel, more at grazing views |
|
|
501
|
+
|
|
502
|
+
A bump map gives fine relief to a flat surface, such as the grain of stone. Its bend depends on the surface's size on the screen, as in three.js. A normal map wins over a bump map, so a material draws one or the other.
|
|
503
|
+
|
|
504
|
+
A displacement map changes the shape itself, so its silhouette and its shadows move too. The vertex shader reads the map at its full size, so the mesh needs about as many vertices as the detail it should show. `geometry.plane` and `geometry.sphere` take segment counts for this. The map moves vertices after skinning and morph targets, as in three.js.
|
|
505
|
+
|
|
506
|
+
- Without a normal map or a bump map, the displacement map's slope also bends the normals, so the light follows the moved surface. three.js keeps the mesh's normals there, so a port of such a material looks less flat in null3D.
|
|
507
|
+
- With a normal map, the normal map bends the normals, as in three.js. A normal map made from the same heights already holds their slope.
|
|
508
|
+
- Shadows and the depth prepass follow the moved vertices. Culling grows each object's bounds by the farthest that the material has moved a vertex, so no `setBounds` call is needed.
|
|
509
|
+
- Raycasts, outlines and debug views see the mesh before it moves, as three.js's raycasts do.
|
|
510
|
+
|
|
511
|
+
`parallax` adds the detail that the vertices cannot hold, such as the joints between bricks or cobbles. Silhouettes and shadows keep the vertices' shape. It takes only opaque and masked surfaces: the `blend` alpha mode and `transmission` with `parallax` throw E1217. The quality preset's `parallax` setting turns it off on Low, where such materials draw with their displacement alone.
|
|
512
|
+
|
|
513
|
+
A page without relief pays nothing for it. The first material with a bump map loads the shader builds of bump maps, and the first with a displacement map those of displacement and parallax. To load them before the first frame instead, list `'bump'` and `'displacement'` in `createEngine`'s `preload` option.
|
|
514
|
+
|
|
515
|
+
## Texture coordinate transform
|
|
516
|
+
|
|
517
|
+
`uvTransform` places every map of a material on the texture coordinates: `offset`, `repeat` and `rotation` in radians. They act as three.js's texture `offset`, `repeat` and `rotation` with the default `center`. A transform that leaves a value out takes its default. `set` changes the transform at any time. `mapUvTransforms` places one map by its option name, such as `emissiveMap`, where it differs from the others. A map without one keeps the transform that `uvTransform` gives it. Two maps that share a slot, as a sheen map and an anisotropy map do, share one transform too. A glTF file keeps a transform for each of its textures, so the loader places each map with its own.
|
|
518
|
+
|
|
519
|
+
## Color
|
|
520
|
+
|
|
521
|
+
`color`, `emissive` and `specularColor` take an sRGB color, as three.js does. That is a hex string such as `'#4a8cff'` or `'#48f'`, a number such as `0x4a8cff`, or three linear components from 0 to 1. The engine converts the color to linear once, when the call receives it. Any other value, such as the name `'red'`, throws E1204. The linear components of `specularColor` may also exceed 1, as glTF allows.
|
|
522
|
+
|
|
523
|
+
## Changing a material
|
|
524
|
+
|
|
525
|
+
`set(options)` changes a material's values at any time, and every object that uses the material changes with it. It changes only the options that you pass. The others keep their values, so `set({ roughness: 0.5 })` keeps the color. A standard material's `set` takes every value in the table above, and an unlit material's `set` takes `color`, `opacity`, `alphaCutoff`, `uvTransform` and `mapUvTransforms`.
|
|
526
|
+
|
|
527
|
+
`set` is for setup, and for several values at once. It reads each number from the options object that you pass. The browser boxes a read where it cannot keep a field's number unboxed. That happens in an object whose fields hold other kinds of value too, and in one of more than a few shapes. Change the values that a frame changes with `setUniform(name, value)`, which takes the value itself. `material.setUniform('roughness', 0.5 + 0.1 * Math.sin(t))` allocates nothing from a small step of your own, as the other setters do. It takes a number, as `roughness` and `emissiveIntensity` do, or a color, as `color` and `sheenColor` do. Give a color in an array that you change in place. A value that takes more than one number, as `uvTransform`, `normalScale`, `clearcoatNormalScale`, `angleFade`, `ior` and `attenuationDistance` do, goes through `set`. A custom material's `setUniform` changes one of its WGSL uniforms too, by the name in its `struct Uniforms`. `bun run bench:allocation --setters` checks `setUniform` in every frame and `set` at setup.
|
|
528
|
+
|
|
529
|
+
`set` checks every value before it changes any, so a call that throws changes nothing. It converts a color without allocating, and it reads each number by its name. Keep one options object for each material that changes. To change one object alone, give it another material with `mesh.setMaterial(material)`.
|
|
530
|
+
|
|
531
|
+
## Destroying a material
|
|
532
|
+
|
|
533
|
+
`material.destroy()` frees a material that the sketch no longer needs, as three.js's `material.dispose()` does. From the next frame, objects and instance batches that still use it draw nothing, until `setMaterial` gives them another material. Once no object or batch uses it, its place in the engine's table of materials goes to the next material that you create. When the last material of a custom material's WGSL goes, the engine also frees that WGSL's pipelines.
|
|
534
|
+
|
|
535
|
+
`destroy` leaves the material's textures, which other materials may share. Destroy them apart with `texture.destroy()`. Calls on a destroyed material, and calls that pass it, such as `createMesh`, throw [E1101](../errors/E1101.md). Destroying a material changes which objects draw, so the next frame rebuilds the engine's draw tables, as creating one does.
|
|
536
|
+
|
|
537
|
+
## Options fixed at creation
|
|
538
|
+
|
|
539
|
+
These options are fixed when you create the material. Most of them choose the material's shader or its pipeline, and a change would compile a new pipeline, which can make a frame late. Make one material for each combination instead.
|
|
540
|
+
|
|
541
|
+
| Option | Materials | Default | What it does |
|
|
542
|
+
| --- | --- | --- | --- |
|
|
543
|
+
| `doubleSided` | Both | false | Draws both faces of each triangle. A back face lights as if it faced the camera, as with three.js's `side: DoubleSide` |
|
|
544
|
+
| `vertexColors` | Both | false | Multiplies the base color by the mesh's vertex colors, on meshes that have them. [Geometry](geometry.md) makes meshes with colors |
|
|
545
|
+
| `flatShading` | Standard | false | Lights each triangle with the normal of its face, so the mesh looks faceted |
|
|
546
|
+
| `alphaMode` | Both | `'opaque'` | How the material uses its alpha: `'opaque'`, `'mask'`, `'hash'` or `'blend'`. See "Alpha modes" |
|
|
547
|
+
| `alphaToCoverage` | Both | true | With the `mask` alpha mode, smooths the cut edges with MSAA, as three.js's `alphaToCoverage` does. `false` gives the hard cut edges of three.js's `alphaTest`. See "Alpha to coverage" |
|
|
548
|
+
| `blending` | Both | `'normal'` | With the `blend` alpha mode, how the surface meets what lies behind it: `'normal'`, `'additive'`, `'multiply'` or `'weighted'`. See "Blending" |
|
|
549
|
+
| `depthWrite` | Both | true | False writes no depth, so the surface hides nothing that draws after it |
|
|
550
|
+
| `depthTest` | Both | true | False draws the surface whatever lies in front of it. It then writes no depth either, as in three.js's WebGL renderer |
|
|
551
|
+
| `colorWrite` | Both | true | False writes no color, so the surface shows nothing itself and hides what lies behind it, as three.js's `colorWrite: false` does. See "Invisible surfaces that hide" |
|
|
552
|
+
| `depthBias` | Both | No bias | Moves the surface's depth, as three.js's polygon offset does. See "Depth bias" |
|
|
553
|
+
| `forceSinglePass` | Both | false | With the `blend` alpha mode and `doubleSided`, draws both faces in one draw, as three.js's `forceSinglePass` does. See "Double-sided blended surfaces" |
|
|
554
|
+
| `transmission` | Standard | None | Given at all, even as 0, lets light through the surface, and `set` can then change its value. See "Transmission" |
|
|
555
|
+
| `diffuseTransmission` | Standard | None | Given at all, even as 0, lets light through to the surface's other side, and `set` can then change its value. See "Light through thin surfaces" |
|
|
556
|
+
| `subsurfaceRadius` | Standard | None | Given at all, even as 0, spreads the surface's light under it, and `set` can then change its value. See "Light under the surface" |
|
|
557
|
+
| The layer values and maps | Standard | None | Any of them gives the material its layers above the surface, even a coat of 0, and `set` can then change their values. See "Clear coat and sheen" and "Iridescence and anisotropy" |
|
|
558
|
+
| `fog` | Both | true | Takes the scene's fog. With `false`, the material keeps its color at every distance, as with three.js's `fog: false`. [Scene](scene.md#fog) sets the fog |
|
|
559
|
+
| `toneMapped` | Both | true | With `false`, keeps the color as the display shows it, as with three.js's `toneMapped: false`: the tone curve leaves it alone. The 8-bit path decides that in the material's own shader. The HDR path reads a mask of these surfaces in its final pass and skips the curve where one draws. The vignette and the sRGB encoding still apply, and the exposure scales the material's colors, so the color shows brighter than the same color tone mapped. A blended surface keeps the curve on the HDR path, since a blended pixel mixes two surfaces. [Color management](../concepts/color-management.md) explains the two paths |
|
|
560
|
+
| `contactShadows` | Standard | true | Takes the main directional light's contact shadows. With `false`, the surface takes none and keeps the shadow map's shadows. Use it on grass, leaf cards and other thin surfaces that crowd together or sway, where contact shadows make them dark and grainy and flicker as they move. [Shadows](../concepts/shadows.md#grass-and-other-thin-surfaces) explains why |
|
|
561
|
+
| `wireframe` | Both | false | Draws the edges of each triangle as lines one pixel wide, with the material's own shading, as three.js's `wireframe` does. See "Wireframe" |
|
|
562
|
+
| `parallax` | Standard | false | With a `displacementMap`, adds parallax occlusion mapping. See "Relief" |
|
|
563
|
+
| `sceneInputs` | Custom | None | The scene inputs that the material's WGSL reads, which fix its shader. `['sceneDepth']` binds the copy of the opaque scene's depth. See "The scene behind a surface" |
|
|
564
|
+
|
|
565
|
+
A material with `vertexColors` draws a mesh without colors in its base color alone. The kind of material, standard or unlit, is fixed too.
|
|
566
|
+
|
|
567
|
+
### Wireframe
|
|
568
|
+
|
|
569
|
+
A material with `wireframe: true` draws each triangle's three edges as lines, as three.js does. An edge that two triangles share draws twice. The engine keeps an edge list for each mesh from the first wireframe on, which takes twice the GPU memory of the mesh's triangle indices. Its shadows draw lines too. Flat shading and bump maps have no effect, as in three.js, because lines have no faces. Lines are one pixel wide on every GPU path. For wide lines, or for a mesh's outline edges alone, use [Lines](lines.md).
|
|
570
|
+
|
|
571
|
+
## Alpha modes
|
|
572
|
+
|
|
573
|
+
A surface's alpha is its `opacity`, times the alpha of its base color map. With `vertexColors`, the alpha of the mesh's vertex colors multiplies it too. `alphaMode` says how the material uses the alpha:
|
|
574
|
+
|
|
575
|
+
| Mode | What it draws | three.js |
|
|
576
|
+
| --- | --- | --- |
|
|
577
|
+
| `'opaque'` | The whole surface, opaque. The alpha has no effect | The default material |
|
|
578
|
+
| `'mask'` | Nothing where the alpha is below `alphaCutoff`, and the rest opaque | `alphaTest: alphaCutoff` |
|
|
579
|
+
| `'hash'` | Each point of the surface opaque or not at all, so the alpha sets how much of the surface draws | `alphaHash: true` |
|
|
580
|
+
| `'blend'` | The surface blended over what lies behind it, as far as the alpha says | `transparent: true` |
|
|
581
|
+
|
|
582
|
+
A masked surface has hard edges, and it hides what lies behind it as an opaque one does, so its objects draw in any order. Use it for leaves, fences and cut-out shapes. Only masked and hashed materials draw with the shader that drops fragments, so opaque ones keep the GPU's early depth test.
|
|
583
|
+
|
|
584
|
+
A hashed surface draws a share of its points that its alpha sets: half of them at an alpha of 0.5. A hash of each point's place on the mesh picks the points, as three.js's `alphaHash` picks them. So the pattern moves with the object and does not crawl as the camera moves. The hash uses integer math, so every GPU draws the same pattern. three.js's pattern differs from GPU to GPU, so the two engines' patterns differ, but each draws the same share of the surface. Hashed objects draw in any order, as masked ones do. They suit fades and see-through surfaces that cross each other, where blending would need a sort. The pattern is noisy up close. `alphaCutoff` has no effect in this mode.
|
|
585
|
+
|
|
586
|
+
A blended surface lets what lies behind it show through. Blended objects draw after the opaque ones, farthest first, so each one blends over the objects behind it. A call to `mesh.setRenderOrder(order)` draws an object before or after the others, whatever its depth. The rows of an instance batch sort one by one. The page [Materials and pipelines](../concepts/materials.md#the-transparent-pass) explains the sort. It also says where the sort cannot help.
|
|
587
|
+
|
|
588
|
+
A blended material writes depth, as three.js's transparent materials do. Give particles, glows and other surfaces that cross `depthWrite: false`, so they never hide each other.
|
|
589
|
+
|
|
590
|
+
```ts
|
|
591
|
+
// sketch.ts: leaves whose vertex alpha cuts their shape.
|
|
592
|
+
const leaves = materials.standard({ color: '#5bc27a', vertexColors: true, alphaMode: 'mask', alphaCutoff: 0.4 });
|
|
593
|
+
// Later: a lower cutoff grows the leaves, at no cost.
|
|
594
|
+
leaves.set({ alphaCutoff: 0.2 });
|
|
595
|
+
```
|
|
596
|
+
|
|
597
|
+
### Alpha to coverage
|
|
598
|
+
|
|
599
|
+
A masked surface's cut edges are as smooth as its outer edges, as `alphaToCoverage` is on by default. The alpha fades from nothing at `alphaCutoff` to full over about one pixel, as three.js's `alphaToCoverage` makes it fade. MSAA then draws the surface on that share of each edge pixel's samples. Foliage and fences lose their stair steps, and their objects still draw in any order.
|
|
600
|
+
|
|
601
|
+
This is the best technique for cut-out shapes, so it is the default, as in Filament. three.js's `alphaTest` alone cuts hard edges: give `alphaToCoverage: false` for that look. The option needs MSAA, the default anti-aliasing. With FXAA or no anti-aliasing, as on the Low preset, the mask cuts as without it. On WebGPU, where the scene's colors have no alpha channel, the shader sets the covered samples itself, with the same look. The first such material loads the shader builds of alpha to coverage, and the first hashed material those of the hash. To load them before the first frame instead, list `'coverage'` and `'hash'` in `createEngine`'s `preload` option.
|
|
602
|
+
|
|
603
|
+
A [custom material](materials.md#custom-materials) takes both, but only where its WGSL sets or reads the surface's `alpha`. Such a material's shadow caster and motion build run that alpha too, so its shadow and its motion keep the mask's holes. WGSL that never names the alpha throws E1217 for `alphaToCoverage` and for the `hash` mode, and it casts its mesh's whole shape, as it did before.
|
|
604
|
+
|
|
605
|
+
```ts
|
|
606
|
+
// sketch.ts: grass cards whose cut edges MSAA smooths, and a fence with hard pixel edges.
|
|
607
|
+
const grass = materials.standard({ map: grassTexture, alphaMode: 'mask', alphaCutoff: 0.5 });
|
|
608
|
+
const fence = materials.standard({ map: fenceTexture, alphaMode: 'mask', alphaToCoverage: false });
|
|
609
|
+
```
|
|
610
|
+
|
|
611
|
+
## Invisible surfaces that hide
|
|
612
|
+
|
|
613
|
+
`colorWrite: false` draws a surface that shows nothing itself. It still writes depth, so it hides what lies behind it. Its objects draw before the opaque objects that write color, so the depth it writes holds back their color. Use it for a plane that hides the scene behind a page, as three.js's `colorWrite: false` does.
|
|
614
|
+
|
|
615
|
+
With the `mask` or `hash` alpha mode, the parts that the alpha drops write no depth either. The surface then cuts a shape out of the space it holds.
|
|
616
|
+
|
|
617
|
+
A blended surface that writes no color keeps its place among the blended objects, which `setRenderOrder` orders. It hides only the surfaces that draw after it.
|
|
618
|
+
|
|
619
|
+
```ts
|
|
620
|
+
// sketch.ts: a plane at a page's plane, which holds back the frame's faces behind the page.
|
|
621
|
+
const holdout = materials.unlit({ colorWrite: false });
|
|
622
|
+
scene.createMesh({ mesh: geometry.plane({ width: 8, height: 6 }), material: holdout });
|
|
623
|
+
```
|
|
624
|
+
|
|
625
|
+
## Double-sided blended surfaces
|
|
626
|
+
|
|
627
|
+
A blended surface with `doubleSided: true` draws in two draws, as three.js draws it. Its back faces draw first, then its front faces. So the near side of a glass box or a sphere always covers its far side, whatever the order of the mesh's triangles. Neighbors that share the mesh and the material draw together: all their back faces, then all their front faces.
|
|
628
|
+
|
|
629
|
+
`forceSinglePass: true` draws both faces in one draw, as three.js's `forceSinglePass` does. The triangles then cover each other in the mesh's order. Use it for flat surfaces, such as leaves and planes of glass, whose two faces never overlap on screen: it saves one draw per object. The second draw costs about as much as the first, so it is the speed setting for scenes with many double-sided blended objects. Solid double-sided materials always draw once.
|
|
630
|
+
|
|
631
|
+
```ts
|
|
632
|
+
// sketch.ts: a glass globe that shows its far side, and a flat pane that needs one draw.
|
|
633
|
+
const globe = materials.standard({ color: '#a8d8ff', opacity: 0.3, alphaMode: 'blend', doubleSided: true });
|
|
634
|
+
const pane = materials.standard({ color: '#a8d8ff', opacity: 0.3, alphaMode: 'blend', doubleSided: true, forceSinglePass: true });
|
|
635
|
+
```
|
|
636
|
+
|
|
637
|
+
## Blending
|
|
638
|
+
|
|
639
|
+
`blending` says how a blended surface meets what lies behind it. It has an effect with the `blend` alpha mode only.
|
|
640
|
+
|
|
641
|
+
| Blending | What it does | Use it for |
|
|
642
|
+
| --- | --- | --- |
|
|
643
|
+
| `'normal'` | Covers what lies behind, as far as the alpha says | Glass, fading objects, smoke |
|
|
644
|
+
| `'additive'` | Adds the surface's light to what lies behind, times the alpha | Glows, fire, sparks, lasers |
|
|
645
|
+
| `'multiply'` | Tints what lies behind by the surface's color, as far as the alpha says | Stains, shadows painted on, tinted film |
|
|
646
|
+
| `'weighted'` | Covers what lies behind as `'normal'` does, but blends with the other weighted surfaces in any order | Smoke, dust, clouds of particles, many panes of glass that cross |
|
|
647
|
+
|
|
648
|
+
The engine blends colors multiplied by their alpha, as three.js does with `premultipliedAlpha: true`. Textures loaded with `premultipliedAlpha: true` blend correctly too.
|
|
649
|
+
|
|
650
|
+
The engine blends in linear color, before the tone mapping, as three.js's `WebGPURenderer` does. three.js's `WebGLRenderer` tone maps each surface and encodes it as sRGB first, and then blends it on the canvas. So a see-through surface over a different color looks a little lighter in null3D than in a `WebGLRenderer` port, and an additive glow a little weaker. The [8-bit path](../concepts/color-management.md#the-8-bit-path) of some devices tone maps and encodes each surface first too, so there the engine blends as `WebGLRenderer` does.
|
|
651
|
+
|
|
652
|
+
```ts
|
|
653
|
+
// sketch.ts: a pane of glass and a glow that never hides what it crosses.
|
|
654
|
+
const glass = materials.standard({ color: '#a8d8ff', opacity: 0.3, roughness: 0.1, alphaMode: 'blend' });
|
|
655
|
+
const glow = materials.unlit({ color: '#ffb040', alphaMode: 'blend', blending: 'additive', depthWrite: false });
|
|
656
|
+
```
|
|
657
|
+
|
|
658
|
+
### Weighted blending
|
|
659
|
+
|
|
660
|
+
Blended objects draw farthest first, and the sort orders whole objects, or the rows of a batch. Surfaces that cross, a large surface around a small one, and puffs of smoke inside each other have no right order. The sort then puts some of them in the wrong order, and they pop as the camera moves. Additive and multiply blending give the same result in any order, so only normal blending needs the sort.
|
|
661
|
+
|
|
662
|
+
`blending: 'weighted'` blends such surfaces without a sort. The engine uses weighted blended order-independent transparency (McGuire and Bavoil, 2013), as three.js's `OITPassNode` does. Each weighted surface adds its color and its coverage into two targets, in any order, and near surfaces weigh more than far ones. A full-screen step then blends the average color over the scene, as far as the surfaces cover it.
|
|
663
|
+
|
|
664
|
+
```ts
|
|
665
|
+
// sketch.ts: smoke puffs that cross each other, and panes of glass that cross, without popping.
|
|
666
|
+
const smoke = materials.unlit({ color: '#9a9590', opacity: 0.35, alphaMode: 'blend', blending: 'weighted', depthWrite: false });
|
|
667
|
+
const glass = materials.standard({ color: '#a8d8ff', opacity: 0.3, roughness: 0.1, alphaMode: 'blend', blending: 'weighted', doubleSided: true });
|
|
668
|
+
```
|
|
669
|
+
|
|
670
|
+
- The result is an average. Where a dark and a bright surface overlap at a similar depth, both show. The nearest surface shows most. Where an exact order exists, a sorted blend shows it.
|
|
671
|
+
- Weighted surfaces draw as one layer after the camera's other blended surfaces and its surfaces that let light through. They show where nothing nearer wrote depth.
|
|
672
|
+
- A weighted surface writes no depth, and both faces of a double-sided one draw in one draw.
|
|
673
|
+
- The layer draws at one sample per pixel, so MSAA does not smooth the edges of weighted surfaces. Soft surfaces, such as smoke, look the same. FXAA smooths the edges as it smooths the rest.
|
|
674
|
+
- Views other than the camera's, such as [scene passes](render.md#scene-passes) and [reflection passes](render.md#reflection-passes), draw weighted surfaces farthest first, as `'normal'` ones. So do WebGL2 devices that cannot draw into 16-bit float targets, and frames before the layer's shaders have loaded.
|
|
675
|
+
- Materials with `transmission`, custom materials and lines do not take the `weighted` blending. They throw E1217.
|
|
676
|
+
|
|
677
|
+
### Cost of weighted blending
|
|
678
|
+
|
|
679
|
+
The layer costs nothing until the first weighted surface draws, and its shaders download only then. Each frame then draws the camera's weighted surfaces into two targets of the render size, 10 bytes per pixel together. A full-screen step blends them over the scene. With MSAA, the layer first copies one sample of each pixel's depth. The camera's other blended objects and the weighted layer draw in separate render passes. To load the layer's shaders before the first frame, list `'weighted'` in `createEngine`'s `preload` option.
|
|
680
|
+
|
|
681
|
+
### Moment transparency
|
|
682
|
+
|
|
683
|
+
The quality setting `momentTransparency` blends the blended surfaces in a second layer that needs no sort. It is nearer an exact back-to-front blend than the weighted blending on both test scenes: more than twice nearer where five surfaces sit within a few meters, and about two and a half times where they spread over some meters. The engine stores four depth moments of each pixel, then draws the surfaces a second time and weights each fragment's color by the light that the moments say survives in front of it. A last step blends the result over the scene. The fit is exact for one surface and for two, and closest to the exact blend of every method the engine has for overlapping glass, foliage and particles.
|
|
684
|
+
|
|
685
|
+
```ts
|
|
686
|
+
// The page turns the layer on when the engine starts, and every blended material draws in it.
|
|
687
|
+
const engine = await createEngine({ canvas, sketch, momentTransparency: true });
|
|
688
|
+
// Or the engine's own switch does: ?moments=on
|
|
689
|
+
```
|
|
690
|
+
|
|
691
|
+
- The setting covers the standard, basic and sprite materials whose blending is normal or weighted. A surface with another feature that the layer has no shader for, such as `transmission`, a custom material, a line or a masked surface, keeps the transparent pass's sort.
|
|
692
|
+
- The layer draws at one sample per pixel, so MSAA does not smooth its surfaces' edges. SMAA 1x smooths them under the share that the layer covers, and the opaque edges keep MSAA's samples.
|
|
693
|
+
- It costs more than the weighted blending: two draws of the surfaces, 16 bytes per pixel written a frame at the render size, one more full-screen pass, and SMAA's three steps. It is off on every preset, and [Quality presets](../concepts/quality-presets.md#moment-transparency) gives its cost.
|
|
694
|
+
- A page without the setting draws exactly as it does today. Views other than the camera's, and devices that cannot draw into 16-bit float targets, draw blended surfaces farthest first, as `'normal'` ones.
|
|
695
|
+
|
|
696
|
+
## Depth bias
|
|
697
|
+
|
|
698
|
+
`depthBias: { constant, slopeScale }` moves a surface's depth before the depth test. A decal that lies on a wall has the wall's depth, so without a bias the two fight pixel by pixel. Where the depths are exactly equal, no surface is defined to win, and the winner may differ between GPU paths ([The depth prepass](../concepts/quality-presets.md#the-depth-prepass)). A bias toward the camera makes the decal win.
|
|
699
|
+
|
|
700
|
+
| Field | three.js | What it does |
|
|
701
|
+
| --- | --- | --- |
|
|
702
|
+
| `constant` | `polygonOffsetUnits` | Steps of the depth buffer's smallest difference. A fraction rounds to the nearest whole number |
|
|
703
|
+
| `slopeScale` | `polygonOffsetFactor` | A factor of how steeply the surface's depth changes across the screen. It moves surfaces seen at a grazing angle further |
|
|
704
|
+
|
|
705
|
+
Negative values pull the surface toward the camera, and positive values push it away, as in three.js. The engine draws with reversed depth, and it turns the signs for you. Both fields default to 0.
|
|
706
|
+
|
|
707
|
+
```ts
|
|
708
|
+
// sketch.ts: a poster on a wall, as three.js's polygonOffsetFactor: -4, polygonOffsetUnits: -4.
|
|
709
|
+
const poster = materials.standard({ color: '#e8554e', depthBias: { constant: -4, slopeScale: -4 } });
|
|
710
|
+
```
|
|
711
|
+
|
|
712
|
+
## Custom materials
|
|
713
|
+
|
|
714
|
+
`materials.shader(options)` takes every option of `materials.standard` but the texture maps, and a `wgsl` option: WGSL that the null3D Vite plugin compiled. The WGSL declares a surface function, which starts from the look that the standard options make:
|
|
715
|
+
|
|
716
|
+
```ts
|
|
717
|
+
const rings = /* wgsl */ `
|
|
718
|
+
fn surface(input: SurfaceInput) -> Surface {
|
|
719
|
+
var s = defaultSurface(input);
|
|
720
|
+
s.baseColor = mix(s.baseColor, vec3f(1.0), step(0.5, fract(input.uv.y * 6.0)));
|
|
721
|
+
return s;
|
|
722
|
+
}
|
|
723
|
+
`;
|
|
724
|
+
const red = materials.shader({ wgsl: rings, color: '#e04040', roughness: 0.5 });
|
|
725
|
+
red.set({ roughness: 0.2 });
|
|
726
|
+
```
|
|
727
|
+
|
|
728
|
+
A material can add its own specular lobe with `fn lobe(input: LobeInput) -> vec3f`. The engine adds the color it returns to that light's specular, for the main directional light and for each point and spot light. Area lights draw with the base lobe only. [Surface functions](../shaders/surface-functions.md#a-materials-own-lobe) describes the lobe input.
|
|
729
|
+
|
|
730
|
+
A surface function can light the sky's light by a normal of its own, `s.ambientNormal`. A crown then takes its sky light from the gaps above it, and each leaf keeps the sun's light. The field `s.occlusionByMinimum` joins the surface's occlusion with ambient occlusion by the smaller of the two, so an occlusion baked from the same shapes counts once. Only a material whose WGSL names a field builds its code. [Surface functions](../shaders/surface-functions.md#a-normal-for-the-skys-light) describes both fields.
|
|
731
|
+
|
|
732
|
+
The WGSL can declare uniforms as the fields of `struct Uniforms`. The `uniforms` option gives their first values, and `set` changes them with the standard values:
|
|
733
|
+
|
|
734
|
+
```ts
|
|
735
|
+
const tinted = /* wgsl */ `
|
|
736
|
+
struct Uniforms { tint: vec3f, strength: f32 }
|
|
737
|
+
|
|
738
|
+
fn surface(input: SurfaceInput) -> Surface {
|
|
739
|
+
var s = defaultSurface(input);
|
|
740
|
+
s.baseColor = mix(s.baseColor, material.tint, material.strength);
|
|
741
|
+
return s;
|
|
742
|
+
}
|
|
743
|
+
`;
|
|
744
|
+
const paint = materials.shader({ wgsl: tinted, uniforms: { tint: '#ff6a00', strength: 0.5 } });
|
|
745
|
+
paint.set({ strength: 0.8, roughness: 0.3 });
|
|
746
|
+
```
|
|
747
|
+
|
|
748
|
+
TypeScript reads the uniforms' names and types from the WGSL. The `uniforms` option and `set` take only the names that `struct Uniforms` declares. Each name takes a value of its kind, and a misspelled name fails the type check. [Typed uniforms](../guides/custom-shaders.md#typed-uniforms) covers tagged literals and `.wgsl` files.
|
|
749
|
+
|
|
750
|
+
The WGSL can sample up to 6 textures of its own. It declares each one as `var name: texture_2d<f32>;`, and samples it with the sampler `nameSampler`, which the engine declares. The `textures` option gives the textures by name, and they are fixed when the material is created:
|
|
751
|
+
|
|
752
|
+
```ts
|
|
753
|
+
const masked = /* wgsl */ `
|
|
754
|
+
var mask: texture_2d<f32>;
|
|
755
|
+
|
|
756
|
+
fn surface(input: SurfaceInput) -> Surface {
|
|
757
|
+
var s = defaultSurface(input);
|
|
758
|
+
s.alpha *= textureSample(mask, maskSampler, input.uv).g;
|
|
759
|
+
return s;
|
|
760
|
+
}
|
|
761
|
+
`;
|
|
762
|
+
const leaf = await assets.loadTexture('/textures/leaf-mask.png', { colorSpace: 'linear' });
|
|
763
|
+
const leaves = materials.shader({ wgsl: masked, alphaMode: 'mask', textures: { mask: leaf } });
|
|
764
|
+
```
|
|
765
|
+
|
|
766
|
+
The WGSL can also declare a texture array, `var name: texture_2d_array<f32>;`, and pick its layer in the shader, so one array serves a set of facade or window images. The `textures` option then gives a texture of several layers, such as one that `textures.fromData({ width, height, depth: 6, data })` makes. [Textures](../shaders/surface-functions.md#textures) on the Surface functions page gives the rules.
|
|
767
|
+
|
|
768
|
+
A texture samples as white until its image is on the GPU.
|
|
769
|
+
|
|
770
|
+
### The scene behind a surface
|
|
771
|
+
|
|
772
|
+
A surface function can read the depth of the opaque scene behind it. This gives water its shallow color near a shore and its deep color farther out, and foam where a rock nearly touches the surface. Call `sceneDistance(uv)` for the distance in front of the camera of the surface behind the point at the screen's place `uv`, or `sceneDepth(uv)` for its depth value. Declare the input in the `sceneInputs` option:
|
|
773
|
+
|
|
774
|
+
```ts
|
|
775
|
+
const water = /* wgsl */ `
|
|
776
|
+
struct Uniforms { shallow: vec3f, deep: vec3f, foam: vec3f }
|
|
777
|
+
|
|
778
|
+
/// The distance in front of the camera of a depth value, as sceneDistance converts the copy's.
|
|
779
|
+
fn distance_of(depth: f32) -> f32 {
|
|
780
|
+
let near = engine_frame.camera_range.x;
|
|
781
|
+
let far = engine_frame.camera_range.y;
|
|
782
|
+
if engine_frame.camera_position.w > 0.5 {
|
|
783
|
+
return near * far / (near + depth * (far - near));
|
|
784
|
+
}
|
|
785
|
+
return far - depth * (far - near);
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
fn surface(input: SurfaceInput) -> Surface {
|
|
789
|
+
var s = defaultSurface(input);
|
|
790
|
+
let uv = input.fragCoord.xy / frame.resolution;
|
|
791
|
+
// The water's depth along the view ray: the gap to the surface behind the sheet.
|
|
792
|
+
let gap = max(sceneDistance(uv) - distance_of(input.fragCoord.z), 0.0);
|
|
793
|
+
s.baseColor = mix(material.shallow, material.deep, smoothstep(0.05, 1.5, gap));
|
|
794
|
+
s.baseColor = mix(s.baseColor, material.foam, 1.0 - smoothstep(0.0, 0.12, gap));
|
|
795
|
+
s.alpha = smoothstep(0.0, 0.12, gap);
|
|
796
|
+
return s;
|
|
797
|
+
}
|
|
798
|
+
`;
|
|
799
|
+
const sheet = materials.shader({
|
|
800
|
+
wgsl: water,
|
|
801
|
+
sceneInputs: ['sceneDepth'],
|
|
802
|
+
alphaMode: 'blend',
|
|
803
|
+
depthWrite: false,
|
|
804
|
+
uniforms: { shallow: '#8fe0d2', deep: '#0b4a63', foam: '#f2fbff' },
|
|
805
|
+
});
|
|
806
|
+
```
|
|
807
|
+
|
|
808
|
+
- `sceneDepth(uv)` gives the scene's depth with 1 at the camera's near plane and 0 at its far plane, and 0 where nothing drew.
|
|
809
|
+
- `sceneDistance(uv)` gives the distance in front of the camera of that surface, in world units.
|
|
810
|
+
- The water's depth is the gap between the sheet and the surface behind it. Convert the sheet's own depth, `input.fragCoord.z`, to a distance with `engine_frame.camera_range`, and subtract it from `sceneDistance(uv)`. A shore that fades over that gap ends softly against the bank instead of on the sheet's edge.
|
|
811
|
+
- `input.fragCoord` counts pixels from the top left of the render target on both GPU paths, so `input.fragCoord.xy / frame.resolution` is the `uv` of the point.
|
|
812
|
+
- The engine copies the opaque scene's depth after the opaque pass and before the transparent pass. A blended surface therefore reads the surfaces behind it.
|
|
813
|
+
- A surface in the opaque pass reads 0, the far plane, because the copy comes later. A surface in a scene pass or a reflection pass reads 0 too, because its view makes no copy.
|
|
814
|
+
- The copy is made while a material that declares the input draws, whatever the quality preset says. It costs one full-screen pass and one texture of four bytes for each pixel.
|
|
815
|
+
- On WebGL2 the copy holds the depth that the device stores. Where the device draws `reversed-gl` depth, `sceneDistance` is less precise. The engine draws `reversed` depth where the browser has `EXT_clip_control`.
|
|
816
|
+
- A material that reads the scene's depth takes up to seven textures of its own: its maps' group gives up one slot, so that the copy of the depth fits the fragment stage beside the maps under WebGPU's limit of 16 sampled textures. A material that declares eight textures beside the depth is refused, and development builds throw E1217 and name how many to drop.
|
|
817
|
+
- The declaration and the WGSL must agree. Development builds throw E1217 for a declaration that the WGSL never uses, and for WGSL that reads the depth without the declaration. They throw it for a scene input that custom materials do not read yet too.
|
|
818
|
+
|
|
819
|
+
[Surface functions](../shaders/surface-functions.md#the-scenes-depth) shows the helpers among the WGSL.
|
|
820
|
+
|
|
821
|
+
A surface function can set a clear coat and a sheen too, such as a coat where a stone is wet. The WGSL sets the surface's `clearcoat`, `clearcoatRoughness`, `clearcoatNormal`, `sheenColor`, `sheenRoughness`, `iridescence`, `iridescenceIor` or `iridescenceThickness`. Only WGSL that names one of them has the shaders that light the layers. The layer options of such a material give `defaultSurface` its values, and WGSL that never names them throws E1217 when you give it a layer option. [Layers](../shaders/surface-functions.md#clear-coat-and-sheen) on the Surface functions page shows the WGSL.
|
|
822
|
+
|
|
823
|
+
### Values per row of a batch
|
|
824
|
+
|
|
825
|
+
The WGSL reads values of each draw through `frame`, `camera` and `object` ([Built-in values](../shaders/builtins.md)). On the rows of an instance batch made with `values: true`, `object.values` holds the row's four numbers from the batch's `values` array. So one material can sway each blade of grass in its own phase, and tint each one:
|
|
826
|
+
|
|
827
|
+
```ts
|
|
828
|
+
const sway = /* wgsl */ `
|
|
829
|
+
fn vertexOffset(input: VertexInput) -> vec3f {
|
|
830
|
+
return vec3f(sin(frame.time + object.values.x) * 0.2 * input.uv.y, 0.0, 0.0);
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
fn surface(input: SurfaceInput) -> Surface {
|
|
834
|
+
var s = defaultSurface(input);
|
|
835
|
+
s.baseColor *= mix(vec3f(0.3, 0.6, 0.1), vec3f(0.8, 0.7, 0.2), object.values.y);
|
|
836
|
+
return s;
|
|
837
|
+
}
|
|
838
|
+
`;
|
|
839
|
+
const grass = materials.shader({ wgsl: sway, doubleSided: true });
|
|
840
|
+
```
|
|
841
|
+
|
|
842
|
+
A batch made with `colors: true` tints each row by its color in every material, as vertex colors do: `defaultSurface` takes it in `input.vertexColor`. [Instances and batching](../concepts/instances.md#per-row-values) shows a whole sketch.
|
|
843
|
+
|
|
844
|
+
A material with a vertex offset moves its shadows too: its casters draw with the offset, so the shadows of swaying grass sway with it. Such casters draw again in every frame that a shadow map draws, as moving objects do. A material whose offsets follow only the view that draws the object, such as a card that turns toward the camera, declares `castsStill: true`. Its casters then hold the shadow that the light's layer drew until the light turns, and the far shadow cascades stay cached.
|
|
845
|
+
|
|
846
|
+
An offset that fades out with distance, such as wind, declares `swayDistance`: the distance from the camera out to which the offset moves. The material's WGSL fades its offset to nothing by that distance, and the engine counts a caster of the material as moving only while its bounding sphere reaches within it. A plant past the distance stands still, so a far shadow cascade that only its sway reached keeps the layer it holds. Leave it out for an offset that moves at every distance.
|
|
847
|
+
|
|
848
|
+
A masked custom material cuts its shadow at its cutoff only when its WGSL declares `fn coverage(input: SurfaceInput) -> f32`. The function returns the opacity of the point, and the engine calls it in the material's shadow caster builds, so a card casts the shape of the object it shows rather than its whole quad. A material that declares neither a coverage function nor a surface alpha casts its mesh's whole shape, whatever its mask. WGSL that declares a vertex offset, a coverage function or the surface's alpha gets the caster builds; a material with none casts through the engine's own depth template. A flat caster draws both faces, or it casts nothing: the shadow pass culls the front faces of single-sided geometry, so a single-sided quad is culled whole. Give a material whose caster is flat geometry `doubleSided: true`. The caster tests the coverage under the material's `alphaCutoff`, so it needs the `mask` alpha mode: a development build refuses a coverage function on a material that is not masked, because its caster would drop no texel and cast the whole shape.
|
|
849
|
+
|
|
850
|
+
A surface function can move where the sun's shadow lookup reads by setting `s.shadowOffset`, a position in world space relative to the surface. A stand-in card sets it to the surface that its stored depth shows, so its own cast does not fall on it. [Surface functions](../shaders/surface-functions.md#shadows) shows the WGSL.
|
|
851
|
+
|
|
852
|
+
### Mirrors, polished floors and water
|
|
853
|
+
|
|
854
|
+
A custom material can reflect a [reflection pass](render.md#reflection-passes). Its surface function reads the pass's texture where the surface shows on the screen, and sets the surface's `reflection`. The engine lights that color as the light from the mirror direction. The material's Fresnel, metalness and specular values weigh it as they weigh the environment's reflection. [Surface functions](../shaders/surface-functions.md#reflections) shows the WGSL, and [Custom passes](../guides/custom-passes.md#a-water-recipe) a water recipe. Standard materials take no reflection in this version: give a polished floor a custom material with the floor's values.
|
|
855
|
+
|
|
856
|
+
With `alphaMode: 'mask'`, the pixels where the surface function's `alpha` falls below `alphaCutoff` draw nothing. Materials made from the same WGSL share one shader, and each has its own uniforms. A mesh needs texture coordinates to draw with a custom material. WGSL as plain text, which the plugin did not compile, throws E1215. So does a whole shader that is not a [full shader](../guides/custom-shaders.md#full-shaders) of a material. A uniform or a texture that the WGSL does not declare, or a value of the wrong kind, throws E1216. The WGSL can also move the mesh's vertices with a vertex offset. [Surface functions](../shaders/surface-functions.md) describes the WGSL.
|
|
857
|
+
|
|
858
|
+
## Ranges
|
|
859
|
+
|
|
860
|
+
`opacity`, `alphaCutoff`, `metalness`, `roughness`, `aoMapIntensity`, `transmission`, `diffuseTransmission`, `clearcoat`, `clearcoatRoughness`, `sheenRoughness` and `edgeFade` go from 0 to 1, and `emissiveIntensity`, `lightMapIntensity`, `thickness` and `subsurfaceRadius` take 0 or more. `attenuationDistance` takes more than 0. The two angles of `angleFade` go from 0 to π, the first no larger than the second. The numbers of `normalScale`, `clearcoatNormalScale`, `uvTransform`, `mapUvTransforms`, `bumpScale`, `displacementScale` and `displacementBias` must be finite. When a factory or `set` gets a value outside its range, development builds throw E1108. An `alphaMode` or a `blending` that the engine does not know throws E1217. So does the `weighted` blending on a custom material or a material with `transmission`. A depth bias that is not a finite number throws E1203. The `opaque` alpha mode ignores the opacity.
|
|
861
|
+
|
|
862
|
+
## Limits
|
|
863
|
+
|
|
864
|
+
One engine holds up to 1,024 materials at once. One more throws E1501. A material lasts until `destroy`, or as long as the engine. Create materials once in the setup and share them, and never create one per object or per frame.
|
|
865
|
+
|
|
866
|
+
## Related pages
|
|
867
|
+
|
|
868
|
+
- [Scene](scene.md): creating meshes with a material.
|
|
869
|
+
- [Objects and transforms](objects.md): `setMaterial` on a mesh.
|
|
870
|
+
- [Lights](lights.md): what lights a standard material.
|
|
871
|
+
- [Surface functions](../shaders/surface-functions.md): the WGSL of a custom material.
|
|
872
|
+
- [Math helpers](math.md#colors): sRGB and linear colors.
|
|
873
|
+
|
|
874
|
+
## API reference
|
|
875
|
+
|
|
876
|
+
[The API reference](reference/materials.md) lists every export of this page with its type and description. The engine's doc comments make it.
|