@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
|
@@ -705,7 +705,20 @@ export class GPUVectorModel {
|
|
|
705
705
|
}
|
|
706
706
|
}
|
|
707
707
|
|
|
708
|
-
|
|
708
|
+
/**
|
|
709
|
+
* Draws one caller-owned WebGPU indirect record in the open pass. The active index buffer
|
|
710
|
+
* selects the indexed (20-byte) or non-indexed (16-byte) layout. The record supplies all
|
|
711
|
+
* counts and offsets for this call. Subsequent direct draws use the model's own counts.
|
|
712
|
+
* @param byteOffset Four-byte-aligned start of the record in a buffer with INDIRECT usage.
|
|
713
|
+
* @returns Whether the draw completed using the same readiness rules as draw().
|
|
714
|
+
*/
|
|
715
|
+
drawIndirect(renderPass: RenderPass, buffer: Buffer, byteOffset = 0): boolean {
|
|
716
|
+
// Indirect commands require WebGPU and a buffer created for indirect use.
|
|
717
|
+
assert(this.device.type === 'webgpu' && (buffer.usage & Buffer.INDIRECT) !== 0);
|
|
718
|
+
return this._draw(renderPass, buffer, byteOffset);
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
private _draw(renderPass: RenderPass, indirectBuffer?: Buffer, byteOffset = 0): boolean {
|
|
709
722
|
if (this.indexVector?.length === 0) {
|
|
710
723
|
this._lastDrawTimestamp = this.device.timestamp;
|
|
711
724
|
this._needsRedraw = false;
|
|
@@ -716,6 +729,13 @@ export class GPUVectorModel {
|
|
|
716
729
|
(this.geometryVectorBindings.batchCount !== 1 ||
|
|
717
730
|
this.attributeVectorBindings.batchCount !== 1)
|
|
718
731
|
) {
|
|
732
|
+
if (indirectBuffer) {
|
|
733
|
+
// A single command cannot describe multiple physical vector batches.
|
|
734
|
+
assert(
|
|
735
|
+
this.geometryVectorBindings.batchCount <= 1 &&
|
|
736
|
+
this.attributeVectorBindings.batchCount <= 1
|
|
737
|
+
);
|
|
738
|
+
}
|
|
719
739
|
return this.drawVectorGroups(renderPass);
|
|
720
740
|
}
|
|
721
741
|
if (this._drawBlockedReason && !this._pipelineNeedsUpdate) {
|
|
@@ -791,23 +811,32 @@ export class GPUVectorModel {
|
|
|
791
811
|
_bindGroupCacheKeys: this._getBindGroupCacheKeys()
|
|
792
812
|
});
|
|
793
813
|
renderPass.setVertexArray(this.vertexArray);
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
814
|
+
if (indirectBuffer) {
|
|
815
|
+
if (indexBuffer) {
|
|
816
|
+
renderPass.drawIndexedIndirect(indirectBuffer, byteOffset);
|
|
817
|
+
} else {
|
|
818
|
+
renderPass.drawIndirect(indirectBuffer, byteOffset);
|
|
819
|
+
}
|
|
820
|
+
drawSuccess = true;
|
|
821
|
+
} else {
|
|
822
|
+
const hasNoInstances = this.isInstanced === true && this.instanceCount === 0;
|
|
823
|
+
drawSuccess = hasNoInstances
|
|
824
|
+
? true
|
|
825
|
+
: renderPass.draw({
|
|
826
|
+
isInstanced: this.isInstanced,
|
|
827
|
+
vertexCount: this.vertexCount,
|
|
828
|
+
instanceCount: this.isInstanced ? this.instanceCount : undefined,
|
|
829
|
+
indexCount,
|
|
830
|
+
firstVertex: this.firstVertex,
|
|
831
|
+
firstIndex: this.firstIndex,
|
|
832
|
+
transformFeedback: this.transformFeedback || undefined,
|
|
833
|
+
uniforms: this.props.uniforms,
|
|
834
|
+
// WebGL shares underlying cached programs even for models that have different
|
|
835
|
+
// parameters and topology, so those compatibility overrides remain per draw.
|
|
836
|
+
parameters: this.parameters,
|
|
837
|
+
topology: this.topology
|
|
838
|
+
});
|
|
839
|
+
}
|
|
811
840
|
}
|
|
812
841
|
}
|
|
813
842
|
} finally {
|
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import type {
|
|
6
|
+
Binding,
|
|
7
|
+
CommandEncoder,
|
|
8
|
+
Device,
|
|
9
|
+
Framebuffer,
|
|
10
|
+
Sampler,
|
|
11
|
+
Texture,
|
|
12
|
+
TextureFormatColor
|
|
13
|
+
} from '@luma.gl/core';
|
|
14
|
+
import type {FullscreenEffectPlan} from './fullscreen-effect-plan';
|
|
15
|
+
import type {ShaderModule} from '@luma.gl/shaders';
|
|
16
|
+
import type {DynamicTexture, TextureBindingSource} from '@luma.gl/core/dynamic';
|
|
17
|
+
import type {ShaderInputs} from '../shader-inputs';
|
|
18
|
+
import type {EffectResource} from './fullscreen-effect-module';
|
|
19
|
+
import {
|
|
20
|
+
FullscreenEffectExecutor,
|
|
21
|
+
type EffectOccurrenceOverrides
|
|
22
|
+
} from './fullscreen-effect-executor';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* A fullscreen draw in an effect. The shader supplies the filtering or sampling
|
|
26
|
+
* implementation. Inputs route textures to its bindings and output selects the
|
|
27
|
+
* destination. Uniform values here provide defaults for this draw.
|
|
28
|
+
*/
|
|
29
|
+
export type EffectPass<TargetName extends string = string> =
|
|
30
|
+
| (FullscreenEffectPlan<TargetName>['steps'][number] & {kind: 'fullscreen'})
|
|
31
|
+
| (Omit<FullscreenEffectPlan<TargetName>['steps'][number], 'shaderPass'> & {
|
|
32
|
+
kind: 'filter' | 'sample';
|
|
33
|
+
module: ShaderModule<any, any, any>;
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* A reusable, device-independent description of a fullscreen effect.
|
|
38
|
+
*
|
|
39
|
+
* An effect receives the preceding color image and can sample additional textures
|
|
40
|
+
* supplied for the frame. Passes write either private named targets or the shared
|
|
41
|
+
* color chain. Each use of a definition gets its own render targets and history.
|
|
42
|
+
*
|
|
43
|
+
* Use `EffectDefinition<'targetA' | 'targetB'>` to check local target
|
|
44
|
+
* references when declaring an effect as a module-level constant. Treat the
|
|
45
|
+
* definition as immutable once a renderer uses it.
|
|
46
|
+
*
|
|
47
|
+
* @typeParam TargetName - Names of textures owned by this effect.
|
|
48
|
+
*/
|
|
49
|
+
export type EffectDefinition<TargetName extends string = string> = {
|
|
50
|
+
/** Label used to identify the effect and its GPU resources in diagnostics. */
|
|
51
|
+
name: string;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Textures owned by each occurrence of this effect. A target's scale is relative
|
|
55
|
+
* to the renderer size. History targets retain their prior frame value and may
|
|
56
|
+
* declare how to initialize it. Use an empty object for an effect that only
|
|
57
|
+
* writes to the shared color chain.
|
|
58
|
+
*/
|
|
59
|
+
resources?: Record<TargetName, EffectResource>;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Optional backend alternatives for a stage before the shared passes. Both
|
|
63
|
+
* implementations must produce the named textures the shared passes consume.
|
|
64
|
+
* The renderer selects the implementation once when constructed.
|
|
65
|
+
*/
|
|
66
|
+
initialPasses?: {
|
|
67
|
+
/**
|
|
68
|
+
* A fused WebGPU dispatch. Declare each storage output by binding name, and
|
|
69
|
+
* mark the corresponding resource with `storage: true`. The first listed
|
|
70
|
+
* output determines dispatch dimensions. The renderer checks device limits
|
|
71
|
+
* and storage-format support and chooses the fragment sequence if needed.
|
|
72
|
+
*/
|
|
73
|
+
compute?: NonNullable<FullscreenEffectPlan<TargetName>['initialPasses']>['compute'];
|
|
74
|
+
|
|
75
|
+
/** Portable fullscreen draws in execution order. */
|
|
76
|
+
fragment: EffectPass<TargetName>[];
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Shared fullscreen draws in execution order. Use `previous` to read or
|
|
81
|
+
* update the color chain, `original` to read the stack's input image, and a
|
|
82
|
+
* local resource name to route a texture between draws within the effect.
|
|
83
|
+
*/
|
|
84
|
+
passes: EffectPass<TargetName>[];
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
type EffectOptionKey<Options> = Options extends unknown ? Extract<keyof Options, string> : never;
|
|
88
|
+
|
|
89
|
+
/** Value accepted by a fullscreen pass uniform. */
|
|
90
|
+
type EffectUniform = NonNullable<EffectPass['uniforms']>[string];
|
|
91
|
+
|
|
92
|
+
/** Reads a construction option directly or through a lookup table. */
|
|
93
|
+
type EffectOptionValue<Options, Value = unknown> = {
|
|
94
|
+
option: EffectOptionKey<Options>;
|
|
95
|
+
values?: Readonly<Record<string, Value>>;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* A reusable effect whose resource descriptors or pass sequence depend on options.
|
|
100
|
+
* Configure it when constructing the stack or when topology changes. Per-frame
|
|
101
|
+
* uniforms and external textures are supplied to the renderer separately.
|
|
102
|
+
*/
|
|
103
|
+
export type ConfigurableEffectDefinition<Options, TargetName extends string = string> =
|
|
104
|
+
| {
|
|
105
|
+
/** Name of the effect being configured. */
|
|
106
|
+
name: string;
|
|
107
|
+
|
|
108
|
+
/** Returns resources and passes for one configuration. */
|
|
109
|
+
configure(options?: Options): EffectDefinition<TargetName>;
|
|
110
|
+
}
|
|
111
|
+
| (EffectDefinition<TargetName> & {
|
|
112
|
+
optionDefaults: Options;
|
|
113
|
+
/** A numeric option used for both dimensions of the listed render targets. */
|
|
114
|
+
scaleResources?: EffectOptionValue<Options, number> & {
|
|
115
|
+
targets: readonly TargetName[];
|
|
116
|
+
fallback?: EffectOptionValue<Options, number>;
|
|
117
|
+
defaultScale?: number;
|
|
118
|
+
minimum?: number;
|
|
119
|
+
factors?: Partial<Record<TargetName, number>>;
|
|
120
|
+
};
|
|
121
|
+
/** Initialize a history texture’s red channel from a numeric option. */
|
|
122
|
+
historyClearOptions?: Partial<
|
|
123
|
+
Record<TargetName, {option: EffectOptionKey<Options>; minimum?: number}>
|
|
124
|
+
>;
|
|
125
|
+
/** Map options to uniform defaults by shader module and uniform name. */
|
|
126
|
+
optionUniforms?: Record<string, Record<string, EffectOptionValue<Options, EffectUniform>>>;
|
|
127
|
+
/** Map option choices to logical inputs by shader module and binding name. */
|
|
128
|
+
optionInputs?: Record<
|
|
129
|
+
string,
|
|
130
|
+
Record<string, EffectOptionValue<Options, 'previous' | 'original' | TargetName>>
|
|
131
|
+
>;
|
|
132
|
+
/** Select replacement passes and resources using the value of an option. */
|
|
133
|
+
variants?: {
|
|
134
|
+
option: EffectOptionKey<Options>;
|
|
135
|
+
values: Record<
|
|
136
|
+
string,
|
|
137
|
+
Partial<Pick<EffectDefinition<TargetName>, 'name' | 'resources' | 'passes'>>
|
|
138
|
+
>;
|
|
139
|
+
};
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
/** @internal Resolves construction options into the executable effect. */
|
|
143
|
+
export function resolveEffectOptions<Options, TargetName extends string>(
|
|
144
|
+
effect: ConfigurableEffectDefinition<Options, TargetName>,
|
|
145
|
+
options?: NoInfer<Options>
|
|
146
|
+
): EffectDefinition<TargetName> {
|
|
147
|
+
if ('configure' in effect) return effect.configure(options);
|
|
148
|
+
const {
|
|
149
|
+
scaleResources,
|
|
150
|
+
variants,
|
|
151
|
+
optionDefaults,
|
|
152
|
+
optionUniforms,
|
|
153
|
+
optionInputs,
|
|
154
|
+
historyClearOptions
|
|
155
|
+
} = effect;
|
|
156
|
+
const overrides = options as Partial<Record<EffectOptionKey<Options>, unknown>> | undefined;
|
|
157
|
+
const defaults = optionDefaults as Partial<Record<EffectOptionKey<Options>, unknown>>;
|
|
158
|
+
const readOption = (key: EffectOptionKey<Options>) => overrides?.[key] ?? defaults[key];
|
|
159
|
+
const readValue = (mapping: EffectOptionValue<Options>) => {
|
|
160
|
+
const option = readOption(mapping.option);
|
|
161
|
+
if (!mapping.values) return option;
|
|
162
|
+
const key = String(option);
|
|
163
|
+
return Object.hasOwn(mapping.values, key) ? mapping.values[key] : undefined;
|
|
164
|
+
};
|
|
165
|
+
const value = variants && String(readOption(variants.option));
|
|
166
|
+
const variant =
|
|
167
|
+
variants && value !== undefined && Object.hasOwn(variants.values, value)
|
|
168
|
+
? variants.values[value]
|
|
169
|
+
: undefined;
|
|
170
|
+
const resolved = {...effect, ...variant};
|
|
171
|
+
const resources = {...resolved.resources} as NonNullable<
|
|
172
|
+
EffectDefinition<TargetName>['resources']
|
|
173
|
+
>;
|
|
174
|
+
if (scaleResources) {
|
|
175
|
+
const scale =
|
|
176
|
+
readValue(scaleResources) ??
|
|
177
|
+
(scaleResources.fallback && readValue(scaleResources.fallback)) ??
|
|
178
|
+
scaleResources.defaultScale;
|
|
179
|
+
if (
|
|
180
|
+
typeof scale !== 'number' ||
|
|
181
|
+
!Number.isFinite(scale) ||
|
|
182
|
+
(scale <= 0 && !scaleResources.minimum)
|
|
183
|
+
) {
|
|
184
|
+
throw new Error(effect.name + ': resource scale must be a finite positive number');
|
|
185
|
+
}
|
|
186
|
+
for (const name of scaleResources.targets) {
|
|
187
|
+
const resource = resources[name];
|
|
188
|
+
if (!resource?.scale) continue;
|
|
189
|
+
const factor = scaleResources.factors?.[name] ?? 1;
|
|
190
|
+
const size = Math.max(scale, scaleResources.minimum ?? 0) * factor;
|
|
191
|
+
resources[name] = {...resource, scale: [size, size]};
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
for (const name of Object.keys(historyClearOptions ?? {}) as TargetName[]) {
|
|
195
|
+
const mapping = historyClearOptions?.[name];
|
|
196
|
+
const resource = resources[name];
|
|
197
|
+
const initial = resource?.initialize;
|
|
198
|
+
if (!mapping || !initial || initial === 'original') continue;
|
|
199
|
+
const value = readOption(mapping.option);
|
|
200
|
+
if (typeof value === 'number' && Number.isFinite(value)) {
|
|
201
|
+
const [, green, blue, alpha] = initial.clearColor;
|
|
202
|
+
resources[name] = {
|
|
203
|
+
...resource,
|
|
204
|
+
initialize: {
|
|
205
|
+
clearColor: [Math.max(value, mapping.minimum ?? -Infinity), green, blue, alpha]
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
const passes = resolved.passes.map(pass => {
|
|
211
|
+
const moduleName = pass.kind === 'fullscreen' ? pass.shaderPass.name : pass.module.name;
|
|
212
|
+
const uniformOptions = optionUniforms?.[moduleName];
|
|
213
|
+
const inputOptions = optionInputs?.[moduleName];
|
|
214
|
+
if (!uniformOptions && !inputOptions) return pass;
|
|
215
|
+
const uniforms = {...pass.uniforms};
|
|
216
|
+
const inputs = {...pass.inputs};
|
|
217
|
+
for (const [name, mapping] of Object.entries(uniformOptions ?? {})) {
|
|
218
|
+
const value = readValue(mapping) as EffectUniform | undefined;
|
|
219
|
+
if (value !== undefined) uniforms[name] = value;
|
|
220
|
+
}
|
|
221
|
+
for (const [name, mapping] of Object.entries(inputOptions ?? {})) {
|
|
222
|
+
const value = readValue(mapping);
|
|
223
|
+
if (typeof value === 'string') inputs[name] = value as 'previous' | 'original' | TargetName;
|
|
224
|
+
}
|
|
225
|
+
return {...pass, uniforms, ...(inputOptions ? {inputs} : {})};
|
|
226
|
+
});
|
|
227
|
+
return {...resolved, resources, passes};
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/** @internal Lowers an effect definition to the fullscreen renderer's execution format. */
|
|
231
|
+
export function resolveEffect<TargetName extends string>(
|
|
232
|
+
effect: EffectDefinition<TargetName>
|
|
233
|
+
): FullscreenEffectPlan<TargetName> {
|
|
234
|
+
return {
|
|
235
|
+
name: effect.name,
|
|
236
|
+
renderTargets: effect.resources,
|
|
237
|
+
initialPasses: effect.initialPasses && {
|
|
238
|
+
...effect.initialPasses,
|
|
239
|
+
fragment: effect.initialPasses.fragment.map(lowerEffectPass)
|
|
240
|
+
},
|
|
241
|
+
steps: effect.passes.map(lowerEffectPass)
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
function lowerEffectPass<TargetName extends string>(
|
|
246
|
+
pass: EffectPass<TargetName>
|
|
247
|
+
): FullscreenEffectPlan<TargetName>['steps'][number] {
|
|
248
|
+
if (pass.kind === 'fullscreen') return pass;
|
|
249
|
+
const {kind, module, ...routing} = pass;
|
|
250
|
+
return {...routing, shaderPass: {...module, passes: [{action: kind}]}};
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/** Ordered effect definitions and their individually typed construction options. */
|
|
254
|
+
export type EffectEntries<
|
|
255
|
+
Options extends readonly unknown[],
|
|
256
|
+
TextureBinding = Binding | TextureBindingSource
|
|
257
|
+
> = {
|
|
258
|
+
readonly [Index in keyof Options]:
|
|
259
|
+
| EffectDefinition
|
|
260
|
+
| ({
|
|
261
|
+
effect: ConfigurableEffectDefinition<Options[Index]>;
|
|
262
|
+
options?: NoInfer<Options[Index]>;
|
|
263
|
+
} & EffectOccurrenceOverrides<TextureBinding>)
|
|
264
|
+
| ({
|
|
265
|
+
effect: EffectDefinition & {configure?: never; optionDefaults?: never};
|
|
266
|
+
options?: never;
|
|
267
|
+
} & EffectOccurrenceOverrides<TextureBinding>);
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
export type EffectRendererProps<Options extends readonly unknown[] = readonly unknown[]> = {
|
|
271
|
+
shaderInputs?: ShaderInputs;
|
|
272
|
+
colorFormat?: TextureFormatColor;
|
|
273
|
+
flipY?: boolean;
|
|
274
|
+
/**
|
|
275
|
+
* Effects run in array order, with each color output feeding the next effect.
|
|
276
|
+
* Configure reusable effects inline by supplying their definition and options.
|
|
277
|
+
* Each configuration is checked against the options declared by its effect.
|
|
278
|
+
*/
|
|
279
|
+
effects: EffectEntries<Options>;
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
/** Inputs and destination for a single effects frame. */
|
|
283
|
+
export type EffectRenderOptions = {
|
|
284
|
+
sourceTexture: Texture | DynamicTexture;
|
|
285
|
+
uniforms?: Record<string, Record<string, unknown>>;
|
|
286
|
+
bindings?: Record<string, Binding | TextureBindingSource>;
|
|
287
|
+
resetHistory?: boolean;
|
|
288
|
+
/** Omit to return the texture, pass null to present, or supply a borrowed framebuffer. */
|
|
289
|
+
target?: Framebuffer | null;
|
|
290
|
+
/** Defaults to the device encoder. The renderer records work without submitting it. */
|
|
291
|
+
commandEncoder?: CommandEncoder;
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
type EffectFrameInputs = Omit<EffectRenderOptions, 'target' | 'commandEncoder'>;
|
|
295
|
+
|
|
296
|
+
/** @internal Normalizes the public effect entries for either executor. */
|
|
297
|
+
export function resolveEffectEntries<
|
|
298
|
+
Options extends readonly unknown[],
|
|
299
|
+
TextureBinding = Binding | TextureBindingSource
|
|
300
|
+
>(effects: EffectEntries<Options, TextureBinding>): FullscreenEffectPlan[] {
|
|
301
|
+
return effects.map(entry => {
|
|
302
|
+
if (!('effect' in entry)) {
|
|
303
|
+
return resolveEffect(
|
|
304
|
+
'optionDefaults' in entry
|
|
305
|
+
? resolveEffectOptions(entry as ConfigurableEffectDefinition<Options[number]>)
|
|
306
|
+
: entry
|
|
307
|
+
);
|
|
308
|
+
}
|
|
309
|
+
const {effect} = entry;
|
|
310
|
+
if (('configure' in effect && effect.configure) || 'optionDefaults' in effect) {
|
|
311
|
+
return resolveEffect(
|
|
312
|
+
resolveEffectOptions(effect as ConfigurableEffectDefinition<Options[number]>, entry.options)
|
|
313
|
+
);
|
|
314
|
+
}
|
|
315
|
+
return resolveEffect(effect);
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Runs a chain of reusable fullscreen effects for a single device.
|
|
321
|
+
*
|
|
322
|
+
* Resize to the desired output size before rendering. Supply scene textures and
|
|
323
|
+
* per-frame uniforms to the render call. Reset history when the camera cuts or
|
|
324
|
+
* scene changes invalidate temporal data, and destroy the renderer when the
|
|
325
|
+
* chain is no longer needed.
|
|
326
|
+
*/
|
|
327
|
+
export class EffectRenderer<Options extends readonly unknown[] = readonly unknown[]> {
|
|
328
|
+
readonly device: Device;
|
|
329
|
+
#executor: FullscreenEffectExecutor;
|
|
330
|
+
constructor(device: Device, {effects, ...props}: EffectRendererProps<Options>) {
|
|
331
|
+
this.device = device;
|
|
332
|
+
this.#executor = new FullscreenEffectExecutor(device, {
|
|
333
|
+
...props,
|
|
334
|
+
shaderPasses: resolveEffectEntries(effects),
|
|
335
|
+
occurrences: effects.map(entry =>
|
|
336
|
+
'effect' in entry
|
|
337
|
+
? {bindings: {...entry.bindings}, uniforms: {...entry.uniforms}}
|
|
338
|
+
: undefined
|
|
339
|
+
)
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
destroy(): void {
|
|
344
|
+
this.#executor.destroy();
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
resize(size?: [width: number, height: number]): void {
|
|
348
|
+
this.#executor.resize(size);
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
resetHistory(): void {
|
|
352
|
+
this.#executor.resetHistory();
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/** Uses a borrowed sampler for both color-chain textures. Set again after resizing. */
|
|
356
|
+
setColorSampler(sampler: Sampler): void {
|
|
357
|
+
const {current, next} = this.#executor.swapFramebuffers;
|
|
358
|
+
current.colorAttachments[0].texture.setSampler(sampler);
|
|
359
|
+
next.colorAttachments[0].texture.setSampler(sampler);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
get shaderInputs(): ShaderInputs {
|
|
363
|
+
return this.#executor.shaderInputs;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
renderToTexture(options: EffectFrameInputs): Texture | null {
|
|
367
|
+
return this.render(options);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
renderToScreen(options: EffectFrameInputs): boolean {
|
|
371
|
+
return this.render({...options, target: null});
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
encodeToTexture(commandEncoder: CommandEncoder, options: EffectFrameInputs): Texture | null {
|
|
375
|
+
return this.render({...options, commandEncoder});
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
encodeToScreen(commandEncoder: CommandEncoder, options: EffectFrameInputs): boolean {
|
|
379
|
+
return this.render({...options, commandEncoder, target: null});
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
/** Records a frame and returns a borrowed texture, or whether presentation was recorded. */
|
|
383
|
+
render(options: EffectRenderOptions & {target?: undefined}): Texture | null;
|
|
384
|
+
render(options: EffectRenderOptions & {target: Framebuffer | null}): boolean;
|
|
385
|
+
render(options: EffectRenderOptions): Texture | null | boolean;
|
|
386
|
+
render({
|
|
387
|
+
target,
|
|
388
|
+
commandEncoder = this.device.commandEncoder,
|
|
389
|
+
...frame
|
|
390
|
+
}: EffectRenderOptions): Texture | null | boolean {
|
|
391
|
+
if (target && target.device !== this.device) {
|
|
392
|
+
throw new Error('EffectRenderer target must belong to the renderer device');
|
|
393
|
+
}
|
|
394
|
+
const output = this.#executor.encodeToTexture(commandEncoder, frame);
|
|
395
|
+
if (target === undefined) {
|
|
396
|
+
return output;
|
|
397
|
+
}
|
|
398
|
+
if (!output) {
|
|
399
|
+
return false;
|
|
400
|
+
}
|
|
401
|
+
this.#executor.drawOutput(commandEncoder, output, target);
|
|
402
|
+
return true;
|
|
403
|
+
}
|
|
404
|
+
}
|