@luma.gl/engine 10.0.0-rc.1 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD-PARTY-NOTICES.md +89 -0
- package/dist/animation/animation-track.d.ts +7 -0
- package/dist/animation/animation-track.d.ts.map +1 -1
- package/dist/animation/animation-track.js.map +1 -1
- package/dist/animation/node-animation-binding.cjs +1 -0
- package/dist/animation/node-animation-binding.d.ts +2 -1
- package/dist/animation/node-animation-binding.d.ts.map +1 -1
- package/dist/animation/node-animation-binding.js +6 -0
- package/dist/animation/node-animation-binding.js.map +1 -1
- package/dist/animation/scenegraph-gpu-animation-layout.cjs +99 -0
- package/dist/animation/scenegraph-gpu-animation-layout.d.ts +69 -0
- package/dist/animation/scenegraph-gpu-animation-layout.d.ts.map +1 -0
- package/dist/animation/scenegraph-gpu-animation-layout.js +90 -0
- package/dist/animation/scenegraph-gpu-animation-layout.js.map +1 -0
- package/dist/animation/scenegraph-gpu-animation.cjs +281 -0
- package/dist/animation/scenegraph-gpu-animation.d.ts +54 -0
- package/dist/animation/scenegraph-gpu-animation.d.ts.map +1 -0
- package/dist/animation/scenegraph-gpu-animation.js +274 -0
- package/dist/animation/scenegraph-gpu-animation.js.map +1 -0
- package/dist/arrow/arrow-picking.cjs +4 -3
- package/dist/arrow/arrow-picking.d.ts +15 -5
- package/dist/arrow/arrow-picking.d.ts.map +1 -1
- package/dist/arrow/arrow-picking.js +16 -5
- package/dist/arrow/arrow-picking.js.map +1 -1
- package/dist/arrow/index.cjs.map +1 -1
- package/dist/dist.dev.js +1735 -1100
- package/dist/dist.min.js +69 -70
- package/dist/effects/glfx-effects.cjs +261 -0
- package/dist/effects/glfx-effects.d.ts +959 -0
- package/dist/effects/glfx-effects.d.ts.map +1 -0
- package/dist/effects/glfx-effects.js +200 -0
- package/dist/effects/glfx-effects.js.map +1 -0
- package/dist/effects/graph/gpu-effect-operation.cjs +461 -0
- package/dist/effects/graph/gpu-effect-operation.d.ts +127 -0
- package/dist/effects/graph/gpu-effect-operation.d.ts.map +1 -0
- package/dist/effects/graph/gpu-effect-operation.js +474 -0
- package/dist/effects/graph/gpu-effect-operation.js.map +1 -0
- package/dist/effects/graph/temporal-graph-history.cjs +48 -0
- package/dist/effects/graph/temporal-graph-history.d.ts +17 -0
- package/dist/effects/graph/temporal-graph-history.d.ts.map +1 -0
- package/dist/effects/graph/temporal-graph-history.js +30 -0
- package/dist/effects/graph/temporal-graph-history.js.map +1 -0
- package/dist/effects/index.cjs +179 -34
- package/dist/effects/index.cjs.map +3 -3
- package/dist/effects/index.d.ts +64 -27
- package/dist/effects/index.d.ts.map +1 -1
- package/dist/effects/index.js +51 -18
- package/dist/effects/index.js.map +1 -1
- package/dist/effects/passes/postprocessing/detail/detail-blur.cjs +95 -0
- package/dist/effects/passes/postprocessing/detail/detail-blur.d.ts +126 -0
- package/dist/effects/passes/postprocessing/detail/detail-blur.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/detail/detail-blur.js +63 -0
- package/dist/effects/passes/postprocessing/detail/detail-blur.js.map +1 -0
- package/dist/effects/passes/postprocessing/detail/high-pass.cjs +80 -0
- package/dist/effects/passes/postprocessing/detail/high-pass.d.ts +183 -0
- package/dist/effects/passes/postprocessing/detail/high-pass.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/detail/high-pass.js +59 -0
- package/dist/effects/passes/postprocessing/detail/high-pass.js.map +1 -0
- package/dist/effects/passes/postprocessing/detail/local-contrast.cjs +81 -0
- package/dist/effects/passes/postprocessing/detail/local-contrast.d.ts +163 -0
- package/dist/effects/passes/postprocessing/detail/local-contrast.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/detail/local-contrast.js +57 -0
- package/dist/effects/passes/postprocessing/detail/local-contrast.js.map +1 -0
- package/dist/effects/passes/postprocessing/detail/unsharp-mask.cjs +73 -0
- package/dist/effects/passes/postprocessing/detail/unsharp-mask.d.ts +43 -0
- package/dist/effects/passes/postprocessing/detail/unsharp-mask.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/detail/unsharp-mask.js +46 -0
- package/dist/effects/passes/postprocessing/detail/unsharp-mask.js.map +1 -0
- package/dist/effects/passes/postprocessing/fxaa/fxaa.cjs +9 -2
- package/dist/effects/passes/postprocessing/fxaa/fxaa.d.ts +19 -0
- package/dist/effects/passes/postprocessing/fxaa/fxaa.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/fxaa/fxaa.js +6 -0
- package/dist/effects/passes/postprocessing/fxaa/fxaa.js.map +1 -1
- package/dist/effects/passes/postprocessing/grading/curves.cjs +91 -0
- package/dist/effects/passes/postprocessing/grading/curves.d.ts +54 -0
- package/dist/effects/passes/postprocessing/grading/curves.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/grading/curves.js +73 -0
- package/dist/effects/passes/postprocessing/grading/curves.js.map +1 -0
- package/dist/effects/passes/postprocessing/grading/lift-gamma-gain.cjs +71 -0
- package/dist/effects/passes/postprocessing/grading/lift-gamma-gain.d.ts +76 -0
- package/dist/effects/passes/postprocessing/grading/lift-gamma-gain.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/grading/lift-gamma-gain.js +50 -0
- package/dist/effects/passes/postprocessing/grading/lift-gamma-gain.js.map +1 -0
- package/dist/effects/passes/postprocessing/grading/shadows-highlights.cjs +160 -0
- package/dist/effects/passes/postprocessing/grading/shadows-highlights.d.ts +232 -0
- package/dist/effects/passes/postprocessing/grading/shadows-highlights.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/grading/shadows-highlights.js +138 -0
- package/dist/effects/passes/postprocessing/grading/shadows-highlights.js.map +1 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/brightnesscontrast.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/brightnesscontrast.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/chromatic-aberration.cjs +84 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/chromatic-aberration.d.ts +36 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/chromatic-aberration.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/chromatic-aberration.js +58 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/chromatic-aberration.js.map +1 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/denoise.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/denoise.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/huesaturation.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/huesaturation.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/levels.cjs +106 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/levels.d.ts +105 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/levels.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/levels.js +89 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/levels.js.map +1 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/lut-color-grading.cjs +327 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/lut-color-grading.d.ts +201 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/lut-color-grading.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/lut-color-grading.js +296 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/lut-color-grading.js.map +1 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/noise.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/noise.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/output-dithering.cjs +85 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/output-dithering.d.ts +36 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/output-dithering.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/output-dithering.js +59 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/output-dithering.js.map +1 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/pack-color-lut.cjs +58 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/pack-color-lut.d.ts +27 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/pack-color-lut.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/pack-color-lut.js +45 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/pack-color-lut.js.map +1 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/persistence.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/persistence.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/posterize.cjs +64 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/posterize.d.ts +48 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/posterize.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/posterize.js +42 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/posterize.js.map +1 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/sepia.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/sepia.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/sharpen.cjs +110 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/sharpen.d.ts +214 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/sharpen.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/sharpen.js +89 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/sharpen.js.map +1 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/threshold.cjs +62 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/threshold.d.ts +47 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/threshold.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/threshold.js +40 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/threshold.js.map +1 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/tone-mapping.cjs +9 -2
- package/dist/effects/passes/postprocessing/image-adjust-filters/tone-mapping.d.ts +41 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/tone-mapping.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/tone-mapping.js +6 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/tone-mapping.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/vibrance.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/vibrance.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/vignette.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/vignette.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-composite-shader-pass.cjs +200 -13
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-composite-shader-pass.d.ts +993 -7
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-composite-shader-pass.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-composite-shader-pass.js +199 -10
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-composite-shader-pass.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-compute-pyramid.d.ts +4 -4
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-compute-pyramid.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-compute-pyramid.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-lens-effects.cjs +8 -6
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-lens-effects.d.ts +7 -7
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-lens-effects.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-lens-effects.js +8 -6
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-lens-effects.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-blur-filters/gaussianblur.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-blur-filters/gaussianblur.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-blur-filters/tiltshift.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-blur-filters/tiltshift.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-blur-filters/triangleblur.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-blur-filters/triangleblur.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-blur-filters/zoomblur.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-blur-filters/zoomblur.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-fun-filters/colorhalftone.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-fun-filters/colorhalftone.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-fun-filters/dotscreen.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-fun-filters/dotscreen.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-fun-filters/edgework.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-fun-filters/edgework.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-fun-filters/hexagonalpixelate.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-fun-filters/hexagonalpixelate.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-fun-filters/ink.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-fun-filters/ink.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-fun-filters/magnify.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-fun-filters/magnify.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-warp-filters/bulgepinch.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-warp-filters/bulgepinch.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-warp-filters/displacement-map.cjs +79 -0
- package/dist/effects/passes/postprocessing/image-warp-filters/displacement-map.d.ts +59 -0
- package/dist/effects/passes/postprocessing/image-warp-filters/displacement-map.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/image-warp-filters/displacement-map.js +63 -0
- package/dist/effects/passes/postprocessing/image-warp-filters/displacement-map.js.map +1 -0
- package/dist/effects/passes/postprocessing/image-warp-filters/swirl.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-warp-filters/swirl.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-warp-filters/warp.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-warp-filters/warp.js.map +1 -1
- package/dist/effects/passes/postprocessing/layer-styles/bevel.cjs +100 -0
- package/dist/effects/passes/postprocessing/layer-styles/bevel.d.ts +73 -0
- package/dist/effects/passes/postprocessing/layer-styles/bevel.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/layer-styles/bevel.js +78 -0
- package/dist/effects/passes/postprocessing/layer-styles/bevel.js.map +1 -0
- package/dist/effects/passes/postprocessing/layer-styles/drop-shadow.cjs +180 -0
- package/dist/effects/passes/postprocessing/layer-styles/drop-shadow.d.ts +152 -0
- package/dist/effects/passes/postprocessing/layer-styles/drop-shadow.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/layer-styles/drop-shadow.js +157 -0
- package/dist/effects/passes/postprocessing/layer-styles/drop-shadow.js.map +1 -0
- package/dist/effects/passes/postprocessing/optical/lens-flare.cjs +67 -0
- package/dist/effects/passes/postprocessing/optical/lens-flare.d.ts +181 -0
- package/dist/effects/passes/postprocessing/optical/lens-flare.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/optical/lens-flare.js +52 -0
- package/dist/effects/passes/postprocessing/optical/lens-flare.js.map +1 -0
- package/dist/effects/passes/postprocessing/optical/light-shafts.cjs +138 -0
- package/dist/effects/passes/postprocessing/optical/light-shafts.d.ts +138 -0
- package/dist/effects/passes/postprocessing/optical/light-shafts.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/optical/light-shafts.js +119 -0
- package/dist/effects/passes/postprocessing/optical/light-shafts.js.map +1 -0
- package/dist/effects/passes/postprocessing/optical/optical-textures.cjs +104 -0
- package/dist/effects/passes/postprocessing/optical/optical-textures.d.ts +43 -0
- package/dist/effects/passes/postprocessing/optical/optical-textures.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/optical/optical-textures.js +69 -0
- package/dist/effects/passes/postprocessing/optical/optical-textures.js.map +1 -0
- package/dist/effects/passes/postprocessing/optical/selective-glow.cjs +64 -0
- package/dist/effects/passes/postprocessing/optical/selective-glow.d.ts +190 -0
- package/dist/effects/passes/postprocessing/optical/selective-glow.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/optical/selective-glow.js +49 -0
- package/dist/effects/passes/postprocessing/optical/selective-glow.js.map +1 -0
- package/dist/effects/passes/postprocessing/smaa.cjs +279 -0
- package/dist/effects/passes/postprocessing/smaa.d.ts +95 -0
- package/dist/effects/passes/postprocessing/smaa.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/smaa.js +253 -0
- package/dist/effects/passes/postprocessing/smaa.js.map +1 -0
- package/dist/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.cjs +41 -40
- package/dist/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.d.ts +116 -8
- package/dist/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.js +38 -37
- package/dist/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.js.map +1 -1
- package/dist/effects/passes/screen-space/clustered-volumetric-lighting.cjs +101 -70
- package/dist/effects/passes/screen-space/clustered-volumetric-lighting.d.ts +496 -5
- package/dist/effects/passes/screen-space/clustered-volumetric-lighting.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/clustered-volumetric-lighting.js +97 -65
- package/dist/effects/passes/screen-space/clustered-volumetric-lighting.js.map +1 -1
- package/dist/effects/passes/screen-space/copy-pass.cjs +7 -0
- package/dist/effects/passes/screen-space/copy-pass.d.ts +1 -0
- package/dist/effects/passes/screen-space/copy-pass.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/copy-pass.js +4 -0
- package/dist/effects/passes/screen-space/copy-pass.js.map +1 -1
- package/dist/effects/passes/screen-space/depth-aware-blur.cjs +7 -5
- package/dist/effects/passes/screen-space/depth-aware-blur.d.ts +21 -19
- package/dist/effects/passes/screen-space/depth-aware-blur.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/depth-aware-blur.js +5 -3
- package/dist/effects/passes/screen-space/depth-aware-blur.js.map +1 -1
- package/dist/effects/passes/screen-space/dof.cjs +16 -7
- package/dist/effects/passes/screen-space/dof.d.ts +63 -4
- package/dist/effects/passes/screen-space/dof.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/dof.js +12 -4
- package/dist/effects/passes/screen-space/dof.js.map +1 -1
- package/dist/effects/passes/screen-space/gtao.cjs +93 -64
- package/dist/effects/passes/screen-space/gtao.d.ts +642 -6
- package/dist/effects/passes/screen-space/gtao.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/gtao.js +94 -62
- package/dist/effects/passes/screen-space/gtao.js.map +1 -1
- package/dist/effects/passes/screen-space/hdr-auto-exposure.cjs +103 -79
- package/dist/effects/passes/screen-space/hdr-auto-exposure.d.ts +226 -4
- package/dist/effects/passes/screen-space/hdr-auto-exposure.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/hdr-auto-exposure.js +102 -77
- package/dist/effects/passes/screen-space/hdr-auto-exposure.js.map +1 -1
- package/dist/effects/passes/screen-space/height-fog.cjs +14 -0
- package/dist/effects/passes/screen-space/height-fog.d.ts +71 -0
- package/dist/effects/passes/screen-space/height-fog.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/height-fog.js +16 -3
- package/dist/effects/passes/screen-space/height-fog.js.map +1 -1
- package/dist/effects/passes/screen-space/motion-blur.cjs +7 -8
- package/dist/effects/passes/screen-space/motion-blur.d.ts +41 -2
- package/dist/effects/passes/screen-space/motion-blur.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/motion-blur.js +6 -6
- package/dist/effects/passes/screen-space/motion-blur.js.map +1 -1
- package/dist/effects/passes/screen-space/outlines.cjs +143 -18
- package/dist/effects/passes/screen-space/outlines.d.ts +163 -4
- package/dist/effects/passes/screen-space/outlines.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/outlines.js +137 -15
- package/dist/effects/passes/screen-space/outlines.js.map +1 -1
- package/dist/effects/passes/screen-space/screen-space-global-illumination.cjs +82 -63
- package/dist/effects/passes/screen-space/screen-space-global-illumination.d.ts +333 -5
- package/dist/effects/passes/screen-space/screen-space-global-illumination.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/screen-space-global-illumination.js +81 -61
- package/dist/effects/passes/screen-space/screen-space-global-illumination.js.map +1 -1
- package/dist/effects/passes/screen-space/screen-space-reflections.cjs +165 -85
- package/dist/effects/passes/screen-space/screen-space-reflections.d.ts +802 -10
- package/dist/effects/passes/screen-space/screen-space-reflections.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/screen-space-reflections.js +162 -81
- package/dist/effects/passes/screen-space/screen-space-reflections.js.map +1 -1
- package/dist/effects/passes/screen-space/selection-outline.cjs +12 -2
- package/dist/effects/passes/screen-space/selection-outline.d.ts +44 -0
- package/dist/effects/passes/screen-space/selection-outline.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/selection-outline.js +9 -0
- package/dist/effects/passes/screen-space/selection-outline.js.map +1 -1
- package/dist/effects/passes/screen-space/ssao.cjs +66 -43
- package/dist/effects/passes/screen-space/ssao.d.ts +648 -3
- package/dist/effects/passes/screen-space/ssao.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/ssao.js +64 -41
- package/dist/effects/passes/screen-space/ssao.js.map +1 -1
- package/dist/effects/passes/screen-space/ssr-camera-temporal.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/ssr-camera-temporal.js.map +1 -1
- package/dist/effects/passes/screen-space/temporal-antialiasing.cjs +42 -30
- package/dist/effects/passes/screen-space/temporal-antialiasing.d.ts +107 -6
- package/dist/effects/passes/screen-space/temporal-antialiasing.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/temporal-antialiasing.js +40 -27
- package/dist/effects/passes/screen-space/temporal-antialiasing.js.map +1 -1
- package/dist/effects/passes/screen-space/temporal-frame.cjs +34 -0
- package/dist/effects/passes/screen-space/temporal-frame.d.ts +23 -0
- package/dist/effects/passes/screen-space/temporal-frame.d.ts.map +1 -0
- package/dist/effects/passes/screen-space/temporal-frame.js +16 -0
- package/dist/effects/passes/screen-space/temporal-frame.js.map +1 -0
- package/dist/effects/passes/screen-space/volumetric-fog.cjs +25 -22
- package/dist/effects/passes/screen-space/volumetric-fog.d.ts +162 -3
- package/dist/effects/passes/screen-space/volumetric-fog.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/volumetric-fog.js +27 -21
- package/dist/effects/passes/screen-space/volumetric-fog.js.map +1 -1
- package/dist/effects/scene-effect-attachments.cjs +15 -0
- package/dist/effects/scene-effect-attachments.d.ts +23 -0
- package/dist/effects/scene-effect-attachments.d.ts.map +1 -0
- package/dist/effects/scene-effect-attachments.js +5 -0
- package/dist/effects/scene-effect-attachments.js.map +1 -0
- package/dist/effects/temporal-upscale/index.cjs +40 -0
- package/dist/effects/temporal-upscale/index.d.ts +5 -0
- package/dist/effects/temporal-upscale/index.d.ts.map +1 -0
- package/dist/effects/temporal-upscale/index.js +6 -0
- package/dist/effects/temporal-upscale/index.js.map +1 -0
- package/dist/effects/temporal-upscale/temporal-math.cjs +202 -0
- package/dist/effects/temporal-upscale/temporal-math.d.ts +101 -0
- package/dist/effects/temporal-upscale/temporal-math.d.ts.map +1 -0
- package/dist/effects/temporal-upscale/temporal-math.js +202 -0
- package/dist/effects/temporal-upscale/temporal-math.js.map +1 -0
- package/dist/effects/temporal-upscale/temporal-upscale-shaders.cjs +353 -0
- package/dist/effects/temporal-upscale/temporal-upscale-shaders.d.ts +7 -0
- package/dist/effects/temporal-upscale/temporal-upscale-shaders.d.ts.map +1 -0
- package/dist/effects/temporal-upscale/temporal-upscale-shaders.js +321 -0
- package/dist/effects/temporal-upscale/temporal-upscale-shaders.js.map +1 -0
- package/dist/effects/temporal-upscale/temporal-upscaler.cjs +392 -0
- package/dist/effects/temporal-upscale/temporal-upscaler.d.ts +143 -0
- package/dist/effects/temporal-upscale/temporal-upscaler.d.ts.map +1 -0
- package/dist/effects/temporal-upscale/temporal-upscaler.js +385 -0
- package/dist/effects/temporal-upscale/temporal-upscaler.js.map +1 -0
- package/dist/gltf/gltf/create-gltf-model.cjs +34 -71
- package/dist/gltf/gltf/create-gltf-model.d.ts +3 -0
- package/dist/gltf/gltf/create-gltf-model.d.ts.map +1 -1
- package/dist/gltf/gltf/create-gltf-model.js +40 -74
- package/dist/gltf/gltf/create-gltf-model.js.map +1 -1
- package/dist/gltf/gltf/create-scenegraph-from-gltf.cjs +46 -4
- package/dist/gltf/gltf/create-scenegraph-from-gltf.d.ts +9 -1
- package/dist/gltf/gltf/create-scenegraph-from-gltf.d.ts.map +1 -1
- package/dist/gltf/gltf/create-scenegraph-from-gltf.js +54 -4
- package/dist/gltf/gltf/create-scenegraph-from-gltf.js.map +1 -1
- package/dist/gltf/gltf/gltf-animated-crowd.cjs +25 -136
- package/dist/gltf/gltf/gltf-animated-crowd.d.ts +4 -8
- package/dist/gltf/gltf/gltf-animated-crowd.d.ts.map +1 -1
- package/dist/gltf/gltf/gltf-animated-crowd.js +27 -139
- package/dist/gltf/gltf/gltf-animated-crowd.js.map +1 -1
- package/dist/gltf/gltf/gltf-animation-nodes.cjs +84 -0
- package/dist/gltf/gltf/gltf-animation-nodes.d.ts +11 -0
- package/dist/gltf/gltf/gltf-animation-nodes.d.ts.map +1 -0
- package/dist/gltf/gltf/gltf-animation-nodes.js +62 -0
- package/dist/gltf/gltf/gltf-animation-nodes.js.map +1 -0
- package/dist/gltf/gltf/gltf-animator.cjs +8 -2
- package/dist/gltf/gltf/gltf-animator.d.ts +6 -1
- package/dist/gltf/gltf/gltf-animator.d.ts.map +1 -1
- package/dist/gltf/gltf/gltf-animator.js +10 -2
- package/dist/gltf/gltf/gltf-animator.js.map +1 -1
- package/dist/gltf/gltf/gltf-gpu-animation-controller.cjs +81 -0
- package/dist/gltf/gltf/gltf-gpu-animation-controller.d.ts +9 -0
- package/dist/gltf/gltf/gltf-gpu-animation-controller.d.ts.map +1 -0
- package/dist/gltf/gltf/gltf-gpu-animation-controller.js +67 -0
- package/dist/gltf/gltf/gltf-gpu-animation-controller.js.map +1 -0
- package/dist/gltf/gltf/gltf-gpu-animation.cjs +33 -28
- package/dist/gltf/gltf/gltf-gpu-animation.d.ts +7 -26
- package/dist/gltf/gltf/gltf-gpu-animation.d.ts.map +1 -1
- package/dist/gltf/gltf/gltf-gpu-animation.js +29 -28
- package/dist/gltf/gltf/gltf-gpu-animation.js.map +1 -1
- package/dist/gltf/index.cjs.map +3 -3
- package/dist/gltf/index.d.ts +2 -2
- package/dist/gltf/index.d.ts.map +1 -1
- package/dist/gltf/index.js.map +1 -1
- package/dist/gltf/parsers/parse-gltf.cjs +4 -2
- package/dist/gltf/parsers/parse-gltf.d.ts +3 -0
- package/dist/gltf/parsers/parse-gltf.d.ts.map +1 -1
- package/dist/gltf/parsers/parse-gltf.js +7 -2
- package/dist/gltf/parsers/parse-gltf.js.map +1 -1
- package/dist/graph/models/index.cjs.map +2 -2
- package/dist/graph/physics/index.cjs +5 -0
- package/dist/graph/physics/index.cjs.map +3 -3
- package/dist/graph/physics/index.d.ts +1 -0
- package/dist/graph/physics/index.d.ts.map +1 -1
- package/dist/graph/physics/index.js +1 -0
- package/dist/graph/physics/index.js.map +1 -1
- package/dist/graph/physics/physics-controller-geometry.cjs +21 -0
- package/dist/graph/physics/physics-controller-geometry.d.ts +8 -1
- package/dist/graph/physics/physics-controller-geometry.d.ts.map +1 -1
- package/dist/graph/physics/physics-controller-geometry.js +22 -0
- package/dist/graph/physics/physics-controller-geometry.js.map +1 -1
- package/dist/graph/physics/scenegraph-session.d.ts +1 -1
- package/dist/graph/physics/scenegraph-session.d.ts.map +1 -1
- package/dist/graph/tables/index.cjs.map +2 -2
- package/dist/index.cjs +16 -3
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +7 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/lighting/ambient-occlusion-pass.cjs +47 -28
- package/dist/lighting/ambient-occlusion-pass.d.ts +12 -0
- package/dist/lighting/ambient-occlusion-pass.d.ts.map +1 -1
- package/dist/lighting/ambient-occlusion-pass.js +45 -26
- package/dist/lighting/ambient-occlusion-pass.js.map +1 -1
- package/dist/lighting/clustered-light-grid.cjs +73 -26
- package/dist/lighting/clustered-light-grid.d.ts +38 -5
- package/dist/lighting/clustered-light-grid.d.ts.map +1 -1
- package/dist/lighting/clustered-light-grid.js +70 -24
- package/dist/lighting/clustered-light-grid.js.map +1 -1
- package/dist/lighting/contact-shadow-composite.cjs +72 -51
- package/dist/lighting/contact-shadow-composite.d.ts +262 -3
- package/dist/lighting/contact-shadow-composite.d.ts.map +1 -1
- package/dist/lighting/contact-shadow-composite.js +72 -50
- package/dist/lighting/contact-shadow-composite.js.map +1 -1
- package/dist/lighting/contact-shadow-pass.cjs +50 -39
- package/dist/lighting/contact-shadow-pass.d.ts +8 -0
- package/dist/lighting/contact-shadow-pass.d.ts.map +1 -1
- package/dist/lighting/contact-shadow-pass.js +47 -37
- package/dist/lighting/contact-shadow-pass.js.map +1 -1
- package/dist/lighting/cortao/cortao-occluder-lookup-table.cjs +96 -0
- package/dist/lighting/cortao/cortao-occluder-lookup-table.d.ts +41 -0
- package/dist/lighting/cortao/cortao-occluder-lookup-table.d.ts.map +1 -0
- package/dist/lighting/cortao/cortao-occluder-lookup-table.js +94 -0
- package/dist/lighting/cortao/cortao-occluder-lookup-table.js.map +1 -0
- package/dist/lighting/cortao/cortao-parameters.cjs +127 -0
- package/dist/lighting/cortao/cortao-parameters.d.ts +95 -0
- package/dist/lighting/cortao/cortao-parameters.d.ts.map +1 -0
- package/dist/lighting/cortao/cortao-parameters.js +122 -0
- package/dist/lighting/cortao/cortao-parameters.js.map +1 -0
- package/dist/lighting/cortao/cortao-pass.cjs +100 -0
- package/dist/lighting/cortao/cortao-pass.d.ts +33 -0
- package/dist/lighting/cortao/cortao-pass.d.ts.map +1 -0
- package/dist/lighting/cortao/cortao-pass.js +84 -0
- package/dist/lighting/cortao/cortao-pass.js.map +1 -0
- package/dist/lighting/cortao/cortao-passes.cjs +42 -0
- package/dist/lighting/cortao/cortao-passes.d.ts +38 -0
- package/dist/lighting/cortao/cortao-passes.d.ts.map +1 -0
- package/dist/lighting/cortao/cortao-passes.js +19 -0
- package/dist/lighting/cortao/cortao-passes.js.map +1 -0
- package/dist/lighting/cortao/cortao-shaders-wgsl.cjs +606 -0
- package/dist/lighting/cortao/cortao-shaders-wgsl.d.ts +49 -0
- package/dist/lighting/cortao/cortao-shaders-wgsl.d.ts.map +1 -0
- package/dist/lighting/cortao/cortao-shaders-wgsl.js +610 -0
- package/dist/lighting/cortao/cortao-shaders-wgsl.js.map +1 -0
- package/dist/lighting/cortao/cortao-shaders.cjs +667 -0
- package/dist/lighting/cortao/cortao-shaders.d.ts +118 -0
- package/dist/lighting/cortao/cortao-shaders.d.ts.map +1 -0
- package/dist/lighting/cortao/cortao-shaders.js +657 -0
- package/dist/lighting/cortao/cortao-shaders.js.map +1 -0
- package/dist/lighting/cortao/cortao-upsample.cjs +191 -0
- package/dist/lighting/cortao/cortao-upsample.d.ts +16 -0
- package/dist/lighting/cortao/cortao-upsample.d.ts.map +1 -0
- package/dist/lighting/cortao/cortao-upsample.js +159 -0
- package/dist/lighting/cortao/cortao-upsample.js.map +1 -0
- package/dist/lighting/cortao/cortao-webgl-passes.cjs +229 -0
- package/dist/lighting/cortao/cortao-webgl-passes.d.ts +28 -0
- package/dist/lighting/cortao/cortao-webgl-passes.d.ts.map +1 -0
- package/dist/lighting/cortao/cortao-webgl-passes.js +212 -0
- package/dist/lighting/cortao/cortao-webgl-passes.js.map +1 -0
- package/dist/lighting/cortao/cortao-webgpu-passes.cjs +348 -0
- package/dist/lighting/cortao/cortao-webgpu-passes.d.ts +31 -0
- package/dist/lighting/cortao/cortao-webgpu-passes.d.ts.map +1 -0
- package/dist/lighting/cortao/cortao-webgpu-passes.js +335 -0
- package/dist/lighting/cortao/cortao-webgpu-passes.js.map +1 -0
- package/dist/lighting/index.cjs +13 -2
- package/dist/lighting/index.cjs.map +3 -3
- package/dist/lighting/index.d.ts +12 -7
- package/dist/lighting/index.d.ts.map +1 -1
- package/dist/lighting/index.js +6 -5
- package/dist/lighting/index.js.map +1 -1
- package/dist/lighting/shadow-map-renderer.cjs +40 -37
- package/dist/lighting/shadow-map-renderer.d.ts +15 -0
- package/dist/lighting/shadow-map-renderer.d.ts.map +1 -1
- package/dist/lighting/shadow-map-renderer.js +37 -35
- package/dist/lighting/shadow-map-renderer.js.map +1 -1
- package/dist/model/gpu-vector-model.cjs +39 -16
- package/dist/model/gpu-vector-model.d.ts +8 -0
- package/dist/model/gpu-vector-model.d.ts.map +1 -1
- package/dist/model/gpu-vector-model.js +46 -18
- package/dist/model/gpu-vector-model.js.map +1 -1
- package/dist/passes/effect-renderer.cjs +190 -0
- package/dist/passes/effect-renderer.d.ts +182 -0
- package/dist/passes/effect-renderer.d.ts.map +1 -0
- package/dist/passes/effect-renderer.js +182 -0
- package/dist/passes/effect-renderer.js.map +1 -0
- package/dist/passes/{shader-pass-renderer.cjs → fullscreen-effect-executor.cjs} +131 -94
- package/dist/passes/fullscreen-effect-executor.d.ts +188 -0
- package/dist/passes/fullscreen-effect-executor.d.ts.map +1 -0
- package/dist/passes/{shader-pass-renderer.js → fullscreen-effect-executor.js} +132 -100
- package/dist/passes/fullscreen-effect-executor.js.map +1 -0
- package/dist/passes/fullscreen-effect-module.cjs +15 -0
- package/dist/passes/fullscreen-effect-module.d.ts +47 -0
- package/dist/passes/fullscreen-effect-module.d.ts.map +1 -0
- package/dist/passes/fullscreen-effect-module.js +5 -0
- package/dist/passes/fullscreen-effect-module.js.map +1 -0
- package/dist/passes/fullscreen-effect-plan.cjs +15 -0
- package/dist/passes/fullscreen-effect-plan.d.ts +49 -0
- package/dist/passes/fullscreen-effect-plan.d.ts.map +1 -0
- package/dist/passes/fullscreen-effect-plan.js +5 -0
- package/dist/passes/fullscreen-effect-plan.js.map +1 -0
- package/dist/passes/get-fragment-shader.cjs +3 -0
- package/dist/passes/get-fragment-shader.d.ts +2 -2
- package/dist/passes/get-fragment-shader.d.ts.map +1 -1
- package/dist/passes/get-fragment-shader.js +3 -0
- package/dist/passes/get-fragment-shader.js.map +1 -1
- package/dist/passes/scene-capture-pass.cjs +42 -0
- package/dist/passes/scene-capture-pass.d.ts +29 -0
- package/dist/passes/scene-capture-pass.d.ts.map +1 -0
- package/dist/passes/scene-capture-pass.js +21 -0
- package/dist/passes/scene-capture-pass.js.map +1 -0
- package/dist/scenegraph/model-node.cjs +2 -0
- package/dist/scenegraph/model-node.d.ts +4 -0
- package/dist/scenegraph/model-node.d.ts.map +1 -1
- package/dist/scenegraph/model-node.js +2 -0
- package/dist/scenegraph/model-node.js.map +1 -1
- package/dist/shader-inputs.cjs +1 -1
- package/dist/shader-inputs.d.ts +1 -1
- package/dist/shader-inputs.js +1 -1
- package/dist/splats/gpu-paged-splat-renderer.cjs +52 -8
- package/dist/splats/gpu-paged-splat-renderer.d.ts +16 -3
- package/dist/splats/gpu-paged-splat-renderer.d.ts.map +1 -1
- package/dist/splats/gpu-paged-splat-renderer.js +55 -9
- package/dist/splats/gpu-paged-splat-renderer.js.map +1 -1
- package/dist/splats/gpu-paged-splat-shaders.cjs +3 -1
- package/dist/splats/gpu-paged-splat-shaders.d.ts.map +1 -1
- package/dist/splats/gpu-paged-splat-shaders.js +3 -1
- package/dist/splats/gpu-paged-splat-shaders.js.map +1 -1
- package/dist/splats/index.cjs.map +2 -2
- package/dist/text/fonts/atlas/browser-font-atlas.cjs +10 -1
- package/dist/text/fonts/atlas/browser-font-atlas.d.ts +4 -1
- package/dist/text/fonts/atlas/browser-font-atlas.d.ts.map +1 -1
- package/dist/text/fonts/atlas/browser-font-atlas.js +11 -2
- package/dist/text/fonts/atlas/browser-font-atlas.js.map +1 -1
- package/dist/text/fonts/atlas/lru-cache.cjs +4 -0
- package/dist/text/fonts/atlas/lru-cache.d.ts +3 -1
- package/dist/text/fonts/atlas/lru-cache.d.ts.map +1 -1
- package/dist/text/fonts/atlas/lru-cache.js +4 -0
- package/dist/text/fonts/atlas/lru-cache.js.map +1 -1
- package/dist/text/fonts/build-sdf-font-atlas.cjs +1 -1
- package/dist/text/fonts/build-sdf-font-atlas.d.ts.map +1 -1
- package/dist/text/fonts/build-sdf-font-atlas.js +4 -2
- package/dist/text/fonts/build-sdf-font-atlas.js.map +1 -1
- package/dist/text/fonts/index.cjs +4 -0
- package/dist/text/fonts/index.cjs.map +1 -1
- package/dist/text/fonts/index.d.ts +1 -1
- package/dist/text/fonts/index.d.ts.map +1 -1
- package/dist/text/fonts/index.js +1 -1
- package/dist/text/fonts/index.js.map +1 -1
- package/dist/text/index.cjs.map +1 -1
- package/dist/utils/shader-module-utils.cjs +3 -0
- package/dist/utils/shader-module-utils.d.ts.map +1 -1
- package/dist/utils/shader-module-utils.js +3 -0
- package/dist/utils/shader-module-utils.js.map +1 -1
- package/licenses/smaa.txt +24 -0
- package/package.json +8 -8
- package/src/animation/animation-track.ts +5 -0
- package/src/animation/node-animation-binding.ts +9 -8
- package/src/animation/scenegraph-gpu-animation-layout.ts +195 -0
- package/src/animation/scenegraph-gpu-animation.ts +340 -0
- package/src/arrow/arrow-picking.ts +23 -11
- package/src/effects/README.md +40 -16
- package/src/effects/glfx-effects.ts +227 -0
- package/src/effects/graph/gpu-effect-operation.ts +720 -0
- package/src/effects/graph/temporal-graph-history.ts +46 -0
- package/src/effects/index.ts +161 -28
- package/src/effects/passes/postprocessing/detail/detail-blur.ts +77 -0
- package/src/effects/passes/postprocessing/detail/high-pass.ts +86 -0
- package/src/effects/passes/postprocessing/detail/local-contrast.ts +79 -0
- package/src/effects/passes/postprocessing/detail/unsharp-mask.ts +56 -0
- package/src/effects/passes/postprocessing/fxaa/fxaa.ts +10 -2
- package/src/effects/passes/postprocessing/grading/curves.ts +83 -0
- package/src/effects/passes/postprocessing/grading/lift-gamma-gain.ts +68 -0
- package/src/effects/passes/postprocessing/grading/shadows-highlights.ts +169 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/brightnesscontrast.ts +2 -2
- package/src/effects/passes/postprocessing/image-adjust-filters/chromatic-aberration.ts +68 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/denoise.ts +2 -2
- package/src/effects/passes/postprocessing/image-adjust-filters/huesaturation.ts +2 -2
- package/src/effects/passes/postprocessing/image-adjust-filters/levels.ts +111 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/lut-color-grading.ts +347 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/noise.ts +2 -2
- package/src/effects/passes/postprocessing/image-adjust-filters/output-dithering.ts +69 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/pack-color-lut.ts +67 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/persistence.ts +2 -2
- package/src/effects/passes/postprocessing/image-adjust-filters/posterize.ts +52 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/sepia.ts +2 -2
- package/src/effects/passes/postprocessing/image-adjust-filters/sharpen.ts +112 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/threshold.ts +50 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/tone-mapping.ts +10 -2
- package/src/effects/passes/postprocessing/image-adjust-filters/vibrance.ts +2 -2
- package/src/effects/passes/postprocessing/image-adjust-filters/vignette.ts +2 -2
- package/src/effects/passes/postprocessing/image-blur-filters/bloom-composite-shader-pass.ts +233 -29
- package/src/effects/passes/postprocessing/image-blur-filters/bloom-compute-pyramid.ts +7 -7
- package/src/effects/passes/postprocessing/image-blur-filters/bloom-lens-effects.ts +13 -11
- package/src/effects/passes/postprocessing/image-blur-filters/bloom.ts +2 -2
- package/src/effects/passes/postprocessing/image-blur-filters/gaussianblur.ts +2 -2
- package/src/effects/passes/postprocessing/image-blur-filters/tiltshift.ts +2 -2
- package/src/effects/passes/postprocessing/image-blur-filters/triangleblur.ts +2 -2
- package/src/effects/passes/postprocessing/image-blur-filters/zoomblur.ts +2 -2
- package/src/effects/passes/postprocessing/image-fun-filters/colorhalftone.ts +2 -2
- package/src/effects/passes/postprocessing/image-fun-filters/dotscreen.ts +2 -2
- package/src/effects/passes/postprocessing/image-fun-filters/edgework.ts +2 -2
- package/src/effects/passes/postprocessing/image-fun-filters/hexagonalpixelate.ts +2 -2
- package/src/effects/passes/postprocessing/image-fun-filters/ink.ts +2 -2
- package/src/effects/passes/postprocessing/image-fun-filters/magnify.ts +2 -2
- package/src/effects/passes/postprocessing/image-warp-filters/bulgepinch.ts +2 -2
- package/src/effects/passes/postprocessing/image-warp-filters/displacement-map.ts +74 -0
- package/src/effects/passes/postprocessing/image-warp-filters/swirl.ts +2 -2
- package/src/effects/passes/postprocessing/image-warp-filters/warp.ts +2 -2
- package/src/effects/passes/postprocessing/layer-styles/bevel.ts +92 -0
- package/src/effects/passes/postprocessing/layer-styles/drop-shadow.ts +176 -0
- package/src/effects/passes/postprocessing/optical/lens-flare.ts +64 -0
- package/src/effects/passes/postprocessing/optical/light-shafts.ts +139 -0
- package/src/effects/passes/postprocessing/optical/optical-textures.ts +74 -0
- package/src/effects/passes/postprocessing/optical/selective-glow.ts +62 -0
- package/src/effects/passes/postprocessing/smaa.ts +265 -0
- package/src/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.ts +47 -47
- package/src/effects/passes/screen-space/clustered-volumetric-lighting.ts +113 -77
- package/src/effects/passes/screen-space/copy-pass.ts +6 -2
- package/src/effects/passes/screen-space/depth-aware-blur.ts +9 -6
- package/src/effects/passes/screen-space/dof.ts +26 -8
- package/src/effects/passes/screen-space/gtao.ts +110 -74
- package/src/effects/passes/screen-space/hdr-auto-exposure.ts +114 -89
- package/src/effects/passes/screen-space/height-fog.ts +21 -6
- package/src/effects/passes/screen-space/motion-blur.ts +9 -8
- package/src/effects/passes/screen-space/outlines.ts +145 -19
- package/src/effects/passes/screen-space/screen-space-global-illumination.ts +95 -73
- package/src/effects/passes/screen-space/screen-space-reflections.ts +179 -104
- package/src/effects/passes/screen-space/selection-outline.ts +13 -2
- package/src/effects/passes/screen-space/ssao.ts +79 -48
- package/src/effects/passes/screen-space/ssr-camera-temporal.ts +4 -4
- package/src/effects/passes/screen-space/temporal-antialiasing.ts +45 -35
- package/src/effects/passes/screen-space/temporal-frame.ts +33 -0
- package/src/effects/passes/screen-space/volumetric-fog.ts +32 -26
- package/src/effects/scene-effect-attachments.ts +26 -0
- package/src/effects/temporal-upscale/index.ts +20 -0
- package/src/effects/temporal-upscale/temporal-math.ts +308 -0
- package/src/effects/temporal-upscale/temporal-upscale-shaders.ts +326 -0
- package/src/effects/temporal-upscale/temporal-upscaler.ts +538 -0
- package/src/gltf/gltf/create-gltf-model.ts +59 -90
- package/src/gltf/gltf/create-scenegraph-from-gltf.ts +71 -5
- package/src/gltf/gltf/gltf-animated-crowd.ts +30 -177
- package/src/gltf/gltf/gltf-animation-nodes.ts +82 -0
- package/src/gltf/gltf/gltf-animator.ts +15 -4
- package/src/gltf/gltf/gltf-gpu-animation-controller.ts +88 -0
- package/src/gltf/gltf/gltf-gpu-animation.ts +53 -60
- package/src/gltf/index.ts +5 -0
- package/src/gltf/parsers/parse-gltf.ts +12 -2
- package/src/graph/physics/index.ts +4 -0
- package/src/graph/physics/physics-controller-geometry.ts +33 -1
- package/src/index.ts +28 -6
- package/src/lighting/ambient-occlusion-pass.ts +62 -28
- package/src/lighting/clustered-light-grid.ts +89 -40
- package/src/lighting/contact-shadow-composite.ts +80 -52
- package/src/lighting/contact-shadow-pass.ts +59 -39
- package/src/lighting/cortao/cortao-occluder-lookup-table.ts +138 -0
- package/src/lighting/cortao/cortao-parameters.ts +218 -0
- package/src/lighting/cortao/cortao-pass.ts +136 -0
- package/src/lighting/cortao/cortao-passes.ts +50 -0
- package/src/lighting/cortao/cortao-shaders-wgsl.ts +633 -0
- package/src/lighting/cortao/cortao-shaders.ts +674 -0
- package/src/lighting/cortao/cortao-upsample.ts +177 -0
- package/src/lighting/cortao/cortao-webgl-passes.ts +284 -0
- package/src/lighting/cortao/cortao-webgpu-passes.ts +430 -0
- package/src/lighting/index.ts +13 -5
- package/src/lighting/shadow-map-renderer.ts +57 -43
- package/src/model/gpu-vector-model.ts +47 -18
- package/src/passes/effect-renderer.ts +404 -0
- package/src/passes/{shader-pass-renderer.ts → fullscreen-effect-executor.ts} +270 -181
- package/src/passes/fullscreen-effect-module.ts +71 -0
- package/src/passes/fullscreen-effect-plan.ts +59 -0
- package/src/passes/get-fragment-shader.ts +7 -2
- package/src/passes/scene-capture-pass.ts +51 -0
- package/src/scenegraph/model-node.ts +5 -0
- package/src/shader-inputs.ts +1 -1
- package/src/splats/gpu-paged-splat-renderer.ts +77 -9
- package/src/splats/gpu-paged-splat-shaders.ts +7 -1
- package/src/text/fonts/atlas/browser-font-atlas.ts +13 -2
- package/src/text/fonts/atlas/lru-cache.ts +6 -1
- package/src/text/fonts/build-sdf-font-atlas.ts +4 -2
- package/src/text/fonts/index.ts +2 -0
- package/src/utils/shader-module-utils.ts +3 -0
- package/dist/passes/shader-pass-renderer.d.ts +0 -160
- package/dist/passes/shader-pass-renderer.d.ts.map +0 -1
- package/dist/passes/shader-pass-renderer.js.map +0 -1
|
@@ -0,0 +1,202 @@
|
|
|
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 temporal_math_exports = {};
|
|
19
|
+
__export(temporal_math_exports, {
|
|
20
|
+
DEFAULT_KERNEL_SHARPNESS: () => DEFAULT_KERNEL_SHARPNESS,
|
|
21
|
+
DEFAULT_RESPONSIVENESS: () => DEFAULT_RESPONSIVENESS,
|
|
22
|
+
applyJitterToProjectionMatrix: () => applyJitterToProjectionMatrix,
|
|
23
|
+
clipToBox: () => clipToBox,
|
|
24
|
+
getCatmullRomWeights: () => getCatmullRomWeights,
|
|
25
|
+
getCurrentBlend: () => getCurrentBlend,
|
|
26
|
+
getForgetting: () => getForgetting,
|
|
27
|
+
getHistoryTrust: () => getHistoryTrust,
|
|
28
|
+
getJitterOffset: () => getJitterOffset,
|
|
29
|
+
getJitterPhaseCount: () => getJitterPhaseCount,
|
|
30
|
+
getKernelScale: () => getKernelScale,
|
|
31
|
+
getLuminanceChange: () => getLuminanceChange,
|
|
32
|
+
getMaximumWeight: () => getMaximumWeight,
|
|
33
|
+
getNextWeight: () => getNextWeight,
|
|
34
|
+
getSampleWeight: () => getSampleWeight,
|
|
35
|
+
getVelocityFromDepth: () => getVelocityFromDepth,
|
|
36
|
+
halton: () => halton,
|
|
37
|
+
isDisoccluded: () => isDisoccluded,
|
|
38
|
+
jitterToClipOffset: () => jitterToClipOffset,
|
|
39
|
+
lanczos2: () => lanczos2,
|
|
40
|
+
reprojectUV: () => reprojectUV,
|
|
41
|
+
rgbToYCoCg: () => rgbToYCoCg,
|
|
42
|
+
yCoCgToRgb: () => yCoCgToRgb
|
|
43
|
+
});
|
|
44
|
+
module.exports = __toCommonJS(temporal_math_exports);
|
|
45
|
+
const DEFAULT_KERNEL_SHARPNESS = 0.85;
|
|
46
|
+
const DEFAULT_RESPONSIVENESS = 0.5;
|
|
47
|
+
function halton(index, base) {
|
|
48
|
+
let fraction = 1;
|
|
49
|
+
let result = 0;
|
|
50
|
+
while (index > 0) {
|
|
51
|
+
fraction /= base;
|
|
52
|
+
result += fraction * (index % base);
|
|
53
|
+
index = Math.floor(index / base);
|
|
54
|
+
}
|
|
55
|
+
return result;
|
|
56
|
+
}
|
|
57
|
+
function getJitterPhaseCount(renderWidth, outputWidth) {
|
|
58
|
+
return Math.max(1, Math.ceil(8 * (outputWidth / renderWidth) ** 2));
|
|
59
|
+
}
|
|
60
|
+
function getJitterOffset(frameIndex, phaseCount) {
|
|
61
|
+
const index = frameIndex % phaseCount + 1;
|
|
62
|
+
return [halton(index, 2) - 0.5, halton(index, 3) - 0.5];
|
|
63
|
+
}
|
|
64
|
+
function jitterToClipOffset(jitter, renderSize) {
|
|
65
|
+
return [2 * jitter[0] / renderSize[0], -2 * jitter[1] / renderSize[1]];
|
|
66
|
+
}
|
|
67
|
+
function applyJitterToProjectionMatrix(matrix16ColumnMajor, jitter, renderSize) {
|
|
68
|
+
const result = Array.from(matrix16ColumnMajor);
|
|
69
|
+
const offset = jitterToClipOffset(jitter, renderSize);
|
|
70
|
+
for (let column = 0; column < 4; column++) {
|
|
71
|
+
result[column * 4] += offset[0] * matrix16ColumnMajor[column * 4 + 3];
|
|
72
|
+
result[column * 4 + 1] += offset[1] * matrix16ColumnMajor[column * 4 + 3];
|
|
73
|
+
}
|
|
74
|
+
return result;
|
|
75
|
+
}
|
|
76
|
+
function reprojectUV(uv, velocity) {
|
|
77
|
+
return [uv[0] - velocity[0], uv[1] - velocity[1]];
|
|
78
|
+
}
|
|
79
|
+
function transformVector(matrix, vector) {
|
|
80
|
+
return [0, 1, 2, 3].map((row) => vector.reduce((sum, value, column) => sum + matrix[column * 4 + row] * value, 0));
|
|
81
|
+
}
|
|
82
|
+
function getVelocityFromDepth(options) {
|
|
83
|
+
const { uv, depth, jitter, renderSize, currentViewProjectionInverse, previousViewProjection } = options;
|
|
84
|
+
const currentUV = [uv[0] - jitter[0] / renderSize[0], uv[1] - jitter[1] / renderSize[1]];
|
|
85
|
+
const world = transformVector(currentViewProjectionInverse, [
|
|
86
|
+
2 * currentUV[0] - 1,
|
|
87
|
+
1 - 2 * currentUV[1],
|
|
88
|
+
2 * depth - 1,
|
|
89
|
+
1
|
|
90
|
+
]);
|
|
91
|
+
const previous = transformVector(previousViewProjection, world);
|
|
92
|
+
return [
|
|
93
|
+
currentUV[0] - (previous[0] / previous[3] * 0.5 + 0.5),
|
|
94
|
+
currentUV[1] - (0.5 - previous[1] / previous[3] * 0.5),
|
|
95
|
+
(previous[3] - previous[2]) / (2 * previous[3])
|
|
96
|
+
];
|
|
97
|
+
}
|
|
98
|
+
function rgbToYCoCg([red, green, blue]) {
|
|
99
|
+
return [(red + 2 * green + blue) / 4, (red - blue) / 2, (-red + 2 * green - blue) / 4];
|
|
100
|
+
}
|
|
101
|
+
function yCoCgToRgb([luminance, orange, green]) {
|
|
102
|
+
return [luminance + orange - green, luminance + green, luminance - orange - green];
|
|
103
|
+
}
|
|
104
|
+
function clipToBox(color, boxMin, boxMax) {
|
|
105
|
+
const center = boxMin.map((value, index) => (value + boxMax[index]) / 2);
|
|
106
|
+
let scale = 1;
|
|
107
|
+
for (let component = 0; component < 3; component++) {
|
|
108
|
+
const distance = Math.abs(color[component] - center[component]);
|
|
109
|
+
if (distance > 0) {
|
|
110
|
+
scale = Math.min(scale, (boxMax[component] - boxMin[component]) / (2 * distance));
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return color.map((value, index) => center[index] + (value - center[index]) * scale);
|
|
114
|
+
}
|
|
115
|
+
function lanczos2(value) {
|
|
116
|
+
if (value === 0)
|
|
117
|
+
return 1;
|
|
118
|
+
if (Math.abs(value) >= 2)
|
|
119
|
+
return 0;
|
|
120
|
+
const angle = Math.PI * value;
|
|
121
|
+
return Math.sin(angle) * Math.sin(angle / 2) / (angle * angle / 2);
|
|
122
|
+
}
|
|
123
|
+
function getCatmullRomWeights(fraction) {
|
|
124
|
+
const squared = fraction * fraction;
|
|
125
|
+
const cubed = squared * fraction;
|
|
126
|
+
return [
|
|
127
|
+
-0.5 * fraction + squared - 0.5 * cubed,
|
|
128
|
+
1 - 2.5 * squared + 1.5 * cubed,
|
|
129
|
+
0.5 * fraction + 2 * squared - 1.5 * cubed,
|
|
130
|
+
-0.5 * squared + 0.5 * cubed
|
|
131
|
+
];
|
|
132
|
+
}
|
|
133
|
+
function isDisoccluded(previousOneMinusDepth, expectedPreviousOneMinusDepth, tolerance = 0.05) {
|
|
134
|
+
const expected = Math.max(0, expectedPreviousOneMinusDepth);
|
|
135
|
+
return Math.min(...previousOneMinusDepth) > expected + Math.max(expected * tolerance, 1e-5);
|
|
136
|
+
}
|
|
137
|
+
function getKernelScale(renderSize, outputSize, kernelSharpness = DEFAULT_KERNEL_SHARPNESS) {
|
|
138
|
+
const ratio = Math.min(outputSize[0] / renderSize[0], outputSize[1] / renderSize[1]);
|
|
139
|
+
return Math.min(2, Math.max(1, ratio * Math.min(1, Math.max(0.5, kernelSharpness))));
|
|
140
|
+
}
|
|
141
|
+
function getSampleWeight(distance, kernelScale) {
|
|
142
|
+
return Math.max(0, lanczos2(distance[0] * kernelScale)) * Math.max(0, lanczos2(distance[1] * kernelScale));
|
|
143
|
+
}
|
|
144
|
+
function getMaximumWeight(historyWeightMax = 0.95) {
|
|
145
|
+
const maximum = Math.min(0.999, Math.max(0, historyWeightMax));
|
|
146
|
+
return maximum / (1 - maximum);
|
|
147
|
+
}
|
|
148
|
+
function getCurrentBlend(sampleWeight, accumulatedWeight, historyWeightMax = 0.95, isHistoryValid = true) {
|
|
149
|
+
if (!isHistoryValid)
|
|
150
|
+
return 1;
|
|
151
|
+
const accumulated = Math.min(accumulatedWeight, getMaximumWeight(historyWeightMax));
|
|
152
|
+
return sampleWeight / Math.max(accumulated + sampleWeight, 1e-5);
|
|
153
|
+
}
|
|
154
|
+
function getNextWeight(sampleWeight, accumulatedWeight, kernelScale, historyWeightMax = 0.95, isHistoryValid = true) {
|
|
155
|
+
if (!isHistoryValid)
|
|
156
|
+
return Math.max(sampleWeight, 1 / (kernelScale * kernelScale));
|
|
157
|
+
const maximum = getMaximumWeight(historyWeightMax);
|
|
158
|
+
return Math.min(Math.min(accumulatedWeight, maximum) + sampleWeight, maximum);
|
|
159
|
+
}
|
|
160
|
+
function getHistoryTrust(sample, historyMinimum, historyMaximum, alpha = [1, 1, 1]) {
|
|
161
|
+
const excess = Math.max(0, ...sample.map((value, index) => Math.max(historyMinimum[index] - value, value - historyMaximum[index])));
|
|
162
|
+
const alphaExcess = Math.max(0, alpha[1] - alpha[0], alpha[0] - alpha[2]);
|
|
163
|
+
const relative = Math.max(excess / Math.max(sample[0], historyMaximum[0], 0.02), alphaExcess);
|
|
164
|
+
const t = Math.min(1, Math.max(0, (relative - 0.03) / (0.12 - 0.03)));
|
|
165
|
+
return 1 - t * t * (3 - 2 * t);
|
|
166
|
+
}
|
|
167
|
+
function getLuminanceChange(historyLuminance, minimumLuminance, maximumLuminance) {
|
|
168
|
+
const excess = Math.max(0, minimumLuminance - historyLuminance, historyLuminance - maximumLuminance);
|
|
169
|
+
const relative = excess / Math.max(Math.abs(historyLuminance), Math.abs(minimumLuminance), Math.abs(maximumLuminance), 0.02);
|
|
170
|
+
const transition = Math.min(1, Math.max(0, (relative - 0.1) / 0.2));
|
|
171
|
+
return transition * transition * (3 - 2 * transition);
|
|
172
|
+
}
|
|
173
|
+
function getForgetting(responsiveness, luminanceChange, sampleWeight) {
|
|
174
|
+
const evidence = Math.min(1, Math.max(0, (sampleWeight - 0.5) / 0.3));
|
|
175
|
+
return Math.min(1, Math.max(0, responsiveness)) * luminanceChange * evidence * evidence * (3 - 2 * evidence);
|
|
176
|
+
}
|
|
177
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
178
|
+
0 && (module.exports = {
|
|
179
|
+
DEFAULT_KERNEL_SHARPNESS,
|
|
180
|
+
DEFAULT_RESPONSIVENESS,
|
|
181
|
+
applyJitterToProjectionMatrix,
|
|
182
|
+
clipToBox,
|
|
183
|
+
getCatmullRomWeights,
|
|
184
|
+
getCurrentBlend,
|
|
185
|
+
getForgetting,
|
|
186
|
+
getHistoryTrust,
|
|
187
|
+
getJitterOffset,
|
|
188
|
+
getJitterPhaseCount,
|
|
189
|
+
getKernelScale,
|
|
190
|
+
getLuminanceChange,
|
|
191
|
+
getMaximumWeight,
|
|
192
|
+
getNextWeight,
|
|
193
|
+
getSampleWeight,
|
|
194
|
+
getVelocityFromDepth,
|
|
195
|
+
halton,
|
|
196
|
+
isDisoccluded,
|
|
197
|
+
jitterToClipOffset,
|
|
198
|
+
lanczos2,
|
|
199
|
+
reprojectUV,
|
|
200
|
+
rgbToYCoCg,
|
|
201
|
+
yCoCgToRgb
|
|
202
|
+
});
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/** Default accumulation kernel sharpness; larger values narrow the sample footprint. */
|
|
2
|
+
export declare const DEFAULT_KERNEL_SHARPNESS = 0.85;
|
|
3
|
+
/** Default responsiveness for reducing stale history. */
|
|
4
|
+
export declare const DEFAULT_RESPONSIVENESS = 0.5;
|
|
5
|
+
/** A two-component coordinate in top-left UV space, unless documented otherwise. */
|
|
6
|
+
export type TemporalVector2 = [number, number];
|
|
7
|
+
/** A three-component color or velocity/depth value. */
|
|
8
|
+
export type TemporalVector3 = [number, number, number];
|
|
9
|
+
/** Radical inverse for a nonnegative integer index and integer base >= 2; index zero is zero. */
|
|
10
|
+
export declare function halton(index: number, base: number): number;
|
|
11
|
+
/** FSR 2 phase rule for positive render/output widths; eight phases at native resolution. */
|
|
12
|
+
export declare function getJitterPhaseCount(renderWidth: number, outputWidth: number): number;
|
|
13
|
+
/** Periodic Halton(2,3) jitter in render pixels, +x right, +y down; frame zero uses index one. */
|
|
14
|
+
export declare function getJitterOffset(frameIndex: number, phaseCount: number): TemporalVector2;
|
|
15
|
+
/** NDC offset: add this pair times clip.w to clip.xy; depth is unchanged. */
|
|
16
|
+
export declare function jitterToClipOffset(jitter: TemporalVector2, renderSize: TemporalVector2): TemporalVector2;
|
|
17
|
+
/** Copies a column-major matrix and adds offset * row-w to rows x/y, including orthographic matrices. */
|
|
18
|
+
export declare function applyJitterToProjectionMatrix(matrix16ColumnMajor: ArrayLike<number>, jitter: TemporalVector2, renderSize: TemporalVector2): number[];
|
|
19
|
+
/** Reprojects an UNJITTERED top-left UV using current UV minus previous UV motion. */
|
|
20
|
+
export declare function reprojectUV(uv: TemporalVector2, velocity: TemporalVector2): TemporalVector2;
|
|
21
|
+
/** Inputs to the camera-only CPU velocity reference. Both matrices are UNJITTERED. */
|
|
22
|
+
export type VelocityFromDepthOptions = {
|
|
23
|
+
/** Jittered top-left texture UV. */
|
|
24
|
+
uv: TemporalVector2;
|
|
25
|
+
/** Device depth, mapped from GL-style NDC z by z * 0.5 + 0.5. */
|
|
26
|
+
depth: number;
|
|
27
|
+
/** Current render-pixel jitter. */
|
|
28
|
+
jitter: TemporalVector2;
|
|
29
|
+
/** Render dimensions in pixels. */
|
|
30
|
+
renderSize: TemporalVector2;
|
|
31
|
+
/** Inverse current column-major GL-style view-projection matrix, clip z in [-w,w]. */
|
|
32
|
+
currentViewProjectionInverse: ArrayLike<number>;
|
|
33
|
+
/** Previous column-major GL-style view-projection matrix, clip z in [-w,w]. */
|
|
34
|
+
previousViewProjection: ArrayLike<number>;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Returns [currentU - previousU, currentV - previousV, 1 - previous device depth], excluding
|
|
38
|
+
* jitter. The third component is one minus the depth: most depth values are close to 1, and a
|
|
39
|
+
* half-float texture keeps a small number much more exactly than a number close to 1.
|
|
40
|
+
*/
|
|
41
|
+
export declare function getVelocityFromDepth(options: VelocityFromDepthOptions): TemporalVector3;
|
|
42
|
+
/** Linear RGB to YCoCg; no gamma transfer, operates on premultiplied RGB. */
|
|
43
|
+
export declare function rgbToYCoCg([red, green, blue]: TemporalVector3): TemporalVector3;
|
|
44
|
+
/** Inverse of rgbToYCoCg, without saturation. */
|
|
45
|
+
export declare function yCoCgToRgb([luminance, orange, green]: TemporalVector3): TemporalVector3;
|
|
46
|
+
/** Clips along the segment from color to box centre; inside values are unchanged, zero extents supported. */
|
|
47
|
+
export declare function clipToBox(color: TemporalVector3, boxMin: TemporalVector3, boxMax: TemporalVector3): TemporalVector3;
|
|
48
|
+
/** Unnormalized Lanczos-2 kernel, support (-2,2). Normalize sums over the chosen sample footprint. */
|
|
49
|
+
export declare function lanczos2(value: number): number;
|
|
50
|
+
/** Catmull-Rom weights for samples at -1,0,1,2 and fraction t in [0,1]; weights sum to one. */
|
|
51
|
+
export declare function getCatmullRomWeights(fraction: number): [number, number, number, number];
|
|
52
|
+
/**
|
|
53
|
+
* Reject only if ALL four previous 1-depth taps are closer than expected by 5%; absolute
|
|
54
|
+
* far-plane guard 1e-5. Both arguments are `1 - depth` values, as the textures store them.
|
|
55
|
+
*/
|
|
56
|
+
export declare function isDisoccluded(previousOneMinusDepth: readonly number[], expectedPreviousOneMinusDepth: number, tolerance?: number): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Scale of the accumulation kernel, in render pixels: at default sharpness, 1 at native size and 1.7 at half size.
|
|
59
|
+
* A larger scale gives a narrower kernel, so a sample contributes only close to its centre.
|
|
60
|
+
* Sharpness is clamped to [0.5,1]. The default factor 0.85 makes the lobe a little wider than one output pixel. With a factor of 1, the
|
|
61
|
+
* neighbouring output pixels share too few samples, and edges show a one-pixel comb pattern.
|
|
62
|
+
*/
|
|
63
|
+
export declare function getKernelScale(renderSize: TemporalVector2, outputSize: TemporalVector2, kernelSharpness?: number): number;
|
|
64
|
+
/**
|
|
65
|
+
* Weight of one render sample at a distance (render pixels) from an output pixel centre: the
|
|
66
|
+
* main lobe of the Lanczos-2 kernel, narrowed by the kernel scale. Range [0, 1].
|
|
67
|
+
*/
|
|
68
|
+
export declare function getSampleWeight(distance: TemporalVector2, kernelScale: number): number;
|
|
69
|
+
/** Largest accumulated weight. A full-weight sample then has a blend factor of 1 - historyWeightMax. */
|
|
70
|
+
export declare function getMaximumWeight(historyWeightMax?: number): number;
|
|
71
|
+
/**
|
|
72
|
+
* Blend factor of the current frame: its sample weight as a fraction of all accumulated weight.
|
|
73
|
+
* It is 0 when no render sample is close to the output pixel, and 1 without valid history.
|
|
74
|
+
*/
|
|
75
|
+
export declare function getCurrentBlend(sampleWeight: number, accumulatedWeight: number, historyWeightMax?: number, isHistoryValid?: boolean): number;
|
|
76
|
+
/** Accumulated weight to store after a frame. A pixel without history starts with an average frame. */
|
|
77
|
+
export declare function getNextWeight(sampleWeight: number, accumulatedWeight: number, kernelScale: number, historyWeightMax?: number, isHistoryValid?: boolean): number;
|
|
78
|
+
/**
|
|
79
|
+
* Tests whether the history explains a sample of the current frame: 1 when each YCoCg component
|
|
80
|
+
* of the sample is inside the range of the history near the sample position, 0 when a component
|
|
81
|
+
* is outside by more than 12 % of the larger luma, with a smooth step between 3 % and 12 %.
|
|
82
|
+
*/
|
|
83
|
+
export declare function getHistoryTrust(sample: TemporalVector3, historyMinimum: TemporalVector3, historyMaximum: TemporalVector3,
|
|
84
|
+
/** Alpha of the sample and the alpha range of the history, [sample, minimum, maximum]. */
|
|
85
|
+
alpha?: TemporalVector3): number;
|
|
86
|
+
/**
|
|
87
|
+
* Luminance disagreement outside the current 3x3 YCoCg Y range, before history clipping.
|
|
88
|
+
* Relative excess uses the larger absolute luminance with a 0.02 dark-noise floor.
|
|
89
|
+
* Smoothstep from 10% to 30% ignores small fluctuations; in-range history always returns zero.
|
|
90
|
+
*/
|
|
91
|
+
export declare function getLuminanceChange(historyLuminance: number, minimumLuminance: number, maximumLuminance: number): number;
|
|
92
|
+
/**
|
|
93
|
+
* Fraction of the accumulated history weight to forget in one frame.
|
|
94
|
+
* `luminanceChange` is the result of `getLuminanceChange`. `sampleWeight` is the accumulation
|
|
95
|
+
* weight of the current frame at this output pixel. A frame is evidence for a change only when
|
|
96
|
+
* one of its samples lies close to the output pixel, so the weight gates the result with a
|
|
97
|
+
* smoothstep from 0.5 to 0.8. Without this gate, each frame whose samples miss a feature
|
|
98
|
+
* smaller than a render pixel would erase that feature from the history.
|
|
99
|
+
*/
|
|
100
|
+
export declare function getForgetting(responsiveness: number, luminanceChange: number, sampleWeight: number): number;
|
|
101
|
+
//# sourceMappingURL=temporal-math.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"temporal-math.d.ts","sourceRoot":"","sources":["../../../src/effects/temporal-upscale/temporal-math.ts"],"names":[],"mappings":"AAIA,wFAAwF;AACxF,eAAO,MAAM,wBAAwB,OAAO,CAAC;AAE7C,yDAAyD;AACzD,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C,oFAAoF;AACpF,MAAM,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC/C,uDAAuD;AACvD,MAAM,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAEvD,iGAAiG;AACjG,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAS1D;AAED,6FAA6F;AAC7F,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAEpF;AAED,kGAAkG;AAClG,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,eAAe,CAGvF;AAED,6EAA6E;AAC7E,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,eAAe,EACvB,UAAU,EAAE,eAAe,GAC1B,eAAe,CAEjB;AAED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|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
/** Default accumulation kernel sharpness; larger values narrow the sample footprint. */
|
|
5
|
+
export const DEFAULT_KERNEL_SHARPNESS = 0.85;
|
|
6
|
+
/** Default responsiveness for reducing stale history. */
|
|
7
|
+
export const DEFAULT_RESPONSIVENESS = 0.5;
|
|
8
|
+
/** Radical inverse for a nonnegative integer index and integer base >= 2; index zero is zero. */
|
|
9
|
+
export function halton(index, base) {
|
|
10
|
+
let fraction = 1;
|
|
11
|
+
let result = 0;
|
|
12
|
+
while (index > 0) {
|
|
13
|
+
fraction /= base;
|
|
14
|
+
result += fraction * (index % base);
|
|
15
|
+
index = Math.floor(index / base);
|
|
16
|
+
}
|
|
17
|
+
return result;
|
|
18
|
+
}
|
|
19
|
+
/** FSR 2 phase rule for positive render/output widths; eight phases at native resolution. */
|
|
20
|
+
export function getJitterPhaseCount(renderWidth, outputWidth) {
|
|
21
|
+
return Math.max(1, Math.ceil(8 * (outputWidth / renderWidth) ** 2));
|
|
22
|
+
}
|
|
23
|
+
/** Periodic Halton(2,3) jitter in render pixels, +x right, +y down; frame zero uses index one. */
|
|
24
|
+
export function getJitterOffset(frameIndex, phaseCount) {
|
|
25
|
+
const index = (frameIndex % phaseCount) + 1;
|
|
26
|
+
return [halton(index, 2) - 0.5, halton(index, 3) - 0.5];
|
|
27
|
+
}
|
|
28
|
+
/** NDC offset: add this pair times clip.w to clip.xy; depth is unchanged. */
|
|
29
|
+
export function jitterToClipOffset(jitter, renderSize) {
|
|
30
|
+
return [(2 * jitter[0]) / renderSize[0], (-2 * jitter[1]) / renderSize[1]];
|
|
31
|
+
}
|
|
32
|
+
/** Copies a column-major matrix and adds offset * row-w to rows x/y, including orthographic matrices. */
|
|
33
|
+
export function applyJitterToProjectionMatrix(matrix16ColumnMajor, jitter, renderSize) {
|
|
34
|
+
const result = Array.from(matrix16ColumnMajor);
|
|
35
|
+
const offset = jitterToClipOffset(jitter, renderSize);
|
|
36
|
+
for (let column = 0; column < 4; column++) {
|
|
37
|
+
result[column * 4] += offset[0] * matrix16ColumnMajor[column * 4 + 3];
|
|
38
|
+
result[column * 4 + 1] += offset[1] * matrix16ColumnMajor[column * 4 + 3];
|
|
39
|
+
}
|
|
40
|
+
return result;
|
|
41
|
+
}
|
|
42
|
+
/** Reprojects an UNJITTERED top-left UV using current UV minus previous UV motion. */
|
|
43
|
+
export function reprojectUV(uv, velocity) {
|
|
44
|
+
return [uv[0] - velocity[0], uv[1] - velocity[1]];
|
|
45
|
+
}
|
|
46
|
+
/** Column-major homogeneous matrix-vector product. */
|
|
47
|
+
function transformVector(matrix, vector) {
|
|
48
|
+
return [0, 1, 2, 3].map(row => vector.reduce((sum, value, column) => sum + matrix[column * 4 + row] * value, 0));
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Returns [currentU - previousU, currentV - previousV, 1 - previous device depth], excluding
|
|
52
|
+
* jitter. The third component is one minus the depth: most depth values are close to 1, and a
|
|
53
|
+
* half-float texture keeps a small number much more exactly than a number close to 1.
|
|
54
|
+
*/
|
|
55
|
+
export function getVelocityFromDepth(options) {
|
|
56
|
+
const { uv, depth, jitter, renderSize, currentViewProjectionInverse, previousViewProjection } = options;
|
|
57
|
+
const currentUV = [uv[0] - jitter[0] / renderSize[0], uv[1] - jitter[1] / renderSize[1]];
|
|
58
|
+
const world = transformVector(currentViewProjectionInverse, [
|
|
59
|
+
2 * currentUV[0] - 1,
|
|
60
|
+
1 - 2 * currentUV[1],
|
|
61
|
+
2 * depth - 1,
|
|
62
|
+
1
|
|
63
|
+
]);
|
|
64
|
+
const previous = transformVector(previousViewProjection, world);
|
|
65
|
+
return [
|
|
66
|
+
currentUV[0] - ((previous[0] / previous[3]) * 0.5 + 0.5),
|
|
67
|
+
currentUV[1] - (0.5 - (previous[1] / previous[3]) * 0.5),
|
|
68
|
+
(previous[3] - previous[2]) / (2 * previous[3])
|
|
69
|
+
];
|
|
70
|
+
}
|
|
71
|
+
/** Linear RGB to YCoCg; no gamma transfer, operates on premultiplied RGB. */
|
|
72
|
+
export function rgbToYCoCg([red, green, blue]) {
|
|
73
|
+
return [(red + 2 * green + blue) / 4, (red - blue) / 2, (-red + 2 * green - blue) / 4];
|
|
74
|
+
}
|
|
75
|
+
/** Inverse of rgbToYCoCg, without saturation. */
|
|
76
|
+
export function yCoCgToRgb([luminance, orange, green]) {
|
|
77
|
+
return [luminance + orange - green, luminance + green, luminance - orange - green];
|
|
78
|
+
}
|
|
79
|
+
/** Clips along the segment from color to box centre; inside values are unchanged, zero extents supported. */
|
|
80
|
+
export function clipToBox(color, boxMin, boxMax) {
|
|
81
|
+
const center = boxMin.map((value, index) => (value + boxMax[index]) / 2);
|
|
82
|
+
let scale = 1;
|
|
83
|
+
for (let component = 0; component < 3; component++) {
|
|
84
|
+
const distance = Math.abs(color[component] - center[component]);
|
|
85
|
+
if (distance > 0) {
|
|
86
|
+
scale = Math.min(scale, (boxMax[component] - boxMin[component]) / (2 * distance));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return color.map((value, index) => center[index] + (value - center[index]) * scale);
|
|
90
|
+
}
|
|
91
|
+
/** Unnormalized Lanczos-2 kernel, support (-2,2). Normalize sums over the chosen sample footprint. */
|
|
92
|
+
export function lanczos2(value) {
|
|
93
|
+
if (value === 0)
|
|
94
|
+
return 1;
|
|
95
|
+
if (Math.abs(value) >= 2)
|
|
96
|
+
return 0;
|
|
97
|
+
const angle = Math.PI * value;
|
|
98
|
+
return (Math.sin(angle) * Math.sin(angle / 2)) / ((angle * angle) / 2);
|
|
99
|
+
}
|
|
100
|
+
/** Catmull-Rom weights for samples at -1,0,1,2 and fraction t in [0,1]; weights sum to one. */
|
|
101
|
+
export function getCatmullRomWeights(fraction) {
|
|
102
|
+
const squared = fraction * fraction;
|
|
103
|
+
const cubed = squared * fraction;
|
|
104
|
+
return [
|
|
105
|
+
-0.5 * fraction + squared - 0.5 * cubed,
|
|
106
|
+
1 - 2.5 * squared + 1.5 * cubed,
|
|
107
|
+
0.5 * fraction + 2 * squared - 1.5 * cubed,
|
|
108
|
+
-0.5 * squared + 0.5 * cubed
|
|
109
|
+
];
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Reject only if ALL four previous 1-depth taps are closer than expected by 5%; absolute
|
|
113
|
+
* far-plane guard 1e-5. Both arguments are `1 - depth` values, as the textures store them.
|
|
114
|
+
*/
|
|
115
|
+
export function isDisoccluded(previousOneMinusDepth, expectedPreviousOneMinusDepth, tolerance = 0.05) {
|
|
116
|
+
const expected = Math.max(0, expectedPreviousOneMinusDepth);
|
|
117
|
+
return Math.min(...previousOneMinusDepth) > expected + Math.max(expected * tolerance, 0.00001);
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Scale of the accumulation kernel, in render pixels: at default sharpness, 1 at native size and 1.7 at half size.
|
|
121
|
+
* A larger scale gives a narrower kernel, so a sample contributes only close to its centre.
|
|
122
|
+
* Sharpness is clamped to [0.5,1]. The default factor 0.85 makes the lobe a little wider than one output pixel. With a factor of 1, the
|
|
123
|
+
* neighbouring output pixels share too few samples, and edges show a one-pixel comb pattern.
|
|
124
|
+
*/
|
|
125
|
+
export function getKernelScale(renderSize, outputSize, kernelSharpness = DEFAULT_KERNEL_SHARPNESS) {
|
|
126
|
+
const ratio = Math.min(outputSize[0] / renderSize[0], outputSize[1] / renderSize[1]);
|
|
127
|
+
return Math.min(2, Math.max(1, ratio * Math.min(1, Math.max(0.5, kernelSharpness))));
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Weight of one render sample at a distance (render pixels) from an output pixel centre: the
|
|
131
|
+
* main lobe of the Lanczos-2 kernel, narrowed by the kernel scale. Range [0, 1].
|
|
132
|
+
*/
|
|
133
|
+
export function getSampleWeight(distance, kernelScale) {
|
|
134
|
+
return (Math.max(0, lanczos2(distance[0] * kernelScale)) *
|
|
135
|
+
Math.max(0, lanczos2(distance[1] * kernelScale)));
|
|
136
|
+
}
|
|
137
|
+
/** Largest accumulated weight. A full-weight sample then has a blend factor of 1 - historyWeightMax. */
|
|
138
|
+
export function getMaximumWeight(historyWeightMax = 0.95) {
|
|
139
|
+
const maximum = Math.min(0.999, Math.max(0, historyWeightMax));
|
|
140
|
+
return maximum / (1 - maximum);
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Blend factor of the current frame: its sample weight as a fraction of all accumulated weight.
|
|
144
|
+
* It is 0 when no render sample is close to the output pixel, and 1 without valid history.
|
|
145
|
+
*/
|
|
146
|
+
export function getCurrentBlend(sampleWeight, accumulatedWeight, historyWeightMax = 0.95, isHistoryValid = true) {
|
|
147
|
+
if (!isHistoryValid)
|
|
148
|
+
return 1;
|
|
149
|
+
const accumulated = Math.min(accumulatedWeight, getMaximumWeight(historyWeightMax));
|
|
150
|
+
return sampleWeight / Math.max(accumulated + sampleWeight, 0.00001);
|
|
151
|
+
}
|
|
152
|
+
/** Accumulated weight to store after a frame. A pixel without history starts with an average frame. */
|
|
153
|
+
export function getNextWeight(sampleWeight, accumulatedWeight, kernelScale, historyWeightMax = 0.95, isHistoryValid = true) {
|
|
154
|
+
if (!isHistoryValid)
|
|
155
|
+
return Math.max(sampleWeight, 1 / (kernelScale * kernelScale));
|
|
156
|
+
const maximum = getMaximumWeight(historyWeightMax);
|
|
157
|
+
return Math.min(Math.min(accumulatedWeight, maximum) + sampleWeight, maximum);
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Tests whether the history explains a sample of the current frame: 1 when each YCoCg component
|
|
161
|
+
* of the sample is inside the range of the history near the sample position, 0 when a component
|
|
162
|
+
* is outside by more than 12 % of the larger luma, with a smooth step between 3 % and 12 %.
|
|
163
|
+
*/
|
|
164
|
+
export function getHistoryTrust(sample, historyMinimum, historyMaximum,
|
|
165
|
+
/** Alpha of the sample and the alpha range of the history, [sample, minimum, maximum]. */
|
|
166
|
+
alpha = [1, 1, 1]) {
|
|
167
|
+
const excess = Math.max(0, ...sample.map((value, index) => Math.max(historyMinimum[index] - value, value - historyMaximum[index])));
|
|
168
|
+
// Coverage is tested too: a change of alpha can leave the premultiplied color the same.
|
|
169
|
+
const alphaExcess = Math.max(0, alpha[1] - alpha[0], alpha[0] - alpha[2]);
|
|
170
|
+
const relative = Math.max(excess / Math.max(sample[0], historyMaximum[0], 0.02), alphaExcess);
|
|
171
|
+
const t = Math.min(1, Math.max(0, (relative - 0.03) / (0.12 - 0.03)));
|
|
172
|
+
return 1 - t * t * (3 - 2 * t);
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Luminance disagreement outside the current 3x3 YCoCg Y range, before history clipping.
|
|
176
|
+
* Relative excess uses the larger absolute luminance with a 0.02 dark-noise floor.
|
|
177
|
+
* Smoothstep from 10% to 30% ignores small fluctuations; in-range history always returns zero.
|
|
178
|
+
*/
|
|
179
|
+
export function getLuminanceChange(historyLuminance, minimumLuminance, maximumLuminance) {
|
|
180
|
+
const excess = Math.max(0, minimumLuminance - historyLuminance, historyLuminance - maximumLuminance);
|
|
181
|
+
const relative = excess /
|
|
182
|
+
Math.max(Math.abs(historyLuminance), Math.abs(minimumLuminance), Math.abs(maximumLuminance), 0.02);
|
|
183
|
+
const transition = Math.min(1, Math.max(0, (relative - 0.1) / 0.2));
|
|
184
|
+
return transition * transition * (3 - 2 * transition);
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Fraction of the accumulated history weight to forget in one frame.
|
|
188
|
+
* `luminanceChange` is the result of `getLuminanceChange`. `sampleWeight` is the accumulation
|
|
189
|
+
* weight of the current frame at this output pixel. A frame is evidence for a change only when
|
|
190
|
+
* one of its samples lies close to the output pixel, so the weight gates the result with a
|
|
191
|
+
* smoothstep from 0.5 to 0.8. Without this gate, each frame whose samples miss a feature
|
|
192
|
+
* smaller than a render pixel would erase that feature from the history.
|
|
193
|
+
*/
|
|
194
|
+
export function getForgetting(responsiveness, luminanceChange, sampleWeight) {
|
|
195
|
+
const evidence = Math.min(1, Math.max(0, (sampleWeight - 0.5) / 0.3));
|
|
196
|
+
return (Math.min(1, Math.max(0, responsiveness)) *
|
|
197
|
+
luminanceChange *
|
|
198
|
+
evidence *
|
|
199
|
+
evidence *
|
|
200
|
+
(3 - 2 * evidence));
|
|
201
|
+
}
|
|
202
|
+
//# sourceMappingURL=temporal-math.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"temporal-math.js","sourceRoot":"","sources":["../../../src/effects/temporal-upscale/temporal-math.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAE5D,wFAAwF;AACxF,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC;AAE7C,yDAAyD;AACzD,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAO1C,iGAAiG;AACjG,MAAM,UAAU,MAAM,CAAC,KAAa,EAAE,IAAY;IAChD,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,OAAO,KAAK,GAAG,CAAC,EAAE,CAAC;QACjB,QAAQ,IAAI,IAAI,CAAC;QACjB,MAAM,IAAI,QAAQ,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;QACpC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;IACnC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,6FAA6F;AAC7F,MAAM,UAAU,mBAAmB,CAAC,WAAmB,EAAE,WAAmB;IAC1E,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,WAAW,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACtE,CAAC;AAED,kGAAkG;AAClG,MAAM,UAAU,eAAe,CAAC,UAAkB,EAAE,UA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