@luma.gl/engine 10.0.0-rc.1 → 10.0.0-rc.2
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 +82 -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 +1671 -1105
- 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 +402 -0
- package/dist/effects/graph/gpu-effect-operation.d.ts +101 -0
- package/dist/effects/graph/gpu-effect-operation.d.ts.map +1 -0
- package/dist/effects/graph/gpu-effect-operation.js +410 -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 +117 -30
- package/dist/effects/index.cjs.map +3 -3
- package/dist/effects/index.d.ts +34 -18
- package/dist/effects/index.d.ts.map +1 -1
- package/dist/effects/index.js +31 -18
- package/dist/effects/index.js.map +1 -1
- 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/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-blur-filters/bloom-composite-shader-pass.cjs +200 -13
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-composite-shader-pass.d.ts +992 -6
- 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 +3 -3
- 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/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 +83 -66
- package/dist/effects/passes/screen-space/clustered-volumetric-lighting.d.ts +470 -2
- package/dist/effects/passes/screen-space/clustered-volumetric-lighting.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/clustered-volumetric-lighting.js +80 -62
- 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 +14 -5
- package/dist/effects/passes/screen-space/depth-aware-blur.d.ts +125 -17
- package/dist/effects/passes/screen-space/depth-aware-blur.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/depth-aware-blur.js +11 -3
- package/dist/effects/passes/screen-space/depth-aware-blur.js.map +1 -1
- package/dist/effects/passes/screen-space/dof.cjs +19 -3
- package/dist/effects/passes/screen-space/dof.d.ts +181 -0
- package/dist/effects/passes/screen-space/dof.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/dof.js +17 -3
- package/dist/effects/passes/screen-space/dof.js.map +1 -1
- package/dist/effects/passes/screen-space/gtao.cjs +82 -62
- package/dist/effects/passes/screen-space/gtao.d.ts +608 -3
- package/dist/effects/passes/screen-space/gtao.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/gtao.js +83 -60
- 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 +225 -3
- 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 +162 -3
- 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 +70 -61
- package/dist/effects/passes/screen-space/screen-space-global-illumination.d.ts +309 -2
- 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 +69 -59
- package/dist/effects/passes/screen-space/screen-space-global-illumination.js.map +1 -1
- package/dist/effects/passes/screen-space/screen-space-reflections.cjs +151 -83
- package/dist/effects/passes/screen-space/screen-space-reflections.d.ts +778 -7
- package/dist/effects/passes/screen-space/screen-space-reflections.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/screen-space-reflections.js +148 -79
- 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 +647 -2
- 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/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 +161 -2
- 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/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 -0
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- 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 +71 -20
- package/dist/lighting/clustered-light-grid.d.ts +37 -0
- package/dist/lighting/clustered-light-grid.d.ts.map +1 -1
- package/dist/lighting/clustered-light-grid.js +68 -18
- 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 +274 -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 +11 -6
- 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 +155 -0
- package/dist/passes/effect-renderer.d.ts +158 -0
- package/dist/passes/effect-renderer.d.ts.map +1 -0
- package/dist/passes/effect-renderer.js +143 -0
- package/dist/passes/effect-renderer.js.map +1 -0
- 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/passes/shader-pass-renderer.cjs +94 -68
- package/dist/passes/shader-pass-renderer.d.ts +32 -15
- package/dist/passes/shader-pass-renderer.d.ts.map +1 -1
- package/dist/passes/shader-pass-renderer.js +104 -76
- package/dist/passes/shader-pass-renderer.js.map +1 -1
- 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/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 +3 -1
- package/dist/text/fonts/atlas/browser-font-atlas.d.ts.map +1 -1
- package/dist/text/fonts/atlas/browser-font-atlas.js +10 -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/index.cjs +2 -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/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 +38 -14
- package/src/effects/glfx-effects.ts +227 -0
- package/src/effects/graph/gpu-effect-operation.ts +601 -0
- package/src/effects/graph/temporal-graph-history.ts +46 -0
- package/src/effects/index.ts +81 -19
- package/src/effects/passes/postprocessing/fxaa/fxaa.ts +8 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/tone-mapping.ts +8 -0
- package/src/effects/passes/postprocessing/image-blur-filters/bloom-composite-shader-pass.ts +219 -19
- package/src/effects/passes/postprocessing/image-blur-filters/bloom-compute-pyramid.ts +6 -6
- package/src/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.ts +45 -45
- package/src/effects/passes/screen-space/clustered-volumetric-lighting.ts +88 -68
- package/src/effects/passes/screen-space/copy-pass.ts +4 -0
- package/src/effects/passes/screen-space/depth-aware-blur.ts +13 -3
- package/src/effects/passes/screen-space/dof.ts +20 -3
- package/src/effects/passes/screen-space/gtao.ts +91 -65
- package/src/effects/passes/screen-space/hdr-auto-exposure.ts +109 -84
- package/src/effects/passes/screen-space/height-fog.ts +18 -3
- package/src/effects/passes/screen-space/motion-blur.ts +8 -7
- package/src/effects/passes/screen-space/outlines.ts +143 -17
- package/src/effects/passes/screen-space/screen-space-global-illumination.ts +75 -64
- package/src/effects/passes/screen-space/screen-space-reflections.ts +158 -95
- package/src/effects/passes/screen-space/selection-outline.ts +11 -0
- package/src/effects/passes/screen-space/ssao.ts +76 -45
- package/src/effects/passes/screen-space/temporal-antialiasing.ts +43 -33
- package/src/effects/passes/screen-space/temporal-frame.ts +33 -0
- package/src/effects/passes/screen-space/volumetric-fog.ts +30 -24
- 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 +25 -0
- package/src/lighting/ambient-occlusion-pass.ts +62 -28
- package/src/lighting/clustered-light-grid.ts +87 -30
- 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 +12 -3
- package/src/lighting/shadow-map-renderer.ts +57 -43
- package/src/model/gpu-vector-model.ts +47 -18
- package/src/passes/effect-renderer.ts +332 -0
- package/src/passes/scene-capture-pass.ts +51 -0
- package/src/passes/shader-pass-renderer.ts +164 -115
- package/src/scenegraph/model-node.ts +5 -0
- 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 +12 -2
- package/src/text/fonts/atlas/lru-cache.ts +6 -1
- package/src/text/fonts/index.ts +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glfx-effects.d.ts","sourceRoot":"","sources":["../../src/effects/glfx-effects.ts"],"names":[],"mappings":"AA4BA,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIO,CAAC;AAI7C,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWkB,CAAC;AAE7C,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIY,CAAC;AAE7C,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIoB,CAAC;AAE7C,2EAA2E;AAC3E,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmB6B,CAAC;AAEtD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;CAGoB,CAAC;AAE7C,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIiB,CAAC;AAE7C,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAI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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIoB,CAAC"}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
import { copyPass } from "./passes/screen-space/copy-pass.js";
|
|
5
|
+
import { brightnessContrast } from "./passes/postprocessing/image-adjust-filters/brightnesscontrast.js";
|
|
6
|
+
import { denoise } from "./passes/postprocessing/image-adjust-filters/denoise.js";
|
|
7
|
+
import { hueSaturation } from "./passes/postprocessing/image-adjust-filters/huesaturation.js";
|
|
8
|
+
import { noise } from "./passes/postprocessing/image-adjust-filters/noise.js";
|
|
9
|
+
import { persistenceEffect } from "./passes/postprocessing/image-adjust-filters/persistence.js";
|
|
10
|
+
import { sepia } from "./passes/postprocessing/image-adjust-filters/sepia.js";
|
|
11
|
+
import { vibrance } from "./passes/postprocessing/image-adjust-filters/vibrance.js";
|
|
12
|
+
import { vignette } from "./passes/postprocessing/image-adjust-filters/vignette.js";
|
|
13
|
+
import { bloom } from "./passes/postprocessing/image-blur-filters/bloom.js";
|
|
14
|
+
import { gaussianBlur } from "./passes/postprocessing/image-blur-filters/gaussianblur.js";
|
|
15
|
+
import { tiltShift } from "./passes/postprocessing/image-blur-filters/tiltshift.js";
|
|
16
|
+
import { triangleBlur } from "./passes/postprocessing/image-blur-filters/triangleblur.js";
|
|
17
|
+
import { zoomBlur } from "./passes/postprocessing/image-blur-filters/zoomblur.js";
|
|
18
|
+
import { colorHalftone } from "./passes/postprocessing/image-fun-filters/colorhalftone.js";
|
|
19
|
+
import { dotScreen } from "./passes/postprocessing/image-fun-filters/dotscreen.js";
|
|
20
|
+
import { edgeWork } from "./passes/postprocessing/image-fun-filters/edgework.js";
|
|
21
|
+
import { hexagonalPixelate } from "./passes/postprocessing/image-fun-filters/hexagonalpixelate.js";
|
|
22
|
+
import { ink } from "./passes/postprocessing/image-fun-filters/ink.js";
|
|
23
|
+
import { magnify } from "./passes/postprocessing/image-fun-filters/magnify.js";
|
|
24
|
+
import { bulgePinch } from "./passes/postprocessing/image-warp-filters/bulgepinch.js";
|
|
25
|
+
import { swirl } from "./passes/postprocessing/image-warp-filters/swirl.js";
|
|
26
|
+
export const brightnessContrastEffect = {
|
|
27
|
+
name: brightnessContrast.name,
|
|
28
|
+
resources: {},
|
|
29
|
+
passes: [{ kind: 'fullscreen', shaderPass: brightnessContrast, output: 'previous' }]
|
|
30
|
+
};
|
|
31
|
+
const denoiseSample = { ...denoise, passes: [{ sampler: true }] };
|
|
32
|
+
export const denoiseEffect = {
|
|
33
|
+
name: denoise.name,
|
|
34
|
+
resources: {},
|
|
35
|
+
passes: [
|
|
36
|
+
{ kind: 'fullscreen', shaderPass: denoiseSample, output: 'previous' },
|
|
37
|
+
{
|
|
38
|
+
kind: 'fullscreen',
|
|
39
|
+
shaderPass: denoiseSample,
|
|
40
|
+
output: 'previous'
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
};
|
|
44
|
+
export const hueSaturationEffect = {
|
|
45
|
+
name: hueSaturation.name,
|
|
46
|
+
resources: {},
|
|
47
|
+
passes: [{ kind: 'fullscreen', shaderPass: hueSaturation, output: 'previous' }]
|
|
48
|
+
};
|
|
49
|
+
export const noiseEffect = {
|
|
50
|
+
name: noise.name,
|
|
51
|
+
resources: {},
|
|
52
|
+
passes: [{ kind: 'fullscreen', shaderPass: noise, output: 'previous' }]
|
|
53
|
+
};
|
|
54
|
+
/** Accumulates fading trails in a history texture owned by this effect. */
|
|
55
|
+
export const persistence = {
|
|
56
|
+
name: persistenceEffect.name,
|
|
57
|
+
resources: {
|
|
58
|
+
accumulation: { lifetime: 'history', initialize: { clearColor: [0, 0, 0, 0] } }
|
|
59
|
+
},
|
|
60
|
+
passes: [
|
|
61
|
+
{
|
|
62
|
+
kind: 'fullscreen',
|
|
63
|
+
shaderPass: persistenceEffect,
|
|
64
|
+
inputs: { sourceTexture: 'previous', persistenceTexture: 'accumulation' },
|
|
65
|
+
output: 'accumulation'
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
kind: 'fullscreen',
|
|
69
|
+
shaderPass: copyPass,
|
|
70
|
+
inputs: { sourceTexture: 'accumulation' },
|
|
71
|
+
output: 'previous'
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
};
|
|
75
|
+
export const sepiaEffect = {
|
|
76
|
+
name: sepia.name,
|
|
77
|
+
passes: [{ kind: 'filter', module: sepia }]
|
|
78
|
+
};
|
|
79
|
+
export const vibranceEffect = {
|
|
80
|
+
name: vibrance.name,
|
|
81
|
+
resources: {},
|
|
82
|
+
passes: [{ kind: 'fullscreen', shaderPass: vibrance, output: 'previous' }]
|
|
83
|
+
};
|
|
84
|
+
export const vignetteEffect = {
|
|
85
|
+
name: vignette.name,
|
|
86
|
+
resources: {},
|
|
87
|
+
passes: [{ kind: 'fullscreen', shaderPass: vignette, output: 'previous' }]
|
|
88
|
+
};
|
|
89
|
+
export const bloomEffect = {
|
|
90
|
+
name: bloom.name,
|
|
91
|
+
resources: {},
|
|
92
|
+
passes: [{ kind: 'fullscreen', shaderPass: bloom, output: 'previous' }]
|
|
93
|
+
};
|
|
94
|
+
const gaussianBlurSample = { ...gaussianBlur, passes: [{ sampler: true }] };
|
|
95
|
+
export const gaussianBlurEffect = {
|
|
96
|
+
name: gaussianBlur.name,
|
|
97
|
+
resources: {},
|
|
98
|
+
passes: [
|
|
99
|
+
{
|
|
100
|
+
kind: 'fullscreen',
|
|
101
|
+
shaderPass: gaussianBlurSample,
|
|
102
|
+
output: 'previous',
|
|
103
|
+
uniforms: { delta: [1, 0] }
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
kind: 'fullscreen',
|
|
107
|
+
shaderPass: gaussianBlurSample,
|
|
108
|
+
output: 'previous',
|
|
109
|
+
uniforms: { delta: [0, 1] }
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
};
|
|
113
|
+
const tiltShiftSample = { ...tiltShift, passes: [{ sampler: true }] };
|
|
114
|
+
export const tiltShiftEffect = {
|
|
115
|
+
name: tiltShift.name,
|
|
116
|
+
resources: {},
|
|
117
|
+
passes: [
|
|
118
|
+
{ kind: 'fullscreen', shaderPass: tiltShiftSample, output: 'previous', uniforms: { invert: 0 } },
|
|
119
|
+
{
|
|
120
|
+
kind: 'fullscreen',
|
|
121
|
+
shaderPass: tiltShiftSample,
|
|
122
|
+
output: 'previous',
|
|
123
|
+
uniforms: { invert: 1 }
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
};
|
|
127
|
+
const triangleBlurSample = { ...triangleBlur, passes: [{ sampler: true }] };
|
|
128
|
+
export const triangleBlurEffect = {
|
|
129
|
+
name: triangleBlur.name,
|
|
130
|
+
resources: {},
|
|
131
|
+
passes: [
|
|
132
|
+
{
|
|
133
|
+
kind: 'fullscreen',
|
|
134
|
+
shaderPass: triangleBlurSample,
|
|
135
|
+
output: 'previous',
|
|
136
|
+
uniforms: { delta: [1, 0] }
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
kind: 'fullscreen',
|
|
140
|
+
shaderPass: triangleBlurSample,
|
|
141
|
+
output: 'previous',
|
|
142
|
+
uniforms: { delta: [0, 1] }
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
};
|
|
146
|
+
export const zoomBlurEffect = {
|
|
147
|
+
name: zoomBlur.name,
|
|
148
|
+
resources: {},
|
|
149
|
+
passes: [{ kind: 'fullscreen', shaderPass: zoomBlur, output: 'previous' }]
|
|
150
|
+
};
|
|
151
|
+
export const colorHalftoneEffect = {
|
|
152
|
+
name: colorHalftone.name,
|
|
153
|
+
resources: {},
|
|
154
|
+
passes: [{ kind: 'fullscreen', shaderPass: colorHalftone, output: 'previous' }]
|
|
155
|
+
};
|
|
156
|
+
export const dotScreenEffect = {
|
|
157
|
+
name: dotScreen.name,
|
|
158
|
+
resources: {},
|
|
159
|
+
passes: [{ kind: 'fullscreen', shaderPass: dotScreen, output: 'previous' }]
|
|
160
|
+
};
|
|
161
|
+
const edgeWorkSample = { ...edgeWork, passes: [{ sampler: true }] };
|
|
162
|
+
export const edgeWorkEffect = {
|
|
163
|
+
name: edgeWork.name,
|
|
164
|
+
resources: {},
|
|
165
|
+
passes: [
|
|
166
|
+
{ kind: 'fullscreen', shaderPass: edgeWorkSample, output: 'previous', uniforms: { mode: 0 } },
|
|
167
|
+
{
|
|
168
|
+
kind: 'fullscreen',
|
|
169
|
+
shaderPass: edgeWorkSample,
|
|
170
|
+
output: 'previous',
|
|
171
|
+
uniforms: { mode: 1 }
|
|
172
|
+
}
|
|
173
|
+
]
|
|
174
|
+
};
|
|
175
|
+
export const hexagonalPixelateEffect = {
|
|
176
|
+
name: hexagonalPixelate.name,
|
|
177
|
+
resources: {},
|
|
178
|
+
passes: [{ kind: 'fullscreen', shaderPass: hexagonalPixelate, output: 'previous' }]
|
|
179
|
+
};
|
|
180
|
+
export const inkEffect = {
|
|
181
|
+
name: ink.name,
|
|
182
|
+
resources: {},
|
|
183
|
+
passes: [{ kind: 'fullscreen', shaderPass: ink, output: 'previous' }]
|
|
184
|
+
};
|
|
185
|
+
export const magnifyEffect = {
|
|
186
|
+
name: magnify.name,
|
|
187
|
+
resources: {},
|
|
188
|
+
passes: [{ kind: 'fullscreen', shaderPass: magnify, output: 'previous' }]
|
|
189
|
+
};
|
|
190
|
+
export const bulgePinchEffect = {
|
|
191
|
+
name: bulgePinch.name,
|
|
192
|
+
resources: {},
|
|
193
|
+
passes: [{ kind: 'fullscreen', shaderPass: bulgePinch, output: 'previous' }]
|
|
194
|
+
};
|
|
195
|
+
export const swirlEffect = {
|
|
196
|
+
name: swirl.name,
|
|
197
|
+
resources: {},
|
|
198
|
+
passes: [{ kind: 'fullscreen', shaderPass: swirl, output: 'previous' }]
|
|
199
|
+
};
|
|
200
|
+
//# sourceMappingURL=glfx-effects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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;CAC3B,CAAC"}
|
|
@@ -0,0 +1,402 @@
|
|
|
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 gpu_effect_operation_exports = {};
|
|
19
|
+
__export(gpu_effect_operation_exports, {
|
|
20
|
+
GPUEffectOperation: () => GPUEffectOperation,
|
|
21
|
+
addGraphTAA: () => addGraphTAA,
|
|
22
|
+
appendEffects: () => appendEffects,
|
|
23
|
+
createEffectRenderOperation: () => createEffectRenderOperation,
|
|
24
|
+
effectOperationLowering: () => effectOperationLowering
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(gpu_effect_operation_exports);
|
|
27
|
+
var import_core = require("@luma.gl/core");
|
|
28
|
+
var import_gpu_core = require("@luma.gl/graph/gpu-core");
|
|
29
|
+
var import_shaders = require("@luma.gl/shaders");
|
|
30
|
+
var import_temporal_antialiasing = require("../passes/screen-space/temporal-antialiasing.cjs");
|
|
31
|
+
var import_copy_pass = require("../passes/screen-space/copy-pass.cjs");
|
|
32
|
+
var import_effect_renderer = require("../../passes/effect-renderer.cjs");
|
|
33
|
+
var import_shader_pass_renderer = require("../../passes/shader-pass-renderer.cjs");
|
|
34
|
+
function planEffectOccurrences(entries) {
|
|
35
|
+
return (0, import_effect_renderer.resolveEffectEntries)(entries).map((definition, index) => {
|
|
36
|
+
const entry = entries[index];
|
|
37
|
+
return "effect" in entry ? { definition, bindings: { ...entry.bindings }, uniforms: { ...entry.uniforms } } : { definition };
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
class GPUEffectOperation {
|
|
41
|
+
props;
|
|
42
|
+
type = "effects";
|
|
43
|
+
id;
|
|
44
|
+
/** @internal Shared, resolved effect definitions. */
|
|
45
|
+
effects;
|
|
46
|
+
/** @internal Logical shader texture bindings. */
|
|
47
|
+
bindings;
|
|
48
|
+
/** @internal Single-sample output used by the operation contract. */
|
|
49
|
+
outputDescriptor;
|
|
50
|
+
constructor(props) {
|
|
51
|
+
this.props = props;
|
|
52
|
+
this.id = props.id ?? props.output + "-effects";
|
|
53
|
+
this.effects = planEffectOccurrences(props.effects);
|
|
54
|
+
this.bindings = Object.freeze({ ...props.bindings });
|
|
55
|
+
const { outputDescriptor } = props;
|
|
56
|
+
(0, import_core.assert)(outputDescriptor.extent && (outputDescriptor.dimension ?? "2d") === "2d" && (outputDescriptor.mipLevels ?? 1) === 1 && (outputDescriptor.samples ?? 1) === 1);
|
|
57
|
+
this.outputDescriptor = import_gpu_core.gpuGraph.texture({
|
|
58
|
+
...outputDescriptor,
|
|
59
|
+
dimension: "2d",
|
|
60
|
+
mipLevels: 1,
|
|
61
|
+
samples: 1
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/** The named values consumed and produced by this operation. */
|
|
65
|
+
get contract() {
|
|
66
|
+
return {
|
|
67
|
+
values: [
|
|
68
|
+
...Array.from(/* @__PURE__ */ new Set([
|
|
69
|
+
this.props.input,
|
|
70
|
+
...Object.values(this.bindings),
|
|
71
|
+
...this.effects.flatMap((entry) => Object.values(entry.bindings ?? {}))
|
|
72
|
+
]), (value) => ({
|
|
73
|
+
value,
|
|
74
|
+
access: "read",
|
|
75
|
+
textureUsage: "sampled"
|
|
76
|
+
})),
|
|
77
|
+
{ value: this.props.output, access: "write", textureUsage: "render-attachment" }
|
|
78
|
+
],
|
|
79
|
+
outputs: { [this.props.output]: this.outputDescriptor }
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
function appendEffects(graph, props) {
|
|
84
|
+
if (!props.effects.length)
|
|
85
|
+
return props.input;
|
|
86
|
+
graph.add(new GPUEffectOperation(props));
|
|
87
|
+
return props.output;
|
|
88
|
+
}
|
|
89
|
+
const effectOperationLowering = {
|
|
90
|
+
type: "effects",
|
|
91
|
+
lower: lowerEffectOperation
|
|
92
|
+
};
|
|
93
|
+
function lowerEffectOperation(operation, context) {
|
|
94
|
+
const { graph } = context;
|
|
95
|
+
const { props } = operation;
|
|
96
|
+
const nodes = buildEffectNodes(graph, {
|
|
97
|
+
...props,
|
|
98
|
+
id: graph.getUniqueResourceId(operation.id),
|
|
99
|
+
effects: operation.effects,
|
|
100
|
+
source: context.resolveTextureView(props.input),
|
|
101
|
+
output: context.resolveTextureView(props.output),
|
|
102
|
+
resolveTexture: (name) => context.resolveTextureView(name),
|
|
103
|
+
bindings: operation.bindings,
|
|
104
|
+
allowCompute: true
|
|
105
|
+
});
|
|
106
|
+
for (const node of nodes) {
|
|
107
|
+
if (node.type === "compute")
|
|
108
|
+
graph.addComputePass(node);
|
|
109
|
+
else
|
|
110
|
+
graph.addRenderPass(node);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function createEffectRenderOperation(props) {
|
|
114
|
+
const { id, input, output, bindings, uniforms, flipY } = props;
|
|
115
|
+
const effects = planEffectOccurrences(props.effects);
|
|
116
|
+
return new import_gpu_core.GPURenderOperation({
|
|
117
|
+
id,
|
|
118
|
+
createNodes: (graph) => {
|
|
119
|
+
const borrowed = /* @__PURE__ */ new Map();
|
|
120
|
+
const importTexture = (texture, name) => {
|
|
121
|
+
let view = borrowed.get(texture);
|
|
122
|
+
if (view)
|
|
123
|
+
return view;
|
|
124
|
+
view = graph.createTextureView(graph.importTexture({
|
|
125
|
+
id: id + "/borrowed-" + borrowed.size + "-" + name,
|
|
126
|
+
format: texture.format,
|
|
127
|
+
width: texture.width,
|
|
128
|
+
height: texture.height,
|
|
129
|
+
depth: texture.depth,
|
|
130
|
+
dimension: texture.dimension,
|
|
131
|
+
mipLevels: texture.mipLevels,
|
|
132
|
+
samples: texture.props.samples,
|
|
133
|
+
usage: texture.props.usage
|
|
134
|
+
}, texture));
|
|
135
|
+
borrowed.set(texture, view);
|
|
136
|
+
return view;
|
|
137
|
+
};
|
|
138
|
+
return buildEffectNodes(graph, {
|
|
139
|
+
id,
|
|
140
|
+
source: importTexture(input, "source"),
|
|
141
|
+
output: importTexture(output, "output"),
|
|
142
|
+
resolveTexture: (texture, name) => importTexture(texture, "binding-" + name),
|
|
143
|
+
bindings: { ...bindings },
|
|
144
|
+
effects,
|
|
145
|
+
uniforms,
|
|
146
|
+
flipY
|
|
147
|
+
}).filter((node) => node.type === "render");
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
function addGraphTAA(graph, props) {
|
|
152
|
+
(0, import_core.assert)(graph.device.type === "webgpu");
|
|
153
|
+
const { id, input, output, depth, velocity, colorHistory, depthHistory } = props;
|
|
154
|
+
for (const view of [
|
|
155
|
+
input,
|
|
156
|
+
output,
|
|
157
|
+
depth,
|
|
158
|
+
velocity,
|
|
159
|
+
colorHistory.previous,
|
|
160
|
+
colorHistory.current,
|
|
161
|
+
depthHistory.previous,
|
|
162
|
+
depthHistory.current
|
|
163
|
+
]) {
|
|
164
|
+
(0, import_core.assert)(view.width === input.width && view.height === input.height && view.dimension === "2d" && view.texture.samples === 1);
|
|
165
|
+
}
|
|
166
|
+
(0, import_core.assert)(colorHistory.previous.format === output.format && colorHistory.current.format === output.format);
|
|
167
|
+
const nodes = buildEffectNodes(graph, {
|
|
168
|
+
id: graph.getUniqueResourceId(id),
|
|
169
|
+
source: input,
|
|
170
|
+
output,
|
|
171
|
+
resolveTexture: (view) => view,
|
|
172
|
+
bindings: { depthTexture: depth, velocityTexture: velocity },
|
|
173
|
+
effects: [{ definition: (0, import_effect_renderer.resolveEffect)(import_temporal_antialiasing.taa) }],
|
|
174
|
+
history: { taaHistoryColor: colorHistory, taaHistoryDepth: depthHistory },
|
|
175
|
+
uniforms: {
|
|
176
|
+
taaResolve: {
|
|
177
|
+
depthThreshold: props.depthThreshold ?? import_temporal_antialiasing.taaResolve.propTypes.depthThreshold.value
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
getFrameUniforms: ({ currentJitter, previousJitter, resetHistory }) => ({
|
|
181
|
+
taaResolve: {
|
|
182
|
+
currentJitter,
|
|
183
|
+
previousJitter,
|
|
184
|
+
historyWeight: resetHistory ? 0 : props.historyWeight ?? import_temporal_antialiasing.taaResolve.propTypes.historyWeight.value
|
|
185
|
+
}
|
|
186
|
+
})
|
|
187
|
+
});
|
|
188
|
+
for (const node of nodes) {
|
|
189
|
+
if (node.type === "render")
|
|
190
|
+
graph.addRenderPass(node);
|
|
191
|
+
else
|
|
192
|
+
graph.addComputePass(node);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
function buildEffectNodes(graph, props) {
|
|
196
|
+
var _a, _b, _c, _d, _e, _f;
|
|
197
|
+
const source = { view: props.source };
|
|
198
|
+
const output = { view: props.output };
|
|
199
|
+
const colorFormat = props.output.format;
|
|
200
|
+
const flipY = props.flipY ?? graph.device.type === "webgpu";
|
|
201
|
+
(0, import_core.assert)(source.view.dimension === "2d" && source.view.texture.samples === 1);
|
|
202
|
+
const nodes = [];
|
|
203
|
+
let index = 0;
|
|
204
|
+
const nextId = (name) => props.id + "/" + index++ + "-" + name;
|
|
205
|
+
const resolveBindings = (bindings = {}) => Object.fromEntries(Object.entries(bindings).map(([name, value]) => [
|
|
206
|
+
name,
|
|
207
|
+
{ view: props.resolveTexture(value, name) }
|
|
208
|
+
]));
|
|
209
|
+
const sharedBindings = resolveBindings(props.bindings);
|
|
210
|
+
const plans = props.effects.map(({ definition: effect, bindings, uniforms }) => ({
|
|
211
|
+
effect,
|
|
212
|
+
bindings: { ...sharedBindings, ...resolveBindings(bindings) },
|
|
213
|
+
uniforms,
|
|
214
|
+
...(0, import_shader_pass_renderer.planFullscreenPasses)(graph.device, effect, {
|
|
215
|
+
allowCompute: props.allowCompute === true,
|
|
216
|
+
colorFormat
|
|
217
|
+
})
|
|
218
|
+
}));
|
|
219
|
+
const copy = {
|
|
220
|
+
ownerName: props.id,
|
|
221
|
+
shaderPass: import_copy_pass.copyPass,
|
|
222
|
+
subPass: import_copy_pass.copyPass.passes[0]
|
|
223
|
+
};
|
|
224
|
+
let previous = source;
|
|
225
|
+
if (plans.length && (graph.device.type === "webgpu" || flipY || source.view.width !== output.view.width || source.view.height !== output.view.height || source.view.format !== output.view.format)) {
|
|
226
|
+
previous = createTarget("source");
|
|
227
|
+
emitRender(copy, { sourceTexture: source }, previous, flipY);
|
|
228
|
+
}
|
|
229
|
+
for (const [planIndex, { effect, bindings: effectBindings, uniforms, compute, passes }] of plans.entries()) {
|
|
230
|
+
const targets = /* @__PURE__ */ Object.create(null);
|
|
231
|
+
const written = /* @__PURE__ */ new Set();
|
|
232
|
+
for (const [name, spec] of Object.entries(effect.renderTargets ?? {})) {
|
|
233
|
+
if (name === "original" || name === "previous") {
|
|
234
|
+
throw new Error(effect.name + ": reserved target " + name);
|
|
235
|
+
}
|
|
236
|
+
if (spec.lifetime === "history") {
|
|
237
|
+
const history = (_a = props.history) == null ? void 0 : _a[name];
|
|
238
|
+
if (!history)
|
|
239
|
+
throw new Error(effect.name + ": missing history roles for " + name);
|
|
240
|
+
targets[name] = { view: history.current, sampler: spec.sampler };
|
|
241
|
+
} else if (spec.aliasFor) {
|
|
242
|
+
const target = targets[spec.aliasFor];
|
|
243
|
+
const width = targetSize(output.view.width, (_b = spec.scale) == null ? void 0 : _b[0]);
|
|
244
|
+
const height = targetSize(output.view.height, (_c = spec.scale) == null ? void 0 : _c[1]);
|
|
245
|
+
(0, import_core.assert)(target && target.view.width === width && target.view.height === height && target.view.format === (spec.format ?? colorFormat) && (!spec.storage || target.view.texture.usage & import_core.Texture.STORAGE));
|
|
246
|
+
targets[name] = target;
|
|
247
|
+
} else {
|
|
248
|
+
targets[name] = createTarget(name, spec);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
const resolve = (name) => {
|
|
252
|
+
var _a2;
|
|
253
|
+
if (name === "original")
|
|
254
|
+
return source;
|
|
255
|
+
if (name === "previous")
|
|
256
|
+
return previous;
|
|
257
|
+
const target = targets[name];
|
|
258
|
+
if (target && !written.has(target.view)) {
|
|
259
|
+
const history = (_a2 = props.history) == null ? void 0 : _a2[name];
|
|
260
|
+
if (history)
|
|
261
|
+
return { view: history.previous, sampler: target.sampler };
|
|
262
|
+
}
|
|
263
|
+
if (!target || !written.has(target.view)) {
|
|
264
|
+
throw new Error(effect.name + ": unavailable input " + name);
|
|
265
|
+
}
|
|
266
|
+
return target;
|
|
267
|
+
};
|
|
268
|
+
if (compute) {
|
|
269
|
+
const input = resolve(compute.input);
|
|
270
|
+
const outputs = Object.entries(compute.outputs);
|
|
271
|
+
const dispatchTarget = targets[outputs[0][1]].view;
|
|
272
|
+
const shader = (_e = [...((_d = effect.initialPasses) == null ? void 0 : _d.fragment) ?? [], ...effect.steps].find((step) => step.shaderPass.name === compute.uniformModule)) == null ? void 0 : _e.shaderPass;
|
|
273
|
+
if (shader)
|
|
274
|
+
(0, import_shaders.initializeShaderModule)(shader);
|
|
275
|
+
nodes.push({
|
|
276
|
+
type: "compute",
|
|
277
|
+
id: nextId(compute.name),
|
|
278
|
+
resources: [
|
|
279
|
+
{ texture: input.view, usage: "sampled" },
|
|
280
|
+
...outputs.map(([, name]) => ({
|
|
281
|
+
texture: targets[name].view,
|
|
282
|
+
usage: "storage-write"
|
|
283
|
+
}))
|
|
284
|
+
],
|
|
285
|
+
compile: ({ device }) => {
|
|
286
|
+
const executable = new import_shader_pass_renderer.FullscreenComputePass(device, compute, Object.fromEntries(outputs.map(([, name]) => [name, targets[name].view.format])));
|
|
287
|
+
return {
|
|
288
|
+
prepare: (encoding) => {
|
|
289
|
+
var _a2;
|
|
290
|
+
return executable.prepare(encoding.commandEncoder, encoding.getTextureView(input.view), Object.fromEntries(outputs.map(([binding, name]) => [
|
|
291
|
+
binding,
|
|
292
|
+
encoding.getTextureView(targets[name].view)
|
|
293
|
+
])), {
|
|
294
|
+
...shader == null ? void 0 : shader.defaultUniforms,
|
|
295
|
+
...shader == null ? void 0 : shader.uniforms,
|
|
296
|
+
...compute.uniforms,
|
|
297
|
+
...(_a2 = props.uniforms) == null ? void 0 : _a2[compute.uniformModule],
|
|
298
|
+
...uniforms == null ? void 0 : uniforms[compute.uniformModule]
|
|
299
|
+
});
|
|
300
|
+
},
|
|
301
|
+
encode: ({ computePass }) => executable.dispatch(computePass, dispatchTarget.width, dispatchTarget.height),
|
|
302
|
+
destroy: () => executable.destroy()
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
for (const [, name] of outputs)
|
|
307
|
+
written.add(targets[name].view);
|
|
308
|
+
}
|
|
309
|
+
for (const [passIndex, pass] of passes.entries()) {
|
|
310
|
+
const name = pass.output ?? "previous";
|
|
311
|
+
const last = planIndex === plans.length - 1 && passIndex === passes.length - 1;
|
|
312
|
+
const bindings = { sourceTexture: previous };
|
|
313
|
+
for (const [binding, target] of Object.entries(effectBindings)) {
|
|
314
|
+
if (binding === "sourceTexture" || ((_f = pass.shaderPass.bindingLayout) == null ? void 0 : _f.some((entry) => entry.name === binding))) {
|
|
315
|
+
bindings[binding] = target;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
for (const [binding, value] of Object.entries(pass.inputs ?? { sourceTexture: "previous" })) {
|
|
319
|
+
if (value)
|
|
320
|
+
bindings[binding] = resolve(value);
|
|
321
|
+
}
|
|
322
|
+
const outputIsSampled = Object.values(bindings).some((binding) => binding.view.texture === output.view.texture);
|
|
323
|
+
const destination = name === "previous" ? last && !outputIsSampled ? output : createTarget("previous") : targets[name];
|
|
324
|
+
if (!destination)
|
|
325
|
+
throw new Error(effect.name + ": unknown output " + name);
|
|
326
|
+
emitRender(pass, bindings, destination, flipY, uniforms == null ? void 0 : uniforms[pass.shaderPass.name]);
|
|
327
|
+
written.add(destination.view);
|
|
328
|
+
if (name === "previous")
|
|
329
|
+
previous = destination;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
if (previous.view !== output.view) {
|
|
333
|
+
emitRender(copy, { sourceTexture: previous }, output, graph.device.type === "webgpu");
|
|
334
|
+
}
|
|
335
|
+
return nodes;
|
|
336
|
+
function createTarget(name, spec = {}) {
|
|
337
|
+
var _a2, _b2;
|
|
338
|
+
const format = spec.format ?? colorFormat;
|
|
339
|
+
const view = graph.createTextureView(graph.createTransientTexture({
|
|
340
|
+
id: nextId(name),
|
|
341
|
+
width: targetSize(output.view.width, (_a2 = spec.scale) == null ? void 0 : _a2[0]),
|
|
342
|
+
height: targetSize(output.view.height, (_b2 = spec.scale) == null ? void 0 : _b2[1]),
|
|
343
|
+
format,
|
|
344
|
+
usage: import_core.Texture.SAMPLE | import_core.Texture.RENDER | (spec.storage && graph.device.getTextureFormatCapabilities(format).store ? import_core.Texture.STORAGE : 0)
|
|
345
|
+
}));
|
|
346
|
+
return { view, sampler: spec.sampler };
|
|
347
|
+
}
|
|
348
|
+
function emitRender(pass, bindings, destination, flip, uniforms) {
|
|
349
|
+
const inputs = new import_gpu_core.GPURenderInputs({
|
|
350
|
+
textures: Object.fromEntries(Object.entries(bindings).map(([name, target]) => [name, { source: target.view }]))
|
|
351
|
+
});
|
|
352
|
+
nodes.push({
|
|
353
|
+
type: "render",
|
|
354
|
+
id: nextId(pass.shaderPass.name),
|
|
355
|
+
inputs,
|
|
356
|
+
attachments: { colorAttachments: [destination.view] },
|
|
357
|
+
compile: ({ device }) => {
|
|
358
|
+
const executable = new import_shader_pass_renderer.SubPassRenderer(device, pass.shaderPass, pass.subPass, flip);
|
|
359
|
+
const samplers = Object.fromEntries(Object.entries(bindings).filter(([, target]) => target.sampler).map(([name, target]) => [name, device.createSampler(target.sampler)]));
|
|
360
|
+
return {
|
|
361
|
+
prepare: (encoding) => {
|
|
362
|
+
var _a2, _b2;
|
|
363
|
+
const textures = inputs.resolveBindings(executable.model.pipeline.shaderLayout, encoding);
|
|
364
|
+
const resolvedSamplers = Object.fromEntries(Object.entries(bindings).map(([name, target]) => [
|
|
365
|
+
name + "Sampler",
|
|
366
|
+
samplers[name] ?? encoding.getTexture(target.view).sampler
|
|
367
|
+
]));
|
|
368
|
+
const sourceView = bindings["sourceTexture"].view;
|
|
369
|
+
executable.prepare({
|
|
370
|
+
commandEncoder: encoding.commandEncoder,
|
|
371
|
+
bindings: { ...textures, ...resolvedSamplers },
|
|
372
|
+
textureScale: (0, import_shader_pass_renderer.calculateTextureScale)(sourceView, destination.view),
|
|
373
|
+
uniforms: {
|
|
374
|
+
...pass.uniforms,
|
|
375
|
+
...(_a2 = props.uniforms) == null ? void 0 : _a2[pass.shaderPass.name],
|
|
376
|
+
...uniforms,
|
|
377
|
+
...(_b2 = props.getFrameUniforms) == null ? void 0 : _b2.call(props, encoding.parameters)[pass.shaderPass.name]
|
|
378
|
+
}
|
|
379
|
+
});
|
|
380
|
+
},
|
|
381
|
+
encode: ({ renderPass }) => executable.draw(renderPass),
|
|
382
|
+
destroy: () => {
|
|
383
|
+
executable.destroy();
|
|
384
|
+
for (const sampler of Object.values(samplers))
|
|
385
|
+
sampler.destroy();
|
|
386
|
+
}
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
function targetSize(size, scale = 1) {
|
|
393
|
+
return Math.max(1, Math.round(size * scale));
|
|
394
|
+
}
|
|
395
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
396
|
+
0 && (module.exports = {
|
|
397
|
+
GPUEffectOperation,
|
|
398
|
+
addGraphTAA,
|
|
399
|
+
appendEffects,
|
|
400
|
+
createEffectRenderOperation,
|
|
401
|
+
effectOperationLowering
|
|
402
|
+
});
|