@luma.gl/engine 10.0.0-beta.4 → 10.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD-PARTY-NOTICES.md +82 -0
- package/dist/animation/animation-track.d.ts +7 -0
- package/dist/animation/animation-track.d.ts.map +1 -1
- package/dist/animation/animation-track.js.map +1 -1
- package/dist/animation/node-animation-binding.cjs +1 -0
- package/dist/animation/node-animation-binding.d.ts +2 -1
- package/dist/animation/node-animation-binding.d.ts.map +1 -1
- package/dist/animation/node-animation-binding.js +6 -0
- package/dist/animation/node-animation-binding.js.map +1 -1
- package/dist/animation/scenegraph-gpu-animation-layout.cjs +99 -0
- package/dist/animation/scenegraph-gpu-animation-layout.d.ts +69 -0
- package/dist/animation/scenegraph-gpu-animation-layout.d.ts.map +1 -0
- package/dist/animation/scenegraph-gpu-animation-layout.js +90 -0
- package/dist/animation/scenegraph-gpu-animation-layout.js.map +1 -0
- package/dist/animation/scenegraph-gpu-animation.cjs +281 -0
- package/dist/animation/scenegraph-gpu-animation.d.ts +54 -0
- package/dist/animation/scenegraph-gpu-animation.d.ts.map +1 -0
- package/dist/animation/scenegraph-gpu-animation.js +274 -0
- package/dist/animation/scenegraph-gpu-animation.js.map +1 -0
- package/dist/arrow/arrow-picking.cjs +4 -3
- package/dist/arrow/arrow-picking.d.ts +15 -5
- package/dist/arrow/arrow-picking.d.ts.map +1 -1
- package/dist/arrow/arrow-picking.js +16 -5
- package/dist/arrow/arrow-picking.js.map +1 -1
- package/dist/arrow/index.cjs.map +1 -1
- package/dist/audio/audio-controller.cjs +6 -2
- package/dist/audio/audio-controller.d.ts.map +1 -1
- package/dist/audio/audio-controller.js +6 -2
- package/dist/audio/audio-controller.js.map +1 -1
- package/dist/audio/audio-graph.cjs +26 -2
- package/dist/audio/audio-graph.d.ts +9 -0
- package/dist/audio/audio-graph.d.ts.map +1 -1
- package/dist/audio/audio-graph.js +35 -10
- package/dist/audio/audio-graph.js.map +1 -1
- package/dist/dist.dev.js +1689 -1094
- package/dist/dist.min.js +69 -70
- package/dist/effects/glfx-effects.cjs +261 -0
- package/dist/effects/glfx-effects.d.ts +959 -0
- package/dist/effects/glfx-effects.d.ts.map +1 -0
- package/dist/effects/glfx-effects.js +200 -0
- package/dist/effects/glfx-effects.js.map +1 -0
- package/dist/effects/graph/gpu-effect-operation.cjs +402 -0
- package/dist/effects/graph/gpu-effect-operation.d.ts +101 -0
- package/dist/effects/graph/gpu-effect-operation.d.ts.map +1 -0
- package/dist/effects/graph/gpu-effect-operation.js +410 -0
- package/dist/effects/graph/gpu-effect-operation.js.map +1 -0
- package/dist/effects/graph/temporal-graph-history.cjs +48 -0
- package/dist/effects/graph/temporal-graph-history.d.ts +17 -0
- package/dist/effects/graph/temporal-graph-history.d.ts.map +1 -0
- package/dist/effects/graph/temporal-graph-history.js +30 -0
- package/dist/effects/graph/temporal-graph-history.js.map +1 -0
- package/dist/effects/index.cjs +117 -30
- package/dist/effects/index.cjs.map +3 -3
- package/dist/effects/index.d.ts +34 -18
- package/dist/effects/index.d.ts.map +1 -1
- package/dist/effects/index.js +31 -18
- package/dist/effects/index.js.map +1 -1
- package/dist/effects/passes/postprocessing/fxaa/fxaa.cjs +9 -2
- package/dist/effects/passes/postprocessing/fxaa/fxaa.d.ts +19 -0
- package/dist/effects/passes/postprocessing/fxaa/fxaa.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/fxaa/fxaa.js +6 -0
- package/dist/effects/passes/postprocessing/fxaa/fxaa.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/tone-mapping.cjs +9 -2
- package/dist/effects/passes/postprocessing/image-adjust-filters/tone-mapping.d.ts +41 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/tone-mapping.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/tone-mapping.js +6 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/tone-mapping.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-composite-shader-pass.cjs +200 -13
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-composite-shader-pass.d.ts +992 -6
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-composite-shader-pass.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-composite-shader-pass.js +199 -10
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-composite-shader-pass.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-compute-pyramid.d.ts +3 -3
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-compute-pyramid.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-compute-pyramid.js.map +1 -1
- package/dist/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.cjs +41 -40
- package/dist/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.d.ts +116 -8
- package/dist/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.js +38 -37
- package/dist/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.js.map +1 -1
- package/dist/effects/passes/screen-space/clustered-volumetric-lighting.cjs +83 -66
- package/dist/effects/passes/screen-space/clustered-volumetric-lighting.d.ts +470 -2
- package/dist/effects/passes/screen-space/clustered-volumetric-lighting.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/clustered-volumetric-lighting.js +80 -62
- package/dist/effects/passes/screen-space/clustered-volumetric-lighting.js.map +1 -1
- package/dist/effects/passes/screen-space/copy-pass.cjs +7 -0
- package/dist/effects/passes/screen-space/copy-pass.d.ts +1 -0
- package/dist/effects/passes/screen-space/copy-pass.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/copy-pass.js +4 -0
- package/dist/effects/passes/screen-space/copy-pass.js.map +1 -1
- package/dist/effects/passes/screen-space/depth-aware-blur.cjs +14 -5
- package/dist/effects/passes/screen-space/depth-aware-blur.d.ts +125 -17
- package/dist/effects/passes/screen-space/depth-aware-blur.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/depth-aware-blur.js +11 -3
- package/dist/effects/passes/screen-space/depth-aware-blur.js.map +1 -1
- package/dist/effects/passes/screen-space/dof.cjs +19 -3
- package/dist/effects/passes/screen-space/dof.d.ts +181 -0
- package/dist/effects/passes/screen-space/dof.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/dof.js +17 -3
- package/dist/effects/passes/screen-space/dof.js.map +1 -1
- package/dist/effects/passes/screen-space/gtao.cjs +82 -62
- package/dist/effects/passes/screen-space/gtao.d.ts +608 -3
- package/dist/effects/passes/screen-space/gtao.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/gtao.js +83 -60
- package/dist/effects/passes/screen-space/gtao.js.map +1 -1
- package/dist/effects/passes/screen-space/hdr-auto-exposure.cjs +103 -79
- package/dist/effects/passes/screen-space/hdr-auto-exposure.d.ts +225 -3
- package/dist/effects/passes/screen-space/hdr-auto-exposure.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/hdr-auto-exposure.js +102 -77
- package/dist/effects/passes/screen-space/hdr-auto-exposure.js.map +1 -1
- package/dist/effects/passes/screen-space/height-fog.cjs +14 -0
- package/dist/effects/passes/screen-space/height-fog.d.ts +71 -0
- package/dist/effects/passes/screen-space/height-fog.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/height-fog.js +16 -3
- package/dist/effects/passes/screen-space/height-fog.js.map +1 -1
- package/dist/effects/passes/screen-space/motion-blur.cjs +7 -8
- package/dist/effects/passes/screen-space/motion-blur.d.ts +41 -2
- package/dist/effects/passes/screen-space/motion-blur.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/motion-blur.js +6 -6
- package/dist/effects/passes/screen-space/motion-blur.js.map +1 -1
- package/dist/effects/passes/screen-space/outlines.cjs +143 -18
- package/dist/effects/passes/screen-space/outlines.d.ts +162 -3
- package/dist/effects/passes/screen-space/outlines.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/outlines.js +137 -15
- package/dist/effects/passes/screen-space/outlines.js.map +1 -1
- package/dist/effects/passes/screen-space/screen-space-global-illumination.cjs +70 -61
- package/dist/effects/passes/screen-space/screen-space-global-illumination.d.ts +309 -2
- package/dist/effects/passes/screen-space/screen-space-global-illumination.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/screen-space-global-illumination.js +69 -59
- package/dist/effects/passes/screen-space/screen-space-global-illumination.js.map +1 -1
- package/dist/effects/passes/screen-space/screen-space-reflections.cjs +151 -83
- package/dist/effects/passes/screen-space/screen-space-reflections.d.ts +778 -7
- package/dist/effects/passes/screen-space/screen-space-reflections.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/screen-space-reflections.js +148 -79
- package/dist/effects/passes/screen-space/screen-space-reflections.js.map +1 -1
- package/dist/effects/passes/screen-space/selection-outline.cjs +12 -2
- package/dist/effects/passes/screen-space/selection-outline.d.ts +44 -0
- package/dist/effects/passes/screen-space/selection-outline.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/selection-outline.js +9 -0
- package/dist/effects/passes/screen-space/selection-outline.js.map +1 -1
- package/dist/effects/passes/screen-space/ssao.cjs +69 -44
- package/dist/effects/passes/screen-space/ssao.d.ts +648 -3
- package/dist/effects/passes/screen-space/ssao.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/ssao.js +67 -42
- package/dist/effects/passes/screen-space/ssao.js.map +1 -1
- package/dist/effects/passes/screen-space/temporal-antialiasing.cjs +42 -30
- package/dist/effects/passes/screen-space/temporal-antialiasing.d.ts +107 -6
- package/dist/effects/passes/screen-space/temporal-antialiasing.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/temporal-antialiasing.js +40 -27
- package/dist/effects/passes/screen-space/temporal-antialiasing.js.map +1 -1
- package/dist/effects/passes/screen-space/temporal-frame.cjs +34 -0
- package/dist/effects/passes/screen-space/temporal-frame.d.ts +23 -0
- package/dist/effects/passes/screen-space/temporal-frame.d.ts.map +1 -0
- package/dist/effects/passes/screen-space/temporal-frame.js +16 -0
- package/dist/effects/passes/screen-space/temporal-frame.js.map +1 -0
- package/dist/effects/passes/screen-space/volumetric-fog.cjs +25 -22
- package/dist/effects/passes/screen-space/volumetric-fog.d.ts +161 -2
- package/dist/effects/passes/screen-space/volumetric-fog.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/volumetric-fog.js +27 -21
- package/dist/effects/passes/screen-space/volumetric-fog.js.map +1 -1
- package/dist/effects/temporal-upscale/index.cjs +40 -0
- package/dist/effects/temporal-upscale/index.d.ts +5 -0
- package/dist/effects/temporal-upscale/index.d.ts.map +1 -0
- package/dist/effects/temporal-upscale/index.js +6 -0
- package/dist/effects/temporal-upscale/index.js.map +1 -0
- package/dist/effects/temporal-upscale/temporal-math.cjs +202 -0
- package/dist/effects/temporal-upscale/temporal-math.d.ts +101 -0
- package/dist/effects/temporal-upscale/temporal-math.d.ts.map +1 -0
- package/dist/effects/temporal-upscale/temporal-math.js +202 -0
- package/dist/effects/temporal-upscale/temporal-math.js.map +1 -0
- package/dist/effects/temporal-upscale/temporal-upscale-shaders.cjs +353 -0
- package/dist/effects/temporal-upscale/temporal-upscale-shaders.d.ts +7 -0
- package/dist/effects/temporal-upscale/temporal-upscale-shaders.d.ts.map +1 -0
- package/dist/effects/temporal-upscale/temporal-upscale-shaders.js +321 -0
- package/dist/effects/temporal-upscale/temporal-upscale-shaders.js.map +1 -0
- package/dist/effects/temporal-upscale/temporal-upscaler.cjs +392 -0
- package/dist/effects/temporal-upscale/temporal-upscaler.d.ts +143 -0
- package/dist/effects/temporal-upscale/temporal-upscaler.d.ts.map +1 -0
- package/dist/effects/temporal-upscale/temporal-upscaler.js +385 -0
- package/dist/effects/temporal-upscale/temporal-upscaler.js.map +1 -0
- package/dist/experimental-controls.cjs +13 -3
- package/dist/experimental-controls.d.ts +2 -1
- package/dist/experimental-controls.d.ts.map +1 -1
- package/dist/experimental-controls.js +1 -1
- package/dist/experimental-controls.js.map +1 -1
- package/dist/experimental-materials.cjs +37 -3
- package/dist/experimental-materials.d.ts +2 -1
- package/dist/experimental-materials.d.ts.map +1 -1
- package/dist/experimental-materials.js +1 -1
- package/dist/experimental-materials.js.map +1 -1
- package/dist/experimental-textures.cjs +13 -3
- package/dist/experimental-textures.d.ts +2 -1
- package/dist/experimental-textures.d.ts.map +1 -1
- package/dist/experimental-textures.js +1 -1
- package/dist/experimental-textures.js.map +1 -1
- package/dist/experimental-webxr.cjs +17 -3
- package/dist/experimental-webxr.d.ts +2 -1
- package/dist/experimental-webxr.d.ts.map +1 -1
- package/dist/experimental-webxr.js +1 -1
- package/dist/experimental-webxr.js.map +1 -1
- package/dist/gltf/gltf/create-gltf-model.cjs +34 -71
- package/dist/gltf/gltf/create-gltf-model.d.ts +3 -0
- package/dist/gltf/gltf/create-gltf-model.d.ts.map +1 -1
- package/dist/gltf/gltf/create-gltf-model.js +40 -74
- package/dist/gltf/gltf/create-gltf-model.js.map +1 -1
- package/dist/gltf/gltf/create-scenegraph-from-gltf.cjs +46 -4
- package/dist/gltf/gltf/create-scenegraph-from-gltf.d.ts +9 -1
- package/dist/gltf/gltf/create-scenegraph-from-gltf.d.ts.map +1 -1
- package/dist/gltf/gltf/create-scenegraph-from-gltf.js +54 -4
- package/dist/gltf/gltf/create-scenegraph-from-gltf.js.map +1 -1
- package/dist/gltf/gltf/gltf-animated-crowd.cjs +25 -136
- package/dist/gltf/gltf/gltf-animated-crowd.d.ts +4 -8
- package/dist/gltf/gltf/gltf-animated-crowd.d.ts.map +1 -1
- package/dist/gltf/gltf/gltf-animated-crowd.js +27 -139
- package/dist/gltf/gltf/gltf-animated-crowd.js.map +1 -1
- package/dist/gltf/gltf/gltf-animation-nodes.cjs +84 -0
- package/dist/gltf/gltf/gltf-animation-nodes.d.ts +11 -0
- package/dist/gltf/gltf/gltf-animation-nodes.d.ts.map +1 -0
- package/dist/gltf/gltf/gltf-animation-nodes.js +62 -0
- package/dist/gltf/gltf/gltf-animation-nodes.js.map +1 -0
- package/dist/gltf/gltf/gltf-animator.cjs +8 -2
- package/dist/gltf/gltf/gltf-animator.d.ts +6 -1
- package/dist/gltf/gltf/gltf-animator.d.ts.map +1 -1
- package/dist/gltf/gltf/gltf-animator.js +10 -2
- package/dist/gltf/gltf/gltf-animator.js.map +1 -1
- package/dist/gltf/gltf/gltf-gpu-animation-controller.cjs +81 -0
- package/dist/gltf/gltf/gltf-gpu-animation-controller.d.ts +9 -0
- package/dist/gltf/gltf/gltf-gpu-animation-controller.d.ts.map +1 -0
- package/dist/gltf/gltf/gltf-gpu-animation-controller.js +67 -0
- package/dist/gltf/gltf/gltf-gpu-animation-controller.js.map +1 -0
- package/dist/gltf/gltf/gltf-gpu-animation.cjs +33 -28
- package/dist/gltf/gltf/gltf-gpu-animation.d.ts +7 -26
- package/dist/gltf/gltf/gltf-gpu-animation.d.ts.map +1 -1
- package/dist/gltf/gltf/gltf-gpu-animation.js +29 -28
- package/dist/gltf/gltf/gltf-gpu-animation.js.map +1 -1
- package/dist/gltf/index.cjs.map +3 -3
- package/dist/gltf/index.d.ts +2 -2
- package/dist/gltf/index.d.ts.map +1 -1
- package/dist/gltf/index.js.map +1 -1
- package/dist/gltf/parsers/parse-gltf.cjs +4 -2
- package/dist/gltf/parsers/parse-gltf.d.ts +3 -0
- package/dist/gltf/parsers/parse-gltf.d.ts.map +1 -1
- package/dist/gltf/parsers/parse-gltf.js +7 -2
- package/dist/gltf/parsers/parse-gltf.js.map +1 -1
- package/dist/graph/models/index.cjs.map +2 -2
- package/dist/graph/physics/index.cjs +5 -0
- package/dist/graph/physics/index.cjs.map +3 -3
- package/dist/graph/physics/index.d.ts +1 -0
- package/dist/graph/physics/index.d.ts.map +1 -1
- package/dist/graph/physics/index.js +1 -0
- package/dist/graph/physics/index.js.map +1 -1
- package/dist/graph/physics/physics-controller-geometry.cjs +21 -0
- package/dist/graph/physics/physics-controller-geometry.d.ts +8 -1
- package/dist/graph/physics/physics-controller-geometry.d.ts.map +1 -1
- package/dist/graph/physics/physics-controller-geometry.js +22 -0
- package/dist/graph/physics/physics-controller-geometry.js.map +1 -1
- package/dist/graph/physics/scenegraph-session.d.ts +1 -1
- package/dist/graph/physics/scenegraph-session.d.ts.map +1 -1
- package/dist/graph/tables/index.cjs.map +2 -2
- package/dist/index.cjs +16 -0
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/lighting/ambient-occlusion-pass.cjs +47 -28
- package/dist/lighting/ambient-occlusion-pass.d.ts +12 -0
- package/dist/lighting/ambient-occlusion-pass.d.ts.map +1 -1
- package/dist/lighting/ambient-occlusion-pass.js +45 -26
- package/dist/lighting/ambient-occlusion-pass.js.map +1 -1
- package/dist/lighting/clustered-light-grid.cjs +71 -20
- package/dist/lighting/clustered-light-grid.d.ts +37 -0
- package/dist/lighting/clustered-light-grid.d.ts.map +1 -1
- package/dist/lighting/clustered-light-grid.js +68 -18
- package/dist/lighting/clustered-light-grid.js.map +1 -1
- package/dist/lighting/contact-shadow-composite.cjs +72 -51
- package/dist/lighting/contact-shadow-composite.d.ts +274 -3
- package/dist/lighting/contact-shadow-composite.d.ts.map +1 -1
- package/dist/lighting/contact-shadow-composite.js +72 -50
- package/dist/lighting/contact-shadow-composite.js.map +1 -1
- package/dist/lighting/contact-shadow-pass.cjs +50 -39
- package/dist/lighting/contact-shadow-pass.d.ts +8 -0
- package/dist/lighting/contact-shadow-pass.d.ts.map +1 -1
- package/dist/lighting/contact-shadow-pass.js +47 -37
- package/dist/lighting/contact-shadow-pass.js.map +1 -1
- package/dist/lighting/cortao/cortao-occluder-lookup-table.cjs +96 -0
- package/dist/lighting/cortao/cortao-occluder-lookup-table.d.ts +41 -0
- package/dist/lighting/cortao/cortao-occluder-lookup-table.d.ts.map +1 -0
- package/dist/lighting/cortao/cortao-occluder-lookup-table.js +94 -0
- package/dist/lighting/cortao/cortao-occluder-lookup-table.js.map +1 -0
- package/dist/lighting/cortao/cortao-parameters.cjs +127 -0
- package/dist/lighting/cortao/cortao-parameters.d.ts +95 -0
- package/dist/lighting/cortao/cortao-parameters.d.ts.map +1 -0
- package/dist/lighting/cortao/cortao-parameters.js +122 -0
- package/dist/lighting/cortao/cortao-parameters.js.map +1 -0
- package/dist/lighting/cortao/cortao-pass.cjs +100 -0
- package/dist/lighting/cortao/cortao-pass.d.ts +33 -0
- package/dist/lighting/cortao/cortao-pass.d.ts.map +1 -0
- package/dist/lighting/cortao/cortao-pass.js +84 -0
- package/dist/lighting/cortao/cortao-pass.js.map +1 -0
- package/dist/lighting/cortao/cortao-passes.cjs +42 -0
- package/dist/lighting/cortao/cortao-passes.d.ts +38 -0
- package/dist/lighting/cortao/cortao-passes.d.ts.map +1 -0
- package/dist/lighting/cortao/cortao-passes.js +19 -0
- package/dist/lighting/cortao/cortao-passes.js.map +1 -0
- package/dist/lighting/cortao/cortao-shaders-wgsl.cjs +606 -0
- package/dist/lighting/cortao/cortao-shaders-wgsl.d.ts +49 -0
- package/dist/lighting/cortao/cortao-shaders-wgsl.d.ts.map +1 -0
- package/dist/lighting/cortao/cortao-shaders-wgsl.js +610 -0
- package/dist/lighting/cortao/cortao-shaders-wgsl.js.map +1 -0
- package/dist/lighting/cortao/cortao-shaders.cjs +667 -0
- package/dist/lighting/cortao/cortao-shaders.d.ts +118 -0
- package/dist/lighting/cortao/cortao-shaders.d.ts.map +1 -0
- package/dist/lighting/cortao/cortao-shaders.js +657 -0
- package/dist/lighting/cortao/cortao-shaders.js.map +1 -0
- package/dist/lighting/cortao/cortao-upsample.cjs +191 -0
- package/dist/lighting/cortao/cortao-upsample.d.ts +16 -0
- package/dist/lighting/cortao/cortao-upsample.d.ts.map +1 -0
- package/dist/lighting/cortao/cortao-upsample.js +159 -0
- package/dist/lighting/cortao/cortao-upsample.js.map +1 -0
- package/dist/lighting/cortao/cortao-webgl-passes.cjs +229 -0
- package/dist/lighting/cortao/cortao-webgl-passes.d.ts +28 -0
- package/dist/lighting/cortao/cortao-webgl-passes.d.ts.map +1 -0
- package/dist/lighting/cortao/cortao-webgl-passes.js +212 -0
- package/dist/lighting/cortao/cortao-webgl-passes.js.map +1 -0
- package/dist/lighting/cortao/cortao-webgpu-passes.cjs +348 -0
- package/dist/lighting/cortao/cortao-webgpu-passes.d.ts +31 -0
- package/dist/lighting/cortao/cortao-webgpu-passes.d.ts.map +1 -0
- package/dist/lighting/cortao/cortao-webgpu-passes.js +335 -0
- package/dist/lighting/cortao/cortao-webgpu-passes.js.map +1 -0
- package/dist/lighting/index.cjs +13 -2
- package/dist/lighting/index.cjs.map +3 -3
- package/dist/lighting/index.d.ts +11 -6
- package/dist/lighting/index.d.ts.map +1 -1
- package/dist/lighting/index.js +6 -5
- package/dist/lighting/index.js.map +1 -1
- package/dist/lighting/shadow-map-renderer.cjs +40 -37
- package/dist/lighting/shadow-map-renderer.d.ts +15 -0
- package/dist/lighting/shadow-map-renderer.d.ts.map +1 -1
- package/dist/lighting/shadow-map-renderer.js +37 -35
- package/dist/lighting/shadow-map-renderer.js.map +1 -1
- package/dist/model/gpu-vector-model.cjs +39 -16
- package/dist/model/gpu-vector-model.d.ts +8 -0
- package/dist/model/gpu-vector-model.d.ts.map +1 -1
- package/dist/model/gpu-vector-model.js +46 -18
- package/dist/model/gpu-vector-model.js.map +1 -1
- package/dist/passes/effect-renderer.cjs +155 -0
- package/dist/passes/effect-renderer.d.ts +158 -0
- package/dist/passes/effect-renderer.d.ts.map +1 -0
- package/dist/passes/effect-renderer.js +143 -0
- package/dist/passes/effect-renderer.js.map +1 -0
- package/dist/passes/scene-capture-pass.cjs +42 -0
- package/dist/passes/scene-capture-pass.d.ts +29 -0
- package/dist/passes/scene-capture-pass.d.ts.map +1 -0
- package/dist/passes/scene-capture-pass.js +21 -0
- package/dist/passes/scene-capture-pass.js.map +1 -0
- package/dist/passes/shader-pass-renderer.cjs +94 -68
- package/dist/passes/shader-pass-renderer.d.ts +32 -15
- package/dist/passes/shader-pass-renderer.d.ts.map +1 -1
- package/dist/passes/shader-pass-renderer.js +104 -76
- package/dist/passes/shader-pass-renderer.js.map +1 -1
- package/dist/scenegraph/model-node.cjs +2 -0
- package/dist/scenegraph/model-node.d.ts +4 -0
- package/dist/scenegraph/model-node.d.ts.map +1 -1
- package/dist/scenegraph/model-node.js +2 -0
- package/dist/scenegraph/model-node.js.map +1 -1
- package/dist/splats/gpu-paged-splat-renderer.cjs +52 -8
- package/dist/splats/gpu-paged-splat-renderer.d.ts +16 -3
- package/dist/splats/gpu-paged-splat-renderer.d.ts.map +1 -1
- package/dist/splats/gpu-paged-splat-renderer.js +55 -9
- package/dist/splats/gpu-paged-splat-renderer.js.map +1 -1
- package/dist/splats/gpu-paged-splat-shaders.cjs +3 -1
- package/dist/splats/gpu-paged-splat-shaders.d.ts.map +1 -1
- package/dist/splats/gpu-paged-splat-shaders.js +3 -1
- package/dist/splats/gpu-paged-splat-shaders.js.map +1 -1
- package/dist/splats/index.cjs.map +2 -2
- package/dist/text/fonts/atlas/browser-font-atlas.cjs +10 -1
- package/dist/text/fonts/atlas/browser-font-atlas.d.ts +3 -1
- package/dist/text/fonts/atlas/browser-font-atlas.d.ts.map +1 -1
- package/dist/text/fonts/atlas/browser-font-atlas.js +10 -2
- package/dist/text/fonts/atlas/browser-font-atlas.js.map +1 -1
- package/dist/text/fonts/atlas/lru-cache.cjs +4 -0
- package/dist/text/fonts/atlas/lru-cache.d.ts +3 -1
- package/dist/text/fonts/atlas/lru-cache.d.ts.map +1 -1
- package/dist/text/fonts/atlas/lru-cache.js +4 -0
- package/dist/text/fonts/atlas/lru-cache.js.map +1 -1
- package/dist/text/fonts/index.cjs +2 -0
- package/dist/text/fonts/index.cjs.map +1 -1
- package/dist/text/fonts/index.d.ts +1 -1
- package/dist/text/fonts/index.d.ts.map +1 -1
- package/dist/text/fonts/index.js +1 -1
- package/dist/text/fonts/index.js.map +1 -1
- package/dist/text/index.cjs.map +1 -1
- package/package.json +8 -8
- package/src/animation/animation-track.ts +5 -0
- package/src/animation/node-animation-binding.ts +9 -8
- package/src/animation/scenegraph-gpu-animation-layout.ts +195 -0
- package/src/animation/scenegraph-gpu-animation.ts +340 -0
- package/src/arrow/arrow-picking.ts +23 -11
- package/src/audio/audio-controller.ts +4 -1
- package/src/audio/audio-graph.ts +46 -25
- package/src/effects/README.md +38 -14
- package/src/effects/glfx-effects.ts +227 -0
- package/src/effects/graph/gpu-effect-operation.ts +601 -0
- package/src/effects/graph/temporal-graph-history.ts +46 -0
- package/src/effects/index.ts +81 -19
- package/src/effects/passes/postprocessing/fxaa/fxaa.ts +8 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/tone-mapping.ts +8 -0
- package/src/effects/passes/postprocessing/image-blur-filters/bloom-composite-shader-pass.ts +219 -19
- package/src/effects/passes/postprocessing/image-blur-filters/bloom-compute-pyramid.ts +6 -6
- package/src/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.ts +45 -45
- package/src/effects/passes/screen-space/clustered-volumetric-lighting.ts +88 -68
- package/src/effects/passes/screen-space/copy-pass.ts +4 -0
- package/src/effects/passes/screen-space/depth-aware-blur.ts +13 -3
- package/src/effects/passes/screen-space/dof.ts +20 -3
- package/src/effects/passes/screen-space/gtao.ts +91 -65
- package/src/effects/passes/screen-space/hdr-auto-exposure.ts +109 -84
- package/src/effects/passes/screen-space/height-fog.ts +18 -3
- package/src/effects/passes/screen-space/motion-blur.ts +8 -7
- package/src/effects/passes/screen-space/outlines.ts +143 -17
- package/src/effects/passes/screen-space/screen-space-global-illumination.ts +75 -64
- package/src/effects/passes/screen-space/screen-space-reflections.ts +158 -95
- package/src/effects/passes/screen-space/selection-outline.ts +11 -0
- package/src/effects/passes/screen-space/ssao.ts +79 -46
- package/src/effects/passes/screen-space/temporal-antialiasing.ts +43 -33
- package/src/effects/passes/screen-space/temporal-frame.ts +33 -0
- package/src/effects/passes/screen-space/volumetric-fog.ts +30 -24
- package/src/effects/temporal-upscale/index.ts +20 -0
- package/src/effects/temporal-upscale/temporal-math.ts +308 -0
- package/src/effects/temporal-upscale/temporal-upscale-shaders.ts +326 -0
- package/src/effects/temporal-upscale/temporal-upscaler.ts +538 -0
- package/src/experimental-controls.ts +13 -1
- package/src/experimental-materials.ts +37 -1
- package/src/experimental-textures.ts +9 -1
- package/src/experimental-webxr.ts +18 -1
- package/src/gltf/gltf/create-gltf-model.ts +59 -90
- package/src/gltf/gltf/create-scenegraph-from-gltf.ts +71 -5
- package/src/gltf/gltf/gltf-animated-crowd.ts +30 -177
- package/src/gltf/gltf/gltf-animation-nodes.ts +82 -0
- package/src/gltf/gltf/gltf-animator.ts +15 -4
- package/src/gltf/gltf/gltf-gpu-animation-controller.ts +88 -0
- package/src/gltf/gltf/gltf-gpu-animation.ts +53 -60
- package/src/gltf/index.ts +5 -0
- package/src/gltf/parsers/parse-gltf.ts +12 -2
- package/src/graph/physics/index.ts +4 -0
- package/src/graph/physics/physics-controller-geometry.ts +33 -1
- package/src/index.ts +25 -0
- package/src/lighting/ambient-occlusion-pass.ts +62 -28
- package/src/lighting/clustered-light-grid.ts +87 -30
- package/src/lighting/contact-shadow-composite.ts +80 -52
- package/src/lighting/contact-shadow-pass.ts +59 -39
- package/src/lighting/cortao/cortao-occluder-lookup-table.ts +138 -0
- package/src/lighting/cortao/cortao-parameters.ts +218 -0
- package/src/lighting/cortao/cortao-pass.ts +136 -0
- package/src/lighting/cortao/cortao-passes.ts +50 -0
- package/src/lighting/cortao/cortao-shaders-wgsl.ts +633 -0
- package/src/lighting/cortao/cortao-shaders.ts +674 -0
- package/src/lighting/cortao/cortao-upsample.ts +177 -0
- package/src/lighting/cortao/cortao-webgl-passes.ts +284 -0
- package/src/lighting/cortao/cortao-webgpu-passes.ts +430 -0
- package/src/lighting/index.ts +12 -3
- package/src/lighting/shadow-map-renderer.ts +57 -43
- package/src/model/gpu-vector-model.ts +47 -18
- package/src/passes/effect-renderer.ts +332 -0
- package/src/passes/scene-capture-pass.ts +51 -0
- package/src/passes/shader-pass-renderer.ts +164 -115
- package/src/scenegraph/model-node.ts +5 -0
- package/src/splats/README.md +1 -1
- package/src/splats/gpu-paged-splat-renderer.ts +77 -9
- package/src/splats/gpu-paged-splat-shaders.ts +7 -1
- package/src/text/fonts/atlas/browser-font-atlas.ts +12 -2
- package/src/text/fonts/atlas/lru-cache.ts +6 -1
- package/src/text/fonts/index.ts +1 -0
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { Texture } from '@luma.gl/core';
|
|
2
|
-
import type { CompositeShaderPass } from '@luma.gl/shaders';
|
|
3
2
|
export type SSAOCompositeShaderPassOptions = {
|
|
4
3
|
normalSource?: 'reconstruct-from-depth' | 'normal-texture';
|
|
5
4
|
/** Fractional intermediate framebuffer resolution. Defaults to full resolution. */
|
|
@@ -19,7 +18,7 @@ type SSAOBindings = {
|
|
|
19
18
|
};
|
|
20
19
|
export declare const ssaoEvaluate: {
|
|
21
20
|
readonly name: "ssaoEvaluate";
|
|
22
|
-
readonly source: "fn advancedSceneUV(uv: vec2f) -> vec2f {\n return uv;\n}\n\nfn advancedLinearDepth(depth: f32, nearPlane: f32, farPlane: f32) -> f32 {\n return (nearPlane * farPlane) / max(farPlane - depth * (farPlane - nearPlane), 0.0001);\n}\n\nfn advancedDepthNormal(depthTexture: texture_depth_2d, depthTextureSampler: sampler, uv: vec2f) -> vec3f {\n let dimensions = vec2i(textureDimensions(depthTexture));\n let coordinate = clamp(vec2i(uv * vec2f(dimensions)), vec2i(0), dimensions - vec2i(1));\n let center = textureLoad(depthTexture, coordinate, 0);\n let right = textureLoad(depthTexture, min(coordinate + vec2i(1, 0), dimensions - vec2i(1)), 0);\n let up = textureLoad(depthTexture, min(coordinate + vec2i(0, 1), dimensions - vec2i(1)), 0);\n return normalize(vec3f((center - right) * f32(dimensions.x), (center - up) * f32(dimensions.y), 1.0));\n}\n\nstruct ssaoEvaluateUniforms {\n nearPlane: f32,\n farPlane: f32,\n radius: f32,\n bias: f32,\n intensity: f32,\n useNormalTexture: f32,\n};\n@group(0) @binding(auto) var<uniform> ssaoEvaluate: ssaoEvaluateUniforms;\n@group(0) @binding(auto) var depthTexture: texture_depth_2d;\n@group(0) @binding(auto) var depthTextureSampler: sampler;\n@group(0) @binding(auto) var normalTexture: texture_2d<f32>;\n@group(0) @binding(auto) var normalTextureSampler: sampler;\n\nfn ssaoEvaluate_sampleColor(\n sourceTexture: texture_2d<f32>, sourceTextureSampler: sampler, texSize: vec2f, texCoord: vec2f\n) -> vec4f {\n let sceneCoord = advancedSceneUV(texCoord);\n let depth = textureSample(depthTexture, depthTextureSampler, sceneCoord);\n let dimensions = vec2f(textureDimensions(depthTexture));\n let linearDepth = advancedLinearDepth(depth, ssaoEvaluate.nearPlane, ssaoEvaluate.farPlane);\n let reconstructedNormal = advancedDepthNormal(depthTexture, depthTextureSampler, sceneCoord);\n let
|
|
21
|
+
readonly source: "fn advancedSceneUV(uv: vec2f) -> vec2f {\n return uv;\n}\n\nfn advancedLinearDepth(depth: f32, nearPlane: f32, farPlane: f32) -> f32 {\n return (nearPlane * farPlane) / max(farPlane - depth * (farPlane - nearPlane), 0.0001);\n}\n\nfn advancedDepthNormal(depthTexture: texture_depth_2d, depthTextureSampler: sampler, uv: vec2f) -> vec3f {\n let dimensions = vec2i(textureDimensions(depthTexture));\n let coordinate = clamp(vec2i(uv * vec2f(dimensions)), vec2i(0), dimensions - vec2i(1));\n let center = textureLoad(depthTexture, coordinate, 0);\n let right = textureLoad(depthTexture, min(coordinate + vec2i(1, 0), dimensions - vec2i(1)), 0);\n let up = textureLoad(depthTexture, min(coordinate + vec2i(0, 1), dimensions - vec2i(1)), 0);\n return normalize(vec3f((center - right) * f32(dimensions.x), (center - up) * f32(dimensions.y), 1.0));\n}\n\nstruct ssaoEvaluateUniforms {\n nearPlane: f32,\n farPlane: f32,\n radius: f32,\n bias: f32,\n intensity: f32,\n useNormalTexture: f32,\n};\n@group(0) @binding(auto) var<uniform> ssaoEvaluate: ssaoEvaluateUniforms;\n@group(0) @binding(auto) var depthTexture: texture_depth_2d;\n@group(0) @binding(auto) var depthTextureSampler: sampler;\n@group(0) @binding(auto) var normalTexture: texture_2d<f32>;\n@group(0) @binding(auto) var normalTextureSampler: sampler;\n\nfn ssaoEvaluate_sampleColor(\n sourceTexture: texture_2d<f32>, sourceTextureSampler: sampler, texSize: vec2f, texCoord: vec2f\n) -> vec4f {\n let sceneCoord = advancedSceneUV(texCoord);\n let depth = textureSample(depthTexture, depthTextureSampler, sceneCoord);\n let dimensions = vec2f(textureDimensions(depthTexture));\n let linearDepth = advancedLinearDepth(depth, ssaoEvaluate.nearPlane, ssaoEvaluate.farPlane);\n let reconstructedNormal = advancedDepthNormal(depthTexture, depthTextureSampler, sceneCoord);\n let viewNormal = textureSample(normalTexture, normalTextureSampler, sceneCoord).xyz * 2.0 - 1.0;\n // G-buffer normals use +Y up, while WebGPU texture sample offsets use +Y down.\n let textureNormal = normalize(viewNormal * vec3f(1.0, -1.0, 1.0));\n let normal = normalize(mix(reconstructedNormal, textureNormal, ssaoEvaluate.useNormalTexture));\n let angle = fract(sin(dot(texCoord * dimensions, vec2f(12.9898, 78.233))) * 43758.5453) * 6.2831853;\n var occlusion = 0.0;\n for (var index: i32 = 0; index < 12; index++) {\n let sampleAngle = angle + f32(index) * 2.399963;\n let sampleRadius = (0.25 + 0.75 * f32(index + 1) / 12.0) * ssaoEvaluate.radius;\n let direction = vec2f(cos(sampleAngle), sin(sampleAngle));\n let sampleUv = clamp(texCoord + direction * sampleRadius / dimensions, vec2f(0.0), vec2f(1.0));\n let sampleDepth = textureSampleLevel(depthTexture, depthTextureSampler, advancedSceneUV(sampleUv), 0);\n let sampleLinearDepth = advancedLinearDepth(sampleDepth, ssaoEvaluate.nearPlane, ssaoEvaluate.farPlane);\n let rangeWeight = smoothstep(ssaoEvaluate.radius * 2.0, 0.0, abs(sampleLinearDepth - linearDepth));\n let horizonWeight = max(dot(normal, normalize(vec3f(direction, 0.35))), 0.15);\n occlusion += select(0.0, rangeWeight * horizonWeight, sampleLinearDepth + ssaoEvaluate.bias < linearDepth);\n }\n let ambient = select(clamp(1.0 - occlusion / 12.0 * ssaoEvaluate.intensity, 0.0, 1.0), 1.0, depth >= 0.99999);\n return vec4f(vec3f(ambient), 1.0);\n}\n";
|
|
23
22
|
readonly bindingLayout: readonly [{
|
|
24
23
|
readonly name: "depthTexture";
|
|
25
24
|
readonly group: 0;
|
|
@@ -71,7 +70,6 @@ export declare const ssaoEvaluate: {
|
|
|
71
70
|
readonly sampler: true;
|
|
72
71
|
}];
|
|
73
72
|
};
|
|
74
|
-
export declare function createSSAOCompositeShaderPass(options?: SSAOCompositeShaderPassOptions): CompositeShaderPass<'ssaoRaw' | 'ssaoScratch' | 'ssaoBlurred'>;
|
|
75
73
|
export declare const ssaoComposite: {
|
|
76
74
|
readonly name: "ssaoComposite";
|
|
77
75
|
readonly source: "struct ssaoCompositeUniforms {\n debugMode: f32,\n};\n@group(0) @binding(auto) var<uniform> ssaoComposite: ssaoCompositeUniforms;\n@group(0) @binding(auto) var ambientOcclusionTexture: texture_2d<f32>;\n@group(0) @binding(auto) var ambientOcclusionTextureSampler: sampler;\nfn ssaoComposite_sampleColor(\n sourceTexture: texture_2d<f32>, sourceTextureSampler: sampler, texSize: vec2f, texCoord: vec2f\n) -> vec4f {\n let color = textureSample(sourceTexture, sourceTextureSampler, texCoord);\n let ambient = textureSample(ambientOcclusionTexture, ambientOcclusionTextureSampler, texCoord).r;\n if (ssaoComposite.debugMode > 0.5) { return vec4f(vec3f(ambient), 1.0); }\n let rawOcclusion = clamp(1.0 - ambient, 0.0, 1.0);\n let contactOcclusion = smoothstep(0.03, 0.5, rawOcclusion);\n return vec4f(color.rgb * (1.0 - contactOcclusion * 0.48), color.a);\n}";
|
|
@@ -94,5 +92,652 @@ export declare const ssaoComposite: {
|
|
|
94
92
|
readonly sampler: true;
|
|
95
93
|
}];
|
|
96
94
|
};
|
|
95
|
+
/** SSAO with normals reconstructed from the scene depth input. */
|
|
96
|
+
export declare const ssao: {
|
|
97
|
+
readonly name: "ssaoCompositeShaderPass";
|
|
98
|
+
readonly resources: {
|
|
99
|
+
readonly ssaoRaw: {
|
|
100
|
+
readonly scale: [1, 1];
|
|
101
|
+
readonly format: "rgba8unorm";
|
|
102
|
+
};
|
|
103
|
+
readonly ssaoScratch: {
|
|
104
|
+
readonly scale: [1, 1];
|
|
105
|
+
readonly format: "rgba8unorm";
|
|
106
|
+
};
|
|
107
|
+
readonly ssaoBlurred: {
|
|
108
|
+
readonly scale: [1, 1];
|
|
109
|
+
readonly format: "rgba8unorm";
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
readonly passes: [{
|
|
113
|
+
readonly kind: "fullscreen";
|
|
114
|
+
readonly shaderPass: {
|
|
115
|
+
readonly name: "ssaoEvaluate";
|
|
116
|
+
readonly source: "fn advancedSceneUV(uv: vec2f) -> vec2f {\n return uv;\n}\n\nfn advancedLinearDepth(depth: f32, nearPlane: f32, farPlane: f32) -> f32 {\n return (nearPlane * farPlane) / max(farPlane - depth * (farPlane - nearPlane), 0.0001);\n}\n\nfn advancedDepthNormal(depthTexture: texture_depth_2d, depthTextureSampler: sampler, uv: vec2f) -> vec3f {\n let dimensions = vec2i(textureDimensions(depthTexture));\n let coordinate = clamp(vec2i(uv * vec2f(dimensions)), vec2i(0), dimensions - vec2i(1));\n let center = textureLoad(depthTexture, coordinate, 0);\n let right = textureLoad(depthTexture, min(coordinate + vec2i(1, 0), dimensions - vec2i(1)), 0);\n let up = textureLoad(depthTexture, min(coordinate + vec2i(0, 1), dimensions - vec2i(1)), 0);\n return normalize(vec3f((center - right) * f32(dimensions.x), (center - up) * f32(dimensions.y), 1.0));\n}\n\nstruct ssaoEvaluateUniforms {\n nearPlane: f32,\n farPlane: f32,\n radius: f32,\n bias: f32,\n intensity: f32,\n useNormalTexture: f32,\n};\n@group(0) @binding(auto) var<uniform> ssaoEvaluate: ssaoEvaluateUniforms;\n@group(0) @binding(auto) var depthTexture: texture_depth_2d;\n@group(0) @binding(auto) var depthTextureSampler: sampler;\n@group(0) @binding(auto) var normalTexture: texture_2d<f32>;\n@group(0) @binding(auto) var normalTextureSampler: sampler;\n\nfn ssaoEvaluate_sampleColor(\n sourceTexture: texture_2d<f32>, sourceTextureSampler: sampler, texSize: vec2f, texCoord: vec2f\n) -> vec4f {\n let sceneCoord = advancedSceneUV(texCoord);\n let depth = textureSample(depthTexture, depthTextureSampler, sceneCoord);\n let dimensions = vec2f(textureDimensions(depthTexture));\n let linearDepth = advancedLinearDepth(depth, ssaoEvaluate.nearPlane, ssaoEvaluate.farPlane);\n let reconstructedNormal = advancedDepthNormal(depthTexture, depthTextureSampler, sceneCoord);\n let viewNormal = textureSample(normalTexture, normalTextureSampler, sceneCoord).xyz * 2.0 - 1.0;\n // G-buffer normals use +Y up, while WebGPU texture sample offsets use +Y down.\n let textureNormal = normalize(viewNormal * vec3f(1.0, -1.0, 1.0));\n let normal = normalize(mix(reconstructedNormal, textureNormal, ssaoEvaluate.useNormalTexture));\n let angle = fract(sin(dot(texCoord * dimensions, vec2f(12.9898, 78.233))) * 43758.5453) * 6.2831853;\n var occlusion = 0.0;\n for (var index: i32 = 0; index < 12; index++) {\n let sampleAngle = angle + f32(index) * 2.399963;\n let sampleRadius = (0.25 + 0.75 * f32(index + 1) / 12.0) * ssaoEvaluate.radius;\n let direction = vec2f(cos(sampleAngle), sin(sampleAngle));\n let sampleUv = clamp(texCoord + direction * sampleRadius / dimensions, vec2f(0.0), vec2f(1.0));\n let sampleDepth = textureSampleLevel(depthTexture, depthTextureSampler, advancedSceneUV(sampleUv), 0);\n let sampleLinearDepth = advancedLinearDepth(sampleDepth, ssaoEvaluate.nearPlane, ssaoEvaluate.farPlane);\n let rangeWeight = smoothstep(ssaoEvaluate.radius * 2.0, 0.0, abs(sampleLinearDepth - linearDepth));\n let horizonWeight = max(dot(normal, normalize(vec3f(direction, 0.35))), 0.15);\n occlusion += select(0.0, rangeWeight * horizonWeight, sampleLinearDepth + ssaoEvaluate.bias < linearDepth);\n }\n let ambient = select(clamp(1.0 - occlusion / 12.0 * ssaoEvaluate.intensity, 0.0, 1.0), 1.0, depth >= 0.99999);\n return vec4f(vec3f(ambient), 1.0);\n}\n";
|
|
117
|
+
readonly bindingLayout: readonly [{
|
|
118
|
+
readonly name: "depthTexture";
|
|
119
|
+
readonly group: 0;
|
|
120
|
+
}, {
|
|
121
|
+
readonly name: "normalTexture";
|
|
122
|
+
readonly group: 0;
|
|
123
|
+
}];
|
|
124
|
+
readonly props: Partial<SSAOUniforms> & SSAOBindings;
|
|
125
|
+
readonly uniforms: SSAOUniforms;
|
|
126
|
+
readonly bindings: SSAOBindings;
|
|
127
|
+
readonly uniformTypes: {
|
|
128
|
+
readonly nearPlane: "f32";
|
|
129
|
+
readonly farPlane: "f32";
|
|
130
|
+
readonly radius: "f32";
|
|
131
|
+
readonly bias: "f32";
|
|
132
|
+
readonly intensity: "f32";
|
|
133
|
+
readonly useNormalTexture: "f32";
|
|
134
|
+
};
|
|
135
|
+
readonly propTypes: {
|
|
136
|
+
readonly nearPlane: {
|
|
137
|
+
readonly value: 0.1;
|
|
138
|
+
};
|
|
139
|
+
readonly farPlane: {
|
|
140
|
+
readonly value: 200;
|
|
141
|
+
};
|
|
142
|
+
readonly radius: {
|
|
143
|
+
readonly value: 7;
|
|
144
|
+
readonly min: 1;
|
|
145
|
+
readonly softMax: 32;
|
|
146
|
+
};
|
|
147
|
+
readonly bias: {
|
|
148
|
+
readonly value: 0.03;
|
|
149
|
+
readonly min: 0;
|
|
150
|
+
readonly softMax: 0.2;
|
|
151
|
+
};
|
|
152
|
+
readonly intensity: {
|
|
153
|
+
readonly value: 1.35;
|
|
154
|
+
readonly min: 0;
|
|
155
|
+
readonly softMax: 4;
|
|
156
|
+
};
|
|
157
|
+
readonly useNormalTexture: {
|
|
158
|
+
readonly value: 0;
|
|
159
|
+
readonly min: 0;
|
|
160
|
+
readonly max: 1;
|
|
161
|
+
readonly private: true;
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
readonly passes: [{
|
|
165
|
+
readonly sampler: true;
|
|
166
|
+
}];
|
|
167
|
+
};
|
|
168
|
+
readonly inputs: {
|
|
169
|
+
readonly sourceTexture: "previous";
|
|
170
|
+
readonly normalTexture: "previous";
|
|
171
|
+
};
|
|
172
|
+
readonly output: "ssaoRaw";
|
|
173
|
+
readonly uniforms: {
|
|
174
|
+
readonly useNormalTexture: 0;
|
|
175
|
+
};
|
|
176
|
+
}, {
|
|
177
|
+
readonly kind: "fullscreen";
|
|
178
|
+
readonly shaderPass: {
|
|
179
|
+
readonly name: "depthAwareBlur";
|
|
180
|
+
readonly source: "struct depthAwareBlurUniforms {\n direction: vec2f,\n radius: f32,\n depthSigma: f32,\n spatialSigma: f32,\n};\n\n@group(0) @binding(auto) var<uniform> depthAwareBlur: depthAwareBlurUniforms;\n@group(0) @binding(auto) var depthTexture: texture_depth_2d;\n@group(0) @binding(auto) var depthTextureSampler: sampler;\n\nfn depthAwareBlur_sampleColor(\n sourceTexture: texture_2d<f32>,\n sourceTextureSampler: sampler,\n texSize: vec2f,\n texCoord: vec2f\n) -> vec4f {\n let sourceDimensions = vec2f(textureDimensions(sourceTexture));\n let texel = depthAwareBlur.direction / sourceDimensions;\n let centerDepth = textureSample(depthTexture, depthTextureSampler, texCoord);\n var color = textureSample(sourceTexture, sourceTextureSampler, texCoord);\n var totalWeight = 1.0;\n for (var index: i32 = 1; index <= 8; index++) {\n if (f32(index) > depthAwareBlur.radius) { break; }\n let offset = texel * f32(index);\n for (var side: i32 = -1; side <= 1; side += 2) {\n let sampleUv = clamp(texCoord + offset * f32(side), vec2f(0.0), vec2f(1.0));\n let sampleDepth = textureSample(depthTexture, depthTextureSampler, sampleUv);\n let spatialWeight = exp(-f32(index * index) / max(2.0 * depthAwareBlur.spatialSigma * depthAwareBlur.spatialSigma, 0.0001));\n let depthDelta = abs(sampleDepth - centerDepth);\n let depthWeight = exp(-(depthDelta * depthDelta) / max(2.0 * depthAwareBlur.depthSigma * depthAwareBlur.depthSigma, 0.000001));\n let weight = spatialWeight * depthWeight;\n color += textureSample(sourceTexture, sourceTextureSampler, sampleUv) * weight;\n totalWeight += weight;\n }\n }\n return color / totalWeight;\n}\n";
|
|
181
|
+
readonly bindingLayout: readonly [{
|
|
182
|
+
readonly name: "depthTexture";
|
|
183
|
+
readonly group: 0;
|
|
184
|
+
}];
|
|
185
|
+
readonly props: import("./depth-aware-blur").DepthAwareBlurProps & {
|
|
186
|
+
depthTexture?: Texture;
|
|
187
|
+
};
|
|
188
|
+
readonly uniforms: Required<import("./depth-aware-blur").DepthAwareBlurProps>;
|
|
189
|
+
readonly bindings: {
|
|
190
|
+
depthTexture?: Texture;
|
|
191
|
+
};
|
|
192
|
+
readonly uniformTypes: {
|
|
193
|
+
readonly direction: "vec2<f32>";
|
|
194
|
+
readonly radius: "f32";
|
|
195
|
+
readonly depthSigma: "f32";
|
|
196
|
+
readonly spatialSigma: "f32";
|
|
197
|
+
};
|
|
198
|
+
readonly propTypes: {
|
|
199
|
+
readonly direction: {
|
|
200
|
+
readonly value: readonly [1, 0];
|
|
201
|
+
};
|
|
202
|
+
readonly radius: {
|
|
203
|
+
readonly value: 4;
|
|
204
|
+
readonly min: 1;
|
|
205
|
+
readonly max: 8;
|
|
206
|
+
};
|
|
207
|
+
readonly depthSigma: {
|
|
208
|
+
readonly value: 0.01;
|
|
209
|
+
readonly min: 0.0001;
|
|
210
|
+
readonly softMax: 0.1;
|
|
211
|
+
};
|
|
212
|
+
readonly spatialSigma: {
|
|
213
|
+
readonly value: 3;
|
|
214
|
+
readonly min: 0.1;
|
|
215
|
+
readonly softMax: 8;
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
readonly passes: [{
|
|
219
|
+
readonly sampler: true;
|
|
220
|
+
}];
|
|
221
|
+
};
|
|
222
|
+
readonly inputs: {
|
|
223
|
+
readonly sourceTexture: "ssaoRaw";
|
|
224
|
+
};
|
|
225
|
+
readonly output: "ssaoScratch";
|
|
226
|
+
readonly uniforms: {
|
|
227
|
+
readonly direction: [1, 0];
|
|
228
|
+
};
|
|
229
|
+
}, {
|
|
230
|
+
readonly kind: "fullscreen";
|
|
231
|
+
readonly shaderPass: {
|
|
232
|
+
readonly name: "depthAwareBlur";
|
|
233
|
+
readonly source: "struct depthAwareBlurUniforms {\n direction: vec2f,\n radius: f32,\n depthSigma: f32,\n spatialSigma: f32,\n};\n\n@group(0) @binding(auto) var<uniform> depthAwareBlur: depthAwareBlurUniforms;\n@group(0) @binding(auto) var depthTexture: texture_depth_2d;\n@group(0) @binding(auto) var depthTextureSampler: sampler;\n\nfn depthAwareBlur_sampleColor(\n sourceTexture: texture_2d<f32>,\n sourceTextureSampler: sampler,\n texSize: vec2f,\n texCoord: vec2f\n) -> vec4f {\n let sourceDimensions = vec2f(textureDimensions(sourceTexture));\n let texel = depthAwareBlur.direction / sourceDimensions;\n let centerDepth = textureSample(depthTexture, depthTextureSampler, texCoord);\n var color = textureSample(sourceTexture, sourceTextureSampler, texCoord);\n var totalWeight = 1.0;\n for (var index: i32 = 1; index <= 8; index++) {\n if (f32(index) > depthAwareBlur.radius) { break; }\n let offset = texel * f32(index);\n for (var side: i32 = -1; side <= 1; side += 2) {\n let sampleUv = clamp(texCoord + offset * f32(side), vec2f(0.0), vec2f(1.0));\n let sampleDepth = textureSample(depthTexture, depthTextureSampler, sampleUv);\n let spatialWeight = exp(-f32(index * index) / max(2.0 * depthAwareBlur.spatialSigma * depthAwareBlur.spatialSigma, 0.0001));\n let depthDelta = abs(sampleDepth - centerDepth);\n let depthWeight = exp(-(depthDelta * depthDelta) / max(2.0 * depthAwareBlur.depthSigma * depthAwareBlur.depthSigma, 0.000001));\n let weight = spatialWeight * depthWeight;\n color += textureSample(sourceTexture, sourceTextureSampler, sampleUv) * weight;\n totalWeight += weight;\n }\n }\n return color / totalWeight;\n}\n";
|
|
234
|
+
readonly bindingLayout: readonly [{
|
|
235
|
+
readonly name: "depthTexture";
|
|
236
|
+
readonly group: 0;
|
|
237
|
+
}];
|
|
238
|
+
readonly props: import("./depth-aware-blur").DepthAwareBlurProps & {
|
|
239
|
+
depthTexture?: Texture;
|
|
240
|
+
};
|
|
241
|
+
readonly uniforms: Required<import("./depth-aware-blur").DepthAwareBlurProps>;
|
|
242
|
+
readonly bindings: {
|
|
243
|
+
depthTexture?: Texture;
|
|
244
|
+
};
|
|
245
|
+
readonly uniformTypes: {
|
|
246
|
+
readonly direction: "vec2<f32>";
|
|
247
|
+
readonly radius: "f32";
|
|
248
|
+
readonly depthSigma: "f32";
|
|
249
|
+
readonly spatialSigma: "f32";
|
|
250
|
+
};
|
|
251
|
+
readonly propTypes: {
|
|
252
|
+
readonly direction: {
|
|
253
|
+
readonly value: readonly [1, 0];
|
|
254
|
+
};
|
|
255
|
+
readonly radius: {
|
|
256
|
+
readonly value: 4;
|
|
257
|
+
readonly min: 1;
|
|
258
|
+
readonly max: 8;
|
|
259
|
+
};
|
|
260
|
+
readonly depthSigma: {
|
|
261
|
+
readonly value: 0.01;
|
|
262
|
+
readonly min: 0.0001;
|
|
263
|
+
readonly softMax: 0.1;
|
|
264
|
+
};
|
|
265
|
+
readonly spatialSigma: {
|
|
266
|
+
readonly value: 3;
|
|
267
|
+
readonly min: 0.1;
|
|
268
|
+
readonly softMax: 8;
|
|
269
|
+
};
|
|
270
|
+
};
|
|
271
|
+
readonly passes: [{
|
|
272
|
+
readonly sampler: true;
|
|
273
|
+
}];
|
|
274
|
+
};
|
|
275
|
+
readonly inputs: {
|
|
276
|
+
readonly sourceTexture: "ssaoScratch";
|
|
277
|
+
};
|
|
278
|
+
readonly output: "ssaoBlurred";
|
|
279
|
+
readonly uniforms: {
|
|
280
|
+
readonly direction: [0, 1];
|
|
281
|
+
};
|
|
282
|
+
}, {
|
|
283
|
+
readonly kind: "fullscreen";
|
|
284
|
+
readonly shaderPass: {
|
|
285
|
+
readonly name: "ssaoComposite";
|
|
286
|
+
readonly source: "struct ssaoCompositeUniforms {\n debugMode: f32,\n};\n@group(0) @binding(auto) var<uniform> ssaoComposite: ssaoCompositeUniforms;\n@group(0) @binding(auto) var ambientOcclusionTexture: texture_2d<f32>;\n@group(0) @binding(auto) var ambientOcclusionTextureSampler: sampler;\nfn ssaoComposite_sampleColor(\n sourceTexture: texture_2d<f32>, sourceTextureSampler: sampler, texSize: vec2f, texCoord: vec2f\n) -> vec4f {\n let color = textureSample(sourceTexture, sourceTextureSampler, texCoord);\n let ambient = textureSample(ambientOcclusionTexture, ambientOcclusionTextureSampler, texCoord).r;\n if (ssaoComposite.debugMode > 0.5) { return vec4f(vec3f(ambient), 1.0); }\n let rawOcclusion = clamp(1.0 - ambient, 0.0, 1.0);\n let contactOcclusion = smoothstep(0.03, 0.5, rawOcclusion);\n return vec4f(color.rgb * (1.0 - contactOcclusion * 0.48), color.a);\n}";
|
|
287
|
+
readonly bindingLayout: readonly [{
|
|
288
|
+
readonly name: "ambientOcclusionTexture";
|
|
289
|
+
readonly group: 0;
|
|
290
|
+
}];
|
|
291
|
+
readonly uniformTypes: {
|
|
292
|
+
readonly debugMode: "f32";
|
|
293
|
+
};
|
|
294
|
+
readonly propTypes: {
|
|
295
|
+
readonly debugMode: {
|
|
296
|
+
readonly value: 0;
|
|
297
|
+
readonly min: 0;
|
|
298
|
+
readonly max: 1;
|
|
299
|
+
readonly private: true;
|
|
300
|
+
};
|
|
301
|
+
};
|
|
302
|
+
readonly passes: [{
|
|
303
|
+
readonly sampler: true;
|
|
304
|
+
}];
|
|
305
|
+
};
|
|
306
|
+
readonly inputs: {
|
|
307
|
+
readonly sourceTexture: "previous";
|
|
308
|
+
readonly ambientOcclusionTexture: "ssaoBlurred";
|
|
309
|
+
};
|
|
310
|
+
readonly output: "previous";
|
|
311
|
+
}];
|
|
312
|
+
};
|
|
313
|
+
/** Screen-space ambient occlusion with configurable normal input and target size. */
|
|
314
|
+
export declare const ssaoEffect: {
|
|
315
|
+
readonly optionDefaults: Required<SSAOCompositeShaderPassOptions>;
|
|
316
|
+
readonly scaleResources: {
|
|
317
|
+
readonly option: "resolutionScale";
|
|
318
|
+
readonly targets: readonly ["ssaoRaw", "ssaoScratch", "ssaoBlurred"];
|
|
319
|
+
};
|
|
320
|
+
readonly variants: {
|
|
321
|
+
readonly option: "normalSource";
|
|
322
|
+
readonly values: {
|
|
323
|
+
readonly 'normal-texture': {
|
|
324
|
+
readonly passes: [{
|
|
325
|
+
readonly inputs: {
|
|
326
|
+
readonly sourceTexture: "previous";
|
|
327
|
+
};
|
|
328
|
+
readonly uniforms: {
|
|
329
|
+
readonly useNormalTexture: 1;
|
|
330
|
+
};
|
|
331
|
+
readonly kind: "fullscreen";
|
|
332
|
+
readonly shaderPass: {
|
|
333
|
+
readonly name: "ssaoEvaluate";
|
|
334
|
+
readonly source: "fn advancedSceneUV(uv: vec2f) -> vec2f {\n return uv;\n}\n\nfn advancedLinearDepth(depth: f32, nearPlane: f32, farPlane: f32) -> f32 {\n return (nearPlane * farPlane) / max(farPlane - depth * (farPlane - nearPlane), 0.0001);\n}\n\nfn advancedDepthNormal(depthTexture: texture_depth_2d, depthTextureSampler: sampler, uv: vec2f) -> vec3f {\n let dimensions = vec2i(textureDimensions(depthTexture));\n let coordinate = clamp(vec2i(uv * vec2f(dimensions)), vec2i(0), dimensions - vec2i(1));\n let center = textureLoad(depthTexture, coordinate, 0);\n let right = textureLoad(depthTexture, min(coordinate + vec2i(1, 0), dimensions - vec2i(1)), 0);\n let up = textureLoad(depthTexture, min(coordinate + vec2i(0, 1), dimensions - vec2i(1)), 0);\n return normalize(vec3f((center - right) * f32(dimensions.x), (center - up) * f32(dimensions.y), 1.0));\n}\n\nstruct ssaoEvaluateUniforms {\n nearPlane: f32,\n farPlane: f32,\n radius: f32,\n bias: f32,\n intensity: f32,\n useNormalTexture: f32,\n};\n@group(0) @binding(auto) var<uniform> ssaoEvaluate: ssaoEvaluateUniforms;\n@group(0) @binding(auto) var depthTexture: texture_depth_2d;\n@group(0) @binding(auto) var depthTextureSampler: sampler;\n@group(0) @binding(auto) var normalTexture: texture_2d<f32>;\n@group(0) @binding(auto) var normalTextureSampler: sampler;\n\nfn ssaoEvaluate_sampleColor(\n sourceTexture: texture_2d<f32>, sourceTextureSampler: sampler, texSize: vec2f, texCoord: vec2f\n) -> vec4f {\n let sceneCoord = advancedSceneUV(texCoord);\n let depth = textureSample(depthTexture, depthTextureSampler, sceneCoord);\n let dimensions = vec2f(textureDimensions(depthTexture));\n let linearDepth = advancedLinearDepth(depth, ssaoEvaluate.nearPlane, ssaoEvaluate.farPlane);\n let reconstructedNormal = advancedDepthNormal(depthTexture, depthTextureSampler, sceneCoord);\n let viewNormal = textureSample(normalTexture, normalTextureSampler, sceneCoord).xyz * 2.0 - 1.0;\n // G-buffer normals use +Y up, while WebGPU texture sample offsets use +Y down.\n let textureNormal = normalize(viewNormal * vec3f(1.0, -1.0, 1.0));\n let normal = normalize(mix(reconstructedNormal, textureNormal, ssaoEvaluate.useNormalTexture));\n let angle = fract(sin(dot(texCoord * dimensions, vec2f(12.9898, 78.233))) * 43758.5453) * 6.2831853;\n var occlusion = 0.0;\n for (var index: i32 = 0; index < 12; index++) {\n let sampleAngle = angle + f32(index) * 2.399963;\n let sampleRadius = (0.25 + 0.75 * f32(index + 1) / 12.0) * ssaoEvaluate.radius;\n let direction = vec2f(cos(sampleAngle), sin(sampleAngle));\n let sampleUv = clamp(texCoord + direction * sampleRadius / dimensions, vec2f(0.0), vec2f(1.0));\n let sampleDepth = textureSampleLevel(depthTexture, depthTextureSampler, advancedSceneUV(sampleUv), 0);\n let sampleLinearDepth = advancedLinearDepth(sampleDepth, ssaoEvaluate.nearPlane, ssaoEvaluate.farPlane);\n let rangeWeight = smoothstep(ssaoEvaluate.radius * 2.0, 0.0, abs(sampleLinearDepth - linearDepth));\n let horizonWeight = max(dot(normal, normalize(vec3f(direction, 0.35))), 0.15);\n occlusion += select(0.0, rangeWeight * horizonWeight, sampleLinearDepth + ssaoEvaluate.bias < linearDepth);\n }\n let ambient = select(clamp(1.0 - occlusion / 12.0 * ssaoEvaluate.intensity, 0.0, 1.0), 1.0, depth >= 0.99999);\n return vec4f(vec3f(ambient), 1.0);\n}\n";
|
|
335
|
+
readonly bindingLayout: readonly [{
|
|
336
|
+
readonly name: "depthTexture";
|
|
337
|
+
readonly group: 0;
|
|
338
|
+
}, {
|
|
339
|
+
readonly name: "normalTexture";
|
|
340
|
+
readonly group: 0;
|
|
341
|
+
}];
|
|
342
|
+
readonly props: Partial<SSAOUniforms> & SSAOBindings;
|
|
343
|
+
readonly uniforms: SSAOUniforms;
|
|
344
|
+
readonly bindings: SSAOBindings;
|
|
345
|
+
readonly uniformTypes: {
|
|
346
|
+
readonly nearPlane: "f32";
|
|
347
|
+
readonly farPlane: "f32";
|
|
348
|
+
readonly radius: "f32";
|
|
349
|
+
readonly bias: "f32";
|
|
350
|
+
readonly intensity: "f32";
|
|
351
|
+
readonly useNormalTexture: "f32";
|
|
352
|
+
};
|
|
353
|
+
readonly propTypes: {
|
|
354
|
+
readonly nearPlane: {
|
|
355
|
+
readonly value: 0.1;
|
|
356
|
+
};
|
|
357
|
+
readonly farPlane: {
|
|
358
|
+
readonly value: 200;
|
|
359
|
+
};
|
|
360
|
+
readonly radius: {
|
|
361
|
+
readonly value: 7;
|
|
362
|
+
readonly min: 1;
|
|
363
|
+
readonly softMax: 32;
|
|
364
|
+
};
|
|
365
|
+
readonly bias: {
|
|
366
|
+
readonly value: 0.03;
|
|
367
|
+
readonly min: 0;
|
|
368
|
+
readonly softMax: 0.2;
|
|
369
|
+
};
|
|
370
|
+
readonly intensity: {
|
|
371
|
+
readonly value: 1.35;
|
|
372
|
+
readonly min: 0;
|
|
373
|
+
readonly softMax: 4;
|
|
374
|
+
};
|
|
375
|
+
readonly useNormalTexture: {
|
|
376
|
+
readonly value: 0;
|
|
377
|
+
readonly min: 0;
|
|
378
|
+
readonly max: 1;
|
|
379
|
+
readonly private: true;
|
|
380
|
+
};
|
|
381
|
+
};
|
|
382
|
+
readonly passes: [{
|
|
383
|
+
readonly sampler: true;
|
|
384
|
+
}];
|
|
385
|
+
};
|
|
386
|
+
readonly output: "ssaoRaw";
|
|
387
|
+
}, {
|
|
388
|
+
readonly kind: "fullscreen";
|
|
389
|
+
readonly shaderPass: {
|
|
390
|
+
readonly name: "depthAwareBlur";
|
|
391
|
+
readonly source: "struct depthAwareBlurUniforms {\n direction: vec2f,\n radius: f32,\n depthSigma: f32,\n spatialSigma: f32,\n};\n\n@group(0) @binding(auto) var<uniform> depthAwareBlur: depthAwareBlurUniforms;\n@group(0) @binding(auto) var depthTexture: texture_depth_2d;\n@group(0) @binding(auto) var depthTextureSampler: sampler;\n\nfn depthAwareBlur_sampleColor(\n sourceTexture: texture_2d<f32>,\n sourceTextureSampler: sampler,\n texSize: vec2f,\n texCoord: vec2f\n) -> vec4f {\n let sourceDimensions = vec2f(textureDimensions(sourceTexture));\n let texel = depthAwareBlur.direction / sourceDimensions;\n let centerDepth = textureSample(depthTexture, depthTextureSampler, texCoord);\n var color = textureSample(sourceTexture, sourceTextureSampler, texCoord);\n var totalWeight = 1.0;\n for (var index: i32 = 1; index <= 8; index++) {\n if (f32(index) > depthAwareBlur.radius) { break; }\n let offset = texel * f32(index);\n for (var side: i32 = -1; side <= 1; side += 2) {\n let sampleUv = clamp(texCoord + offset * f32(side), vec2f(0.0), vec2f(1.0));\n let sampleDepth = textureSample(depthTexture, depthTextureSampler, sampleUv);\n let spatialWeight = exp(-f32(index * index) / max(2.0 * depthAwareBlur.spatialSigma * depthAwareBlur.spatialSigma, 0.0001));\n let depthDelta = abs(sampleDepth - centerDepth);\n let depthWeight = exp(-(depthDelta * depthDelta) / max(2.0 * depthAwareBlur.depthSigma * depthAwareBlur.depthSigma, 0.000001));\n let weight = spatialWeight * depthWeight;\n color += textureSample(sourceTexture, sourceTextureSampler, sampleUv) * weight;\n totalWeight += weight;\n }\n }\n return color / totalWeight;\n}\n";
|
|
392
|
+
readonly bindingLayout: readonly [{
|
|
393
|
+
readonly name: "depthTexture";
|
|
394
|
+
readonly group: 0;
|
|
395
|
+
}];
|
|
396
|
+
readonly props: import("./depth-aware-blur").DepthAwareBlurProps & {
|
|
397
|
+
depthTexture?: Texture;
|
|
398
|
+
};
|
|
399
|
+
readonly uniforms: Required<import("./depth-aware-blur").DepthAwareBlurProps>;
|
|
400
|
+
readonly bindings: {
|
|
401
|
+
depthTexture?: Texture;
|
|
402
|
+
};
|
|
403
|
+
readonly uniformTypes: {
|
|
404
|
+
readonly direction: "vec2<f32>";
|
|
405
|
+
readonly radius: "f32";
|
|
406
|
+
readonly depthSigma: "f32";
|
|
407
|
+
readonly spatialSigma: "f32";
|
|
408
|
+
};
|
|
409
|
+
readonly propTypes: {
|
|
410
|
+
readonly direction: {
|
|
411
|
+
readonly value: readonly [1, 0];
|
|
412
|
+
};
|
|
413
|
+
readonly radius: {
|
|
414
|
+
readonly value: 4;
|
|
415
|
+
readonly min: 1;
|
|
416
|
+
readonly max: 8;
|
|
417
|
+
};
|
|
418
|
+
readonly depthSigma: {
|
|
419
|
+
readonly value: 0.01;
|
|
420
|
+
readonly min: 0.0001;
|
|
421
|
+
readonly softMax: 0.1;
|
|
422
|
+
};
|
|
423
|
+
readonly spatialSigma: {
|
|
424
|
+
readonly value: 3;
|
|
425
|
+
readonly min: 0.1;
|
|
426
|
+
readonly softMax: 8;
|
|
427
|
+
};
|
|
428
|
+
};
|
|
429
|
+
readonly passes: [{
|
|
430
|
+
readonly sampler: true;
|
|
431
|
+
}];
|
|
432
|
+
};
|
|
433
|
+
readonly inputs: {
|
|
434
|
+
readonly sourceTexture: "ssaoRaw";
|
|
435
|
+
};
|
|
436
|
+
readonly output: "ssaoScratch";
|
|
437
|
+
readonly uniforms: {
|
|
438
|
+
readonly direction: [1, 0];
|
|
439
|
+
};
|
|
440
|
+
}, {
|
|
441
|
+
readonly kind: "fullscreen";
|
|
442
|
+
readonly shaderPass: {
|
|
443
|
+
readonly name: "depthAwareBlur";
|
|
444
|
+
readonly source: "struct depthAwareBlurUniforms {\n direction: vec2f,\n radius: f32,\n depthSigma: f32,\n spatialSigma: f32,\n};\n\n@group(0) @binding(auto) var<uniform> depthAwareBlur: depthAwareBlurUniforms;\n@group(0) @binding(auto) var depthTexture: texture_depth_2d;\n@group(0) @binding(auto) var depthTextureSampler: sampler;\n\nfn depthAwareBlur_sampleColor(\n sourceTexture: texture_2d<f32>,\n sourceTextureSampler: sampler,\n texSize: vec2f,\n texCoord: vec2f\n) -> vec4f {\n let sourceDimensions = vec2f(textureDimensions(sourceTexture));\n let texel = depthAwareBlur.direction / sourceDimensions;\n let centerDepth = textureSample(depthTexture, depthTextureSampler, texCoord);\n var color = textureSample(sourceTexture, sourceTextureSampler, texCoord);\n var totalWeight = 1.0;\n for (var index: i32 = 1; index <= 8; index++) {\n if (f32(index) > depthAwareBlur.radius) { break; }\n let offset = texel * f32(index);\n for (var side: i32 = -1; side <= 1; side += 2) {\n let sampleUv = clamp(texCoord + offset * f32(side), vec2f(0.0), vec2f(1.0));\n let sampleDepth = textureSample(depthTexture, depthTextureSampler, sampleUv);\n let spatialWeight = exp(-f32(index * index) / max(2.0 * depthAwareBlur.spatialSigma * depthAwareBlur.spatialSigma, 0.0001));\n let depthDelta = abs(sampleDepth - centerDepth);\n let depthWeight = exp(-(depthDelta * depthDelta) / max(2.0 * depthAwareBlur.depthSigma * depthAwareBlur.depthSigma, 0.000001));\n let weight = spatialWeight * depthWeight;\n color += textureSample(sourceTexture, sourceTextureSampler, sampleUv) * weight;\n totalWeight += weight;\n }\n }\n return color / totalWeight;\n}\n";
|
|
445
|
+
readonly bindingLayout: readonly [{
|
|
446
|
+
readonly name: "depthTexture";
|
|
447
|
+
readonly group: 0;
|
|
448
|
+
}];
|
|
449
|
+
readonly props: import("./depth-aware-blur").DepthAwareBlurProps & {
|
|
450
|
+
depthTexture?: Texture;
|
|
451
|
+
};
|
|
452
|
+
readonly uniforms: Required<import("./depth-aware-blur").DepthAwareBlurProps>;
|
|
453
|
+
readonly bindings: {
|
|
454
|
+
depthTexture?: Texture;
|
|
455
|
+
};
|
|
456
|
+
readonly uniformTypes: {
|
|
457
|
+
readonly direction: "vec2<f32>";
|
|
458
|
+
readonly radius: "f32";
|
|
459
|
+
readonly depthSigma: "f32";
|
|
460
|
+
readonly spatialSigma: "f32";
|
|
461
|
+
};
|
|
462
|
+
readonly propTypes: {
|
|
463
|
+
readonly direction: {
|
|
464
|
+
readonly value: readonly [1, 0];
|
|
465
|
+
};
|
|
466
|
+
readonly radius: {
|
|
467
|
+
readonly value: 4;
|
|
468
|
+
readonly min: 1;
|
|
469
|
+
readonly max: 8;
|
|
470
|
+
};
|
|
471
|
+
readonly depthSigma: {
|
|
472
|
+
readonly value: 0.01;
|
|
473
|
+
readonly min: 0.0001;
|
|
474
|
+
readonly softMax: 0.1;
|
|
475
|
+
};
|
|
476
|
+
readonly spatialSigma: {
|
|
477
|
+
readonly value: 3;
|
|
478
|
+
readonly min: 0.1;
|
|
479
|
+
readonly softMax: 8;
|
|
480
|
+
};
|
|
481
|
+
};
|
|
482
|
+
readonly passes: [{
|
|
483
|
+
readonly sampler: true;
|
|
484
|
+
}];
|
|
485
|
+
};
|
|
486
|
+
readonly inputs: {
|
|
487
|
+
readonly sourceTexture: "ssaoScratch";
|
|
488
|
+
};
|
|
489
|
+
readonly output: "ssaoBlurred";
|
|
490
|
+
readonly uniforms: {
|
|
491
|
+
readonly direction: [0, 1];
|
|
492
|
+
};
|
|
493
|
+
}, {
|
|
494
|
+
readonly kind: "fullscreen";
|
|
495
|
+
readonly shaderPass: {
|
|
496
|
+
readonly name: "ssaoComposite";
|
|
497
|
+
readonly source: "struct ssaoCompositeUniforms {\n debugMode: f32,\n};\n@group(0) @binding(auto) var<uniform> ssaoComposite: ssaoCompositeUniforms;\n@group(0) @binding(auto) var ambientOcclusionTexture: texture_2d<f32>;\n@group(0) @binding(auto) var ambientOcclusionTextureSampler: sampler;\nfn ssaoComposite_sampleColor(\n sourceTexture: texture_2d<f32>, sourceTextureSampler: sampler, texSize: vec2f, texCoord: vec2f\n) -> vec4f {\n let color = textureSample(sourceTexture, sourceTextureSampler, texCoord);\n let ambient = textureSample(ambientOcclusionTexture, ambientOcclusionTextureSampler, texCoord).r;\n if (ssaoComposite.debugMode > 0.5) { return vec4f(vec3f(ambient), 1.0); }\n let rawOcclusion = clamp(1.0 - ambient, 0.0, 1.0);\n let contactOcclusion = smoothstep(0.03, 0.5, rawOcclusion);\n return vec4f(color.rgb * (1.0 - contactOcclusion * 0.48), color.a);\n}";
|
|
498
|
+
readonly bindingLayout: readonly [{
|
|
499
|
+
readonly name: "ambientOcclusionTexture";
|
|
500
|
+
readonly group: 0;
|
|
501
|
+
}];
|
|
502
|
+
readonly uniformTypes: {
|
|
503
|
+
readonly debugMode: "f32";
|
|
504
|
+
};
|
|
505
|
+
readonly propTypes: {
|
|
506
|
+
readonly debugMode: {
|
|
507
|
+
readonly value: 0;
|
|
508
|
+
readonly min: 0;
|
|
509
|
+
readonly max: 1;
|
|
510
|
+
readonly private: true;
|
|
511
|
+
};
|
|
512
|
+
};
|
|
513
|
+
readonly passes: [{
|
|
514
|
+
readonly sampler: true;
|
|
515
|
+
}];
|
|
516
|
+
};
|
|
517
|
+
readonly inputs: {
|
|
518
|
+
readonly sourceTexture: "previous";
|
|
519
|
+
readonly ambientOcclusionTexture: "ssaoBlurred";
|
|
520
|
+
};
|
|
521
|
+
readonly output: "previous";
|
|
522
|
+
}];
|
|
523
|
+
};
|
|
524
|
+
};
|
|
525
|
+
};
|
|
526
|
+
readonly name: "ssaoCompositeShaderPass";
|
|
527
|
+
readonly resources: {
|
|
528
|
+
readonly ssaoRaw: {
|
|
529
|
+
readonly scale: [1, 1];
|
|
530
|
+
readonly format: "rgba8unorm";
|
|
531
|
+
};
|
|
532
|
+
readonly ssaoScratch: {
|
|
533
|
+
readonly scale: [1, 1];
|
|
534
|
+
readonly format: "rgba8unorm";
|
|
535
|
+
};
|
|
536
|
+
readonly ssaoBlurred: {
|
|
537
|
+
readonly scale: [1, 1];
|
|
538
|
+
readonly format: "rgba8unorm";
|
|
539
|
+
};
|
|
540
|
+
};
|
|
541
|
+
readonly passes: [{
|
|
542
|
+
readonly kind: "fullscreen";
|
|
543
|
+
readonly shaderPass: {
|
|
544
|
+
readonly name: "ssaoEvaluate";
|
|
545
|
+
readonly source: "fn advancedSceneUV(uv: vec2f) -> vec2f {\n return uv;\n}\n\nfn advancedLinearDepth(depth: f32, nearPlane: f32, farPlane: f32) -> f32 {\n return (nearPlane * farPlane) / max(farPlane - depth * (farPlane - nearPlane), 0.0001);\n}\n\nfn advancedDepthNormal(depthTexture: texture_depth_2d, depthTextureSampler: sampler, uv: vec2f) -> vec3f {\n let dimensions = vec2i(textureDimensions(depthTexture));\n let coordinate = clamp(vec2i(uv * vec2f(dimensions)), vec2i(0), dimensions - vec2i(1));\n let center = textureLoad(depthTexture, coordinate, 0);\n let right = textureLoad(depthTexture, min(coordinate + vec2i(1, 0), dimensions - vec2i(1)), 0);\n let up = textureLoad(depthTexture, min(coordinate + vec2i(0, 1), dimensions - vec2i(1)), 0);\n return normalize(vec3f((center - right) * f32(dimensions.x), (center - up) * f32(dimensions.y), 1.0));\n}\n\nstruct ssaoEvaluateUniforms {\n nearPlane: f32,\n farPlane: f32,\n radius: f32,\n bias: f32,\n intensity: f32,\n useNormalTexture: f32,\n};\n@group(0) @binding(auto) var<uniform> ssaoEvaluate: ssaoEvaluateUniforms;\n@group(0) @binding(auto) var depthTexture: texture_depth_2d;\n@group(0) @binding(auto) var depthTextureSampler: sampler;\n@group(0) @binding(auto) var normalTexture: texture_2d<f32>;\n@group(0) @binding(auto) var normalTextureSampler: sampler;\n\nfn ssaoEvaluate_sampleColor(\n sourceTexture: texture_2d<f32>, sourceTextureSampler: sampler, texSize: vec2f, texCoord: vec2f\n) -> vec4f {\n let sceneCoord = advancedSceneUV(texCoord);\n let depth = textureSample(depthTexture, depthTextureSampler, sceneCoord);\n let dimensions = vec2f(textureDimensions(depthTexture));\n let linearDepth = advancedLinearDepth(depth, ssaoEvaluate.nearPlane, ssaoEvaluate.farPlane);\n let reconstructedNormal = advancedDepthNormal(depthTexture, depthTextureSampler, sceneCoord);\n let viewNormal = textureSample(normalTexture, normalTextureSampler, sceneCoord).xyz * 2.0 - 1.0;\n // G-buffer normals use +Y up, while WebGPU texture sample offsets use +Y down.\n let textureNormal = normalize(viewNormal * vec3f(1.0, -1.0, 1.0));\n let normal = normalize(mix(reconstructedNormal, textureNormal, ssaoEvaluate.useNormalTexture));\n let angle = fract(sin(dot(texCoord * dimensions, vec2f(12.9898, 78.233))) * 43758.5453) * 6.2831853;\n var occlusion = 0.0;\n for (var index: i32 = 0; index < 12; index++) {\n let sampleAngle = angle + f32(index) * 2.399963;\n let sampleRadius = (0.25 + 0.75 * f32(index + 1) / 12.0) * ssaoEvaluate.radius;\n let direction = vec2f(cos(sampleAngle), sin(sampleAngle));\n let sampleUv = clamp(texCoord + direction * sampleRadius / dimensions, vec2f(0.0), vec2f(1.0));\n let sampleDepth = textureSampleLevel(depthTexture, depthTextureSampler, advancedSceneUV(sampleUv), 0);\n let sampleLinearDepth = advancedLinearDepth(sampleDepth, ssaoEvaluate.nearPlane, ssaoEvaluate.farPlane);\n let rangeWeight = smoothstep(ssaoEvaluate.radius * 2.0, 0.0, abs(sampleLinearDepth - linearDepth));\n let horizonWeight = max(dot(normal, normalize(vec3f(direction, 0.35))), 0.15);\n occlusion += select(0.0, rangeWeight * horizonWeight, sampleLinearDepth + ssaoEvaluate.bias < linearDepth);\n }\n let ambient = select(clamp(1.0 - occlusion / 12.0 * ssaoEvaluate.intensity, 0.0, 1.0), 1.0, depth >= 0.99999);\n return vec4f(vec3f(ambient), 1.0);\n}\n";
|
|
546
|
+
readonly bindingLayout: readonly [{
|
|
547
|
+
readonly name: "depthTexture";
|
|
548
|
+
readonly group: 0;
|
|
549
|
+
}, {
|
|
550
|
+
readonly name: "normalTexture";
|
|
551
|
+
readonly group: 0;
|
|
552
|
+
}];
|
|
553
|
+
readonly props: Partial<SSAOUniforms> & SSAOBindings;
|
|
554
|
+
readonly uniforms: SSAOUniforms;
|
|
555
|
+
readonly bindings: SSAOBindings;
|
|
556
|
+
readonly uniformTypes: {
|
|
557
|
+
readonly nearPlane: "f32";
|
|
558
|
+
readonly farPlane: "f32";
|
|
559
|
+
readonly radius: "f32";
|
|
560
|
+
readonly bias: "f32";
|
|
561
|
+
readonly intensity: "f32";
|
|
562
|
+
readonly useNormalTexture: "f32";
|
|
563
|
+
};
|
|
564
|
+
readonly propTypes: {
|
|
565
|
+
readonly nearPlane: {
|
|
566
|
+
readonly value: 0.1;
|
|
567
|
+
};
|
|
568
|
+
readonly farPlane: {
|
|
569
|
+
readonly value: 200;
|
|
570
|
+
};
|
|
571
|
+
readonly radius: {
|
|
572
|
+
readonly value: 7;
|
|
573
|
+
readonly min: 1;
|
|
574
|
+
readonly softMax: 32;
|
|
575
|
+
};
|
|
576
|
+
readonly bias: {
|
|
577
|
+
readonly value: 0.03;
|
|
578
|
+
readonly min: 0;
|
|
579
|
+
readonly softMax: 0.2;
|
|
580
|
+
};
|
|
581
|
+
readonly intensity: {
|
|
582
|
+
readonly value: 1.35;
|
|
583
|
+
readonly min: 0;
|
|
584
|
+
readonly softMax: 4;
|
|
585
|
+
};
|
|
586
|
+
readonly useNormalTexture: {
|
|
587
|
+
readonly value: 0;
|
|
588
|
+
readonly min: 0;
|
|
589
|
+
readonly max: 1;
|
|
590
|
+
readonly private: true;
|
|
591
|
+
};
|
|
592
|
+
};
|
|
593
|
+
readonly passes: [{
|
|
594
|
+
readonly sampler: true;
|
|
595
|
+
}];
|
|
596
|
+
};
|
|
597
|
+
readonly inputs: {
|
|
598
|
+
readonly sourceTexture: "previous";
|
|
599
|
+
readonly normalTexture: "previous";
|
|
600
|
+
};
|
|
601
|
+
readonly output: "ssaoRaw";
|
|
602
|
+
readonly uniforms: {
|
|
603
|
+
readonly useNormalTexture: 0;
|
|
604
|
+
};
|
|
605
|
+
}, {
|
|
606
|
+
readonly kind: "fullscreen";
|
|
607
|
+
readonly shaderPass: {
|
|
608
|
+
readonly name: "depthAwareBlur";
|
|
609
|
+
readonly source: "struct depthAwareBlurUniforms {\n direction: vec2f,\n radius: f32,\n depthSigma: f32,\n spatialSigma: f32,\n};\n\n@group(0) @binding(auto) var<uniform> depthAwareBlur: depthAwareBlurUniforms;\n@group(0) @binding(auto) var depthTexture: texture_depth_2d;\n@group(0) @binding(auto) var depthTextureSampler: sampler;\n\nfn depthAwareBlur_sampleColor(\n sourceTexture: texture_2d<f32>,\n sourceTextureSampler: sampler,\n texSize: vec2f,\n texCoord: vec2f\n) -> vec4f {\n let sourceDimensions = vec2f(textureDimensions(sourceTexture));\n let texel = depthAwareBlur.direction / sourceDimensions;\n let centerDepth = textureSample(depthTexture, depthTextureSampler, texCoord);\n var color = textureSample(sourceTexture, sourceTextureSampler, texCoord);\n var totalWeight = 1.0;\n for (var index: i32 = 1; index <= 8; index++) {\n if (f32(index) > depthAwareBlur.radius) { break; }\n let offset = texel * f32(index);\n for (var side: i32 = -1; side <= 1; side += 2) {\n let sampleUv = clamp(texCoord + offset * f32(side), vec2f(0.0), vec2f(1.0));\n let sampleDepth = textureSample(depthTexture, depthTextureSampler, sampleUv);\n let spatialWeight = exp(-f32(index * index) / max(2.0 * depthAwareBlur.spatialSigma * depthAwareBlur.spatialSigma, 0.0001));\n let depthDelta = abs(sampleDepth - centerDepth);\n let depthWeight = exp(-(depthDelta * depthDelta) / max(2.0 * depthAwareBlur.depthSigma * depthAwareBlur.depthSigma, 0.000001));\n let weight = spatialWeight * depthWeight;\n color += textureSample(sourceTexture, sourceTextureSampler, sampleUv) * weight;\n totalWeight += weight;\n }\n }\n return color / totalWeight;\n}\n";
|
|
610
|
+
readonly bindingLayout: readonly [{
|
|
611
|
+
readonly name: "depthTexture";
|
|
612
|
+
readonly group: 0;
|
|
613
|
+
}];
|
|
614
|
+
readonly props: import("./depth-aware-blur").DepthAwareBlurProps & {
|
|
615
|
+
depthTexture?: Texture;
|
|
616
|
+
};
|
|
617
|
+
readonly uniforms: Required<import("./depth-aware-blur").DepthAwareBlurProps>;
|
|
618
|
+
readonly bindings: {
|
|
619
|
+
depthTexture?: Texture;
|
|
620
|
+
};
|
|
621
|
+
readonly uniformTypes: {
|
|
622
|
+
readonly direction: "vec2<f32>";
|
|
623
|
+
readonly radius: "f32";
|
|
624
|
+
readonly depthSigma: "f32";
|
|
625
|
+
readonly spatialSigma: "f32";
|
|
626
|
+
};
|
|
627
|
+
readonly propTypes: {
|
|
628
|
+
readonly direction: {
|
|
629
|
+
readonly value: readonly [1, 0];
|
|
630
|
+
};
|
|
631
|
+
readonly radius: {
|
|
632
|
+
readonly value: 4;
|
|
633
|
+
readonly min: 1;
|
|
634
|
+
readonly max: 8;
|
|
635
|
+
};
|
|
636
|
+
readonly depthSigma: {
|
|
637
|
+
readonly value: 0.01;
|
|
638
|
+
readonly min: 0.0001;
|
|
639
|
+
readonly softMax: 0.1;
|
|
640
|
+
};
|
|
641
|
+
readonly spatialSigma: {
|
|
642
|
+
readonly value: 3;
|
|
643
|
+
readonly min: 0.1;
|
|
644
|
+
readonly softMax: 8;
|
|
645
|
+
};
|
|
646
|
+
};
|
|
647
|
+
readonly passes: [{
|
|
648
|
+
readonly sampler: true;
|
|
649
|
+
}];
|
|
650
|
+
};
|
|
651
|
+
readonly inputs: {
|
|
652
|
+
readonly sourceTexture: "ssaoRaw";
|
|
653
|
+
};
|
|
654
|
+
readonly output: "ssaoScratch";
|
|
655
|
+
readonly uniforms: {
|
|
656
|
+
readonly direction: [1, 0];
|
|
657
|
+
};
|
|
658
|
+
}, {
|
|
659
|
+
readonly kind: "fullscreen";
|
|
660
|
+
readonly shaderPass: {
|
|
661
|
+
readonly name: "depthAwareBlur";
|
|
662
|
+
readonly source: "struct depthAwareBlurUniforms {\n direction: vec2f,\n radius: f32,\n depthSigma: f32,\n spatialSigma: f32,\n};\n\n@group(0) @binding(auto) var<uniform> depthAwareBlur: depthAwareBlurUniforms;\n@group(0) @binding(auto) var depthTexture: texture_depth_2d;\n@group(0) @binding(auto) var depthTextureSampler: sampler;\n\nfn depthAwareBlur_sampleColor(\n sourceTexture: texture_2d<f32>,\n sourceTextureSampler: sampler,\n texSize: vec2f,\n texCoord: vec2f\n) -> vec4f {\n let sourceDimensions = vec2f(textureDimensions(sourceTexture));\n let texel = depthAwareBlur.direction / sourceDimensions;\n let centerDepth = textureSample(depthTexture, depthTextureSampler, texCoord);\n var color = textureSample(sourceTexture, sourceTextureSampler, texCoord);\n var totalWeight = 1.0;\n for (var index: i32 = 1; index <= 8; index++) {\n if (f32(index) > depthAwareBlur.radius) { break; }\n let offset = texel * f32(index);\n for (var side: i32 = -1; side <= 1; side += 2) {\n let sampleUv = clamp(texCoord + offset * f32(side), vec2f(0.0), vec2f(1.0));\n let sampleDepth = textureSample(depthTexture, depthTextureSampler, sampleUv);\n let spatialWeight = exp(-f32(index * index) / max(2.0 * depthAwareBlur.spatialSigma * depthAwareBlur.spatialSigma, 0.0001));\n let depthDelta = abs(sampleDepth - centerDepth);\n let depthWeight = exp(-(depthDelta * depthDelta) / max(2.0 * depthAwareBlur.depthSigma * depthAwareBlur.depthSigma, 0.000001));\n let weight = spatialWeight * depthWeight;\n color += textureSample(sourceTexture, sourceTextureSampler, sampleUv) * weight;\n totalWeight += weight;\n }\n }\n return color / totalWeight;\n}\n";
|
|
663
|
+
readonly bindingLayout: readonly [{
|
|
664
|
+
readonly name: "depthTexture";
|
|
665
|
+
readonly group: 0;
|
|
666
|
+
}];
|
|
667
|
+
readonly props: import("./depth-aware-blur").DepthAwareBlurProps & {
|
|
668
|
+
depthTexture?: Texture;
|
|
669
|
+
};
|
|
670
|
+
readonly uniforms: Required<import("./depth-aware-blur").DepthAwareBlurProps>;
|
|
671
|
+
readonly bindings: {
|
|
672
|
+
depthTexture?: Texture;
|
|
673
|
+
};
|
|
674
|
+
readonly uniformTypes: {
|
|
675
|
+
readonly direction: "vec2<f32>";
|
|
676
|
+
readonly radius: "f32";
|
|
677
|
+
readonly depthSigma: "f32";
|
|
678
|
+
readonly spatialSigma: "f32";
|
|
679
|
+
};
|
|
680
|
+
readonly propTypes: {
|
|
681
|
+
readonly direction: {
|
|
682
|
+
readonly value: readonly [1, 0];
|
|
683
|
+
};
|
|
684
|
+
readonly radius: {
|
|
685
|
+
readonly value: 4;
|
|
686
|
+
readonly min: 1;
|
|
687
|
+
readonly max: 8;
|
|
688
|
+
};
|
|
689
|
+
readonly depthSigma: {
|
|
690
|
+
readonly value: 0.01;
|
|
691
|
+
readonly min: 0.0001;
|
|
692
|
+
readonly softMax: 0.1;
|
|
693
|
+
};
|
|
694
|
+
readonly spatialSigma: {
|
|
695
|
+
readonly value: 3;
|
|
696
|
+
readonly min: 0.1;
|
|
697
|
+
readonly softMax: 8;
|
|
698
|
+
};
|
|
699
|
+
};
|
|
700
|
+
readonly passes: [{
|
|
701
|
+
readonly sampler: true;
|
|
702
|
+
}];
|
|
703
|
+
};
|
|
704
|
+
readonly inputs: {
|
|
705
|
+
readonly sourceTexture: "ssaoScratch";
|
|
706
|
+
};
|
|
707
|
+
readonly output: "ssaoBlurred";
|
|
708
|
+
readonly uniforms: {
|
|
709
|
+
readonly direction: [0, 1];
|
|
710
|
+
};
|
|
711
|
+
}, {
|
|
712
|
+
readonly kind: "fullscreen";
|
|
713
|
+
readonly shaderPass: {
|
|
714
|
+
readonly name: "ssaoComposite";
|
|
715
|
+
readonly source: "struct ssaoCompositeUniforms {\n debugMode: f32,\n};\n@group(0) @binding(auto) var<uniform> ssaoComposite: ssaoCompositeUniforms;\n@group(0) @binding(auto) var ambientOcclusionTexture: texture_2d<f32>;\n@group(0) @binding(auto) var ambientOcclusionTextureSampler: sampler;\nfn ssaoComposite_sampleColor(\n sourceTexture: texture_2d<f32>, sourceTextureSampler: sampler, texSize: vec2f, texCoord: vec2f\n) -> vec4f {\n let color = textureSample(sourceTexture, sourceTextureSampler, texCoord);\n let ambient = textureSample(ambientOcclusionTexture, ambientOcclusionTextureSampler, texCoord).r;\n if (ssaoComposite.debugMode > 0.5) { return vec4f(vec3f(ambient), 1.0); }\n let rawOcclusion = clamp(1.0 - ambient, 0.0, 1.0);\n let contactOcclusion = smoothstep(0.03, 0.5, rawOcclusion);\n return vec4f(color.rgb * (1.0 - contactOcclusion * 0.48), color.a);\n}";
|
|
716
|
+
readonly bindingLayout: readonly [{
|
|
717
|
+
readonly name: "ambientOcclusionTexture";
|
|
718
|
+
readonly group: 0;
|
|
719
|
+
}];
|
|
720
|
+
readonly uniformTypes: {
|
|
721
|
+
readonly debugMode: "f32";
|
|
722
|
+
};
|
|
723
|
+
readonly propTypes: {
|
|
724
|
+
readonly debugMode: {
|
|
725
|
+
readonly value: 0;
|
|
726
|
+
readonly min: 0;
|
|
727
|
+
readonly max: 1;
|
|
728
|
+
readonly private: true;
|
|
729
|
+
};
|
|
730
|
+
};
|
|
731
|
+
readonly passes: [{
|
|
732
|
+
readonly sampler: true;
|
|
733
|
+
}];
|
|
734
|
+
};
|
|
735
|
+
readonly inputs: {
|
|
736
|
+
readonly sourceTexture: "previous";
|
|
737
|
+
readonly ambientOcclusionTexture: "ssaoBlurred";
|
|
738
|
+
};
|
|
739
|
+
readonly output: "previous";
|
|
740
|
+
}];
|
|
741
|
+
};
|
|
97
742
|
export {};
|
|
98
743
|
//# sourceMappingURL=ssao.d.ts.map
|