@woosh/meep-engine 3.60.3 → 3.60.4
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/editor/ecs/component/editors/ecs/Trail3DEditor.d.ts +3 -0
- package/editor/ecs/component/editors/ecs/Trail3DEditor.d.ts.map +1 -1
- package/editor/ecs/component/editors/ecs/Trail3DEditor.js +6 -0
- package/package.json +1 -1
- package/src/engine/ecs/ik/PLAN.md +1 -1
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometryFlags.js +1 -2
- package/src/engine/graphics/ecs/trail3d/TRAIL3D_FADE_LINEAR.d.ts +14 -0
- package/src/engine/graphics/ecs/trail3d/TRAIL3D_FADE_LINEAR.d.ts.map +1 -0
- package/src/engine/graphics/ecs/trail3d/TRAIL3D_FADE_LINEAR.js +22 -0
- package/src/engine/graphics/ecs/trail3d/Trail3D.d.ts +19 -3
- package/src/engine/graphics/ecs/trail3d/Trail3D.d.ts.map +1 -1
- package/src/engine/graphics/ecs/trail3d/Trail3D.js +31 -4
- package/src/engine/graphics/ecs/trail3d/advance_trail.js +1 -1
- package/src/engine/graphics/trail/tube/simulator/TubeXFixedPhysicsSimulator.d.ts +5 -5
- package/src/engine/graphics/trail/tube/simulator/TubeXFixedPhysicsSimulator.d.ts.map +1 -1
- package/src/engine/graphics/trail/tube/simulator/TubeXFixedPhysicsSimulator.js +6 -6
- package/src/engine/graphics3/trail/trail_tube_write_geometry.d.ts +10 -0
- package/src/engine/graphics3/trail/trail_tube_write_geometry.d.ts.map +1 -1
- package/src/engine/graphics3/trail/trail_tube_write_geometry.js +13 -1
- package/src/engine/physics/cloth/ecs/cloth_geodesic.d.ts +2 -2
- package/src/engine/physics/cloth/ecs/cloth_geodesic.js +2 -2
- package/src/shade/playground/probe_clipmap/README.md +1 -0
- package/src/shade/playground/probe_clipmap/index.html +5 -0
- package/src/shade/playground/probe_clipmap/main.d.ts.map +1 -1
- package/src/shade/playground/probe_clipmap/main.js +16 -2
- package/src/shade/playground/vgeo_scene/README.md +1 -1
- package/src/shade/renderer/atmosphere/MULTISCATTER_LUT_CONFIG.d.ts +4 -6
- package/src/shade/renderer/atmosphere/MULTISCATTER_LUT_CONFIG.d.ts.map +1 -1
- package/src/shade/renderer/atmosphere/MULTISCATTER_LUT_CONFIG.js +34 -36
- package/src/shade/renderer/atmosphere/chunk_get_multiscatter_values.d.ts +1 -1
- package/src/shade/renderer/atmosphere/chunk_get_multiscatter_values.d.ts.map +1 -1
- package/src/shade/renderer/atmosphere/chunk_get_multiscatter_values.js +162 -163
- package/src/shade/renderer/atmosphere/compute_mie_absorption.d.ts +1 -1
- package/src/shade/renderer/atmosphere/compute_mie_absorption.js +1 -1
- package/src/shade/renderer/atmosphere/hillaire/ATMOSPHERE_EARTH.js +1 -1
- package/src/shade/renderer/atmosphere/hillaire/ATMOSPHERE_PARAMETERS_STRUCT.js +1 -1
- package/src/shade/renderer/atmosphere/shader_multiscatter_lut.js +164 -164
- package/src/shade/renderer/atmosphere/shader_sky_irradiance_lut.js +1 -1
- package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts +2 -2
- package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.js +2 -2
- package/src/shade/renderer/geometry/sdf/cards/mesh_cards_raster_pass_descriptor.js +2 -2
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_histogram.d.ts +1 -1
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_histogram.js +1 -1
- package/src/shade/renderer/geometry/sdf/chunk_blas_query_band_sdf.d.ts +4 -5
- package/src/shade/renderer/geometry/sdf/chunk_blas_query_band_sdf.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/chunk_blas_query_band_sdf.js +6 -7
- package/src/shade/renderer/geometry/virtual/ATTRIBUTE_PLAN_2026_09_18.md +1 -1
- package/src/shade/renderer/geometry/virtual/VIRTUAL_GEOMETRY_PLAN.md +2 -4
- package/src/shade/renderer/geometry/virtual/WEDGE_PLAN_2026_09_18.md +1 -1
- package/src/shade/renderer/geometry/virtual/runtime/SHADOW_PLAN_2026_09_28.md +3 -10
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.js +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/PROBE_CLIPMAP_PROPOSAL_2026_10_27.md +119 -38
- package/src/shade/renderer/global_illumination/probe_clipmap/PROBE_RAYS_VARIABLE_AND_SORTED_SCOPE_2026_10_30.md +2 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts +12 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.js +22 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts +4 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.js +50 -4
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.d.ts +6 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.js +7 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP_RESAMPLING.d.ts +13 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP_RESAMPLING.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP_RESAMPLING.js +13 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.d.ts +17 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.js +20 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_resampled.d.ts +18 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_resampled.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_resampled.js +42 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_sample_radiance.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_sample_radiance.js +5 -4
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.d.ts +4 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.js +13 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_resample.d.ts +52 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_resample.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_resample.js +250 -0
- package/src/shade/renderer/light/cluster/PROPOSAL_ALGORITHM_2026_10_16.md +7 -7
- package/src/shade/renderer/light/cluster/PROPOSAL_HIERARCHICAL_2026_10_16.md +2 -2
- package/src/shade/renderer/light/environment/environment_level_1_blur_plan.d.ts +39 -0
- package/src/shade/renderer/light/environment/environment_level_1_blur_plan.d.ts.map +1 -0
- package/src/shade/renderer/light/environment/environment_level_1_blur_plan.js +119 -0
- package/src/shade/renderer/light/environment/execute_filter_environment_map.d.ts +15 -7
- package/src/shade/renderer/light/environment/execute_filter_environment_map.d.ts.map +1 -1
- package/src/shade/renderer/light/environment/execute_filter_environment_map.js +66 -83
- package/src/shade/renderer/light/environment/graph_filter_environment_map.d.ts.map +1 -1
- package/src/shade/renderer/light/environment/graph_filter_environment_map.js +15 -6
- package/src/shade/renderer/light/environment/shader_blur_environment_map.d.ts +3 -0
- package/src/shade/renderer/light/environment/shader_blur_environment_map.d.ts.map +1 -0
- package/src/shade/renderer/light/environment/shader_blur_environment_map.js +111 -0
- package/src/shade/renderer/light/environment/shader_convolve_reflection_map_from_blurred.d.ts +3 -0
- package/src/shade/renderer/light/environment/shader_convolve_reflection_map_from_blurred.d.ts.map +1 -0
- package/src/shade/renderer/light/environment/shader_convolve_reflection_map_from_blurred.js +128 -0
- package/src/shade/renderer/light/environment/shader_downsample_environment_map.d.ts.map +1 -1
- package/src/shade/renderer/light/environment/shader_downsample_environment_map.js +0 -1
- package/src/shade/renderer/particles/EMITTER_GLOBAL_STATE_PLAN_2026_10_29.md +1 -4
- package/src/shade/renderer/particles/ORIENTATION_PLAN_2026_10_15.md +2 -2
- package/src/shade/renderer/postprocess/nss/NOTES.md +14 -21
- package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -3
- package/src/shade/renderer/postprocess/nss/NSS.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/nss/NSS.js +1 -3
- package/src/shade/renderer/postprocess/nss/NSS_NETWORK_SCHEMA.d.ts +5 -6
- package/src/shade/renderer/postprocess/nss/NSS_NETWORK_SCHEMA.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/nss/NSS_NETWORK_SCHEMA.js +9 -10
- package/src/shade/renderer/postprocess/nss/shader_nss_extract_feedback.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/nss/shader_nss_extract_feedback.js +48 -49
- package/src/shade/renderer/postprocess/nss/shader_nss_postprocess.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/nss/shader_nss_postprocess.js +12 -16
- package/src/shade/renderer/postprocess/nss/shader_nss_preprocess.js +246 -246
- package/src/shade/renderer/rasterize/chunk_triangle_winding_is_reversed.d.ts +1 -2
- package/src/shade/renderer/rasterize/chunk_triangle_winding_is_reversed.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/chunk_triangle_winding_is_reversed.js +34 -35
- package/src/shade/renderer/shader/chunk/atmosphere/C_MIE_SCATTERING_DECLARATION.d.ts +2 -2
- package/src/shade/renderer/shader/chunk/atmosphere/C_MIE_SCATTERING_DECLARATION.js +2 -2
- package/src/shade/renderer/shader/chunk/atmosphere/NOTES.md +1 -1
- package/src/shade/renderer/shader/chunk/atmosphere/chunk_compute_extinction.js +1 -1
- package/src/shade/renderer/shader/chunk/atmosphere/hillaire/DENSITY_PROFILE_LAYER_STRUCT.d.ts +1 -1
- package/src/shade/renderer/shader/chunk/atmosphere/hillaire/DENSITY_PROFILE_LAYER_STRUCT.js +1 -1
- package/src/shade/renderer/shader/chunk/brdf/FRESNEL_BRIEF_2026_10_16.md +4 -7
- package/src/shade/renderer/shader/chunk/brdf/fresnel/chunk_F_Schlick.d.ts +3 -3
- package/src/shade/renderer/shader/chunk/brdf/fresnel/chunk_F_Schlick.js +3 -3
- package/src/shade/renderer/shader/chunk/color/tonemap/ACES_TONE_MAPPING_BRIEF_2026_10_17.md +12 -19
- package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_aces_ue_matrices.d.ts +9 -10
- package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_aces_ue_matrices.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_aces_ue_matrices.js +9 -10
- package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_tonemap_ue_filmic.d.ts +4 -4
- package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_tonemap_ue_filmic.js +5 -5
- package/src/shade/renderer/shader/chunk/material/MULTISCATTER.md +1 -1
- package/src/shade/renderer/shader/chunk/math/chunk_f16_round_stochastic.d.ts +1 -2
- package/src/shade/renderer/shader/chunk/math/chunk_f16_round_stochastic.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/math/chunk_f16_round_stochastic.js +1 -2
- package/src/shade/renderer/shader/chunk/noise/chunk_stbn_sample_vec2.d.ts +14 -1
- package/src/shade/renderer/shader/chunk/noise/chunk_stbn_sample_vec2.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/noise/chunk_stbn_sample_vec2.js +19 -6
- package/src/shade/renderer/shader/chunk/noise/chunk_stbn_sample_vec3.d.ts +10 -1
- package/src/shade/renderer/shader/chunk/noise/chunk_stbn_sample_vec3.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/noise/chunk_stbn_sample_vec3.js +14 -6
- package/src/shade/renderer/shader/chunk/random/murmur/chunk_murmur3_vec3u.d.ts +1 -1
- package/src/shade/renderer/shader/chunk/random/murmur/chunk_murmur3_vec3u.js +1 -1
- package/src/shade/renderer/shader/compiler/SHADER_SWITCH_PROPOSAL_2026_10_16.md +9 -14
- package/src/shade/renderer/shadow/contact/FINDINGS.md +5 -5
- package/src/shade/renderer/shadow/vsm/DEFAULT_VSM_MAX_DYNAMIC_LOD_BIAS.d.ts +2 -3
- package/src/shade/renderer/shadow/vsm/DEFAULT_VSM_MAX_DYNAMIC_LOD_BIAS.d.ts.map +1 -1
- package/src/shade/renderer/shadow/vsm/DEFAULT_VSM_MAX_DYNAMIC_LOD_BIAS.js +7 -8
- package/src/shade/renderer/shadow/vsm/DEFAULT_VSM_MAX_LOAD_FACTOR.d.ts +1 -1
- package/src/shade/renderer/shadow/vsm/DEFAULT_VSM_MAX_LOAD_FACTOR.js +12 -12
- package/src/shade/renderer/shadow/vsm/VSMPageManager.d.ts +2 -2
- package/src/shade/renderer/shadow/vsm/VSMPageManager.d.ts.map +1 -1
- package/src/shade/renderer/shadow/vsm/VSMPageManager.js +3 -4
- package/src/shade/renderer/texture/mipmaps/NOTES.md +1 -2
- package/src/shade/renderer/volumetrics/VOLUMETRIC_NOISE_PLAN_2026_10_15.md +1 -1
- package/src/view/elements/progress/segmented/SegmentedResourceBarView.d.ts +0 -19
- package/src/view/elements/progress/segmented/SegmentedResourceBarView.d.ts.map +1 -1
- package/src/view/elements/progress/segmented/SegmentedResourceBarView.js +2 -52
- package/src/shade/renderer/light/environment/shader_convolve_reflection_map_from_averages.d.ts +0 -13
- package/src/shade/renderer/light/environment/shader_convolve_reflection_map_from_averages.d.ts.map +0 -1
- package/src/shade/renderer/light/environment/shader_convolve_reflection_map_from_averages.js +0 -198
- package/src/view/elements/progress/segmented/segment_frame_transform.d.ts +0 -15
- package/src/view/elements/progress/segmented/segment_frame_transform.d.ts.map +0 -1
- package/src/view/elements/progress/segmented/segment_frame_transform.js +0 -69
package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_probe_clipmap.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.js"],"names":[],"mappings":"AA4DA;;;;;;GAMG;AACH,kCAFU,YAAY,CAoBG;AAEzB;;;;;GAKG;AACH,+BAFU,YAAY,CAuBA;AAEtB;;;;;;GAMG;AACH,oCAFU,wBAAwB,CAEyE;AAE3G;;;;GAIG;AACH,+CAFU,wBAAwB,CAE0G;AAE5I;;;;GAIG;AACH,0CAFU,wBAAwB,CAE+F;AAEjI;;;GAGG;AACH,yCAFU,wBAAwB,CAEwF;AAE1H;;;GAGG;AACH,2CAFU,wBAAwB,CAE+G;AAEjJ;;;GAGG;AACH,0CAFU,wBAAwB,CAEwG;AAE1I;;;GAGG;AACH,sCAFU,wBAAwB,CAEkG;AAEpI;;;;GAIG;AACH,2CAFU,wBAAwB,CAEoF;AAEtH;;;GAGG;AACH,kCAFU,wBAAwB,CAE6E;AAE/G;;;;;GAKG;AACH,oCAFU,YAAY,CAKK;AAE3B;;;GAGG;AACH,2CAFU,wBAAwB,CAE0F;AAE5H;;;GAGG;AACH,4CAFU,wBAAwB,CAEiG;AAEnI;;;GAGG;AACH,yCAFU,wBAAwB,CAEgG;AAElI;;;GAGG;AACH,0CAFU,wBAAwB,CAEyG;AAE3I;;;GAGG;AACH,4CAFU,wBAAwB,CAEoG;AAEtI;;;GAGG;AACH,yCAFU,wBAAwB,CAEwG;AAE1I;;;GAGG;AACH,yCAFU,wBAAwB,CAEiG;AAEnI;;;GAGG;AACH,wCAFU,wBAAwB,CAEyF;AAE3H;;;;GAIG;AACH,yCAFU,wBAAwB,CAEgG;AAElI;;;GAGG;AACH,0CAFU,wBAAwB,CAEmG;AAErI;;;GAGG;AACH,yCAFU,wBAAwB,CAE2F;AAE7H;;;GAGG;AACH,sCAFU,wBAAwB,CAEqF;AAEvH;;;;GAIG;AACH,2CAFU,wBAAwB,CAEiG;AAEnI;;;GAGG;AACH,0CAFU,wBAAwB,CAE0F;AAE5H;;;GAGG;AACH,wCAFU,wBAAwB,CAEsG;AAExI;;;GAGG;AACH,uCAFU,wBAAwB,CAE+F;AAEjI;;;;;GAKG;AACH,8CAFU,wBAAwB,CAE0G;AAE5I;;;;GAIG;AACH,gDAFU,wBAAwB,CAE8G;AAEhJ;;;GAGG;AACH,iDAFU,wBAAwB,CAE2G;AAE7I;;;GAGG;AACH,mDAFU,wBAAwB,CAE+G;AAEjJ;;;;;GAKG;AACH,4CAFU,wBAAwB,CAEsG;AAExI;;;GAGG;AACH,2CAFU,wBAAwB,CAE+F;AAEjI;;;;;GAKG;AACH,mCAFU,YAAY,CAWI;AAE1B;;;GAGG;AACH,4CAFU,wBAAwB,CAEkH;AAEpJ;;;GAGG;AACH,2CAFU,wBAAwB,CAE2G;AAE7I;;;;GAIG;AACH,wCAFU,wBAAwB,CAEmF;AAErH;;;GAGG;AACH,uCAFU,wBAAwB,CAE4E;AAE9G;;;;;;GAMG;AACH,wCAFU,wBAAwB,CAEiG;AAEnI;;;GAGG;AACH,0CAFU,YAAY,CAYU;AAEhC;;;GAGG;AACH,8CAFU,wBAAwB,CAE6H;AAE/J;;;GAGG;AACH,6CAFU,wBAAwB,CAEsH;AAExJ;;;;GAIG;AACH,8CAFU,wBAAwB,CAE+E;AAEjH;;;;GAIG;AACH,2CAFU,wBAAwB,CAEyE;AAE3G;;;GAGG;AACH,4CAFU,wBAAwB,CAEwG;AAE1I;;;GAGG;AACH,yCAFU,wBAAwB,CAEgG;AAElI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,kCAFU,SAAS,CAgIhB;AAEH;;;;;;;;;;GAUG;AACH,6CAFU,SAAS,CA8BhB;AAIH;;;;;;;;;;;;;;;;;GAiBG;AACH,4CAFU,SAAS,CA+BhB;AAEH;;;;;;;;;;GAUG;AACH,6CAFU,SAAS,CAkBhB;AAIH;;;;;;;;;;;;GAYG;AACH,6CAFU,SAAS,CAehB;AAEH;;;GAGG;AACH,yCAFU,wBAAwB,CAEqF;AAEvH;;;GAGG;AACH,wCAFU,wBAAwB,CAE8E;AAEhH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wCAFU,SAAS,CA+DhB;AAEH;;;;;;;;;;GAUG;AACH,oDAFU,SAAS,CAWhB;
|
|
1
|
+
{"version":3,"file":"chunk_probe_clipmap.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.js"],"names":[],"mappings":"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"}
|
|
@@ -375,6 +375,26 @@ export const PROBE_MAPS_READ_RESOURCE = ShaderResourceDescriptor.storageBuffer("
|
|
|
375
375
|
*/
|
|
376
376
|
export const PROBE_ESTIMATORS_RESOURCE = ShaderResourceDescriptor.storageBuffer("probe_estimators", WebGPUArray.from(vec4u), true);
|
|
377
377
|
|
|
378
|
+
/**
|
|
379
|
+
* Each slot's radiance estimators, as the re-sample pass reads them: how spread each texel's samples are.
|
|
380
|
+
* @type {ShaderResourceDescriptor}
|
|
381
|
+
*/
|
|
382
|
+
export const PROBE_ESTIMATORS_READ_RESOURCE = ShaderResourceDescriptor.storageBuffer("probe_estimators", WebGPUArray.from(vec4u));
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* The listed probes' re-samples of their neighbours, n_r² a probe by radiance texel, in list order: the
|
|
386
|
+
* accepted re-samples' radiance, each times its weight, summed, and the weights' sum
|
|
387
|
+
* (`shader_probe_clipmap_resample`), as the re-sample pass writes them.
|
|
388
|
+
* @type {ShaderResourceDescriptor}
|
|
389
|
+
*/
|
|
390
|
+
export const PROBE_RESAMPLES_WRITE_RESOURCE = ShaderResourceDescriptor.storageBuffer("probe_resamples", WebGPUArray.from(vec4f), true);
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* The listed probes' re-samples, as accumulation reads them.
|
|
394
|
+
* @type {ShaderResourceDescriptor}
|
|
395
|
+
*/
|
|
396
|
+
export const PROBE_RESAMPLES_READ_RESOURCE = ShaderResourceDescriptor.storageBuffer("probe_resamples", WebGPUArray.from(vec4f));
|
|
397
|
+
|
|
378
398
|
/**
|
|
379
399
|
* A row of a listed probe's radiance map, projected: its irradiance SH, and its rays this update.
|
|
380
400
|
* @type {WebGPUStruct}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A radiance texel's rays as accumulate pools them, by {@link PROBE_CLIPMAP_RESAMPLING}:
|
|
3
|
+
*
|
|
4
|
+
* ```wgsl
|
|
5
|
+
* fn probe_clipmap_resampled(index: u32, sum: vec3<f32>, count: u32) -> vec4<f32> // index: the texel's among the listed probes', k·n_r² + i
|
|
6
|
+
* ```
|
|
7
|
+
*
|
|
8
|
+
* Takes the texel's rays this update, their radiance's sum and their count, and gives the samples it
|
|
9
|
+
* pools: their radiance's sum and their weight, whose quotient is the texel's sample.
|
|
10
|
+
* - `false`, the default: the rays alone.
|
|
11
|
+
* - `true`: the rays and the re-samples of the probe's neighbours that `shader_probe_clipmap_resample`
|
|
12
|
+
* wrote for the texel, each a ray's worth at a visibility of one.
|
|
13
|
+
*
|
|
14
|
+
* @type {CodeChunkChoice}
|
|
15
|
+
*/
|
|
16
|
+
export const chunk_probe_clipmap_resampled: CodeChunkChoice;
|
|
17
|
+
import { CodeChunkChoice } from "../../../shader/compiler/CodeChunkChoice.js";
|
|
18
|
+
//# sourceMappingURL=chunk_probe_clipmap_resampled.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk_probe_clipmap_resampled.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_resampled.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;GAcG;AACH,4CAFU,eAAe,CAEmE;gCAnB5D,6CAA6C"}
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_resampled.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
|
|
2
|
+
import { CodeChunkChoice } from "../../../shader/compiler/CodeChunkChoice.js";
|
|
3
|
+
import { PROBE_RESAMPLES_READ_RESOURCE } from "./chunk_probe_clipmap.js";
|
|
4
|
+
import { PROBE_CLIPMAP_RESAMPLING } from "./PROBE_CLIPMAP_RESAMPLING.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A radiance texel's rays as accumulate pools them, by {@link PROBE_CLIPMAP_RESAMPLING}:
|
|
8
|
+
*
|
|
9
|
+
* ```wgsl
|
|
10
|
+
* fn probe_clipmap_resampled(index: u32, sum: vec3<f32>, count: u32) -> vec4<f32> // index: the texel's among the listed probes', k·n_r² + i
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* Takes the texel's rays this update, their radiance's sum and their count, and gives the samples it
|
|
14
|
+
* pools: their radiance's sum and their weight, whose quotient is the texel's sample.
|
|
15
|
+
* - `false`, the default: the rays alone.
|
|
16
|
+
* - `true`: the rays and the re-samples of the probe's neighbours that `shader_probe_clipmap_resample`
|
|
17
|
+
* wrote for the texel, each a ray's worth at a visibility of one.
|
|
18
|
+
*
|
|
19
|
+
* @type {CodeChunkChoice}
|
|
20
|
+
*/
|
|
21
|
+
export const chunk_probe_clipmap_resampled = CodeChunkChoice.from(PROBE_CLIPMAP_RESAMPLING);
|
|
22
|
+
|
|
23
|
+
const rays = CodeChunk.from(
|
|
24
|
+
//language=WGSL
|
|
25
|
+
`
|
|
26
|
+
fn probe_clipmap_resampled(index: u32, sum: vec3<f32>, count: u32) -> vec4<f32> {
|
|
27
|
+
return vec4<f32>(sum, f32(count));
|
|
28
|
+
}
|
|
29
|
+
`);
|
|
30
|
+
|
|
31
|
+
const resampled = CodeChunk.from(
|
|
32
|
+
//language=WGSL
|
|
33
|
+
`
|
|
34
|
+
fn probe_clipmap_resampled(index: u32, sum: vec3<f32>, count: u32) -> vec4<f32> {
|
|
35
|
+
return vec4<f32>(sum, f32(count)) + probe_resamples[index];
|
|
36
|
+
}
|
|
37
|
+
`);
|
|
38
|
+
|
|
39
|
+
resampled.requireResource(PROBE_RESAMPLES_READ_RESOURCE);
|
|
40
|
+
|
|
41
|
+
chunk_probe_clipmap_resampled.add(false, rays);
|
|
42
|
+
chunk_probe_clipmap_resampled.add(true, resampled);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_probe_clipmap_sample_radiance.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_sample_radiance.js"],"names":[],"mappings":"AAwBA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,kDAFU,SAAS,
|
|
1
|
+
{"version":3,"file":"chunk_probe_clipmap_sample_radiance.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_sample_radiance.js"],"names":[],"mappings":"AAwBA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,kDAFU,SAAS,CAsIZ;0BA7KmB,uCAAuC"}
|
|
@@ -63,14 +63,15 @@ struct ProbeClipmapLobe {
|
|
|
63
63
|
sh: ${METRO_L1_IRRADIANCE_STRUCT.wgsl_ref},
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
// a slot's radiance toward a direction: one bilinear tap of its
|
|
67
|
-
|
|
66
|
+
// a slot's radiance toward a direction, and its texels' count of samples in alpha: one bilinear tap of its
|
|
67
|
+
// tile, through its skirt
|
|
68
|
+
fn probe_clipmap_radiance(slot: u32, direction: vec3<f32>) -> vec4<f32> {
|
|
68
69
|
let side = probe_sampling.radiance_resolution + 2u;
|
|
69
70
|
let place = index_to_grid2d_reciprocal(slot, probe_sampling.radiance_tiles_per_row, probe_sampling.radiance_tiles_per_row_reciprocal);
|
|
70
71
|
let tile = vec2<f32>(place * side);
|
|
71
72
|
let in_tile = texture_octahedral_skirt_uv(uv_octahedral_unit_encode(direction), f32(side)) * f32(side);
|
|
72
73
|
|
|
73
|
-
return textureSampleLevel(probe_radiance, probe_depth_sampler, (tile + in_tile) * probe_sampling.radiance_texel, 0.0)
|
|
74
|
+
return textureSampleLevel(probe_radiance, probe_depth_sampler, (tile + in_tile) * probe_sampling.radiance_texel, 0.0);
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
// a picked probe's share for the lobe, its radiance along it and its SH
|
|
@@ -108,7 +109,7 @@ fn probe_clipmap_lobe(slot: u32, share: f32, position: vec3<f32>, normal: vec3<f
|
|
|
108
109
|
}
|
|
109
110
|
}
|
|
110
111
|
|
|
111
|
-
out.radiance = probe_clipmap_radiance(slot, direction);
|
|
112
|
+
out.radiance = probe_clipmap_radiance(slot, direction).rgb;
|
|
112
113
|
|
|
113
114
|
return out;
|
|
114
115
|
}
|
|
@@ -33,6 +33,10 @@ export const PROBE_ACCUMULATE_SETTINGS: WebGPUStruct;
|
|
|
33
33
|
* - Samples are clipped once the variance's window has passed, when 1/(a+1) is no longer its blend:
|
|
34
34
|
* before that it holds no spread to clip to.
|
|
35
35
|
* - A texel's first sample seeds both means. A texel no ray reached keeps its history.
|
|
36
|
+
* - Where the frame re-samples (`PROBE_CLIPMAP_RESAMPLING`), the sample pools the rays with the texel's
|
|
37
|
+
* re-samples of the probe's neighbours (`shader_probe_clipmap_resample`), each a ray's worth at a
|
|
38
|
+
* visibility of one (`chunk_probe_clipmap_resampled`). Only a texel some ray reached takes them: its
|
|
39
|
+
* time terms are a sampled texel's.
|
|
36
40
|
* - **Depth**: the moments (d, d²) of the rays landing in the texel, in spacings: a miss the limit, a
|
|
37
41
|
* back face 0.2·t (DDGI 2021's shortening), a hit t, every sample held to the limit, the farthest a
|
|
38
42
|
* cage tests a relocated probe, (1 + 0.45)·√3 (`PROBE_DEPTH_LIMIT`, D9). On a uniform update the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader_probe_clipmap_accumulate.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shader_probe_clipmap_accumulate.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.js"],"names":[],"mappings":"AA4CA;;GAEG;AACH,wCAFU,YAAY,CAqBQ;AAqB9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,8CAFU,aAAa,CAsVpB;6BAtd0B,sCAAsC;8BAHrC,kCAAkC"}
|
|
@@ -28,9 +28,11 @@ import {
|
|
|
28
28
|
PROBE_RAY_SUMS_READ_RESOURCE,
|
|
29
29
|
PROBE_RAYS_READ_RESOURCE,
|
|
30
30
|
PROBE_RECORDS_READ_RESOURCE,
|
|
31
|
+
PROBE_RESAMPLES_READ_RESOURCE,
|
|
31
32
|
PROBE_STATES_READ_RESOURCE,
|
|
32
33
|
PROBE_TRACE_READ_RESOURCE
|
|
33
34
|
} from "./chunk_probe_clipmap.js";
|
|
35
|
+
import { chunk_probe_clipmap_resampled } from "./chunk_probe_clipmap_resampled.js";
|
|
34
36
|
import {
|
|
35
37
|
PROBE_BACK_FACE_DEPTH,
|
|
36
38
|
PROBE_CHANGE_SIGNIFICANCE,
|
|
@@ -79,7 +81,9 @@ resources.createGroup()
|
|
|
79
81
|
.add(PROBE_MAPS_WRITE_RESOURCE)
|
|
80
82
|
.add(PROBE_RADIANCE_HISTORY_RESOURCE)
|
|
81
83
|
.add(PROBE_DEPTH_HISTORY_RESOURCE)
|
|
82
|
-
.add(PROBE_ESTIMATORS_RESOURCE)
|
|
84
|
+
.add(PROBE_ESTIMATORS_RESOURCE)
|
|
85
|
+
// read only where the frame re-samples (chunk_probe_clipmap_resampled)
|
|
86
|
+
.add(PROBE_RESAMPLES_READ_RESOURCE);
|
|
83
87
|
|
|
84
88
|
/**
|
|
85
89
|
* Accumulate (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.8): a thread a texel of each listed probe's maps,
|
|
@@ -112,6 +116,10 @@ resources.createGroup()
|
|
|
112
116
|
* - Samples are clipped once the variance's window has passed, when 1/(a+1) is no longer its blend:
|
|
113
117
|
* before that it holds no spread to clip to.
|
|
114
118
|
* - A texel's first sample seeds both means. A texel no ray reached keeps its history.
|
|
119
|
+
* - Where the frame re-samples (`PROBE_CLIPMAP_RESAMPLING`), the sample pools the rays with the texel's
|
|
120
|
+
* re-samples of the probe's neighbours (`shader_probe_clipmap_resample`), each a ray's worth at a
|
|
121
|
+
* visibility of one (`chunk_probe_clipmap_resampled`). Only a texel some ray reached takes them: its
|
|
122
|
+
* time terms are a sampled texel's.
|
|
115
123
|
* - **Depth**: the moments (d, d²) of the rays landing in the texel, in spacings: a miss the limit, a
|
|
116
124
|
* back face 0.2·t (DDGI 2021's shortening), a hit t, every sample held to the limit, the farthest a
|
|
117
125
|
* cage tests a relocated probe, (1 + 0.45)·√3 (`PROBE_DEPTH_LIMIT`, D9). On a uniform update the
|
|
@@ -280,7 +288,9 @@ fn main(
|
|
|
280
288
|
var change = vec2<f32>(0.0);
|
|
281
289
|
|
|
282
290
|
if (count > 0u) {
|
|
283
|
-
|
|
291
|
+
// the rays, and the neighbours' re-samples where the frame took them
|
|
292
|
+
let pooled = probe_clipmap_resampled(k * texels + i, sum, count);
|
|
293
|
+
let sample = pooled.rgb / pooled.w;
|
|
284
294
|
let estimator = slot * texels + i;
|
|
285
295
|
let rate = probe_clipmap_guide_rate(probe_accumulate_expected_rays(base, i, rays, n), settings.rays_per_probe, texels, settings.uniform_period);
|
|
286
296
|
|
|
@@ -459,6 +469,7 @@ fn main(
|
|
|
459
469
|
chunk_probe_clipmap_ray_layout,
|
|
460
470
|
chunk_probe_clipmap_ray_texel,
|
|
461
471
|
chunk_probe_clipmap_guide,
|
|
472
|
+
chunk_probe_clipmap_resampled,
|
|
462
473
|
chunk_folded_workgroup_index,
|
|
463
474
|
chunk_index_to_grid2d,
|
|
464
475
|
chunk_f16_round_stochastic,
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @type {WebGPUStruct}
|
|
3
|
+
*/
|
|
4
|
+
export const PROBE_RESAMPLE_SETTINGS: WebGPUStruct;
|
|
5
|
+
/**
|
|
6
|
+
* Re-sample: each radiance texel of each listed probe B takes what its neighbours have already seen, and
|
|
7
|
+
* traces nothing (Enshrouded's probe reprojection). A thread a texel, through accumulate's launch,
|
|
8
|
+
* `PROBE_DISPATCH_TEXELS`; the depth texels' threads do nothing. It writes the texel's
|
|
9
|
+
* `probe_resamples`: the accepted re-samples' radiance, each times its weight, summed, and the weights'
|
|
10
|
+
* sum. Accumulate adds them to the texel's rays when `PROBE_CLIPMAP_RESAMPLING` is on, each re-sample a
|
|
11
|
+
* ray's worth (`chunk_probe_clipmap_resampled`); with it off, this pass is not recorded.
|
|
12
|
+
*
|
|
13
|
+
* - **The neighbours**: `PROBE_RESAMPLE_NEIGHBOURS` distinct ones of the 26 around B's lattice point
|
|
14
|
+
* in its cascade, from a start and a stride coprime with 26 that a hash of the slot, the texel and
|
|
15
|
+
* the update count picks, so a texel meets every neighbour over its updates. A neighbour is taken only
|
|
16
|
+
* if it is ALIVE and its record holds that point: the indirection's storage wraps.
|
|
17
|
+
* - **The point B sees**: along the texel's centre direction ω, at B's mean depth there, from its
|
|
18
|
+
* published depth.
|
|
19
|
+
* - **The neighbour's radiance**: its published radiance toward the point, weighed by how well its own
|
|
20
|
+
* depth toward the point confirms a surface there: `s² / (s² + (d − μ)²)`, d the point's distance from
|
|
21
|
+
* it and μ its mean depth that way, in spacings, s² its depth's variance that way plus the receiver
|
|
22
|
+
* bias squared (`PROBE_RECEIVER_BIAS`). Two-sided, unlike Chebyshev's: a neighbour that sees nearer
|
|
23
|
+
* has an occluder between, and one that sees farther sees past a point in mid-air, which B's texel puts
|
|
24
|
+
* there where it mixes a near depth with a far one.
|
|
25
|
+
* - **Only what depth confirms**: a texel whose depth is at the limit, everything past every probe's
|
|
26
|
+
* moments, takes nothing, and nor is a neighbour whose distance to the point is at the limit or past it.
|
|
27
|
+
* - Measured on Sponza, the 4090, the settled frame's eight-corner diffuse against a reference of four times
|
|
28
|
+
* the rays without re-sampling: without re-sampling +1.1–1.9% (two runs); Chebyshev one-sided, the first
|
|
29
|
+
* read along ω itself and the second at the limit alone, +11.5%; two-sided, +9.8%; without the second,
|
|
30
|
+
* +6.5%; without either, as built, +3.2%. Light the depth cannot confirm is light through a wall.
|
|
31
|
+
* - **Confidence**: the weight is also scaled by how much the neighbour's mean can be trusted, so a re-sample
|
|
32
|
+
* stays at most a ray's worth:
|
|
33
|
+
* - its spread and its count, `σ²_B / (σ²_B + σ²_A / n_A)`: σ²_A the variance of the samples of the
|
|
34
|
+
* neighbour's texel the point is in (its estimator's deviation, luminance), n_A that texel's count of
|
|
35
|
+
* samples (the radiance's alpha), so σ²_A / n_A is the variance of the mean read; σ²_B that of one of
|
|
36
|
+
* B's own samples of its texel. Both are absolute, each held to the estimator's own floor of 10⁻⁵, so a
|
|
37
|
+
* dark neighbour is not taken less for being dark;
|
|
38
|
+
* - its freshness, `e^(−age / τ)`: age the frames since the neighbour's last update, τ
|
|
39
|
+
* `response_frames`, the time over which a probe's own history follows a change.
|
|
40
|
+
* - A neighbour's texel no ray has reached, its count zero, is not taken.
|
|
41
|
+
* - A probe whose first update this is, or a DEAD one, takes nothing: its depth is not yet its own, or
|
|
42
|
+
* it is inside a solid.
|
|
43
|
+
*
|
|
44
|
+
* Reads only the atlases as the last publish left them, and the frame's records and states, which no
|
|
45
|
+
* pass after relocation writes before accumulate.
|
|
46
|
+
*
|
|
47
|
+
* @type {ComputeShader}
|
|
48
|
+
*/
|
|
49
|
+
export const shader_probe_clipmap_resample: ComputeShader;
|
|
50
|
+
import { WebGPUStruct } from "../../../shader/type/WebGPUStruct.js";
|
|
51
|
+
import { ComputeShader } from "../../../shader/ComputeShader.js";
|
|
52
|
+
//# sourceMappingURL=shader_probe_clipmap_resample.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shader_probe_clipmap_resample.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_resample.js"],"names":[],"mappings":"AA+BA;;GAEG;AACH,sCAFU,YAAY,CAaM;AAsB5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,4CAFU,aAAa,CA4IpB;6BAhP0B,sCAAsC;8BAHrC,kCAAkC"}
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_resample.js
ADDED
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { chunk_rgb_to_luminance } from "../../../shader/chunk/color/chunk_rgb_to_luminance.js";
|
|
2
|
+
import { chunk_uv_octahedral_unit_decode } from "../../../shader/chunk/geometry/octahedron/chunk_uv_octahedral_unit_decode.js";
|
|
3
|
+
import { chunk_uv_octahedral_unit_encode } from "../../../shader/chunk/geometry/octahedron/chunk_uv_octahedral_unit_encode.js";
|
|
4
|
+
import { chunk_folded_workgroup_index } from "../../../shader/chunk/grid/chunk_folded_workgroup_index.js";
|
|
5
|
+
import { chunk_pcg3d } from "../../../shader/chunk/random/pcg/chunk_pcg3d.js";
|
|
6
|
+
import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
|
|
7
|
+
import { ComputeShader } from "../../../shader/ComputeShader.js";
|
|
8
|
+
import { ShaderResourceSetDescriptor } from "../../../shader/resource/ShaderResourceSetDescriptor.js";
|
|
9
|
+
import { f32, u32 } from "../../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
|
|
10
|
+
import { WebGPUStruct } from "../../../shader/type/WebGPUStruct.js";
|
|
11
|
+
import {
|
|
12
|
+
chunk_probe_clipmap,
|
|
13
|
+
PROBE_DEPTH_HISTORY_RESOURCE,
|
|
14
|
+
PROBE_ESTIMATORS_READ_RESOURCE,
|
|
15
|
+
PROBE_LEVELS_RESOURCE,
|
|
16
|
+
PROBE_ORIGINS_READ_RESOURCE,
|
|
17
|
+
PROBE_RADIANCE_HISTORY_RESOURCE,
|
|
18
|
+
PROBE_RECORDS_READ_RESOURCE,
|
|
19
|
+
PROBE_RESAMPLES_WRITE_RESOURCE,
|
|
20
|
+
PROBE_STATES_READ_RESOURCE,
|
|
21
|
+
PROBE_TRACE_READ_RESOURCE
|
|
22
|
+
} from "./chunk_probe_clipmap.js";
|
|
23
|
+
import {
|
|
24
|
+
chunk_probe_clipmap_pick,
|
|
25
|
+
PROBE_DEPTH_SAMPLER_RESOURCE,
|
|
26
|
+
PROBE_INDIRECTION_READ_RESOURCE,
|
|
27
|
+
PROBE_SAMPLING_RESOURCE
|
|
28
|
+
} from "./chunk_probe_clipmap_pick.js";
|
|
29
|
+
import { chunk_probe_clipmap_sample_radiance } from "./chunk_probe_clipmap_sample_radiance.js";
|
|
30
|
+
import { PROBE_DEPTH_LIMIT, PROBE_RECEIVER_BIAS, PROBE_RESAMPLE_NEIGHBOURS, PROBE_THREAD_WORKGROUP_SIZE } from "./PROBE_CLIPMAP.js";
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @type {WebGPUStruct}
|
|
34
|
+
*/
|
|
35
|
+
export const PROBE_RESAMPLE_SETTINGS = WebGPUStruct.from({
|
|
36
|
+
/** probes a frame updates at most: the trace list's bound */
|
|
37
|
+
trace_capacity: u32,
|
|
38
|
+
/** octahedral radiance texels a side, n_r */
|
|
39
|
+
radiance_resolution: u32,
|
|
40
|
+
/** octahedral depth texels a side, n_d: the texels' launch is accumulate's, n_r² + n_d² a probe */
|
|
41
|
+
depth_resolution: u32,
|
|
42
|
+
/** the frame, of the frames the clipmap has recorded */
|
|
43
|
+
frame: u32,
|
|
44
|
+
/** the short mean's response, τ, in frames: how fast a neighbour's history goes stale */
|
|
45
|
+
response_frames: f32,
|
|
46
|
+
}, "ProbeResampleSettings");
|
|
47
|
+
|
|
48
|
+
const resources = new ShaderResourceSetDescriptor();
|
|
49
|
+
|
|
50
|
+
resources.setImmediate("settings", PROBE_RESAMPLE_SETTINGS);
|
|
51
|
+
|
|
52
|
+
resources.createGroup()
|
|
53
|
+
.add(PROBE_TRACE_READ_RESOURCE)
|
|
54
|
+
.add(PROBE_ORIGINS_READ_RESOURCE)
|
|
55
|
+
.add(PROBE_RESAMPLES_WRITE_RESOURCE);
|
|
56
|
+
|
|
57
|
+
resources.createGroup()
|
|
58
|
+
.add(PROBE_LEVELS_RESOURCE)
|
|
59
|
+
.add(PROBE_SAMPLING_RESOURCE)
|
|
60
|
+
.add(PROBE_INDIRECTION_READ_RESOURCE)
|
|
61
|
+
.add(PROBE_STATES_READ_RESOURCE)
|
|
62
|
+
.add(PROBE_RECORDS_READ_RESOURCE)
|
|
63
|
+
.add(PROBE_DEPTH_HISTORY_RESOURCE)
|
|
64
|
+
.add(PROBE_RADIANCE_HISTORY_RESOURCE)
|
|
65
|
+
.add(PROBE_DEPTH_SAMPLER_RESOURCE)
|
|
66
|
+
.add(PROBE_ESTIMATORS_READ_RESOURCE);
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Re-sample: each radiance texel of each listed probe B takes what its neighbours have already seen, and
|
|
70
|
+
* traces nothing (Enshrouded's probe reprojection). A thread a texel, through accumulate's launch,
|
|
71
|
+
* `PROBE_DISPATCH_TEXELS`; the depth texels' threads do nothing. It writes the texel's
|
|
72
|
+
* `probe_resamples`: the accepted re-samples' radiance, each times its weight, summed, and the weights'
|
|
73
|
+
* sum. Accumulate adds them to the texel's rays when `PROBE_CLIPMAP_RESAMPLING` is on, each re-sample a
|
|
74
|
+
* ray's worth (`chunk_probe_clipmap_resampled`); with it off, this pass is not recorded.
|
|
75
|
+
*
|
|
76
|
+
* - **The neighbours**: `PROBE_RESAMPLE_NEIGHBOURS` distinct ones of the 26 around B's lattice point
|
|
77
|
+
* in its cascade, from a start and a stride coprime with 26 that a hash of the slot, the texel and
|
|
78
|
+
* the update count picks, so a texel meets every neighbour over its updates. A neighbour is taken only
|
|
79
|
+
* if it is ALIVE and its record holds that point: the indirection's storage wraps.
|
|
80
|
+
* - **The point B sees**: along the texel's centre direction ω, at B's mean depth there, from its
|
|
81
|
+
* published depth.
|
|
82
|
+
* - **The neighbour's radiance**: its published radiance toward the point, weighed by how well its own
|
|
83
|
+
* depth toward the point confirms a surface there: `s² / (s² + (d − μ)²)`, d the point's distance from
|
|
84
|
+
* it and μ its mean depth that way, in spacings, s² its depth's variance that way plus the receiver
|
|
85
|
+
* bias squared (`PROBE_RECEIVER_BIAS`). Two-sided, unlike Chebyshev's: a neighbour that sees nearer
|
|
86
|
+
* has an occluder between, and one that sees farther sees past a point in mid-air, which B's texel puts
|
|
87
|
+
* there where it mixes a near depth with a far one.
|
|
88
|
+
* - **Only what depth confirms**: a texel whose depth is at the limit, everything past every probe's
|
|
89
|
+
* moments, takes nothing, and nor is a neighbour whose distance to the point is at the limit or past it.
|
|
90
|
+
* - Measured on Sponza, the 4090, the settled frame's eight-corner diffuse against a reference of four times
|
|
91
|
+
* the rays without re-sampling: without re-sampling +1.1–1.9% (two runs); Chebyshev one-sided, the first
|
|
92
|
+
* read along ω itself and the second at the limit alone, +11.5%; two-sided, +9.8%; without the second,
|
|
93
|
+
* +6.5%; without either, as built, +3.2%. Light the depth cannot confirm is light through a wall.
|
|
94
|
+
* - **Confidence**: the weight is also scaled by how much the neighbour's mean can be trusted, so a re-sample
|
|
95
|
+
* stays at most a ray's worth:
|
|
96
|
+
* - its spread and its count, `σ²_B / (σ²_B + σ²_A / n_A)`: σ²_A the variance of the samples of the
|
|
97
|
+
* neighbour's texel the point is in (its estimator's deviation, luminance), n_A that texel's count of
|
|
98
|
+
* samples (the radiance's alpha), so σ²_A / n_A is the variance of the mean read; σ²_B that of one of
|
|
99
|
+
* B's own samples of its texel. Both are absolute, each held to the estimator's own floor of 10⁻⁵, so a
|
|
100
|
+
* dark neighbour is not taken less for being dark;
|
|
101
|
+
* - its freshness, `e^(−age / τ)`: age the frames since the neighbour's last update, τ
|
|
102
|
+
* `response_frames`, the time over which a probe's own history follows a change.
|
|
103
|
+
* - A neighbour's texel no ray has reached, its count zero, is not taken.
|
|
104
|
+
* - A probe whose first update this is, or a DEAD one, takes nothing: its depth is not yet its own, or
|
|
105
|
+
* it is inside a solid.
|
|
106
|
+
*
|
|
107
|
+
* Reads only the atlases as the last publish left them, and the frame's records and states, which no
|
|
108
|
+
* pass after relocation writes before accumulate.
|
|
109
|
+
*
|
|
110
|
+
* @type {ComputeShader}
|
|
111
|
+
*/
|
|
112
|
+
export const shader_probe_clipmap_resample = ComputeShader.from({
|
|
113
|
+
label: "Probe Clipmap Resample",
|
|
114
|
+
resources,
|
|
115
|
+
body: CodeChunk.from(
|
|
116
|
+
//language=WGSL
|
|
117
|
+
`
|
|
118
|
+
// the j-th of the 26 neighbours: the 3×3×3 around the point, its centre skipped
|
|
119
|
+
fn probe_resample_offset(j: u32) -> vec3<i32> {
|
|
120
|
+
let index = j + select(0u, 1u, j >= 13u);
|
|
121
|
+
|
|
122
|
+
return vec3<i32>(vec3<u32>(index % 3u, (index / 3u) % 3u, index / 9u)) - vec3<i32>(1);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// the variance of a texel's samples, luminance, from its estimator's words: the deviation's r in the second word's
|
|
126
|
+
// high half, its g and b in the third; held to the estimator's own floor
|
|
127
|
+
fn probe_resample_variance(words: vec4<u32>) -> f32 {
|
|
128
|
+
let deviation = vec3<f32>(unpack2x16float(words.y).y, unpack2x16float(words.z));
|
|
129
|
+
let d = rgb_to_luminance(sqrt(max(vec3<f32>(1e-5), deviation * deviation)));
|
|
130
|
+
|
|
131
|
+
return d * d;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// a stride through the 26 that meets each of them once: odd, and not 13
|
|
135
|
+
fn probe_resample_stride(hash: u32) -> u32 {
|
|
136
|
+
let m = hash % 12u;
|
|
137
|
+
|
|
138
|
+
return 2u * m + 1u + select(0u, 2u, m >= 6u);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
@compute @workgroup_size(${PROBE_THREAD_WORKGROUP_SIZE})
|
|
142
|
+
fn main(
|
|
143
|
+
@builtin(workgroup_id) workgroup_id: vec3<u32>,
|
|
144
|
+
@builtin(local_invocation_index) lane: u32,
|
|
145
|
+
) {
|
|
146
|
+
let thread = folded_workgroup_index(workgroup_id) * PROBE_THREAD_WORKGROUP_SIZE + lane;
|
|
147
|
+
|
|
148
|
+
let n = settings.radiance_resolution;
|
|
149
|
+
let texels = n * n;
|
|
150
|
+
let per_probe = texels + settings.depth_resolution * settings.depth_resolution;
|
|
151
|
+
|
|
152
|
+
if (thread >= min(probe_trace.count, settings.trace_capacity) * per_probe) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
let k = thread / per_probe;
|
|
157
|
+
let i = thread % per_probe;
|
|
158
|
+
|
|
159
|
+
if (i >= texels) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
let slot = probe_trace.elements[k];
|
|
164
|
+
let state = probe_states[slot];
|
|
165
|
+
|
|
166
|
+
var sum = vec4<f32>(0.0);
|
|
167
|
+
|
|
168
|
+
if (probe_state_kind(state.x) == PROBE_STATE_ALIVE) {
|
|
169
|
+
let record = probe_records[slot];
|
|
170
|
+
let cascade = probe_record_cascade(record.flags);
|
|
171
|
+
let origin = probe_origins[k];
|
|
172
|
+
let spacing = origin.w;
|
|
173
|
+
|
|
174
|
+
let direction = uv_octahedral_unit_decode((vec2<f32>(f32(i % n), f32(i / n)) + 0.5) / f32(n));
|
|
175
|
+
let seen = probe_clipmap_depth_moments(slot, direction).x;
|
|
176
|
+
let point = origin.xyz + direction * (seen * spacing);
|
|
177
|
+
// the variance of one of B's own samples of the texel
|
|
178
|
+
let own = probe_resample_variance(probe_estimators[slot * texels + i]);
|
|
179
|
+
|
|
180
|
+
let hash = pcg3d(vec3<u32>(slot, i, probe_state_updates(state.x)));
|
|
181
|
+
let start = hash.x % 26u;
|
|
182
|
+
let stride = probe_resample_stride(hash.y);
|
|
183
|
+
|
|
184
|
+
// at the limit to a half float's step there, 2^-9 between 2 and 4: every ray that way went past it,
|
|
185
|
+
// and no depth confirms where
|
|
186
|
+
let gathered = select(0u, ${PROBE_RESAMPLE_NEIGHBOURS}u, seen < ${PROBE_DEPTH_LIMIT} - 1.0 / 512.0);
|
|
187
|
+
|
|
188
|
+
for (var t = 0u; t < gathered; t++) {
|
|
189
|
+
let lattice = record.cell + probe_resample_offset((start + t * stride) % 26u);
|
|
190
|
+
let neighbour = probe_clipmap_corner_slot(cascade, lattice);
|
|
191
|
+
|
|
192
|
+
if (neighbour == PROBE_CLIPMAP_NONE) {
|
|
193
|
+
continue;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
let neighbour_state = probe_states[neighbour];
|
|
197
|
+
|
|
198
|
+
// the storage wraps: the slot is this point's only if its record says so
|
|
199
|
+
if (probe_state_kind(neighbour_state.x) != PROBE_STATE_ALIVE || any(probe_records[neighbour].cell != lattice)) {
|
|
200
|
+
continue;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
let at = vec3<f32>(lattice) * spacing + probe_clipmap_offset_decode(neighbour_state.y, spacing);
|
|
204
|
+
let to_point = point - at;
|
|
205
|
+
let distance = length(to_point) / spacing;
|
|
206
|
+
|
|
207
|
+
if (distance >= ${PROBE_DEPTH_LIMIT}) {
|
|
208
|
+
continue;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
let toward = to_point / max(distance * spacing, 1e-6);
|
|
212
|
+
let radiance = probe_clipmap_radiance(neighbour, toward);
|
|
213
|
+
|
|
214
|
+
if (radiance.a < 1.0) {
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
let moments = probe_clipmap_depth_moments(neighbour, toward);
|
|
219
|
+
let spread = max(moments.y - moments.x * moments.x, 0.0) + ${PROBE_RECEIVER_BIAS} * ${PROBE_RECEIVER_BIAS};
|
|
220
|
+
let gap = distance - moments.x;
|
|
221
|
+
let visibility = spread / (spread + gap * gap);
|
|
222
|
+
|
|
223
|
+
// the neighbour's texel the point is in: the variance of the mean read, its samples' over their count
|
|
224
|
+
let uv = min(vec2<u32>(uv_octahedral_unit_encode(toward) * f32(n)), vec2<u32>(n - 1u));
|
|
225
|
+
let mean_variance = probe_resample_variance(probe_estimators[neighbour * texels + uv.y * n + uv.x]) / radiance.a;
|
|
226
|
+
let confidence = own / (own + mean_variance);
|
|
227
|
+
|
|
228
|
+
// how stale its history is: the frames since its last update, over the response time
|
|
229
|
+
let age = f32(settings.frame - probe_records[neighbour].traced_frame);
|
|
230
|
+
let freshness = exp(-age / settings.response_frames);
|
|
231
|
+
|
|
232
|
+
let weight = visibility * confidence * freshness;
|
|
233
|
+
|
|
234
|
+
sum += vec4<f32>(radiance.rgb * weight, weight);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
probe_resamples[k * texels + i] = sum;
|
|
239
|
+
}
|
|
240
|
+
`, [
|
|
241
|
+
chunk_probe_clipmap,
|
|
242
|
+
chunk_probe_clipmap_pick,
|
|
243
|
+
chunk_probe_clipmap_sample_radiance,
|
|
244
|
+
chunk_folded_workgroup_index,
|
|
245
|
+
chunk_uv_octahedral_unit_decode,
|
|
246
|
+
chunk_uv_octahedral_unit_encode,
|
|
247
|
+
chunk_rgb_to_luminance,
|
|
248
|
+
chunk_pcg3d,
|
|
249
|
+
]),
|
|
250
|
+
});
|
|
@@ -140,19 +140,19 @@ planes. This removes exactly those pairs (0 other cells change) and is 4–20% f
|
|
|
140
140
|
Every entry below is **VERIFIED**, read at a pinned commit, unless tagged **SECONDARY**. The raw copies are
|
|
141
141
|
in the scratchpad `src/`.
|
|
142
142
|
|
|
143
|
-
### 2.1 Unreal Engine 5.4
|
|
143
|
+
### 2.1 Unreal Engine 5.4
|
|
144
144
|
|
|
145
|
-
- **Thread mapping:** one thread per cell,
|
|
145
|
+
- **Thread mapping:** one thread per cell, 4×4×4 groups. The grid is 64 px tiles ×
|
|
146
146
|
32 slices.
|
|
147
147
|
- **No parent or coarse grid in 5.4.**
|
|
148
|
-
- **Cell bounds:** the view-space AABB of the cell's 8 corners
|
|
148
|
+
- **Cell bounds:** the view-space AABB of the cell's 8 corners. Lights are moved to
|
|
149
149
|
view space on the CPU.
|
|
150
|
-
- **Test:**
|
|
151
|
-
apex facing the AABB centre
|
|
150
|
+
- **Test:** squared distance from box to point < r². For spot lights, one separating plane through the
|
|
151
|
+
apex facing the AABB centre.
|
|
152
152
|
- **Iteration:** brute force over every local light, per cell.
|
|
153
|
-
- **Default output, the linked list
|
|
153
|
+
- **Default output, the linked list:**
|
|
154
154
|
- per hit pair: an `InterlockedAdd` on one global counter, plus an `InterlockedExchange` on the cell's head;
|
|
155
|
-
- then
|
|
155
|
+
- then a compaction pass, on the same grid, walks each list, allocates with one global
|
|
156
156
|
`InterlockedAdd` (the LDS pre-aggregation is off by default), and writes the list reversed to restore
|
|
157
157
|
list order.
|
|
158
158
|
- **Non-linked mode:** per-cell `InterlockedAdd` into 32 fixed slots.
|
|
@@ -690,7 +690,7 @@ engine camera are as in round 1, §6.
|
|
|
690
690
|
- **fine stage:** every cell runs the precise test on its block's survivors, in id order.
|
|
691
691
|
3. **Linked list against count-then-write, same hierarchy (G):**
|
|
692
692
|
- **assignment:** the list's single sweep is 20–31% faster on the 4090 and 25–31% on the iGPU.
|
|
693
|
-
- **compaction into today's product** (UE's
|
|
693
|
+
- **compaction into today's product** (UE's light-grid compaction shape) costs 9–125 µs on the 4090 and
|
|
694
694
|
0.4–15 ms on the iGPU.
|
|
695
695
|
- **consumers walking the list directly** pay +8–30% per consumer pass on the 4090 and +6–27% on the
|
|
696
696
|
iGPU (stand-in shading pass).
|
|
@@ -1063,7 +1063,7 @@ depends on the device.
|
|
|
1063
1063
|
| subgroup allocation | `chunk_vsm_append_mover` |
|
|
1064
1064
|
| ordered compaction | `chunk_subgroup_active_count_bits` pattern, `workgroupUniformLoad` |
|
|
1065
1065
|
| tile / block gather (BT) | the structural session's R1 bin step, which is the rejected gather here |
|
|
1066
|
-
| compaction | UE 5.4
|
|
1066
|
+
| compaction | UE 5.4 light-grid compaction (round 1 §2.1) |
|
|
1067
1067
|
| decals | `shader_cluster_assign_decals` takes the same fine pass with keep-largest; not built |
|
|
1068
1068
|
|
|
1069
1069
|
## 6. Forks for Alex
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How level 1 of a map of side `map_size` is filtered.
|
|
3
|
+
*
|
|
4
|
+
* Level 1's samples are uniform in its cone, so each stands for Ω_s = Ω_cone / N. They read a copy of
|
|
5
|
+
* level 0 blurred by a Gaussian of σ = 0.7 · max(√Ω_s, the copy's largest texel), wide enough that
|
|
6
|
+
* neither the samples nor the copy's texels alias. The copy is level 0 averaged down to level 1's
|
|
7
|
+
* size when that leaves the lobe room for the blur, else level 0's own size.
|
|
8
|
+
*
|
|
9
|
+
* The lobe exp(2 (N·H - 1) / r^4) is a Gaussian of variance 2 r^4 an axis (N·H = cos(θ/2)), and
|
|
10
|
+
* Gaussians add variances, so it is narrowed by what the copy adds: the blur, and the bilinear tent
|
|
11
|
+
* across the copy's texels beyond the one across level 0's. It narrows to the minimum roughness when
|
|
12
|
+
* the map's texels are coarser than the lobe itself, and level 1 is then the blur alone.
|
|
13
|
+
*
|
|
14
|
+
* @param {number} map_size side of the map's level 0
|
|
15
|
+
* @returns {{
|
|
16
|
+
* blurred_size: number,
|
|
17
|
+
* average_first: boolean,
|
|
18
|
+
* sigma: number,
|
|
19
|
+
* radius: number,
|
|
20
|
+
* lobe_roughness: number,
|
|
21
|
+
* }} `average_first`: the copy is level 0 averaged to level 1's size before the blur; `sigma` the
|
|
22
|
+
* blur still to apply (radians), past what averaging adds; `radius` in the copy's texels
|
|
23
|
+
*/
|
|
24
|
+
export function environment_level_1_blur_plan(map_size: number): {
|
|
25
|
+
blurred_size: number;
|
|
26
|
+
average_first: boolean;
|
|
27
|
+
sigma: number;
|
|
28
|
+
radius: number;
|
|
29
|
+
lobe_roughness: number;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Samples per texel of level 1. They read a Gaussian-blurred copy of level 0, so the count sets how
|
|
33
|
+
* fine that blur can be and how much of the lobe is the lobe's own. Measured on a 1024 map against
|
|
34
|
+
* level 1 from 8192 point taps (sun lobe 1.315° rms): 64 → sky rms error 0.092, sun 1.345°, a bright
|
|
35
|
+
* texel's share 0.998 ± 0.008; 128 → 0.057, 1.342°, 0.998 ± 0.003, never above 1.
|
|
36
|
+
* @type {number}
|
|
37
|
+
*/
|
|
38
|
+
export const LEVEL_1_SAMPLE_COUNT: number;
|
|
39
|
+
//# sourceMappingURL=environment_level_1_blur_plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment_level_1_blur_plan.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/light/environment/environment_level_1_blur_plan.js"],"names":[],"mappings":"AA+CA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wDAVW,MAAM,GACJ;IACZ,YAAgB,EAAE,MAAM,CAAC;IACzB,aAAiB,EAAE,OAAO,CAAC;IAC3B,KAAS,EAAE,MAAM,CAAC;IAClB,MAAU,EAAE,MAAM,CAAC;IACnB,cAAkB,EAAE,MAAM,CAAC;CACxB,CAmDH;AAjHD;;;;;;GAMG;AACH,mCAFU,MAAM,CAEwB"}
|