@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
|
@@ -2,7 +2,15 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import type {
|
|
5
|
+
import type {
|
|
6
|
+
Binding,
|
|
7
|
+
BindingDeclaration,
|
|
8
|
+
CommandEncoder,
|
|
9
|
+
ComputePass,
|
|
10
|
+
TextureFormat,
|
|
11
|
+
TextureFormatColor,
|
|
12
|
+
TextureView
|
|
13
|
+
} from '@luma.gl/core';
|
|
6
14
|
import {Buffer, Device, Framebuffer, RenderPass, Texture} from '@luma.gl/core';
|
|
7
15
|
import type {
|
|
8
16
|
ShaderPass,
|
|
@@ -24,17 +32,23 @@ import {getFragmentShaderForRenderPass} from './get-fragment-shader';
|
|
|
24
32
|
import {textureTransform} from './texture-transform-module';
|
|
25
33
|
|
|
26
34
|
type ShaderPassLike = ShaderPass | CompositeShaderPass;
|
|
35
|
+
type ComputeStage = Omit<CompositeShaderPassComputeOptimization, 'replacedPasses'>;
|
|
27
36
|
type ShaderSubPass = NonNullable<ShaderPass['passes']>[0];
|
|
28
37
|
|
|
29
|
-
|
|
38
|
+
/** @internal One resolved fullscreen draw, before GPU objects are constructed. */
|
|
39
|
+
export type PlannedFullscreenPass = {
|
|
30
40
|
ownerName: string;
|
|
31
41
|
shaderPass: ShaderPass;
|
|
32
|
-
|
|
42
|
+
subPass: ShaderSubPass;
|
|
33
43
|
inputs?: Partial<Record<string, ShaderPassInputSource<string>>>;
|
|
34
44
|
output?: 'previous' | string;
|
|
35
45
|
uniforms?: Record<string, unknown>;
|
|
36
46
|
};
|
|
37
47
|
|
|
48
|
+
type EffectiveSubPass = Omit<PlannedFullscreenPass, 'subPass'> & {
|
|
49
|
+
subPassRenderer: SubPassRenderer;
|
|
50
|
+
};
|
|
51
|
+
|
|
38
52
|
type ManagedRenderTarget = {
|
|
39
53
|
name: string;
|
|
40
54
|
spec: ShaderPassRenderTarget;
|
|
@@ -165,9 +179,19 @@ export class ShaderPassRenderer {
|
|
|
165
179
|
return false;
|
|
166
180
|
}
|
|
167
181
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
182
|
+
this.drawOutput(commandEncoder, outputTexture, null);
|
|
183
|
+
return true;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/** @internal Records presentation of a completed effect output. */
|
|
187
|
+
protected drawOutput(
|
|
188
|
+
commandEncoder: CommandEncoder,
|
|
189
|
+
outputTexture: Texture,
|
|
190
|
+
target: Framebuffer | null
|
|
191
|
+
): void {
|
|
192
|
+
const framebuffer =
|
|
193
|
+
target ??
|
|
194
|
+
this.device.getDefaultCanvasContext().getCurrentFramebuffer({depthStencilFormat: false});
|
|
171
195
|
// Prepare fullscreen presentation bindings before opening the render pass so WebGPU
|
|
172
196
|
// uploads stay on the parent command encoder rather than the active render pass encoder.
|
|
173
197
|
this.textureModel.setProps({backgroundTexture: outputTexture});
|
|
@@ -177,9 +201,11 @@ export class ShaderPassRenderer {
|
|
|
177
201
|
framebuffer,
|
|
178
202
|
clearDepth: false
|
|
179
203
|
});
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
204
|
+
try {
|
|
205
|
+
this.textureModel.draw(renderPass);
|
|
206
|
+
} finally {
|
|
207
|
+
renderPass.end();
|
|
208
|
+
}
|
|
183
209
|
}
|
|
184
210
|
|
|
185
211
|
/** Runs the shaderPasses in sequence on the sourceTexture and returns a texture with the results.
|
|
@@ -313,7 +339,7 @@ class PassRenderer {
|
|
|
313
339
|
passDefinition: ShaderPassLike;
|
|
314
340
|
renderTargets: Record<string, ManagedRenderTarget>;
|
|
315
341
|
subPassExecutions: EffectiveSubPass[];
|
|
316
|
-
computeRenderer?:
|
|
342
|
+
computeRenderer?: FullscreenComputePass;
|
|
317
343
|
|
|
318
344
|
constructor(
|
|
319
345
|
device: Device,
|
|
@@ -328,31 +354,29 @@ class PassRenderer {
|
|
|
328
354
|
if (isCompositeShaderPass(passDefinition)) {
|
|
329
355
|
validateRenderTargetNames(passDefinition.name, passDefinition.renderTargets || {});
|
|
330
356
|
this.renderTargets = createManagedRenderTargets(device, passDefinition.renderTargets || {});
|
|
331
|
-
|
|
332
|
-
|
|
357
|
+
const {compute, passes} = planFullscreenPasses(device, passDefinition);
|
|
358
|
+
if (compute) {
|
|
359
|
+
this.computeRenderer = new FullscreenComputePass(
|
|
333
360
|
device,
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
361
|
+
compute,
|
|
362
|
+
Object.fromEntries(
|
|
363
|
+
Object.entries(this.renderTargets).map(([name, target]) => [
|
|
364
|
+
name,
|
|
365
|
+
target.texture.format
|
|
366
|
+
])
|
|
367
|
+
)
|
|
337
368
|
);
|
|
338
369
|
}
|
|
339
|
-
|
|
340
|
-
? passDefinition.steps.filter(
|
|
341
|
-
step => !passDefinition.compute!.replacedPasses.includes(step.shaderPass.name)
|
|
342
|
-
)
|
|
343
|
-
: passDefinition.steps;
|
|
344
|
-
this.subPassExecutions = executableSteps.flatMap(step =>
|
|
345
|
-
this.createStepExecutions(passDefinition, step, flipY)
|
|
346
|
-
);
|
|
370
|
+
this.subPassExecutions = this.createPassExecutions(passes, flipY);
|
|
347
371
|
return;
|
|
348
372
|
}
|
|
349
373
|
|
|
350
374
|
validateShaderPassDoesNotOwnRenderTargets(passDefinition, passDefinition.name);
|
|
351
375
|
this.renderTargets = {};
|
|
352
|
-
this.subPassExecutions = this.createPassExecutions(
|
|
353
|
-
|
|
376
|
+
this.subPassExecutions = this.createPassExecutions(
|
|
377
|
+
planShaderSubpasses(passDefinition, passDefinition.name),
|
|
354
378
|
flipY
|
|
355
|
-
|
|
379
|
+
);
|
|
356
380
|
}
|
|
357
381
|
|
|
358
382
|
destroy() {
|
|
@@ -381,8 +405,23 @@ class PassRenderer {
|
|
|
381
405
|
options.originalTexture,
|
|
382
406
|
options.previousTexture
|
|
383
407
|
);
|
|
384
|
-
this.computeRenderer
|
|
385
|
-
|
|
408
|
+
const {optimization} = this.computeRenderer;
|
|
409
|
+
const outputs = Object.fromEntries(
|
|
410
|
+
Object.entries(optimization.outputs).map(([binding, targetName]) => [
|
|
411
|
+
binding,
|
|
412
|
+
this.renderTargets[targetName].texture.view
|
|
413
|
+
])
|
|
414
|
+
);
|
|
415
|
+
this.computeRenderer.prepare(options.commandEncoder, sourceTexture.view, outputs, {
|
|
416
|
+
...this.shaderInputs.getUniformValues()[optimization.uniformModule],
|
|
417
|
+
...optimization.uniforms,
|
|
418
|
+
...options.runtimeUniforms[optimization.uniformModule]
|
|
419
|
+
});
|
|
420
|
+
const target = this.renderTargets[Object.values(optimization.outputs)[0]].texture;
|
|
421
|
+
const pass = options.commandEncoder.beginComputePass({id: optimization.name});
|
|
422
|
+
this.computeRenderer.dispatch(pass, target.width, target.height);
|
|
423
|
+
pass.end();
|
|
424
|
+
for (const targetName of Object.values(optimization.outputs)) {
|
|
386
425
|
this.markTargetWritten(targetName);
|
|
387
426
|
}
|
|
388
427
|
}
|
|
@@ -516,52 +555,15 @@ class PassRenderer {
|
|
|
516
555
|
return resolvedBindings;
|
|
517
556
|
}
|
|
518
557
|
|
|
519
|
-
private createStepExecutions(
|
|
520
|
-
compositeShaderPass: CompositeShaderPass,
|
|
521
|
-
step: CompositeShaderPass['steps'][number],
|
|
522
|
-
flipY: boolean
|
|
523
|
-
): EffectiveSubPass[] {
|
|
524
|
-
validateShaderPassDoesNotOwnRenderTargets(
|
|
525
|
-
step.shaderPass,
|
|
526
|
-
`${compositeShaderPass.name}/${step.shaderPass.name}`
|
|
527
|
-
);
|
|
528
|
-
|
|
529
|
-
return this.createPassExecutions(step.shaderPass, {
|
|
530
|
-
ownerName: `${compositeShaderPass.name}/${step.shaderPass.name}`,
|
|
531
|
-
firstInputs: step.inputs,
|
|
532
|
-
lastOutput: step.output,
|
|
533
|
-
uniformOverrides: step.uniforms,
|
|
534
|
-
flipY
|
|
535
|
-
});
|
|
536
|
-
}
|
|
537
|
-
|
|
538
558
|
private createPassExecutions(
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
ownerName: string;
|
|
542
|
-
firstInputs?: Partial<Record<string, ShaderPassInputSource<string>>>;
|
|
543
|
-
lastOutput?: 'previous' | string;
|
|
544
|
-
uniformOverrides?: Record<string, unknown>;
|
|
545
|
-
flipY: boolean;
|
|
546
|
-
}
|
|
559
|
+
passes: PlannedFullscreenPass[],
|
|
560
|
+
flipY: boolean
|
|
547
561
|
): EffectiveSubPass[] {
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
const isFirstSubPass = index === 0;
|
|
551
|
-
const isLastSubPass = index === subPasses.length - 1;
|
|
552
|
-
const inputs =
|
|
553
|
-
isFirstSubPass && options.firstInputs !== undefined ? options.firstInputs : subPass.inputs;
|
|
554
|
-
const output =
|
|
555
|
-
isLastSubPass && options.lastOutput !== undefined ? options.lastOutput : subPass.output;
|
|
556
|
-
validateSubPassRouting(options.ownerName, inputs, output, this.renderTargets);
|
|
557
|
-
|
|
562
|
+
return passes.map(({subPass, ...pass}) => {
|
|
563
|
+
validateSubPassRouting(pass.ownerName, pass.inputs, pass.output, this.renderTargets);
|
|
558
564
|
return {
|
|
559
|
-
|
|
560
|
-
shaderPass,
|
|
561
|
-
subPassRenderer: new SubPassRenderer(this.device, shaderPass, subPass, options.flipY),
|
|
562
|
-
inputs,
|
|
563
|
-
output,
|
|
564
|
-
uniforms: mergeUniforms(options.uniformOverrides, subPass.uniforms)
|
|
565
|
+
...pass,
|
|
566
|
+
subPassRenderer: new SubPassRenderer(this.device, pass.shaderPass, subPass, flipY)
|
|
565
567
|
};
|
|
566
568
|
});
|
|
567
569
|
}
|
|
@@ -591,24 +593,19 @@ class PassRenderer {
|
|
|
591
593
|
}
|
|
592
594
|
}
|
|
593
595
|
|
|
594
|
-
/**
|
|
595
|
-
class
|
|
596
|
-
readonly optimization:
|
|
596
|
+
/** @internal Shared executable for a fused fullscreen compute stage. */
|
|
597
|
+
export class FullscreenComputePass {
|
|
598
|
+
readonly optimization: ComputeStage;
|
|
597
599
|
|
|
598
|
-
private readonly renderTargets: Record<string, ManagedRenderTarget>;
|
|
599
|
-
private readonly shaderInputs: ShaderInputs;
|
|
600
600
|
private readonly computation: Computation;
|
|
601
601
|
private readonly parameterBuffer: Buffer;
|
|
602
602
|
|
|
603
603
|
constructor(
|
|
604
604
|
device: Device,
|
|
605
|
-
optimization:
|
|
606
|
-
|
|
607
|
-
shaderInputs: ShaderInputs
|
|
605
|
+
optimization: ComputeStage,
|
|
606
|
+
outputFormats: Record<string, TextureFormat>
|
|
608
607
|
) {
|
|
609
608
|
this.optimization = optimization;
|
|
610
|
-
this.renderTargets = renderTargets;
|
|
611
|
-
this.shaderInputs = shaderInputs;
|
|
612
609
|
this.parameterBuffer = device.createBuffer({
|
|
613
610
|
id: `${optimization.name}-parameters`,
|
|
614
611
|
byteLength: Math.max(Math.ceil(optimization.uniformNames.length / 4) * 16, 16),
|
|
@@ -621,7 +618,7 @@ class CompositeShaderPassComputeRenderer {
|
|
|
621
618
|
group: 0,
|
|
622
619
|
location: outputIndex + 2,
|
|
623
620
|
access: 'write-only',
|
|
624
|
-
format:
|
|
621
|
+
format: outputFormats[targetName]
|
|
625
622
|
})
|
|
626
623
|
);
|
|
627
624
|
try {
|
|
@@ -648,16 +645,13 @@ class CompositeShaderPassComputeRenderer {
|
|
|
648
645
|
}
|
|
649
646
|
}
|
|
650
647
|
|
|
651
|
-
|
|
648
|
+
/** Binds the current graph or renderer resources and records its uniform upload. */
|
|
649
|
+
prepare(
|
|
652
650
|
commandEncoder: CommandEncoder,
|
|
653
|
-
|
|
654
|
-
|
|
651
|
+
source: TextureView,
|
|
652
|
+
outputs: Record<string, TextureView>,
|
|
653
|
+
effectiveUniforms: Record<string, unknown>
|
|
655
654
|
): void {
|
|
656
|
-
const effectiveUniforms = {
|
|
657
|
-
...(this.shaderInputs.getUniformValues()[this.optimization.uniformModule] || {}),
|
|
658
|
-
...this.optimization.uniforms,
|
|
659
|
-
...(runtimeUniforms[this.optimization.uniformModule] || {})
|
|
660
|
-
};
|
|
661
655
|
const uniformValues = new Float32Array(
|
|
662
656
|
Math.max(Math.ceil(this.optimization.uniformNames.length / 4) * 4, 4)
|
|
663
657
|
);
|
|
@@ -665,27 +659,27 @@ class CompositeShaderPassComputeRenderer {
|
|
|
665
659
|
const value = effectiveUniforms[uniformName];
|
|
666
660
|
uniformValues[uniformIndex] = typeof value === 'number' ? value : 0;
|
|
667
661
|
}
|
|
668
|
-
this.parameterBuffer.
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
662
|
+
this.parameterBuffer.device.writeBufferViaCommandEncoder(
|
|
663
|
+
commandEncoder,
|
|
664
|
+
this.parameterBuffer,
|
|
665
|
+
uniformValues
|
|
666
|
+
);
|
|
667
|
+
this.computation.setBindings({
|
|
672
668
|
[this.optimization.uniformBinding]: this.parameterBuffer,
|
|
673
|
-
sourceTexture:
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
bindings[bindingName] = this.renderTargets[targetName].texture.view;
|
|
677
|
-
}
|
|
678
|
-
this.computation.setBindings(bindings);
|
|
669
|
+
sourceTexture: source,
|
|
670
|
+
...outputs
|
|
671
|
+
});
|
|
679
672
|
this.computation.predraw(commandEncoder);
|
|
680
|
-
|
|
681
|
-
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
/** Dispatches against the dimensions of the first declared storage output. */
|
|
676
|
+
dispatch(pass: ComputePass, width: number, height: number): void {
|
|
682
677
|
this.computation.dispatch(
|
|
683
|
-
|
|
684
|
-
Math.ceil(
|
|
685
|
-
Math.ceil(
|
|
678
|
+
pass,
|
|
679
|
+
Math.ceil(width / this.optimization.workgroupSize[0]),
|
|
680
|
+
Math.ceil(height / this.optimization.workgroupSize[1]),
|
|
686
681
|
1
|
|
687
682
|
);
|
|
688
|
-
computePass.end();
|
|
689
683
|
}
|
|
690
684
|
|
|
691
685
|
destroy(): void {
|
|
@@ -694,14 +688,15 @@ class CompositeShaderPassComputeRenderer {
|
|
|
694
688
|
}
|
|
695
689
|
}
|
|
696
690
|
|
|
697
|
-
/**
|
|
698
|
-
class SubPassRenderer {
|
|
691
|
+
/** @internal Shared fullscreen draw executable. */
|
|
692
|
+
export class SubPassRenderer {
|
|
699
693
|
model: ClipSpace;
|
|
700
694
|
shaderPass: ShaderPass;
|
|
701
695
|
subPass: ShaderSubPass;
|
|
702
696
|
flipY: boolean;
|
|
703
697
|
|
|
704
698
|
constructor(device: Device, shaderPass: ShaderPass, subPass: ShaderSubPass, flipY: boolean) {
|
|
699
|
+
initializeShaderModule(shaderPass);
|
|
705
700
|
this.shaderPass = shaderPass;
|
|
706
701
|
this.subPass = subPass;
|
|
707
702
|
this.flipY = flipY;
|
|
@@ -754,9 +749,59 @@ class SubPassRenderer {
|
|
|
754
749
|
}
|
|
755
750
|
}
|
|
756
751
|
|
|
752
|
+
/** @internal Resolves compute selection and fullscreen draw routing for both executors. */
|
|
753
|
+
export function planFullscreenPasses(
|
|
754
|
+
device: Device,
|
|
755
|
+
effect: CompositeShaderPass,
|
|
756
|
+
options: {allowCompute?: boolean; colorFormat?: TextureFormatColor} = {}
|
|
757
|
+
): {compute?: ComputeStage; passes: PlannedFullscreenPass[]} {
|
|
758
|
+
const fallback = effect.initialPasses?.fragment ?? [];
|
|
759
|
+
const compute =
|
|
760
|
+
options.allowCompute !== false &&
|
|
761
|
+
supportsComputeOptimization(device, effect, options.colorFormat)
|
|
762
|
+
? effect.initialPasses
|
|
763
|
+
? effect.initialPasses.compute
|
|
764
|
+
: effect.compute
|
|
765
|
+
: undefined;
|
|
766
|
+
const steps = effect.initialPasses
|
|
767
|
+
? [...(compute ? [] : fallback), ...effect.steps]
|
|
768
|
+
: compute
|
|
769
|
+
? effect.steps.filter(step => !effect.compute!.replacedPasses.includes(step.shaderPass.name))
|
|
770
|
+
: effect.steps;
|
|
771
|
+
return {
|
|
772
|
+
compute,
|
|
773
|
+
passes: steps.flatMap(step => {
|
|
774
|
+
const ownerName = effect.name + '/' + step.shaderPass.name;
|
|
775
|
+
validateShaderPassDoesNotOwnRenderTargets(step.shaderPass, ownerName);
|
|
776
|
+
return planShaderSubpasses(step.shaderPass, ownerName, step);
|
|
777
|
+
})
|
|
778
|
+
};
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
/** Applies step-level routing to the first input and last output of a shader pass. */
|
|
782
|
+
function planShaderSubpasses(
|
|
783
|
+
shaderPass: ShaderPass,
|
|
784
|
+
ownerName: string,
|
|
785
|
+
step?: CompositeShaderPass['steps'][number]
|
|
786
|
+
): PlannedFullscreenPass[] {
|
|
787
|
+
const subPasses = shaderPass.passes ?? [];
|
|
788
|
+
return subPasses.map((subPass, index) => ({
|
|
789
|
+
ownerName,
|
|
790
|
+
shaderPass,
|
|
791
|
+
subPass,
|
|
792
|
+
inputs: (index === 0 ? step?.inputs : undefined) ?? subPass.inputs,
|
|
793
|
+
output: (index === subPasses.length - 1 ? step?.output : undefined) ?? subPass.output,
|
|
794
|
+
uniforms: mergeUniforms(step?.uniforms, subPass.uniforms)
|
|
795
|
+
}));
|
|
796
|
+
}
|
|
797
|
+
|
|
757
798
|
function getExecutableShaderPasses(shaderPasses: ShaderPassLike[]): ShaderPass[] {
|
|
758
799
|
return shaderPasses.flatMap(shaderPass =>
|
|
759
|
-
isCompositeShaderPass(shaderPass)
|
|
800
|
+
isCompositeShaderPass(shaderPass)
|
|
801
|
+
? [...(shaderPass.initialPasses?.fragment ?? []), ...shaderPass.steps].map(
|
|
802
|
+
step => step.shaderPass
|
|
803
|
+
)
|
|
804
|
+
: [shaderPass]
|
|
760
805
|
);
|
|
761
806
|
}
|
|
762
807
|
|
|
@@ -767,9 +812,12 @@ function isCompositeShaderPass(shaderPass: ShaderPassLike): shaderPass is Compos
|
|
|
767
812
|
/** @internal Returns whether a composite pass's optional compute path is valid for this device. */
|
|
768
813
|
export function supportsComputeOptimization(
|
|
769
814
|
device: Device,
|
|
770
|
-
compositeShaderPass: CompositeShaderPass
|
|
815
|
+
compositeShaderPass: CompositeShaderPass,
|
|
816
|
+
colorFormat: TextureFormatColor = device.preferredColorFormat
|
|
771
817
|
): boolean {
|
|
772
|
-
const optimization = compositeShaderPass.
|
|
818
|
+
const optimization = compositeShaderPass.initialPasses
|
|
819
|
+
? compositeShaderPass.initialPasses.compute
|
|
820
|
+
: compositeShaderPass.compute;
|
|
773
821
|
if (!optimization || device.type !== 'webgpu') {
|
|
774
822
|
return false;
|
|
775
823
|
}
|
|
@@ -791,7 +839,7 @@ export function supportsComputeOptimization(
|
|
|
791
839
|
if (!target?.storage) {
|
|
792
840
|
return false;
|
|
793
841
|
}
|
|
794
|
-
const format = target.format ||
|
|
842
|
+
const format = target.format || colorFormat;
|
|
795
843
|
return device.getTextureFormatCapabilities(format).store;
|
|
796
844
|
});
|
|
797
845
|
}
|
|
@@ -1094,9 +1142,10 @@ function getSeedFramebuffer(
|
|
|
1094
1142
|
return swapFramebuffers.current;
|
|
1095
1143
|
}
|
|
1096
1144
|
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1145
|
+
/** @internal Computes the texture coordinate scale for differing source and output aspects. */
|
|
1146
|
+
export function calculateTextureScale(
|
|
1147
|
+
sourceTexture: Pick<Texture, 'width' | 'height'>,
|
|
1148
|
+
outputTexture: Pick<Texture, 'width' | 'height'>
|
|
1100
1149
|
): [scaleX: number, scaleY: number] {
|
|
1101
1150
|
const sourceAspect = sourceTexture.width / sourceTexture.height;
|
|
1102
1151
|
const outputAspect = outputTexture.width / outputTexture.height;
|
|
@@ -12,10 +12,13 @@ import {
|
|
|
12
12
|
} from './scenegraph-bounds';
|
|
13
13
|
import type {ScenegraphBounds} from './scenegraph-bounds';
|
|
14
14
|
import {Model} from '../model/model';
|
|
15
|
+
import type {ScenegraphGPUAnimationResources} from '../animation/scenegraph-gpu-animation';
|
|
15
16
|
|
|
16
17
|
export type ModelNodeProps = ScenegraphNodeProps & {
|
|
17
18
|
model: Model;
|
|
18
19
|
managedResources?: any[];
|
|
20
|
+
/** Optional baked pose storage used by the primitive shader. */
|
|
21
|
+
gpuAnimation?: ScenegraphGPUAnimationResources;
|
|
19
22
|
/** Bounds of one model instance before instance and node transforms. */
|
|
20
23
|
bounds?: ScenegraphBounds;
|
|
21
24
|
/** Optional per-instance transforms used to calculate aggregate local bounds. */
|
|
@@ -24,6 +27,7 @@ export type ModelNodeProps = ScenegraphNodeProps & {
|
|
|
24
27
|
|
|
25
28
|
export class ModelNode extends ScenegraphNode {
|
|
26
29
|
readonly model: Model;
|
|
30
|
+
readonly gpuAnimation?: ScenegraphGPUAnimationResources;
|
|
27
31
|
readonly instanceMatrices: readonly NumericArray[] | null;
|
|
28
32
|
bounds: ScenegraphBounds | null = null;
|
|
29
33
|
managedResources: any[];
|
|
@@ -38,6 +42,7 @@ export class ModelNode extends ScenegraphNode {
|
|
|
38
42
|
|
|
39
43
|
// Create new Model or used supplied Model
|
|
40
44
|
this.model = props.model;
|
|
45
|
+
this.gpuAnimation = props.gpuAnimation;
|
|
41
46
|
this.managedResources = props.managedResources || [];
|
|
42
47
|
this.instanceMatrices = props.instanceMatrices || null;
|
|
43
48
|
this.bounds = props.bounds
|
|
@@ -8,7 +8,12 @@ import {
|
|
|
8
8
|
type Binding,
|
|
9
9
|
type CommandEncoder,
|
|
10
10
|
type Device,
|
|
11
|
+
type Framebuffer,
|
|
11
12
|
type RenderPass,
|
|
13
|
+
type RenderPipeline,
|
|
14
|
+
type RenderPipelineParameters,
|
|
15
|
+
type TextureFormatColor,
|
|
16
|
+
type TextureFormatDepthStencil,
|
|
12
17
|
type ShaderLayout
|
|
13
18
|
} from '@luma.gl/core';
|
|
14
19
|
import {Computation, Model} from '@luma.gl/engine';
|
|
@@ -24,7 +29,6 @@ import {
|
|
|
24
29
|
} from '@luma.gl/graph/gpu-core';
|
|
25
30
|
import type {GPUSplatGraphRendererProps} from './gpu-splat-graph-renderer';
|
|
26
31
|
import {
|
|
27
|
-
GPU_SPLAT_GRAPH_FEATURE_UNIFORM_BYTE_LENGTH,
|
|
28
32
|
GPU_SPLAT_GRAPH_UNIFORM_BYTE_LENGTH,
|
|
29
33
|
GPU_SPLAT_PROJECTED_RECORD_BYTE_LENGTH
|
|
30
34
|
} from './gpu-splat-graph-shaders';
|
|
@@ -48,9 +52,19 @@ import {
|
|
|
48
52
|
|
|
49
53
|
const WORKGROUP_SIZE = 256;
|
|
50
54
|
const MINIMUM_SEMANTIC_SELECTION_CAPACITY = 64;
|
|
55
|
+
/** Paged feature uniforms include a 16-byte aligned RGB scale. */
|
|
56
|
+
const PAGED_FEATURE_UNIFORM_BYTE_LENGTH = 64;
|
|
51
57
|
|
|
52
58
|
/** One intact caller-owned source page and its optional batch-local active-row frontier. */
|
|
53
59
|
export type GPUPagedSplatPage = {
|
|
60
|
+
/** Per-page source-to-clip transform. */
|
|
61
|
+
modelViewProjectionMatrix?: readonly number[];
|
|
62
|
+
/** Camera in the page's source frame. */
|
|
63
|
+
cameraPosition?: readonly [number, number, number];
|
|
64
|
+
/** Per-page alpha multiplier. */
|
|
65
|
+
alphaScale?: number;
|
|
66
|
+
/** Linear RGB tint applied after feature evaluation. */
|
|
67
|
+
colorScale?: readonly [number, number, number];
|
|
54
68
|
/** Stable page identity used to retain source topology and renderer-owned index buffers. */
|
|
55
69
|
id: string;
|
|
56
70
|
/** Original caller-owned prepared source allocation, never rewritten or destroyed here. */
|
|
@@ -229,6 +243,8 @@ export class GPUPagedSplatRenderer {
|
|
|
229
243
|
private readonly pageRevisions = new Map<string, number>();
|
|
230
244
|
private plannedSegments: PlannedSourceSegment[] = [];
|
|
231
245
|
private includeRenderPass = true;
|
|
246
|
+
/** Pipeline variants retained for the current graph model. */
|
|
247
|
+
private readonly hostPipelines = new Map<string, RenderPipeline>();
|
|
232
248
|
private model?: Model;
|
|
233
249
|
private sortedValuesBuffer?: Buffer;
|
|
234
250
|
private semanticSelectionBuffer?: Buffer;
|
|
@@ -497,12 +513,55 @@ export class GPUPagedSplatRenderer {
|
|
|
497
513
|
return this.encodeFrame(commandEncoder, false);
|
|
498
514
|
}
|
|
499
515
|
|
|
500
|
-
/**
|
|
501
|
-
|
|
516
|
+
/**
|
|
517
|
+
* Draws prepared splats into a caller-owned pass without clearing, ending, or submitting it.
|
|
518
|
+
* Pipeline overrides apply only to this draw. Attachment formats and samples come from the pass.
|
|
519
|
+
*/
|
|
520
|
+
draw(renderPass: RenderPass, parameters?: RenderPipelineParameters): void {
|
|
502
521
|
if (this.isDestroyed || !this.hasPresentedContent || !this.model) {
|
|
503
522
|
return;
|
|
504
523
|
}
|
|
505
|
-
|
|
524
|
+
const framebuffer =
|
|
525
|
+
(renderPass as RenderPass & {framebuffer?: Framebuffer}).framebuffer ??
|
|
526
|
+
renderPass.props.framebuffer;
|
|
527
|
+
const colorAttachmentFormats = framebuffer?.colorAttachments.map(attachment =>
|
|
528
|
+
attachment ? (attachment.texture.format as TextureFormatColor) : null
|
|
529
|
+
) ?? [this.device.preferredColorFormat];
|
|
530
|
+
const depthStencilAttachmentFormat = framebuffer?.depthStencilAttachment?.texture.format as
|
|
531
|
+
| TextureFormatDepthStencil
|
|
532
|
+
| undefined;
|
|
533
|
+
const resolvedParameters: RenderPipelineParameters = {
|
|
534
|
+
...this.model.pipeline.props.parameters,
|
|
535
|
+
...parameters,
|
|
536
|
+
sampleCount: framebuffer?.props.samples ?? 1
|
|
537
|
+
};
|
|
538
|
+
if (depthStencilAttachmentFormat) {
|
|
539
|
+
resolvedParameters.depthFormat = depthStencilAttachmentFormat;
|
|
540
|
+
}
|
|
541
|
+
for (const key of Object.keys(resolvedParameters) as (keyof RenderPipelineParameters)[]) {
|
|
542
|
+
if (
|
|
543
|
+
(!depthStencilAttachmentFormat && /^(depth|stencil)/.test(key)) ||
|
|
544
|
+
(resolvedParameters.blend === false && key !== 'blend' && key.startsWith('blend'))
|
|
545
|
+
) {
|
|
546
|
+
delete resolvedParameters[key];
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
const key = JSON.stringify([
|
|
550
|
+
colorAttachmentFormats,
|
|
551
|
+
depthStencilAttachmentFormat,
|
|
552
|
+
resolvedParameters
|
|
553
|
+
]);
|
|
554
|
+
let pipeline = this.hostPipelines.get(key);
|
|
555
|
+
if (!pipeline) {
|
|
556
|
+
pipeline = this.model.pipelineFactory.createRenderPipeline({
|
|
557
|
+
...this.model.pipeline.props,
|
|
558
|
+
colorAttachmentFormats,
|
|
559
|
+
depthStencilAttachmentFormat,
|
|
560
|
+
parameters: resolvedParameters
|
|
561
|
+
});
|
|
562
|
+
this.hostPipelines.set(key, pipeline);
|
|
563
|
+
}
|
|
564
|
+
renderPass.setPipeline(pipeline);
|
|
506
565
|
renderPass.setVertexArray(this.model.vertexArray);
|
|
507
566
|
for (const segment of this.outputSegments) {
|
|
508
567
|
renderPass.setBindings({
|
|
@@ -783,7 +842,7 @@ export class GPUPagedSplatRenderer {
|
|
|
783
842
|
);
|
|
784
843
|
const featureUniformBuffer = this.createUniformBuffer(
|
|
785
844
|
`paged-gaussian-features-${planned.id}`,
|
|
786
|
-
|
|
845
|
+
PAGED_FEATURE_UNIFORM_BYTE_LENGTH
|
|
787
846
|
);
|
|
788
847
|
return {
|
|
789
848
|
...planned,
|
|
@@ -1286,10 +1345,13 @@ fn main() {
|
|
|
1286
1345
|
const uniformData = new ArrayBuffer(GPU_SPLAT_GRAPH_UNIFORM_BYTE_LENGTH);
|
|
1287
1346
|
const floatValues = new Float32Array(uniformData);
|
|
1288
1347
|
const integerValues = new Uint32Array(uniformData);
|
|
1289
|
-
floatValues.set(
|
|
1348
|
+
floatValues.set(
|
|
1349
|
+
segment.page.modelViewProjectionMatrix ?? this.props.modelViewProjectionMatrix,
|
|
1350
|
+
0
|
|
1351
|
+
);
|
|
1290
1352
|
floatValues.set(this.props.viewportSize, 16);
|
|
1291
1353
|
floatValues[18] = this.props.radiusScale;
|
|
1292
|
-
floatValues[19] = this.props.alphaScale;
|
|
1354
|
+
floatValues[19] = this.props.alphaScale * (segment.page.alphaScale ?? 1);
|
|
1293
1355
|
floatValues[20] = this.props.alphaCutoff;
|
|
1294
1356
|
floatValues[21] = this.props.screenSizeCutoffPixels;
|
|
1295
1357
|
floatValues[22] = this.props.gaussianSupportRadius;
|
|
@@ -1309,7 +1371,7 @@ fn main() {
|
|
|
1309
1371
|
integerValues[31] = segment.sourceRowOffset;
|
|
1310
1372
|
segment.uniformBuffer.write(new Uint8Array(uniformData));
|
|
1311
1373
|
|
|
1312
|
-
const featureData = new ArrayBuffer(
|
|
1374
|
+
const featureData = new ArrayBuffer(PAGED_FEATURE_UNIFORM_BYTE_LENGTH);
|
|
1313
1375
|
const featureFloatValues = new Float32Array(featureData);
|
|
1314
1376
|
const featureIntegerValues = new Uint32Array(featureData);
|
|
1315
1377
|
const batch = segment.page.data;
|
|
@@ -1317,7 +1379,7 @@ fn main() {
|
|
|
1317
1379
|
batch.sphericalHarmonics && this.props.sphericalHarmonicsDegree > 0
|
|
1318
1380
|
? Math.min(batch.sphericalHarmonicsDegree, this.props.sphericalHarmonicsDegree)
|
|
1319
1381
|
: 0;
|
|
1320
|
-
featureFloatValues.set(this.props.cameraPosition, 0);
|
|
1382
|
+
featureFloatValues.set(segment.page.cameraPosition ?? this.props.cameraPosition, 0);
|
|
1321
1383
|
featureIntegerValues[3] = degree;
|
|
1322
1384
|
featureIntegerValues[4] = getSplatSphericalHarmonicCoefficientCount(
|
|
1323
1385
|
batch.sphericalHarmonicsDegree
|
|
@@ -1331,6 +1393,7 @@ fn main() {
|
|
|
1331
1393
|
? 1
|
|
1332
1394
|
: 0;
|
|
1333
1395
|
featureIntegerValues[10] = this.props.semanticFilter ? 1 : 0;
|
|
1396
|
+
featureFloatValues.set(segment.page.colorScale ?? [1, 1, 1], 12);
|
|
1334
1397
|
segment.featureUniformBuffer.write(new Uint8Array(featureData));
|
|
1335
1398
|
}
|
|
1336
1399
|
}
|
|
@@ -1501,6 +1564,11 @@ fn main() {
|
|
|
1501
1564
|
this.compiledGraph?.destroy();
|
|
1502
1565
|
this.compiledGraph = undefined;
|
|
1503
1566
|
this.lastEncoding = undefined;
|
|
1567
|
+
if (this.model) {
|
|
1568
|
+
for (const pipeline of this.hostPipelines.values())
|
|
1569
|
+
this.model.pipelineFactory.release(pipeline);
|
|
1570
|
+
}
|
|
1571
|
+
this.hostPipelines.clear();
|
|
1504
1572
|
this.model?.destroy();
|
|
1505
1573
|
this.model = undefined;
|
|
1506
1574
|
for (const buffer of this.ownedBuffers) {
|
|
@@ -113,7 +113,11 @@ export const GPU_PAGED_SPLAT_FEATURE_SHADER = replacePagedShaderSource(
|
|
|
113
113
|
replacePagedShaderSource(
|
|
114
114
|
replacePagedShaderSource(
|
|
115
115
|
replacePagedShaderSource(
|
|
116
|
-
|
|
116
|
+
replacePagedShaderSource(
|
|
117
|
+
GPU_SPLAT_FEATURE_SHADER,
|
|
118
|
+
' semanticFilterActive: u32,\n padding: u32,\n};',
|
|
119
|
+
' semanticFilterActive: u32,\n padding: u32,\n colorScale: vec3<f32>,\n};'
|
|
120
|
+
),
|
|
117
121
|
'const INVALID_FEATURE_DEPTH_KEY: u32 = 65535u;',
|
|
118
122
|
`const INVALID_FEATURE_DEPTH_KEY: u32 = ${GPU_PAGED_SPLAT_INVALID_DEPTH_KEY}u;`
|
|
119
123
|
),
|
|
@@ -164,6 +168,8 @@ export const GPU_PAGED_SPLAT_FEATURE_SHADER = replacePagedShaderSource(
|
|
|
164
168
|
projectedColor.a
|
|
165
169
|
);
|
|
166
170
|
}
|
|
171
|
+
let tintedColor = projectedRecords[projectedRowIndex].color;
|
|
172
|
+
projectedRecords[projectedRowIndex].color = vec4<f32>(tintedColor.rgb * featureUniforms.colorScale, tintedColor.a);
|
|
167
173
|
atomicAdd(&drawCommands[1u], 1u);
|
|
168
174
|
}
|
|
169
175
|
`
|
|
@@ -73,12 +73,22 @@ const CACHE_LIMIT = 3;
|
|
|
73
73
|
|
|
74
74
|
let cache = new LRUCache<FontAtlas>(CACHE_LIMIT);
|
|
75
75
|
|
|
76
|
-
/**
|
|
76
|
+
/** Resets the shared generated atlas cache to the requested capacity. */
|
|
77
77
|
export function setFontAtlasCacheLimit(limit: number): void {
|
|
78
|
+
validateCacheLimit(limit);
|
|
79
|
+
cache = new LRUCache(limit);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** Ensures the shared generated atlas cache can hold at least this many entries. */
|
|
83
|
+
export function ensureFontAtlasCacheCapacity(limit: number): void {
|
|
84
|
+
validateCacheLimit(limit);
|
|
85
|
+
cache.grow(limit);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function validateCacheLimit(limit: number): void {
|
|
78
89
|
if (!Number.isFinite(limit) || limit < CACHE_LIMIT) {
|
|
79
90
|
throw new Error(`Font atlas cache limit must be at least ${CACHE_LIMIT}`);
|
|
80
91
|
}
|
|
81
|
-
cache = new LRUCache(limit);
|
|
82
92
|
}
|
|
83
93
|
|
|
84
94
|
/** Applies stable browser-font defaults without constructing an atlas. */
|