@luma.gl/shaders 0.0.0-stage → 10.0.0-alpha.10
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 +19880 -0
- package/dist/dist.min.js +12192 -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 +243 -0
- package/dist/index.cjs.map +6 -0
- package/dist/index.d.ts +91 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +65 -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/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-material/pbr-material-glsl.cjs +1767 -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 +1745 -0
- package/dist/modules/lighting/pbr-material/pbr-material-glsl.js.map +1 -0
- package/dist/modules/lighting/pbr-material/pbr-material-wgsl.cjs +2062 -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 +2040 -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/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/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/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 +259 -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/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-material/pbr-material-glsl.ts +1748 -0
- package/src/modules/lighting/pbr-material/pbr-material-wgsl.ts +2043 -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/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/surface-weather/README.md +28 -0
- package/src/modules/lighting/surface-weather/surface-weather.ts +198 -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,93 @@
|
|
|
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 path_dash_exports = {};
|
|
19
|
+
__export(path_dash_exports, {
|
|
20
|
+
pathDash: () => pathDash
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(path_dash_exports);
|
|
23
|
+
const DEFAULT_UNIFORMS = { dashLength: 12, gapLength: 8, offset: 0 };
|
|
24
|
+
const pathDash = {
|
|
25
|
+
name: "pathDash",
|
|
26
|
+
bindingLayout: [{ name: "pathDash", group: 3 }],
|
|
27
|
+
firstBindingSlot: 0,
|
|
28
|
+
uniformTypes: { dashLength: "f32", gapLength: "f32", offset: "f32" },
|
|
29
|
+
defaultUniforms: DEFAULT_UNIFORMS,
|
|
30
|
+
getUniforms(props = {}, previousUniforms = DEFAULT_UNIFORMS) {
|
|
31
|
+
const uniforms = { ...DEFAULT_UNIFORMS, ...previousUniforms };
|
|
32
|
+
if (props.dashLength !== void 0)
|
|
33
|
+
uniforms.dashLength = Math.max(0, props.dashLength);
|
|
34
|
+
if (props.gapLength !== void 0)
|
|
35
|
+
uniforms.gapLength = Math.max(0, props.gapLength);
|
|
36
|
+
if (props.offset !== void 0)
|
|
37
|
+
uniforms.offset = props.offset;
|
|
38
|
+
return uniforms;
|
|
39
|
+
},
|
|
40
|
+
fs: (
|
|
41
|
+
/* glsl */
|
|
42
|
+
`
|
|
43
|
+
layout(std140) uniform pathDashUniforms {
|
|
44
|
+
float dashLength;
|
|
45
|
+
float gapLength;
|
|
46
|
+
float offset;
|
|
47
|
+
} pathDash;
|
|
48
|
+
float pathDash_integral(float coordinate, float fraction) {
|
|
49
|
+
return floor(coordinate) * fraction + min(fract(coordinate), fraction);
|
|
50
|
+
}
|
|
51
|
+
float pathDash_getCoverage(float distanceAlongPath) {
|
|
52
|
+
float period = max(pathDash.dashLength + pathDash.gapLength, 0.0001);
|
|
53
|
+
float coordinate = (distanceAlongPath + pathDash.offset) / period;
|
|
54
|
+
float extent = max(fwidth(coordinate), 0.0001);
|
|
55
|
+
float center = fract(coordinate);
|
|
56
|
+
float fraction = pathDash.dashLength / period;
|
|
57
|
+
float coverage = (pathDash_integral(center + extent * 0.5, fraction) - pathDash_integral(center - extent * 0.5, fraction)) / extent;
|
|
58
|
+
if (pathDash.gapLength <= 0.0) return 1.0;
|
|
59
|
+
if (pathDash.dashLength <= 0.0) return 0.0;
|
|
60
|
+
return clamp(coverage, 0.0, 1.0);
|
|
61
|
+
}
|
|
62
|
+
`
|
|
63
|
+
),
|
|
64
|
+
source: (
|
|
65
|
+
/* wgsl */
|
|
66
|
+
`
|
|
67
|
+
struct pathDashUniforms {
|
|
68
|
+
dashLength: f32,
|
|
69
|
+
gapLength: f32,
|
|
70
|
+
offset: f32,
|
|
71
|
+
};
|
|
72
|
+
@group(3) @binding(auto) var<uniform> pathDash: pathDashUniforms;
|
|
73
|
+
fn pathDash_integral(coordinate: f32, fraction: f32) -> f32 {
|
|
74
|
+
return floor(coordinate) * fraction + min(fract(coordinate), fraction);
|
|
75
|
+
}
|
|
76
|
+
fn pathDash_getCoverage(distanceAlongPath: f32) -> f32 {
|
|
77
|
+
let period = max(pathDash.dashLength + pathDash.gapLength, 0.0001);
|
|
78
|
+
let coordinate = (distanceAlongPath + pathDash.offset) / period;
|
|
79
|
+
let extent = max(fwidth(coordinate), 0.0001);
|
|
80
|
+
let center = fract(coordinate);
|
|
81
|
+
let fraction = pathDash.dashLength / period;
|
|
82
|
+
let coverage = (pathDash_integral(center + extent * 0.5, fraction) - pathDash_integral(center - extent * 0.5, fraction)) / extent;
|
|
83
|
+
if (pathDash.gapLength <= 0.0) { return 1.0; }
|
|
84
|
+
if (pathDash.dashLength <= 0.0) { return 0.0; }
|
|
85
|
+
return clamp(coverage, 0.0, 1.0);
|
|
86
|
+
}
|
|
87
|
+
`
|
|
88
|
+
)
|
|
89
|
+
};
|
|
90
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
91
|
+
0 && (module.exports = {
|
|
92
|
+
pathDash
|
|
93
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ShaderModule } from "../../../lib/shader-module/shader-module.js";
|
|
2
|
+
export type PathDashUniforms = {
|
|
3
|
+
dashLength: number;
|
|
4
|
+
gapLength: number;
|
|
5
|
+
offset: number;
|
|
6
|
+
};
|
|
7
|
+
export type PathDashProps = Partial<PathDashUniforms>;
|
|
8
|
+
/** Filtered dash coverage from cumulative path distance, independent of coordinate units. */
|
|
9
|
+
export declare const pathDash: ShaderModule<PathDashProps, PathDashUniforms>;
|
|
10
|
+
//# sourceMappingURL=path-dash.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path-dash.d.ts","sourceRoot":"","sources":["../../../../src/modules/geometry/path-dash/path-dash.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,YAAY,EAAC,oDAAiD;AAE3E,MAAM,MAAM,gBAAgB,GAAG;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAC,CAAC;AACvF,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAGtD,6FAA6F;AAC7F,eAAO,MAAM,QAAQ,EAAE,YAAY,CAAC,aAAa,EAAE,gBAAgB,CAwDlE,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
const DEFAULT_UNIFORMS = { dashLength: 12, gapLength: 8, offset: 0 };
|
|
5
|
+
/** Filtered dash coverage from cumulative path distance, independent of coordinate units. */
|
|
6
|
+
export const pathDash = {
|
|
7
|
+
name: 'pathDash',
|
|
8
|
+
bindingLayout: [{ name: 'pathDash', group: 3 }],
|
|
9
|
+
firstBindingSlot: 0,
|
|
10
|
+
uniformTypes: { dashLength: 'f32', gapLength: 'f32', offset: 'f32' },
|
|
11
|
+
defaultUniforms: DEFAULT_UNIFORMS,
|
|
12
|
+
getUniforms(props = {}, previousUniforms = DEFAULT_UNIFORMS) {
|
|
13
|
+
const uniforms = { ...DEFAULT_UNIFORMS, ...previousUniforms };
|
|
14
|
+
if (props.dashLength !== undefined)
|
|
15
|
+
uniforms.dashLength = Math.max(0, props.dashLength);
|
|
16
|
+
if (props.gapLength !== undefined)
|
|
17
|
+
uniforms.gapLength = Math.max(0, props.gapLength);
|
|
18
|
+
if (props.offset !== undefined)
|
|
19
|
+
uniforms.offset = props.offset;
|
|
20
|
+
return uniforms;
|
|
21
|
+
},
|
|
22
|
+
fs: /* glsl */ `
|
|
23
|
+
layout(std140) uniform pathDashUniforms {
|
|
24
|
+
float dashLength;
|
|
25
|
+
float gapLength;
|
|
26
|
+
float offset;
|
|
27
|
+
} pathDash;
|
|
28
|
+
float pathDash_integral(float coordinate, float fraction) {
|
|
29
|
+
return floor(coordinate) * fraction + min(fract(coordinate), fraction);
|
|
30
|
+
}
|
|
31
|
+
float pathDash_getCoverage(float distanceAlongPath) {
|
|
32
|
+
float period = max(pathDash.dashLength + pathDash.gapLength, 0.0001);
|
|
33
|
+
float coordinate = (distanceAlongPath + pathDash.offset) / period;
|
|
34
|
+
float extent = max(fwidth(coordinate), 0.0001);
|
|
35
|
+
float center = fract(coordinate);
|
|
36
|
+
float fraction = pathDash.dashLength / period;
|
|
37
|
+
float coverage = (pathDash_integral(center + extent * 0.5, fraction) - pathDash_integral(center - extent * 0.5, fraction)) / extent;
|
|
38
|
+
if (pathDash.gapLength <= 0.0) return 1.0;
|
|
39
|
+
if (pathDash.dashLength <= 0.0) return 0.0;
|
|
40
|
+
return clamp(coverage, 0.0, 1.0);
|
|
41
|
+
}
|
|
42
|
+
`,
|
|
43
|
+
source: /* wgsl */ `
|
|
44
|
+
struct pathDashUniforms {
|
|
45
|
+
dashLength: f32,
|
|
46
|
+
gapLength: f32,
|
|
47
|
+
offset: f32,
|
|
48
|
+
};
|
|
49
|
+
@group(3) @binding(auto) var<uniform> pathDash: pathDashUniforms;
|
|
50
|
+
fn pathDash_integral(coordinate: f32, fraction: f32) -> f32 {
|
|
51
|
+
return floor(coordinate) * fraction + min(fract(coordinate), fraction);
|
|
52
|
+
}
|
|
53
|
+
fn pathDash_getCoverage(distanceAlongPath: f32) -> f32 {
|
|
54
|
+
let period = max(pathDash.dashLength + pathDash.gapLength, 0.0001);
|
|
55
|
+
let coordinate = (distanceAlongPath + pathDash.offset) / period;
|
|
56
|
+
let extent = max(fwidth(coordinate), 0.0001);
|
|
57
|
+
let center = fract(coordinate);
|
|
58
|
+
let fraction = pathDash.dashLength / period;
|
|
59
|
+
let coverage = (pathDash_integral(center + extent * 0.5, fraction) - pathDash_integral(center - extent * 0.5, fraction)) / extent;
|
|
60
|
+
if (pathDash.gapLength <= 0.0) { return 1.0; }
|
|
61
|
+
if (pathDash.dashLength <= 0.0) { return 0.0; }
|
|
62
|
+
return clamp(coverage, 0.0, 1.0);
|
|
63
|
+
}
|
|
64
|
+
`
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=path-dash.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path-dash.js","sourceRoot":"","sources":["../../../../src/modules/geometry/path-dash/path-dash.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAM5D,MAAM,gBAAgB,GAAqB,EAAC,UAAU,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAC,CAAC;AAErF,6FAA6F;AAC7F,MAAM,CAAC,MAAM,QAAQ,GAAkD;IACrE,IAAI,EAAE,UAAU;IAChB,aAAa,EAAE,CAAC,EAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,EAAC,CAAC;IAC7C,gBAAgB,EAAE,CAAC;IACnB,YAAY,EAAE,EAAC,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAC;IAClE,eAAe,EAAE,gBAAgB;IACjC,WAAW,CAAC,KAAK,GAAG,EAAE,EAAE,gBAAgB,GAAG,gBAAgB;QACzD,MAAM,QAAQ,GAAG,EAAC,GAAG,gBAAgB,EAAE,GAAG,gBAAgB,EAAC,CAAC;QAC5D,IAAI,KAAK,CAAC,UAAU,KAAK,SAAS;YAAE,QAAQ,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;QACxF,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS;YAAE,QAAQ,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;QACrF,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS;YAAE,QAAQ,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QAC/D,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,EAAE,EAAE,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;CAoBhB;IACC,MAAM,EAAE,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;CAqBpB;CACA,CAAC"}
|
|
@@ -0,0 +1,117 @@
|
|
|
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 pattern_fill_shaders_exports = {};
|
|
19
|
+
__export(pattern_fill_shaders_exports, {
|
|
20
|
+
PATTERN_FILL_GLSL: () => PATTERN_FILL_GLSL,
|
|
21
|
+
PATTERN_FILL_WGSL: () => PATTERN_FILL_WGSL
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(pattern_fill_shaders_exports);
|
|
24
|
+
const PATTERN_FILL_GLSL = (
|
|
25
|
+
/* glsl */
|
|
26
|
+
`
|
|
27
|
+
layout(std140) uniform patternFillUniforms {
|
|
28
|
+
int patternType;
|
|
29
|
+
float spacing;
|
|
30
|
+
float width;
|
|
31
|
+
float angle;
|
|
32
|
+
vec2 offset;
|
|
33
|
+
} patternFill;
|
|
34
|
+
|
|
35
|
+
// Integral of a unit-period pulse. Filtering the integral preserves mean coverage at distance.
|
|
36
|
+
float patternFill_integral(float coordinate, float width) {
|
|
37
|
+
return floor(coordinate) * width + min(fract(coordinate), width);
|
|
38
|
+
}
|
|
39
|
+
float patternFill_stripe(float coordinate, float footprint, float width) {
|
|
40
|
+
float extent = max(footprint, 0.0001);
|
|
41
|
+
float center = fract(coordinate + width * 0.5);
|
|
42
|
+
return clamp((patternFill_integral(center + extent * 0.5, width) -
|
|
43
|
+
patternFill_integral(center - extent * 0.5, width)) / extent, 0.0, 1.0);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
float patternFill_getCoverage(vec2 coordinates) {
|
|
47
|
+
float cosine = cos(patternFill.angle);
|
|
48
|
+
float sine = sin(patternFill.angle);
|
|
49
|
+
vec2 local = coordinates - patternFill.offset;
|
|
50
|
+
vec2 rotated = vec2(dot(local, vec2(cosine, sine)), dot(local, vec2(-sine, cosine)));
|
|
51
|
+
vec2 phase = rotated / max(patternFill.spacing, 0.0001);
|
|
52
|
+
// Evaluate derivatives before pattern selection so WGSL and GLSL use the same footprint.
|
|
53
|
+
vec2 footprint = fwidth(phase);
|
|
54
|
+
float width = clamp(patternFill.width, 0.0, 1.0);
|
|
55
|
+
float first = patternFill_stripe(phase.x, footprint.x, width);
|
|
56
|
+
float second = patternFill_stripe(phase.y, footprint.y, width);
|
|
57
|
+
vec2 cell = fract(phase + 0.5) - 0.5;
|
|
58
|
+
float radius = width * 0.5;
|
|
59
|
+
float dots = clamp(0.5 + (radius - length(cell)) / max(length(footprint), 0.0001), 0.0, 1.0);
|
|
60
|
+
float dotMean = 3.141592653589793 * radius * radius;
|
|
61
|
+
dots = mix(dots, dotMean, smoothstep(0.35, 1.0, max(footprint.x, footprint.y)));
|
|
62
|
+
if (width <= 0.0) return 0.0;
|
|
63
|
+
if (patternFill.patternType == 2) return dots;
|
|
64
|
+
if (patternFill.patternType == 1) return first + second - first * second;
|
|
65
|
+
return first;
|
|
66
|
+
}
|
|
67
|
+
`
|
|
68
|
+
);
|
|
69
|
+
const PATTERN_FILL_WGSL = (
|
|
70
|
+
/* wgsl */
|
|
71
|
+
`
|
|
72
|
+
struct patternFillUniforms {
|
|
73
|
+
patternType: i32,
|
|
74
|
+
spacing: f32,
|
|
75
|
+
width: f32,
|
|
76
|
+
angle: f32,
|
|
77
|
+
offset: vec2<f32>,
|
|
78
|
+
};
|
|
79
|
+
@group(3) @binding(auto) var<uniform> patternFill: patternFillUniforms;
|
|
80
|
+
|
|
81
|
+
fn patternFill_integral(coordinate: f32, width: f32) -> f32 {
|
|
82
|
+
return floor(coordinate) * width + min(fract(coordinate), width);
|
|
83
|
+
}
|
|
84
|
+
fn patternFill_stripe(coordinate: f32, footprint: f32, width: f32) -> f32 {
|
|
85
|
+
let extent = max(footprint, 0.0001);
|
|
86
|
+
let center = fract(coordinate + width * 0.5);
|
|
87
|
+
return clamp((patternFill_integral(center + extent * 0.5, width) -
|
|
88
|
+
patternFill_integral(center - extent * 0.5, width)) / extent, 0.0, 1.0);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
fn patternFill_getCoverage(coordinates: vec2<f32>) -> f32 {
|
|
92
|
+
let cosine = cos(patternFill.angle);
|
|
93
|
+
let sine = sin(patternFill.angle);
|
|
94
|
+
let local = coordinates - patternFill.offset;
|
|
95
|
+
let rotated = vec2<f32>(dot(local, vec2<f32>(cosine, sine)), dot(local, vec2<f32>(-sine, cosine)));
|
|
96
|
+
let phase = rotated / max(patternFill.spacing, 0.0001);
|
|
97
|
+
let footprint = fwidth(phase);
|
|
98
|
+
let width = clamp(patternFill.width, 0.0, 1.0);
|
|
99
|
+
let first = patternFill_stripe(phase.x, footprint.x, width);
|
|
100
|
+
let second = patternFill_stripe(phase.y, footprint.y, width);
|
|
101
|
+
let cell = fract(phase + 0.5) - 0.5;
|
|
102
|
+
let radius = width * 0.5;
|
|
103
|
+
var dots = clamp(0.5 + (radius - length(cell)) / max(length(footprint), 0.0001), 0.0, 1.0);
|
|
104
|
+
let dotMean = 3.141592653589793 * radius * radius;
|
|
105
|
+
dots = mix(dots, dotMean, smoothstep(0.35, 1.0, max(footprint.x, footprint.y)));
|
|
106
|
+
if (width <= 0.0) { return 0.0; }
|
|
107
|
+
if (patternFill.patternType == 2) { return dots; }
|
|
108
|
+
if (patternFill.patternType == 1) { return first + second - first * second; }
|
|
109
|
+
return first;
|
|
110
|
+
}
|
|
111
|
+
`
|
|
112
|
+
);
|
|
113
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
114
|
+
0 && (module.exports = {
|
|
115
|
+
PATTERN_FILL_GLSL,
|
|
116
|
+
PATTERN_FILL_WGSL
|
|
117
|
+
});
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const PATTERN_FILL_GLSL = "\nlayout(std140) uniform patternFillUniforms {\n int patternType;\n float spacing;\n float width;\n float angle;\n vec2 offset;\n} patternFill;\n\n// Integral of a unit-period pulse. Filtering the integral preserves mean coverage at distance.\nfloat patternFill_integral(float coordinate, float width) {\n return floor(coordinate) * width + min(fract(coordinate), width);\n}\nfloat patternFill_stripe(float coordinate, float footprint, float width) {\n float extent = max(footprint, 0.0001);\n float center = fract(coordinate + width * 0.5);\n return clamp((patternFill_integral(center + extent * 0.5, width) -\n patternFill_integral(center - extent * 0.5, width)) / extent, 0.0, 1.0);\n}\n\nfloat patternFill_getCoverage(vec2 coordinates) {\n float cosine = cos(patternFill.angle);\n float sine = sin(patternFill.angle);\n vec2 local = coordinates - patternFill.offset;\n vec2 rotated = vec2(dot(local, vec2(cosine, sine)), dot(local, vec2(-sine, cosine)));\n vec2 phase = rotated / max(patternFill.spacing, 0.0001);\n // Evaluate derivatives before pattern selection so WGSL and GLSL use the same footprint.\n vec2 footprint = fwidth(phase);\n float width = clamp(patternFill.width, 0.0, 1.0);\n float first = patternFill_stripe(phase.x, footprint.x, width);\n float second = patternFill_stripe(phase.y, footprint.y, width);\n vec2 cell = fract(phase + 0.5) - 0.5;\n float radius = width * 0.5;\n float dots = clamp(0.5 + (radius - length(cell)) / max(length(footprint), 0.0001), 0.0, 1.0);\n float dotMean = 3.141592653589793 * radius * radius;\n dots = mix(dots, dotMean, smoothstep(0.35, 1.0, max(footprint.x, footprint.y)));\n if (width <= 0.0) return 0.0;\n if (patternFill.patternType == 2) return dots;\n if (patternFill.patternType == 1) return first + second - first * second;\n return first;\n}\n";
|
|
2
|
+
export declare const PATTERN_FILL_WGSL = "\nstruct patternFillUniforms {\n patternType: i32,\n spacing: f32,\n width: f32,\n angle: f32,\n offset: vec2<f32>,\n};\n@group(3) @binding(auto) var<uniform> patternFill: patternFillUniforms;\n\nfn patternFill_integral(coordinate: f32, width: f32) -> f32 {\n return floor(coordinate) * width + min(fract(coordinate), width);\n}\nfn patternFill_stripe(coordinate: f32, footprint: f32, width: f32) -> f32 {\n let extent = max(footprint, 0.0001);\n let center = fract(coordinate + width * 0.5);\n return clamp((patternFill_integral(center + extent * 0.5, width) -\n patternFill_integral(center - extent * 0.5, width)) / extent, 0.0, 1.0);\n}\n\nfn patternFill_getCoverage(coordinates: vec2<f32>) -> f32 {\n let cosine = cos(patternFill.angle);\n let sine = sin(patternFill.angle);\n let local = coordinates - patternFill.offset;\n let rotated = vec2<f32>(dot(local, vec2<f32>(cosine, sine)), dot(local, vec2<f32>(-sine, cosine)));\n let phase = rotated / max(patternFill.spacing, 0.0001);\n let footprint = fwidth(phase);\n let width = clamp(patternFill.width, 0.0, 1.0);\n let first = patternFill_stripe(phase.x, footprint.x, width);\n let second = patternFill_stripe(phase.y, footprint.y, width);\n let cell = fract(phase + 0.5) - 0.5;\n let radius = width * 0.5;\n var dots = clamp(0.5 + (radius - length(cell)) / max(length(footprint), 0.0001), 0.0, 1.0);\n let dotMean = 3.141592653589793 * radius * radius;\n dots = mix(dots, dotMean, smoothstep(0.35, 1.0, max(footprint.x, footprint.y)));\n if (width <= 0.0) { return 0.0; }\n if (patternFill.patternType == 2) { return dots; }\n if (patternFill.patternType == 1) { return first + second - first * second; }\n return first;\n}\n";
|
|
3
|
+
//# sourceMappingURL=pattern-fill-shaders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pattern-fill-shaders.d.ts","sourceRoot":"","sources":["../../../../src/modules/geometry/pattern-fill/pattern-fill-shaders.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,iBAAiB,ozDAyC7B,CAAC;AAEF,eAAO,MAAM,iBAAiB,srDAwC7B,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
export const PATTERN_FILL_GLSL = /* glsl */ `
|
|
5
|
+
layout(std140) uniform patternFillUniforms {
|
|
6
|
+
int patternType;
|
|
7
|
+
float spacing;
|
|
8
|
+
float width;
|
|
9
|
+
float angle;
|
|
10
|
+
vec2 offset;
|
|
11
|
+
} patternFill;
|
|
12
|
+
|
|
13
|
+
// Integral of a unit-period pulse. Filtering the integral preserves mean coverage at distance.
|
|
14
|
+
float patternFill_integral(float coordinate, float width) {
|
|
15
|
+
return floor(coordinate) * width + min(fract(coordinate), width);
|
|
16
|
+
}
|
|
17
|
+
float patternFill_stripe(float coordinate, float footprint, float width) {
|
|
18
|
+
float extent = max(footprint, 0.0001);
|
|
19
|
+
float center = fract(coordinate + width * 0.5);
|
|
20
|
+
return clamp((patternFill_integral(center + extent * 0.5, width) -
|
|
21
|
+
patternFill_integral(center - extent * 0.5, width)) / extent, 0.0, 1.0);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
float patternFill_getCoverage(vec2 coordinates) {
|
|
25
|
+
float cosine = cos(patternFill.angle);
|
|
26
|
+
float sine = sin(patternFill.angle);
|
|
27
|
+
vec2 local = coordinates - patternFill.offset;
|
|
28
|
+
vec2 rotated = vec2(dot(local, vec2(cosine, sine)), dot(local, vec2(-sine, cosine)));
|
|
29
|
+
vec2 phase = rotated / max(patternFill.spacing, 0.0001);
|
|
30
|
+
// Evaluate derivatives before pattern selection so WGSL and GLSL use the same footprint.
|
|
31
|
+
vec2 footprint = fwidth(phase);
|
|
32
|
+
float width = clamp(patternFill.width, 0.0, 1.0);
|
|
33
|
+
float first = patternFill_stripe(phase.x, footprint.x, width);
|
|
34
|
+
float second = patternFill_stripe(phase.y, footprint.y, width);
|
|
35
|
+
vec2 cell = fract(phase + 0.5) - 0.5;
|
|
36
|
+
float radius = width * 0.5;
|
|
37
|
+
float dots = clamp(0.5 + (radius - length(cell)) / max(length(footprint), 0.0001), 0.0, 1.0);
|
|
38
|
+
float dotMean = 3.141592653589793 * radius * radius;
|
|
39
|
+
dots = mix(dots, dotMean, smoothstep(0.35, 1.0, max(footprint.x, footprint.y)));
|
|
40
|
+
if (width <= 0.0) return 0.0;
|
|
41
|
+
if (patternFill.patternType == 2) return dots;
|
|
42
|
+
if (patternFill.patternType == 1) return first + second - first * second;
|
|
43
|
+
return first;
|
|
44
|
+
}
|
|
45
|
+
`;
|
|
46
|
+
export const PATTERN_FILL_WGSL = /* wgsl */ `
|
|
47
|
+
struct patternFillUniforms {
|
|
48
|
+
patternType: i32,
|
|
49
|
+
spacing: f32,
|
|
50
|
+
width: f32,
|
|
51
|
+
angle: f32,
|
|
52
|
+
offset: vec2<f32>,
|
|
53
|
+
};
|
|
54
|
+
@group(3) @binding(auto) var<uniform> patternFill: patternFillUniforms;
|
|
55
|
+
|
|
56
|
+
fn patternFill_integral(coordinate: f32, width: f32) -> f32 {
|
|
57
|
+
return floor(coordinate) * width + min(fract(coordinate), width);
|
|
58
|
+
}
|
|
59
|
+
fn patternFill_stripe(coordinate: f32, footprint: f32, width: f32) -> f32 {
|
|
60
|
+
let extent = max(footprint, 0.0001);
|
|
61
|
+
let center = fract(coordinate + width * 0.5);
|
|
62
|
+
return clamp((patternFill_integral(center + extent * 0.5, width) -
|
|
63
|
+
patternFill_integral(center - extent * 0.5, width)) / extent, 0.0, 1.0);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
fn patternFill_getCoverage(coordinates: vec2<f32>) -> f32 {
|
|
67
|
+
let cosine = cos(patternFill.angle);
|
|
68
|
+
let sine = sin(patternFill.angle);
|
|
69
|
+
let local = coordinates - patternFill.offset;
|
|
70
|
+
let rotated = vec2<f32>(dot(local, vec2<f32>(cosine, sine)), dot(local, vec2<f32>(-sine, cosine)));
|
|
71
|
+
let phase = rotated / max(patternFill.spacing, 0.0001);
|
|
72
|
+
let footprint = fwidth(phase);
|
|
73
|
+
let width = clamp(patternFill.width, 0.0, 1.0);
|
|
74
|
+
let first = patternFill_stripe(phase.x, footprint.x, width);
|
|
75
|
+
let second = patternFill_stripe(phase.y, footprint.y, width);
|
|
76
|
+
let cell = fract(phase + 0.5) - 0.5;
|
|
77
|
+
let radius = width * 0.5;
|
|
78
|
+
var dots = clamp(0.5 + (radius - length(cell)) / max(length(footprint), 0.0001), 0.0, 1.0);
|
|
79
|
+
let dotMean = 3.141592653589793 * radius * radius;
|
|
80
|
+
dots = mix(dots, dotMean, smoothstep(0.35, 1.0, max(footprint.x, footprint.y)));
|
|
81
|
+
if (width <= 0.0) { return 0.0; }
|
|
82
|
+
if (patternFill.patternType == 2) { return dots; }
|
|
83
|
+
if (patternFill.patternType == 1) { return first + second - first * second; }
|
|
84
|
+
return first;
|
|
85
|
+
}
|
|
86
|
+
`;
|
|
87
|
+
//# sourceMappingURL=pattern-fill-shaders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pattern-fill-shaders.js","sourceRoot":"","sources":["../../../../src/modules/geometry/pattern-fill/pattern-fill-shaders.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAE5D,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyC3C,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwC3C,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
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 pattern_fill_exports = {};
|
|
19
|
+
__export(pattern_fill_exports, {
|
|
20
|
+
patternFill: () => patternFill
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(pattern_fill_exports);
|
|
23
|
+
var import_pattern_fill_shaders = require("./pattern-fill-shaders.cjs");
|
|
24
|
+
const DEFAULT_UNIFORMS = {
|
|
25
|
+
patternType: 0,
|
|
26
|
+
spacing: 8,
|
|
27
|
+
width: 0.12,
|
|
28
|
+
angle: Math.PI / 4,
|
|
29
|
+
offset: [0, 0]
|
|
30
|
+
};
|
|
31
|
+
const patternFill = {
|
|
32
|
+
name: "patternFill",
|
|
33
|
+
firstBindingSlot: 0,
|
|
34
|
+
bindingLayout: [{ name: "patternFill", group: 3 }],
|
|
35
|
+
source: import_pattern_fill_shaders.PATTERN_FILL_WGSL,
|
|
36
|
+
fs: import_pattern_fill_shaders.PATTERN_FILL_GLSL,
|
|
37
|
+
uniformTypes: {
|
|
38
|
+
patternType: "i32",
|
|
39
|
+
spacing: "f32",
|
|
40
|
+
width: "f32",
|
|
41
|
+
angle: "f32",
|
|
42
|
+
offset: "vec2<f32>"
|
|
43
|
+
},
|
|
44
|
+
defaultUniforms: DEFAULT_UNIFORMS,
|
|
45
|
+
getUniforms(props = {}, previousUniforms = DEFAULT_UNIFORMS) {
|
|
46
|
+
const uniforms = { ...DEFAULT_UNIFORMS, ...previousUniforms };
|
|
47
|
+
if (props.pattern !== void 0) {
|
|
48
|
+
uniforms.patternType = { hatch: 0, crosshatch: 1, dots: 2 }[props.pattern];
|
|
49
|
+
}
|
|
50
|
+
if (props.spacing !== void 0)
|
|
51
|
+
uniforms.spacing = Math.max(props.spacing, 1e-4);
|
|
52
|
+
if (props.width !== void 0)
|
|
53
|
+
uniforms.width = Math.min(1, Math.max(0, props.width));
|
|
54
|
+
if (props.angle !== void 0)
|
|
55
|
+
uniforms.angle = props.angle;
|
|
56
|
+
if (props.offset !== void 0)
|
|
57
|
+
uniforms.offset = props.offset;
|
|
58
|
+
return uniforms;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
62
|
+
0 && (module.exports = {
|
|
63
|
+
patternFill
|
|
64
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ShaderModule } from "../../../lib/shader-module/shader-module.js";
|
|
2
|
+
export type PatternFillUniforms = {
|
|
3
|
+
patternType: number;
|
|
4
|
+
spacing: number;
|
|
5
|
+
width: number;
|
|
6
|
+
angle: number;
|
|
7
|
+
offset: readonly [number, number];
|
|
8
|
+
};
|
|
9
|
+
export type PatternFillProps = Partial<Omit<PatternFillUniforms, 'patternType'>> & {
|
|
10
|
+
pattern?: 'hatch' | 'crosshatch' | 'dots';
|
|
11
|
+
};
|
|
12
|
+
/** Fragment coverage for coordinate-anchored, filtered hatch and dot fills. */
|
|
13
|
+
export declare const patternFill: ShaderModule<PatternFillProps, PatternFillUniforms>;
|
|
14
|
+
//# sourceMappingURL=pattern-fill.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pattern-fill.d.ts","sourceRoot":"","sources":["../../../../src/modules/geometry/pattern-fill/pattern-fill.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,YAAY,EAAC,oDAAiD;AAG3E,MAAM,MAAM,mBAAmB,GAAG;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,aAAa,CAAC,CAAC,GAAG;IACjF,OAAO,CAAC,EAAE,OAAO,GAAG,YAAY,GAAG,MAAM,CAAC;CAC3C,CAAC;AAUF,+EAA+E;AAC/E,eAAO,MAAM,WAAW,EAAE,YAAY,CAAC,gBAAgB,EAAE,mBAAmB,CAyB3E,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
import { PATTERN_FILL_GLSL, PATTERN_FILL_WGSL } from "./pattern-fill-shaders.js";
|
|
5
|
+
const DEFAULT_UNIFORMS = {
|
|
6
|
+
patternType: 0,
|
|
7
|
+
spacing: 8,
|
|
8
|
+
width: 0.12,
|
|
9
|
+
angle: Math.PI / 4,
|
|
10
|
+
offset: [0, 0]
|
|
11
|
+
};
|
|
12
|
+
/** Fragment coverage for coordinate-anchored, filtered hatch and dot fills. */
|
|
13
|
+
export const patternFill = {
|
|
14
|
+
name: 'patternFill',
|
|
15
|
+
firstBindingSlot: 0,
|
|
16
|
+
bindingLayout: [{ name: 'patternFill', group: 3 }],
|
|
17
|
+
source: PATTERN_FILL_WGSL,
|
|
18
|
+
fs: PATTERN_FILL_GLSL,
|
|
19
|
+
uniformTypes: {
|
|
20
|
+
patternType: 'i32',
|
|
21
|
+
spacing: 'f32',
|
|
22
|
+
width: 'f32',
|
|
23
|
+
angle: 'f32',
|
|
24
|
+
offset: 'vec2<f32>'
|
|
25
|
+
},
|
|
26
|
+
defaultUniforms: DEFAULT_UNIFORMS,
|
|
27
|
+
getUniforms(props = {}, previousUniforms = DEFAULT_UNIFORMS) {
|
|
28
|
+
const uniforms = { ...DEFAULT_UNIFORMS, ...previousUniforms };
|
|
29
|
+
if (props.pattern !== undefined) {
|
|
30
|
+
uniforms.patternType = { hatch: 0, crosshatch: 1, dots: 2 }[props.pattern];
|
|
31
|
+
}
|
|
32
|
+
if (props.spacing !== undefined)
|
|
33
|
+
uniforms.spacing = Math.max(props.spacing, 0.0001);
|
|
34
|
+
if (props.width !== undefined)
|
|
35
|
+
uniforms.width = Math.min(1, Math.max(0, props.width));
|
|
36
|
+
if (props.angle !== undefined)
|
|
37
|
+
uniforms.angle = props.angle;
|
|
38
|
+
if (props.offset !== undefined)
|
|
39
|
+
uniforms.offset = props.offset;
|
|
40
|
+
return uniforms;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=pattern-fill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pattern-fill.js","sourceRoot":"","sources":["../../../../src/modules/geometry/pattern-fill/pattern-fill.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAG5D,OAAO,EAAC,iBAAiB,EAAE,iBAAiB,EAAC,kCAA+B;AAc5E,MAAM,gBAAgB,GAAwB;IAC5C,WAAW,EAAE,CAAC;IACd,OAAO,EAAE,CAAC;IACV,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI,CAAC,EAAE,GAAG,CAAC;IAClB,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;CACf,CAAC;AAEF,+EAA+E;AAC/E,MAAM,CAAC,MAAM,WAAW,GAAwD;IAC9E,IAAI,EAAE,aAAa;IACnB,gBAAgB,EAAE,CAAC;IACnB,aAAa,EAAE,CAAC,EAAC,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,EAAC,CAAC;IAChD,MAAM,EAAE,iBAAiB;IACzB,EAAE,EAAE,iBAAiB;IACrB,YAAY,EAAE;QACZ,WAAW,EAAE,KAAK;QAClB,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,KAAK;QACZ,KAAK,EAAE,KAAK;QACZ,MAAM,EAAE,WAAW;KACpB;IACD,eAAe,EAAE,gBAAgB;IACjC,WAAW,CAAC,KAAK,GAAG,EAAE,EAAE,gBAAgB,GAAG,gBAAgB;QACzD,MAAM,QAAQ,GAAG,EAAC,GAAG,gBAAgB,EAAE,GAAG,gBAAgB,EAAC,CAAC;QAC5D,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAChC,QAAQ,CAAC,WAAW,GAAG,EAAC,KAAK,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC3E,CAAC;QACD,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS;YAAE,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACpF,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS;YAAE,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;QACtF,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS;YAAE,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QAC5D,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS;YAAE,QAAQ,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QAC/D,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
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 point_glow_exports = {};
|
|
19
|
+
__export(point_glow_exports, {
|
|
20
|
+
pointGlow: () => pointGlow
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(point_glow_exports);
|
|
23
|
+
const DEFAULT_UNIFORMS = {
|
|
24
|
+
coreRadius: 0.12,
|
|
25
|
+
coreIntensity: 1,
|
|
26
|
+
haloIntensity: 0.6,
|
|
27
|
+
falloff: 5
|
|
28
|
+
};
|
|
29
|
+
const pointGlow = {
|
|
30
|
+
name: "pointGlow",
|
|
31
|
+
firstBindingSlot: 0,
|
|
32
|
+
bindingLayout: [{ name: "pointGlow", group: 3 }],
|
|
33
|
+
uniformTypes: {
|
|
34
|
+
coreRadius: "f32",
|
|
35
|
+
coreIntensity: "f32",
|
|
36
|
+
haloIntensity: "f32",
|
|
37
|
+
falloff: "f32"
|
|
38
|
+
},
|
|
39
|
+
defaultUniforms: DEFAULT_UNIFORMS,
|
|
40
|
+
getUniforms(props = {}, previousUniforms = DEFAULT_UNIFORMS) {
|
|
41
|
+
const uniforms = { ...DEFAULT_UNIFORMS, ...previousUniforms };
|
|
42
|
+
if (props.coreRadius !== void 0)
|
|
43
|
+
uniforms.coreRadius = Math.min(1, Math.max(0, props.coreRadius));
|
|
44
|
+
if (props.coreIntensity !== void 0)
|
|
45
|
+
uniforms.coreIntensity = Math.max(0, props.coreIntensity);
|
|
46
|
+
if (props.haloIntensity !== void 0)
|
|
47
|
+
uniforms.haloIntensity = Math.max(0, props.haloIntensity);
|
|
48
|
+
if (props.falloff !== void 0)
|
|
49
|
+
uniforms.falloff = Math.max(0.01, props.falloff);
|
|
50
|
+
return uniforms;
|
|
51
|
+
},
|
|
52
|
+
fs: (
|
|
53
|
+
/* glsl */
|
|
54
|
+
`
|
|
55
|
+
layout(std140) uniform pointGlowUniforms {
|
|
56
|
+
float coreRadius;
|
|
57
|
+
float coreIntensity;
|
|
58
|
+
float haloIntensity;
|
|
59
|
+
float falloff;
|
|
60
|
+
} pointGlow;
|
|
61
|
+
|
|
62
|
+
// Coordinates span [-1, 1] across the sprite; tint is linear RGB.
|
|
63
|
+
vec3 pointGlow_getColor(vec2 coordinates, vec3 tint) {
|
|
64
|
+
float radius = length(coordinates);
|
|
65
|
+
float edgeWidth = max(fwidth(radius), 0.0001);
|
|
66
|
+
float envelope = 1.0 - smoothstep(1.0 - edgeWidth, 1.0, radius);
|
|
67
|
+
float core = 1.0 - smoothstep(pointGlow.coreRadius - edgeWidth * 0.5,
|
|
68
|
+
pointGlow.coreRadius + edgeWidth * 0.5, radius);
|
|
69
|
+
if (pointGlow.coreRadius <= 0.0) core = 0.0;
|
|
70
|
+
float outer = exp(-pointGlow.falloff);
|
|
71
|
+
float halo = max(0.0, (exp(-pointGlow.falloff * radius * radius) - outer) / (1.0 - outer));
|
|
72
|
+
return (vec3(core * pointGlow.coreIntensity) + tint * halo * pointGlow.haloIntensity) * envelope;
|
|
73
|
+
}
|
|
74
|
+
`
|
|
75
|
+
),
|
|
76
|
+
source: (
|
|
77
|
+
/* wgsl */
|
|
78
|
+
`
|
|
79
|
+
struct pointGlowUniforms {
|
|
80
|
+
coreRadius: f32,
|
|
81
|
+
coreIntensity: f32,
|
|
82
|
+
haloIntensity: f32,
|
|
83
|
+
falloff: f32,
|
|
84
|
+
};
|
|
85
|
+
@group(3) @binding(auto) var<uniform> pointGlow: pointGlowUniforms;
|
|
86
|
+
|
|
87
|
+
fn pointGlow_getColor(coordinates: vec2<f32>, tint: vec3<f32>) -> vec3<f32> {
|
|
88
|
+
let radius = length(coordinates);
|
|
89
|
+
let edgeWidth = max(fwidth(radius), 0.0001);
|
|
90
|
+
let envelope = 1.0 - smoothstep(1.0 - edgeWidth, 1.0, radius);
|
|
91
|
+
var core = 1.0 - smoothstep(pointGlow.coreRadius - edgeWidth * 0.5,
|
|
92
|
+
pointGlow.coreRadius + edgeWidth * 0.5, radius);
|
|
93
|
+
if (pointGlow.coreRadius <= 0.0) { core = 0.0; }
|
|
94
|
+
let outer = exp(-pointGlow.falloff);
|
|
95
|
+
let halo = max(0.0, (exp(-pointGlow.falloff * radius * radius) - outer) / (1.0 - outer));
|
|
96
|
+
return (vec3<f32>(core * pointGlow.coreIntensity) + tint * halo * pointGlow.haloIntensity) * envelope;
|
|
97
|
+
}
|
|
98
|
+
`
|
|
99
|
+
)
|
|
100
|
+
};
|
|
101
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
102
|
+
0 && (module.exports = {
|
|
103
|
+
pointGlow
|
|
104
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ShaderModule } from "../../../lib/shader-module/shader-module.js";
|
|
2
|
+
export type PointGlowUniforms = {
|
|
3
|
+
coreRadius: number;
|
|
4
|
+
coreIntensity: number;
|
|
5
|
+
haloIntensity: number;
|
|
6
|
+
falloff: number;
|
|
7
|
+
};
|
|
8
|
+
export type PointGlowProps = Partial<PointGlowUniforms>;
|
|
9
|
+
/** Linear radiance for a bounded point sprite. Blend additively or composite into an HDR target. */
|
|
10
|
+
export declare const pointGlow: ShaderModule<PointGlowProps, PointGlowUniforms>;
|
|
11
|
+
//# sourceMappingURL=point-glow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"point-glow.d.ts","sourceRoot":"","sources":["../../../../src/modules/geometry/point-glow/point-glow.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,YAAY,EAAC,oDAAiD;AAE3E,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AACF,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AASxD,oGAAoG;AACpG,eAAO,MAAM,SAAS,EAAE,YAAY,CAAC,cAAc,EAAE,iBAAiB,CAgErE,CAAC"}
|