@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
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { Buffer, Texture } from '@luma.gl/core';
|
|
2
|
-
import type { CompositeShaderPass } from '@luma.gl/shaders';
|
|
3
2
|
import type { NumberArray3, NumberArray16 } from '@math.gl/core/types';
|
|
4
3
|
/** Construction options for clustered participating-media integration. */
|
|
5
4
|
export type ClusteredVolumetricLightingCompositeShaderPassOptions = {
|
|
@@ -361,6 +360,475 @@ export declare const clusteredVolumetricComposite: {
|
|
|
361
360
|
}];
|
|
362
361
|
};
|
|
363
362
|
/** Creates clustered participating-media integration, temporal stabilization, and composition. */
|
|
364
|
-
export declare
|
|
363
|
+
export declare const clusteredVolumetricLighting: {
|
|
364
|
+
readonly optionDefaults: Required<ClusteredVolumetricLightingCompositeShaderPassOptions>;
|
|
365
|
+
readonly scaleResources: {
|
|
366
|
+
readonly option: "resolutionScale";
|
|
367
|
+
readonly targets: readonly ["clusteredVolumeRaw", "clusteredVolumeHistory", "clusteredVolumeDepthHistory", "clusteredVolumeScratch", "clusteredVolumeScattering"];
|
|
368
|
+
};
|
|
369
|
+
readonly name: "clusteredVolumetricLightingCompositeShaderPass";
|
|
370
|
+
readonly resources: {
|
|
371
|
+
readonly clusteredVolumeRaw: {
|
|
372
|
+
readonly scale: [1, 1];
|
|
373
|
+
readonly format: "rgba16float";
|
|
374
|
+
};
|
|
375
|
+
readonly clusteredVolumeHistory: {
|
|
376
|
+
readonly scale: [1, 1];
|
|
377
|
+
readonly format: "rgba16float";
|
|
378
|
+
readonly lifetime: "history";
|
|
379
|
+
readonly initialize: {
|
|
380
|
+
readonly clearColor: [0, 0, 0, 1];
|
|
381
|
+
};
|
|
382
|
+
};
|
|
383
|
+
readonly clusteredVolumeDepthHistory: {
|
|
384
|
+
readonly scale: [1, 1];
|
|
385
|
+
readonly format: "rg16float";
|
|
386
|
+
readonly lifetime: "history";
|
|
387
|
+
readonly initialize: {
|
|
388
|
+
readonly clearColor: [0, 0, 0, 1];
|
|
389
|
+
};
|
|
390
|
+
};
|
|
391
|
+
readonly clusteredVolumeScratch: {
|
|
392
|
+
readonly scale: [1, 1];
|
|
393
|
+
readonly format: "rgba16float";
|
|
394
|
+
};
|
|
395
|
+
readonly clusteredVolumeScattering: {
|
|
396
|
+
readonly scale: [1, 1];
|
|
397
|
+
readonly format: "rgba16float";
|
|
398
|
+
};
|
|
399
|
+
};
|
|
400
|
+
readonly passes: [{
|
|
401
|
+
readonly kind: "fullscreen";
|
|
402
|
+
readonly shaderPass: {
|
|
403
|
+
readonly name: "clusteredVolumetricTrace";
|
|
404
|
+
readonly source: "const CLUSTERED_VOLUMETRIC_PI: f32 = 3.141592653589793;\nconst CLUSTERED_VOLUMETRIC_MAX_STEPS: u32 = 20u;\nconst CLUSTERED_VOLUMETRIC_MAX_LIGHTS: u32 = 10u;\nconst CLUSTERED_VOLUMETRIC_MAX_GOD_RAY_STEPS: u32 = 32u;\n\nstruct ClusteredVolumetricTraceUniforms {\n projectionMatrix: mat4x4f,\n inverseProjectionMatrix: mat4x4f,\n inverseViewMatrix: mat4x4f,\n directionalLightDirectionView: vec3f,\n directionalLightColor: vec3f,\n fogColor: vec3f,\n godRayPosition: vec2f,\n density: f32,\n heightFalloff: f32,\n fogHeight: f32,\n anisotropy: f32,\n directionalIntensity: f32,\n pointLightIntensity: f32,\n godRayIntensity: f32,\n godRaySourceRadius: f32,\n godRayDensity: f32,\n godRayDecay: f32,\n godRaySampleCount: f32,\n godRaysOnly: f32,\n maxDistance: f32,\n sampleCount: f32,\n shadowStrength: f32,\n clusterCountX: u32,\n clusterCountY: u32,\n clusterCountZ: u32,\n maxLightsPerCluster: u32,\n pointLightCount: u32,\n clusterNearPlane: f32,\n clusterFarPlane: f32,\n};\n\nstruct ClusteredVolumetricPointLight {\n positionRange: vec4f,\n colorIntensity: vec4f,\n};\n\n@group(0) @binding(auto) var<uniform> clusteredVolumetricTrace:\n ClusteredVolumetricTraceUniforms;\n@group(0) @binding(auto) var depthTexture: texture_depth_2d;\n@group(0) @binding(auto) var depthTextureSampler: sampler;\n@group(0) @binding(auto) var<storage, read> pointLights:\n array<ClusteredVolumetricPointLight>;\n@group(0) @binding(auto) var<storage, read> clusterLightCounts: array<u32>;\n@group(0) @binding(auto) var<storage, read> clusterLightIndices: array<u32>;\n\nfn clusteredVolumetricTrace_reconstructViewPosition(texCoord: vec2f, depth: f32) -> vec3f {\n let clip = vec4f(texCoord.x * 2.0 - 1.0, 1.0 - texCoord.y * 2.0, depth, 1.0);\n let viewPosition = clusteredVolumetricTrace.inverseProjectionMatrix * clip;\n return viewPosition.xyz / max(abs(viewPosition.w), 0.00001);\n}\n\nfn clusteredVolumetricTrace_projectViewPosition(viewPosition: vec3f) -> vec2f {\n let clip = clusteredVolumetricTrace.projectionMatrix * vec4f(viewPosition, 1.0);\n let normalizedDeviceCoordinate = clip.xy / max(clip.w, 0.00001);\n return normalizedDeviceCoordinate * vec2f(0.5, -0.5) + vec2f(0.5);\n}\n\nfn clusteredVolumetricTrace_phase(cosine: f32, anisotropy: f32) -> f32 {\n let squaredAnisotropy = anisotropy * anisotropy;\n let denominator = max(1.0 + squaredAnisotropy - 2.0 * anisotropy * cosine, 0.02);\n return (1.0 - squaredAnisotropy) /\n (4.0 * CLUSTERED_VOLUMETRIC_PI * pow(denominator, 1.5));\n}\n\nfn clusteredVolumetricTrace_clusterIndex(texCoord: vec2f, viewDepth: f32) -> u32 {\n let tileX = min(\n u32(clamp(texCoord.x, 0.0, 0.999999) * f32(clusteredVolumetricTrace.clusterCountX)),\n clusteredVolumetricTrace.clusterCountX - 1u\n );\n let tileY = min(\n u32(clamp(texCoord.y, 0.0, 0.999999) * f32(clusteredVolumetricTrace.clusterCountY)),\n clusteredVolumetricTrace.clusterCountY - 1u\n );\n let normalizedDepth = clamp(\n log(max(viewDepth, clusteredVolumetricTrace.clusterNearPlane) /\n clusteredVolumetricTrace.clusterNearPlane) /\n log(clusteredVolumetricTrace.clusterFarPlane /\n clusteredVolumetricTrace.clusterNearPlane),\n 0.0,\n 0.999999\n );\n let tileZ = min(\n u32(normalizedDepth * f32(clusteredVolumetricTrace.clusterCountZ)),\n clusteredVolumetricTrace.clusterCountZ - 1u\n );\n return tileX + clusteredVolumetricTrace.clusterCountX *\n (tileY + clusteredVolumetricTrace.clusterCountY * tileZ);\n}\n\nfn clusteredVolumetricTrace_directionalVisibility(viewPosition: vec3f) -> f32 {\n let lightDirection = normalize(clusteredVolumetricTrace.directionalLightDirectionView);\n for (var shadowStep: u32 = 1u; shadowStep <= 3u; shadowStep++) {\n let shadowPosition = viewPosition + lightDirection * (0.32 + f32(shadowStep) * 0.95);\n if (shadowPosition.z >= -0.04) {\n return 1.0;\n }\n let shadowCoord = clusteredVolumetricTrace_projectViewPosition(shadowPosition);\n if (any(shadowCoord <= vec2f(0.0)) || any(shadowCoord >= vec2f(1.0))) {\n return 1.0;\n }\n let occluderDepth = textureSampleLevel(depthTexture, depthTextureSampler, shadowCoord, 0);\n if (occluderDepth >= 0.99999) {\n continue;\n }\n let occluderPosition = clusteredVolumetricTrace_reconstructViewPosition(\n shadowCoord,\n occluderDepth\n );\n let depthBehindOccluder = -shadowPosition.z - (-occluderPosition.z);\n if (depthBehindOccluder > 0.06 && depthBehindOccluder < 1.9) {\n return 1.0 - clusteredVolumetricTrace.shadowStrength;\n }\n }\n return 1.0;\n}\n\nfn clusteredVolumetricTrace_godRayVisibility(texCoord: vec2f) -> f32 {\n if (clusteredVolumetricTrace.godRayIntensity <= 0.0001) {\n return 0.0;\n }\n\n let sampleCount = clamp(\n u32(clusteredVolumetricTrace.godRaySampleCount),\n 3u,\n CLUSTERED_VOLUMETRIC_MAX_GOD_RAY_STEPS\n );\n let sampleOffset = (texCoord - clusteredVolumetricTrace.godRayPosition) *\n clusteredVolumetricTrace.godRayDensity / f32(sampleCount);\n var sampleCoord = texCoord;\n var illumination = 0.0;\n var totalWeight = 0.0;\n var illuminationDecay = 1.0;\n\n for (var sampleIndex: u32 = 0u;\n sampleIndex < CLUSTERED_VOLUMETRIC_MAX_GOD_RAY_STEPS;\n sampleIndex++) {\n if (sampleIndex >= sampleCount) {\n break;\n }\n sampleCoord -= sampleOffset;\n if (any(sampleCoord < vec2f(0.0)) || any(sampleCoord > vec2f(1.0))) {\n break;\n }\n let dimensions = textureDimensions(depthTexture);\n let pixel = clamp(vec2i(sampleCoord * vec2f(dimensions)), vec2i(0), vec2i(dimensions) - vec2i(1));\n let occluderDepth = textureLoad(depthTexture, pixel, 0);\n // Perspective depth approaches one on distant opaque geometry. Only cleared\n // depth is open sky; a fixed near-one threshold leaks shafts through buildings.\n let visibility = select(0.0, 1.0, occluderDepth >= 1.0);\n // Integrate a finite emitter rather than treating every open-sky pixel as a sun.\n let sourceOffset = (sampleCoord - clusteredVolumetricTrace.godRayPosition) /\n max(clusteredVolumetricTrace.godRaySourceRadius, 0.001);\n let sourceRadiance = exp(-dot(sourceOffset, sourceOffset));\n illumination += visibility * sourceRadiance * illuminationDecay;\n totalWeight += illuminationDecay;\n illuminationDecay *= clusteredVolumetricTrace.godRayDecay;\n }\n\n let distanceFromSun = distance(texCoord, clusteredVolumetricTrace.godRayPosition);\n return illumination / max(totalWeight, 0.0001) * exp(-distanceFromSun * 1.6);\n}\n\nfn clusteredVolumetricTrace_pointRadiance(\n texCoord: vec2f,\n viewPosition: vec3f,\n viewDirection: vec3f\n) -> vec3f {\n let clusterIndex = clusteredVolumetricTrace_clusterIndex(texCoord, -viewPosition.z);\n let clusterCount = clusterLightCounts[clusterIndex];\n let firstCandidateIndex = clusterIndex * clusteredVolumetricTrace.maxLightsPerCluster;\n let clampedFirstCandidateIndex = min(firstCandidateIndex, arrayLength(&clusterLightIndices));\n let storedCandidateCapacity = min(\n clusteredVolumetricTrace.maxLightsPerCluster,\n arrayLength(&clusterLightIndices) - clampedFirstCandidateIndex\n );\n let candidateCount = min(clusterCount, storedCandidateCapacity);\n let activePointLightCount = min(\n clusteredVolumetricTrace.pointLightCount,\n arrayLength(&pointLights)\n );\n var selectedLightIndices: array<u32, CLUSTERED_VOLUMETRIC_MAX_LIGHTS>;\n var selectedLightScores: array<f32, CLUSTERED_VOLUMETRIC_MAX_LIGHTS>;\n for (var slotIndex: u32 = 0u; slotIndex < CLUSTERED_VOLUMETRIC_MAX_LIGHTS; slotIndex++) {\n selectedLightIndices[slotIndex] = 0xffffffffu;\n selectedLightScores[slotIndex] = 1.0e20;\n }\n var selectedLightCount = 0u;\n var worstSlotIndex = 0u;\n var worstScore = -1.0;\n\n // Score every candidate retained by the cluster builder, including its complete overflow-safe\n // storage capacity, while keeping integration work independent of the global light count.\n for (var candidateIndex: u32 = 0u; candidateIndex < candidateCount; candidateIndex++) {\n let lightIndex = clusterLightIndices[firstCandidateIndex + candidateIndex];\n if (lightIndex >= activePointLightCount) {\n continue;\n }\n let light = pointLights[lightIndex];\n let toLight = light.positionRange.xyz - viewPosition;\n let distanceSquared = dot(toLight, toLight);\n let rangeSquared = light.positionRange.w * light.positionRange.w;\n if (distanceSquared >= rangeSquared || distanceSquared <= 0.0004) {\n continue;\n }\n let lightScore = distanceSquared /\n max(rangeSquared * max(light.colorIntensity.a, 0.05), 0.0001);\n if (selectedLightCount < CLUSTERED_VOLUMETRIC_MAX_LIGHTS) {\n selectedLightIndices[selectedLightCount] = lightIndex;\n selectedLightScores[selectedLightCount] = lightScore;\n if (lightScore > worstScore) {\n worstSlotIndex = selectedLightCount;\n worstScore = lightScore;\n }\n selectedLightCount += 1u;\n continue;\n }\n if (lightScore < worstScore) {\n selectedLightIndices[worstSlotIndex] = lightIndex;\n selectedLightScores[worstSlotIndex] = lightScore;\n worstSlotIndex = 0u;\n worstScore = selectedLightScores[0];\n for (var slotIndex = 1u; slotIndex < CLUSTERED_VOLUMETRIC_MAX_LIGHTS; slotIndex++) {\n if (selectedLightScores[slotIndex] > worstScore) {\n worstSlotIndex = slotIndex;\n worstScore = selectedLightScores[slotIndex];\n }\n }\n }\n }\n\n var radiance = vec3f(0.0);\n for (var slotIndex: u32 = 0u; slotIndex < CLUSTERED_VOLUMETRIC_MAX_LIGHTS; slotIndex++) {\n let lightIndex = selectedLightIndices[slotIndex];\n if (lightIndex >= arrayLength(&pointLights)) {\n continue;\n }\n let light = pointLights[lightIndex];\n let toLight = light.positionRange.xyz - viewPosition;\n let distanceToLight = length(toLight);\n if (distanceToLight >= light.positionRange.w || distanceToLight <= 0.02) {\n continue;\n }\n let lightDirection = toLight / distanceToLight;\n let rangeFade = pow(1.0 - distanceToLight / light.positionRange.w, 2.0);\n let attenuation = rangeFade / (1.0 + distanceToLight * distanceToLight * 0.1);\n let phase = clusteredVolumetricTrace_phase(\n dot(viewDirection, lightDirection),\n clusteredVolumetricTrace.anisotropy * 0.65\n );\n radiance += light.colorIntensity.rgb * light.colorIntensity.a *\n attenuation * phase * clusteredVolumetricTrace.pointLightIntensity;\n }\n return radiance;\n}\n\nfn clusteredVolumetricTrace_sampleColor(\n sourceTexture: texture_2d<f32>,\n sourceTextureSampler: sampler,\n texSize: vec2f,\n texCoord: vec2f\n) -> vec4f {\n if (clusteredVolumetricTrace.density <= 0.0001) {\n return vec4f(0.0, 0.0, 0.0, 1.0);\n }\n let sceneDepth = textureSampleLevel(depthTexture, depthTextureSampler, texCoord, 0);\n let rayOrigin = clusteredVolumetricTrace_reconstructViewPosition(texCoord, 0.0);\n let farPosition = clusteredVolumetricTrace_reconstructViewPosition(texCoord, 0.9999);\n let viewDirection = normalize(farPosition - rayOrigin);\n let scenePosition = clusteredVolumetricTrace_reconstructViewPosition(texCoord, sceneDepth);\n let rayDistance = select(\n min(\n max(dot(scenePosition - rayOrigin, viewDirection), 0.0),\n clusteredVolumetricTrace.maxDistance\n ),\n clusteredVolumetricTrace.maxDistance,\n sceneDepth >= 0.99999\n );\n let stepCount = clamp(u32(clusteredVolumetricTrace.sampleCount), 3u,\n CLUSTERED_VOLUMETRIC_MAX_STEPS);\n let stepDistance = rayDistance / f32(stepCount);\n let pixelCoordinate = floor(texCoord * texSize);\n let rayJitter = fract(sin(dot(pixelCoordinate, vec2f(12.9898, 78.233))) * 43758.5453);\n let directionalPhase = clusteredVolumetricTrace_phase(\n dot(viewDirection, normalize(clusteredVolumetricTrace.directionalLightDirectionView)),\n clusteredVolumetricTrace.anisotropy\n );\n let godRayVisibility = clusteredVolumetricTrace_godRayVisibility(texCoord);\n\n var opticalDepth = 0.0;\n var scattering = vec3f(0.0);\n for (var stepIndex: u32 = 0u; stepIndex < CLUSTERED_VOLUMETRIC_MAX_STEPS; stepIndex++) {\n if (stepIndex >= stepCount) {\n break;\n }\n let travel = (f32(stepIndex) + 0.28 + rayJitter * 0.52) * stepDistance;\n let viewPosition = rayOrigin + viewDirection * travel;\n let worldPosition =\n (clusteredVolumetricTrace.inverseViewMatrix * vec4f(viewPosition, 1.0)).xyz;\n let localDensity = clusteredVolumetricTrace.density * exp(\n -max(worldPosition.y - clusteredVolumetricTrace.fogHeight, 0.0) *\n clusteredVolumetricTrace.heightFalloff\n );\n let extinction = localDensity * stepDistance;\n opticalDepth += extinction;\n let directionalVisibility = clusteredVolumetricTrace_directionalVisibility(viewPosition);\n let directionalRadiance = clusteredVolumetricTrace.directionalLightColor *\n clusteredVolumetricTrace.directionalIntensity * directionalPhase * directionalVisibility;\n let godRayRadiance = clusteredVolumetricTrace.directionalLightColor *\n clusteredVolumetricTrace.directionalIntensity * directionalPhase * godRayVisibility *\n clusteredVolumetricTrace.godRayIntensity * 2.4;\n let localRadiance = clusteredVolumetricTrace_pointRadiance(\n texCoord,\n viewPosition,\n viewDirection\n );\n let incomingRadiance = select(\n clusteredVolumetricTrace.fogColor * 0.11 + directionalRadiance + localRadiance +\n godRayRadiance,\n godRayRadiance,\n clusteredVolumetricTrace.godRaysOnly > 0.5\n );\n scattering += incomingRadiance * extinction * exp(-opticalDepth);\n }\n\n return vec4f(scattering, clamp(exp(-opticalDepth), 0.0, 1.0));\n}";
|
|
405
|
+
readonly bindingLayout: readonly [{
|
|
406
|
+
readonly name: "depthTexture";
|
|
407
|
+
readonly group: 0;
|
|
408
|
+
}, {
|
|
409
|
+
readonly name: "pointLights";
|
|
410
|
+
readonly group: 0;
|
|
411
|
+
}, {
|
|
412
|
+
readonly name: "clusterLightCounts";
|
|
413
|
+
readonly group: 0;
|
|
414
|
+
}, {
|
|
415
|
+
readonly name: "clusterLightIndices";
|
|
416
|
+
readonly group: 0;
|
|
417
|
+
}];
|
|
418
|
+
readonly props: Partial<ClusteredVolumetricTraceUniforms> & ClusteredVolumetricTraceBindings;
|
|
419
|
+
readonly uniforms: ClusteredVolumetricTraceUniforms;
|
|
420
|
+
readonly bindings: ClusteredVolumetricTraceBindings;
|
|
421
|
+
readonly uniformTypes: {
|
|
422
|
+
readonly projectionMatrix: "mat4x4<f32>";
|
|
423
|
+
readonly inverseProjectionMatrix: "mat4x4<f32>";
|
|
424
|
+
readonly inverseViewMatrix: "mat4x4<f32>";
|
|
425
|
+
readonly directionalLightDirectionView: "vec3<f32>";
|
|
426
|
+
readonly directionalLightColor: "vec3<f32>";
|
|
427
|
+
readonly fogColor: "vec3<f32>";
|
|
428
|
+
readonly godRayPosition: "vec2<f32>";
|
|
429
|
+
readonly density: "f32";
|
|
430
|
+
readonly heightFalloff: "f32";
|
|
431
|
+
readonly fogHeight: "f32";
|
|
432
|
+
readonly anisotropy: "f32";
|
|
433
|
+
readonly directionalIntensity: "f32";
|
|
434
|
+
readonly pointLightIntensity: "f32";
|
|
435
|
+
readonly godRayIntensity: "f32";
|
|
436
|
+
readonly godRaySourceRadius: "f32";
|
|
437
|
+
readonly godRayDensity: "f32";
|
|
438
|
+
readonly godRayDecay: "f32";
|
|
439
|
+
readonly godRaySampleCount: "f32";
|
|
440
|
+
readonly godRaysOnly: "f32";
|
|
441
|
+
readonly maxDistance: "f32";
|
|
442
|
+
readonly sampleCount: "f32";
|
|
443
|
+
readonly shadowStrength: "f32";
|
|
444
|
+
readonly clusterCountX: "u32";
|
|
445
|
+
readonly clusterCountY: "u32";
|
|
446
|
+
readonly clusterCountZ: "u32";
|
|
447
|
+
readonly maxLightsPerCluster: "u32";
|
|
448
|
+
readonly pointLightCount: "u32";
|
|
449
|
+
readonly clusterNearPlane: "f32";
|
|
450
|
+
readonly clusterFarPlane: "f32";
|
|
451
|
+
};
|
|
452
|
+
readonly propTypes: {
|
|
453
|
+
readonly projectionMatrix: {
|
|
454
|
+
readonly value: NumberArray16;
|
|
455
|
+
readonly private: true;
|
|
456
|
+
};
|
|
457
|
+
readonly inverseProjectionMatrix: {
|
|
458
|
+
readonly value: NumberArray16;
|
|
459
|
+
readonly private: true;
|
|
460
|
+
};
|
|
461
|
+
readonly inverseViewMatrix: {
|
|
462
|
+
readonly value: NumberArray16;
|
|
463
|
+
readonly private: true;
|
|
464
|
+
};
|
|
465
|
+
readonly directionalLightDirectionView: {
|
|
466
|
+
readonly value: readonly [0.35, 0.82, 0.38];
|
|
467
|
+
readonly private: true;
|
|
468
|
+
};
|
|
469
|
+
readonly directionalLightColor: {
|
|
470
|
+
readonly value: readonly [1, 0.85, 0.66];
|
|
471
|
+
readonly private: true;
|
|
472
|
+
};
|
|
473
|
+
readonly fogColor: {
|
|
474
|
+
readonly value: readonly [0.18, 0.3, 0.48];
|
|
475
|
+
};
|
|
476
|
+
readonly godRayPosition: {
|
|
477
|
+
readonly value: readonly [0.72, 0.16];
|
|
478
|
+
};
|
|
479
|
+
readonly density: {
|
|
480
|
+
readonly value: 0.055;
|
|
481
|
+
readonly min: 0;
|
|
482
|
+
readonly softMax: 0.22;
|
|
483
|
+
};
|
|
484
|
+
readonly heightFalloff: {
|
|
485
|
+
readonly value: 0.23;
|
|
486
|
+
readonly min: 0;
|
|
487
|
+
readonly softMax: 2;
|
|
488
|
+
};
|
|
489
|
+
readonly fogHeight: {
|
|
490
|
+
readonly value: 0.2;
|
|
491
|
+
readonly min: -5;
|
|
492
|
+
readonly softMax: 5;
|
|
493
|
+
};
|
|
494
|
+
readonly anisotropy: {
|
|
495
|
+
readonly value: 0.45;
|
|
496
|
+
readonly min: -0.8;
|
|
497
|
+
readonly max: 0.85;
|
|
498
|
+
};
|
|
499
|
+
readonly directionalIntensity: {
|
|
500
|
+
readonly value: 2.2;
|
|
501
|
+
readonly min: 0;
|
|
502
|
+
readonly softMax: 8;
|
|
503
|
+
};
|
|
504
|
+
readonly pointLightIntensity: {
|
|
505
|
+
readonly value: 1.8;
|
|
506
|
+
readonly min: 0;
|
|
507
|
+
readonly softMax: 6;
|
|
508
|
+
};
|
|
509
|
+
readonly godRayIntensity: {
|
|
510
|
+
readonly value: 0;
|
|
511
|
+
readonly min: 0;
|
|
512
|
+
readonly softMax: 6;
|
|
513
|
+
};
|
|
514
|
+
readonly godRaySourceRadius: {
|
|
515
|
+
readonly value: 0.08;
|
|
516
|
+
readonly min: 0.001;
|
|
517
|
+
readonly softMax: 0.3;
|
|
518
|
+
};
|
|
519
|
+
readonly godRayDensity: {
|
|
520
|
+
readonly value: 0.94;
|
|
521
|
+
readonly min: 0.1;
|
|
522
|
+
readonly max: 1.2;
|
|
523
|
+
};
|
|
524
|
+
readonly godRayDecay: {
|
|
525
|
+
readonly value: 0.96;
|
|
526
|
+
readonly min: 0.7;
|
|
527
|
+
readonly max: 1;
|
|
528
|
+
};
|
|
529
|
+
readonly godRaySampleCount: {
|
|
530
|
+
readonly value: 18;
|
|
531
|
+
readonly min: 3;
|
|
532
|
+
readonly max: 32;
|
|
533
|
+
};
|
|
534
|
+
readonly godRaysOnly: {
|
|
535
|
+
readonly value: 0;
|
|
536
|
+
readonly min: 0;
|
|
537
|
+
readonly max: 1;
|
|
538
|
+
readonly private: true;
|
|
539
|
+
};
|
|
540
|
+
readonly maxDistance: {
|
|
541
|
+
readonly value: 28;
|
|
542
|
+
readonly min: 1;
|
|
543
|
+
readonly softMax: 80;
|
|
544
|
+
};
|
|
545
|
+
readonly sampleCount: {
|
|
546
|
+
readonly value: 10;
|
|
547
|
+
readonly min: 3;
|
|
548
|
+
readonly max: 20;
|
|
549
|
+
};
|
|
550
|
+
readonly shadowStrength: {
|
|
551
|
+
readonly value: 0.74;
|
|
552
|
+
readonly min: 0;
|
|
553
|
+
readonly max: 1;
|
|
554
|
+
};
|
|
555
|
+
readonly clusterCountX: {
|
|
556
|
+
readonly value: 1;
|
|
557
|
+
readonly private: true;
|
|
558
|
+
};
|
|
559
|
+
readonly clusterCountY: {
|
|
560
|
+
readonly value: 1;
|
|
561
|
+
readonly private: true;
|
|
562
|
+
};
|
|
563
|
+
readonly clusterCountZ: {
|
|
564
|
+
readonly value: 1;
|
|
565
|
+
readonly private: true;
|
|
566
|
+
};
|
|
567
|
+
readonly maxLightsPerCluster: {
|
|
568
|
+
readonly value: 1;
|
|
569
|
+
readonly private: true;
|
|
570
|
+
};
|
|
571
|
+
readonly pointLightCount: {
|
|
572
|
+
readonly value: 0;
|
|
573
|
+
readonly private: true;
|
|
574
|
+
};
|
|
575
|
+
readonly clusterNearPlane: {
|
|
576
|
+
readonly value: 0.1;
|
|
577
|
+
readonly private: true;
|
|
578
|
+
};
|
|
579
|
+
readonly clusterFarPlane: {
|
|
580
|
+
readonly value: 100;
|
|
581
|
+
readonly private: true;
|
|
582
|
+
};
|
|
583
|
+
};
|
|
584
|
+
readonly passes: [{
|
|
585
|
+
readonly sampler: true;
|
|
586
|
+
}];
|
|
587
|
+
};
|
|
588
|
+
readonly inputs: {
|
|
589
|
+
readonly sourceTexture: "previous";
|
|
590
|
+
};
|
|
591
|
+
readonly output: "clusteredVolumeRaw";
|
|
592
|
+
}, {
|
|
593
|
+
readonly kind: "fullscreen";
|
|
594
|
+
readonly shaderPass: {
|
|
595
|
+
readonly name: "clusteredVolumetricTemporal";
|
|
596
|
+
readonly source: "struct ClusteredVolumetricTemporalUniforms {\n inverseProjectionMatrix: mat4x4f,\n inverseViewProjectionMatrix: mat4x4f,\n previousViewProjectionMatrix: mat4x4f,\n historyWeight: f32,\n depthThreshold: f32,\n};\n\n@group(0) @binding(auto) var<uniform> clusteredVolumetricTemporal:\n ClusteredVolumetricTemporalUniforms;\n@group(0) @binding(auto) var historyTexture: texture_2d<f32>;\n@group(0) @binding(auto) var historyTextureSampler: sampler;\n@group(0) @binding(auto) var velocityTexture: texture_2d<f32>;\n@group(0) @binding(auto) var velocityTextureSampler: sampler;\n@group(0) @binding(auto) var depthTexture: texture_depth_2d;\n@group(0) @binding(auto) var depthTextureSampler: sampler;\n@group(0) @binding(auto) var previousDepthTexture: texture_2d<f32>;\n\nfn clusteredVolumetricTemporal_viewDepth(texCoord: vec2f, depth: f32) -> f32 {\n let clip = vec4f(texCoord.x * 2.0 - 1.0, 1.0 - texCoord.y * 2.0, depth, 1.0);\n let viewPosition = clusteredVolumetricTemporal.inverseProjectionMatrix * clip;\n return abs(viewPosition.z / max(abs(viewPosition.w), 0.00001));\n}\n\nfn clusteredVolumetricTemporal_cameraPreviousCoord(texCoord: vec2f, depth: f32) -> vec3f {\n let clip = vec4f(texCoord.x * 2.0 - 1.0, 1.0 - texCoord.y * 2.0, depth, 1.0);\n let worldPosition = clusteredVolumetricTemporal.inverseViewProjectionMatrix * clip;\n let world = worldPosition.xyz / max(abs(worldPosition.w), 0.00001);\n let previousClip = clusteredVolumetricTemporal.previousViewProjectionMatrix * vec4f(world, 1.0);\n let previousNdc = previousClip.xy / max(abs(previousClip.w), 0.00001);\n let previousCoord = previousNdc * vec2f(0.5, -0.5) + vec2f(0.5);\n return vec3f(previousCoord, select(0.0, 1.0, previousClip.w > 0.00001));\n}\n\nfn clusteredVolumetricTemporal_sampleColor(\n sourceTexture: texture_2d<f32>,\n sourceTextureSampler: sampler,\n texSize: vec2f,\n texCoord: vec2f\n) -> vec4f {\n let current = textureSampleLevel(sourceTexture, sourceTextureSampler, texCoord, 0);\n let currentDepth = textureSampleLevel(depthTexture, depthTextureSampler, texCoord, 0);\n let velocity = textureSampleLevel(velocityTexture, velocityTextureSampler, texCoord, 0).xy;\n let cameraReprojection = clusteredVolumetricTemporal_cameraPreviousCoord(texCoord, currentDepth);\n let velocityIsFinite = all(velocity == velocity) && all(abs(velocity) <= vec2f(1.0));\n let useObjectVelocity = currentDepth < 0.99999 && velocityIsFinite;\n let previousCoord = select(cameraReprojection.xy, texCoord - velocity, useObjectVelocity);\n let validCoordinate = all(previousCoord >= vec2f(0.0)) &&\n all(previousCoord <= vec2f(1.0)) &&\n (useObjectVelocity || cameraReprojection.z > 0.5);\n let clampedPreviousCoord = clamp(previousCoord, vec2f(0.0), vec2f(1.0));\n let previousDepthDimensions = textureDimensions(previousDepthTexture);\n let previousDepthCoordinate = min(\n vec2u(clampedPreviousCoord * vec2f(previousDepthDimensions)),\n previousDepthDimensions - vec2u(1u)\n );\n let currentViewDepth = clusteredVolumetricTemporal_viewDepth(texCoord, currentDepth);\n let previousViewDepth = textureLoad(\n previousDepthTexture,\n vec2i(previousDepthCoordinate),\n 0\n ).r;\n let relativeDepthDifference = abs(previousViewDepth - currentViewDepth) /\n max(currentViewDepth, 0.0001);\n let validDepth = previousViewDepth > 0.0 &&\n relativeDepthDifference < clusteredVolumetricTemporal.depthThreshold;\n\n let texel = 1.0 / vec2f(textureDimensions(sourceTexture));\n var minimumScattering = current;\n var maximumScattering = current;\n for (var sampleY: i32 = -1; sampleY <= 1; sampleY++) {\n for (var sampleX: i32 = -1; sampleX <= 1; sampleX++) {\n let sampleCoord = clamp(\n texCoord + vec2f(f32(sampleX), f32(sampleY)) * texel,\n vec2f(0.0),\n vec2f(1.0)\n );\n let sampleScattering = textureSampleLevel(\n sourceTexture,\n sourceTextureSampler,\n sampleCoord,\n 0\n );\n minimumScattering = min(minimumScattering, sampleScattering);\n maximumScattering = max(maximumScattering, sampleScattering);\n }\n }\n\n let history = clamp(\n textureSampleLevel(historyTexture, historyTextureSampler, clampedPreviousCoord, 0),\n minimumScattering,\n maximumScattering\n );\n let weight = select(\n 0.0,\n clusteredVolumetricTemporal.historyWeight,\n validCoordinate && validDepth\n );\n return mix(current, history, weight);\n}";
|
|
597
|
+
readonly bindingLayout: readonly [{
|
|
598
|
+
readonly name: "historyTexture";
|
|
599
|
+
readonly group: 0;
|
|
600
|
+
}, {
|
|
601
|
+
readonly name: "velocityTexture";
|
|
602
|
+
readonly group: 0;
|
|
603
|
+
}, {
|
|
604
|
+
readonly name: "depthTexture";
|
|
605
|
+
readonly group: 0;
|
|
606
|
+
}, {
|
|
607
|
+
readonly name: "previousDepthTexture";
|
|
608
|
+
readonly group: 0;
|
|
609
|
+
}];
|
|
610
|
+
readonly props: Partial<ClusteredVolumetricTemporalUniforms> & ClusteredVolumetricTemporalBindings;
|
|
611
|
+
readonly uniforms: ClusteredVolumetricTemporalUniforms;
|
|
612
|
+
readonly bindings: ClusteredVolumetricTemporalBindings;
|
|
613
|
+
readonly uniformTypes: {
|
|
614
|
+
readonly inverseProjectionMatrix: "mat4x4<f32>";
|
|
615
|
+
readonly inverseViewProjectionMatrix: "mat4x4<f32>";
|
|
616
|
+
readonly previousViewProjectionMatrix: "mat4x4<f32>";
|
|
617
|
+
readonly historyWeight: "f32";
|
|
618
|
+
readonly depthThreshold: "f32";
|
|
619
|
+
};
|
|
620
|
+
readonly propTypes: {
|
|
621
|
+
readonly inverseProjectionMatrix: {
|
|
622
|
+
readonly value: NumberArray16;
|
|
623
|
+
readonly private: true;
|
|
624
|
+
};
|
|
625
|
+
readonly inverseViewProjectionMatrix: {
|
|
626
|
+
readonly value: NumberArray16;
|
|
627
|
+
readonly private: true;
|
|
628
|
+
};
|
|
629
|
+
readonly previousViewProjectionMatrix: {
|
|
630
|
+
readonly value: NumberArray16;
|
|
631
|
+
readonly private: true;
|
|
632
|
+
};
|
|
633
|
+
readonly historyWeight: {
|
|
634
|
+
readonly value: 0.88;
|
|
635
|
+
readonly min: 0;
|
|
636
|
+
readonly max: 0.97;
|
|
637
|
+
};
|
|
638
|
+
readonly depthThreshold: {
|
|
639
|
+
readonly value: 0.035;
|
|
640
|
+
readonly min: 0.0001;
|
|
641
|
+
readonly softMax: 0.2;
|
|
642
|
+
};
|
|
643
|
+
};
|
|
644
|
+
readonly passes: [{
|
|
645
|
+
readonly sampler: true;
|
|
646
|
+
}];
|
|
647
|
+
};
|
|
648
|
+
readonly inputs: {
|
|
649
|
+
readonly sourceTexture: "clusteredVolumeRaw";
|
|
650
|
+
readonly historyTexture: "clusteredVolumeHistory";
|
|
651
|
+
readonly previousDepthTexture: "clusteredVolumeDepthHistory";
|
|
652
|
+
};
|
|
653
|
+
readonly output: "clusteredVolumeHistory";
|
|
654
|
+
}, {
|
|
655
|
+
readonly kind: "fullscreen";
|
|
656
|
+
readonly shaderPass: {
|
|
657
|
+
readonly name: "clusteredVolumetricDepthHistoryCopy";
|
|
658
|
+
readonly source: "struct ClusteredVolumetricDepthHistoryCopyUniforms {\n inverseProjectionMatrix: mat4x4f,\n};\n\n@group(0) @binding(auto) var<uniform> clusteredVolumetricDepthHistoryCopy:\n ClusteredVolumetricDepthHistoryCopyUniforms;\n@group(0) @binding(auto) var depthTexture: texture_depth_2d;\n@group(0) @binding(auto) var depthTextureSampler: sampler;\n\nfn clusteredVolumetricDepthHistoryCopy_sampleColor(\n sourceTexture: texture_2d<f32>,\n sourceTextureSampler: sampler,\n texSize: vec2f,\n texCoord: vec2f\n) -> vec4f {\n let depth = textureSampleLevel(depthTexture, depthTextureSampler, texCoord, 0);\n let clip = vec4f(texCoord.x * 2.0 - 1.0, 1.0 - texCoord.y * 2.0, depth, 1.0);\n let viewPosition = clusteredVolumetricDepthHistoryCopy.inverseProjectionMatrix * clip;\n let linearDepth = abs(viewPosition.z / max(abs(viewPosition.w), 0.00001));\n return vec4f(linearDepth, 0.0, 0.0, 1.0);\n}";
|
|
659
|
+
readonly bindingLayout: readonly [{
|
|
660
|
+
readonly name: "depthTexture";
|
|
661
|
+
readonly group: 0;
|
|
662
|
+
}];
|
|
663
|
+
readonly props: Partial<ClusteredVolumetricDepthHistoryCopyUniforms>;
|
|
664
|
+
readonly uniforms: ClusteredVolumetricDepthHistoryCopyUniforms;
|
|
665
|
+
readonly uniformTypes: {
|
|
666
|
+
readonly inverseProjectionMatrix: "mat4x4<f32>";
|
|
667
|
+
};
|
|
668
|
+
readonly propTypes: {
|
|
669
|
+
readonly inverseProjectionMatrix: {
|
|
670
|
+
readonly value: NumberArray16;
|
|
671
|
+
readonly private: true;
|
|
672
|
+
};
|
|
673
|
+
};
|
|
674
|
+
readonly passes: [{
|
|
675
|
+
readonly sampler: true;
|
|
676
|
+
}];
|
|
677
|
+
};
|
|
678
|
+
readonly inputs: {
|
|
679
|
+
readonly sourceTexture: "previous";
|
|
680
|
+
};
|
|
681
|
+
readonly output: "clusteredVolumeDepthHistory";
|
|
682
|
+
}, {
|
|
683
|
+
readonly kind: "fullscreen";
|
|
684
|
+
readonly shaderPass: {
|
|
685
|
+
readonly name: "depthAwareBlur";
|
|
686
|
+
readonly source: "struct depthAwareBlurUniforms {\n direction: vec2f,\n radius: f32,\n depthSigma: f32,\n spatialSigma: f32,\n};\n\n@group(0) @binding(auto) var<uniform> depthAwareBlur: depthAwareBlurUniforms;\n@group(0) @binding(auto) var depthTexture: texture_depth_2d;\n@group(0) @binding(auto) var depthTextureSampler: sampler;\n\nfn depthAwareBlur_sampleColor(\n sourceTexture: texture_2d<f32>,\n sourceTextureSampler: sampler,\n texSize: vec2f,\n texCoord: vec2f\n) -> vec4f {\n let sourceDimensions = vec2f(textureDimensions(sourceTexture));\n let texel = depthAwareBlur.direction / sourceDimensions;\n let centerDepth = textureSample(depthTexture, depthTextureSampler, texCoord);\n var color = textureSample(sourceTexture, sourceTextureSampler, texCoord);\n var totalWeight = 1.0;\n for (var index: i32 = 1; index <= 8; index++) {\n if (f32(index) > depthAwareBlur.radius) { break; }\n let offset = texel * f32(index);\n for (var side: i32 = -1; side <= 1; side += 2) {\n let sampleUv = clamp(texCoord + offset * f32(side), vec2f(0.0), vec2f(1.0));\n let sampleDepth = textureSample(depthTexture, depthTextureSampler, sampleUv);\n let spatialWeight = exp(-f32(index * index) / max(2.0 * depthAwareBlur.spatialSigma * depthAwareBlur.spatialSigma, 0.0001));\n let depthDelta = abs(sampleDepth - centerDepth);\n let depthWeight = exp(-(depthDelta * depthDelta) / max(2.0 * depthAwareBlur.depthSigma * depthAwareBlur.depthSigma, 0.000001));\n let weight = spatialWeight * depthWeight;\n color += textureSample(sourceTexture, sourceTextureSampler, sampleUv) * weight;\n totalWeight += weight;\n }\n }\n return color / totalWeight;\n}\n";
|
|
687
|
+
readonly bindingLayout: readonly [{
|
|
688
|
+
readonly name: "depthTexture";
|
|
689
|
+
readonly group: 0;
|
|
690
|
+
}];
|
|
691
|
+
readonly props: import("./depth-aware-blur").DepthAwareBlurProps & {
|
|
692
|
+
depthTexture?: Texture;
|
|
693
|
+
};
|
|
694
|
+
readonly uniforms: Required<import("./depth-aware-blur").DepthAwareBlurProps>;
|
|
695
|
+
readonly bindings: {
|
|
696
|
+
depthTexture?: Texture;
|
|
697
|
+
};
|
|
698
|
+
readonly uniformTypes: {
|
|
699
|
+
readonly direction: "vec2<f32>";
|
|
700
|
+
readonly radius: "f32";
|
|
701
|
+
readonly depthSigma: "f32";
|
|
702
|
+
readonly spatialSigma: "f32";
|
|
703
|
+
};
|
|
704
|
+
readonly propTypes: {
|
|
705
|
+
readonly direction: {
|
|
706
|
+
readonly value: readonly [1, 0];
|
|
707
|
+
};
|
|
708
|
+
readonly radius: {
|
|
709
|
+
readonly value: 4;
|
|
710
|
+
readonly min: 1;
|
|
711
|
+
readonly max: 8;
|
|
712
|
+
};
|
|
713
|
+
readonly depthSigma: {
|
|
714
|
+
readonly value: 0.01;
|
|
715
|
+
readonly min: 0.0001;
|
|
716
|
+
readonly softMax: 0.1;
|
|
717
|
+
};
|
|
718
|
+
readonly spatialSigma: {
|
|
719
|
+
readonly value: 3;
|
|
720
|
+
readonly min: 0.1;
|
|
721
|
+
readonly softMax: 8;
|
|
722
|
+
};
|
|
723
|
+
};
|
|
724
|
+
readonly passes: [{
|
|
725
|
+
readonly sampler: true;
|
|
726
|
+
}];
|
|
727
|
+
};
|
|
728
|
+
readonly inputs: {
|
|
729
|
+
readonly sourceTexture: "clusteredVolumeHistory";
|
|
730
|
+
};
|
|
731
|
+
readonly output: "clusteredVolumeScratch";
|
|
732
|
+
readonly uniforms: {
|
|
733
|
+
readonly direction: [1, 0];
|
|
734
|
+
readonly radius: 3;
|
|
735
|
+
readonly spatialSigma: 2.2;
|
|
736
|
+
readonly depthSigma: 0.018;
|
|
737
|
+
};
|
|
738
|
+
}, {
|
|
739
|
+
readonly kind: "fullscreen";
|
|
740
|
+
readonly shaderPass: {
|
|
741
|
+
readonly name: "depthAwareBlur";
|
|
742
|
+
readonly source: "struct depthAwareBlurUniforms {\n direction: vec2f,\n radius: f32,\n depthSigma: f32,\n spatialSigma: f32,\n};\n\n@group(0) @binding(auto) var<uniform> depthAwareBlur: depthAwareBlurUniforms;\n@group(0) @binding(auto) var depthTexture: texture_depth_2d;\n@group(0) @binding(auto) var depthTextureSampler: sampler;\n\nfn depthAwareBlur_sampleColor(\n sourceTexture: texture_2d<f32>,\n sourceTextureSampler: sampler,\n texSize: vec2f,\n texCoord: vec2f\n) -> vec4f {\n let sourceDimensions = vec2f(textureDimensions(sourceTexture));\n let texel = depthAwareBlur.direction / sourceDimensions;\n let centerDepth = textureSample(depthTexture, depthTextureSampler, texCoord);\n var color = textureSample(sourceTexture, sourceTextureSampler, texCoord);\n var totalWeight = 1.0;\n for (var index: i32 = 1; index <= 8; index++) {\n if (f32(index) > depthAwareBlur.radius) { break; }\n let offset = texel * f32(index);\n for (var side: i32 = -1; side <= 1; side += 2) {\n let sampleUv = clamp(texCoord + offset * f32(side), vec2f(0.0), vec2f(1.0));\n let sampleDepth = textureSample(depthTexture, depthTextureSampler, sampleUv);\n let spatialWeight = exp(-f32(index * index) / max(2.0 * depthAwareBlur.spatialSigma * depthAwareBlur.spatialSigma, 0.0001));\n let depthDelta = abs(sampleDepth - centerDepth);\n let depthWeight = exp(-(depthDelta * depthDelta) / max(2.0 * depthAwareBlur.depthSigma * depthAwareBlur.depthSigma, 0.000001));\n let weight = spatialWeight * depthWeight;\n color += textureSample(sourceTexture, sourceTextureSampler, sampleUv) * weight;\n totalWeight += weight;\n }\n }\n return color / totalWeight;\n}\n";
|
|
743
|
+
readonly bindingLayout: readonly [{
|
|
744
|
+
readonly name: "depthTexture";
|
|
745
|
+
readonly group: 0;
|
|
746
|
+
}];
|
|
747
|
+
readonly props: import("./depth-aware-blur").DepthAwareBlurProps & {
|
|
748
|
+
depthTexture?: Texture;
|
|
749
|
+
};
|
|
750
|
+
readonly uniforms: Required<import("./depth-aware-blur").DepthAwareBlurProps>;
|
|
751
|
+
readonly bindings: {
|
|
752
|
+
depthTexture?: Texture;
|
|
753
|
+
};
|
|
754
|
+
readonly uniformTypes: {
|
|
755
|
+
readonly direction: "vec2<f32>";
|
|
756
|
+
readonly radius: "f32";
|
|
757
|
+
readonly depthSigma: "f32";
|
|
758
|
+
readonly spatialSigma: "f32";
|
|
759
|
+
};
|
|
760
|
+
readonly propTypes: {
|
|
761
|
+
readonly direction: {
|
|
762
|
+
readonly value: readonly [1, 0];
|
|
763
|
+
};
|
|
764
|
+
readonly radius: {
|
|
765
|
+
readonly value: 4;
|
|
766
|
+
readonly min: 1;
|
|
767
|
+
readonly max: 8;
|
|
768
|
+
};
|
|
769
|
+
readonly depthSigma: {
|
|
770
|
+
readonly value: 0.01;
|
|
771
|
+
readonly min: 0.0001;
|
|
772
|
+
readonly softMax: 0.1;
|
|
773
|
+
};
|
|
774
|
+
readonly spatialSigma: {
|
|
775
|
+
readonly value: 3;
|
|
776
|
+
readonly min: 0.1;
|
|
777
|
+
readonly softMax: 8;
|
|
778
|
+
};
|
|
779
|
+
};
|
|
780
|
+
readonly passes: [{
|
|
781
|
+
readonly sampler: true;
|
|
782
|
+
}];
|
|
783
|
+
};
|
|
784
|
+
readonly inputs: {
|
|
785
|
+
readonly sourceTexture: "clusteredVolumeScratch";
|
|
786
|
+
};
|
|
787
|
+
readonly output: "clusteredVolumeScattering";
|
|
788
|
+
readonly uniforms: {
|
|
789
|
+
readonly direction: [0, 1];
|
|
790
|
+
readonly radius: 3;
|
|
791
|
+
readonly spatialSigma: 2.2;
|
|
792
|
+
readonly depthSigma: 0.018;
|
|
793
|
+
};
|
|
794
|
+
}, {
|
|
795
|
+
readonly kind: "fullscreen";
|
|
796
|
+
readonly shaderPass: {
|
|
797
|
+
readonly name: "clusteredVolumetricComposite";
|
|
798
|
+
readonly source: "struct ClusteredVolumetricCompositeUniforms {\n strength: f32,\n debugMode: f32,\n};\n\n@group(0) @binding(auto) var<uniform> clusteredVolumetricComposite:\n ClusteredVolumetricCompositeUniforms;\n@group(0) @binding(auto) var scatteringTexture: texture_2d<f32>;\n@group(0) @binding(auto) var scatteringTextureSampler: sampler;\n\nfn clusteredVolumetricComposite_sampleColor(\n sourceTexture: texture_2d<f32>,\n sourceTextureSampler: sampler,\n texSize: vec2f,\n texCoord: vec2f\n) -> vec4f {\n let source = textureSampleLevel(sourceTexture, sourceTextureSampler, texCoord, 0);\n let scattering = textureSampleLevel(scatteringTexture, scatteringTextureSampler, texCoord, 0);\n if (clusteredVolumetricComposite.debugMode > 1.5) {\n return vec4f(vec3f(clamp(scattering.a, 0.0, 1.0)), 1.0);\n }\n if (clusteredVolumetricComposite.debugMode > 0.5) {\n return vec4f(scattering.rgb * 2.4, 1.0);\n }\n let strength = clamp(clusteredVolumetricComposite.strength, 0.0, 2.0);\n let transmittance = mix(1.0, clamp(scattering.a, 0.0, 1.0), min(strength, 1.0));\n return vec4f(source.rgb * transmittance + scattering.rgb * strength, source.a);\n}";
|
|
799
|
+
readonly bindingLayout: readonly [{
|
|
800
|
+
readonly name: "scatteringTexture";
|
|
801
|
+
readonly group: 0;
|
|
802
|
+
}];
|
|
803
|
+
readonly props: Partial<ClusteredVolumetricCompositeUniforms>;
|
|
804
|
+
readonly uniforms: ClusteredVolumetricCompositeUniforms;
|
|
805
|
+
readonly uniformTypes: {
|
|
806
|
+
readonly strength: "f32";
|
|
807
|
+
readonly debugMode: "f32";
|
|
808
|
+
};
|
|
809
|
+
readonly propTypes: {
|
|
810
|
+
readonly strength: {
|
|
811
|
+
readonly value: 0.9;
|
|
812
|
+
readonly min: 0;
|
|
813
|
+
readonly softMax: 2;
|
|
814
|
+
};
|
|
815
|
+
readonly debugMode: {
|
|
816
|
+
readonly value: 0;
|
|
817
|
+
readonly min: 0;
|
|
818
|
+
readonly max: 2;
|
|
819
|
+
readonly private: true;
|
|
820
|
+
};
|
|
821
|
+
};
|
|
822
|
+
readonly passes: [{
|
|
823
|
+
readonly sampler: true;
|
|
824
|
+
}];
|
|
825
|
+
};
|
|
826
|
+
readonly inputs: {
|
|
827
|
+
readonly sourceTexture: "previous";
|
|
828
|
+
readonly scatteringTexture: "clusteredVolumeScattering";
|
|
829
|
+
};
|
|
830
|
+
readonly output: "previous";
|
|
831
|
+
}];
|
|
832
|
+
};
|
|
365
833
|
export {};
|
|
366
834
|
//# sourceMappingURL=clustered-volumetric-lighting.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clustered-volumetric-lighting.d.ts","sourceRoot":"","sources":["../../../../src/effects/passes/screen-space/clustered-volumetric-lighting.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"clustered-volumetric-lighting.d.ts","sourceRoot":"","sources":["../../../../src/effects/passes/screen-space/clustered-volumetric-lighting.ts"],"names":[],"mappings":"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"}
|