@luma.gl/engine 10.0.0-rc.1 → 10.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD-PARTY-NOTICES.md +82 -0
- package/dist/animation/animation-track.d.ts +7 -0
- package/dist/animation/animation-track.d.ts.map +1 -1
- package/dist/animation/animation-track.js.map +1 -1
- package/dist/animation/node-animation-binding.cjs +1 -0
- package/dist/animation/node-animation-binding.d.ts +2 -1
- package/dist/animation/node-animation-binding.d.ts.map +1 -1
- package/dist/animation/node-animation-binding.js +6 -0
- package/dist/animation/node-animation-binding.js.map +1 -1
- package/dist/animation/scenegraph-gpu-animation-layout.cjs +99 -0
- package/dist/animation/scenegraph-gpu-animation-layout.d.ts +69 -0
- package/dist/animation/scenegraph-gpu-animation-layout.d.ts.map +1 -0
- package/dist/animation/scenegraph-gpu-animation-layout.js +90 -0
- package/dist/animation/scenegraph-gpu-animation-layout.js.map +1 -0
- package/dist/animation/scenegraph-gpu-animation.cjs +281 -0
- package/dist/animation/scenegraph-gpu-animation.d.ts +54 -0
- package/dist/animation/scenegraph-gpu-animation.d.ts.map +1 -0
- package/dist/animation/scenegraph-gpu-animation.js +274 -0
- package/dist/animation/scenegraph-gpu-animation.js.map +1 -0
- package/dist/arrow/arrow-picking.cjs +4 -3
- package/dist/arrow/arrow-picking.d.ts +15 -5
- package/dist/arrow/arrow-picking.d.ts.map +1 -1
- package/dist/arrow/arrow-picking.js +16 -5
- package/dist/arrow/arrow-picking.js.map +1 -1
- package/dist/arrow/index.cjs.map +1 -1
- package/dist/dist.dev.js +1671 -1105
- package/dist/dist.min.js +69 -70
- package/dist/effects/glfx-effects.cjs +261 -0
- package/dist/effects/glfx-effects.d.ts +959 -0
- package/dist/effects/glfx-effects.d.ts.map +1 -0
- package/dist/effects/glfx-effects.js +200 -0
- package/dist/effects/glfx-effects.js.map +1 -0
- package/dist/effects/graph/gpu-effect-operation.cjs +402 -0
- package/dist/effects/graph/gpu-effect-operation.d.ts +101 -0
- package/dist/effects/graph/gpu-effect-operation.d.ts.map +1 -0
- package/dist/effects/graph/gpu-effect-operation.js +410 -0
- package/dist/effects/graph/gpu-effect-operation.js.map +1 -0
- package/dist/effects/graph/temporal-graph-history.cjs +48 -0
- package/dist/effects/graph/temporal-graph-history.d.ts +17 -0
- package/dist/effects/graph/temporal-graph-history.d.ts.map +1 -0
- package/dist/effects/graph/temporal-graph-history.js +30 -0
- package/dist/effects/graph/temporal-graph-history.js.map +1 -0
- package/dist/effects/index.cjs +117 -30
- package/dist/effects/index.cjs.map +3 -3
- package/dist/effects/index.d.ts +34 -18
- package/dist/effects/index.d.ts.map +1 -1
- package/dist/effects/index.js +31 -18
- package/dist/effects/index.js.map +1 -1
- package/dist/effects/passes/postprocessing/fxaa/fxaa.cjs +9 -2
- package/dist/effects/passes/postprocessing/fxaa/fxaa.d.ts +19 -0
- package/dist/effects/passes/postprocessing/fxaa/fxaa.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/fxaa/fxaa.js +6 -0
- package/dist/effects/passes/postprocessing/fxaa/fxaa.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/tone-mapping.cjs +9 -2
- package/dist/effects/passes/postprocessing/image-adjust-filters/tone-mapping.d.ts +41 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/tone-mapping.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/tone-mapping.js +6 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/tone-mapping.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-composite-shader-pass.cjs +200 -13
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-composite-shader-pass.d.ts +992 -6
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-composite-shader-pass.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-composite-shader-pass.js +199 -10
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-composite-shader-pass.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-compute-pyramid.d.ts +3 -3
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-compute-pyramid.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-compute-pyramid.js.map +1 -1
- package/dist/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.cjs +41 -40
- package/dist/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.d.ts +116 -8
- package/dist/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.js +38 -37
- package/dist/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.js.map +1 -1
- package/dist/effects/passes/screen-space/clustered-volumetric-lighting.cjs +83 -66
- package/dist/effects/passes/screen-space/clustered-volumetric-lighting.d.ts +470 -2
- package/dist/effects/passes/screen-space/clustered-volumetric-lighting.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/clustered-volumetric-lighting.js +80 -62
- package/dist/effects/passes/screen-space/clustered-volumetric-lighting.js.map +1 -1
- package/dist/effects/passes/screen-space/copy-pass.cjs +7 -0
- package/dist/effects/passes/screen-space/copy-pass.d.ts +1 -0
- package/dist/effects/passes/screen-space/copy-pass.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/copy-pass.js +4 -0
- package/dist/effects/passes/screen-space/copy-pass.js.map +1 -1
- package/dist/effects/passes/screen-space/depth-aware-blur.cjs +14 -5
- package/dist/effects/passes/screen-space/depth-aware-blur.d.ts +125 -17
- package/dist/effects/passes/screen-space/depth-aware-blur.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/depth-aware-blur.js +11 -3
- package/dist/effects/passes/screen-space/depth-aware-blur.js.map +1 -1
- package/dist/effects/passes/screen-space/dof.cjs +19 -3
- package/dist/effects/passes/screen-space/dof.d.ts +181 -0
- package/dist/effects/passes/screen-space/dof.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/dof.js +17 -3
- package/dist/effects/passes/screen-space/dof.js.map +1 -1
- package/dist/effects/passes/screen-space/gtao.cjs +82 -62
- package/dist/effects/passes/screen-space/gtao.d.ts +608 -3
- package/dist/effects/passes/screen-space/gtao.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/gtao.js +83 -60
- package/dist/effects/passes/screen-space/gtao.js.map +1 -1
- package/dist/effects/passes/screen-space/hdr-auto-exposure.cjs +103 -79
- package/dist/effects/passes/screen-space/hdr-auto-exposure.d.ts +225 -3
- package/dist/effects/passes/screen-space/hdr-auto-exposure.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/hdr-auto-exposure.js +102 -77
- package/dist/effects/passes/screen-space/hdr-auto-exposure.js.map +1 -1
- package/dist/effects/passes/screen-space/height-fog.cjs +14 -0
- package/dist/effects/passes/screen-space/height-fog.d.ts +71 -0
- package/dist/effects/passes/screen-space/height-fog.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/height-fog.js +16 -3
- package/dist/effects/passes/screen-space/height-fog.js.map +1 -1
- package/dist/effects/passes/screen-space/motion-blur.cjs +7 -8
- package/dist/effects/passes/screen-space/motion-blur.d.ts +41 -2
- package/dist/effects/passes/screen-space/motion-blur.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/motion-blur.js +6 -6
- package/dist/effects/passes/screen-space/motion-blur.js.map +1 -1
- package/dist/effects/passes/screen-space/outlines.cjs +143 -18
- package/dist/effects/passes/screen-space/outlines.d.ts +162 -3
- package/dist/effects/passes/screen-space/outlines.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/outlines.js +137 -15
- package/dist/effects/passes/screen-space/outlines.js.map +1 -1
- package/dist/effects/passes/screen-space/screen-space-global-illumination.cjs +70 -61
- package/dist/effects/passes/screen-space/screen-space-global-illumination.d.ts +309 -2
- package/dist/effects/passes/screen-space/screen-space-global-illumination.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/screen-space-global-illumination.js +69 -59
- package/dist/effects/passes/screen-space/screen-space-global-illumination.js.map +1 -1
- package/dist/effects/passes/screen-space/screen-space-reflections.cjs +151 -83
- package/dist/effects/passes/screen-space/screen-space-reflections.d.ts +778 -7
- package/dist/effects/passes/screen-space/screen-space-reflections.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/screen-space-reflections.js +148 -79
- package/dist/effects/passes/screen-space/screen-space-reflections.js.map +1 -1
- package/dist/effects/passes/screen-space/selection-outline.cjs +12 -2
- package/dist/effects/passes/screen-space/selection-outline.d.ts +44 -0
- package/dist/effects/passes/screen-space/selection-outline.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/selection-outline.js +9 -0
- package/dist/effects/passes/screen-space/selection-outline.js.map +1 -1
- package/dist/effects/passes/screen-space/ssao.cjs +66 -43
- package/dist/effects/passes/screen-space/ssao.d.ts +647 -2
- package/dist/effects/passes/screen-space/ssao.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/ssao.js +64 -41
- package/dist/effects/passes/screen-space/ssao.js.map +1 -1
- package/dist/effects/passes/screen-space/temporal-antialiasing.cjs +42 -30
- package/dist/effects/passes/screen-space/temporal-antialiasing.d.ts +107 -6
- package/dist/effects/passes/screen-space/temporal-antialiasing.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/temporal-antialiasing.js +40 -27
- package/dist/effects/passes/screen-space/temporal-antialiasing.js.map +1 -1
- package/dist/effects/passes/screen-space/temporal-frame.cjs +34 -0
- package/dist/effects/passes/screen-space/temporal-frame.d.ts +23 -0
- package/dist/effects/passes/screen-space/temporal-frame.d.ts.map +1 -0
- package/dist/effects/passes/screen-space/temporal-frame.js +16 -0
- package/dist/effects/passes/screen-space/temporal-frame.js.map +1 -0
- package/dist/effects/passes/screen-space/volumetric-fog.cjs +25 -22
- package/dist/effects/passes/screen-space/volumetric-fog.d.ts +161 -2
- package/dist/effects/passes/screen-space/volumetric-fog.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/volumetric-fog.js +27 -21
- package/dist/effects/passes/screen-space/volumetric-fog.js.map +1 -1
- package/dist/effects/temporal-upscale/index.cjs +40 -0
- package/dist/effects/temporal-upscale/index.d.ts +5 -0
- package/dist/effects/temporal-upscale/index.d.ts.map +1 -0
- package/dist/effects/temporal-upscale/index.js +6 -0
- package/dist/effects/temporal-upscale/index.js.map +1 -0
- package/dist/effects/temporal-upscale/temporal-math.cjs +202 -0
- package/dist/effects/temporal-upscale/temporal-math.d.ts +101 -0
- package/dist/effects/temporal-upscale/temporal-math.d.ts.map +1 -0
- package/dist/effects/temporal-upscale/temporal-math.js +202 -0
- package/dist/effects/temporal-upscale/temporal-math.js.map +1 -0
- package/dist/effects/temporal-upscale/temporal-upscale-shaders.cjs +353 -0
- package/dist/effects/temporal-upscale/temporal-upscale-shaders.d.ts +7 -0
- package/dist/effects/temporal-upscale/temporal-upscale-shaders.d.ts.map +1 -0
- package/dist/effects/temporal-upscale/temporal-upscale-shaders.js +321 -0
- package/dist/effects/temporal-upscale/temporal-upscale-shaders.js.map +1 -0
- package/dist/effects/temporal-upscale/temporal-upscaler.cjs +392 -0
- package/dist/effects/temporal-upscale/temporal-upscaler.d.ts +143 -0
- package/dist/effects/temporal-upscale/temporal-upscaler.d.ts.map +1 -0
- package/dist/effects/temporal-upscale/temporal-upscaler.js +385 -0
- package/dist/effects/temporal-upscale/temporal-upscaler.js.map +1 -0
- package/dist/gltf/gltf/create-gltf-model.cjs +34 -71
- package/dist/gltf/gltf/create-gltf-model.d.ts +3 -0
- package/dist/gltf/gltf/create-gltf-model.d.ts.map +1 -1
- package/dist/gltf/gltf/create-gltf-model.js +40 -74
- package/dist/gltf/gltf/create-gltf-model.js.map +1 -1
- package/dist/gltf/gltf/create-scenegraph-from-gltf.cjs +46 -4
- package/dist/gltf/gltf/create-scenegraph-from-gltf.d.ts +9 -1
- package/dist/gltf/gltf/create-scenegraph-from-gltf.d.ts.map +1 -1
- package/dist/gltf/gltf/create-scenegraph-from-gltf.js +54 -4
- package/dist/gltf/gltf/create-scenegraph-from-gltf.js.map +1 -1
- package/dist/gltf/gltf/gltf-animated-crowd.cjs +25 -136
- package/dist/gltf/gltf/gltf-animated-crowd.d.ts +4 -8
- package/dist/gltf/gltf/gltf-animated-crowd.d.ts.map +1 -1
- package/dist/gltf/gltf/gltf-animated-crowd.js +27 -139
- package/dist/gltf/gltf/gltf-animated-crowd.js.map +1 -1
- package/dist/gltf/gltf/gltf-animation-nodes.cjs +84 -0
- package/dist/gltf/gltf/gltf-animation-nodes.d.ts +11 -0
- package/dist/gltf/gltf/gltf-animation-nodes.d.ts.map +1 -0
- package/dist/gltf/gltf/gltf-animation-nodes.js +62 -0
- package/dist/gltf/gltf/gltf-animation-nodes.js.map +1 -0
- package/dist/gltf/gltf/gltf-animator.cjs +8 -2
- package/dist/gltf/gltf/gltf-animator.d.ts +6 -1
- package/dist/gltf/gltf/gltf-animator.d.ts.map +1 -1
- package/dist/gltf/gltf/gltf-animator.js +10 -2
- package/dist/gltf/gltf/gltf-animator.js.map +1 -1
- package/dist/gltf/gltf/gltf-gpu-animation-controller.cjs +81 -0
- package/dist/gltf/gltf/gltf-gpu-animation-controller.d.ts +9 -0
- package/dist/gltf/gltf/gltf-gpu-animation-controller.d.ts.map +1 -0
- package/dist/gltf/gltf/gltf-gpu-animation-controller.js +67 -0
- package/dist/gltf/gltf/gltf-gpu-animation-controller.js.map +1 -0
- package/dist/gltf/gltf/gltf-gpu-animation.cjs +33 -28
- package/dist/gltf/gltf/gltf-gpu-animation.d.ts +7 -26
- package/dist/gltf/gltf/gltf-gpu-animation.d.ts.map +1 -1
- package/dist/gltf/gltf/gltf-gpu-animation.js +29 -28
- package/dist/gltf/gltf/gltf-gpu-animation.js.map +1 -1
- package/dist/gltf/index.cjs.map +3 -3
- package/dist/gltf/index.d.ts +2 -2
- package/dist/gltf/index.d.ts.map +1 -1
- package/dist/gltf/index.js.map +1 -1
- package/dist/gltf/parsers/parse-gltf.cjs +4 -2
- package/dist/gltf/parsers/parse-gltf.d.ts +3 -0
- package/dist/gltf/parsers/parse-gltf.d.ts.map +1 -1
- package/dist/gltf/parsers/parse-gltf.js +7 -2
- package/dist/gltf/parsers/parse-gltf.js.map +1 -1
- package/dist/graph/models/index.cjs.map +2 -2
- package/dist/graph/physics/index.cjs +5 -0
- package/dist/graph/physics/index.cjs.map +3 -3
- package/dist/graph/physics/index.d.ts +1 -0
- package/dist/graph/physics/index.d.ts.map +1 -1
- package/dist/graph/physics/index.js +1 -0
- package/dist/graph/physics/index.js.map +1 -1
- package/dist/graph/physics/physics-controller-geometry.cjs +21 -0
- package/dist/graph/physics/physics-controller-geometry.d.ts +8 -1
- package/dist/graph/physics/physics-controller-geometry.d.ts.map +1 -1
- package/dist/graph/physics/physics-controller-geometry.js +22 -0
- package/dist/graph/physics/physics-controller-geometry.js.map +1 -1
- package/dist/graph/physics/scenegraph-session.d.ts +1 -1
- package/dist/graph/physics/scenegraph-session.d.ts.map +1 -1
- package/dist/graph/tables/index.cjs.map +2 -2
- package/dist/index.cjs +16 -0
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/lighting/ambient-occlusion-pass.cjs +47 -28
- package/dist/lighting/ambient-occlusion-pass.d.ts +12 -0
- package/dist/lighting/ambient-occlusion-pass.d.ts.map +1 -1
- package/dist/lighting/ambient-occlusion-pass.js +45 -26
- package/dist/lighting/ambient-occlusion-pass.js.map +1 -1
- package/dist/lighting/clustered-light-grid.cjs +71 -20
- package/dist/lighting/clustered-light-grid.d.ts +37 -0
- package/dist/lighting/clustered-light-grid.d.ts.map +1 -1
- package/dist/lighting/clustered-light-grid.js +68 -18
- package/dist/lighting/clustered-light-grid.js.map +1 -1
- package/dist/lighting/contact-shadow-composite.cjs +72 -51
- package/dist/lighting/contact-shadow-composite.d.ts +274 -3
- package/dist/lighting/contact-shadow-composite.d.ts.map +1 -1
- package/dist/lighting/contact-shadow-composite.js +72 -50
- package/dist/lighting/contact-shadow-composite.js.map +1 -1
- package/dist/lighting/contact-shadow-pass.cjs +50 -39
- package/dist/lighting/contact-shadow-pass.d.ts +8 -0
- package/dist/lighting/contact-shadow-pass.d.ts.map +1 -1
- package/dist/lighting/contact-shadow-pass.js +47 -37
- package/dist/lighting/contact-shadow-pass.js.map +1 -1
- package/dist/lighting/cortao/cortao-occluder-lookup-table.cjs +96 -0
- package/dist/lighting/cortao/cortao-occluder-lookup-table.d.ts +41 -0
- package/dist/lighting/cortao/cortao-occluder-lookup-table.d.ts.map +1 -0
- package/dist/lighting/cortao/cortao-occluder-lookup-table.js +94 -0
- package/dist/lighting/cortao/cortao-occluder-lookup-table.js.map +1 -0
- package/dist/lighting/cortao/cortao-parameters.cjs +127 -0
- package/dist/lighting/cortao/cortao-parameters.d.ts +95 -0
- package/dist/lighting/cortao/cortao-parameters.d.ts.map +1 -0
- package/dist/lighting/cortao/cortao-parameters.js +122 -0
- package/dist/lighting/cortao/cortao-parameters.js.map +1 -0
- package/dist/lighting/cortao/cortao-pass.cjs +100 -0
- package/dist/lighting/cortao/cortao-pass.d.ts +33 -0
- package/dist/lighting/cortao/cortao-pass.d.ts.map +1 -0
- package/dist/lighting/cortao/cortao-pass.js +84 -0
- package/dist/lighting/cortao/cortao-pass.js.map +1 -0
- package/dist/lighting/cortao/cortao-passes.cjs +42 -0
- package/dist/lighting/cortao/cortao-passes.d.ts +38 -0
- package/dist/lighting/cortao/cortao-passes.d.ts.map +1 -0
- package/dist/lighting/cortao/cortao-passes.js +19 -0
- package/dist/lighting/cortao/cortao-passes.js.map +1 -0
- package/dist/lighting/cortao/cortao-shaders-wgsl.cjs +606 -0
- package/dist/lighting/cortao/cortao-shaders-wgsl.d.ts +49 -0
- package/dist/lighting/cortao/cortao-shaders-wgsl.d.ts.map +1 -0
- package/dist/lighting/cortao/cortao-shaders-wgsl.js +610 -0
- package/dist/lighting/cortao/cortao-shaders-wgsl.js.map +1 -0
- package/dist/lighting/cortao/cortao-shaders.cjs +667 -0
- package/dist/lighting/cortao/cortao-shaders.d.ts +118 -0
- package/dist/lighting/cortao/cortao-shaders.d.ts.map +1 -0
- package/dist/lighting/cortao/cortao-shaders.js +657 -0
- package/dist/lighting/cortao/cortao-shaders.js.map +1 -0
- package/dist/lighting/cortao/cortao-upsample.cjs +191 -0
- package/dist/lighting/cortao/cortao-upsample.d.ts +16 -0
- package/dist/lighting/cortao/cortao-upsample.d.ts.map +1 -0
- package/dist/lighting/cortao/cortao-upsample.js +159 -0
- package/dist/lighting/cortao/cortao-upsample.js.map +1 -0
- package/dist/lighting/cortao/cortao-webgl-passes.cjs +229 -0
- package/dist/lighting/cortao/cortao-webgl-passes.d.ts +28 -0
- package/dist/lighting/cortao/cortao-webgl-passes.d.ts.map +1 -0
- package/dist/lighting/cortao/cortao-webgl-passes.js +212 -0
- package/dist/lighting/cortao/cortao-webgl-passes.js.map +1 -0
- package/dist/lighting/cortao/cortao-webgpu-passes.cjs +348 -0
- package/dist/lighting/cortao/cortao-webgpu-passes.d.ts +31 -0
- package/dist/lighting/cortao/cortao-webgpu-passes.d.ts.map +1 -0
- package/dist/lighting/cortao/cortao-webgpu-passes.js +335 -0
- package/dist/lighting/cortao/cortao-webgpu-passes.js.map +1 -0
- package/dist/lighting/index.cjs +13 -2
- package/dist/lighting/index.cjs.map +3 -3
- package/dist/lighting/index.d.ts +11 -6
- package/dist/lighting/index.d.ts.map +1 -1
- package/dist/lighting/index.js +6 -5
- package/dist/lighting/index.js.map +1 -1
- package/dist/lighting/shadow-map-renderer.cjs +40 -37
- package/dist/lighting/shadow-map-renderer.d.ts +15 -0
- package/dist/lighting/shadow-map-renderer.d.ts.map +1 -1
- package/dist/lighting/shadow-map-renderer.js +37 -35
- package/dist/lighting/shadow-map-renderer.js.map +1 -1
- package/dist/model/gpu-vector-model.cjs +39 -16
- package/dist/model/gpu-vector-model.d.ts +8 -0
- package/dist/model/gpu-vector-model.d.ts.map +1 -1
- package/dist/model/gpu-vector-model.js +46 -18
- package/dist/model/gpu-vector-model.js.map +1 -1
- package/dist/passes/effect-renderer.cjs +155 -0
- package/dist/passes/effect-renderer.d.ts +158 -0
- package/dist/passes/effect-renderer.d.ts.map +1 -0
- package/dist/passes/effect-renderer.js +143 -0
- package/dist/passes/effect-renderer.js.map +1 -0
- package/dist/passes/scene-capture-pass.cjs +42 -0
- package/dist/passes/scene-capture-pass.d.ts +29 -0
- package/dist/passes/scene-capture-pass.d.ts.map +1 -0
- package/dist/passes/scene-capture-pass.js +21 -0
- package/dist/passes/scene-capture-pass.js.map +1 -0
- package/dist/passes/shader-pass-renderer.cjs +94 -68
- package/dist/passes/shader-pass-renderer.d.ts +32 -15
- package/dist/passes/shader-pass-renderer.d.ts.map +1 -1
- package/dist/passes/shader-pass-renderer.js +104 -76
- package/dist/passes/shader-pass-renderer.js.map +1 -1
- package/dist/scenegraph/model-node.cjs +2 -0
- package/dist/scenegraph/model-node.d.ts +4 -0
- package/dist/scenegraph/model-node.d.ts.map +1 -1
- package/dist/scenegraph/model-node.js +2 -0
- package/dist/scenegraph/model-node.js.map +1 -1
- package/dist/splats/gpu-paged-splat-renderer.cjs +52 -8
- package/dist/splats/gpu-paged-splat-renderer.d.ts +16 -3
- package/dist/splats/gpu-paged-splat-renderer.d.ts.map +1 -1
- package/dist/splats/gpu-paged-splat-renderer.js +55 -9
- package/dist/splats/gpu-paged-splat-renderer.js.map +1 -1
- package/dist/splats/gpu-paged-splat-shaders.cjs +3 -1
- package/dist/splats/gpu-paged-splat-shaders.d.ts.map +1 -1
- package/dist/splats/gpu-paged-splat-shaders.js +3 -1
- package/dist/splats/gpu-paged-splat-shaders.js.map +1 -1
- package/dist/splats/index.cjs.map +2 -2
- package/dist/text/fonts/atlas/browser-font-atlas.cjs +10 -1
- package/dist/text/fonts/atlas/browser-font-atlas.d.ts +3 -1
- package/dist/text/fonts/atlas/browser-font-atlas.d.ts.map +1 -1
- package/dist/text/fonts/atlas/browser-font-atlas.js +10 -2
- package/dist/text/fonts/atlas/browser-font-atlas.js.map +1 -1
- package/dist/text/fonts/atlas/lru-cache.cjs +4 -0
- package/dist/text/fonts/atlas/lru-cache.d.ts +3 -1
- package/dist/text/fonts/atlas/lru-cache.d.ts.map +1 -1
- package/dist/text/fonts/atlas/lru-cache.js +4 -0
- package/dist/text/fonts/atlas/lru-cache.js.map +1 -1
- package/dist/text/fonts/index.cjs +2 -0
- package/dist/text/fonts/index.cjs.map +1 -1
- package/dist/text/fonts/index.d.ts +1 -1
- package/dist/text/fonts/index.d.ts.map +1 -1
- package/dist/text/fonts/index.js +1 -1
- package/dist/text/fonts/index.js.map +1 -1
- package/dist/text/index.cjs.map +1 -1
- package/package.json +8 -8
- package/src/animation/animation-track.ts +5 -0
- package/src/animation/node-animation-binding.ts +9 -8
- package/src/animation/scenegraph-gpu-animation-layout.ts +195 -0
- package/src/animation/scenegraph-gpu-animation.ts +340 -0
- package/src/arrow/arrow-picking.ts +23 -11
- package/src/effects/README.md +38 -14
- package/src/effects/glfx-effects.ts +227 -0
- package/src/effects/graph/gpu-effect-operation.ts +601 -0
- package/src/effects/graph/temporal-graph-history.ts +46 -0
- package/src/effects/index.ts +81 -19
- package/src/effects/passes/postprocessing/fxaa/fxaa.ts +8 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/tone-mapping.ts +8 -0
- package/src/effects/passes/postprocessing/image-blur-filters/bloom-composite-shader-pass.ts +219 -19
- package/src/effects/passes/postprocessing/image-blur-filters/bloom-compute-pyramid.ts +6 -6
- package/src/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.ts +45 -45
- package/src/effects/passes/screen-space/clustered-volumetric-lighting.ts +88 -68
- package/src/effects/passes/screen-space/copy-pass.ts +4 -0
- package/src/effects/passes/screen-space/depth-aware-blur.ts +13 -3
- package/src/effects/passes/screen-space/dof.ts +20 -3
- package/src/effects/passes/screen-space/gtao.ts +91 -65
- package/src/effects/passes/screen-space/hdr-auto-exposure.ts +109 -84
- package/src/effects/passes/screen-space/height-fog.ts +18 -3
- package/src/effects/passes/screen-space/motion-blur.ts +8 -7
- package/src/effects/passes/screen-space/outlines.ts +143 -17
- package/src/effects/passes/screen-space/screen-space-global-illumination.ts +75 -64
- package/src/effects/passes/screen-space/screen-space-reflections.ts +158 -95
- package/src/effects/passes/screen-space/selection-outline.ts +11 -0
- package/src/effects/passes/screen-space/ssao.ts +76 -45
- package/src/effects/passes/screen-space/temporal-antialiasing.ts +43 -33
- package/src/effects/passes/screen-space/temporal-frame.ts +33 -0
- package/src/effects/passes/screen-space/volumetric-fog.ts +30 -24
- package/src/effects/temporal-upscale/index.ts +20 -0
- package/src/effects/temporal-upscale/temporal-math.ts +308 -0
- package/src/effects/temporal-upscale/temporal-upscale-shaders.ts +326 -0
- package/src/effects/temporal-upscale/temporal-upscaler.ts +538 -0
- package/src/gltf/gltf/create-gltf-model.ts +59 -90
- package/src/gltf/gltf/create-scenegraph-from-gltf.ts +71 -5
- package/src/gltf/gltf/gltf-animated-crowd.ts +30 -177
- package/src/gltf/gltf/gltf-animation-nodes.ts +82 -0
- package/src/gltf/gltf/gltf-animator.ts +15 -4
- package/src/gltf/gltf/gltf-gpu-animation-controller.ts +88 -0
- package/src/gltf/gltf/gltf-gpu-animation.ts +53 -60
- package/src/gltf/index.ts +5 -0
- package/src/gltf/parsers/parse-gltf.ts +12 -2
- package/src/graph/physics/index.ts +4 -0
- package/src/graph/physics/physics-controller-geometry.ts +33 -1
- package/src/index.ts +25 -0
- package/src/lighting/ambient-occlusion-pass.ts +62 -28
- package/src/lighting/clustered-light-grid.ts +87 -30
- package/src/lighting/contact-shadow-composite.ts +80 -52
- package/src/lighting/contact-shadow-pass.ts +59 -39
- package/src/lighting/cortao/cortao-occluder-lookup-table.ts +138 -0
- package/src/lighting/cortao/cortao-parameters.ts +218 -0
- package/src/lighting/cortao/cortao-pass.ts +136 -0
- package/src/lighting/cortao/cortao-passes.ts +50 -0
- package/src/lighting/cortao/cortao-shaders-wgsl.ts +633 -0
- package/src/lighting/cortao/cortao-shaders.ts +674 -0
- package/src/lighting/cortao/cortao-upsample.ts +177 -0
- package/src/lighting/cortao/cortao-webgl-passes.ts +284 -0
- package/src/lighting/cortao/cortao-webgpu-passes.ts +430 -0
- package/src/lighting/index.ts +12 -3
- package/src/lighting/shadow-map-renderer.ts +57 -43
- package/src/model/gpu-vector-model.ts +47 -18
- package/src/passes/effect-renderer.ts +332 -0
- package/src/passes/scene-capture-pass.ts +51 -0
- package/src/passes/shader-pass-renderer.ts +164 -115
- package/src/scenegraph/model-node.ts +5 -0
- package/src/splats/gpu-paged-splat-renderer.ts +77 -9
- package/src/splats/gpu-paged-splat-shaders.ts +7 -1
- package/src/text/fonts/atlas/browser-font-atlas.ts +12 -2
- package/src/text/fonts/atlas/lru-cache.ts +6 -1
- package/src/text/fonts/index.ts +1 -0
package/dist/effects/passes/postprocessing/image-blur-filters/bloom-composite-shader-pass.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { EffectPass } from "../../../../passes/effect-renderer.js";
|
|
1
2
|
import type { Texture, TextureFormatColor } from '@luma.gl/core';
|
|
2
|
-
import type {
|
|
3
|
+
import type { ShaderPassRenderTarget } from '@luma.gl/shaders';
|
|
3
4
|
import type { BloomProps, BloomUniforms } from "./bloom.js";
|
|
4
5
|
import { type BloomLensEffectsOptions } from "./bloom-lens-effects.js";
|
|
5
6
|
export type { BloomLensEffectsOptions } from "./bloom-lens-effects.js";
|
|
@@ -55,19 +56,30 @@ export type BloomCompositeShaderPassOptions = BloomProps & {
|
|
|
55
56
|
/** Filterable color intermediate format. Defaults to rgba16float for HDR highlight energy. */
|
|
56
57
|
colorFormat?: TextureFormatColor;
|
|
57
58
|
};
|
|
59
|
+
type BloomUpsampleBindings = {
|
|
60
|
+
higherResolutionGlow?: Texture;
|
|
61
|
+
};
|
|
58
62
|
type BloomCompositeBindings = {
|
|
59
63
|
glowHalf?: Texture;
|
|
60
64
|
glowQuarter?: Texture;
|
|
61
65
|
glowEighth?: Texture;
|
|
62
66
|
};
|
|
67
|
+
type BloomAdaptiveCompositeBindings = {
|
|
68
|
+
glowTexture?: Texture;
|
|
69
|
+
};
|
|
70
|
+
type BloomAdaptiveCompositeUniforms = {
|
|
71
|
+
tint?: [number, number, number];
|
|
72
|
+
intensity?: number;
|
|
73
|
+
energyConserving?: number;
|
|
74
|
+
};
|
|
63
75
|
/**
|
|
64
76
|
* BloomCompositeShaderPass
|
|
65
77
|
* Extracts bright pixels at half resolution, successively downsamples and blurs them, and
|
|
66
78
|
* composites the multiscale glow over the preceding effect output.
|
|
67
79
|
*/
|
|
68
|
-
export declare const
|
|
80
|
+
export declare const multiscaleBloomEffect: {
|
|
69
81
|
readonly name: "bloomCompositeShaderPass";
|
|
70
|
-
readonly
|
|
82
|
+
readonly resources: {
|
|
71
83
|
readonly extractHalf: {
|
|
72
84
|
readonly scale: [0.5, 0.5];
|
|
73
85
|
readonly sampler: {
|
|
@@ -132,7 +144,8 @@ export declare const bloomCompositeShaderPass: {
|
|
|
132
144
|
};
|
|
133
145
|
};
|
|
134
146
|
};
|
|
135
|
-
readonly
|
|
147
|
+
readonly passes: [{
|
|
148
|
+
readonly kind: "fullscreen";
|
|
136
149
|
readonly shaderPass: {
|
|
137
150
|
readonly name: "bloomExtract";
|
|
138
151
|
readonly source: "\nstruct bloomExtractUniforms {\n threshold: f32,\n softKnee: f32,\n fireflyReduction: f32,\n exposure: f32,\n exposureCompensation: f32,\n};\n\n@group(0) @binding(auto) var<uniform> bloomExtract: bloomExtractUniforms;\n\nfn bloomExtract_applyThreshold(sourceColor: vec4f) -> vec4f {\n let luminance = dot(sourceColor.rgb, vec3f(0.2126, 0.7152, 0.0722));\n let exposure = max(bloomExtract.exposure * exp2(bloomExtract.exposureCompensation), 0.0001);\n let threshold = bloomExtract.threshold / exposure;\n let knee = max(threshold * bloomExtract.softKnee, 0.00001);\n let soft = clamp((luminance - threshold + knee) / (2.0 * knee), 0.0, 1.0);\n let softContribution = soft * soft * knee;\n let hardContribution = max(luminance - threshold, 0.0);\n let bloomContribution = max(hardContribution, softContribution) / max(luminance, 0.00001);\n return vec4f(sourceColor.rgb * bloomContribution, sourceColor.a * bloomContribution);\n}\n\nfn bloomExtract_loadColor(sourceTexture: texture_2d<f32>, coordinate: vec2i) -> vec4f {\n let maximumCoordinate = vec2i(textureDimensions(sourceTexture)) - vec2i(1);\n return textureLoad(sourceTexture, clamp(coordinate, vec2i(0), maximumCoordinate), 0);\n}\n\nfn bloomExtract_sampleColor(\n sourceTexture: texture_2d<f32>,\n sourceTextureSampler: sampler,\n texSize: vec2f,\n texCoord: vec2f\n) -> vec4f {\n let sourceDimensions = vec2i(textureDimensions(sourceTexture));\n let sourceCenter = texCoord * vec2f(sourceDimensions) - vec2f(0.5);\n let sourceFootprint = max(\n (abs(dpdx(texCoord)) + abs(dpdy(texCoord))) * vec2f(sourceDimensions),\n vec2f(1.0)\n );\n let filterRadius = max(sourceFootprint, vec2f(2.0));\n let minimumCoordinate = vec2i(floor(sourceCenter - filterRadius)) + vec2i(1);\n let maximumCoordinate = vec2i(ceil(sourceCenter + filterRadius)) - vec2i(1);\n var color = vec4f(0.0);\n var totalWeight = 0.0;\n\n // The tent radius follows the actual source-to-target ratio so reduced-resolution pyramids do\n // not leave unsampled bands. At the default half resolution this is the original 4x4 tent.\n for (var sourceY = minimumCoordinate.y; sourceY <= maximumCoordinate.y; sourceY += 1) {\n let weightY = max(1.0 - abs(f32(sourceY) - sourceCenter.y) / filterRadius.y, 0.0);\n for (var sourceX = minimumCoordinate.x; sourceX <= maximumCoordinate.x; sourceX += 1) {\n let weightX = max(1.0 - abs(f32(sourceX) - sourceCenter.x) / filterRadius.x, 0.0);\n let sourceColor = bloomExtract_loadColor(\n sourceTexture,\n vec2i(sourceX, sourceY)\n );\n let luminance = dot(sourceColor.rgb, vec3f(0.2126, 0.7152, 0.0722));\n let fireflyWeight = mix(\n 1.0,\n 1.0 / (1.0 + max(luminance, 0.0)),\n clamp(bloomExtract.fireflyReduction, 0.0, 1.0)\n );\n let weight = weightX * weightY * fireflyWeight;\n color += bloomExtract_applyThreshold(sourceColor) * weight;\n totalWeight += weight;\n }\n }\n\n return color / max(totalWeight, 0.00001);\n}\n";
|
|
@@ -190,6 +203,7 @@ export declare const bloomCompositeShaderPass: {
|
|
|
190
203
|
readonly threshold: 0.8;
|
|
191
204
|
};
|
|
192
205
|
}, {
|
|
206
|
+
readonly kind: "fullscreen";
|
|
193
207
|
readonly shaderPass: {
|
|
194
208
|
readonly name: "bloomBlur";
|
|
195
209
|
readonly source: `
|
|
@@ -365,6 +379,7 @@ vec4 bloomBlur_sampleColor(sampler2D sourceTexture, vec2 texSize, vec2 texCoord)
|
|
|
365
379
|
readonly delta: [1, 0];
|
|
366
380
|
};
|
|
367
381
|
}, {
|
|
382
|
+
readonly kind: "fullscreen";
|
|
368
383
|
readonly shaderPass: {
|
|
369
384
|
readonly name: "bloomBlur";
|
|
370
385
|
readonly source: `
|
|
@@ -540,6 +555,7 @@ vec4 bloomBlur_sampleColor(sampler2D sourceTexture, vec2 texSize, vec2 texCoord)
|
|
|
540
555
|
readonly delta: [0, 1];
|
|
541
556
|
};
|
|
542
557
|
}, {
|
|
558
|
+
readonly kind: "fullscreen";
|
|
543
559
|
readonly shaderPass: {
|
|
544
560
|
readonly name: "bloomDownsample";
|
|
545
561
|
readonly source: "\nfn bloomDownsample_loadColor(sourceTexture: texture_2d<f32>, coordinate: vec2i) -> vec4f {\n let maximumCoordinate = vec2i(textureDimensions(sourceTexture)) - vec2i(1);\n return textureLoad(sourceTexture, clamp(coordinate, vec2i(0), maximumCoordinate), 0);\n}\n\nfn bloomDownsample_sampleColor(\n sourceTexture: texture_2d<f32>,\n sourceTextureSampler: sampler,\n texSize: vec2f,\n texCoord: vec2f\n) -> vec4f {\n let sourceDimensions = vec2i(textureDimensions(sourceTexture));\n let sourceCenter = texCoord * vec2f(sourceDimensions) - vec2f(0.5);\n let sourceFootprint = max(\n (abs(dpdx(texCoord)) + abs(dpdy(texCoord))) * vec2f(sourceDimensions),\n vec2f(1.0)\n );\n let filterRadius = max(sourceFootprint, vec2f(2.0));\n let minimumCoordinate = vec2i(floor(sourceCenter - filterRadius)) + vec2i(1);\n let maximumCoordinate = vec2i(ceil(sourceCenter + filterRadius)) - vec2i(1);\n var color = vec4f(0.0);\n var totalWeight = 0.0;\n\n for (var sourceY = minimumCoordinate.y; sourceY <= maximumCoordinate.y; sourceY += 1) {\n let weightY = max(1.0 - abs(f32(sourceY) - sourceCenter.y) / filterRadius.y, 0.0);\n for (var sourceX = minimumCoordinate.x; sourceX <= maximumCoordinate.x; sourceX += 1) {\n let weightX = max(1.0 - abs(f32(sourceX) - sourceCenter.x) / filterRadius.x, 0.0);\n let weight = weightX * weightY;\n color += bloomDownsample_loadColor(\n sourceTexture,\n vec2i(sourceX, sourceY)\n ) * weight;\n totalWeight += weight;\n }\n }\n\n return color / max(totalWeight, 0.00001);\n}\n";
|
|
@@ -553,6 +569,7 @@ vec4 bloomBlur_sampleColor(sampler2D sourceTexture, vec2 texSize, vec2 texCoord)
|
|
|
553
569
|
};
|
|
554
570
|
readonly output: "extractQuarter";
|
|
555
571
|
}, {
|
|
572
|
+
readonly kind: "fullscreen";
|
|
556
573
|
readonly shaderPass: {
|
|
557
574
|
readonly name: "bloomBlur";
|
|
558
575
|
readonly source: `
|
|
@@ -728,6 +745,7 @@ vec4 bloomBlur_sampleColor(sampler2D sourceTexture, vec2 texSize, vec2 texCoord)
|
|
|
728
745
|
readonly delta: [1, 0];
|
|
729
746
|
};
|
|
730
747
|
}, {
|
|
748
|
+
readonly kind: "fullscreen";
|
|
731
749
|
readonly shaderPass: {
|
|
732
750
|
readonly name: "bloomBlur";
|
|
733
751
|
readonly source: `
|
|
@@ -903,6 +921,7 @@ vec4 bloomBlur_sampleColor(sampler2D sourceTexture, vec2 texSize, vec2 texCoord)
|
|
|
903
921
|
readonly delta: [0, 1];
|
|
904
922
|
};
|
|
905
923
|
}, {
|
|
924
|
+
readonly kind: "fullscreen";
|
|
906
925
|
readonly shaderPass: {
|
|
907
926
|
readonly name: "bloomDownsample";
|
|
908
927
|
readonly source: "\nfn bloomDownsample_loadColor(sourceTexture: texture_2d<f32>, coordinate: vec2i) -> vec4f {\n let maximumCoordinate = vec2i(textureDimensions(sourceTexture)) - vec2i(1);\n return textureLoad(sourceTexture, clamp(coordinate, vec2i(0), maximumCoordinate), 0);\n}\n\nfn bloomDownsample_sampleColor(\n sourceTexture: texture_2d<f32>,\n sourceTextureSampler: sampler,\n texSize: vec2f,\n texCoord: vec2f\n) -> vec4f {\n let sourceDimensions = vec2i(textureDimensions(sourceTexture));\n let sourceCenter = texCoord * vec2f(sourceDimensions) - vec2f(0.5);\n let sourceFootprint = max(\n (abs(dpdx(texCoord)) + abs(dpdy(texCoord))) * vec2f(sourceDimensions),\n vec2f(1.0)\n );\n let filterRadius = max(sourceFootprint, vec2f(2.0));\n let minimumCoordinate = vec2i(floor(sourceCenter - filterRadius)) + vec2i(1);\n let maximumCoordinate = vec2i(ceil(sourceCenter + filterRadius)) - vec2i(1);\n var color = vec4f(0.0);\n var totalWeight = 0.0;\n\n for (var sourceY = minimumCoordinate.y; sourceY <= maximumCoordinate.y; sourceY += 1) {\n let weightY = max(1.0 - abs(f32(sourceY) - sourceCenter.y) / filterRadius.y, 0.0);\n for (var sourceX = minimumCoordinate.x; sourceX <= maximumCoordinate.x; sourceX += 1) {\n let weightX = max(1.0 - abs(f32(sourceX) - sourceCenter.x) / filterRadius.x, 0.0);\n let weight = weightX * weightY;\n color += bloomDownsample_loadColor(\n sourceTexture,\n vec2i(sourceX, sourceY)\n ) * weight;\n totalWeight += weight;\n }\n }\n\n return color / max(totalWeight, 0.00001);\n}\n";
|
|
@@ -916,6 +935,7 @@ vec4 bloomBlur_sampleColor(sampler2D sourceTexture, vec2 texSize, vec2 texCoord)
|
|
|
916
935
|
};
|
|
917
936
|
readonly output: "extractEighth";
|
|
918
937
|
}, {
|
|
938
|
+
readonly kind: "fullscreen";
|
|
919
939
|
readonly shaderPass: {
|
|
920
940
|
readonly name: "bloomBlur";
|
|
921
941
|
readonly source: `
|
|
@@ -1091,6 +1111,7 @@ vec4 bloomBlur_sampleColor(sampler2D sourceTexture, vec2 texSize, vec2 texCoord)
|
|
|
1091
1111
|
readonly delta: [1, 0];
|
|
1092
1112
|
};
|
|
1093
1113
|
}, {
|
|
1114
|
+
readonly kind: "fullscreen";
|
|
1094
1115
|
readonly shaderPass: {
|
|
1095
1116
|
readonly name: "bloomBlur";
|
|
1096
1117
|
readonly source: `
|
|
@@ -1266,6 +1287,7 @@ vec4 bloomBlur_sampleColor(sampler2D sourceTexture, vec2 texSize, vec2 texCoord)
|
|
|
1266
1287
|
readonly delta: [0, 1];
|
|
1267
1288
|
};
|
|
1268
1289
|
}, {
|
|
1290
|
+
readonly kind: "fullscreen";
|
|
1269
1291
|
readonly shaderPass: {
|
|
1270
1292
|
readonly name: "bloomComposite";
|
|
1271
1293
|
readonly source: "\nstruct bloomCompositeUniforms {\n intensity: f32,\n};\n\n@group(0) @binding(auto) var<uniform> bloomComposite: bloomCompositeUniforms;\n@group(0) @binding(auto) var glowHalf: texture_2d<f32>;\n@group(0) @binding(auto) var glowHalfSampler: sampler;\n@group(0) @binding(auto) var glowQuarter: texture_2d<f32>;\n@group(0) @binding(auto) var glowQuarterSampler: sampler;\n@group(0) @binding(auto) var glowEighth: texture_2d<f32>;\n@group(0) @binding(auto) var glowEighthSampler: sampler;\n\nfn bloomComposite_sampleColor(\n sourceTexture: texture_2d<f32>,\n sourceTextureSampler: sampler,\n texSize: vec2f,\n texCoord: vec2f\n) -> vec4f {\n let sourceColor = textureSample(sourceTexture, sourceTextureSampler, texCoord);\n let halfGlow = textureSample(glowHalf, glowHalfSampler, texCoord).rgb;\n let quarterGlow = textureSample(glowQuarter, glowQuarterSampler, texCoord).rgb;\n let eighthGlow = textureSample(glowEighth, glowEighthSampler, texCoord).rgb;\n let glowColor = halfGlow * 0.50 + quarterGlow * 0.32 + eighthGlow * 0.18;\n return vec4f(sourceColor.rgb + glowColor * bloomComposite.intensity, sourceColor.a);\n}\n";
|
|
@@ -1308,6 +1330,970 @@ vec4 bloomBlur_sampleColor(sampler2D sourceTexture, vec2 texSize, vec2 texCoord)
|
|
|
1308
1330
|
};
|
|
1309
1331
|
}];
|
|
1310
1332
|
};
|
|
1311
|
-
/**
|
|
1312
|
-
export declare
|
|
1333
|
+
/** Two-level HDR bloom with explicit compute and fragment extraction alternatives. */
|
|
1334
|
+
export declare const bloomLow: {
|
|
1335
|
+
readonly name: "bloomLow";
|
|
1336
|
+
readonly resources: {
|
|
1337
|
+
readonly extractHalf: {
|
|
1338
|
+
readonly scale: [0.5, 0.5];
|
|
1339
|
+
readonly format: "rgba16float";
|
|
1340
|
+
readonly sampler: {
|
|
1341
|
+
readonly minFilter: "linear";
|
|
1342
|
+
readonly magFilter: "linear";
|
|
1343
|
+
};
|
|
1344
|
+
readonly storage: true;
|
|
1345
|
+
};
|
|
1346
|
+
readonly blurHalfScratch: {
|
|
1347
|
+
readonly scale: [0.5, 0.5];
|
|
1348
|
+
readonly format: "rgba16float";
|
|
1349
|
+
readonly sampler: {
|
|
1350
|
+
readonly minFilter: "linear";
|
|
1351
|
+
readonly magFilter: "linear";
|
|
1352
|
+
};
|
|
1353
|
+
};
|
|
1354
|
+
readonly blurHalf: {
|
|
1355
|
+
readonly scale: [0.5, 0.5];
|
|
1356
|
+
readonly format: "rgba16float";
|
|
1357
|
+
readonly sampler: {
|
|
1358
|
+
readonly minFilter: "linear";
|
|
1359
|
+
readonly magFilter: "linear";
|
|
1360
|
+
};
|
|
1361
|
+
};
|
|
1362
|
+
readonly extractQuarter: {
|
|
1363
|
+
readonly scale: [0.25, 0.25];
|
|
1364
|
+
readonly format: "rgba16float";
|
|
1365
|
+
readonly sampler: {
|
|
1366
|
+
readonly minFilter: "linear";
|
|
1367
|
+
readonly magFilter: "linear";
|
|
1368
|
+
};
|
|
1369
|
+
readonly storage: true;
|
|
1370
|
+
};
|
|
1371
|
+
readonly blurQuarterScratch: {
|
|
1372
|
+
readonly scale: [0.25, 0.25];
|
|
1373
|
+
readonly format: "rgba16float";
|
|
1374
|
+
readonly sampler: {
|
|
1375
|
+
readonly minFilter: "linear";
|
|
1376
|
+
readonly magFilter: "linear";
|
|
1377
|
+
};
|
|
1378
|
+
};
|
|
1379
|
+
readonly blurQuarter: {
|
|
1380
|
+
readonly scale: [0.25, 0.25];
|
|
1381
|
+
readonly format: "rgba16float";
|
|
1382
|
+
readonly sampler: {
|
|
1383
|
+
readonly minFilter: "linear";
|
|
1384
|
+
readonly magFilter: "linear";
|
|
1385
|
+
};
|
|
1386
|
+
};
|
|
1387
|
+
readonly glow: {
|
|
1388
|
+
readonly scale: [0.5, 0.5];
|
|
1389
|
+
readonly format: "rgba16float";
|
|
1390
|
+
readonly sampler: {
|
|
1391
|
+
readonly minFilter: "linear";
|
|
1392
|
+
readonly magFilter: "linear";
|
|
1393
|
+
};
|
|
1394
|
+
};
|
|
1395
|
+
};
|
|
1396
|
+
readonly initialPasses: {
|
|
1397
|
+
readonly compute: import("@luma.gl/shaders").CompositeShaderPassComputeOptimization<"extractHalf" | "extractQuarter">;
|
|
1398
|
+
readonly fragment: [{
|
|
1399
|
+
readonly kind: "fullscreen";
|
|
1400
|
+
readonly shaderPass: {
|
|
1401
|
+
readonly name: "bloomExtract";
|
|
1402
|
+
readonly source: "\nstruct bloomExtractUniforms {\n threshold: f32,\n softKnee: f32,\n fireflyReduction: f32,\n exposure: f32,\n exposureCompensation: f32,\n};\n\n@group(0) @binding(auto) var<uniform> bloomExtract: bloomExtractUniforms;\n\nfn bloomExtract_applyThreshold(sourceColor: vec4f) -> vec4f {\n let luminance = dot(sourceColor.rgb, vec3f(0.2126, 0.7152, 0.0722));\n let exposure = max(bloomExtract.exposure * exp2(bloomExtract.exposureCompensation), 0.0001);\n let threshold = bloomExtract.threshold / exposure;\n let knee = max(threshold * bloomExtract.softKnee, 0.00001);\n let soft = clamp((luminance - threshold + knee) / (2.0 * knee), 0.0, 1.0);\n let softContribution = soft * soft * knee;\n let hardContribution = max(luminance - threshold, 0.0);\n let bloomContribution = max(hardContribution, softContribution) / max(luminance, 0.00001);\n return vec4f(sourceColor.rgb * bloomContribution, sourceColor.a * bloomContribution);\n}\n\nfn bloomExtract_loadColor(sourceTexture: texture_2d<f32>, coordinate: vec2i) -> vec4f {\n let maximumCoordinate = vec2i(textureDimensions(sourceTexture)) - vec2i(1);\n return textureLoad(sourceTexture, clamp(coordinate, vec2i(0), maximumCoordinate), 0);\n}\n\nfn bloomExtract_sampleColor(\n sourceTexture: texture_2d<f32>,\n sourceTextureSampler: sampler,\n texSize: vec2f,\n texCoord: vec2f\n) -> vec4f {\n let sourceDimensions = vec2i(textureDimensions(sourceTexture));\n let sourceCenter = texCoord * vec2f(sourceDimensions) - vec2f(0.5);\n let sourceFootprint = max(\n (abs(dpdx(texCoord)) + abs(dpdy(texCoord))) * vec2f(sourceDimensions),\n vec2f(1.0)\n );\n let filterRadius = max(sourceFootprint, vec2f(2.0));\n let minimumCoordinate = vec2i(floor(sourceCenter - filterRadius)) + vec2i(1);\n let maximumCoordinate = vec2i(ceil(sourceCenter + filterRadius)) - vec2i(1);\n var color = vec4f(0.0);\n var totalWeight = 0.0;\n\n // The tent radius follows the actual source-to-target ratio so reduced-resolution pyramids do\n // not leave unsampled bands. At the default half resolution this is the original 4x4 tent.\n for (var sourceY = minimumCoordinate.y; sourceY <= maximumCoordinate.y; sourceY += 1) {\n let weightY = max(1.0 - abs(f32(sourceY) - sourceCenter.y) / filterRadius.y, 0.0);\n for (var sourceX = minimumCoordinate.x; sourceX <= maximumCoordinate.x; sourceX += 1) {\n let weightX = max(1.0 - abs(f32(sourceX) - sourceCenter.x) / filterRadius.x, 0.0);\n let sourceColor = bloomExtract_loadColor(\n sourceTexture,\n vec2i(sourceX, sourceY)\n );\n let luminance = dot(sourceColor.rgb, vec3f(0.2126, 0.7152, 0.0722));\n let fireflyWeight = mix(\n 1.0,\n 1.0 / (1.0 + max(luminance, 0.0)),\n clamp(bloomExtract.fireflyReduction, 0.0, 1.0)\n );\n let weight = weightX * weightY * fireflyWeight;\n color += bloomExtract_applyThreshold(sourceColor) * weight;\n totalWeight += weight;\n }\n }\n\n return color / max(totalWeight, 0.00001);\n}\n";
|
|
1403
|
+
readonly fs: "\nlayout(std140) uniform bloomExtractUniforms {\n float threshold;\n float softKnee;\n float fireflyReduction;\n float exposure;\n float exposureCompensation;\n} bloomExtract;\n\nvec4 bloomExtract_applyThreshold(vec4 sourceColor) {\n float luminance = dot(sourceColor.rgb, vec3(0.2126, 0.7152, 0.0722));\n float exposure = max(bloomExtract.exposure * exp2(bloomExtract.exposureCompensation), 0.0001);\n float threshold = bloomExtract.threshold / exposure;\n float knee = max(threshold * bloomExtract.softKnee, 0.00001);\n float soft = clamp((luminance - threshold + knee) / (2.0 * knee), 0.0, 1.0);\n float softContribution = soft * soft * knee;\n float hardContribution = max(luminance - threshold, 0.0);\n float bloomContribution = max(hardContribution, softContribution) / max(luminance, 0.00001);\n return vec4(sourceColor.rgb * bloomContribution, sourceColor.a * bloomContribution);\n}\n\nvec4 bloomExtract_loadColor(sampler2D sourceTexture, ivec2 coordinate) {\n ivec2 maximumCoordinate = textureSize(sourceTexture, 0) - ivec2(1);\n return texelFetch(sourceTexture, clamp(coordinate, ivec2(0), maximumCoordinate), 0);\n}\n\nvec4 bloomExtract_sampleColor(sampler2D sourceTexture, vec2 texSize, vec2 texCoord) {\n ivec2 sourceDimensions = textureSize(sourceTexture, 0);\n vec2 sourceCenter = texCoord * vec2(sourceDimensions) - vec2(0.5);\n vec2 sourceFootprint = max(\n (abs(dFdx(texCoord)) + abs(dFdy(texCoord))) * vec2(sourceDimensions),\n vec2(1.0)\n );\n vec2 filterRadius = max(sourceFootprint, vec2(2.0));\n ivec2 minimumCoordinate = ivec2(floor(sourceCenter - filterRadius)) + ivec2(1);\n ivec2 maximumCoordinate = ivec2(ceil(sourceCenter + filterRadius)) - ivec2(1);\n vec4 color = vec4(0.0);\n float totalWeight = 0.0;\n\n // Keep this kernel identical to the WGSL path so WebGL and WebGPU conserve the same energy.\n for (int sourceY = minimumCoordinate.y; sourceY <= maximumCoordinate.y; sourceY++) {\n float weightY = max(1.0 - abs(float(sourceY) - sourceCenter.y) / filterRadius.y, 0.0);\n for (int sourceX = minimumCoordinate.x; sourceX <= maximumCoordinate.x; sourceX++) {\n float weightX = max(1.0 - abs(float(sourceX) - sourceCenter.x) / filterRadius.x, 0.0);\n vec4 sourceColor = bloomExtract_loadColor(\n sourceTexture,\n ivec2(sourceX, sourceY)\n );\n float luminance = dot(sourceColor.rgb, vec3(0.2126, 0.7152, 0.0722));\n float fireflyWeight = mix(\n 1.0,\n 1.0 / (1.0 + max(luminance, 0.0)),\n clamp(bloomExtract.fireflyReduction, 0.0, 1.0)\n );\n float weight = weightX * weightY * fireflyWeight;\n color += bloomExtract_applyThreshold(sourceColor) * weight;\n totalWeight += weight;\n }\n }\n\n return color / max(totalWeight, 0.00001);\n}\n";
|
|
1404
|
+
readonly uniformTypes: {
|
|
1405
|
+
readonly threshold: "f32";
|
|
1406
|
+
readonly softKnee: "f32";
|
|
1407
|
+
readonly fireflyReduction: "f32";
|
|
1408
|
+
readonly exposure: "f32";
|
|
1409
|
+
readonly exposureCompensation: "f32";
|
|
1410
|
+
};
|
|
1411
|
+
readonly defaultUniforms: {
|
|
1412
|
+
readonly threshold: 0.8;
|
|
1413
|
+
readonly softKnee: 0.5;
|
|
1414
|
+
readonly fireflyReduction: 0;
|
|
1415
|
+
readonly exposure: 1;
|
|
1416
|
+
readonly exposureCompensation: 0;
|
|
1417
|
+
};
|
|
1418
|
+
readonly propTypes: {
|
|
1419
|
+
readonly threshold: {
|
|
1420
|
+
readonly value: 0.8;
|
|
1421
|
+
readonly min: 0;
|
|
1422
|
+
readonly max: 1;
|
|
1423
|
+
};
|
|
1424
|
+
readonly softKnee: {
|
|
1425
|
+
readonly value: 0.5;
|
|
1426
|
+
readonly min: 0;
|
|
1427
|
+
readonly max: 1;
|
|
1428
|
+
};
|
|
1429
|
+
readonly fireflyReduction: {
|
|
1430
|
+
readonly value: 0;
|
|
1431
|
+
readonly min: 0;
|
|
1432
|
+
readonly max: 1;
|
|
1433
|
+
};
|
|
1434
|
+
readonly exposure: {
|
|
1435
|
+
readonly value: 1;
|
|
1436
|
+
readonly min: 0.0001;
|
|
1437
|
+
readonly softMax: 8;
|
|
1438
|
+
};
|
|
1439
|
+
readonly exposureCompensation: {
|
|
1440
|
+
readonly value: 0;
|
|
1441
|
+
readonly min: -8;
|
|
1442
|
+
readonly max: 8;
|
|
1443
|
+
};
|
|
1444
|
+
};
|
|
1445
|
+
readonly passes: [{
|
|
1446
|
+
readonly sampler: true;
|
|
1447
|
+
}];
|
|
1448
|
+
};
|
|
1449
|
+
readonly inputs: {
|
|
1450
|
+
readonly sourceTexture: "previous";
|
|
1451
|
+
};
|
|
1452
|
+
readonly output: "extractHalf";
|
|
1453
|
+
readonly uniforms: {
|
|
1454
|
+
threshold: number;
|
|
1455
|
+
softKnee: number;
|
|
1456
|
+
fireflyReduction: number;
|
|
1457
|
+
exposure: number;
|
|
1458
|
+
exposureCompensation: number;
|
|
1459
|
+
};
|
|
1460
|
+
}, {
|
|
1461
|
+
readonly kind: "fullscreen";
|
|
1462
|
+
readonly shaderPass: {
|
|
1463
|
+
readonly name: "bloomDownsample";
|
|
1464
|
+
readonly source: "\nfn bloomDownsample_loadColor(sourceTexture: texture_2d<f32>, coordinate: vec2i) -> vec4f {\n let maximumCoordinate = vec2i(textureDimensions(sourceTexture)) - vec2i(1);\n return textureLoad(sourceTexture, clamp(coordinate, vec2i(0), maximumCoordinate), 0);\n}\n\nfn bloomDownsample_sampleColor(\n sourceTexture: texture_2d<f32>,\n sourceTextureSampler: sampler,\n texSize: vec2f,\n texCoord: vec2f\n) -> vec4f {\n let sourceDimensions = vec2i(textureDimensions(sourceTexture));\n let sourceCenter = texCoord * vec2f(sourceDimensions) - vec2f(0.5);\n let sourceFootprint = max(\n (abs(dpdx(texCoord)) + abs(dpdy(texCoord))) * vec2f(sourceDimensions),\n vec2f(1.0)\n );\n let filterRadius = max(sourceFootprint, vec2f(2.0));\n let minimumCoordinate = vec2i(floor(sourceCenter - filterRadius)) + vec2i(1);\n let maximumCoordinate = vec2i(ceil(sourceCenter + filterRadius)) - vec2i(1);\n var color = vec4f(0.0);\n var totalWeight = 0.0;\n\n for (var sourceY = minimumCoordinate.y; sourceY <= maximumCoordinate.y; sourceY += 1) {\n let weightY = max(1.0 - abs(f32(sourceY) - sourceCenter.y) / filterRadius.y, 0.0);\n for (var sourceX = minimumCoordinate.x; sourceX <= maximumCoordinate.x; sourceX += 1) {\n let weightX = max(1.0 - abs(f32(sourceX) - sourceCenter.x) / filterRadius.x, 0.0);\n let weight = weightX * weightY;\n color += bloomDownsample_loadColor(\n sourceTexture,\n vec2i(sourceX, sourceY)\n ) * weight;\n totalWeight += weight;\n }\n }\n\n return color / max(totalWeight, 0.00001);\n}\n";
|
|
1465
|
+
readonly fs: "\nvec4 bloomDownsample_loadColor(sampler2D sourceTexture, ivec2 coordinate) {\n ivec2 maximumCoordinate = textureSize(sourceTexture, 0) - ivec2(1);\n return texelFetch(sourceTexture, clamp(coordinate, ivec2(0), maximumCoordinate), 0);\n}\n\nvec4 bloomDownsample_sampleColor(sampler2D sourceTexture, vec2 texSize, vec2 texCoord) {\n ivec2 sourceDimensions = textureSize(sourceTexture, 0);\n vec2 sourceCenter = texCoord * vec2(sourceDimensions) - vec2(0.5);\n vec2 sourceFootprint = max(\n (abs(dFdx(texCoord)) + abs(dFdy(texCoord))) * vec2(sourceDimensions),\n vec2(1.0)\n );\n vec2 filterRadius = max(sourceFootprint, vec2(2.0));\n ivec2 minimumCoordinate = ivec2(floor(sourceCenter - filterRadius)) + ivec2(1);\n ivec2 maximumCoordinate = ivec2(ceil(sourceCenter + filterRadius)) - ivec2(1);\n vec4 color = vec4(0.0);\n float totalWeight = 0.0;\n\n for (int sourceY = minimumCoordinate.y; sourceY <= maximumCoordinate.y; sourceY++) {\n float weightY = max(1.0 - abs(float(sourceY) - sourceCenter.y) / filterRadius.y, 0.0);\n for (int sourceX = minimumCoordinate.x; sourceX <= maximumCoordinate.x; sourceX++) {\n float weightX = max(1.0 - abs(float(sourceX) - sourceCenter.x) / filterRadius.x, 0.0);\n float weight = weightX * weightY;\n color += bloomDownsample_loadColor(\n sourceTexture,\n ivec2(sourceX, sourceY)\n ) * weight;\n totalWeight += weight;\n }\n }\n\n return color / max(totalWeight, 0.00001);\n}\n";
|
|
1466
|
+
readonly passes: [{
|
|
1467
|
+
readonly sampler: true;
|
|
1468
|
+
}];
|
|
1469
|
+
};
|
|
1470
|
+
readonly inputs: {
|
|
1471
|
+
readonly sourceTexture: "extractHalf";
|
|
1472
|
+
};
|
|
1473
|
+
readonly output: "extractQuarter";
|
|
1474
|
+
}];
|
|
1475
|
+
};
|
|
1476
|
+
readonly passes: [{
|
|
1477
|
+
readonly kind: "fullscreen";
|
|
1478
|
+
readonly shaderPass: {
|
|
1479
|
+
readonly name: "bloomBlur";
|
|
1480
|
+
readonly source: `
|
|
1481
|
+
const BLOOM_BLUR_MAX_RADIUS = 24.0;
|
|
1482
|
+
const BLOOM_BLUR_MAX_PAIRS = ${number};
|
|
1483
|
+
|
|
1484
|
+
struct bloomBlurUniforms {
|
|
1485
|
+
radius: f32,
|
|
1486
|
+
delta: vec2f,
|
|
1487
|
+
};
|
|
1488
|
+
|
|
1489
|
+
@group(0) @binding(auto) var<uniform> bloomBlur: bloomBlurUniforms;
|
|
1490
|
+
|
|
1491
|
+
fn bloomBlur_applySample(color: vec4f) -> vec4f {
|
|
1492
|
+
return color;
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
fn bloomBlur_getEffectiveRadius() -> f32 {
|
|
1496
|
+
return clamp(bloomBlur.radius, 0.0, BLOOM_BLUR_MAX_RADIUS);
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
fn bloomBlur_getSigma(radius: f32) -> f32 {
|
|
1500
|
+
return max(radius / 3.0, 0.00001);
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
fn bloomBlur_getWeight(offset: f32, sigma: f32) -> f32 {
|
|
1504
|
+
let normalizedOffset = offset / sigma;
|
|
1505
|
+
return exp(-0.5 * normalizedOffset * normalizedOffset);
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
fn bloomBlur_sampleColor(
|
|
1509
|
+
sourceTexture: texture_2d<f32>,
|
|
1510
|
+
sourceTextureSampler: sampler,
|
|
1511
|
+
texSize: vec2f,
|
|
1512
|
+
texCoord: vec2f
|
|
1513
|
+
) -> vec4f {
|
|
1514
|
+
let effectiveRadius = bloomBlur_getEffectiveRadius();
|
|
1515
|
+
if (effectiveRadius <= 0.0) {
|
|
1516
|
+
return textureSample(sourceTexture, sourceTextureSampler, texCoord);
|
|
1517
|
+
}
|
|
1518
|
+
|
|
1519
|
+
let adjustedDelta = bloomBlur.delta / texSize;
|
|
1520
|
+
let sigma = bloomBlur_getSigma(effectiveRadius);
|
|
1521
|
+
let centerWeight = bloomBlur_getWeight(0.0, sigma);
|
|
1522
|
+
|
|
1523
|
+
var color = vec4f(0.0);
|
|
1524
|
+
var totalWeight = centerWeight;
|
|
1525
|
+
|
|
1526
|
+
let centerColor = bloomBlur_applySample(
|
|
1527
|
+
textureSample(sourceTexture, sourceTextureSampler, texCoord)
|
|
1528
|
+
);
|
|
1529
|
+
color += centerColor * centerWeight;
|
|
1530
|
+
|
|
1531
|
+
for (var pairIndex = 0; pairIndex < BLOOM_BLUR_MAX_PAIRS; pairIndex += 1) {
|
|
1532
|
+
let firstOffset = f32(pairIndex * 2 + 1);
|
|
1533
|
+
if (firstOffset > effectiveRadius) {
|
|
1534
|
+
continue;
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1537
|
+
let secondOffset = firstOffset + 1.0;
|
|
1538
|
+
let firstWeight = bloomBlur_getWeight(firstOffset, sigma);
|
|
1539
|
+
let secondWeight =
|
|
1540
|
+
select(0.0, bloomBlur_getWeight(secondOffset, sigma), secondOffset <= effectiveRadius);
|
|
1541
|
+
let combinedWeight = firstWeight + secondWeight;
|
|
1542
|
+
let combinedOffset =
|
|
1543
|
+
(firstOffset * firstWeight + secondOffset * secondWeight) / max(combinedWeight, 0.00001);
|
|
1544
|
+
|
|
1545
|
+
let positiveColor = bloomBlur_applySample(
|
|
1546
|
+
textureSample(sourceTexture, sourceTextureSampler, texCoord + adjustedDelta * combinedOffset)
|
|
1547
|
+
);
|
|
1548
|
+
let negativeColor = bloomBlur_applySample(
|
|
1549
|
+
textureSample(sourceTexture, sourceTextureSampler, texCoord - adjustedDelta * combinedOffset)
|
|
1550
|
+
);
|
|
1551
|
+
|
|
1552
|
+
color += (positiveColor + negativeColor) * combinedWeight;
|
|
1553
|
+
totalWeight += combinedWeight * 2.0;
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
return color / totalWeight;
|
|
1557
|
+
}
|
|
1558
|
+
`;
|
|
1559
|
+
readonly fs: `
|
|
1560
|
+
#define BLOOM_BLUR_MAX_RADIUS 24.0
|
|
1561
|
+
#define BLOOM_BLUR_MAX_PAIRS ${number}
|
|
1562
|
+
|
|
1563
|
+
layout(std140) uniform bloomBlurUniforms {
|
|
1564
|
+
float radius;
|
|
1565
|
+
vec2 delta;
|
|
1566
|
+
} bloomBlur;
|
|
1567
|
+
|
|
1568
|
+
vec4 bloomBlur_applySample(vec4 color) {
|
|
1569
|
+
return color;
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
float bloomBlur_getEffectiveRadius() {
|
|
1573
|
+
return clamp(bloomBlur.radius, 0.0, BLOOM_BLUR_MAX_RADIUS);
|
|
1574
|
+
}
|
|
1575
|
+
|
|
1576
|
+
float bloomBlur_getSigma(float radius) {
|
|
1577
|
+
return max(radius / 3.0, 0.00001);
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
float bloomBlur_getWeight(float offset, float sigma) {
|
|
1581
|
+
float normalizedOffset = offset / sigma;
|
|
1582
|
+
return exp(-0.5 * normalizedOffset * normalizedOffset);
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1585
|
+
vec4 bloomBlur_sampleColor(sampler2D sourceTexture, vec2 texSize, vec2 texCoord) {
|
|
1586
|
+
float effectiveRadius = bloomBlur_getEffectiveRadius();
|
|
1587
|
+
if (effectiveRadius <= 0.0) {
|
|
1588
|
+
return texture(sourceTexture, texCoord);
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
vec2 adjustedDelta = bloomBlur.delta / texSize;
|
|
1592
|
+
float sigma = bloomBlur_getSigma(effectiveRadius);
|
|
1593
|
+
float centerWeight = bloomBlur_getWeight(0.0, sigma);
|
|
1594
|
+
|
|
1595
|
+
vec4 color = vec4(0.0);
|
|
1596
|
+
float totalWeight = centerWeight;
|
|
1597
|
+
|
|
1598
|
+
vec4 centerColor = bloomBlur_applySample(texture(sourceTexture, texCoord));
|
|
1599
|
+
color += centerColor * centerWeight;
|
|
1600
|
+
|
|
1601
|
+
for (int pairIndex = 0; pairIndex < BLOOM_BLUR_MAX_PAIRS; pairIndex++) {
|
|
1602
|
+
float firstOffset = float(pairIndex * 2 + 1);
|
|
1603
|
+
if (firstOffset > effectiveRadius) {
|
|
1604
|
+
continue;
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1607
|
+
float secondOffset = firstOffset + 1.0;
|
|
1608
|
+
float firstWeight = bloomBlur_getWeight(firstOffset, sigma);
|
|
1609
|
+
float secondWeight = secondOffset <= effectiveRadius ? bloomBlur_getWeight(secondOffset, sigma) : 0.0;
|
|
1610
|
+
float combinedWeight = firstWeight + secondWeight;
|
|
1611
|
+
float combinedOffset =
|
|
1612
|
+
(firstOffset * firstWeight + secondOffset * secondWeight) / max(combinedWeight, 0.00001);
|
|
1613
|
+
|
|
1614
|
+
vec4 positiveColor = bloomBlur_applySample(texture(sourceTexture, texCoord + adjustedDelta * combinedOffset));
|
|
1615
|
+
vec4 negativeColor = bloomBlur_applySample(texture(sourceTexture, texCoord - adjustedDelta * combinedOffset));
|
|
1616
|
+
color += (positiveColor + negativeColor) * combinedWeight;
|
|
1617
|
+
totalWeight += combinedWeight * 2.0;
|
|
1618
|
+
}
|
|
1619
|
+
|
|
1620
|
+
color /= totalWeight;
|
|
1621
|
+
return color;
|
|
1622
|
+
}
|
|
1623
|
+
`;
|
|
1624
|
+
readonly uniformTypes: {
|
|
1625
|
+
readonly radius: "f32";
|
|
1626
|
+
readonly delta: "vec2<f32>";
|
|
1627
|
+
};
|
|
1628
|
+
readonly propTypes: {
|
|
1629
|
+
readonly radius: {
|
|
1630
|
+
readonly value: 8;
|
|
1631
|
+
readonly min: 0;
|
|
1632
|
+
readonly max: 24;
|
|
1633
|
+
readonly softMax: 24;
|
|
1634
|
+
};
|
|
1635
|
+
readonly delta: {
|
|
1636
|
+
readonly value: readonly [1, 0];
|
|
1637
|
+
readonly private: true;
|
|
1638
|
+
};
|
|
1639
|
+
};
|
|
1640
|
+
readonly passes: [{
|
|
1641
|
+
readonly sampler: true;
|
|
1642
|
+
}];
|
|
1643
|
+
};
|
|
1644
|
+
readonly inputs: {
|
|
1645
|
+
readonly sourceTexture: "extractHalf";
|
|
1646
|
+
};
|
|
1647
|
+
readonly output: "blurHalfScratch";
|
|
1648
|
+
readonly uniforms: {
|
|
1649
|
+
readonly radius: 8;
|
|
1650
|
+
readonly delta: [1, 0];
|
|
1651
|
+
};
|
|
1652
|
+
}, {
|
|
1653
|
+
readonly kind: "fullscreen";
|
|
1654
|
+
readonly shaderPass: {
|
|
1655
|
+
readonly name: "bloomBlur";
|
|
1656
|
+
readonly source: `
|
|
1657
|
+
const BLOOM_BLUR_MAX_RADIUS = 24.0;
|
|
1658
|
+
const BLOOM_BLUR_MAX_PAIRS = ${number};
|
|
1659
|
+
|
|
1660
|
+
struct bloomBlurUniforms {
|
|
1661
|
+
radius: f32,
|
|
1662
|
+
delta: vec2f,
|
|
1663
|
+
};
|
|
1664
|
+
|
|
1665
|
+
@group(0) @binding(auto) var<uniform> bloomBlur: bloomBlurUniforms;
|
|
1666
|
+
|
|
1667
|
+
fn bloomBlur_applySample(color: vec4f) -> vec4f {
|
|
1668
|
+
return color;
|
|
1669
|
+
}
|
|
1670
|
+
|
|
1671
|
+
fn bloomBlur_getEffectiveRadius() -> f32 {
|
|
1672
|
+
return clamp(bloomBlur.radius, 0.0, BLOOM_BLUR_MAX_RADIUS);
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
fn bloomBlur_getSigma(radius: f32) -> f32 {
|
|
1676
|
+
return max(radius / 3.0, 0.00001);
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1679
|
+
fn bloomBlur_getWeight(offset: f32, sigma: f32) -> f32 {
|
|
1680
|
+
let normalizedOffset = offset / sigma;
|
|
1681
|
+
return exp(-0.5 * normalizedOffset * normalizedOffset);
|
|
1682
|
+
}
|
|
1683
|
+
|
|
1684
|
+
fn bloomBlur_sampleColor(
|
|
1685
|
+
sourceTexture: texture_2d<f32>,
|
|
1686
|
+
sourceTextureSampler: sampler,
|
|
1687
|
+
texSize: vec2f,
|
|
1688
|
+
texCoord: vec2f
|
|
1689
|
+
) -> vec4f {
|
|
1690
|
+
let effectiveRadius = bloomBlur_getEffectiveRadius();
|
|
1691
|
+
if (effectiveRadius <= 0.0) {
|
|
1692
|
+
return textureSample(sourceTexture, sourceTextureSampler, texCoord);
|
|
1693
|
+
}
|
|
1694
|
+
|
|
1695
|
+
let adjustedDelta = bloomBlur.delta / texSize;
|
|
1696
|
+
let sigma = bloomBlur_getSigma(effectiveRadius);
|
|
1697
|
+
let centerWeight = bloomBlur_getWeight(0.0, sigma);
|
|
1698
|
+
|
|
1699
|
+
var color = vec4f(0.0);
|
|
1700
|
+
var totalWeight = centerWeight;
|
|
1701
|
+
|
|
1702
|
+
let centerColor = bloomBlur_applySample(
|
|
1703
|
+
textureSample(sourceTexture, sourceTextureSampler, texCoord)
|
|
1704
|
+
);
|
|
1705
|
+
color += centerColor * centerWeight;
|
|
1706
|
+
|
|
1707
|
+
for (var pairIndex = 0; pairIndex < BLOOM_BLUR_MAX_PAIRS; pairIndex += 1) {
|
|
1708
|
+
let firstOffset = f32(pairIndex * 2 + 1);
|
|
1709
|
+
if (firstOffset > effectiveRadius) {
|
|
1710
|
+
continue;
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
let secondOffset = firstOffset + 1.0;
|
|
1714
|
+
let firstWeight = bloomBlur_getWeight(firstOffset, sigma);
|
|
1715
|
+
let secondWeight =
|
|
1716
|
+
select(0.0, bloomBlur_getWeight(secondOffset, sigma), secondOffset <= effectiveRadius);
|
|
1717
|
+
let combinedWeight = firstWeight + secondWeight;
|
|
1718
|
+
let combinedOffset =
|
|
1719
|
+
(firstOffset * firstWeight + secondOffset * secondWeight) / max(combinedWeight, 0.00001);
|
|
1720
|
+
|
|
1721
|
+
let positiveColor = bloomBlur_applySample(
|
|
1722
|
+
textureSample(sourceTexture, sourceTextureSampler, texCoord + adjustedDelta * combinedOffset)
|
|
1723
|
+
);
|
|
1724
|
+
let negativeColor = bloomBlur_applySample(
|
|
1725
|
+
textureSample(sourceTexture, sourceTextureSampler, texCoord - adjustedDelta * combinedOffset)
|
|
1726
|
+
);
|
|
1727
|
+
|
|
1728
|
+
color += (positiveColor + negativeColor) * combinedWeight;
|
|
1729
|
+
totalWeight += combinedWeight * 2.0;
|
|
1730
|
+
}
|
|
1731
|
+
|
|
1732
|
+
return color / totalWeight;
|
|
1733
|
+
}
|
|
1734
|
+
`;
|
|
1735
|
+
readonly fs: `
|
|
1736
|
+
#define BLOOM_BLUR_MAX_RADIUS 24.0
|
|
1737
|
+
#define BLOOM_BLUR_MAX_PAIRS ${number}
|
|
1738
|
+
|
|
1739
|
+
layout(std140) uniform bloomBlurUniforms {
|
|
1740
|
+
float radius;
|
|
1741
|
+
vec2 delta;
|
|
1742
|
+
} bloomBlur;
|
|
1743
|
+
|
|
1744
|
+
vec4 bloomBlur_applySample(vec4 color) {
|
|
1745
|
+
return color;
|
|
1746
|
+
}
|
|
1747
|
+
|
|
1748
|
+
float bloomBlur_getEffectiveRadius() {
|
|
1749
|
+
return clamp(bloomBlur.radius, 0.0, BLOOM_BLUR_MAX_RADIUS);
|
|
1750
|
+
}
|
|
1751
|
+
|
|
1752
|
+
float bloomBlur_getSigma(float radius) {
|
|
1753
|
+
return max(radius / 3.0, 0.00001);
|
|
1754
|
+
}
|
|
1755
|
+
|
|
1756
|
+
float bloomBlur_getWeight(float offset, float sigma) {
|
|
1757
|
+
float normalizedOffset = offset / sigma;
|
|
1758
|
+
return exp(-0.5 * normalizedOffset * normalizedOffset);
|
|
1759
|
+
}
|
|
1760
|
+
|
|
1761
|
+
vec4 bloomBlur_sampleColor(sampler2D sourceTexture, vec2 texSize, vec2 texCoord) {
|
|
1762
|
+
float effectiveRadius = bloomBlur_getEffectiveRadius();
|
|
1763
|
+
if (effectiveRadius <= 0.0) {
|
|
1764
|
+
return texture(sourceTexture, texCoord);
|
|
1765
|
+
}
|
|
1766
|
+
|
|
1767
|
+
vec2 adjustedDelta = bloomBlur.delta / texSize;
|
|
1768
|
+
float sigma = bloomBlur_getSigma(effectiveRadius);
|
|
1769
|
+
float centerWeight = bloomBlur_getWeight(0.0, sigma);
|
|
1770
|
+
|
|
1771
|
+
vec4 color = vec4(0.0);
|
|
1772
|
+
float totalWeight = centerWeight;
|
|
1773
|
+
|
|
1774
|
+
vec4 centerColor = bloomBlur_applySample(texture(sourceTexture, texCoord));
|
|
1775
|
+
color += centerColor * centerWeight;
|
|
1776
|
+
|
|
1777
|
+
for (int pairIndex = 0; pairIndex < BLOOM_BLUR_MAX_PAIRS; pairIndex++) {
|
|
1778
|
+
float firstOffset = float(pairIndex * 2 + 1);
|
|
1779
|
+
if (firstOffset > effectiveRadius) {
|
|
1780
|
+
continue;
|
|
1781
|
+
}
|
|
1782
|
+
|
|
1783
|
+
float secondOffset = firstOffset + 1.0;
|
|
1784
|
+
float firstWeight = bloomBlur_getWeight(firstOffset, sigma);
|
|
1785
|
+
float secondWeight = secondOffset <= effectiveRadius ? bloomBlur_getWeight(secondOffset, sigma) : 0.0;
|
|
1786
|
+
float combinedWeight = firstWeight + secondWeight;
|
|
1787
|
+
float combinedOffset =
|
|
1788
|
+
(firstOffset * firstWeight + secondOffset * secondWeight) / max(combinedWeight, 0.00001);
|
|
1789
|
+
|
|
1790
|
+
vec4 positiveColor = bloomBlur_applySample(texture(sourceTexture, texCoord + adjustedDelta * combinedOffset));
|
|
1791
|
+
vec4 negativeColor = bloomBlur_applySample(texture(sourceTexture, texCoord - adjustedDelta * combinedOffset));
|
|
1792
|
+
color += (positiveColor + negativeColor) * combinedWeight;
|
|
1793
|
+
totalWeight += combinedWeight * 2.0;
|
|
1794
|
+
}
|
|
1795
|
+
|
|
1796
|
+
color /= totalWeight;
|
|
1797
|
+
return color;
|
|
1798
|
+
}
|
|
1799
|
+
`;
|
|
1800
|
+
readonly uniformTypes: {
|
|
1801
|
+
readonly radius: "f32";
|
|
1802
|
+
readonly delta: "vec2<f32>";
|
|
1803
|
+
};
|
|
1804
|
+
readonly propTypes: {
|
|
1805
|
+
readonly radius: {
|
|
1806
|
+
readonly value: 8;
|
|
1807
|
+
readonly min: 0;
|
|
1808
|
+
readonly max: 24;
|
|
1809
|
+
readonly softMax: 24;
|
|
1810
|
+
};
|
|
1811
|
+
readonly delta: {
|
|
1812
|
+
readonly value: readonly [1, 0];
|
|
1813
|
+
readonly private: true;
|
|
1814
|
+
};
|
|
1815
|
+
};
|
|
1816
|
+
readonly passes: [{
|
|
1817
|
+
readonly sampler: true;
|
|
1818
|
+
}];
|
|
1819
|
+
};
|
|
1820
|
+
readonly inputs: {
|
|
1821
|
+
readonly sourceTexture: "blurHalfScratch";
|
|
1822
|
+
};
|
|
1823
|
+
readonly output: "blurHalf";
|
|
1824
|
+
readonly uniforms: {
|
|
1825
|
+
readonly radius: 8;
|
|
1826
|
+
readonly delta: [0, 1];
|
|
1827
|
+
};
|
|
1828
|
+
}, {
|
|
1829
|
+
readonly kind: "fullscreen";
|
|
1830
|
+
readonly shaderPass: {
|
|
1831
|
+
readonly name: "bloomBlur";
|
|
1832
|
+
readonly source: `
|
|
1833
|
+
const BLOOM_BLUR_MAX_RADIUS = 24.0;
|
|
1834
|
+
const BLOOM_BLUR_MAX_PAIRS = ${number};
|
|
1835
|
+
|
|
1836
|
+
struct bloomBlurUniforms {
|
|
1837
|
+
radius: f32,
|
|
1838
|
+
delta: vec2f,
|
|
1839
|
+
};
|
|
1840
|
+
|
|
1841
|
+
@group(0) @binding(auto) var<uniform> bloomBlur: bloomBlurUniforms;
|
|
1842
|
+
|
|
1843
|
+
fn bloomBlur_applySample(color: vec4f) -> vec4f {
|
|
1844
|
+
return color;
|
|
1845
|
+
}
|
|
1846
|
+
|
|
1847
|
+
fn bloomBlur_getEffectiveRadius() -> f32 {
|
|
1848
|
+
return clamp(bloomBlur.radius, 0.0, BLOOM_BLUR_MAX_RADIUS);
|
|
1849
|
+
}
|
|
1850
|
+
|
|
1851
|
+
fn bloomBlur_getSigma(radius: f32) -> f32 {
|
|
1852
|
+
return max(radius / 3.0, 0.00001);
|
|
1853
|
+
}
|
|
1854
|
+
|
|
1855
|
+
fn bloomBlur_getWeight(offset: f32, sigma: f32) -> f32 {
|
|
1856
|
+
let normalizedOffset = offset / sigma;
|
|
1857
|
+
return exp(-0.5 * normalizedOffset * normalizedOffset);
|
|
1858
|
+
}
|
|
1859
|
+
|
|
1860
|
+
fn bloomBlur_sampleColor(
|
|
1861
|
+
sourceTexture: texture_2d<f32>,
|
|
1862
|
+
sourceTextureSampler: sampler,
|
|
1863
|
+
texSize: vec2f,
|
|
1864
|
+
texCoord: vec2f
|
|
1865
|
+
) -> vec4f {
|
|
1866
|
+
let effectiveRadius = bloomBlur_getEffectiveRadius();
|
|
1867
|
+
if (effectiveRadius <= 0.0) {
|
|
1868
|
+
return textureSample(sourceTexture, sourceTextureSampler, texCoord);
|
|
1869
|
+
}
|
|
1870
|
+
|
|
1871
|
+
let adjustedDelta = bloomBlur.delta / texSize;
|
|
1872
|
+
let sigma = bloomBlur_getSigma(effectiveRadius);
|
|
1873
|
+
let centerWeight = bloomBlur_getWeight(0.0, sigma);
|
|
1874
|
+
|
|
1875
|
+
var color = vec4f(0.0);
|
|
1876
|
+
var totalWeight = centerWeight;
|
|
1877
|
+
|
|
1878
|
+
let centerColor = bloomBlur_applySample(
|
|
1879
|
+
textureSample(sourceTexture, sourceTextureSampler, texCoord)
|
|
1880
|
+
);
|
|
1881
|
+
color += centerColor * centerWeight;
|
|
1882
|
+
|
|
1883
|
+
for (var pairIndex = 0; pairIndex < BLOOM_BLUR_MAX_PAIRS; pairIndex += 1) {
|
|
1884
|
+
let firstOffset = f32(pairIndex * 2 + 1);
|
|
1885
|
+
if (firstOffset > effectiveRadius) {
|
|
1886
|
+
continue;
|
|
1887
|
+
}
|
|
1888
|
+
|
|
1889
|
+
let secondOffset = firstOffset + 1.0;
|
|
1890
|
+
let firstWeight = bloomBlur_getWeight(firstOffset, sigma);
|
|
1891
|
+
let secondWeight =
|
|
1892
|
+
select(0.0, bloomBlur_getWeight(secondOffset, sigma), secondOffset <= effectiveRadius);
|
|
1893
|
+
let combinedWeight = firstWeight + secondWeight;
|
|
1894
|
+
let combinedOffset =
|
|
1895
|
+
(firstOffset * firstWeight + secondOffset * secondWeight) / max(combinedWeight, 0.00001);
|
|
1896
|
+
|
|
1897
|
+
let positiveColor = bloomBlur_applySample(
|
|
1898
|
+
textureSample(sourceTexture, sourceTextureSampler, texCoord + adjustedDelta * combinedOffset)
|
|
1899
|
+
);
|
|
1900
|
+
let negativeColor = bloomBlur_applySample(
|
|
1901
|
+
textureSample(sourceTexture, sourceTextureSampler, texCoord - adjustedDelta * combinedOffset)
|
|
1902
|
+
);
|
|
1903
|
+
|
|
1904
|
+
color += (positiveColor + negativeColor) * combinedWeight;
|
|
1905
|
+
totalWeight += combinedWeight * 2.0;
|
|
1906
|
+
}
|
|
1907
|
+
|
|
1908
|
+
return color / totalWeight;
|
|
1909
|
+
}
|
|
1910
|
+
`;
|
|
1911
|
+
readonly fs: `
|
|
1912
|
+
#define BLOOM_BLUR_MAX_RADIUS 24.0
|
|
1913
|
+
#define BLOOM_BLUR_MAX_PAIRS ${number}
|
|
1914
|
+
|
|
1915
|
+
layout(std140) uniform bloomBlurUniforms {
|
|
1916
|
+
float radius;
|
|
1917
|
+
vec2 delta;
|
|
1918
|
+
} bloomBlur;
|
|
1919
|
+
|
|
1920
|
+
vec4 bloomBlur_applySample(vec4 color) {
|
|
1921
|
+
return color;
|
|
1922
|
+
}
|
|
1923
|
+
|
|
1924
|
+
float bloomBlur_getEffectiveRadius() {
|
|
1925
|
+
return clamp(bloomBlur.radius, 0.0, BLOOM_BLUR_MAX_RADIUS);
|
|
1926
|
+
}
|
|
1927
|
+
|
|
1928
|
+
float bloomBlur_getSigma(float radius) {
|
|
1929
|
+
return max(radius / 3.0, 0.00001);
|
|
1930
|
+
}
|
|
1931
|
+
|
|
1932
|
+
float bloomBlur_getWeight(float offset, float sigma) {
|
|
1933
|
+
float normalizedOffset = offset / sigma;
|
|
1934
|
+
return exp(-0.5 * normalizedOffset * normalizedOffset);
|
|
1935
|
+
}
|
|
1936
|
+
|
|
1937
|
+
vec4 bloomBlur_sampleColor(sampler2D sourceTexture, vec2 texSize, vec2 texCoord) {
|
|
1938
|
+
float effectiveRadius = bloomBlur_getEffectiveRadius();
|
|
1939
|
+
if (effectiveRadius <= 0.0) {
|
|
1940
|
+
return texture(sourceTexture, texCoord);
|
|
1941
|
+
}
|
|
1942
|
+
|
|
1943
|
+
vec2 adjustedDelta = bloomBlur.delta / texSize;
|
|
1944
|
+
float sigma = bloomBlur_getSigma(effectiveRadius);
|
|
1945
|
+
float centerWeight = bloomBlur_getWeight(0.0, sigma);
|
|
1946
|
+
|
|
1947
|
+
vec4 color = vec4(0.0);
|
|
1948
|
+
float totalWeight = centerWeight;
|
|
1949
|
+
|
|
1950
|
+
vec4 centerColor = bloomBlur_applySample(texture(sourceTexture, texCoord));
|
|
1951
|
+
color += centerColor * centerWeight;
|
|
1952
|
+
|
|
1953
|
+
for (int pairIndex = 0; pairIndex < BLOOM_BLUR_MAX_PAIRS; pairIndex++) {
|
|
1954
|
+
float firstOffset = float(pairIndex * 2 + 1);
|
|
1955
|
+
if (firstOffset > effectiveRadius) {
|
|
1956
|
+
continue;
|
|
1957
|
+
}
|
|
1958
|
+
|
|
1959
|
+
float secondOffset = firstOffset + 1.0;
|
|
1960
|
+
float firstWeight = bloomBlur_getWeight(firstOffset, sigma);
|
|
1961
|
+
float secondWeight = secondOffset <= effectiveRadius ? bloomBlur_getWeight(secondOffset, sigma) : 0.0;
|
|
1962
|
+
float combinedWeight = firstWeight + secondWeight;
|
|
1963
|
+
float combinedOffset =
|
|
1964
|
+
(firstOffset * firstWeight + secondOffset * secondWeight) / max(combinedWeight, 0.00001);
|
|
1965
|
+
|
|
1966
|
+
vec4 positiveColor = bloomBlur_applySample(texture(sourceTexture, texCoord + adjustedDelta * combinedOffset));
|
|
1967
|
+
vec4 negativeColor = bloomBlur_applySample(texture(sourceTexture, texCoord - adjustedDelta * combinedOffset));
|
|
1968
|
+
color += (positiveColor + negativeColor) * combinedWeight;
|
|
1969
|
+
totalWeight += combinedWeight * 2.0;
|
|
1970
|
+
}
|
|
1971
|
+
|
|
1972
|
+
color /= totalWeight;
|
|
1973
|
+
return color;
|
|
1974
|
+
}
|
|
1975
|
+
`;
|
|
1976
|
+
readonly uniformTypes: {
|
|
1977
|
+
readonly radius: "f32";
|
|
1978
|
+
readonly delta: "vec2<f32>";
|
|
1979
|
+
};
|
|
1980
|
+
readonly propTypes: {
|
|
1981
|
+
readonly radius: {
|
|
1982
|
+
readonly value: 8;
|
|
1983
|
+
readonly min: 0;
|
|
1984
|
+
readonly max: 24;
|
|
1985
|
+
readonly softMax: 24;
|
|
1986
|
+
};
|
|
1987
|
+
readonly delta: {
|
|
1988
|
+
readonly value: readonly [1, 0];
|
|
1989
|
+
readonly private: true;
|
|
1990
|
+
};
|
|
1991
|
+
};
|
|
1992
|
+
readonly passes: [{
|
|
1993
|
+
readonly sampler: true;
|
|
1994
|
+
}];
|
|
1995
|
+
};
|
|
1996
|
+
readonly inputs: {
|
|
1997
|
+
readonly sourceTexture: "extractQuarter";
|
|
1998
|
+
};
|
|
1999
|
+
readonly output: "blurQuarterScratch";
|
|
2000
|
+
readonly uniforms: {
|
|
2001
|
+
readonly radius: 8;
|
|
2002
|
+
readonly delta: [1, 0];
|
|
2003
|
+
};
|
|
2004
|
+
}, {
|
|
2005
|
+
readonly kind: "fullscreen";
|
|
2006
|
+
readonly shaderPass: {
|
|
2007
|
+
readonly name: "bloomBlur";
|
|
2008
|
+
readonly source: `
|
|
2009
|
+
const BLOOM_BLUR_MAX_RADIUS = 24.0;
|
|
2010
|
+
const BLOOM_BLUR_MAX_PAIRS = ${number};
|
|
2011
|
+
|
|
2012
|
+
struct bloomBlurUniforms {
|
|
2013
|
+
radius: f32,
|
|
2014
|
+
delta: vec2f,
|
|
2015
|
+
};
|
|
2016
|
+
|
|
2017
|
+
@group(0) @binding(auto) var<uniform> bloomBlur: bloomBlurUniforms;
|
|
2018
|
+
|
|
2019
|
+
fn bloomBlur_applySample(color: vec4f) -> vec4f {
|
|
2020
|
+
return color;
|
|
2021
|
+
}
|
|
2022
|
+
|
|
2023
|
+
fn bloomBlur_getEffectiveRadius() -> f32 {
|
|
2024
|
+
return clamp(bloomBlur.radius, 0.0, BLOOM_BLUR_MAX_RADIUS);
|
|
2025
|
+
}
|
|
2026
|
+
|
|
2027
|
+
fn bloomBlur_getSigma(radius: f32) -> f32 {
|
|
2028
|
+
return max(radius / 3.0, 0.00001);
|
|
2029
|
+
}
|
|
2030
|
+
|
|
2031
|
+
fn bloomBlur_getWeight(offset: f32, sigma: f32) -> f32 {
|
|
2032
|
+
let normalizedOffset = offset / sigma;
|
|
2033
|
+
return exp(-0.5 * normalizedOffset * normalizedOffset);
|
|
2034
|
+
}
|
|
2035
|
+
|
|
2036
|
+
fn bloomBlur_sampleColor(
|
|
2037
|
+
sourceTexture: texture_2d<f32>,
|
|
2038
|
+
sourceTextureSampler: sampler,
|
|
2039
|
+
texSize: vec2f,
|
|
2040
|
+
texCoord: vec2f
|
|
2041
|
+
) -> vec4f {
|
|
2042
|
+
let effectiveRadius = bloomBlur_getEffectiveRadius();
|
|
2043
|
+
if (effectiveRadius <= 0.0) {
|
|
2044
|
+
return textureSample(sourceTexture, sourceTextureSampler, texCoord);
|
|
2045
|
+
}
|
|
2046
|
+
|
|
2047
|
+
let adjustedDelta = bloomBlur.delta / texSize;
|
|
2048
|
+
let sigma = bloomBlur_getSigma(effectiveRadius);
|
|
2049
|
+
let centerWeight = bloomBlur_getWeight(0.0, sigma);
|
|
2050
|
+
|
|
2051
|
+
var color = vec4f(0.0);
|
|
2052
|
+
var totalWeight = centerWeight;
|
|
2053
|
+
|
|
2054
|
+
let centerColor = bloomBlur_applySample(
|
|
2055
|
+
textureSample(sourceTexture, sourceTextureSampler, texCoord)
|
|
2056
|
+
);
|
|
2057
|
+
color += centerColor * centerWeight;
|
|
2058
|
+
|
|
2059
|
+
for (var pairIndex = 0; pairIndex < BLOOM_BLUR_MAX_PAIRS; pairIndex += 1) {
|
|
2060
|
+
let firstOffset = f32(pairIndex * 2 + 1);
|
|
2061
|
+
if (firstOffset > effectiveRadius) {
|
|
2062
|
+
continue;
|
|
2063
|
+
}
|
|
2064
|
+
|
|
2065
|
+
let secondOffset = firstOffset + 1.0;
|
|
2066
|
+
let firstWeight = bloomBlur_getWeight(firstOffset, sigma);
|
|
2067
|
+
let secondWeight =
|
|
2068
|
+
select(0.0, bloomBlur_getWeight(secondOffset, sigma), secondOffset <= effectiveRadius);
|
|
2069
|
+
let combinedWeight = firstWeight + secondWeight;
|
|
2070
|
+
let combinedOffset =
|
|
2071
|
+
(firstOffset * firstWeight + secondOffset * secondWeight) / max(combinedWeight, 0.00001);
|
|
2072
|
+
|
|
2073
|
+
let positiveColor = bloomBlur_applySample(
|
|
2074
|
+
textureSample(sourceTexture, sourceTextureSampler, texCoord + adjustedDelta * combinedOffset)
|
|
2075
|
+
);
|
|
2076
|
+
let negativeColor = bloomBlur_applySample(
|
|
2077
|
+
textureSample(sourceTexture, sourceTextureSampler, texCoord - adjustedDelta * combinedOffset)
|
|
2078
|
+
);
|
|
2079
|
+
|
|
2080
|
+
color += (positiveColor + negativeColor) * combinedWeight;
|
|
2081
|
+
totalWeight += combinedWeight * 2.0;
|
|
2082
|
+
}
|
|
2083
|
+
|
|
2084
|
+
return color / totalWeight;
|
|
2085
|
+
}
|
|
2086
|
+
`;
|
|
2087
|
+
readonly fs: `
|
|
2088
|
+
#define BLOOM_BLUR_MAX_RADIUS 24.0
|
|
2089
|
+
#define BLOOM_BLUR_MAX_PAIRS ${number}
|
|
2090
|
+
|
|
2091
|
+
layout(std140) uniform bloomBlurUniforms {
|
|
2092
|
+
float radius;
|
|
2093
|
+
vec2 delta;
|
|
2094
|
+
} bloomBlur;
|
|
2095
|
+
|
|
2096
|
+
vec4 bloomBlur_applySample(vec4 color) {
|
|
2097
|
+
return color;
|
|
2098
|
+
}
|
|
2099
|
+
|
|
2100
|
+
float bloomBlur_getEffectiveRadius() {
|
|
2101
|
+
return clamp(bloomBlur.radius, 0.0, BLOOM_BLUR_MAX_RADIUS);
|
|
2102
|
+
}
|
|
2103
|
+
|
|
2104
|
+
float bloomBlur_getSigma(float radius) {
|
|
2105
|
+
return max(radius / 3.0, 0.00001);
|
|
2106
|
+
}
|
|
2107
|
+
|
|
2108
|
+
float bloomBlur_getWeight(float offset, float sigma) {
|
|
2109
|
+
float normalizedOffset = offset / sigma;
|
|
2110
|
+
return exp(-0.5 * normalizedOffset * normalizedOffset);
|
|
2111
|
+
}
|
|
2112
|
+
|
|
2113
|
+
vec4 bloomBlur_sampleColor(sampler2D sourceTexture, vec2 texSize, vec2 texCoord) {
|
|
2114
|
+
float effectiveRadius = bloomBlur_getEffectiveRadius();
|
|
2115
|
+
if (effectiveRadius <= 0.0) {
|
|
2116
|
+
return texture(sourceTexture, texCoord);
|
|
2117
|
+
}
|
|
2118
|
+
|
|
2119
|
+
vec2 adjustedDelta = bloomBlur.delta / texSize;
|
|
2120
|
+
float sigma = bloomBlur_getSigma(effectiveRadius);
|
|
2121
|
+
float centerWeight = bloomBlur_getWeight(0.0, sigma);
|
|
2122
|
+
|
|
2123
|
+
vec4 color = vec4(0.0);
|
|
2124
|
+
float totalWeight = centerWeight;
|
|
2125
|
+
|
|
2126
|
+
vec4 centerColor = bloomBlur_applySample(texture(sourceTexture, texCoord));
|
|
2127
|
+
color += centerColor * centerWeight;
|
|
2128
|
+
|
|
2129
|
+
for (int pairIndex = 0; pairIndex < BLOOM_BLUR_MAX_PAIRS; pairIndex++) {
|
|
2130
|
+
float firstOffset = float(pairIndex * 2 + 1);
|
|
2131
|
+
if (firstOffset > effectiveRadius) {
|
|
2132
|
+
continue;
|
|
2133
|
+
}
|
|
2134
|
+
|
|
2135
|
+
float secondOffset = firstOffset + 1.0;
|
|
2136
|
+
float firstWeight = bloomBlur_getWeight(firstOffset, sigma);
|
|
2137
|
+
float secondWeight = secondOffset <= effectiveRadius ? bloomBlur_getWeight(secondOffset, sigma) : 0.0;
|
|
2138
|
+
float combinedWeight = firstWeight + secondWeight;
|
|
2139
|
+
float combinedOffset =
|
|
2140
|
+
(firstOffset * firstWeight + secondOffset * secondWeight) / max(combinedWeight, 0.00001);
|
|
2141
|
+
|
|
2142
|
+
vec4 positiveColor = bloomBlur_applySample(texture(sourceTexture, texCoord + adjustedDelta * combinedOffset));
|
|
2143
|
+
vec4 negativeColor = bloomBlur_applySample(texture(sourceTexture, texCoord - adjustedDelta * combinedOffset));
|
|
2144
|
+
color += (positiveColor + negativeColor) * combinedWeight;
|
|
2145
|
+
totalWeight += combinedWeight * 2.0;
|
|
2146
|
+
}
|
|
2147
|
+
|
|
2148
|
+
color /= totalWeight;
|
|
2149
|
+
return color;
|
|
2150
|
+
}
|
|
2151
|
+
`;
|
|
2152
|
+
readonly uniformTypes: {
|
|
2153
|
+
readonly radius: "f32";
|
|
2154
|
+
readonly delta: "vec2<f32>";
|
|
2155
|
+
};
|
|
2156
|
+
readonly propTypes: {
|
|
2157
|
+
readonly radius: {
|
|
2158
|
+
readonly value: 8;
|
|
2159
|
+
readonly min: 0;
|
|
2160
|
+
readonly max: 24;
|
|
2161
|
+
readonly softMax: 24;
|
|
2162
|
+
};
|
|
2163
|
+
readonly delta: {
|
|
2164
|
+
readonly value: readonly [1, 0];
|
|
2165
|
+
readonly private: true;
|
|
2166
|
+
};
|
|
2167
|
+
};
|
|
2168
|
+
readonly passes: [{
|
|
2169
|
+
readonly sampler: true;
|
|
2170
|
+
}];
|
|
2171
|
+
};
|
|
2172
|
+
readonly inputs: {
|
|
2173
|
+
readonly sourceTexture: "blurQuarterScratch";
|
|
2174
|
+
};
|
|
2175
|
+
readonly output: "blurQuarter";
|
|
2176
|
+
readonly uniforms: {
|
|
2177
|
+
readonly radius: 8;
|
|
2178
|
+
readonly delta: [0, 1];
|
|
2179
|
+
};
|
|
2180
|
+
}, {
|
|
2181
|
+
readonly kind: "fullscreen";
|
|
2182
|
+
readonly shaderPass: {
|
|
2183
|
+
readonly name: "bloomUpsample";
|
|
2184
|
+
readonly source: "\nstruct bloomUpsampleUniforms {\n scatter: f32,\n reconstruction: f32,\n};\n\n@group(0) @binding(auto) var<uniform> bloomUpsample: bloomUpsampleUniforms;\n@group(0) @binding(auto) var higherResolutionGlow: texture_2d<f32>;\n@group(0) @binding(auto) var higherResolutionGlowSampler: sampler;\n\nfn bloomUpsample_sampleLowerGlow(\n sourceTexture: texture_2d<f32>,\n sourceTextureSampler: sampler,\n texCoord: vec2f\n) -> vec4f {\n let texel = 1.0 / vec2f(textureDimensions(sourceTexture));\n let horizontalOffset = vec2f(texel.x, 0.0);\n let verticalOffset = vec2f(0.0, texel.y);\n let center = textureSample(sourceTexture, sourceTextureSampler, texCoord) * 4.0;\n let edges = (\n textureSample(sourceTexture, sourceTextureSampler, texCoord - horizontalOffset) +\n textureSample(sourceTexture, sourceTextureSampler, texCoord + horizontalOffset) +\n textureSample(sourceTexture, sourceTextureSampler, texCoord - verticalOffset) +\n textureSample(sourceTexture, sourceTextureSampler, texCoord + verticalOffset)\n ) * 2.0;\n let corners =\n textureSample(sourceTexture, sourceTextureSampler, texCoord - horizontalOffset - verticalOffset) +\n textureSample(sourceTexture, sourceTextureSampler, texCoord + horizontalOffset - verticalOffset) +\n textureSample(sourceTexture, sourceTextureSampler, texCoord - horizontalOffset + verticalOffset) +\n textureSample(sourceTexture, sourceTextureSampler, texCoord + horizontalOffset + verticalOffset);\n return (center + edges + corners) / 16.0;\n}\n\nfn bloomUpsample_sampleBicubicGlow(\n sourceTexture: texture_2d<f32>,\n sourceTextureSampler: sampler,\n texCoord: vec2f\n) -> vec4f {\n let dimensions = vec2f(textureDimensions(sourceTexture));\n let texelPosition = texCoord * dimensions - vec2f(0.5);\n let basePosition = floor(texelPosition);\n let fraction = fract(texelPosition);\n let complement = vec2f(1.0) - fraction;\n let firstWeight = complement * complement * complement / 6.0;\n let secondWeight =\n (fraction * fraction * fraction * 3.0 - fraction * fraction * 6.0 + vec2f(4.0)) / 6.0;\n let thirdWeight =\n (-fraction * fraction * fraction * 3.0 + fraction * fraction * 3.0 + fraction * 3.0 +\n vec2f(1.0)) / 6.0;\n let fourthWeight = fraction * fraction * fraction / 6.0;\n let firstPairWeight = firstWeight + secondWeight;\n let secondPairWeight = thirdWeight + fourthWeight;\n let firstPosition =\n (basePosition - vec2f(1.0) + secondWeight / firstPairWeight + vec2f(0.5)) / dimensions;\n let secondPosition =\n (basePosition + vec2f(1.0) + fourthWeight / secondPairWeight + vec2f(0.5)) / dimensions;\n let topLeft = textureSampleLevel(\n sourceTexture,\n sourceTextureSampler,\n vec2f(firstPosition.x, firstPosition.y),\n 0.0\n );\n let topRight = textureSampleLevel(\n sourceTexture,\n sourceTextureSampler,\n vec2f(secondPosition.x, firstPosition.y),\n 0.0\n );\n let bottomLeft = textureSampleLevel(\n sourceTexture,\n sourceTextureSampler,\n vec2f(firstPosition.x, secondPosition.y),\n 0.0\n );\n let bottomRight = textureSampleLevel(\n sourceTexture,\n sourceTextureSampler,\n vec2f(secondPosition.x, secondPosition.y),\n 0.0\n );\n return topLeft * firstPairWeight.x * firstPairWeight.y +\n topRight * secondPairWeight.x * firstPairWeight.y +\n bottomLeft * firstPairWeight.x * secondPairWeight.y +\n bottomRight * secondPairWeight.x * secondPairWeight.y;\n}\n\nfn bloomUpsample_sampleColor(\n sourceTexture: texture_2d<f32>,\n sourceTextureSampler: sampler,\n texSize: vec2f,\n texCoord: vec2f\n) -> vec4f {\n var lowerGlow: vec4f;\n if (bloomUpsample.reconstruction > 0.5) {\n lowerGlow = bloomUpsample_sampleBicubicGlow(sourceTexture, sourceTextureSampler, texCoord);\n } else {\n lowerGlow = bloomUpsample_sampleLowerGlow(sourceTexture, sourceTextureSampler, texCoord);\n }\n let higherGlow = textureSample(higherResolutionGlow, higherResolutionGlowSampler, texCoord);\n return mix(higherGlow, lowerGlow, clamp(bloomUpsample.scatter, 0.0, 1.0));\n}\n";
|
|
2185
|
+
readonly fs: "\nlayout(std140) uniform bloomUpsampleUniforms {\n float scatter;\n float reconstruction;\n} bloomUpsample;\n\nuniform sampler2D higherResolutionGlow;\n\nvec4 bloomUpsample_sampleLowerGlow(sampler2D sourceTexture, vec2 texCoord) {\n vec2 texel = 1.0 / vec2(textureSize(sourceTexture, 0));\n vec2 horizontalOffset = vec2(texel.x, 0.0);\n vec2 verticalOffset = vec2(0.0, texel.y);\n vec4 center = texture(sourceTexture, texCoord) * 4.0;\n vec4 edges = (\n texture(sourceTexture, texCoord - horizontalOffset) +\n texture(sourceTexture, texCoord + horizontalOffset) +\n texture(sourceTexture, texCoord - verticalOffset) +\n texture(sourceTexture, texCoord + verticalOffset)\n ) * 2.0;\n vec4 corners =\n texture(sourceTexture, texCoord - horizontalOffset - verticalOffset) +\n texture(sourceTexture, texCoord + horizontalOffset - verticalOffset) +\n texture(sourceTexture, texCoord - horizontalOffset + verticalOffset) +\n texture(sourceTexture, texCoord + horizontalOffset + verticalOffset);\n return (center + edges + corners) / 16.0;\n}\n\nvec4 bloomUpsample_sampleBicubicGlow(sampler2D sourceTexture, vec2 texCoord) {\n vec2 dimensions = vec2(textureSize(sourceTexture, 0));\n vec2 texelPosition = texCoord * dimensions - vec2(0.5);\n vec2 basePosition = floor(texelPosition);\n vec2 fraction = fract(texelPosition);\n vec2 complement = vec2(1.0) - fraction;\n vec2 firstWeight = complement * complement * complement / 6.0;\n vec2 secondWeight =\n (fraction * fraction * fraction * 3.0 - fraction * fraction * 6.0 + vec2(4.0)) / 6.0;\n vec2 thirdWeight =\n (-fraction * fraction * fraction * 3.0 + fraction * fraction * 3.0 + fraction * 3.0 +\n vec2(1.0)) / 6.0;\n vec2 fourthWeight = fraction * fraction * fraction / 6.0;\n vec2 firstPairWeight = firstWeight + secondWeight;\n vec2 secondPairWeight = thirdWeight + fourthWeight;\n vec2 firstPosition =\n (basePosition - vec2(1.0) + secondWeight / firstPairWeight + vec2(0.5)) / dimensions;\n vec2 secondPosition =\n (basePosition + vec2(1.0) + fourthWeight / secondPairWeight + vec2(0.5)) / dimensions;\n vec4 topLeft = textureLod(sourceTexture, vec2(firstPosition.x, firstPosition.y), 0.0);\n vec4 topRight = textureLod(sourceTexture, vec2(secondPosition.x, firstPosition.y), 0.0);\n vec4 bottomLeft = textureLod(sourceTexture, vec2(firstPosition.x, secondPosition.y), 0.0);\n vec4 bottomRight = textureLod(sourceTexture, vec2(secondPosition.x, secondPosition.y), 0.0);\n return topLeft * firstPairWeight.x * firstPairWeight.y +\n topRight * secondPairWeight.x * firstPairWeight.y +\n bottomLeft * firstPairWeight.x * secondPairWeight.y +\n bottomRight * secondPairWeight.x * secondPairWeight.y;\n}\n\nvec4 bloomUpsample_sampleColor(sampler2D sourceTexture, vec2 texSize, vec2 texCoord) {\n vec4 lowerGlow;\n if (bloomUpsample.reconstruction > 0.5) {\n lowerGlow = bloomUpsample_sampleBicubicGlow(sourceTexture, texCoord);\n } else {\n lowerGlow = bloomUpsample_sampleLowerGlow(sourceTexture, texCoord);\n }\n vec4 higherGlow = texture(higherResolutionGlow, texCoord);\n return mix(higherGlow, lowerGlow, clamp(bloomUpsample.scatter, 0.0, 1.0));\n}\n";
|
|
2186
|
+
readonly bindingLayout: readonly [{
|
|
2187
|
+
readonly name: "higherResolutionGlow";
|
|
2188
|
+
readonly group: 0;
|
|
2189
|
+
}];
|
|
2190
|
+
readonly uniforms: {
|
|
2191
|
+
scatter?: number;
|
|
2192
|
+
reconstruction?: number;
|
|
2193
|
+
};
|
|
2194
|
+
readonly bindings: BloomUpsampleBindings;
|
|
2195
|
+
readonly uniformTypes: {
|
|
2196
|
+
readonly scatter: "f32";
|
|
2197
|
+
readonly reconstruction: "f32";
|
|
2198
|
+
};
|
|
2199
|
+
readonly defaultUniforms: {
|
|
2200
|
+
readonly scatter: 0.55;
|
|
2201
|
+
readonly reconstruction: 0;
|
|
2202
|
+
};
|
|
2203
|
+
readonly propTypes: {
|
|
2204
|
+
readonly scatter: {
|
|
2205
|
+
readonly value: 0.55;
|
|
2206
|
+
readonly min: 0;
|
|
2207
|
+
readonly max: 1;
|
|
2208
|
+
};
|
|
2209
|
+
readonly reconstruction: {
|
|
2210
|
+
readonly value: 0;
|
|
2211
|
+
readonly min: 0;
|
|
2212
|
+
readonly max: 1;
|
|
2213
|
+
readonly private: true;
|
|
2214
|
+
};
|
|
2215
|
+
};
|
|
2216
|
+
readonly passes: [{
|
|
2217
|
+
readonly sampler: true;
|
|
2218
|
+
}];
|
|
2219
|
+
};
|
|
2220
|
+
readonly inputs: {
|
|
2221
|
+
readonly sourceTexture: "blurQuarter";
|
|
2222
|
+
readonly higherResolutionGlow: "blurHalf";
|
|
2223
|
+
};
|
|
2224
|
+
readonly output: "glow";
|
|
2225
|
+
readonly uniforms: {
|
|
2226
|
+
readonly scatter: 0.55;
|
|
2227
|
+
readonly reconstruction: 0;
|
|
2228
|
+
};
|
|
2229
|
+
}, {
|
|
2230
|
+
readonly kind: "fullscreen";
|
|
2231
|
+
readonly shaderPass: {
|
|
2232
|
+
readonly name: "bloomComposite";
|
|
2233
|
+
readonly source: "\nstruct bloomCompositeUniforms {\n tint: vec3f,\n intensity: f32,\n energyConserving: f32,\n};\n\n@group(0) @binding(auto) var<uniform> bloomComposite: bloomCompositeUniforms;\n@group(0) @binding(auto) var glowTexture: texture_2d<f32>;\n@group(0) @binding(auto) var glowTextureSampler: sampler;\n\nfn bloomComposite_sampleColor(\n sourceTexture: texture_2d<f32>,\n sourceTextureSampler: sampler,\n texSize: vec2f,\n texCoord: vec2f\n) -> vec4f {\n let sourceColor = textureSample(sourceTexture, sourceTextureSampler, texCoord);\n let glowColor = textureSample(glowTexture, glowTextureSampler, texCoord).rgb;\n let tintedGlow = glowColor * bloomComposite.tint * bloomComposite.intensity;\n let additiveColor = sourceColor.rgb + tintedGlow;\n let physicalColor = mix(\n sourceColor.rgb,\n glowColor * bloomComposite.tint,\n clamp(bloomComposite.intensity, 0.0, 1.0)\n );\n return vec4f(\n select(additiveColor, physicalColor, bloomComposite.energyConserving > 0.5),\n sourceColor.a\n );\n}\n";
|
|
2234
|
+
readonly fs: "\nlayout(std140) uniform bloomCompositeUniforms {\n vec3 tint;\n float intensity;\n float energyConserving;\n} bloomComposite;\n\nuniform sampler2D glowTexture;\n\nvec4 bloomComposite_sampleColor(sampler2D sourceTexture, vec2 texSize, vec2 texCoord) {\n vec4 sourceColor = texture(sourceTexture, texCoord);\n vec3 glowColor = texture(glowTexture, texCoord).rgb;\n vec3 tintedGlow = glowColor * bloomComposite.tint * bloomComposite.intensity;\n vec3 additiveColor = sourceColor.rgb + tintedGlow;\n vec3 physicalColor = mix(\n sourceColor.rgb,\n glowColor * bloomComposite.tint,\n clamp(bloomComposite.intensity, 0.0, 1.0)\n );\n return vec4(\n bloomComposite.energyConserving > 0.5 ? physicalColor : additiveColor,\n sourceColor.a\n );\n}\n";
|
|
2235
|
+
readonly bindingLayout: readonly [{
|
|
2236
|
+
readonly name: "glowTexture";
|
|
2237
|
+
readonly group: 0;
|
|
2238
|
+
}];
|
|
2239
|
+
readonly uniforms: BloomAdaptiveCompositeUniforms;
|
|
2240
|
+
readonly bindings: BloomAdaptiveCompositeBindings;
|
|
2241
|
+
readonly uniformTypes: {
|
|
2242
|
+
readonly tint: "vec3<f32>";
|
|
2243
|
+
readonly intensity: "f32";
|
|
2244
|
+
readonly energyConserving: "f32";
|
|
2245
|
+
};
|
|
2246
|
+
readonly defaultUniforms: {
|
|
2247
|
+
readonly tint: [number, number, number];
|
|
2248
|
+
readonly intensity: 1;
|
|
2249
|
+
readonly energyConserving: 0;
|
|
2250
|
+
};
|
|
2251
|
+
readonly propTypes: {
|
|
2252
|
+
readonly tint: {
|
|
2253
|
+
readonly value: [number, number, number];
|
|
2254
|
+
};
|
|
2255
|
+
readonly intensity: {
|
|
2256
|
+
readonly value: 1;
|
|
2257
|
+
readonly min: 0;
|
|
2258
|
+
readonly softMax: 3;
|
|
2259
|
+
};
|
|
2260
|
+
readonly energyConserving: {
|
|
2261
|
+
readonly value: 0;
|
|
2262
|
+
readonly min: 0;
|
|
2263
|
+
readonly max: 1;
|
|
2264
|
+
readonly private: true;
|
|
2265
|
+
};
|
|
2266
|
+
};
|
|
2267
|
+
readonly passes: [{
|
|
2268
|
+
readonly sampler: true;
|
|
2269
|
+
}];
|
|
2270
|
+
};
|
|
2271
|
+
readonly inputs: {
|
|
2272
|
+
readonly sourceTexture: "previous";
|
|
2273
|
+
readonly glowTexture: "glow";
|
|
2274
|
+
};
|
|
2275
|
+
readonly output: "previous";
|
|
2276
|
+
readonly uniforms: {
|
|
2277
|
+
readonly intensity: 1;
|
|
2278
|
+
readonly tint: [1, 1, 1];
|
|
2279
|
+
readonly energyConserving: 0;
|
|
2280
|
+
};
|
|
2281
|
+
}];
|
|
2282
|
+
};
|
|
2283
|
+
/**
|
|
2284
|
+
* Configurable multiscale HDR bloom. Settings select level count, reconstruction,
|
|
2285
|
+
* optional history and lens stages, and the initial compute or fragment path.
|
|
2286
|
+
*/
|
|
2287
|
+
export declare const hdrBloom: {
|
|
2288
|
+
readonly name: "bloomCompositeShaderPass";
|
|
2289
|
+
readonly configure: (options?: BloomCompositeShaderPassOptions | undefined) => {
|
|
2290
|
+
name: "bloomCompositeShaderPass";
|
|
2291
|
+
resources: Record<string, ShaderPassRenderTarget>;
|
|
2292
|
+
initialPasses: {
|
|
2293
|
+
compute?: import("@luma.gl/shaders").CompositeShaderPassComputeOptimization<"extractHalf" | "extractQuarter" | "extractEighth" | "extractSixteenth" | "extractThirtySecond"> | undefined;
|
|
2294
|
+
fragment: EffectPass[];
|
|
2295
|
+
};
|
|
2296
|
+
passes: EffectPass[];
|
|
2297
|
+
};
|
|
2298
|
+
};
|
|
1313
2299
|
//# sourceMappingURL=bloom-composite-shader-pass.d.ts.map
|