@luma.gl/shaders 0.0.0-stage → 10.0.0-alpha.11
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 +38 -0
- package/README.md +25 -2
- package/dist/dist.dev.js +21598 -0
- package/dist/dist.min.js +13439 -0
- package/dist/glsl.cjs +33 -0
- package/dist/glsl.cjs.map +6 -0
- package/dist/glsl.d.ts +6 -0
- package/dist/glsl.d.ts.map +1 -0
- package/dist/glsl.js +7 -0
- package/dist/glsl.js.map +1 -0
- package/dist/index.cjs +278 -0
- package/dist/index.cjs.map +6 -0
- package/dist/index.d.ts +108 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +74 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/color/normalize-byte-colors.cjs +50 -0
- package/dist/lib/color/normalize-byte-colors.d.ts +23 -0
- package/dist/lib/color/normalize-byte-colors.d.ts.map +1 -0
- package/dist/lib/color/normalize-byte-colors.js +42 -0
- package/dist/lib/color/normalize-byte-colors.js.map +1 -0
- package/dist/lib/filters/prop-types.cjs +90 -0
- package/dist/lib/filters/prop-types.d.ts +44 -0
- package/dist/lib/filters/prop-types.d.ts.map +1 -0
- package/dist/lib/filters/prop-types.js +96 -0
- package/dist/lib/filters/prop-types.js.map +1 -0
- package/dist/lib/glsl-shader-assembler.cjs +50 -0
- package/dist/lib/glsl-shader-assembler.d.ts +19 -0
- package/dist/lib/glsl-shader-assembler.d.ts.map +1 -0
- package/dist/lib/glsl-shader-assembler.js +29 -0
- package/dist/lib/glsl-shader-assembler.js.map +1 -0
- package/dist/lib/glsl-utils/get-shader-info.cjs +52 -0
- package/dist/lib/glsl-utils/get-shader-info.d.ts +9 -0
- package/dist/lib/glsl-utils/get-shader-info.d.ts.map +1 -0
- package/dist/lib/glsl-utils/get-shader-info.js +33 -0
- package/dist/lib/glsl-utils/get-shader-info.js.map +1 -0
- package/dist/lib/glsl-utils/shader-utils.cjs +126 -0
- package/dist/lib/glsl-utils/shader-utils.d.ts +23 -0
- package/dist/lib/glsl-utils/shader-utils.d.ts.map +1 -0
- package/dist/lib/glsl-utils/shader-utils.js +92 -0
- package/dist/lib/glsl-utils/shader-utils.js.map +1 -0
- package/dist/lib/preprocessor/preprocessor.cjs +128 -0
- package/dist/lib/preprocessor/preprocessor.d.ts +15 -0
- package/dist/lib/preprocessor/preprocessor.d.ts.map +1 -0
- package/dist/lib/preprocessor/preprocessor.js +120 -0
- package/dist/lib/preprocessor/preprocessor.js.map +1 -0
- package/dist/lib/shader-assembler-base.cjs +132 -0
- package/dist/lib/shader-assembler-base.d.ts +51 -0
- package/dist/lib/shader-assembler-base.d.ts.map +1 -0
- package/dist/lib/shader-assembler-base.js +127 -0
- package/dist/lib/shader-assembler-base.js.map +1 -0
- package/dist/lib/shader-assembler.cjs +33 -0
- package/dist/lib/shader-assembler.d.ts +4 -0
- package/dist/lib/shader-assembler.d.ts.map +1 -0
- package/dist/lib/shader-assembler.js +7 -0
- package/dist/lib/shader-assembler.js.map +1 -0
- package/dist/lib/shader-assembly/assemble-glsl-shaders.cjs +181 -0
- package/dist/lib/shader-assembly/assemble-glsl-shaders.d.ts +70 -0
- package/dist/lib/shader-assembly/assemble-glsl-shaders.d.ts.map +1 -0
- package/dist/lib/shader-assembly/assemble-glsl-shaders.js +208 -0
- package/dist/lib/shader-assembly/assemble-glsl-shaders.js.map +1 -0
- package/dist/lib/shader-assembly/assemble-shaders.cjs +42 -0
- package/dist/lib/shader-assembly/assemble-shaders.d.ts +10 -0
- package/dist/lib/shader-assembly/assemble-shaders.d.ts.map +1 -0
- package/dist/lib/shader-assembly/assemble-shaders.js +10 -0
- package/dist/lib/shader-assembly/assemble-shaders.js.map +1 -0
- package/dist/lib/shader-assembly/assemble-wgsl-shaders.cjs +498 -0
- package/dist/lib/shader-assembly/assemble-wgsl-shaders.d.ts +70 -0
- package/dist/lib/shader-assembly/assemble-wgsl-shaders.d.ts.map +1 -0
- package/dist/lib/shader-assembly/assemble-wgsl-shaders.js +480 -0
- package/dist/lib/shader-assembly/assemble-wgsl-shaders.js.map +1 -0
- package/dist/lib/shader-assembly/platform-defines.cjs +79 -0
- package/dist/lib/shader-assembly/platform-defines.d.ts +4 -0
- package/dist/lib/shader-assembly/platform-defines.d.ts.map +1 -0
- package/dist/lib/shader-assembly/platform-defines.js +52 -0
- package/dist/lib/shader-assembly/platform-defines.js.map +1 -0
- package/dist/lib/shader-assembly/platform-info.cjs +15 -0
- package/dist/lib/shader-assembly/platform-info.d.ts +20 -0
- package/dist/lib/shader-assembly/platform-info.d.ts.map +1 -0
- package/dist/lib/shader-assembly/platform-info.js +5 -0
- package/dist/lib/shader-assembly/platform-info.js.map +1 -0
- package/dist/lib/shader-assembly/shader-assembly-shared.cjs +96 -0
- package/dist/lib/shader-assembly/shader-assembly-shared.d.ts +16 -0
- package/dist/lib/shader-assembly/shader-assembly-shared.d.ts.map +1 -0
- package/dist/lib/shader-assembly/shader-assembly-shared.js +79 -0
- package/dist/lib/shader-assembly/shader-assembly-shared.js.map +1 -0
- package/dist/lib/shader-assembly/shader-assembly-types.cjs +15 -0
- package/dist/lib/shader-assembly/shader-assembly-types.d.ts +132 -0
- package/dist/lib/shader-assembly/shader-assembly-types.d.ts.map +1 -0
- package/dist/lib/shader-assembly/shader-assembly-types.js +5 -0
- package/dist/lib/shader-assembly/shader-assembly-types.js.map +1 -0
- package/dist/lib/shader-assembly/shader-injection-targets.cjs +103 -0
- package/dist/lib/shader-assembly/shader-injection-targets.d.ts +46 -0
- package/dist/lib/shader-assembly/shader-injection-targets.d.ts.map +1 -0
- package/dist/lib/shader-assembly/shader-injection-targets.js +83 -0
- package/dist/lib/shader-assembly/shader-injection-targets.js.map +1 -0
- package/dist/lib/shader-assembly/shader-injections.cjs +204 -0
- package/dist/lib/shader-assembly/shader-injections.d.ts +49 -0
- package/dist/lib/shader-assembly/shader-injections.d.ts.map +1 -0
- package/dist/lib/shader-assembly/shader-injections.js +207 -0
- package/dist/lib/shader-assembly/shader-injections.js.map +1 -0
- package/dist/lib/shader-assembly/shader-plugin-varyings.cjs +434 -0
- package/dist/lib/shader-assembly/shader-plugin-varyings.d.ts +15 -0
- package/dist/lib/shader-assembly/shader-plugin-varyings.d.ts.map +1 -0
- package/dist/lib/shader-assembly/shader-plugin-varyings.js +438 -0
- package/dist/lib/shader-assembly/shader-plugin-varyings.js.map +1 -0
- package/dist/lib/shader-assembly/shader-plugin-vertex-inputs.cjs +254 -0
- package/dist/lib/shader-assembly/shader-plugin-vertex-inputs.d.ts +12 -0
- package/dist/lib/shader-assembly/shader-plugin-vertex-inputs.d.ts.map +1 -0
- package/dist/lib/shader-assembly/shader-plugin-vertex-inputs.js +237 -0
- package/dist/lib/shader-assembly/shader-plugin-vertex-inputs.js.map +1 -0
- package/dist/lib/shader-assembly/wgsl-binding-debug.cjs +166 -0
- package/dist/lib/shader-assembly/wgsl-binding-debug.d.ts +37 -0
- package/dist/lib/shader-assembly/wgsl-binding-debug.d.ts.map +1 -0
- package/dist/lib/shader-assembly/wgsl-binding-debug.js +144 -0
- package/dist/lib/shader-assembly/wgsl-binding-debug.js.map +1 -0
- package/dist/lib/shader-assembly/wgsl-binding-scan.cjs +184 -0
- package/dist/lib/shader-assembly/wgsl-binding-scan.d.ts +19 -0
- package/dist/lib/shader-assembly/wgsl-binding-scan.d.ts.map +1 -0
- package/dist/lib/shader-assembly/wgsl-binding-scan.js +151 -0
- package/dist/lib/shader-assembly/wgsl-binding-scan.js.map +1 -0
- package/dist/lib/shader-assembly/wgsl-injection-target-names.cjs +163 -0
- package/dist/lib/shader-assembly/wgsl-injection-target-names.d.ts +8 -0
- package/dist/lib/shader-assembly/wgsl-injection-target-names.d.ts.map +1 -0
- package/dist/lib/shader-assembly/wgsl-injection-target-names.js +145 -0
- package/dist/lib/shader-assembly/wgsl-injection-target-names.js.map +1 -0
- package/dist/lib/shader-assembly/wgsl-interface-scan.cjs +502 -0
- package/dist/lib/shader-assembly/wgsl-interface-scan.d.ts +14 -0
- package/dist/lib/shader-assembly/wgsl-interface-scan.d.ts.map +1 -0
- package/dist/lib/shader-assembly/wgsl-interface-scan.js +498 -0
- package/dist/lib/shader-assembly/wgsl-interface-scan.js.map +1 -0
- package/dist/lib/shader-generator/generate-shader.cjs +36 -0
- package/dist/lib/shader-generator/generate-shader.d.ts +8 -0
- package/dist/lib/shader-generator/generate-shader.d.ts.map +1 -0
- package/dist/lib/shader-generator/generate-shader.js +15 -0
- package/dist/lib/shader-generator/generate-shader.js.map +1 -0
- package/dist/lib/shader-generator/glsl/generate-glsl.cjs +94 -0
- package/dist/lib/shader-generator/glsl/generate-glsl.d.ts +7 -0
- package/dist/lib/shader-generator/glsl/generate-glsl.d.ts.map +1 -0
- package/dist/lib/shader-generator/glsl/generate-glsl.js +79 -0
- package/dist/lib/shader-generator/glsl/generate-glsl.js.map +1 -0
- package/dist/lib/shader-generator/utils/capitalize.cjs +29 -0
- package/dist/lib/shader-generator/utils/capitalize.d.ts +7 -0
- package/dist/lib/shader-generator/utils/capitalize.d.ts.map +1 -0
- package/dist/lib/shader-generator/utils/capitalize.js +12 -0
- package/dist/lib/shader-generator/utils/capitalize.js.map +1 -0
- package/dist/lib/shader-generator/wgsl/generate-wgsl.cjs +46 -0
- package/dist/lib/shader-generator/wgsl/generate-wgsl.d.ts +7 -0
- package/dist/lib/shader-generator/wgsl/generate-wgsl.d.ts.map +1 -0
- package/dist/lib/shader-generator/wgsl/generate-wgsl.js +23 -0
- package/dist/lib/shader-generator/wgsl/generate-wgsl.js.map +1 -0
- package/dist/lib/shader-module/composite-shader-pass.cjs +15 -0
- package/dist/lib/shader-module/composite-shader-pass.d.ts +41 -0
- package/dist/lib/shader-module/composite-shader-pass.d.ts.map +1 -0
- package/dist/lib/shader-module/composite-shader-pass.js +5 -0
- package/dist/lib/shader-module/composite-shader-pass.js.map +1 -0
- package/dist/lib/shader-module/shader-module-dependencies.cjs +83 -0
- package/dist/lib/shader-module/shader-module-dependencies.d.ts +39 -0
- package/dist/lib/shader-module/shader-module-dependencies.d.ts.map +1 -0
- package/dist/lib/shader-module/shader-module-dependencies.js +103 -0
- package/dist/lib/shader-module/shader-module-dependencies.js.map +1 -0
- package/dist/lib/shader-module/shader-module-uniform-layout.cjs +224 -0
- package/dist/lib/shader-module/shader-module-uniform-layout.d.ts +91 -0
- package/dist/lib/shader-module/shader-module-uniform-layout.d.ts.map +1 -0
- package/dist/lib/shader-module/shader-module-uniform-layout.js +253 -0
- package/dist/lib/shader-module/shader-module-uniform-layout.js.map +1 -0
- package/dist/lib/shader-module/shader-module.cjs +99 -0
- package/dist/lib/shader-module/shader-module.d.ts +94 -0
- package/dist/lib/shader-module/shader-module.d.ts.map +1 -0
- package/dist/lib/shader-module/shader-module.js +101 -0
- package/dist/lib/shader-module/shader-module.js.map +1 -0
- package/dist/lib/shader-module/shader-pass.cjs +15 -0
- package/dist/lib/shader-module/shader-pass.d.ts +48 -0
- package/dist/lib/shader-module/shader-pass.d.ts.map +1 -0
- package/dist/lib/shader-module/shader-pass.js +5 -0
- package/dist/lib/shader-module/shader-pass.js.map +1 -0
- package/dist/lib/shader-plugin.cjs +156 -0
- package/dist/lib/shader-plugin.d.ts +61 -0
- package/dist/lib/shader-plugin.d.ts.map +1 -0
- package/dist/lib/shader-plugin.js +147 -0
- package/dist/lib/shader-plugin.js.map +1 -0
- package/dist/lib/shader-transpiler/shader-transpiler.cjs +15 -0
- package/dist/lib/shader-transpiler/shader-transpiler.d.ts +27 -0
- package/dist/lib/shader-transpiler/shader-transpiler.d.ts.map +1 -0
- package/dist/lib/shader-transpiler/shader-transpiler.js +5 -0
- package/dist/lib/shader-transpiler/shader-transpiler.js.map +1 -0
- package/dist/lib/shader-transpiler/transpile-glsl-shader.cjs +71 -0
- package/dist/lib/shader-transpiler/transpile-glsl-shader.d.ts +9 -0
- package/dist/lib/shader-transpiler/transpile-glsl-shader.d.ts.map +1 -0
- package/dist/lib/shader-transpiler/transpile-glsl-shader.js +69 -0
- package/dist/lib/shader-transpiler/transpile-glsl-shader.js.map +1 -0
- package/dist/lib/utils/assert.cjs +34 -0
- package/dist/lib/utils/assert.d.ts +2 -0
- package/dist/lib/utils/assert.d.ts.map +1 -0
- package/dist/lib/utils/assert.js +13 -0
- package/dist/lib/utils/assert.js.map +1 -0
- package/dist/lib/utils/uniform-types.cjs +15 -0
- package/dist/lib/utils/uniform-types.d.ts +18 -0
- package/dist/lib/utils/uniform-types.d.ts.map +1 -0
- package/dist/lib/utils/uniform-types.js +5 -0
- package/dist/lib/utils/uniform-types.js.map +1 -0
- package/dist/lib/wgsl-shader-assembler.cjs +99 -0
- package/dist/lib/wgsl-shader-assembler.d.ts +34 -0
- package/dist/lib/wgsl-shader-assembler.d.ts.map +1 -0
- package/dist/lib/wgsl-shader-assembler.js +84 -0
- package/dist/lib/wgsl-shader-assembler.js.map +1 -0
- package/dist/module-injectors.cjs +59 -0
- package/dist/module-injectors.d.ts +3 -0
- package/dist/module-injectors.d.ts.map +1 -0
- package/dist/module-injectors.js +31 -0
- package/dist/module-injectors.js.map +1 -0
- package/dist/modules/color/float-colors.cjs +275 -0
- package/dist/modules/color/float-colors.d.ts +132 -0
- package/dist/modules/color/float-colors.d.ts.map +1 -0
- package/dist/modules/color/float-colors.js +248 -0
- package/dist/modules/color/float-colors.js.map +1 -0
- package/dist/modules/engine/clip/clip.cjs +142 -0
- package/dist/modules/engine/clip/clip.d.ts +12 -0
- package/dist/modules/engine/clip/clip.d.ts.map +1 -0
- package/dist/modules/engine/clip/clip.js +119 -0
- package/dist/modules/engine/clip/clip.js.map +1 -0
- package/dist/modules/engine/filter/filter.cjs +103 -0
- package/dist/modules/engine/filter/filter.d.ts +12 -0
- package/dist/modules/engine/filter/filter.d.ts.map +1 -0
- package/dist/modules/engine/filter/filter.js +80 -0
- package/dist/modules/engine/filter/filter.js.map +1 -0
- package/dist/modules/engine/geometry/geometry.cjs +63 -0
- package/dist/modules/engine/geometry/geometry.d.ts +9 -0
- package/dist/modules/engine/geometry/geometry.d.ts.map +1 -0
- package/dist/modules/engine/geometry/geometry.js +42 -0
- package/dist/modules/engine/geometry/geometry.js.map +1 -0
- package/dist/modules/engine/gpu-animation/gpu-animation.cjs +255 -0
- package/dist/modules/engine/gpu-animation/gpu-animation.d.ts +34 -0
- package/dist/modules/engine/gpu-animation/gpu-animation.d.ts.map +1 -0
- package/dist/modules/engine/gpu-animation/gpu-animation.js +228 -0
- package/dist/modules/engine/gpu-animation/gpu-animation.js.map +1 -0
- package/dist/modules/engine/picking/picking.cjs +210 -0
- package/dist/modules/engine/picking/picking.d.ts +77 -0
- package/dist/modules/engine/picking/picking.d.ts.map +1 -0
- package/dist/modules/engine/picking/picking.js +198 -0
- package/dist/modules/engine/picking/picking.js.map +1 -0
- package/dist/modules/engine/project/project.cjs +138 -0
- package/dist/modules/engine/project/project.d.ts +39 -0
- package/dist/modules/engine/project/project.d.ts.map +1 -0
- package/dist/modules/engine/project/project.js +129 -0
- package/dist/modules/engine/project/project.js.map +1 -0
- package/dist/modules/engine/skin/skin.cjs +212 -0
- package/dist/modules/engine/skin/skin.d.ts +52 -0
- package/dist/modules/engine/skin/skin.d.ts.map +1 -0
- package/dist/modules/engine/skin/skin.js +179 -0
- package/dist/modules/engine/skin/skin.js.map +1 -0
- package/dist/modules/engine/transform/transform.cjs +72 -0
- package/dist/modules/engine/transform/transform.d.ts +6 -0
- package/dist/modules/engine/transform/transform.d.ts.map +1 -0
- package/dist/modules/engine/transform/transform.js +49 -0
- package/dist/modules/engine/transform/transform.js.map +1 -0
- package/dist/modules/geometry/path-dash/path-dash.cjs +93 -0
- package/dist/modules/geometry/path-dash/path-dash.d.ts +10 -0
- package/dist/modules/geometry/path-dash/path-dash.d.ts.map +1 -0
- package/dist/modules/geometry/path-dash/path-dash.js +66 -0
- package/dist/modules/geometry/path-dash/path-dash.js.map +1 -0
- package/dist/modules/geometry/pattern-fill/pattern-fill-shaders.cjs +117 -0
- package/dist/modules/geometry/pattern-fill/pattern-fill-shaders.d.ts +3 -0
- package/dist/modules/geometry/pattern-fill/pattern-fill-shaders.d.ts.map +1 -0
- package/dist/modules/geometry/pattern-fill/pattern-fill-shaders.js +87 -0
- package/dist/modules/geometry/pattern-fill/pattern-fill-shaders.js.map +1 -0
- package/dist/modules/geometry/pattern-fill/pattern-fill.cjs +64 -0
- package/dist/modules/geometry/pattern-fill/pattern-fill.d.ts +14 -0
- package/dist/modules/geometry/pattern-fill/pattern-fill.d.ts.map +1 -0
- package/dist/modules/geometry/pattern-fill/pattern-fill.js +43 -0
- package/dist/modules/geometry/pattern-fill/pattern-fill.js.map +1 -0
- package/dist/modules/geometry/point-glow/point-glow.cjs +104 -0
- package/dist/modules/geometry/point-glow/point-glow.d.ts +11 -0
- package/dist/modules/geometry/point-glow/point-glow.d.ts.map +1 -0
- package/dist/modules/geometry/point-glow/point-glow.js +77 -0
- package/dist/modules/geometry/point-glow/point-glow.js.map +1 -0
- package/dist/modules/geometry/precipitation/precipitation.cjs +122 -0
- package/dist/modules/geometry/precipitation/precipitation.d.ts +40 -0
- package/dist/modules/geometry/precipitation/precipitation.d.ts.map +1 -0
- package/dist/modules/geometry/precipitation/precipitation.js +95 -0
- package/dist/modules/geometry/precipitation/precipitation.js.map +1 -0
- package/dist/modules/geometry/sketch-stroke/sketch-stroke.cjs +158 -0
- package/dist/modules/geometry/sketch-stroke/sketch-stroke.d.ts +60 -0
- package/dist/modules/geometry/sketch-stroke/sketch-stroke.d.ts.map +1 -0
- package/dist/modules/geometry/sketch-stroke/sketch-stroke.js +137 -0
- package/dist/modules/geometry/sketch-stroke/sketch-stroke.js.map +1 -0
- package/dist/modules/geospatial/dggs/dggs-wgsl.cjs +2304 -0
- package/dist/modules/geospatial/dggs/dggs-wgsl.d.ts +3 -0
- package/dist/modules/geospatial/dggs/dggs-wgsl.d.ts.map +1 -0
- package/dist/modules/geospatial/dggs/dggs-wgsl.js +2283 -0
- package/dist/modules/geospatial/dggs/dggs-wgsl.js.map +1 -0
- package/dist/modules/geospatial/dggs/dggs.cjs +31 -0
- package/dist/modules/geospatial/dggs/dggs.d.ts +6 -0
- package/dist/modules/geospatial/dggs/dggs.d.ts.map +1 -0
- package/dist/modules/geospatial/dggs/dggs.js +10 -0
- package/dist/modules/geospatial/dggs/dggs.js.map +1 -0
- package/dist/modules/lighting/area-lighting/area-light-types.cjs +68 -0
- package/dist/modules/lighting/area-lighting/area-light-types.d.ts +34 -0
- package/dist/modules/lighting/area-lighting/area-light-types.d.ts.map +1 -0
- package/dist/modules/lighting/area-lighting/area-light-types.js +40 -0
- package/dist/modules/lighting/area-lighting/area-light-types.js.map +1 -0
- package/dist/modules/lighting/area-lighting/area-lighting-shaders.cjs +101 -0
- package/dist/modules/lighting/area-lighting/area-lighting-shaders.d.ts +3 -0
- package/dist/modules/lighting/area-lighting/area-lighting-shaders.d.ts.map +1 -0
- package/dist/modules/lighting/area-lighting/area-lighting-shaders.js +71 -0
- package/dist/modules/lighting/area-lighting/area-lighting-shaders.js.map +1 -0
- package/dist/modules/lighting/area-lighting/area-lighting.cjs +62 -0
- package/dist/modules/lighting/area-lighting/area-lighting.d.ts +89 -0
- package/dist/modules/lighting/area-lighting/area-lighting.d.ts.map +1 -0
- package/dist/modules/lighting/area-lighting/area-lighting.js +41 -0
- package/dist/modules/lighting/area-lighting/area-lighting.js.map +1 -0
- package/dist/modules/lighting/area-lighting/ltc-shaders.cjs +192 -0
- package/dist/modules/lighting/area-lighting/ltc-shaders.d.ts +3 -0
- package/dist/modules/lighting/area-lighting/ltc-shaders.d.ts.map +1 -0
- package/dist/modules/lighting/area-lighting/ltc-shaders.js +162 -0
- package/dist/modules/lighting/area-lighting/ltc-shaders.js.map +1 -0
- package/dist/modules/lighting/atmosphere/atmosphere.cjs +253 -0
- package/dist/modules/lighting/atmosphere/atmosphere.d.ts +45 -0
- package/dist/modules/lighting/atmosphere/atmosphere.d.ts.map +1 -0
- package/dist/modules/lighting/atmosphere/atmosphere.js +228 -0
- package/dist/modules/lighting/atmosphere/atmosphere.js.map +1 -0
- package/dist/modules/lighting/clouds/clouds.cjs +216 -0
- package/dist/modules/lighting/clouds/clouds.d.ts +58 -0
- package/dist/modules/lighting/clouds/clouds.d.ts.map +1 -0
- package/dist/modules/lighting/clouds/clouds.js +192 -0
- package/dist/modules/lighting/clouds/clouds.js.map +1 -0
- package/dist/modules/lighting/clustered-light-grid/clustered-light-grid.cjs +40 -0
- package/dist/modules/lighting/clustered-light-grid/clustered-light-grid.d.ts +6 -0
- package/dist/modules/lighting/clustered-light-grid/clustered-light-grid.d.ts.map +1 -0
- package/dist/modules/lighting/clustered-light-grid/clustered-light-grid.js +15 -0
- package/dist/modules/lighting/clustered-light-grid/clustered-light-grid.js.map +1 -0
- package/dist/modules/lighting/contact-shadow/contact-shadow.cjs +348 -0
- package/dist/modules/lighting/contact-shadow/contact-shadow.d.ts +188 -0
- package/dist/modules/lighting/contact-shadow/contact-shadow.d.ts.map +1 -0
- package/dist/modules/lighting/contact-shadow/contact-shadow.js +307 -0
- package/dist/modules/lighting/contact-shadow/contact-shadow.js.map +1 -0
- package/dist/modules/lighting/firefly/firefly.cjs +74 -0
- package/dist/modules/lighting/firefly/firefly.d.ts +36 -0
- package/dist/modules/lighting/firefly/firefly.d.ts.map +1 -0
- package/dist/modules/lighting/firefly/firefly.js +53 -0
- package/dist/modules/lighting/firefly/firefly.js.map +1 -0
- package/dist/modules/lighting/globe-clouds/globe-clouds.cjs +143 -0
- package/dist/modules/lighting/globe-clouds/globe-clouds.d.ts +53 -0
- package/dist/modules/lighting/globe-clouds/globe-clouds.d.ts.map +1 -0
- package/dist/modules/lighting/globe-clouds/globe-clouds.js +119 -0
- package/dist/modules/lighting/globe-clouds/globe-clouds.js.map +1 -0
- package/dist/modules/lighting/gouraud-material/gouraud-material.cjs +61 -0
- package/dist/modules/lighting/gouraud-material/gouraud-material.d.ts +12 -0
- package/dist/modules/lighting/gouraud-material/gouraud-material.d.ts.map +1 -0
- package/dist/modules/lighting/gouraud-material/gouraud-material.js +40 -0
- package/dist/modules/lighting/gouraud-material/gouraud-material.js.map +1 -0
- package/dist/modules/lighting/height-fog/height-fog-functions.cjs +139 -0
- package/dist/modules/lighting/height-fog/height-fog-functions.d.ts +14 -0
- package/dist/modules/lighting/height-fog/height-fog-functions.d.ts.map +1 -0
- package/dist/modules/lighting/height-fog/height-fog-functions.js +114 -0
- package/dist/modules/lighting/height-fog/height-fog-functions.js.map +1 -0
- package/dist/modules/lighting/height-fog/height-fog.cjs +104 -0
- package/dist/modules/lighting/height-fog/height-fog.d.ts +60 -0
- package/dist/modules/lighting/height-fog/height-fog.d.ts.map +1 -0
- package/dist/modules/lighting/height-fog/height-fog.js +77 -0
- package/dist/modules/lighting/height-fog/height-fog.js.map +1 -0
- package/dist/modules/lighting/ibl/ibl.cjs +63 -0
- package/dist/modules/lighting/ibl/ibl.d.ts +25 -0
- package/dist/modules/lighting/ibl/ibl.d.ts.map +1 -0
- package/dist/modules/lighting/ibl/ibl.js +33 -0
- package/dist/modules/lighting/ibl/ibl.js.map +1 -0
- package/dist/modules/lighting/lambert-material/lambert-material.cjs +54 -0
- package/dist/modules/lighting/lambert-material/lambert-material.d.ts +10 -0
- package/dist/modules/lighting/lambert-material/lambert-material.d.ts.map +1 -0
- package/dist/modules/lighting/lambert-material/lambert-material.js +33 -0
- package/dist/modules/lighting/lambert-material/lambert-material.js.map +1 -0
- package/dist/modules/lighting/lambert-material/lambert-shaders-glsl.cjs +88 -0
- package/dist/modules/lighting/lambert-material/lambert-shaders-glsl.d.ts +3 -0
- package/dist/modules/lighting/lambert-material/lambert-shaders-glsl.d.ts.map +1 -0
- package/dist/modules/lighting/lambert-material/lambert-shaders-glsl.js +60 -0
- package/dist/modules/lighting/lambert-material/lambert-shaders-glsl.js.map +1 -0
- package/dist/modules/lighting/lambert-material/lambert-shaders-wgsl.cjs +97 -0
- package/dist/modules/lighting/lambert-material/lambert-shaders-wgsl.d.ts +2 -0
- package/dist/modules/lighting/lambert-material/lambert-shaders-wgsl.d.ts.map +1 -0
- package/dist/modules/lighting/lambert-material/lambert-shaders-wgsl.js +73 -0
- package/dist/modules/lighting/lambert-material/lambert-shaders-wgsl.js.map +1 -0
- package/dist/modules/lighting/lights/lighting-glsl.cjs +116 -0
- package/dist/modules/lighting/lights/lighting-glsl.d.ts +2 -0
- package/dist/modules/lighting/lights/lighting-glsl.d.ts.map +1 -0
- package/dist/modules/lighting/lights/lighting-glsl.js +92 -0
- package/dist/modules/lighting/lights/lighting-glsl.js.map +1 -0
- package/dist/modules/lighting/lights/lighting-wgsl.cjs +115 -0
- package/dist/modules/lighting/lights/lighting-wgsl.d.ts +2 -0
- package/dist/modules/lighting/lights/lighting-wgsl.d.ts.map +1 -0
- package/dist/modules/lighting/lights/lighting-wgsl.js +91 -0
- package/dist/modules/lighting/lights/lighting-wgsl.js.map +1 -0
- package/dist/modules/lighting/lights/lighting.cjs +210 -0
- package/dist/modules/lighting/lights/lighting.d.ts +163 -0
- package/dist/modules/lighting/lights/lighting.d.ts.map +1 -0
- package/dist/modules/lighting/lights/lighting.js +208 -0
- package/dist/modules/lighting/lights/lighting.js.map +1 -0
- package/dist/modules/lighting/no-material/dirlight.cjs +112 -0
- package/dist/modules/lighting/no-material/dirlight.d.ts +33 -0
- package/dist/modules/lighting/no-material/dirlight.d.ts.map +1 -0
- package/dist/modules/lighting/no-material/dirlight.js +86 -0
- package/dist/modules/lighting/no-material/dirlight.js.map +1 -0
- package/dist/modules/lighting/pbr-ambient-occlusion/pbr-ambient-occlusion.cjs +87 -0
- package/dist/modules/lighting/pbr-ambient-occlusion/pbr-ambient-occlusion.d.ts +21 -0
- package/dist/modules/lighting/pbr-ambient-occlusion/pbr-ambient-occlusion.d.ts.map +1 -0
- package/dist/modules/lighting/pbr-ambient-occlusion/pbr-ambient-occlusion.js +61 -0
- package/dist/modules/lighting/pbr-ambient-occlusion/pbr-ambient-occlusion.js.map +1 -0
- package/dist/modules/lighting/pbr-contact-shadow/pbr-contact-shadow.cjs +87 -0
- package/dist/modules/lighting/pbr-contact-shadow/pbr-contact-shadow.d.ts +21 -0
- package/dist/modules/lighting/pbr-contact-shadow/pbr-contact-shadow.d.ts.map +1 -0
- package/dist/modules/lighting/pbr-contact-shadow/pbr-contact-shadow.js +61 -0
- package/dist/modules/lighting/pbr-contact-shadow/pbr-contact-shadow.js.map +1 -0
- package/dist/modules/lighting/pbr-material/pbr-material-glsl.cjs +1789 -0
- package/dist/modules/lighting/pbr-material/pbr-material-glsl.d.ts +3 -0
- package/dist/modules/lighting/pbr-material/pbr-material-glsl.d.ts.map +1 -0
- package/dist/modules/lighting/pbr-material/pbr-material-glsl.js +1767 -0
- package/dist/modules/lighting/pbr-material/pbr-material-glsl.js.map +1 -0
- package/dist/modules/lighting/pbr-material/pbr-material-wgsl.cjs +2084 -0
- package/dist/modules/lighting/pbr-material/pbr-material-wgsl.d.ts +3 -0
- package/dist/modules/lighting/pbr-material/pbr-material-wgsl.d.ts.map +1 -0
- package/dist/modules/lighting/pbr-material/pbr-material-wgsl.js +2062 -0
- package/dist/modules/lighting/pbr-material/pbr-material-wgsl.js.map +1 -0
- package/dist/modules/lighting/pbr-material/pbr-material.cjs +315 -0
- package/dist/modules/lighting/pbr-material/pbr-material.d.ts +516 -0
- package/dist/modules/lighting/pbr-material/pbr-material.d.ts.map +1 -0
- package/dist/modules/lighting/pbr-material/pbr-material.js +292 -0
- package/dist/modules/lighting/pbr-material/pbr-material.js.map +1 -0
- package/dist/modules/lighting/pbr-material/pbr-projection.cjs +63 -0
- package/dist/modules/lighting/pbr-material/pbr-projection.d.ts +10 -0
- package/dist/modules/lighting/pbr-material/pbr-projection.d.ts.map +1 -0
- package/dist/modules/lighting/pbr-material/pbr-projection.js +37 -0
- package/dist/modules/lighting/pbr-material/pbr-projection.js.map +1 -0
- package/dist/modules/lighting/pbr-material/pbr-scene.cjs +109 -0
- package/dist/modules/lighting/pbr-material/pbr-scene.d.ts +52 -0
- package/dist/modules/lighting/pbr-material/pbr-scene.d.ts.map +1 -0
- package/dist/modules/lighting/pbr-material/pbr-scene.js +83 -0
- package/dist/modules/lighting/pbr-material/pbr-scene.js.map +1 -0
- package/dist/modules/lighting/pbr-shadow/pbr-shadow.cjs +97 -0
- package/dist/modules/lighting/pbr-shadow/pbr-shadow.d.ts +15 -0
- package/dist/modules/lighting/pbr-shadow/pbr-shadow.d.ts.map +1 -0
- package/dist/modules/lighting/pbr-shadow/pbr-shadow.js +69 -0
- package/dist/modules/lighting/pbr-shadow/pbr-shadow.js.map +1 -0
- package/dist/modules/lighting/pbr-surface/pbr-surface.cjs +114 -0
- package/dist/modules/lighting/pbr-surface/pbr-surface.d.ts +15 -0
- package/dist/modules/lighting/pbr-surface/pbr-surface.d.ts.map +1 -0
- package/dist/modules/lighting/pbr-surface/pbr-surface.js +88 -0
- package/dist/modules/lighting/pbr-surface/pbr-surface.js.map +1 -0
- package/dist/modules/lighting/phong-material/phong-material.cjs +61 -0
- package/dist/modules/lighting/phong-material/phong-material.d.ts +13 -0
- package/dist/modules/lighting/phong-material/phong-material.d.ts.map +1 -0
- package/dist/modules/lighting/phong-material/phong-material.js +40 -0
- package/dist/modules/lighting/phong-material/phong-material.js.map +1 -0
- package/dist/modules/lighting/phong-material/phong-shaders-glsl.cjs +100 -0
- package/dist/modules/lighting/phong-material/phong-shaders-glsl.d.ts +3 -0
- package/dist/modules/lighting/phong-material/phong-shaders-glsl.d.ts.map +1 -0
- package/dist/modules/lighting/phong-material/phong-shaders-glsl.js +72 -0
- package/dist/modules/lighting/phong-material/phong-shaders-glsl.js.map +1 -0
- package/dist/modules/lighting/phong-material/phong-shaders-wgsl.cjs +153 -0
- package/dist/modules/lighting/phong-material/phong-shaders-wgsl.d.ts +2 -0
- package/dist/modules/lighting/phong-material/phong-shaders-wgsl.d.ts.map +1 -0
- package/dist/modules/lighting/phong-material/phong-shaders-wgsl.js +129 -0
- package/dist/modules/lighting/phong-material/phong-shaders-wgsl.js.map +1 -0
- package/dist/modules/lighting/prefiltered-environment/prefiltered-environment.cjs +379 -0
- package/dist/modules/lighting/prefiltered-environment/prefiltered-environment.d.ts +41 -0
- package/dist/modules/lighting/prefiltered-environment/prefiltered-environment.d.ts.map +1 -0
- package/dist/modules/lighting/prefiltered-environment/prefiltered-environment.js +345 -0
- package/dist/modules/lighting/prefiltered-environment/prefiltered-environment.js.map +1 -0
- package/dist/modules/lighting/shadow/shadow-glsl.cjs +228 -0
- package/dist/modules/lighting/shadow/shadow-glsl.d.ts +3 -0
- package/dist/modules/lighting/shadow/shadow-glsl.d.ts.map +1 -0
- package/dist/modules/lighting/shadow/shadow-glsl.js +204 -0
- package/dist/modules/lighting/shadow/shadow-glsl.js.map +1 -0
- package/dist/modules/lighting/shadow/shadow-types.cjs +15 -0
- package/dist/modules/lighting/shadow/shadow-types.d.ts +63 -0
- package/dist/modules/lighting/shadow/shadow-types.d.ts.map +1 -0
- package/dist/modules/lighting/shadow/shadow-types.js +5 -0
- package/dist/modules/lighting/shadow/shadow-types.js.map +1 -0
- package/dist/modules/lighting/shadow/shadow.cjs +458 -0
- package/dist/modules/lighting/shadow/shadow.d.ts +117 -0
- package/dist/modules/lighting/shadow/shadow.d.ts.map +1 -0
- package/dist/modules/lighting/shadow/shadow.js +450 -0
- package/dist/modules/lighting/shadow/shadow.js.map +1 -0
- package/dist/modules/lighting/surface-weather/surface-weather.cjs +199 -0
- package/dist/modules/lighting/surface-weather/surface-weather.d.ts +54 -0
- package/dist/modules/lighting/surface-weather/surface-weather.d.ts.map +1 -0
- package/dist/modules/lighting/surface-weather/surface-weather.js +175 -0
- package/dist/modules/lighting/surface-weather/surface-weather.js.map +1 -0
- package/dist/modules/lighting/unlit-material/unlit-material.cjs +60 -0
- package/dist/modules/lighting/unlit-material/unlit-material.d.ts +9 -0
- package/dist/modules/lighting/unlit-material/unlit-material.d.ts.map +1 -0
- package/dist/modules/lighting/unlit-material/unlit-material.js +40 -0
- package/dist/modules/lighting/unlit-material/unlit-material.js.map +1 -0
- package/dist/modules/lighting/water-material/river-water-material.cjs +56 -0
- package/dist/modules/lighting/water-material/river-water-material.d.ts +21 -0
- package/dist/modules/lighting/water-material/river-water-material.d.ts.map +1 -0
- package/dist/modules/lighting/water-material/river-water-material.js +36 -0
- package/dist/modules/lighting/water-material/river-water-material.js.map +1 -0
- package/dist/modules/lighting/water-material/river-water-shaders.cjs +261 -0
- package/dist/modules/lighting/water-material/river-water-shaders.d.ts +3 -0
- package/dist/modules/lighting/water-material/river-water-shaders.d.ts.map +1 -0
- package/dist/modules/lighting/water-material/river-water-shaders.js +233 -0
- package/dist/modules/lighting/water-material/river-water-shaders.js.map +1 -0
- package/dist/modules/lighting/water-material/water-material.cjs +188 -0
- package/dist/modules/lighting/water-material/water-material.d.ts +28 -0
- package/dist/modules/lighting/water-material/water-material.d.ts.map +1 -0
- package/dist/modules/lighting/water-material/water-material.js +179 -0
- package/dist/modules/lighting/water-material/water-material.js.map +1 -0
- package/dist/modules/lighting/water-material/water-shaders-glsl.cjs +260 -0
- package/dist/modules/lighting/water-material/water-shaders-glsl.d.ts +3 -0
- package/dist/modules/lighting/water-material/water-shaders-glsl.d.ts.map +1 -0
- package/dist/modules/lighting/water-material/water-shaders-glsl.js +232 -0
- package/dist/modules/lighting/water-material/water-shaders-glsl.js.map +1 -0
- package/dist/modules/lighting/water-material/water-shaders-wgsl.cjs +254 -0
- package/dist/modules/lighting/water-material/water-shaders-wgsl.d.ts +2 -0
- package/dist/modules/lighting/water-material/water-shaders-wgsl.d.ts.map +1 -0
- package/dist/modules/lighting/water-material/water-shaders-wgsl.js +230 -0
- package/dist/modules/lighting/water-material/water-shaders-wgsl.js.map +1 -0
- package/dist/modules/math/fp16/fp16-utils.cjs +112 -0
- package/dist/modules/math/fp16/fp16-utils.d.ts +13 -0
- package/dist/modules/math/fp16/fp16-utils.d.ts.map +1 -0
- package/dist/modules/math/fp16/fp16-utils.js +118 -0
- package/dist/modules/math/fp16/fp16-utils.js.map +1 -0
- package/dist/modules/math/fp32/fp32.cjs +310 -0
- package/dist/modules/math/fp32/fp32.d.ts +9 -0
- package/dist/modules/math/fp32/fp32.d.ts.map +1 -0
- package/dist/modules/math/fp32/fp32.js +288 -0
- package/dist/modules/math/fp32/fp32.js.map +1 -0
- package/dist/modules/math/fp64/fp64-arithmetic-glsl.cjs +229 -0
- package/dist/modules/math/fp64/fp64-arithmetic-glsl.d.ts +2 -0
- package/dist/modules/math/fp64/fp64-arithmetic-glsl.d.ts.map +1 -0
- package/dist/modules/math/fp64/fp64-arithmetic-glsl.js +205 -0
- package/dist/modules/math/fp64/fp64-arithmetic-glsl.js.map +1 -0
- package/dist/modules/math/fp64/fp64-arithmetic-wgsl-hybrid.cjs +144 -0
- package/dist/modules/math/fp64/fp64-arithmetic-wgsl-hybrid.d.ts +10 -0
- package/dist/modules/math/fp64/fp64-arithmetic-wgsl-hybrid.d.ts.map +1 -0
- package/dist/modules/math/fp64/fp64-arithmetic-wgsl-hybrid.js +128 -0
- package/dist/modules/math/fp64/fp64-arithmetic-wgsl-hybrid.js.map +1 -0
- package/dist/modules/math/fp64/fp64-arithmetic-wgsl-integer.cjs +583 -0
- package/dist/modules/math/fp64/fp64-arithmetic-wgsl-integer.d.ts +11 -0
- package/dist/modules/math/fp64/fp64-arithmetic-wgsl-integer.d.ts.map +1 -0
- package/dist/modules/math/fp64/fp64-arithmetic-wgsl-integer.js +563 -0
- package/dist/modules/math/fp64/fp64-arithmetic-wgsl-integer.js.map +1 -0
- package/dist/modules/math/fp64/fp64-arithmetic-wgsl.cjs +946 -0
- package/dist/modules/math/fp64/fp64-arithmetic-wgsl.d.ts +3 -0
- package/dist/modules/math/fp64/fp64-arithmetic-wgsl.d.ts.map +1 -0
- package/dist/modules/math/fp64/fp64-arithmetic-wgsl.js +923 -0
- package/dist/modules/math/fp64/fp64-arithmetic-wgsl.js.map +1 -0
- package/dist/modules/math/fp64/fp64-functions-glsl.cjs +699 -0
- package/dist/modules/math/fp64/fp64-functions-glsl.d.ts +2 -0
- package/dist/modules/math/fp64/fp64-functions-glsl.d.ts.map +1 -0
- package/dist/modules/math/fp64/fp64-functions-glsl.js +675 -0
- package/dist/modules/math/fp64/fp64-functions-glsl.js.map +1 -0
- package/dist/modules/math/fp64/fp64-functions-wgsl.cjs +180 -0
- package/dist/modules/math/fp64/fp64-functions-wgsl.d.ts +3 -0
- package/dist/modules/math/fp64/fp64-functions-wgsl.d.ts.map +1 -0
- package/dist/modules/math/fp64/fp64-functions-wgsl.js +157 -0
- package/dist/modules/math/fp64/fp64-functions-wgsl.js.map +1 -0
- package/dist/modules/math/fp64/fp64-utils.cjs +50 -0
- package/dist/modules/math/fp64/fp64-utils.d.ts +22 -0
- package/dist/modules/math/fp64/fp64-utils.d.ts.map +1 -0
- package/dist/modules/math/fp64/fp64-utils.js +42 -0
- package/dist/modules/math/fp64/fp64-utils.js.map +1 -0
- package/dist/modules/math/fp64/fp64.cjs +68 -0
- package/dist/modules/math/fp64/fp64.d.ts +24 -0
- package/dist/modules/math/fp64/fp64.d.ts.map +1 -0
- package/dist/modules/math/fp64/fp64.js +46 -0
- package/dist/modules/math/fp64/fp64.js.map +1 -0
- package/dist/modules/math/random/random.cjs +46 -0
- package/dist/modules/math/random/random.d.ts +7 -0
- package/dist/modules/math/random/random.d.ts.map +1 -0
- package/dist/modules/math/random/random.js +21 -0
- package/dist/modules/math/random/random.js.map +1 -0
- package/dist/modules/math/value-noise/value-noise.cjs +95 -0
- package/dist/modules/math/value-noise/value-noise.d.ts +7 -0
- package/dist/modules/math/value-noise/value-noise.d.ts.map +1 -0
- package/dist/modules/math/value-noise/value-noise.js +68 -0
- package/dist/modules/math/value-noise/value-noise.js.map +1 -0
- package/dist/modules/volume/volume-raymarch.cjs +107 -0
- package/dist/modules/volume/volume-raymarch.d.ts +6 -0
- package/dist/modules/volume/volume-raymarch.d.ts.map +1 -0
- package/dist/modules/volume/volume-raymarch.js +84 -0
- package/dist/modules/volume/volume-raymarch.js.map +1 -0
- package/dist/types/align-to.cjs +38 -0
- package/dist/types/align-to.d.ts +3 -0
- package/dist/types/align-to.d.ts.map +1 -0
- package/dist/types/align-to.js +13 -0
- package/dist/types/align-to.js.map +1 -0
- package/dist/types/primitive-data-types.cjs +15 -0
- package/dist/types/primitive-data-types.d.ts +7 -0
- package/dist/types/primitive-data-types.d.ts.map +1 -0
- package/dist/types/primitive-data-types.js +5 -0
- package/dist/types/primitive-data-types.js.map +1 -0
- package/dist/types/sampler-props.cjs +15 -0
- package/dist/types/sampler-props.d.ts +26 -0
- package/dist/types/sampler-props.d.ts.map +1 -0
- package/dist/types/sampler-props.js +5 -0
- package/dist/types/sampler-props.js.map +1 -0
- package/dist/types/shader-block-layout.cjs +184 -0
- package/dist/types/shader-block-layout.d.ts +72 -0
- package/dist/types/shader-block-layout.d.ts.map +1 -0
- package/dist/types/shader-block-layout.js +209 -0
- package/dist/types/shader-block-layout.js.map +1 -0
- package/dist/types/shader-layout.cjs +15 -0
- package/dist/types/shader-layout.d.ts +178 -0
- package/dist/types/shader-layout.d.ts.map +1 -0
- package/dist/types/shader-layout.js +5 -0
- package/dist/types/shader-layout.js.map +1 -0
- package/dist/types/shader-type-decoder.cjs +240 -0
- package/dist/types/shader-type-decoder.d.ts +41 -0
- package/dist/types/shader-type-decoder.d.ts.map +1 -0
- package/dist/types/shader-type-decoder.js +210 -0
- package/dist/types/shader-type-decoder.js.map +1 -0
- package/dist/types/shader-types.cjs +15 -0
- package/dist/types/shader-types.d.ts +101 -0
- package/dist/types/shader-types.d.ts.map +1 -0
- package/dist/types/shader-types.js +30 -0
- package/dist/types/shader-types.js.map +1 -0
- package/dist/types/texture-formats.cjs +15 -0
- package/dist/types/texture-formats.d.ts +24 -0
- package/dist/types/texture-formats.d.ts.map +1 -0
- package/dist/types/texture-formats.js +5 -0
- package/dist/types/texture-formats.js.map +1 -0
- package/dist/types.cjs +53 -0
- package/dist/types.cjs.map +6 -0
- package/dist/types.d.ts +14 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -0
- package/dist/wgsl.cjs +55 -0
- package/dist/wgsl.cjs.map +6 -0
- package/dist/wgsl.d.ts +8 -0
- package/dist/wgsl.d.ts.map +1 -0
- package/dist/wgsl.js +9 -0
- package/dist/wgsl.js.map +1 -0
- package/package.json +65 -4
- package/src/glsl.ts +13 -0
- package/src/index.ts +307 -0
- package/src/lib/color/normalize-byte-colors.ts +57 -0
- package/src/lib/filters/prop-types.ts +150 -0
- package/src/lib/glsl-shader-assembler.ts +39 -0
- package/src/lib/glsl-utils/get-shader-info.ts +42 -0
- package/src/lib/glsl-utils/shader-utils.ts +110 -0
- package/src/lib/preprocessor/preprocessor.ts +157 -0
- package/src/lib/shader-assembler-base.ts +169 -0
- package/src/lib/shader-assembler.ts +7 -0
- package/src/lib/shader-assembly/assemble-glsl-shaders.ts +305 -0
- package/src/lib/shader-assembly/assemble-shaders.ts +13 -0
- package/src/lib/shader-assembly/assemble-wgsl-shaders.ts +830 -0
- package/src/lib/shader-assembly/platform-defines.ts +58 -0
- package/src/lib/shader-assembly/platform-info.ts +23 -0
- package/src/lib/shader-assembly/shader-assembly-shared.ts +95 -0
- package/src/lib/shader-assembly/shader-assembly-types.ts +146 -0
- package/src/lib/shader-assembly/shader-injection-targets.ts +148 -0
- package/src/lib/shader-assembly/shader-injections.ts +298 -0
- package/src/lib/shader-assembly/shader-plugin-varyings.ts +555 -0
- package/src/lib/shader-assembly/shader-plugin-vertex-inputs.ts +279 -0
- package/src/lib/shader-assembly/wgsl-binding-debug.ts +227 -0
- package/src/lib/shader-assembly/wgsl-binding-scan.ts +228 -0
- package/src/lib/shader-assembly/wgsl-injection-target-names.ts +180 -0
- package/src/lib/shader-assembly/wgsl-interface-scan.ts +676 -0
- package/src/lib/shader-generator/generate-shader.ts +27 -0
- package/src/lib/shader-generator/glsl/generate-glsl.ts +101 -0
- package/src/lib/shader-generator/utils/capitalize.ts +12 -0
- package/src/lib/shader-generator/wgsl/generate-wgsl.ts +40 -0
- package/src/lib/shader-module/composite-shader-pass.ts +47 -0
- package/src/lib/shader-module/shader-module-dependencies.ts +128 -0
- package/src/lib/shader-module/shader-module-uniform-layout.ts +420 -0
- package/src/lib/shader-module/shader-module.ts +237 -0
- package/src/lib/shader-module/shader-pass.ts +69 -0
- package/src/lib/shader-plugin.ts +236 -0
- package/src/lib/shader-transpiler/shader-transpiler.ts +34 -0
- package/src/lib/shader-transpiler/transpile-glsl-shader.ts +78 -0
- package/src/lib/utils/assert.ts +13 -0
- package/src/lib/utils/uniform-types.ts +89 -0
- package/src/lib/wgsl-shader-assembler.ts +122 -0
- package/src/module-injectors.ts +32 -0
- package/src/modules/color/float-colors.ts +334 -0
- package/src/modules/engine/clip/clip.ts +139 -0
- package/src/modules/engine/filter/filter.ts +99 -0
- package/src/modules/engine/geometry/geometry.ts +45 -0
- package/src/modules/engine/gpu-animation/gpu-animation.ts +244 -0
- package/src/modules/engine/picking/README.md +88 -0
- package/src/modules/engine/picking/picking.ts +252 -0
- package/src/modules/engine/project/project.ts +166 -0
- package/src/modules/engine/skin/skin.ts +233 -0
- package/src/modules/engine/transform/transform.ts +50 -0
- package/src/modules/geometry/path-dash/path-dash.ts +68 -0
- package/src/modules/geometry/pattern-fill/pattern-fill-shaders.ts +88 -0
- package/src/modules/geometry/pattern-fill/pattern-fill.ts +54 -0
- package/src/modules/geometry/point-glow/point-glow.ts +87 -0
- package/src/modules/geometry/precipitation/README.md +19 -0
- package/src/modules/geometry/precipitation/precipitation.ts +108 -0
- package/src/modules/geometry/sketch-stroke/sketch-stroke.ts +160 -0
- package/src/modules/geospatial/dggs/dggs-wgsl.ts +2284 -0
- package/src/modules/geospatial/dggs/dggs.ts +12 -0
- package/src/modules/lighting/area-lighting/area-light-types.ts +71 -0
- package/src/modules/lighting/area-lighting/area-lighting-shaders.ts +72 -0
- package/src/modules/lighting/area-lighting/area-lighting.ts +63 -0
- package/src/modules/lighting/area-lighting/ltc-shaders.ts +163 -0
- package/src/modules/lighting/atmosphere/README.md +25 -0
- package/src/modules/lighting/atmosphere/atmosphere.ts +246 -0
- package/src/modules/lighting/clouds/README.md +24 -0
- package/src/modules/lighting/clouds/clouds.ts +216 -0
- package/src/modules/lighting/clustered-light-grid/clustered-light-grid.ts +17 -0
- package/src/modules/lighting/contact-shadow/contact-shadow.ts +365 -0
- package/src/modules/lighting/firefly/firefly.ts +64 -0
- package/src/modules/lighting/globe-clouds/globe-clouds.ts +124 -0
- package/src/modules/lighting/gouraud-material/gouraud-material.ts +55 -0
- package/src/modules/lighting/height-fog/README.md +36 -0
- package/src/modules/lighting/height-fog/height-fog-functions.ts +116 -0
- package/src/modules/lighting/height-fog/height-fog.ts +96 -0
- package/src/modules/lighting/ibl/ibl.ts +43 -0
- package/src/modules/lighting/lambert-material/lambert-material.ts +42 -0
- package/src/modules/lighting/lambert-material/lambert-shaders-glsl.ts +61 -0
- package/src/modules/lighting/lambert-material/lambert-shaders-wgsl.ts +73 -0
- package/src/modules/lighting/lights/lighting-glsl.ts +92 -0
- package/src/modules/lighting/lights/lighting-wgsl.ts +91 -0
- package/src/modules/lighting/lights/lighting.ts +385 -0
- package/src/modules/lighting/no-material/dirlight.ts +101 -0
- package/src/modules/lighting/pbr-ambient-occlusion/pbr-ambient-occlusion.ts +78 -0
- package/src/modules/lighting/pbr-contact-shadow/pbr-contact-shadow.ts +78 -0
- package/src/modules/lighting/pbr-material/pbr-material-glsl.ts +1770 -0
- package/src/modules/lighting/pbr-material/pbr-material-wgsl.ts +2065 -0
- package/src/modules/lighting/pbr-material/pbr-material.ts +517 -0
- package/src/modules/lighting/pbr-material/pbr-projection.ts +50 -0
- package/src/modules/lighting/pbr-material/pbr-scene.ts +112 -0
- package/src/modules/lighting/pbr-shadow/pbr-shadow.ts +85 -0
- package/src/modules/lighting/pbr-surface/pbr-surface.ts +103 -0
- package/src/modules/lighting/phong-material/phong-material.ts +53 -0
- package/src/modules/lighting/phong-material/phong-shaders-glsl.ts +73 -0
- package/src/modules/lighting/phong-material/phong-shaders-wgsl.ts +129 -0
- package/src/modules/lighting/prefiltered-environment/prefiltered-environment.ts +370 -0
- package/src/modules/lighting/shadow/shadow-glsl.ts +204 -0
- package/src/modules/lighting/shadow/shadow-types.ts +68 -0
- package/src/modules/lighting/shadow/shadow.ts +536 -0
- package/src/modules/lighting/surface-weather/README.md +28 -0
- package/src/modules/lighting/surface-weather/surface-weather.ts +198 -0
- package/src/modules/lighting/unlit-material/unlit-material.ts +44 -0
- package/src/modules/lighting/water-material/river-water-material.ts +58 -0
- package/src/modules/lighting/water-material/river-water-shaders.ts +234 -0
- package/src/modules/lighting/water-material/water-material.ts +234 -0
- package/src/modules/lighting/water-material/water-shaders-glsl.ts +233 -0
- package/src/modules/lighting/water-material/water-shaders-wgsl.ts +230 -0
- package/src/modules/math/fp16/fp16-utils.ts +156 -0
- package/src/modules/math/fp32/fp32.ts +291 -0
- package/src/modules/math/fp64/fp64-arithmetic-glsl.ts +205 -0
- package/src/modules/math/fp64/fp64-arithmetic-wgsl-hybrid.ts +129 -0
- package/src/modules/math/fp64/fp64-arithmetic-wgsl-integer.ts +564 -0
- package/src/modules/math/fp64/fp64-arithmetic-wgsl.ts +924 -0
- package/src/modules/math/fp64/fp64-functions-glsl.ts +675 -0
- package/src/modules/math/fp64/fp64-functions-wgsl.ts +157 -0
- package/src/modules/math/fp64/fp64-utils.ts +46 -0
- package/src/modules/math/fp64/fp64.ts +64 -0
- package/src/modules/math/random/random.ts +25 -0
- package/src/modules/math/value-noise/value-noise.ts +70 -0
- package/src/modules/volume/volume-raymarch.ts +87 -0
- package/src/types/align-to.ts +13 -0
- package/src/types/primitive-data-types.ts +10 -0
- package/src/types/sampler-props.ts +39 -0
- package/src/types/shader-block-layout.ts +340 -0
- package/src/types/shader-layout.ts +208 -0
- package/src/types/shader-type-decoder.ts +285 -0
- package/src/types/shader-types.ts +207 -0
- package/src/types/texture-formats.ts +157 -0
- package/src/types.ts +116 -0
- package/src/wgsl.ts +34 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var random_exports = {};
|
|
19
|
+
__export(random_exports, {
|
|
20
|
+
random: () => random
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(random_exports);
|
|
23
|
+
const source = (
|
|
24
|
+
/* wgsl */
|
|
25
|
+
`fn random(scale: vec3f, seed: f32) -> f32 {
|
|
26
|
+
return fract(sin(dot(scale + vec3f(seed), vec3f(12.9898, 78.233, 151.7182))) * 43758.5453 + seed);
|
|
27
|
+
}
|
|
28
|
+
`
|
|
29
|
+
);
|
|
30
|
+
const fs = (
|
|
31
|
+
/* glsl */
|
|
32
|
+
`float random(vec3 scale, float seed) {
|
|
33
|
+
/* use the fragment position for a different seed per-pixel */
|
|
34
|
+
return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);
|
|
35
|
+
}
|
|
36
|
+
`
|
|
37
|
+
);
|
|
38
|
+
const random = {
|
|
39
|
+
name: "random",
|
|
40
|
+
source,
|
|
41
|
+
fs
|
|
42
|
+
};
|
|
43
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
+
0 && (module.exports = {
|
|
45
|
+
random
|
|
46
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Quick random generator for fragment shaders */
|
|
2
|
+
export declare const random: {
|
|
3
|
+
readonly name: "random";
|
|
4
|
+
readonly source: "fn random(scale: vec3f, seed: f32) -> f32 {\n return fract(sin(dot(scale + vec3f(seed), vec3f(12.9898, 78.233, 151.7182))) * 43758.5453 + seed);\n}\n";
|
|
5
|
+
readonly fs: "float random(vec3 scale, float seed) {\n /* use the fragment position for a different seed per-pixel */\n return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);\n}\n";
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=random.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../../../src/modules/math/random/random.ts"],"names":[],"mappings":"AAmBA,kDAAkD;AAClD,eAAO,MAAM,MAAM;;;;CAIsB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
const source = /* wgsl */ `\
|
|
5
|
+
fn random(scale: vec3f, seed: f32) -> f32 {
|
|
6
|
+
return fract(sin(dot(scale + vec3f(seed), vec3f(12.9898, 78.233, 151.7182))) * 43758.5453 + seed);
|
|
7
|
+
}
|
|
8
|
+
`;
|
|
9
|
+
const fs = /* glsl */ `\
|
|
10
|
+
float random(vec3 scale, float seed) {
|
|
11
|
+
/* use the fragment position for a different seed per-pixel */
|
|
12
|
+
return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
/** Quick random generator for fragment shaders */
|
|
16
|
+
export const random = {
|
|
17
|
+
name: 'random',
|
|
18
|
+
source,
|
|
19
|
+
fs
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=random.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"random.js","sourceRoot":"","sources":["../../../../src/modules/math/random/random.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAI5D,MAAM,MAAM,GAAG,UAAU,CAAC;;;;CAIzB,CAAC;AAEF,MAAM,EAAE,GAAG,UAAU,CAAC;;;;;CAKrB,CAAC;AAEF,kDAAkD;AAClD,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,IAAI,EAAE,QAAQ;IACd,MAAM;IACN,EAAE;CACqC,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var value_noise_exports = {};
|
|
19
|
+
__export(value_noise_exports, {
|
|
20
|
+
valueNoise: () => valueNoise
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(value_noise_exports);
|
|
23
|
+
const valueNoise = {
|
|
24
|
+
name: "valueNoise",
|
|
25
|
+
fs: (
|
|
26
|
+
/* glsl */
|
|
27
|
+
`
|
|
28
|
+
float valueNoise_hash(vec2 cell) {
|
|
29
|
+
vec3 value = fract(vec3(cell.x, cell.y, cell.x) * 0.1031);
|
|
30
|
+
value += dot(value, value.yzx + 33.33);
|
|
31
|
+
return fract((value.x + value.y) * value.z);
|
|
32
|
+
}
|
|
33
|
+
float valueNoise_noise(vec2 position) {
|
|
34
|
+
vec2 cell = floor(position);
|
|
35
|
+
vec2 fraction = fract(position);
|
|
36
|
+
vec2 blend = fraction * fraction * (3.0 - 2.0 * fraction);
|
|
37
|
+
return mix(mix(valueNoise_hash(cell), valueNoise_hash(cell + vec2(1.0, 0.0)), blend.x),
|
|
38
|
+
mix(valueNoise_hash(cell + vec2(0.0, 1.0)), valueNoise_hash(cell + vec2(1.0)), blend.x), blend.y);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
float valueNoise_hash3(vec3 cell) {
|
|
42
|
+
vec3 value = fract(cell * 0.1031);
|
|
43
|
+
value += dot(value, value.yzx + 33.33);
|
|
44
|
+
return fract((value.x + value.y) * value.z);
|
|
45
|
+
}
|
|
46
|
+
float valueNoise_noise3(vec3 position) {
|
|
47
|
+
vec3 cell = floor(position);
|
|
48
|
+
vec3 fraction = fract(position);
|
|
49
|
+
vec3 blend = fraction * fraction * (3.0 - 2.0 * fraction);
|
|
50
|
+
float bottom = mix(mix(valueNoise_hash3(cell), valueNoise_hash3(cell + vec3(1.0, 0.0, 0.0)), blend.x),
|
|
51
|
+
mix(valueNoise_hash3(cell + vec3(0.0, 1.0, 0.0)), valueNoise_hash3(cell + vec3(1.0, 1.0, 0.0)), blend.x), blend.y);
|
|
52
|
+
float top = mix(mix(valueNoise_hash3(cell + vec3(0.0, 0.0, 1.0)), valueNoise_hash3(cell + vec3(1.0, 0.0, 1.0)), blend.x),
|
|
53
|
+
mix(valueNoise_hash3(cell + vec3(0.0, 1.0, 1.0)), valueNoise_hash3(cell + vec3(1.0)), blend.x), blend.y);
|
|
54
|
+
return mix(bottom, top, blend.z);
|
|
55
|
+
}
|
|
56
|
+
`
|
|
57
|
+
),
|
|
58
|
+
source: (
|
|
59
|
+
/* wgsl */
|
|
60
|
+
`
|
|
61
|
+
fn valueNoise_hash(cell: vec2f) -> f32 {
|
|
62
|
+
var value = fract(vec3f(cell.x, cell.y, cell.x) * 0.1031);
|
|
63
|
+
value += vec3f(dot(value, value.yzx + vec3f(33.33)));
|
|
64
|
+
return fract((value.x + value.y) * value.z);
|
|
65
|
+
}
|
|
66
|
+
fn valueNoise_noise(position: vec2f) -> f32 {
|
|
67
|
+
let cell = floor(position);
|
|
68
|
+
let fraction = fract(position);
|
|
69
|
+
let blend = fraction * fraction * (vec2f(3.0) - 2.0 * fraction);
|
|
70
|
+
return mix(mix(valueNoise_hash(cell), valueNoise_hash(cell + vec2f(1.0, 0.0)), blend.x),
|
|
71
|
+
mix(valueNoise_hash(cell + vec2f(0.0, 1.0)), valueNoise_hash(cell + vec2f(1.0)), blend.x), blend.y);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
fn valueNoise_hash3(cell: vec3f) -> f32 {
|
|
75
|
+
var value = fract(cell * 0.1031);
|
|
76
|
+
value += vec3f(dot(value, value.yzx + vec3f(33.33)));
|
|
77
|
+
return fract((value.x + value.y) * value.z);
|
|
78
|
+
}
|
|
79
|
+
fn valueNoise_noise3(position: vec3f) -> f32 {
|
|
80
|
+
let cell = floor(position);
|
|
81
|
+
let fraction = fract(position);
|
|
82
|
+
let blend = fraction * fraction * (vec3f(3.0) - 2.0 * fraction);
|
|
83
|
+
let bottom = mix(mix(valueNoise_hash3(cell), valueNoise_hash3(cell + vec3f(1.0, 0.0, 0.0)), blend.x),
|
|
84
|
+
mix(valueNoise_hash3(cell + vec3f(0.0, 1.0, 0.0)), valueNoise_hash3(cell + vec3f(1.0, 1.0, 0.0)), blend.x), blend.y);
|
|
85
|
+
let top = mix(mix(valueNoise_hash3(cell + vec3f(0.0, 0.0, 1.0)), valueNoise_hash3(cell + vec3f(1.0, 0.0, 1.0)), blend.x),
|
|
86
|
+
mix(valueNoise_hash3(cell + vec3f(0.0, 1.0, 1.0)), valueNoise_hash3(cell + vec3f(1.0)), blend.x), blend.y);
|
|
87
|
+
return mix(bottom, top, blend.z);
|
|
88
|
+
}
|
|
89
|
+
`
|
|
90
|
+
)
|
|
91
|
+
};
|
|
92
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
93
|
+
0 && (module.exports = {
|
|
94
|
+
valueNoise
|
|
95
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Smooth, deterministic value noise shared by atmospheric shader modules. */
|
|
2
|
+
export declare const valueNoise: {
|
|
3
|
+
readonly name: "valueNoise";
|
|
4
|
+
readonly fs: "\nfloat valueNoise_hash(vec2 cell) {\n vec3 value = fract(vec3(cell.x, cell.y, cell.x) * 0.1031);\n value += dot(value, value.yzx + 33.33);\n return fract((value.x + value.y) * value.z);\n}\nfloat valueNoise_noise(vec2 position) {\n vec2 cell = floor(position);\n vec2 fraction = fract(position);\n vec2 blend = fraction * fraction * (3.0 - 2.0 * fraction);\n return mix(mix(valueNoise_hash(cell), valueNoise_hash(cell + vec2(1.0, 0.0)), blend.x),\n mix(valueNoise_hash(cell + vec2(0.0, 1.0)), valueNoise_hash(cell + vec2(1.0)), blend.x), blend.y);\n}\n\nfloat valueNoise_hash3(vec3 cell) {\n vec3 value = fract(cell * 0.1031);\n value += dot(value, value.yzx + 33.33);\n return fract((value.x + value.y) * value.z);\n}\nfloat valueNoise_noise3(vec3 position) {\n vec3 cell = floor(position);\n vec3 fraction = fract(position);\n vec3 blend = fraction * fraction * (3.0 - 2.0 * fraction);\n float bottom = mix(mix(valueNoise_hash3(cell), valueNoise_hash3(cell + vec3(1.0, 0.0, 0.0)), blend.x),\n mix(valueNoise_hash3(cell + vec3(0.0, 1.0, 0.0)), valueNoise_hash3(cell + vec3(1.0, 1.0, 0.0)), blend.x), blend.y);\n float top = mix(mix(valueNoise_hash3(cell + vec3(0.0, 0.0, 1.0)), valueNoise_hash3(cell + vec3(1.0, 0.0, 1.0)), blend.x),\n mix(valueNoise_hash3(cell + vec3(0.0, 1.0, 1.0)), valueNoise_hash3(cell + vec3(1.0)), blend.x), blend.y);\n return mix(bottom, top, blend.z);\n}\n";
|
|
5
|
+
readonly source: "\nfn valueNoise_hash(cell: vec2f) -> f32 {\n var value = fract(vec3f(cell.x, cell.y, cell.x) * 0.1031);\n value += vec3f(dot(value, value.yzx + vec3f(33.33)));\n return fract((value.x + value.y) * value.z);\n}\nfn valueNoise_noise(position: vec2f) -> f32 {\n let cell = floor(position);\n let fraction = fract(position);\n let blend = fraction * fraction * (vec2f(3.0) - 2.0 * fraction);\n return mix(mix(valueNoise_hash(cell), valueNoise_hash(cell + vec2f(1.0, 0.0)), blend.x),\n mix(valueNoise_hash(cell + vec2f(0.0, 1.0)), valueNoise_hash(cell + vec2f(1.0)), blend.x), blend.y);\n}\n\nfn valueNoise_hash3(cell: vec3f) -> f32 {\n var value = fract(cell * 0.1031);\n value += vec3f(dot(value, value.yzx + vec3f(33.33)));\n return fract((value.x + value.y) * value.z);\n}\nfn valueNoise_noise3(position: vec3f) -> f32 {\n let cell = floor(position);\n let fraction = fract(position);\n let blend = fraction * fraction * (vec3f(3.0) - 2.0 * fraction);\n let bottom = mix(mix(valueNoise_hash3(cell), valueNoise_hash3(cell + vec3f(1.0, 0.0, 0.0)), blend.x),\n mix(valueNoise_hash3(cell + vec3f(0.0, 1.0, 0.0)), valueNoise_hash3(cell + vec3f(1.0, 1.0, 0.0)), blend.x), blend.y);\n let top = mix(mix(valueNoise_hash3(cell + vec3f(0.0, 0.0, 1.0)), valueNoise_hash3(cell + vec3f(1.0, 0.0, 1.0)), blend.x),\n mix(valueNoise_hash3(cell + vec3f(0.0, 1.0, 1.0)), valueNoise_hash3(cell + vec3f(1.0)), blend.x), blend.y);\n return mix(bottom, top, blend.z);\n}\n";
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=value-noise.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"value-noise.d.ts","sourceRoot":"","sources":["../../../../src/modules/math/value-noise/value-noise.ts"],"names":[],"mappings":"AAMA,8EAA8E;AAC9E,eAAO,MAAM,UAAU;;;;CA8DU,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
/** Smooth, deterministic value noise shared by atmospheric shader modules. */
|
|
5
|
+
export const valueNoise = {
|
|
6
|
+
name: 'valueNoise',
|
|
7
|
+
fs: /* glsl */ `
|
|
8
|
+
float valueNoise_hash(vec2 cell) {
|
|
9
|
+
vec3 value = fract(vec3(cell.x, cell.y, cell.x) * 0.1031);
|
|
10
|
+
value += dot(value, value.yzx + 33.33);
|
|
11
|
+
return fract((value.x + value.y) * value.z);
|
|
12
|
+
}
|
|
13
|
+
float valueNoise_noise(vec2 position) {
|
|
14
|
+
vec2 cell = floor(position);
|
|
15
|
+
vec2 fraction = fract(position);
|
|
16
|
+
vec2 blend = fraction * fraction * (3.0 - 2.0 * fraction);
|
|
17
|
+
return mix(mix(valueNoise_hash(cell), valueNoise_hash(cell + vec2(1.0, 0.0)), blend.x),
|
|
18
|
+
mix(valueNoise_hash(cell + vec2(0.0, 1.0)), valueNoise_hash(cell + vec2(1.0)), blend.x), blend.y);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
float valueNoise_hash3(vec3 cell) {
|
|
22
|
+
vec3 value = fract(cell * 0.1031);
|
|
23
|
+
value += dot(value, value.yzx + 33.33);
|
|
24
|
+
return fract((value.x + value.y) * value.z);
|
|
25
|
+
}
|
|
26
|
+
float valueNoise_noise3(vec3 position) {
|
|
27
|
+
vec3 cell = floor(position);
|
|
28
|
+
vec3 fraction = fract(position);
|
|
29
|
+
vec3 blend = fraction * fraction * (3.0 - 2.0 * fraction);
|
|
30
|
+
float bottom = mix(mix(valueNoise_hash3(cell), valueNoise_hash3(cell + vec3(1.0, 0.0, 0.0)), blend.x),
|
|
31
|
+
mix(valueNoise_hash3(cell + vec3(0.0, 1.0, 0.0)), valueNoise_hash3(cell + vec3(1.0, 1.0, 0.0)), blend.x), blend.y);
|
|
32
|
+
float top = mix(mix(valueNoise_hash3(cell + vec3(0.0, 0.0, 1.0)), valueNoise_hash3(cell + vec3(1.0, 0.0, 1.0)), blend.x),
|
|
33
|
+
mix(valueNoise_hash3(cell + vec3(0.0, 1.0, 1.0)), valueNoise_hash3(cell + vec3(1.0)), blend.x), blend.y);
|
|
34
|
+
return mix(bottom, top, blend.z);
|
|
35
|
+
}
|
|
36
|
+
`,
|
|
37
|
+
source: /* wgsl */ `
|
|
38
|
+
fn valueNoise_hash(cell: vec2f) -> f32 {
|
|
39
|
+
var value = fract(vec3f(cell.x, cell.y, cell.x) * 0.1031);
|
|
40
|
+
value += vec3f(dot(value, value.yzx + vec3f(33.33)));
|
|
41
|
+
return fract((value.x + value.y) * value.z);
|
|
42
|
+
}
|
|
43
|
+
fn valueNoise_noise(position: vec2f) -> f32 {
|
|
44
|
+
let cell = floor(position);
|
|
45
|
+
let fraction = fract(position);
|
|
46
|
+
let blend = fraction * fraction * (vec2f(3.0) - 2.0 * fraction);
|
|
47
|
+
return mix(mix(valueNoise_hash(cell), valueNoise_hash(cell + vec2f(1.0, 0.0)), blend.x),
|
|
48
|
+
mix(valueNoise_hash(cell + vec2f(0.0, 1.0)), valueNoise_hash(cell + vec2f(1.0)), blend.x), blend.y);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
fn valueNoise_hash3(cell: vec3f) -> f32 {
|
|
52
|
+
var value = fract(cell * 0.1031);
|
|
53
|
+
value += vec3f(dot(value, value.yzx + vec3f(33.33)));
|
|
54
|
+
return fract((value.x + value.y) * value.z);
|
|
55
|
+
}
|
|
56
|
+
fn valueNoise_noise3(position: vec3f) -> f32 {
|
|
57
|
+
let cell = floor(position);
|
|
58
|
+
let fraction = fract(position);
|
|
59
|
+
let blend = fraction * fraction * (vec3f(3.0) - 2.0 * fraction);
|
|
60
|
+
let bottom = mix(mix(valueNoise_hash3(cell), valueNoise_hash3(cell + vec3f(1.0, 0.0, 0.0)), blend.x),
|
|
61
|
+
mix(valueNoise_hash3(cell + vec3f(0.0, 1.0, 0.0)), valueNoise_hash3(cell + vec3f(1.0, 1.0, 0.0)), blend.x), blend.y);
|
|
62
|
+
let top = mix(mix(valueNoise_hash3(cell + vec3f(0.0, 0.0, 1.0)), valueNoise_hash3(cell + vec3f(1.0, 0.0, 1.0)), blend.x),
|
|
63
|
+
mix(valueNoise_hash3(cell + vec3f(0.0, 1.0, 1.0)), valueNoise_hash3(cell + vec3f(1.0)), blend.x), blend.y);
|
|
64
|
+
return mix(bottom, top, blend.z);
|
|
65
|
+
}
|
|
66
|
+
`
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=value-noise.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"value-noise.js","sourceRoot":"","sources":["../../../../src/modules/math/value-noise/value-noise.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAI5D,8EAA8E;AAC9E,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,IAAI,EAAE,YAAY;IAClB,EAAE,EAAE,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BhB;IACC,MAAM,EAAE,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BpB;CACgC,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var volume_raymarch_exports = {};
|
|
19
|
+
__export(volume_raymarch_exports, {
|
|
20
|
+
volumeRaymarch: () => volumeRaymarch
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(volume_raymarch_exports);
|
|
23
|
+
const source = (
|
|
24
|
+
/* wgsl */
|
|
25
|
+
`fn volumeRaymarch_intersectBox(origin: vec3f, direction: vec3f, minimum: vec3f, maximum: vec3f) -> vec2f {
|
|
26
|
+
let safeDirection = select(vec3f(0.000001), direction, abs(direction) > vec3f(0.000001));
|
|
27
|
+
let first = (minimum - origin) / safeDirection;
|
|
28
|
+
let second = (maximum - origin) / safeDirection;
|
|
29
|
+
let nearPlane = min(first, second);
|
|
30
|
+
let farPlane = max(first, second);
|
|
31
|
+
return vec2f(
|
|
32
|
+
max(max(nearPlane.x, nearPlane.y), nearPlane.z),
|
|
33
|
+
min(min(farPlane.x, farPlane.y), farPlane.z)
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
fn volumeRaymarch_mixScalar(corners: array<f32, 8>, blend: vec3f) -> f32 {
|
|
38
|
+
let lower = mix(mix(corners[0], corners[1], blend.x), mix(corners[2], corners[3], blend.x), blend.y);
|
|
39
|
+
let upper = mix(mix(corners[4], corners[5], blend.x), mix(corners[6], corners[7], blend.x), blend.y);
|
|
40
|
+
return mix(lower, upper, blend.z);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
fn volumeRaymarch_mixVector(corners: array<vec3f, 8>, blend: vec3f) -> vec3f {
|
|
44
|
+
let lower = mix(mix(corners[0], corners[1], blend.x), mix(corners[2], corners[3], blend.x), blend.y);
|
|
45
|
+
let upper = mix(mix(corners[4], corners[5], blend.x), mix(corners[6], corners[7], blend.x), blend.y);
|
|
46
|
+
return mix(lower, upper, blend.z);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
fn volumeRaymarch_sequentialColor(value: f32, lowColor: vec3f, highColor: vec3f) -> vec3f {
|
|
50
|
+
return mix(lowColor, highColor, clamp(value, 0.0, 1.0));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
fn volumeRaymarch_signedColor(value: f32, negativeColor: vec3f, neutralColor: vec3f, positiveColor: vec3f) -> vec3f {
|
|
54
|
+
let amount = clamp(abs(value), 0.0, 1.0);
|
|
55
|
+
let signedTarget = select(negativeColor, positiveColor, value >= 0.0);
|
|
56
|
+
return mix(neutralColor, signedTarget, amount);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
fn volumeRaymarch_directionColor(vector: vec3f) -> vec3f {
|
|
60
|
+
let direction = normalize(vector + vec3f(0.00001));
|
|
61
|
+
return 0.18 + 0.82 * (direction * 0.5 + 0.5);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
fn volumeRaymarch_segmentDistance(point: vec3f, start: vec3f, end: vec3f) -> f32 {
|
|
65
|
+
let segment = end - start;
|
|
66
|
+
let fraction = clamp(dot(point - start, segment) / max(dot(segment, segment), 0.000001), 0.0, 1.0);
|
|
67
|
+
return length(point - (start + segment * fraction));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
fn volumeRaymarch_arrowDistance(
|
|
71
|
+
point: vec3f,
|
|
72
|
+
center: vec3f,
|
|
73
|
+
direction: vec3f,
|
|
74
|
+
arrowLength: f32,
|
|
75
|
+
shaftRadius: f32,
|
|
76
|
+
headRadius: f32
|
|
77
|
+
) -> vec2f {
|
|
78
|
+
let tail = center - direction * arrowLength * 0.48;
|
|
79
|
+
let shoulder = center + direction * arrowLength * 0.18;
|
|
80
|
+
let tip = center + direction * arrowLength * 0.52;
|
|
81
|
+
let shaftDistance = volumeRaymarch_segmentDistance(point, tail, shoulder) - shaftRadius;
|
|
82
|
+
let headVector = point - shoulder;
|
|
83
|
+
let headLength = max(length(tip - shoulder), 0.000001);
|
|
84
|
+
let headPosition = dot(headVector, direction);
|
|
85
|
+
let taperedRadius = headRadius * (1.0 - clamp(headPosition / headLength, 0.0, 1.0));
|
|
86
|
+
let radialDistance = length(headVector - direction * headPosition);
|
|
87
|
+
let headDistance = max(
|
|
88
|
+
radialDistance - taperedRadius,
|
|
89
|
+
max(-headPosition, headPosition - headLength)
|
|
90
|
+
);
|
|
91
|
+
return vec2f(min(shaftDistance, headDistance), headDistance);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
fn volumeRaymarch_composite(accumulated: vec4f, color: vec3f, alpha: f32) -> vec4f {
|
|
95
|
+
let contribution = (1.0 - accumulated.a) * clamp(alpha, 0.0, 1.0);
|
|
96
|
+
return vec4f(accumulated.rgb + color * contribution, accumulated.a + contribution);
|
|
97
|
+
}
|
|
98
|
+
`
|
|
99
|
+
);
|
|
100
|
+
const volumeRaymarch = {
|
|
101
|
+
name: "volumeRaymarch",
|
|
102
|
+
source
|
|
103
|
+
};
|
|
104
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
105
|
+
0 && (module.exports = {
|
|
106
|
+
volumeRaymarch
|
|
107
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** WGSL helpers shared by structured-volume ray marchers. */
|
|
2
|
+
export declare const volumeRaymarch: {
|
|
3
|
+
readonly name: "volumeRaymarch";
|
|
4
|
+
readonly source: "fn volumeRaymarch_intersectBox(origin: vec3f, direction: vec3f, minimum: vec3f, maximum: vec3f) -> vec2f {\n let safeDirection = select(vec3f(0.000001), direction, abs(direction) > vec3f(0.000001));\n let first = (minimum - origin) / safeDirection;\n let second = (maximum - origin) / safeDirection;\n let nearPlane = min(first, second);\n let farPlane = max(first, second);\n return vec2f(\n max(max(nearPlane.x, nearPlane.y), nearPlane.z),\n min(min(farPlane.x, farPlane.y), farPlane.z)\n );\n}\n\nfn volumeRaymarch_mixScalar(corners: array<f32, 8>, blend: vec3f) -> f32 {\n let lower = mix(mix(corners[0], corners[1], blend.x), mix(corners[2], corners[3], blend.x), blend.y);\n let upper = mix(mix(corners[4], corners[5], blend.x), mix(corners[6], corners[7], blend.x), blend.y);\n return mix(lower, upper, blend.z);\n}\n\nfn volumeRaymarch_mixVector(corners: array<vec3f, 8>, blend: vec3f) -> vec3f {\n let lower = mix(mix(corners[0], corners[1], blend.x), mix(corners[2], corners[3], blend.x), blend.y);\n let upper = mix(mix(corners[4], corners[5], blend.x), mix(corners[6], corners[7], blend.x), blend.y);\n return mix(lower, upper, blend.z);\n}\n\nfn volumeRaymarch_sequentialColor(value: f32, lowColor: vec3f, highColor: vec3f) -> vec3f {\n return mix(lowColor, highColor, clamp(value, 0.0, 1.0));\n}\n\nfn volumeRaymarch_signedColor(value: f32, negativeColor: vec3f, neutralColor: vec3f, positiveColor: vec3f) -> vec3f {\n let amount = clamp(abs(value), 0.0, 1.0);\n let signedTarget = select(negativeColor, positiveColor, value >= 0.0);\n return mix(neutralColor, signedTarget, amount);\n}\n\nfn volumeRaymarch_directionColor(vector: vec3f) -> vec3f {\n let direction = normalize(vector + vec3f(0.00001));\n return 0.18 + 0.82 * (direction * 0.5 + 0.5);\n}\n\nfn volumeRaymarch_segmentDistance(point: vec3f, start: vec3f, end: vec3f) -> f32 {\n let segment = end - start;\n let fraction = clamp(dot(point - start, segment) / max(dot(segment, segment), 0.000001), 0.0, 1.0);\n return length(point - (start + segment * fraction));\n}\n\nfn volumeRaymarch_arrowDistance(\n point: vec3f,\n center: vec3f,\n direction: vec3f,\n arrowLength: f32,\n shaftRadius: f32,\n headRadius: f32\n) -> vec2f {\n let tail = center - direction * arrowLength * 0.48;\n let shoulder = center + direction * arrowLength * 0.18;\n let tip = center + direction * arrowLength * 0.52;\n let shaftDistance = volumeRaymarch_segmentDistance(point, tail, shoulder) - shaftRadius;\n let headVector = point - shoulder;\n let headLength = max(length(tip - shoulder), 0.000001);\n let headPosition = dot(headVector, direction);\n let taperedRadius = headRadius * (1.0 - clamp(headPosition / headLength, 0.0, 1.0));\n let radialDistance = length(headVector - direction * headPosition);\n let headDistance = max(\n radialDistance - taperedRadius,\n max(-headPosition, headPosition - headLength)\n );\n return vec2f(min(shaftDistance, headDistance), headDistance);\n}\n\nfn volumeRaymarch_composite(accumulated: vec4f, color: vec3f, alpha: f32) -> vec4f {\n let contribution = (1.0 - accumulated.a) * clamp(alpha, 0.0, 1.0);\n return vec4f(accumulated.rgb + color * contribution, accumulated.a + contribution);\n}\n";
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=volume-raymarch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"volume-raymarch.d.ts","sourceRoot":"","sources":["../../../src/modules/volume/volume-raymarch.ts"],"names":[],"mappings":"AAkFA,6DAA6D;AAC7D,eAAO,MAAM,cAAc;;;CAGc,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
const source = /* wgsl */ `\
|
|
5
|
+
fn volumeRaymarch_intersectBox(origin: vec3f, direction: vec3f, minimum: vec3f, maximum: vec3f) -> vec2f {
|
|
6
|
+
let safeDirection = select(vec3f(0.000001), direction, abs(direction) > vec3f(0.000001));
|
|
7
|
+
let first = (minimum - origin) / safeDirection;
|
|
8
|
+
let second = (maximum - origin) / safeDirection;
|
|
9
|
+
let nearPlane = min(first, second);
|
|
10
|
+
let farPlane = max(first, second);
|
|
11
|
+
return vec2f(
|
|
12
|
+
max(max(nearPlane.x, nearPlane.y), nearPlane.z),
|
|
13
|
+
min(min(farPlane.x, farPlane.y), farPlane.z)
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
fn volumeRaymarch_mixScalar(corners: array<f32, 8>, blend: vec3f) -> f32 {
|
|
18
|
+
let lower = mix(mix(corners[0], corners[1], blend.x), mix(corners[2], corners[3], blend.x), blend.y);
|
|
19
|
+
let upper = mix(mix(corners[4], corners[5], blend.x), mix(corners[6], corners[7], blend.x), blend.y);
|
|
20
|
+
return mix(lower, upper, blend.z);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
fn volumeRaymarch_mixVector(corners: array<vec3f, 8>, blend: vec3f) -> vec3f {
|
|
24
|
+
let lower = mix(mix(corners[0], corners[1], blend.x), mix(corners[2], corners[3], blend.x), blend.y);
|
|
25
|
+
let upper = mix(mix(corners[4], corners[5], blend.x), mix(corners[6], corners[7], blend.x), blend.y);
|
|
26
|
+
return mix(lower, upper, blend.z);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
fn volumeRaymarch_sequentialColor(value: f32, lowColor: vec3f, highColor: vec3f) -> vec3f {
|
|
30
|
+
return mix(lowColor, highColor, clamp(value, 0.0, 1.0));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
fn volumeRaymarch_signedColor(value: f32, negativeColor: vec3f, neutralColor: vec3f, positiveColor: vec3f) -> vec3f {
|
|
34
|
+
let amount = clamp(abs(value), 0.0, 1.0);
|
|
35
|
+
let signedTarget = select(negativeColor, positiveColor, value >= 0.0);
|
|
36
|
+
return mix(neutralColor, signedTarget, amount);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
fn volumeRaymarch_directionColor(vector: vec3f) -> vec3f {
|
|
40
|
+
let direction = normalize(vector + vec3f(0.00001));
|
|
41
|
+
return 0.18 + 0.82 * (direction * 0.5 + 0.5);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
fn volumeRaymarch_segmentDistance(point: vec3f, start: vec3f, end: vec3f) -> f32 {
|
|
45
|
+
let segment = end - start;
|
|
46
|
+
let fraction = clamp(dot(point - start, segment) / max(dot(segment, segment), 0.000001), 0.0, 1.0);
|
|
47
|
+
return length(point - (start + segment * fraction));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
fn volumeRaymarch_arrowDistance(
|
|
51
|
+
point: vec3f,
|
|
52
|
+
center: vec3f,
|
|
53
|
+
direction: vec3f,
|
|
54
|
+
arrowLength: f32,
|
|
55
|
+
shaftRadius: f32,
|
|
56
|
+
headRadius: f32
|
|
57
|
+
) -> vec2f {
|
|
58
|
+
let tail = center - direction * arrowLength * 0.48;
|
|
59
|
+
let shoulder = center + direction * arrowLength * 0.18;
|
|
60
|
+
let tip = center + direction * arrowLength * 0.52;
|
|
61
|
+
let shaftDistance = volumeRaymarch_segmentDistance(point, tail, shoulder) - shaftRadius;
|
|
62
|
+
let headVector = point - shoulder;
|
|
63
|
+
let headLength = max(length(tip - shoulder), 0.000001);
|
|
64
|
+
let headPosition = dot(headVector, direction);
|
|
65
|
+
let taperedRadius = headRadius * (1.0 - clamp(headPosition / headLength, 0.0, 1.0));
|
|
66
|
+
let radialDistance = length(headVector - direction * headPosition);
|
|
67
|
+
let headDistance = max(
|
|
68
|
+
radialDistance - taperedRadius,
|
|
69
|
+
max(-headPosition, headPosition - headLength)
|
|
70
|
+
);
|
|
71
|
+
return vec2f(min(shaftDistance, headDistance), headDistance);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
fn volumeRaymarch_composite(accumulated: vec4f, color: vec3f, alpha: f32) -> vec4f {
|
|
75
|
+
let contribution = (1.0 - accumulated.a) * clamp(alpha, 0.0, 1.0);
|
|
76
|
+
return vec4f(accumulated.rgb + color * contribution, accumulated.a + contribution);
|
|
77
|
+
}
|
|
78
|
+
`;
|
|
79
|
+
/** WGSL helpers shared by structured-volume ray marchers. */
|
|
80
|
+
export const volumeRaymarch = {
|
|
81
|
+
name: 'volumeRaymarch',
|
|
82
|
+
source
|
|
83
|
+
};
|
|
84
|
+
//# sourceMappingURL=volume-raymarch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"volume-raymarch.js","sourceRoot":"","sources":["../../../src/modules/volume/volume-raymarch.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAI5D,MAAM,MAAM,GAAG,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0EzB,CAAC;AAEF,6DAA6D;AAC7D,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,gBAAgB;IACtB,MAAM;CACiC,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var align_to_exports = {};
|
|
19
|
+
__export(align_to_exports, {
|
|
20
|
+
alignTo: () => alignTo
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(align_to_exports);
|
|
23
|
+
function alignTo(size, count) {
|
|
24
|
+
switch (count) {
|
|
25
|
+
case 1:
|
|
26
|
+
return size;
|
|
27
|
+
// Pad upwards to even multiple of 2
|
|
28
|
+
case 2:
|
|
29
|
+
return size + size % 2;
|
|
30
|
+
// Pad upwards to even multiple of 2
|
|
31
|
+
default:
|
|
32
|
+
return size + (4 - size % 4) % 4;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
36
|
+
0 && (module.exports = {
|
|
37
|
+
alignTo
|
|
38
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"align-to.d.ts","sourceRoot":"","sources":["../../src/types/align-to.ts"],"names":[],"mappings":"AAIA,4DAA4D;AAC5D,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAO3D"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
/** Align offset to 1, 2 or 4 elements (4, 8 or 16 bytes) */
|
|
5
|
+
export function alignTo(size, count) {
|
|
6
|
+
// biome-ignore format: preserve layout
|
|
7
|
+
switch (count) {
|
|
8
|
+
case 1: return size; // Pad upwards to even multiple of 2
|
|
9
|
+
case 2: return size + (size % 2); // Pad upwards to even multiple of 2
|
|
10
|
+
default: return size + ((4 - (size % 4)) % 4); // Pad upwards to even multiple of 4
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=align-to.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"align-to.js","sourceRoot":"","sources":["../../src/types/align-to.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAE5D,4DAA4D;AAC5D,MAAM,UAAU,OAAO,CAAC,IAAY,EAAE,KAAa;IACjD,uCAAuC;IACvC,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,oCAAoC;QACzD,KAAK,CAAC,CAAC,CAAC,OAAO,IAAI,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,oCAAoC;QACtE,OAAO,CAAC,CAAC,OAAO,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,oCAAoC;IACrF,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
var primitive_data_types_exports = {};
|
|
15
|
+
module.exports = __toCommonJS(primitive_data_types_exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Primitive data types that shaders can perform calculations in and declare variables with.
|
|
3
|
+
* @note attribute inputs and texture samples can be populated from a different in-memory types, see below.
|
|
4
|
+
* @note `f16` requires the `f16` extension
|
|
5
|
+
*/
|
|
6
|
+
export type PrimitiveDataType = 'u32' | 'i32' | 'f32' | 'f16';
|
|
7
|
+
//# sourceMappingURL=primitive-data-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitive-data-types.d.ts","sourceRoot":"","sources":["../../src/types/primitive-data-types.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitive-data-types.js","sourceRoot":"","sources":["../../src/types/primitive-data-types.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
var sampler_props_exports = {};
|
|
15
|
+
module.exports = __toCommonJS(sampler_props_exports);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type CompareFunction = 'never' | 'less' | 'equal' | 'less-equal' | 'greater' | 'not-equal' | 'greater-equal' | 'always';
|
|
2
|
+
export type SamplerProps = {
|
|
3
|
+
/** Comparison / shadow samplers are used with depth textures. See the `Sampler.compare` field */
|
|
4
|
+
type?: 'color-sampler' | 'comparison-sampler';
|
|
5
|
+
/** Edge value sampling in X direction */
|
|
6
|
+
addressModeU?: 'clamp-to-edge' | 'repeat' | 'mirror-repeat';
|
|
7
|
+
/** Edge value sampling in Y direction */
|
|
8
|
+
addressModeV?: 'clamp-to-edge' | 'repeat' | 'mirror-repeat';
|
|
9
|
+
/** Edge value sampling in Z direction */
|
|
10
|
+
addressModeW?: 'clamp-to-edge' | 'repeat' | 'mirror-repeat';
|
|
11
|
+
/** Magnification: the area of the fragment in texture space is smaller than a texel */
|
|
12
|
+
magFilter?: 'nearest' | 'linear';
|
|
13
|
+
/** Minification: the area of the fragment in texture space is larger than a texel */
|
|
14
|
+
minFilter?: 'nearest' | 'linear';
|
|
15
|
+
/** mipmapping: select between multiple mipmaps based on angle and size of the texture relative to the screen. */
|
|
16
|
+
mipmapFilter?: 'none' | 'nearest' | 'linear';
|
|
17
|
+
/** Affects the mipmap image selection */
|
|
18
|
+
lodMinClamp?: number;
|
|
19
|
+
/** Affects the mipmap image selection */
|
|
20
|
+
lodMaxClamp?: number;
|
|
21
|
+
/** Maximum number of samples that can be taken of the texture during any one texture fetch */
|
|
22
|
+
maxAnisotropy?: number;
|
|
23
|
+
/** How to compare reference values provided in shader shadow sampler calls with those pulled from the texture */
|
|
24
|
+
compare?: CompareFunction;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=sampler-props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sampler-props.d.ts","sourceRoot":"","sources":["../../src/types/sampler-props.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,eAAe,GACvB,OAAO,GACP,MAAM,GACN,OAAO,GACP,YAAY,GACZ,SAAS,GACT,WAAW,GACX,eAAe,GACf,QAAQ,CAAC;AAEb,MAAM,MAAM,YAAY,GAAG;IACzB,iGAAiG;IACjG,IAAI,CAAC,EAAE,eAAe,GAAG,oBAAoB,CAAC;IAC9C,yCAAyC;IACzC,YAAY,CAAC,EAAE,eAAe,GAAG,QAAQ,GAAG,eAAe,CAAC;IAC5D,yCAAyC;IACzC,YAAY,CAAC,EAAE,eAAe,GAAG,QAAQ,GAAG,eAAe,CAAC;IAC5D,yCAAyC;IACzC,YAAY,CAAC,EAAE,eAAe,GAAG,QAAQ,GAAG,eAAe,CAAC;IAE5D,uFAAuF;IACvF,SAAS,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IACjC,qFAAqF;IACrF,SAAS,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IACjC,iHAAiH;IACjH,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;IAC7C,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8FAA8F;IAC9F,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iHAAiH;IACjH,OAAO,CAAC,EAAE,eAAe,CAAC;CAC3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sampler-props.js","sourceRoot":"","sources":["../../src/types/sampler-props.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D"}
|