@luma.gl/engine 10.0.0-beta.4 → 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/audio/audio-controller.cjs +6 -2
- package/dist/audio/audio-controller.d.ts.map +1 -1
- package/dist/audio/audio-controller.js +6 -2
- package/dist/audio/audio-controller.js.map +1 -1
- package/dist/audio/audio-graph.cjs +26 -2
- package/dist/audio/audio-graph.d.ts +9 -0
- package/dist/audio/audio-graph.d.ts.map +1 -1
- package/dist/audio/audio-graph.js +35 -10
- package/dist/audio/audio-graph.js.map +1 -1
- package/dist/dist.dev.js +1689 -1094
- 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 +69 -44
- package/dist/effects/passes/screen-space/ssao.d.ts +648 -3
- package/dist/effects/passes/screen-space/ssao.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/ssao.js +67 -42
- 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/experimental-controls.cjs +13 -3
- package/dist/experimental-controls.d.ts +2 -1
- package/dist/experimental-controls.d.ts.map +1 -1
- package/dist/experimental-controls.js +1 -1
- package/dist/experimental-controls.js.map +1 -1
- package/dist/experimental-materials.cjs +37 -3
- package/dist/experimental-materials.d.ts +2 -1
- package/dist/experimental-materials.d.ts.map +1 -1
- package/dist/experimental-materials.js +1 -1
- package/dist/experimental-materials.js.map +1 -1
- package/dist/experimental-textures.cjs +13 -3
- package/dist/experimental-textures.d.ts +2 -1
- package/dist/experimental-textures.d.ts.map +1 -1
- package/dist/experimental-textures.js +1 -1
- package/dist/experimental-textures.js.map +1 -1
- package/dist/experimental-webxr.cjs +17 -3
- package/dist/experimental-webxr.d.ts +2 -1
- package/dist/experimental-webxr.d.ts.map +1 -1
- package/dist/experimental-webxr.js +1 -1
- package/dist/experimental-webxr.js.map +1 -1
- 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/audio/audio-controller.ts +4 -1
- package/src/audio/audio-graph.ts +46 -25
- 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 +79 -46
- 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/experimental-controls.ts +13 -1
- package/src/experimental-materials.ts +37 -1
- package/src/experimental-textures.ts +9 -1
- package/src/experimental-webxr.ts +18 -1
- 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/README.md +1 -1
- package/src/splats/gpu-paged-splat-renderer.ts +77 -9
- package/src/splats/gpu-paged-splat-shaders.ts +7 -1
- package/src/text/fonts/atlas/browser-font-atlas.ts +12 -2
- package/src/text/fonts/atlas/lru-cache.ts +6 -1
- package/src/text/fonts/index.ts +1 -0
|
@@ -0,0 +1,281 @@
|
|
|
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 scenegraph_gpu_animation_exports = {};
|
|
19
|
+
__export(scenegraph_gpu_animation_exports, {
|
|
20
|
+
ScenegraphGPUAnimationResources: () => ScenegraphGPUAnimationResources,
|
|
21
|
+
bakeScenegraphGPUAnimation: () => bakeScenegraphGPUAnimation,
|
|
22
|
+
createScenegraphGPUAnimationStorage: () => createScenegraphGPUAnimationStorage,
|
|
23
|
+
getScenegraphGPUPlaybackClip: () => getScenegraphGPUPlaybackClip
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(scenegraph_gpu_animation_exports);
|
|
26
|
+
var import_core = require("@luma.gl/core");
|
|
27
|
+
var import_matrix = require("@math.gl/core/matrix");
|
|
28
|
+
var import_group_node = require("../scenegraph/group-node.cjs");
|
|
29
|
+
var import_animation_clip = require("./animation-clip.cjs");
|
|
30
|
+
var import_animation_track = require("./animation-track.cjs");
|
|
31
|
+
var import_animation_mixer = require("./animation-mixer.cjs");
|
|
32
|
+
var import_node_animation_binding = require("./node-animation-binding.cjs");
|
|
33
|
+
var import_skin = require("./skin.cjs");
|
|
34
|
+
var import_scenegraph_gpu_animation_layout = require("./scenegraph-gpu-animation-layout.cjs");
|
|
35
|
+
class ScenegraphGPUAnimationResources {
|
|
36
|
+
layout;
|
|
37
|
+
animationJointCount;
|
|
38
|
+
morphTargetCount;
|
|
39
|
+
animationFrames;
|
|
40
|
+
animationFrameValues;
|
|
41
|
+
animationFrameStride;
|
|
42
|
+
animationParameters;
|
|
43
|
+
animationParameterBuffer;
|
|
44
|
+
animationBlend;
|
|
45
|
+
animationBlendBuffer;
|
|
46
|
+
constructor(device, layout, animationJointCount, morphTargetCount, capacity = 1, id = "scenegraph-animation") {
|
|
47
|
+
this.layout = layout;
|
|
48
|
+
this.animationJointCount = animationJointCount;
|
|
49
|
+
this.morphTargetCount = morphTargetCount;
|
|
50
|
+
this.animationFrameStride = (0, import_scenegraph_gpu_animation_layout.getScenegraphGPUAnimationFrameStride)(animationJointCount, morphTargetCount);
|
|
51
|
+
this.animationFrameValues = new Float32Array(layout.frameCount * this.animationFrameStride * 4);
|
|
52
|
+
this.animationParameters = new Float32Array(capacity * 4);
|
|
53
|
+
this.animationBlend = new Float32Array(capacity * 4);
|
|
54
|
+
this.animationFrames = createScenegraphGPUAnimationStorage(device, `${id}-frames`, this.animationFrameValues, this.animationFrameStride, layout.frameCount);
|
|
55
|
+
try {
|
|
56
|
+
this.animationParameterBuffer = device.createBuffer({
|
|
57
|
+
id: `${id}-instanceAnimationFrames`,
|
|
58
|
+
data: this.animationParameters,
|
|
59
|
+
usage: import_core.Buffer.VERTEX | import_core.Buffer.COPY_DST
|
|
60
|
+
});
|
|
61
|
+
try {
|
|
62
|
+
this.animationBlendBuffer = device.createBuffer({
|
|
63
|
+
id: `${id}-instanceAnimationBlend`,
|
|
64
|
+
data: this.animationBlend,
|
|
65
|
+
usage: import_core.Buffer.VERTEX | import_core.Buffer.COPY_DST
|
|
66
|
+
});
|
|
67
|
+
} catch (error) {
|
|
68
|
+
this.animationParameterBuffer.destroy();
|
|
69
|
+
throw error;
|
|
70
|
+
}
|
|
71
|
+
} catch (error) {
|
|
72
|
+
this.animationFrames.destroy();
|
|
73
|
+
throw error;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/** Shader options for the shared GPU animation module. */
|
|
77
|
+
get defines() {
|
|
78
|
+
return {
|
|
79
|
+
HAS_GPU_CROWD_ANIMATION: true,
|
|
80
|
+
CROWD_ANIMATION_FRAME_STRIDE: this.animationFrameStride
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
get bindings() {
|
|
84
|
+
return { gpuAnimationFrames: this.animationFrames };
|
|
85
|
+
}
|
|
86
|
+
/** Vertex attributes consumed by the GPU animation shader module. */
|
|
87
|
+
get attributes() {
|
|
88
|
+
return {
|
|
89
|
+
instanceAnimationFrames: this.animationParameterBuffer,
|
|
90
|
+
instanceAnimationBlend: this.animationBlendBuffer
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
get bufferLayout() {
|
|
94
|
+
return [
|
|
95
|
+
{ name: "instanceAnimationFrames", format: "float32x4", stepMode: "instance" },
|
|
96
|
+
{ name: "instanceAnimationBlend", format: "float32x4", stepMode: "instance" }
|
|
97
|
+
];
|
|
98
|
+
}
|
|
99
|
+
/** Uploads the baked atlas after sampling has finished. */
|
|
100
|
+
upload() {
|
|
101
|
+
if (this.animationFrames instanceof import_core.Buffer) {
|
|
102
|
+
this.animationFrames.write(this.animationFrameValues);
|
|
103
|
+
} else {
|
|
104
|
+
this.animationFrames.writeData(this.animationFrameValues, {
|
|
105
|
+
width: this.animationFrameStride,
|
|
106
|
+
height: this.layout.frameCount
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
destroy() {
|
|
111
|
+
this.animationParameterBuffer.destroy();
|
|
112
|
+
this.animationBlendBuffer.destroy();
|
|
113
|
+
this.animationFrames.destroy();
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
function createScenegraphGPUAnimationStorage(device, id, values, width, height) {
|
|
117
|
+
if (device.type === "webgpu") {
|
|
118
|
+
return device.createBuffer({ id, data: values, usage: import_core.Buffer.STORAGE | import_core.Buffer.COPY_DST });
|
|
119
|
+
}
|
|
120
|
+
const texture = device.createTexture({
|
|
121
|
+
id,
|
|
122
|
+
format: "rgba32float",
|
|
123
|
+
width,
|
|
124
|
+
height,
|
|
125
|
+
usage: import_core.Texture.SAMPLE | import_core.Texture.COPY_DST,
|
|
126
|
+
sampler: { minFilter: "nearest", magFilter: "nearest", mipmapFilter: "nearest" }
|
|
127
|
+
});
|
|
128
|
+
try {
|
|
129
|
+
texture.writeData(values, { width, height });
|
|
130
|
+
return texture;
|
|
131
|
+
} catch (error) {
|
|
132
|
+
texture.destroy();
|
|
133
|
+
throw error;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
function getScenegraphGPUPlaybackClip(clip) {
|
|
137
|
+
return new import_animation_clip.AnimationClip({
|
|
138
|
+
name: clip.name,
|
|
139
|
+
duration: clip.duration,
|
|
140
|
+
tracks: clip.tracks.filter((track) => !track.binding.poseTarget)
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
function bakeScenegraphGPUAnimation({ scenes, clips, layout, targets, skins = [] }) {
|
|
144
|
+
const poseNodes = /* @__PURE__ */ new Map();
|
|
145
|
+
const clone = (source) => {
|
|
146
|
+
const existing = poseNodes.get(source);
|
|
147
|
+
if (existing)
|
|
148
|
+
return existing;
|
|
149
|
+
const pose = new import_group_node.GroupNode({ id: source.id });
|
|
150
|
+
poseNodes.set(source, pose);
|
|
151
|
+
resetPose(source, pose);
|
|
152
|
+
for (const child of source.children) {
|
|
153
|
+
if (child instanceof import_group_node.GroupNode)
|
|
154
|
+
pose.add(clone(child));
|
|
155
|
+
}
|
|
156
|
+
return pose;
|
|
157
|
+
};
|
|
158
|
+
const poseScenes = scenes.map(clone);
|
|
159
|
+
const bindMatrices = collectWorldMatrices(poseScenes);
|
|
160
|
+
const poseTargets = targets.map(({ node, resources: resources2, relativeToBindPose }) => {
|
|
161
|
+
const pose = poseNodes.get(node);
|
|
162
|
+
(0, import_core.assert)(pose && resources2.layout === layout);
|
|
163
|
+
const skin = skins.find((candidate) => candidate.node === node);
|
|
164
|
+
(0, import_core.assert)(!skin || !resources2.animationJointCount || skin.joints.length <= resources2.animationJointCount);
|
|
165
|
+
const joints = skin == null ? void 0 : skin.joints.map(clone);
|
|
166
|
+
return {
|
|
167
|
+
pose,
|
|
168
|
+
resources: resources2,
|
|
169
|
+
inverseBind: relativeToBindPose ? new import_matrix.Matrix4(bindMatrices.get(pose)).invert() : null,
|
|
170
|
+
joints,
|
|
171
|
+
inverseBindMatrices: skin == null ? void 0 : skin.inverseBindMatrices
|
|
172
|
+
};
|
|
173
|
+
});
|
|
174
|
+
try {
|
|
175
|
+
const mixer = new import_animation_mixer.AnimationMixer();
|
|
176
|
+
const bindings = /* @__PURE__ */ new Map();
|
|
177
|
+
for (const clip of layout.clips) {
|
|
178
|
+
mixer.stopAllAction();
|
|
179
|
+
for (const [source, pose] of poseNodes)
|
|
180
|
+
resetPose(source, pose);
|
|
181
|
+
const sourceClip = clips.find((candidate) => candidate.name === clip.name);
|
|
182
|
+
(0, import_core.assert)(sourceClip);
|
|
183
|
+
const tracks = sourceClip.tracks.flatMap((track) => {
|
|
184
|
+
const target = track.binding.poseTarget;
|
|
185
|
+
const pose = target && poseNodes.get(target.node);
|
|
186
|
+
if (!pose || !target)
|
|
187
|
+
return [];
|
|
188
|
+
let binding = bindings.get(track.binding);
|
|
189
|
+
if (!binding) {
|
|
190
|
+
binding = (0, import_node_animation_binding.makeNodeAnimationBinding)(pose, target.property, { id: track.binding.id });
|
|
191
|
+
bindings.set(track.binding, binding);
|
|
192
|
+
}
|
|
193
|
+
return [new import_animation_track.AnimationTrack({ ...track, binding })];
|
|
194
|
+
});
|
|
195
|
+
const action = mixer.clipAction(new import_animation_clip.AnimationClip({
|
|
196
|
+
name: clip.name,
|
|
197
|
+
duration: clip.duration,
|
|
198
|
+
tracks
|
|
199
|
+
})).setLoop("once", 1).play();
|
|
200
|
+
for (let frame = 0; frame < clip.frameCount; frame++) {
|
|
201
|
+
action.setTime(Math.min(frame / layout.sampleRate, clip.duration));
|
|
202
|
+
mixer.update(0);
|
|
203
|
+
const matrices = collectWorldMatrices(poseScenes);
|
|
204
|
+
for (const { pose, resources: resources2, inverseBind, joints, inverseBindMatrices } of poseTargets) {
|
|
205
|
+
const offset = (clip.frameOffset + frame) * resources2.animationFrameStride * 4;
|
|
206
|
+
const values = resources2.animationFrameValues;
|
|
207
|
+
const world = matrices.get(pose);
|
|
208
|
+
values.set(inverseBind ? new import_matrix.Matrix4(inverseBind).multiplyRight(world) : world, offset);
|
|
209
|
+
if (joints && resources2.animationJointCount) {
|
|
210
|
+
(0, import_skin.updateSkinJointMatrices)({
|
|
211
|
+
joints,
|
|
212
|
+
meshNode: pose,
|
|
213
|
+
worldMatrices: matrices,
|
|
214
|
+
inverseBindMatrices,
|
|
215
|
+
target: values.subarray(offset + 16, offset + 16 + joints.length * 16)
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
const weights = pose.userData["morphWeights"];
|
|
219
|
+
const weightOffset = offset + 16 + resources2.animationJointCount * 16;
|
|
220
|
+
for (let index = 0; index < resources2.morphTargetCount; index++) {
|
|
221
|
+
values[weightOffset + index * 4] = (weights == null ? void 0 : weights[index]) ?? 0;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
for (const { resources: resources2 } of targets)
|
|
227
|
+
resources2.upload();
|
|
228
|
+
} finally {
|
|
229
|
+
for (const pose of poseNodes.values())
|
|
230
|
+
pose.destroy();
|
|
231
|
+
}
|
|
232
|
+
const resources = targets.map((target) => target.resources);
|
|
233
|
+
const clipsByName = new Map(layout.clips.map((clip) => [clip.name, clip]));
|
|
234
|
+
return (animator) => updateScenegraphGPUAnimation(animator, layout, clipsByName, resources);
|
|
235
|
+
}
|
|
236
|
+
function updateScenegraphGPUAnimation(animator, layout, clipsByName, resources) {
|
|
237
|
+
const actions = animator.getAnimations().filter((animation) => animation.action.shouldApply && animation.action.weight > 0);
|
|
238
|
+
(0, import_core.assert)(actions.length <= 2);
|
|
239
|
+
const primary = actions.find((animation) => animation.name === animator.activeClip) || actions[0];
|
|
240
|
+
const primaryLayout = primary && clipsByName.get(primary.name) || layout.clips[0];
|
|
241
|
+
const secondary = actions.find((animation) => animation !== primary);
|
|
242
|
+
const secondaryLayout = secondary && clipsByName.get(secondary.name);
|
|
243
|
+
const frames = (0, import_scenegraph_gpu_animation_layout.getScenegraphGPUAnimationFrames)(primaryLayout, (primary == null ? void 0 : primary.action.time) || 0, layout.sampleRate);
|
|
244
|
+
const secondaryFrames = secondaryLayout && secondary ? (0, import_scenegraph_gpu_animation_layout.getScenegraphGPUAnimationFrames)(secondaryLayout, secondary.action.time, layout.sampleRate) : [0, 0, 0];
|
|
245
|
+
const totalWeight = ((primary == null ? void 0 : primary.action.weight) || 0) + ((secondary == null ? void 0 : secondary.action.weight) || 0);
|
|
246
|
+
for (const resource of resources) {
|
|
247
|
+
resource.animationParameters.set([...frames, (primary == null ? void 0 : primary.action.weight) || 1]);
|
|
248
|
+
resource.animationBlend.set([
|
|
249
|
+
...secondaryFrames,
|
|
250
|
+
secondaryLayout && secondary && totalWeight > 0 ? secondary.action.weight / totalWeight : 0
|
|
251
|
+
]);
|
|
252
|
+
resource.animationParameterBuffer.write(resource.animationParameters);
|
|
253
|
+
resource.animationBlendBuffer.write(resource.animationBlend);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
function resetPose(source, target) {
|
|
257
|
+
target.setProps({
|
|
258
|
+
position: Array.from(source.position),
|
|
259
|
+
rotation: Array.from(source.rotation),
|
|
260
|
+
scale: Array.from(source.scale),
|
|
261
|
+
matrix: Array.from(source.matrix)
|
|
262
|
+
});
|
|
263
|
+
target.userData["morphWeights"] = source.userData["morphWeights"];
|
|
264
|
+
}
|
|
265
|
+
function collectWorldMatrices(scenes) {
|
|
266
|
+
const matrices = /* @__PURE__ */ new Map();
|
|
267
|
+
for (const scene of scenes) {
|
|
268
|
+
scene.preorderTraversal((node, { worldMatrix }) => {
|
|
269
|
+
if (node instanceof import_group_node.GroupNode)
|
|
270
|
+
matrices.set(node, worldMatrix);
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
return matrices;
|
|
274
|
+
}
|
|
275
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
276
|
+
0 && (module.exports = {
|
|
277
|
+
ScenegraphGPUAnimationResources,
|
|
278
|
+
bakeScenegraphGPUAnimation,
|
|
279
|
+
createScenegraphGPUAnimationStorage,
|
|
280
|
+
getScenegraphGPUPlaybackClip
|
|
281
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Buffer, type Device, Texture, type BufferLayout } from '@luma.gl/core';
|
|
2
|
+
import { GroupNode } from "../scenegraph/group-node.js";
|
|
3
|
+
import { type SkinBinding } from "../scenegraph/controllers/skin-controller.js";
|
|
4
|
+
import { AnimationClip } from "./animation-clip.js";
|
|
5
|
+
import { type ScenegraphAnimator, type ScenegraphAnimationClip } from "./scenegraph-animator.js";
|
|
6
|
+
import { type ScenegraphGPUAnimationLayout } from "./scenegraph-gpu-animation-layout.js";
|
|
7
|
+
/** Storage and instance attributes for one primitive using the GPU animation shader module. */
|
|
8
|
+
export declare class ScenegraphGPUAnimationResources {
|
|
9
|
+
readonly layout: ScenegraphGPUAnimationLayout;
|
|
10
|
+
readonly animationJointCount: number;
|
|
11
|
+
readonly morphTargetCount: number;
|
|
12
|
+
readonly animationFrames: Buffer | Texture;
|
|
13
|
+
readonly animationFrameValues: Float32Array;
|
|
14
|
+
readonly animationFrameStride: number;
|
|
15
|
+
readonly animationParameters: Float32Array;
|
|
16
|
+
readonly animationParameterBuffer: Buffer;
|
|
17
|
+
readonly animationBlend: Float32Array;
|
|
18
|
+
readonly animationBlendBuffer: Buffer;
|
|
19
|
+
constructor(device: Device, layout: ScenegraphGPUAnimationLayout, animationJointCount: number, morphTargetCount: number, capacity?: number, id?: string);
|
|
20
|
+
/** Shader options for the shared GPU animation module. */
|
|
21
|
+
get defines(): Record<string, boolean | number>;
|
|
22
|
+
get bindings(): {
|
|
23
|
+
gpuAnimationFrames: Buffer | Texture;
|
|
24
|
+
};
|
|
25
|
+
/** Vertex attributes consumed by the GPU animation shader module. */
|
|
26
|
+
get attributes(): Record<string, Buffer>;
|
|
27
|
+
get bufferLayout(): BufferLayout[];
|
|
28
|
+
/** Uploads the baked atlas after sampling has finished. */
|
|
29
|
+
upload(): void;
|
|
30
|
+
destroy(): void;
|
|
31
|
+
}
|
|
32
|
+
/** Stores RGBA float data in the format used by the GPU animation shader on each backend. */
|
|
33
|
+
export declare function createScenegraphGPUAnimationStorage(device: Device, id: string, values: Float32Array, width: number, height: number): Buffer | Texture;
|
|
34
|
+
/** A primitive's source pose and writable atlas. The caller retains resource ownership. */
|
|
35
|
+
export type ScenegraphGPUAnimationTarget = {
|
|
36
|
+
node: GroupNode;
|
|
37
|
+
resources: ScenegraphGPUAnimationResources;
|
|
38
|
+
/** Keep authored model placement and apply only the motion relative to the bind pose. */
|
|
39
|
+
relativeToBindPose?: boolean;
|
|
40
|
+
};
|
|
41
|
+
export type ScenegraphGPUAnimationBakeProps = {
|
|
42
|
+
scenes: readonly GroupNode[];
|
|
43
|
+
clips: readonly AnimationClip[];
|
|
44
|
+
layout: ScenegraphGPUAnimationLayout;
|
|
45
|
+
targets: readonly ScenegraphGPUAnimationTarget[];
|
|
46
|
+
skins?: readonly SkinBinding[];
|
|
47
|
+
};
|
|
48
|
+
/** Keep visibility, interaction, and arbitrary property tracks in the live CPU mixer. */
|
|
49
|
+
export declare function getScenegraphGPUPlaybackClip(clip: AnimationClip): AnimationClip;
|
|
50
|
+
/** Updates GPU frame selection from the caller's existing animator. */
|
|
51
|
+
export type ScenegraphGPUAnimationPlayback = (animator: Pick<ScenegraphAnimator<ScenegraphAnimationClip>, 'activeClip' | 'getAnimations'>) => void;
|
|
52
|
+
/** Bakes resolved pose tracks and returns the GPU frame-selection update. */
|
|
53
|
+
export declare function bakeScenegraphGPUAnimation({ scenes, clips, layout, targets, skins }: ScenegraphGPUAnimationBakeProps): ScenegraphGPUAnimationPlayback;
|
|
54
|
+
//# sourceMappingURL=scenegraph-gpu-animation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scenegraph-gpu-animation.d.ts","sourceRoot":"","sources":["../../src/animation/scenegraph-gpu-animation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAS,MAAM,EAAE,KAAK,MAAM,EAAE,OAAO,EAAE,KAAK,YAAY,EAAC,MAAM,eAAe,CAAC;AAEtF,OAAO,EAAC,SAAS,EAAC,oCAAiC;AACnD,OAAO,EAAC,KAAK,WAAW,EAAC,qDAAkD;AAC3E,OAAO,EAAC,aAAa,EAAC,4BAAyB;AAG/C,OAAO,EAAC,KAAK,kBAAkB,EAAE,KAAK,uBAAuB,EAAC,iCAA8B;AAG5F,OAAO,EAGL,KAAK,4BAA4B,EAClC,6CAA0C;AAE3C,+FAA+F;AAC/F,qBAAa,+BAA+B;IAWxC,QAAQ,CAAC,MAAM,EAAE,4BAA4B;IAC7C,QAAQ,CAAC,mBAAmB,EAAE,MAAM;IACpC,QAAQ,CAAC,gBAAgB,EAAE,MAAM;IAZnC,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3C,QAAQ,CAAC,oBAAoB,EAAE,YAAY,CAAC;IAC5C,QAAQ,CAAC,oB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AC;IACrC,OAAO,EAAE,SAAS,4BAA4B,EAAE,CAAC;IACjD,KAAK,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;CAChC,CAAC;AAEF,yFAAyF;AACzF,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,aAAa,GAAG,aAAa,CAM/E;AAED,uEAAuE;AACvE,MAAM,MAAM,8BAA8B,GAAG,CAC3C,QAAQ,EAAE,IAAI,CAAC,kBAAkB,CAAC,uBAAuB,CAAC,EAAE,YAAY,GAAG,eAAe,CAAC,KACxF,IAAI,CAAC;AAEV,6EAA6E;AAC7E,wBAAgB,0BAA0B,CAAC,EACzC,MAAM,EACN,KAAK,EACL,MAAM,EACN,OAAO,EACP,KAAU,EACX,EAAE,+BAA+B,GAAG,8BAA8B,CAiGlE"}
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
import { assert, Buffer, Texture } from '@luma.gl/core';
|
|
5
|
+
import { Matrix4 } from '@math.gl/core/matrix';
|
|
6
|
+
import { GroupNode } from "../scenegraph/group-node.js";
|
|
7
|
+
import { AnimationClip } from "./animation-clip.js";
|
|
8
|
+
import { AnimationTrack } from "./animation-track.js";
|
|
9
|
+
import { AnimationMixer } from "./animation-mixer.js";
|
|
10
|
+
import { makeNodeAnimationBinding } from "./node-animation-binding.js";
|
|
11
|
+
import { updateSkinJointMatrices } from "./skin.js";
|
|
12
|
+
import { getScenegraphGPUAnimationFrameStride, getScenegraphGPUAnimationFrames } from "./scenegraph-gpu-animation-layout.js";
|
|
13
|
+
/** Storage and instance attributes for one primitive using the GPU animation shader module. */
|
|
14
|
+
export class ScenegraphGPUAnimationResources {
|
|
15
|
+
layout;
|
|
16
|
+
animationJointCount;
|
|
17
|
+
morphTargetCount;
|
|
18
|
+
animationFrames;
|
|
19
|
+
animationFrameValues;
|
|
20
|
+
animationFrameStride;
|
|
21
|
+
animationParameters;
|
|
22
|
+
animationParameterBuffer;
|
|
23
|
+
animationBlend;
|
|
24
|
+
animationBlendBuffer;
|
|
25
|
+
constructor(device, layout, animationJointCount, morphTargetCount, capacity = 1, id = 'scenegraph-animation') {
|
|
26
|
+
this.layout = layout;
|
|
27
|
+
this.animationJointCount = animationJointCount;
|
|
28
|
+
this.morphTargetCount = morphTargetCount;
|
|
29
|
+
this.animationFrameStride = getScenegraphGPUAnimationFrameStride(animationJointCount, morphTargetCount);
|
|
30
|
+
this.animationFrameValues = new Float32Array(layout.frameCount * this.animationFrameStride * 4);
|
|
31
|
+
this.animationParameters = new Float32Array(capacity * 4);
|
|
32
|
+
this.animationBlend = new Float32Array(capacity * 4);
|
|
33
|
+
this.animationFrames = createScenegraphGPUAnimationStorage(device, `${id}-frames`, this.animationFrameValues, this.animationFrameStride, layout.frameCount);
|
|
34
|
+
try {
|
|
35
|
+
this.animationParameterBuffer = device.createBuffer({
|
|
36
|
+
id: `${id}-instanceAnimationFrames`,
|
|
37
|
+
data: this.animationParameters,
|
|
38
|
+
usage: Buffer.VERTEX | Buffer.COPY_DST
|
|
39
|
+
});
|
|
40
|
+
try {
|
|
41
|
+
this.animationBlendBuffer = device.createBuffer({
|
|
42
|
+
id: `${id}-instanceAnimationBlend`,
|
|
43
|
+
data: this.animationBlend,
|
|
44
|
+
usage: Buffer.VERTEX | Buffer.COPY_DST
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
this.animationParameterBuffer.destroy();
|
|
49
|
+
throw error;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
this.animationFrames.destroy();
|
|
54
|
+
throw error;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/** Shader options for the shared GPU animation module. */
|
|
58
|
+
get defines() {
|
|
59
|
+
return {
|
|
60
|
+
HAS_GPU_CROWD_ANIMATION: true,
|
|
61
|
+
CROWD_ANIMATION_FRAME_STRIDE: this.animationFrameStride
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
get bindings() {
|
|
65
|
+
return { gpuAnimationFrames: this.animationFrames };
|
|
66
|
+
}
|
|
67
|
+
/** Vertex attributes consumed by the GPU animation shader module. */
|
|
68
|
+
get attributes() {
|
|
69
|
+
return {
|
|
70
|
+
instanceAnimationFrames: this.animationParameterBuffer,
|
|
71
|
+
instanceAnimationBlend: this.animationBlendBuffer
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
get bufferLayout() {
|
|
75
|
+
return [
|
|
76
|
+
{ name: 'instanceAnimationFrames', format: 'float32x4', stepMode: 'instance' },
|
|
77
|
+
{ name: 'instanceAnimationBlend', format: 'float32x4', stepMode: 'instance' }
|
|
78
|
+
];
|
|
79
|
+
}
|
|
80
|
+
/** Uploads the baked atlas after sampling has finished. */
|
|
81
|
+
upload() {
|
|
82
|
+
if (this.animationFrames instanceof Buffer) {
|
|
83
|
+
this.animationFrames.write(this.animationFrameValues);
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
this.animationFrames.writeData(this.animationFrameValues, {
|
|
87
|
+
width: this.animationFrameStride,
|
|
88
|
+
height: this.layout.frameCount
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
destroy() {
|
|
93
|
+
this.animationParameterBuffer.destroy();
|
|
94
|
+
this.animationBlendBuffer.destroy();
|
|
95
|
+
this.animationFrames.destroy();
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/** Stores RGBA float data in the format used by the GPU animation shader on each backend. */
|
|
99
|
+
export function createScenegraphGPUAnimationStorage(device, id, values, width, height) {
|
|
100
|
+
if (device.type === 'webgpu') {
|
|
101
|
+
return device.createBuffer({ id, data: values, usage: Buffer.STORAGE | Buffer.COPY_DST });
|
|
102
|
+
}
|
|
103
|
+
const texture = device.createTexture({
|
|
104
|
+
id,
|
|
105
|
+
format: 'rgba32float',
|
|
106
|
+
width,
|
|
107
|
+
height,
|
|
108
|
+
usage: Texture.SAMPLE | Texture.COPY_DST,
|
|
109
|
+
sampler: { minFilter: 'nearest', magFilter: 'nearest', mipmapFilter: 'nearest' }
|
|
110
|
+
});
|
|
111
|
+
try {
|
|
112
|
+
texture.writeData(values, { width, height });
|
|
113
|
+
return texture;
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
texture.destroy();
|
|
117
|
+
throw error;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/** Keep visibility, interaction, and arbitrary property tracks in the live CPU mixer. */
|
|
121
|
+
export function getScenegraphGPUPlaybackClip(clip) {
|
|
122
|
+
return new AnimationClip({
|
|
123
|
+
name: clip.name,
|
|
124
|
+
duration: clip.duration,
|
|
125
|
+
tracks: clip.tracks.filter(track => !track.binding.poseTarget)
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
/** Bakes resolved pose tracks and returns the GPU frame-selection update. */
|
|
129
|
+
export function bakeScenegraphGPUAnimation({ scenes, clips, layout, targets, skins = [] }) {
|
|
130
|
+
const poseNodes = new Map();
|
|
131
|
+
const clone = (source) => {
|
|
132
|
+
const existing = poseNodes.get(source);
|
|
133
|
+
if (existing)
|
|
134
|
+
return existing;
|
|
135
|
+
const pose = new GroupNode({ id: source.id });
|
|
136
|
+
poseNodes.set(source, pose);
|
|
137
|
+
resetPose(source, pose);
|
|
138
|
+
for (const child of source.children) {
|
|
139
|
+
if (child instanceof GroupNode)
|
|
140
|
+
pose.add(clone(child));
|
|
141
|
+
}
|
|
142
|
+
return pose;
|
|
143
|
+
};
|
|
144
|
+
const poseScenes = scenes.map(clone);
|
|
145
|
+
const bindMatrices = collectWorldMatrices(poseScenes);
|
|
146
|
+
const poseTargets = targets.map(({ node, resources, relativeToBindPose }) => {
|
|
147
|
+
const pose = poseNodes.get(node);
|
|
148
|
+
// Targets are resolved members of the supplied scene hierarchy.
|
|
149
|
+
assert(pose && resources.layout === layout);
|
|
150
|
+
const skin = skins.find(candidate => candidate.node === node);
|
|
151
|
+
// A primitive cannot use more joints than fit in its allocated atlas.
|
|
152
|
+
assert(!skin || !resources.animationJointCount || skin.joints.length <= resources.animationJointCount);
|
|
153
|
+
const joints = skin?.joints.map(clone);
|
|
154
|
+
return {
|
|
155
|
+
pose,
|
|
156
|
+
resources,
|
|
157
|
+
inverseBind: relativeToBindPose ? new Matrix4(bindMatrices.get(pose)).invert() : null,
|
|
158
|
+
joints,
|
|
159
|
+
inverseBindMatrices: skin?.inverseBindMatrices
|
|
160
|
+
};
|
|
161
|
+
});
|
|
162
|
+
try {
|
|
163
|
+
const mixer = new AnimationMixer();
|
|
164
|
+
const bindings = new Map();
|
|
165
|
+
for (const clip of layout.clips) {
|
|
166
|
+
mixer.stopAllAction();
|
|
167
|
+
for (const [source, pose] of poseNodes)
|
|
168
|
+
resetPose(source, pose);
|
|
169
|
+
const sourceClip = clips.find(candidate => candidate.name === clip.name);
|
|
170
|
+
// The baked layout and the resolved clips must describe the same named animations.
|
|
171
|
+
assert(sourceClip);
|
|
172
|
+
const tracks = sourceClip.tracks.flatMap(track => {
|
|
173
|
+
const target = track.binding.poseTarget;
|
|
174
|
+
const pose = target && poseNodes.get(target.node);
|
|
175
|
+
if (!pose || !target)
|
|
176
|
+
return [];
|
|
177
|
+
let binding = bindings.get(track.binding);
|
|
178
|
+
if (!binding) {
|
|
179
|
+
binding = makeNodeAnimationBinding(pose, target.property, { id: track.binding.id });
|
|
180
|
+
bindings.set(track.binding, binding);
|
|
181
|
+
}
|
|
182
|
+
return [new AnimationTrack({ ...track, binding })];
|
|
183
|
+
});
|
|
184
|
+
const action = mixer
|
|
185
|
+
.clipAction(new AnimationClip({
|
|
186
|
+
name: clip.name,
|
|
187
|
+
duration: clip.duration,
|
|
188
|
+
tracks
|
|
189
|
+
}))
|
|
190
|
+
.setLoop('once', 1)
|
|
191
|
+
.play();
|
|
192
|
+
for (let frame = 0; frame < clip.frameCount; frame++) {
|
|
193
|
+
action.setTime(Math.min(frame / layout.sampleRate, clip.duration));
|
|
194
|
+
mixer.update(0);
|
|
195
|
+
const matrices = collectWorldMatrices(poseScenes);
|
|
196
|
+
for (const { pose, resources, inverseBind, joints, inverseBindMatrices } of poseTargets) {
|
|
197
|
+
const offset = (clip.frameOffset + frame) * resources.animationFrameStride * 4;
|
|
198
|
+
const values = resources.animationFrameValues;
|
|
199
|
+
const world = matrices.get(pose);
|
|
200
|
+
values.set(inverseBind ? new Matrix4(inverseBind).multiplyRight(world) : world, offset);
|
|
201
|
+
if (joints && resources.animationJointCount) {
|
|
202
|
+
updateSkinJointMatrices({
|
|
203
|
+
joints,
|
|
204
|
+
meshNode: pose,
|
|
205
|
+
worldMatrices: matrices,
|
|
206
|
+
inverseBindMatrices,
|
|
207
|
+
target: values.subarray(offset + 16, offset + 16 + joints.length * 16)
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
const weights = pose.userData['morphWeights'];
|
|
211
|
+
const weightOffset = offset + 16 + resources.animationJointCount * 16;
|
|
212
|
+
for (let index = 0; index < resources.morphTargetCount; index++) {
|
|
213
|
+
values[weightOffset + index * 4] = weights?.[index] ?? 0;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
for (const { resources } of targets)
|
|
219
|
+
resources.upload();
|
|
220
|
+
}
|
|
221
|
+
finally {
|
|
222
|
+
for (const pose of poseNodes.values())
|
|
223
|
+
pose.destroy();
|
|
224
|
+
}
|
|
225
|
+
const resources = targets.map(target => target.resources);
|
|
226
|
+
const clipsByName = new Map(layout.clips.map(clip => [clip.name, clip]));
|
|
227
|
+
return animator => updateScenegraphGPUAnimation(animator, layout, clipsByName, resources);
|
|
228
|
+
}
|
|
229
|
+
/** Updates one scene's frame addresses from the existing scenegraph playback clock. */
|
|
230
|
+
function updateScenegraphGPUAnimation(animator, layout, clipsByName, resources) {
|
|
231
|
+
const actions = animator
|
|
232
|
+
.getAnimations()
|
|
233
|
+
.filter(animation => animation.action.shouldApply && animation.action.weight > 0);
|
|
234
|
+
// The shader samples one clip or a crossfade between two clips.
|
|
235
|
+
assert(actions.length <= 2);
|
|
236
|
+
const primary = actions.find(animation => animation.name === animator.activeClip) || actions[0];
|
|
237
|
+
const primaryLayout = (primary && clipsByName.get(primary.name)) || layout.clips[0];
|
|
238
|
+
const secondary = actions.find(animation => animation !== primary);
|
|
239
|
+
const secondaryLayout = secondary && clipsByName.get(secondary.name);
|
|
240
|
+
const frames = getScenegraphGPUAnimationFrames(primaryLayout, primary?.action.time || 0, layout.sampleRate);
|
|
241
|
+
const secondaryFrames = secondaryLayout && secondary
|
|
242
|
+
? getScenegraphGPUAnimationFrames(secondaryLayout, secondary.action.time, layout.sampleRate)
|
|
243
|
+
: [0, 0, 0];
|
|
244
|
+
const totalWeight = (primary?.action.weight || 0) + (secondary?.action.weight || 0);
|
|
245
|
+
for (const resource of resources) {
|
|
246
|
+
resource.animationParameters.set([...frames, primary?.action.weight || 1]);
|
|
247
|
+
resource.animationBlend.set([
|
|
248
|
+
...secondaryFrames,
|
|
249
|
+
secondaryLayout && secondary && totalWeight > 0 ? secondary.action.weight / totalWeight : 0
|
|
250
|
+
]);
|
|
251
|
+
resource.animationParameterBuffer.write(resource.animationParameters);
|
|
252
|
+
resource.animationBlendBuffer.write(resource.animationBlend);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
function resetPose(source, target) {
|
|
256
|
+
target.setProps({
|
|
257
|
+
position: Array.from(source.position),
|
|
258
|
+
rotation: Array.from(source.rotation),
|
|
259
|
+
scale: Array.from(source.scale),
|
|
260
|
+
matrix: Array.from(source.matrix)
|
|
261
|
+
});
|
|
262
|
+
target.userData['morphWeights'] = source.userData['morphWeights'];
|
|
263
|
+
}
|
|
264
|
+
function collectWorldMatrices(scenes) {
|
|
265
|
+
const matrices = new Map();
|
|
266
|
+
for (const scene of scenes) {
|
|
267
|
+
scene.preorderTraversal((node, { worldMatrix }) => {
|
|
268
|
+
if (node instanceof GroupNode)
|
|
269
|
+
matrices.set(node, worldMatrix);
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
return matrices;
|
|
273
|
+
}
|
|
274
|
+
//# sourceMappingURL=scenegraph-gpu-animation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scenegraph-gpu-animation.js","sourceRoot":"","sources":["../../src/animation/scenegraph-gpu-animation.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAE5D,OAAO,EAAC,MAAM,EAAE,MAAM,EAAe,OAAO,EAAoB,MAAM,eAAe,CAAC;AACtF,OAAO,EAAC,OAAO,EAAC,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAC,SAAS,EAAC,oCAAiC;AAEnD,OAAO,EAAC,aAAa,EAAC,4BAAyB;AAC/C,OAAO,EAAC,cAAc,EAAwB,6BAA0B;AACxE,OAAO,EAAC,cAAc,EAAC,6BAA0B;AAEjD,OAAO,EAAC,wBAAwB,EAAC,oCAAiC;AAClE,OAAO,EAAC,uBAAuB,EAAC,kBAAe;AAC/C,OAAO,EACL,oCAAoC,EACpC,+BAA+B,EAEhC,6CAA0C;AAE3C,+FAA+F;AAC/F,MAAM,OAAO,+BAA+B;IAW/B;IACA;IACA;IAZF,eAAe,CAAmB;IAClC,oBAAoB,CAAe;IACnC,oBAAoB,CAAS;IAC7B,mBAAmB,CAAe;IAClC,wBAAwB,CAAS;IACjC,cAAc,CAAe;IAC7B,oBAAoB,CAAS;IAEtC,YACE,MAAc,EACL,MAAoC,EACpC,mBAA2B,EAC3B,gBAAwB,EACjC,QAAQ,GAAG,CAAC,EACZ,EAAE,GAAG,sBAAsB;QAJlB,WAAM,GAAN,MAAM,CAA8B;QACpC,wBAAmB,GAAnB,mBAAmB,CAAQ;QAC3B,qBAAgB,GAAhB,gBAAgB,CAAQ;QAIjC,IAAI,CAAC,oBAAoB,GAAG,oCAAoC,CAC9D,mBAAmB,EACnB,gBAAgB,CACjB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KAAK,CAAC;QAC/B,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;KAClC,CAAC,CAAC;IACH,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;AACpE,CAAC;AAED,SAAS,oBAAoB,CAAC,MAA4B;IACxD,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAsB,CAAC;IAC/C,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,KAAK,CAAC,iBAAiB,CAAC,CAAC,IAAI,EAAE,EAAC,WAAW,EAAC,EAAE,EAAE;YAC9C,IAAI,IAAI,YAAY,SAAS;gBAAE,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QACjE,CAAC,CAAC,CAAC;IACL,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -97,7 +97,7 @@ function resolveArrowPickInfo(pickInfo, source) {
|
|
|
97
97
|
}
|
|
98
98
|
const sourceInfo = getArrowPickingSourceInfo(source, pickInfo.batchIndex);
|
|
99
99
|
return {
|
|
100
|
-
batchIndex: (sourceInfo == null ? void 0 : sourceInfo.sourceBatchIndex) ?? pickInfo.batchIndex,
|
|
100
|
+
batchIndex: sourceInfo === null ? null : (sourceInfo == null ? void 0 : sourceInfo.sourceBatchIndex) ?? pickInfo.batchIndex,
|
|
101
101
|
rowIndex: pickInfo.objectIndex,
|
|
102
102
|
batchRowIndex: getArrowBatchRowIndex(pickInfo.objectIndex, sourceInfo)
|
|
103
103
|
};
|
|
@@ -108,13 +108,14 @@ function getArrowPickingSourceInfo(source, batchIndex) {
|
|
|
108
108
|
return void 0;
|
|
109
109
|
}
|
|
110
110
|
if (Array.isArray(source)) {
|
|
111
|
-
return source[batchIndex]
|
|
111
|
+
return source[batchIndex];
|
|
112
112
|
}
|
|
113
113
|
if ("batches" in source) {
|
|
114
114
|
return (_a = source.batches[batchIndex]) == null ? void 0 : _a.sourceInfo;
|
|
115
115
|
}
|
|
116
116
|
const sourceObject = source;
|
|
117
|
-
|
|
117
|
+
const sourceInfo = (_b = sourceObject.sourceInfos) == null ? void 0 : _b[batchIndex];
|
|
118
|
+
return sourceInfo !== void 0 ? sourceInfo : (_d = (_c = sourceObject.table) == null ? void 0 : _c.batches[batchIndex]) == null ? void 0 : _d.sourceInfo;
|
|
118
119
|
}
|
|
119
120
|
function getArrowBatchRowIndex(rowIndex, sourceInfo) {
|
|
120
121
|
if (!sourceInfo) {
|