@woosh/meep-engine 3.60.6 → 3.60.7
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/build/bundle-worker-terrain.js +1 -1
- package/package.json +1 -1
- package/src/core/binary/BitSet.d.ts.map +1 -1
- package/src/core/binary/BitSet.js +2 -1
- package/src/{format/image/avif/av1/util → core/binary/operations}/ceil_log2.d.ts +2 -2
- package/src/core/binary/operations/ceil_log2.d.ts.map +1 -0
- package/src/{format/image/avif/av1/util → core/binary/operations}/ceil_log2.js +18 -18
- package/src/core/binary/zstd/ZstdReverseBitReader.d.ts.map +1 -1
- package/src/core/binary/zstd/ZstdReverseBitReader.js +225 -223
- package/src/core/binary/zstd/zstd_fse.d.ts.map +1 -1
- package/src/core/binary/zstd/zstd_fse.js +267 -265
- package/src/core/binary/zstd/zstd_huffman.d.ts.map +1 -1
- package/src/core/binary/zstd/zstd_huffman.js +246 -244
- package/src/core/bvh2/binary/2/BinaryUint32BVH.d.ts.map +1 -1
- package/src/core/bvh2/binary/2/BinaryUint32BVH.js +8 -2
- package/src/core/bvh2/bvh3/ebvh_optimize_treelet.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/ebvh_optimize_treelet.js +8 -7
- package/src/core/collection/PairUint32Map.d.ts.map +1 -1
- package/src/core/collection/PairUint32Map.js +2 -2
- package/src/core/collection/Uint32Map.d.ts.map +1 -1
- package/src/core/collection/Uint32Map.js +2 -4
- package/src/core/collection/heap/FibonacciHeap.d.ts.map +1 -1
- package/src/core/collection/heap/FibonacciHeap.js +2 -1
- package/src/core/geom/2d/r-tree/StaticR2Tree.d.ts.map +1 -1
- package/src/core/geom/2d/r-tree/StaticR2Tree.js +8 -2
- package/src/core/geom/3d/shape/util/mesh_compute_triangle_edge_flags.d.ts.map +1 -1
- package/src/core/geom/3d/shape/util/mesh_compute_triangle_edge_flags.js +2 -3
- package/src/engine/graphics/texture/atlas/TextureAtlas.d.ts.map +1 -1
- package/src/engine/graphics/texture/atlas/TextureAtlas.js +13 -14
- package/src/engine/graphics/texture/atlas/sprite_atlas_border.d.ts.map +1 -1
- package/src/engine/graphics/texture/atlas/sprite_atlas_border.js +70 -69
- package/src/engine/graphics/texture/reflection/convolve_equirectangular_reflection.d.ts.map +1 -1
- package/src/engine/graphics/texture/reflection/convolve_equirectangular_reflection.js +2 -1
- package/src/engine/graphics3/GPUParticleEmitterSystem.d.ts.map +1 -1
- package/src/engine/graphics3/GPUParticleEmitterSystem.js +2 -1
- package/src/engine/graphics3/decal/GPUDecalRenderer.d.ts.map +1 -1
- package/src/engine/graphics3/decal/GPUDecalRenderer.js +2 -1
- package/src/engine/graphics3/decal/chunk_decal_record.d.ts +14 -0
- package/src/engine/graphics3/decal/chunk_decal_record.d.ts.map +1 -0
- package/src/engine/graphics3/decal/chunk_decal_record.js +44 -0
- package/src/engine/graphics3/decal/shader_cluster_assign_decals.d.ts.map +1 -1
- package/src/engine/graphics3/decal/shader_cluster_assign_decals.js +2 -15
- package/src/engine/graphics3/decal/shader_cull_decals_frustum.d.ts.map +1 -1
- package/src/engine/graphics3/decal/shader_cull_decals_frustum.js +3 -16
- package/src/engine/graphics3/decal/shader_decal_composite.d.ts.map +1 -1
- package/src/engine/graphics3/decal/shader_decal_composite.js +3 -23
- package/src/engine/graphics3/terrain/TERRAIN_MATERIAL_TEMPLATE.d.ts.map +1 -1
- package/src/engine/graphics3/terrain/TERRAIN_MATERIAL_TEMPLATE.js +2 -1
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/engine/physics/queries/shape_cast.js +2 -2
- package/src/format/image/avif/av1/decode/decode_palette.js +442 -442
- package/src/format/image/avif/av1/entropy/SymbolWriter.d.ts.map +1 -1
- package/src/format/image/avif/av1/entropy/SymbolWriter.js +2 -1
- package/src/generation/foliage/material/foliage_tile.d.ts.map +1 -1
- package/src/generation/foliage/material/foliage_tile.js +2 -1
- package/src/shade/device/mock/SoftwareGPUDevice.d.ts.map +1 -1
- package/src/shade/device/mock/SoftwareGPUDevice.js +6 -13
- package/src/shade/playground/caldera/main.js +3 -2
- package/src/shade/playground/probe_clipmap/README.md +2 -1
- package/src/shade/playground/probe_clipmap/index.html +7 -2
- package/src/shade/playground/probe_clipmap/main.d.ts.map +1 -1
- package/src/shade/playground/probe_clipmap/main.js +17 -7
- package/src/shade/playground/sh_exponential/sh_exp_playground_shaders.d.ts.map +1 -1
- package/src/shade/playground/sh_exponential/sh_exp_playground_shaders.js +7 -13
- package/src/shade/playground/vgeo_scene/main.js +2 -1
- package/src/shade/playground/vsm/VSMDebugOverlay.d.ts.map +1 -1
- package/src/shade/playground/vsm/VSMDebugOverlay.js +3 -1
- package/src/shade/renderer/fluid/GPUFluidCascade.d.ts +3 -3
- package/src/shade/renderer/fluid/GPUFluidCascadeStack.d.ts +1 -1
- package/src/shade/renderer/fluid/forcing/GPUFluidForcing.d.ts +6 -6
- package/src/shade/renderer/fluid/pressure/GPUFluidPressureSolve.d.ts +1 -1
- package/src/shade/renderer/fluid/pressure/shader_fluid_mg_coarsest.d.ts.map +1 -1
- package/src/shade/renderer/fluid/pressure/shader_fluid_mg_coarsest.js +5 -4
- package/src/shade/renderer/fluid/pressure/shader_fluid_mg_residual_restrict.d.ts.map +1 -1
- package/src/shade/renderer/fluid/pressure/shader_fluid_mg_residual_restrict.js +168 -166
- package/src/shade/renderer/fluid/pressure/shader_fluid_mg_smooth.d.ts.map +1 -1
- package/src/shade/renderer/fluid/pressure/shader_fluid_mg_smooth.js +221 -219
- package/src/shade/renderer/fluid/query/GPUFluidQueries.d.ts +1 -1
- package/src/shade/renderer/fow/shader_fog_of_war.d.ts.map +1 -1
- package/src/shade/renderer/fow/shader_fog_of_war.js +8 -19
- package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.js +6 -6
- package/src/shade/renderer/geometry/sdf/MeshSDFLayout.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/MeshSDFLayout.js +2 -1
- package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.js +2 -1
- package/src/shade/renderer/geometry/virtual/runtime/VGeoResidency.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/runtime/VGeoResidency.js +2 -1
- package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v1/chunk_brick4_sh3_color_decode_from_storage.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v1/chunk_brick4_sh3_color_decode_from_storage.js +10 -31
- package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v1/chunk_brick4_sh3_color_encode_to_storage.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v1/chunk_brick4_sh3_color_encode_to_storage.js +9 -15
- package/src/shade/renderer/global_illumination/clipmap/shader_debug_clipmap.d.ts +2 -1
- package/src/shade/renderer/global_illumination/clipmap/shader_debug_clipmap.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/clipmap/shader_debug_clipmap.js +6 -5
- package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_reduce_atlas_to_sh.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_reduce_atlas_to_sh.js +2 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts +15 -3
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.js +168 -18
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts +98 -57
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.js +168 -77
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.d.ts +4 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.js +27 -12
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap.js +12 -7
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.js +8 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_walk.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_walk.js +5 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_batch.js +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_gather.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_gather.js +5 -3
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_resolve.js +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_free.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_free.js +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_movers_command.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_movers_command.js +4 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_scroll.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_scroll.js +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_store.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_store.js +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_take.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_take.js +3 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_mesh_cards.js +2 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts +114 -41
- 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 +424 -207
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.d.ts +34 -25
- 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 +41 -31
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP_RESAMPLING.d.ts +7 -5
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP_RESAMPLING.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP_RESAMPLING.js +7 -5
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapHitWants.d.ts +47 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapHitWants.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapHitWants.js +84 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.d.ts +48 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.js +101 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.d.ts +58 -4
- 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 +127 -30
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_cage.d.ts +18 -7
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_cage.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_cage.js +39 -13
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.d.ts +29 -8
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.js +112 -56
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_resample.d.ts +19 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_resample.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_resample.js +35 -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 +9 -3
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.d.ts +3 -3
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.js +5 -5
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.d.ts +8 -12
- 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 +23 -56
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_admit.d.ts +0 -3
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_admit.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_admit.js +11 -15
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_bounce.d.ts +26 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_bounce.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_bounce.js +173 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_candidate.d.ts +32 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_candidate.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_candidate.js +166 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_due.d.ts +3 -4
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_due.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_due.js +3 -4
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_guide.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_guide.js +3 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.d.ts +6 -12
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.js +15 -65
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_order.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_order.js +7 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.d.ts +4 -4
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.js +24 -17
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_publish.d.ts +7 -5
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_publish.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_publish.js +18 -10
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_ray_layout.d.ts +2 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_ray_layout.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_ray_layout.js +9 -5
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_relocate.d.ts +3 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_relocate.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_relocate.js +9 -6
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_resample.d.ts +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_resample.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_resample.js +16 -16
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_resample_rays.d.ts +36 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_resample_rays.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_resample_rays.js +233 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_schedule.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_schedule.js +7 -5
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.js +5 -3
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.js +10 -4
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace_command.d.ts +2 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace_command.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace_command.js +12 -6
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want.d.ts +1 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want.js +5 -6
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.d.ts +14 -18
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.js +25 -35
- package/src/shade/renderer/gpu_primitive/WEBGPU_GUARANTEED_MAX_UNIFORM_BUFFER_BINDING_SIZE.d.ts +13 -0
- package/src/shade/renderer/gpu_primitive/WEBGPU_GUARANTEED_MAX_UNIFORM_BUFFER_BINDING_SIZE.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/WEBGPU_GUARANTEED_MAX_UNIFORM_BUFFER_BINDING_SIZE.js +12 -0
- package/src/shade/renderer/gpu_primitive/hash_table/cpu_build_hash_table.d.ts +27 -2
- package/src/shade/renderer/gpu_primitive/hash_table/cpu_build_hash_table.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/hash_table/cpu_build_hash_table.js +62 -6
- package/src/shade/renderer/gpu_primitive/indirect/IndirectComputeCommandBuildPass.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/indirect/IndirectComputeCommandBuildPass.js +10 -19
- package/src/shade/renderer/gpu_primitive/indirect/chunk_folded_dispatch.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/indirect/chunk_folded_dispatch.js +6 -3
- package/src/shade/renderer/hiz/hzb_pick_alignment.d.ts.map +1 -1
- package/src/shade/renderer/hiz/hzb_pick_alignment.js +149 -148
- package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_environment_cells.d.ts.map +1 -1
- package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_environment_cells.js +4 -2
- package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_log_floor.d.ts.map +1 -1
- package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_log_floor.js +6 -5
- package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_project.d.ts.map +1 -1
- package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_project.js +3 -1
- package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_reference_reflectance.d.ts.map +1 -1
- package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_reference_reflectance.js +3 -1
- package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_solve.d.ts.map +1 -1
- package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_solve.js +3 -1
- package/src/shade/renderer/light/world_cluster/WORLD_LIGHT_CLUSTER.d.ts +0 -5
- package/src/shade/renderer/light/world_cluster/WORLD_LIGHT_CLUSTER.d.ts.map +1 -1
- package/src/shade/renderer/light/world_cluster/WORLD_LIGHT_CLUSTER.js +0 -7
- package/src/shade/renderer/light/world_cluster/graph_build_world_light_clusters.d.ts +15 -2
- package/src/shade/renderer/light/world_cluster/graph_build_world_light_clusters.d.ts.map +1 -1
- package/src/shade/renderer/light/world_cluster/graph_build_world_light_clusters.js +51 -16
- package/src/shade/renderer/light/world_cluster/shader_world_cluster_assign_lights.d.ts.map +1 -1
- package/src/shade/renderer/light/world_cluster/shader_world_cluster_assign_lights.js +3 -2
- package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
- package/src/shade/renderer/postprocess/dof/raymarch/chunk_dof_lds_coc_cache.d.ts +17 -0
- package/src/shade/renderer/postprocess/dof/raymarch/chunk_dof_lds_coc_cache.d.ts.map +1 -0
- package/src/shade/renderer/postprocess/dof/raymarch/chunk_dof_lds_coc_cache.js +81 -0
- package/src/shade/renderer/postprocess/dof/raymarch/shader_dof_raymarch_compute.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/dof/raymarch/shader_dof_raymarch_compute.js +5 -48
- package/src/shade/renderer/postprocess/dof/raymarch/shader_dof_slice_compute.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/dof/raymarch/shader_dof_slice_compute.js +4 -44
- package/src/shade/renderer/postprocess/gtao/chunk_integrate_lighting_sample.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/gtao/chunk_integrate_lighting_sample.js +4 -1
- package/src/shade/renderer/postprocess/gtao/fragment_shader_gtao_with_irradiance.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/gtao/fragment_shader_gtao_with_irradiance.js +8 -7
- package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
- package/src/shade/renderer/postprocess/nss/chunk_nss_luma_derivative.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/nss/chunk_nss_luma_derivative.js +5 -7
- package/src/shade/renderer/postprocess/nss/chunk_nss_tonemap.d.ts +17 -0
- package/src/shade/renderer/postprocess/nss/chunk_nss_tonemap.d.ts.map +1 -0
- package/src/shade/renderer/postprocess/nss/chunk_nss_tonemap.js +56 -0
- package/src/shade/renderer/postprocess/nss/shader_nss_postprocess.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/nss/shader_nss_postprocess.js +2 -22
- package/src/shade/renderer/postprocess/nss/shader_nss_preprocess.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/nss/shader_nss_preprocess.js +2 -13
- package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.js +10 -13
- package/src/shade/renderer/rasterize/expand/bucket/RASTERIZATION_BUCKET_LIMIT.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/expand/bucket/RASTERIZATION_BUCKET_LIMIT.js +39 -38
- package/src/shade/renderer/rasterize/expand/mesh/shader_prefix_sum_to_command.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/expand/mesh/shader_prefix_sum_to_command.js +7 -12
- package/src/shade/renderer/shader/chunk/clipmap/CLIPMAP_LEVEL_STRUCT.d.ts +8 -6
- package/src/shade/renderer/shader/chunk/clipmap/CLIPMAP_LEVEL_STRUCT.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/clipmap/CLIPMAP_LEVEL_STRUCT.js +10 -7
- package/src/shade/renderer/shader/chunk/clipmap/chunk_clipmap_key.d.ts +16 -0
- package/src/shade/renderer/shader/chunk/clipmap/chunk_clipmap_key.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/clipmap/chunk_clipmap_key.js +35 -0
- package/src/shade/renderer/shader/chunk/clipmap/chunk_clipmap_select_finest.d.ts +5 -2
- package/src/shade/renderer/shader/chunk/clipmap/chunk_clipmap_select_finest.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/clipmap/chunk_clipmap_select_finest.js +27 -18
- package/src/shade/renderer/shader/chunk/spherical_harmonics/chunk_sh2_color_get_irradiance_at.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/spherical_harmonics/chunk_sh2_color_get_irradiance_at.js +5 -15
- package/src/shade/renderer/shader/chunk/spherical_harmonics/chunk_sh3_convolve_with_cosine_kernel.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/spherical_harmonics/chunk_sh3_convolve_with_cosine_kernel.js +5 -19
- package/src/shade/renderer/shader/chunk/spherical_harmonics/dering/chunk_sh3_windowing.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/spherical_harmonics/dering/chunk_sh3_windowing.js +3 -22
- package/src/shade/renderer/shadow/map/ShadowmapDrawSelector.d.ts.map +1 -1
- package/src/shade/renderer/shadow/map/ShadowmapDrawSelector.js +2 -1
- package/src/shade/renderer/volumetrics/chunk_volumetrics_sun_shadow_group_list.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/chunk_volumetrics_sun_shadow_group_list.js +154 -152
- package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.js +2 -1
- package/src/shade/renderer/volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP.d.ts +3 -1
- package/src/shade/renderer/volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP.js +4 -3
- package/src/shade/renderer/volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP_STRUCT.d.ts +7 -1
- package/src/shade/renderer/volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP_STRUCT.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP_STRUCT.js +54 -47
- package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_sample.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_sample.js +371 -370
- package/src/shade/renderer/water/GPUWaterRenderer.d.ts.map +1 -1
- package/src/shade/renderer/water/GPUWaterRenderer.js +2 -1
- package/src/shade/renderer/water/query/GPUWaterQueries.d.ts +1 -1
- package/src/shade/renderer/water/surface/lod/shader_water_lod.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/lod/shader_water_lod.js +12 -14
- package/src/shade/renderer/water/surface/particles/GPUWaterParticles.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/particles/GPUWaterParticles.js +2 -9
- package/src/shade/renderer/water/surface/particles/chunk_water_particle.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/particles/chunk_water_particle.js +2 -1
- package/src/shade/renderer/wind/WIND_FIELD.d.ts +3 -1
- package/src/shade/renderer/wind/WIND_FIELD.d.ts.map +1 -1
- package/src/shade/renderer/wind/WIND_FIELD.js +4 -3
- package/src/shade/renderer/wind/WIND_FIELD_STRUCT.d.ts +8 -2
- package/src/shade/renderer/wind/WIND_FIELD_STRUCT.d.ts.map +1 -1
- package/src/shade/renderer/wind/WIND_FIELD_STRUCT.js +11 -4
- package/src/shade/renderer/wind/chunk_wind_field_sample_cascades.d.ts +2 -2
- package/src/shade/renderer/wind/chunk_wind_field_sample_cascades.d.ts.map +1 -1
- package/src/shade/renderer/wind/chunk_wind_field_sample_cascades.js +13 -4
- package/src/shade/util/texture_mip_extent.d.ts.map +1 -1
- package/src/shade/util/texture_mip_extent.js +88 -87
- package/src/shade/wgsl/emulator/WGSLLanguageCore.d.ts.map +1 -1
- package/src/shade/wgsl/emulator/WGSLLanguageCore.js +9 -7
- package/src/format/image/avif/av1/util/ceil_log2.d.ts.map +0 -1
- package/src/shade/renderer/shader/chunk/color/chunk_hash_squirrel3.d.ts +0 -1
- package/src/shade/renderer/shader/chunk/color/chunk_hash_squirrel3.d.ts.map +0 -1
- package/src/shade/renderer/shader/chunk/color/chunk_hash_squirrel3.js +0 -0
package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_candidate.js
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { chunk_folded_workgroup_index } from "../../../shader/chunk/grid/chunk_folded_workgroup_index.js";
|
|
2
|
+
import { chunk_hash_to_float01 } from "../../../shader/chunk/random/chunk_hash_to_float01.js";
|
|
3
|
+
import { chunk_pcg3d } from "../../../shader/chunk/random/pcg/chunk_pcg3d.js";
|
|
4
|
+
import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
|
|
5
|
+
import { ComputeShader } from "../../../shader/ComputeShader.js";
|
|
6
|
+
import { ShaderResourceSetDescriptor } from "../../../shader/resource/ShaderResourceSetDescriptor.js";
|
|
7
|
+
import { u32 } from "../../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
|
|
8
|
+
import { WebGPUStruct } from "../../../shader/type/WebGPUStruct.js";
|
|
9
|
+
import {
|
|
10
|
+
chunk_probe_clipmap,
|
|
11
|
+
chunk_probe_clipmap_listed,
|
|
12
|
+
PROBE_CANDIDATES_WRITE_RESOURCE,
|
|
13
|
+
PROBE_DEPTH_HISTORY_RESOURCE,
|
|
14
|
+
PROBE_LEVELS_RESOURCE,
|
|
15
|
+
PROBE_LISTED_READ_RESOURCE,
|
|
16
|
+
PROBE_ORIGINS_READ_RESOURCE,
|
|
17
|
+
PROBE_RECORDS_READ_RESOURCE,
|
|
18
|
+
PROBE_STATES_READ_RESOURCE,
|
|
19
|
+
PROBE_TRACE_READ_RESOURCE
|
|
20
|
+
} from "./chunk_probe_clipmap.js";
|
|
21
|
+
import {
|
|
22
|
+
chunk_probe_clipmap_pick,
|
|
23
|
+
PROBE_DEPTH_SAMPLER_RESOURCE,
|
|
24
|
+
PROBE_INDIRECTION_READ_RESOURCE,
|
|
25
|
+
PROBE_SAMPLING_RESOURCE
|
|
26
|
+
} from "./chunk_probe_clipmap_pick.js";
|
|
27
|
+
import { chunk_probe_clipmap_resample } from "./chunk_probe_clipmap_resample.js";
|
|
28
|
+
import { PROBE_DEPTH_LIMIT, PROBE_THREAD_WORKGROUP_SIZE } from "./PROBE_CLIPMAP.js";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @type {WebGPUStruct}
|
|
32
|
+
*/
|
|
33
|
+
export const PROBE_CANDIDATE_SETTINGS = WebGPUStruct.from({
|
|
34
|
+
/** probes a frame updates at most: the trace list's bound */
|
|
35
|
+
trace_capacity: u32,
|
|
36
|
+
}, "ProbeCandidateSettings");
|
|
37
|
+
|
|
38
|
+
const resources = new ShaderResourceSetDescriptor();
|
|
39
|
+
|
|
40
|
+
resources.setImmediate("settings", PROBE_CANDIDATE_SETTINGS);
|
|
41
|
+
|
|
42
|
+
resources.createGroup()
|
|
43
|
+
.add(PROBE_TRACE_READ_RESOURCE)
|
|
44
|
+
.add(PROBE_ORIGINS_READ_RESOURCE)
|
|
45
|
+
.add(PROBE_LISTED_READ_RESOURCE)
|
|
46
|
+
.add(PROBE_CANDIDATES_WRITE_RESOURCE);
|
|
47
|
+
|
|
48
|
+
resources.createGroup()
|
|
49
|
+
.add(PROBE_LEVELS_RESOURCE)
|
|
50
|
+
.add(PROBE_SAMPLING_RESOURCE)
|
|
51
|
+
.add(PROBE_INDIRECTION_READ_RESOURCE)
|
|
52
|
+
.add(PROBE_STATES_READ_RESOURCE)
|
|
53
|
+
.add(PROBE_RECORDS_READ_RESOURCE)
|
|
54
|
+
.add(PROBE_DEPTH_HISTORY_RESOURCE)
|
|
55
|
+
.add(PROBE_DEPTH_SAMPLER_RESOURCE);
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The candidate (Enshrouded's "pick neighbor candidates"): a thread a listed probe B, dispatched through
|
|
59
|
+
* `PROBE_DISPATCH_TRACED` after relocation, draws the one neighbour whose rays of this frame it re-samples
|
|
60
|
+
* (`shader_probe_clipmap_resample_rays`), and writes it to `probe_candidates`: its place in the list, or
|
|
61
|
+
* `PROBE_CLIPMAP_NONE`, and the weight its rays take.
|
|
62
|
+
*
|
|
63
|
+
* - **The neighbours**: the 26 around B's lattice point in its cascade. One is a candidate if it is ALIVE, its
|
|
64
|
+
* record holds that point (the storage wraps), and it is listed this frame (`probe_clipmap_listed`), so that its
|
|
65
|
+
* rays are in `probe_rays`. A NEW one is not. M counts them.
|
|
66
|
+
* - **The importance**: the neighbour's radiance, its irradiance's L0 luma, times B's visibility of it: Chebyshev
|
|
67
|
+
* over B's depth moments toward it (`probe_visibility_chebyshev`), its distance in B's spacings held to the depth
|
|
68
|
+
* limit, as the moments are. A dark neighbour, or one behind a wall, weighs about nothing.
|
|
69
|
+
* - **The draw**: one by its importance, a reservoir of one through the 26 with a hash of the slot, the update count
|
|
70
|
+
* and the neighbour.
|
|
71
|
+
* - **The weight**: the draw's density divided out, `(1 / M) / p`, p the drawn one's importance over the sum: the
|
|
72
|
+
* rays B takes are then, in expectation, every candidate's alike.
|
|
73
|
+
* - A probe whose first update this is, or a DEAD one, draws nothing: its depth is not yet its own, or it is
|
|
74
|
+
* inside a solid.
|
|
75
|
+
*
|
|
76
|
+
* Reads the depth atlas as the last publish left it, and the frame's origins, records and states, which no pass
|
|
77
|
+
* after relocation writes before accumulate.
|
|
78
|
+
*
|
|
79
|
+
* @type {ComputeShader}
|
|
80
|
+
*/
|
|
81
|
+
export const shader_probe_clipmap_candidate = ComputeShader.from({
|
|
82
|
+
label: "Probe Clipmap Candidate",
|
|
83
|
+
resources,
|
|
84
|
+
body: CodeChunk.from(
|
|
85
|
+
//language=WGSL
|
|
86
|
+
`
|
|
87
|
+
@compute @workgroup_size(${PROBE_THREAD_WORKGROUP_SIZE})
|
|
88
|
+
fn main(
|
|
89
|
+
@builtin(workgroup_id) workgroup_id: vec3<u32>,
|
|
90
|
+
@builtin(local_invocation_index) lane: u32,
|
|
91
|
+
) {
|
|
92
|
+
let k = folded_workgroup_index(workgroup_id) * PROBE_THREAD_WORKGROUP_SIZE + lane;
|
|
93
|
+
|
|
94
|
+
if (k >= min(probe_trace.count, settings.trace_capacity)) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
let slot = probe_trace.elements[k];
|
|
99
|
+
let state = probe_states[slot];
|
|
100
|
+
|
|
101
|
+
var drawn = PROBE_CLIPMAP_NONE;
|
|
102
|
+
var drawn_importance = 0.0;
|
|
103
|
+
var total = 0.0;
|
|
104
|
+
var candidates = 0u;
|
|
105
|
+
|
|
106
|
+
if (probe_state_kind(state.x) == PROBE_STATE_ALIVE) {
|
|
107
|
+
let record = probe_records[slot];
|
|
108
|
+
let cascade = probe_record_cascade(record.flags);
|
|
109
|
+
let origin = probe_origins[k];
|
|
110
|
+
let spacing = origin.w;
|
|
111
|
+
let updates = probe_state_updates(state.x);
|
|
112
|
+
|
|
113
|
+
for (var j = 0u; j < 26u; j++) {
|
|
114
|
+
let lattice = record.cell + probe_resample_offset(j);
|
|
115
|
+
let neighbour = probe_clipmap_corner_slot(cascade, lattice);
|
|
116
|
+
|
|
117
|
+
if (neighbour == PROBE_CLIPMAP_NONE) {
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// the storage wraps: the slot is this point's only if its record says so
|
|
122
|
+
if (probe_state_kind(probe_states[neighbour].x) != PROBE_STATE_ALIVE || any(probe_records[neighbour].cell != lattice)) {
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
let listed = probe_clipmap_listed(neighbour, settings.trace_capacity);
|
|
127
|
+
|
|
128
|
+
if (listed == PROBE_CLIPMAP_NONE) {
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
candidates++;
|
|
133
|
+
|
|
134
|
+
let to_neighbour = probe_origins[listed].xyz - origin.xyz;
|
|
135
|
+
let distance = length(to_neighbour);
|
|
136
|
+
let toward = to_neighbour / max(distance, 1e-6);
|
|
137
|
+
let visibility = probe_visibility_chebyshev(probe_clipmap_depth_moments(slot, toward), min(distance / spacing, ${PROBE_DEPTH_LIMIT}));
|
|
138
|
+
let radiance = max(probe_record_sh_decode(probe_records[neighbour].sh).Y.w, 0.0);
|
|
139
|
+
let importance = radiance * visibility;
|
|
140
|
+
|
|
141
|
+
if (importance <= 0.0) {
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
total += importance;
|
|
146
|
+
|
|
147
|
+
if (hash_to_float01(pcg3d(vec3<u32>(slot, updates, j)).x) * total < importance) {
|
|
148
|
+
drawn = listed;
|
|
149
|
+
drawn_importance = importance;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
probe_candidates[k].listed = drawn;
|
|
155
|
+
probe_candidates[k].weight = select(0.0, total / (f32(candidates) * drawn_importance), drawn != PROBE_CLIPMAP_NONE);
|
|
156
|
+
}
|
|
157
|
+
`, [
|
|
158
|
+
chunk_probe_clipmap,
|
|
159
|
+
chunk_probe_clipmap_listed,
|
|
160
|
+
chunk_probe_clipmap_pick,
|
|
161
|
+
chunk_probe_clipmap_resample,
|
|
162
|
+
chunk_folded_workgroup_index,
|
|
163
|
+
chunk_hash_to_float01,
|
|
164
|
+
chunk_pcg3d,
|
|
165
|
+
]),
|
|
166
|
+
});
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_due.d.ts
CHANGED
|
@@ -8,10 +8,9 @@ export const PROBE_DUE_SETTINGS: WebGPUStruct;
|
|
|
8
8
|
* when a want waits on it:
|
|
9
9
|
* - it is NEW, in the first pass, which lists them first: it has had no update;
|
|
10
10
|
* - in the second pass, it is ALIVE or DEAD, a pixel or a hit wanted it since its last update, its
|
|
11
|
-
* wanted time past its traced time, and `(frame + h(slot)) mod T` is 0. A DEAD probe
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* trace 16 a frame).
|
|
11
|
+
* wanted time past its traced time, and `(frame + h(slot)) mod T` is 0. A DEAD probe is due every
|
|
12
|
+
* period like an ALIVE one, its update casting `PROBE_DEAD_RAYS`, so that a probe inside a solid
|
|
13
|
+
* notices when the scene changes (Enshrouded's dead probes trace 16 a frame).
|
|
15
14
|
*
|
|
16
15
|
* Wanted since its last update, not this frame: a hit wants a probe the frame after its own probe's
|
|
17
16
|
* update, so a probe that only hits keep is wanted on few of its turns. Measured on Sponza with the
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_due.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader_probe_clipmap_due.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_due.js"],"names":[],"mappings":"AAkBA;;GAEG;AACH,iCAFU,YAAY,CAWC;AAavB
|
|
1
|
+
{"version":3,"file":"shader_probe_clipmap_due.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_due.js"],"names":[],"mappings":"AAkBA;;GAEG;AACH,iCAFU,YAAY,CAWC;AAavB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,uCAFU,aAAa,CA4CpB;6BApG0B,sCAAsC;8BAHrC,kCAAkC"}
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_due.js
CHANGED
|
@@ -47,10 +47,9 @@ resources.createGroup()
|
|
|
47
47
|
* when a want waits on it:
|
|
48
48
|
* - it is NEW, in the first pass, which lists them first: it has had no update;
|
|
49
49
|
* - in the second pass, it is ALIVE or DEAD, a pixel or a hit wanted it since its last update, its
|
|
50
|
-
* wanted time past its traced time, and `(frame + h(slot)) mod T` is 0. A DEAD probe
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
* trace 16 a frame).
|
|
50
|
+
* wanted time past its traced time, and `(frame + h(slot)) mod T` is 0. A DEAD probe is due every
|
|
51
|
+
* period like an ALIVE one, its update casting `PROBE_DEAD_RAYS`, so that a probe inside a solid
|
|
52
|
+
* notices when the scene changes (Enshrouded's dead probes trace 16 a frame).
|
|
54
53
|
*
|
|
55
54
|
* Wanted since its last update, not this frame: a hit wants a probe the frame after its own probe's
|
|
56
55
|
* update, so a probe that only hits keep is wanted on few of its turns. Measured on Sponza with the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader_probe_clipmap_guide.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_guide.js"],"names":[],"mappings":"AAmBA;;GAEG;AACH,mCAFU,YAAY,
|
|
1
|
+
{"version":3,"file":"shader_probe_clipmap_guide.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_guide.js"],"names":[],"mappings":"AAmBA;;GAEG;AACH,mCAFU,YAAY,CAaG;AAkEzB;;;;;;;;;GASG;AACH,8CAFU,aAAa,CAgCpB;AAEH;;;;;;GAMG;AACH,iDAFU,aAAa,CA4CpB;AAEH;;;;;;;;GAQG;AACH,gDAFU,aAAa,CA2DpB;6BA5P0B,sCAAsC;8BAHrC,kCAAkC"}
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_guide.js
CHANGED
|
@@ -29,6 +29,8 @@ export const PROBE_GUIDE_SETTINGS = WebGPUStruct.from({
|
|
|
29
29
|
radiance_resolution: u32,
|
|
30
30
|
/** tiles a row of the radiance atlas */
|
|
31
31
|
radiance_tiles_per_row: u32,
|
|
32
|
+
/** texels of skirt around a radiance tile's map on each side: 1, or 0 for a clipmap whose radiance is never sampled */
|
|
33
|
+
radiance_skirt: u32,
|
|
32
34
|
}, "ProbeGuideSettings");
|
|
33
35
|
|
|
34
36
|
const resources = new ShaderResourceSetDescriptor();
|
|
@@ -78,7 +80,7 @@ fn probe_guide_thread(workgroup_id: vec3<u32>, lane: u32) -> ProbeGuideThread {
|
|
|
78
80
|
out.slot = probe_trace.elements[out.k];
|
|
79
81
|
out.updates = probe_state_updates(probe_states[out.slot].x);
|
|
80
82
|
out.base = out.k * probe_clipmap_guide_words(n);
|
|
81
|
-
out.tile = index_to_grid2d(out.slot, settings.radiance_tiles_per_row) * (n + 2u) +
|
|
83
|
+
out.tile = index_to_grid2d(out.slot, settings.radiance_tiles_per_row) * (n + 2u * settings.radiance_skirt) + settings.radiance_skirt;
|
|
82
84
|
|
|
83
85
|
return out;
|
|
84
86
|
}
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The light a front-face hit takes from
|
|
2
|
+
* The light a front-face hit takes from the local lights (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.7): a
|
|
3
3
|
* thread a ray, after shade through the same launch, `PROBE_DISPATCH_RAYS`, its probe the one trace wrote
|
|
4
|
-
* into its flags. It adds ρ_d·
|
|
5
|
-
*
|
|
4
|
+
* into its flags. It adds ρ_d·E_loc/π to the radiance shade left, ρ_d being the albedo shade left in the
|
|
5
|
+
* ray's \`row\`; the next bounce, E_ind, is the bounce pass's, after it (`shader_probe_clipmap_bounce`).
|
|
6
6
|
*
|
|
7
7
|
* - **E_loc, the local lights**: one of the point and spot lights of the hit's cell of the world light
|
|
8
8
|
* clusters, built over the bricks' cascades so that every hit has one, at most
|
|
@@ -19,16 +19,10 @@
|
|
|
19
19
|
* a voxel, whichever is more, for the expand at that end. It sees the light if it misses; a hit, or a
|
|
20
20
|
* march that spends its steps, is no light. A light that casts no shadow traces none.
|
|
21
21
|
* - The pick and the point are drawn from the ray's slot and direction, fresh every update.
|
|
22
|
-
* - **E_ind, the next bounce**: this mode's own diffuse at the hit, `probe_clipmap_sample_sh` from the
|
|
23
|
-
* hit along its normal, the view back along the ray, with the ray's own jitter as the pick's noise.
|
|
24
|
-
* The projection writes the records later in the frame, so they hold last frame's SH: each frame takes
|
|
25
|
-
* one more bounce.
|
|
26
|
-
* - Where no probe weighs anything the bounce is **zero**, not the environment: a hit behind the camera
|
|
27
|
-
* in a cave must not bring daylight in. The next frame's hits' wants ask for the probes it read
|
|
28
|
-
* (`shader_probe_clipmap_want_hits`), so the bounce has them a frame or two later.
|
|
29
|
-
* - LPV's 0.97 a bounce is dropped: an albedo under one bounds the series already.
|
|
30
22
|
*
|
|
31
|
-
* Its own pass because shade binds nine of a stage's ten storage buffers
|
|
23
|
+
* Its own pass because shade binds nine of a stage's ten storage buffers; apart from the bounce because the
|
|
24
|
+
* two together would bind twelve storage buffers, and a shadow march is another cost than probe taps
|
|
25
|
+
* (WORLD_PROBE_CACHE_SCOPE_2026_11_01.md §1.5).
|
|
32
26
|
*
|
|
33
27
|
* @type {ComputeShader}
|
|
34
28
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader_probe_clipmap_light.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shader_probe_clipmap_light.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.js"],"names":[],"mappings":"AAqEA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,yCAFU,aAAa,CA0KpB;8BAnP2B,kCAAkC"}
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.js
CHANGED
|
@@ -11,20 +11,20 @@ import {
|
|
|
11
11
|
import { chunk_rgb_to_luminance } from "../../../shader/chunk/color/chunk_rgb_to_luminance.js";
|
|
12
12
|
import { chunk_rgbe9995_decode } from "../../../shader/chunk/color/rgbe9995/chunk_rgbe9995_decode.js";
|
|
13
13
|
import { chunk_rgbe9995_encode } from "../../../shader/chunk/color/rgbe9995/chunk_rgbe9995_encode.js";
|
|
14
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
chunk_uv_octahedral_unit_decode
|
|
16
|
+
} from "../../../shader/chunk/geometry/octahedron/chunk_uv_octahedral_unit_decode.js";
|
|
15
17
|
import { chunk_sphere_sample_volume } from "../../../shader/chunk/geometry/sphere/chunk_sphere_sample_volume.js";
|
|
16
18
|
import { chunk_folded_workgroup_index } from "../../../shader/chunk/grid/chunk_folded_workgroup_index.js";
|
|
17
19
|
import { RECIPROCAL_PI_DECLARATION } from "../../../shader/chunk/math/RECIPROCAL_PI_DECLARATION.js";
|
|
18
20
|
import { chunk_hash_to_float01 } from "../../../shader/chunk/random/chunk_hash_to_float01.js";
|
|
19
21
|
import { chunk_pcg4d } from "../../../shader/chunk/random/pcg/chunk_pcg4d.js";
|
|
20
|
-
import {
|
|
21
|
-
chunk_resolve_irradiance_sh_to_diffuse
|
|
22
|
-
} from "../../../shader/chunk/spherical_harmonics/l1i/chunk_resolve_irradiance_sh_to_diffuse.js";
|
|
23
22
|
import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
|
|
24
23
|
import { ComputeShader } from "../../../shader/ComputeShader.js";
|
|
25
24
|
import { ShaderResourceSetDescriptor } from "../../../shader/resource/ShaderResourceSetDescriptor.js";
|
|
26
|
-
import {
|
|
27
|
-
|
|
25
|
+
import {
|
|
26
|
+
chunk_irradiance_clipmap_local_light
|
|
27
|
+
} from "../../../volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_local_light.js";
|
|
28
28
|
import { IRRADIANCE_CLIPMAP_LIGHT_BUDGET } from "../../../volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP.js";
|
|
29
29
|
import { BRICK_TRACE_HIT } from "../brick/BRICK_CLIPMAP.js";
|
|
30
30
|
import {
|
|
@@ -37,25 +37,11 @@ import {
|
|
|
37
37
|
} from "../brick/chunk_brick_clipmap_trace.js";
|
|
38
38
|
import {
|
|
39
39
|
chunk_probe_clipmap,
|
|
40
|
-
chunk_probe_clipmap_ray_jitter,
|
|
41
|
-
chunk_probe_clipmap_ray_layout,
|
|
42
40
|
chunk_probe_clipmap_ray_origin,
|
|
43
|
-
chunk_probe_clipmap_ray_texel,
|
|
44
|
-
PROBE_DEPTH_HISTORY_RESOURCE,
|
|
45
|
-
PROBE_LEVELS_RESOURCE,
|
|
46
41
|
PROBE_ORIGINS_READ_RESOURCE,
|
|
47
|
-
PROBE_RAY_SUMS_READ_RESOURCE,
|
|
48
42
|
PROBE_RAYS_WRITE_RESOURCE,
|
|
49
|
-
PROBE_RECORDS_READ_RESOURCE,
|
|
50
|
-
PROBE_STATES_READ_RESOURCE,
|
|
51
43
|
PROBE_TRACE_READ_RESOURCE
|
|
52
44
|
} from "./chunk_probe_clipmap.js";
|
|
53
|
-
import {
|
|
54
|
-
chunk_probe_clipmap_pick,
|
|
55
|
-
PROBE_DEPTH_SAMPLER_RESOURCE,
|
|
56
|
-
PROBE_INDIRECTION_READ_RESOURCE,
|
|
57
|
-
PROBE_SAMPLING_RESOURCE
|
|
58
|
-
} from "./chunk_probe_clipmap_pick.js";
|
|
59
45
|
import { PROBE_THREAD_WORKGROUP_SIZE } from "./PROBE_CLIPMAP.js";
|
|
60
46
|
import { PROBE_TRACE_SETTINGS } from "./shader_probe_clipmap_trace.js";
|
|
61
47
|
|
|
@@ -69,18 +55,7 @@ resources.setImmediate("settings", PROBE_TRACE_SETTINGS);
|
|
|
69
55
|
resources.createGroup()
|
|
70
56
|
.add(PROBE_TRACE_READ_RESOURCE)
|
|
71
57
|
.add(PROBE_ORIGINS_READ_RESOURCE)
|
|
72
|
-
.add(PROBE_RAYS_WRITE_RESOURCE)
|
|
73
|
-
.add(PROBE_RAY_SUMS_READ_RESOURCE)
|
|
74
|
-
.add(PROBE_STATES_READ_RESOURCE)
|
|
75
|
-
.add(STBN_VEC2_RESOURCE);
|
|
76
|
-
|
|
77
|
-
resources.createGroup()
|
|
78
|
-
.add(PROBE_LEVELS_RESOURCE)
|
|
79
|
-
.add(PROBE_SAMPLING_RESOURCE)
|
|
80
|
-
.add(PROBE_INDIRECTION_READ_RESOURCE)
|
|
81
|
-
.add(PROBE_RECORDS_READ_RESOURCE)
|
|
82
|
-
.add(PROBE_DEPTH_HISTORY_RESOURCE)
|
|
83
|
-
.add(PROBE_DEPTH_SAMPLER_RESOURCE);
|
|
58
|
+
.add(PROBE_RAYS_WRITE_RESOURCE);
|
|
84
59
|
|
|
85
60
|
resources.createGroup()
|
|
86
61
|
.add(BRICK_LEVELS_RESOURCE)
|
|
@@ -93,10 +68,10 @@ resources.createGroup()
|
|
|
93
68
|
.add(WORLD_CLUSTER_DATA_RESOURCE);
|
|
94
69
|
|
|
95
70
|
/**
|
|
96
|
-
* The light a front-face hit takes from
|
|
71
|
+
* The light a front-face hit takes from the local lights (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.7): a
|
|
97
72
|
* thread a ray, after shade through the same launch, `PROBE_DISPATCH_RAYS`, its probe the one trace wrote
|
|
98
|
-
* into its flags. It adds ρ_d·
|
|
99
|
-
*
|
|
73
|
+
* into its flags. It adds ρ_d·E_loc/π to the radiance shade left, ρ_d being the albedo shade left in the
|
|
74
|
+
* ray's \`row\`; the next bounce, E_ind, is the bounce pass's, after it (`shader_probe_clipmap_bounce`).
|
|
100
75
|
*
|
|
101
76
|
* - **E_loc, the local lights**: one of the point and spot lights of the hit's cell of the world light
|
|
102
77
|
* clusters, built over the bricks' cascades so that every hit has one, at most
|
|
@@ -113,16 +88,10 @@ resources.createGroup()
|
|
|
113
88
|
* a voxel, whichever is more, for the expand at that end. It sees the light if it misses; a hit, or a
|
|
114
89
|
* march that spends its steps, is no light. A light that casts no shadow traces none.
|
|
115
90
|
* - The pick and the point are drawn from the ray's slot and direction, fresh every update.
|
|
116
|
-
* - **E_ind, the next bounce**: this mode's own diffuse at the hit, `probe_clipmap_sample_sh` from the
|
|
117
|
-
* hit along its normal, the view back along the ray, with the ray's own jitter as the pick's noise.
|
|
118
|
-
* The projection writes the records later in the frame, so they hold last frame's SH: each frame takes
|
|
119
|
-
* one more bounce.
|
|
120
|
-
* - Where no probe weighs anything the bounce is **zero**, not the environment: a hit behind the camera
|
|
121
|
-
* in a cave must not bring daylight in. The next frame's hits' wants ask for the probes it read
|
|
122
|
-
* (`shader_probe_clipmap_want_hits`), so the bounce has them a frame or two later.
|
|
123
|
-
* - LPV's 0.97 a bounce is dropped: an albedo under one bounds the series already.
|
|
124
91
|
*
|
|
125
|
-
* Its own pass because shade binds nine of a stage's ten storage buffers
|
|
92
|
+
* Its own pass because shade binds nine of a stage's ten storage buffers; apart from the bounce because the
|
|
93
|
+
* two together would bind twelve storage buffers, and a shadow march is another cost than probe taps
|
|
94
|
+
* (WORLD_PROBE_CACHE_SCOPE_2026_11_01.md §1.5).
|
|
126
95
|
*
|
|
127
96
|
* @type {ComputeShader}
|
|
128
97
|
*/
|
|
@@ -255,16 +224,8 @@ fn main(
|
|
|
255
224
|
return;
|
|
256
225
|
}
|
|
257
226
|
|
|
258
|
-
// the probe's update's rays, and this one's place among them
|
|
259
227
|
let k = record.flags >> PROBE_RAY_PROBE_SHIFT;
|
|
260
|
-
let span = probe_clipmap_probe_rays(k);
|
|
261
|
-
let rays = span.y;
|
|
262
|
-
let i = ray - span.x;
|
|
263
|
-
|
|
264
228
|
let slot = probe_trace.elements[k];
|
|
265
|
-
let n = settings.radiance_resolution;
|
|
266
|
-
let updates = probe_state_updates(probe_states[slot].x);
|
|
267
|
-
let texel = probe_clipmap_ray_texel(i, updates, rays, n * n);
|
|
268
229
|
|
|
269
230
|
let direction = uv_octahedral_unit_decode(unpack2x16unorm(record.direction));
|
|
270
231
|
let position = probe_clipmap_ray_origin(probe_origins[k], slot, record.direction) + record.t * direction;
|
|
@@ -274,14 +235,8 @@ fn main(
|
|
|
274
235
|
let hash = pcg4d(vec4<u32>(slot, record.direction, 0xA54FF53Au, 0u));
|
|
275
236
|
let random = vec4<f32>(hash_to_float01(hash.x), hash_to_float01(hash.y), hash_to_float01(hash.z), hash_to_float01(hash.w));
|
|
276
237
|
|
|
277
|
-
// E
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
let probes = probe_clipmap_sample_sh(position, normal, -direction, probe_clipmap_ray_jitter(slot, texel, i, updates, rays, n));
|
|
281
|
-
|
|
282
|
-
if (probes.found) {
|
|
283
|
-
e += resolve_irradiance_sh_to_diffuse(probes.sh.Y, probes.sh.CoCg, normal);
|
|
284
|
-
}
|
|
238
|
+
// E/π of the local lights
|
|
239
|
+
let e = probe_clipmap_local_irradiance((record.flags >> PROBE_RAY_CASCADE_SHIFT) & PROBE_RAY_CASCADE_MASK, position, normal, random) * RECIPROCAL_PI;
|
|
285
240
|
|
|
286
241
|
if (all(e == vec3<f32>(0.0))) {
|
|
287
242
|
return;
|
|
@@ -291,14 +246,9 @@ fn main(
|
|
|
291
246
|
}
|
|
292
247
|
`, [
|
|
293
248
|
chunk_probe_clipmap,
|
|
294
|
-
chunk_probe_clipmap_ray_layout,
|
|
295
|
-
chunk_probe_clipmap_ray_texel,
|
|
296
|
-
chunk_probe_clipmap_ray_jitter,
|
|
297
249
|
chunk_probe_clipmap_ray_origin,
|
|
298
250
|
chunk_folded_workgroup_index,
|
|
299
251
|
chunk_uv_octahedral_unit_decode,
|
|
300
|
-
chunk_probe_clipmap_pick,
|
|
301
|
-
chunk_resolve_irradiance_sh_to_diffuse,
|
|
302
252
|
RECIPROCAL_PI_DECLARATION,
|
|
303
253
|
chunk_world_light_cluster_lookup_at,
|
|
304
254
|
chunk_light_cluster_counts,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader_probe_clipmap_order.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_order.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shader_probe_clipmap_order.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_order.js"],"names":[],"mappings":"AAoBA;;GAEG;AACH,mCAFU,YAAY,CASG;AAWzB;;;;;;;;;;;;;;GAcG;AACH,yCAFU,aAAa,CA4DpB;6BAzG0B,sCAAsC;8BAHrC,kCAAkC"}
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_order.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { assert } from "../../../../../core/assert.js";
|
|
1
2
|
import { chunk_sort_bitonic_workgroup } from "../../../gpu_primitive/sort/chunk_sort_bitonic_workgroup.js";
|
|
2
3
|
import { SORT_KEYS_PER_THREAD, SORT_TILE_SIZE, SORT_WORKGROUP_SIZE } from "../../../gpu_primitive/sort/defs.js";
|
|
3
4
|
import { chunk_v3_morton_encode } from "../../../shader/chunk/bvh/morton/chunk_v3_morton_encode.js";
|
|
@@ -7,8 +8,12 @@ import { ComputeShader } from "../../../shader/ComputeShader.js";
|
|
|
7
8
|
import { ShaderResourceSetDescriptor } from "../../../shader/resource/ShaderResourceSetDescriptor.js";
|
|
8
9
|
import { u32 } from "../../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
|
|
9
10
|
import { WebGPUStruct } from "../../../shader/type/WebGPUStruct.js";
|
|
10
|
-
import {
|
|
11
|
-
|
|
11
|
+
import {
|
|
12
|
+
chunk_probe_clipmap,
|
|
13
|
+
PROBE_LEVELS_RESOURCE,
|
|
14
|
+
PROBE_RECORDS_READ_RESOURCE,
|
|
15
|
+
PROBE_TRACE_ORDER_RESOURCE
|
|
16
|
+
} from "./chunk_probe_clipmap.js";
|
|
12
17
|
import { PROBE_ORDER_RUN } from "./PROBE_CLIPMAP.js";
|
|
13
18
|
|
|
14
19
|
assert.equal(PROBE_ORDER_RUN, SORT_TILE_SIZE, 'PROBE_ORDER_RUN is a tile of the bitonic sort');
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export const shader_probe_clipmap_project_rows: ComputeShader;
|
|
|
16
16
|
/**
|
|
17
17
|
* Projection, probes (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.4, §8.8): a thread a listed probe,
|
|
18
18
|
* dispatched through `PROBE_DISPATCH_TRACED`. It sums its rows into its record's SH, and classifies it
|
|
19
|
-
* by the update's resolved rays: dead
|
|
19
|
+
* by the update's resolved rays: dead when every one hit a back face, else alive, its update counted and
|
|
20
20
|
* its time the frame's. An update with no resolved ray keeps the probe's kind.
|
|
21
21
|
*
|
|
22
22
|
* Only uniform rays classify. Those are a uniform update's, and a guided update's whose guide weighs
|
|
@@ -32,9 +32,9 @@ export const shader_probe_clipmap_project_rows: ComputeShader;
|
|
|
32
32
|
* texel's own noise (measured: the estimator's inconsistency barely moves on a doubling); a sum of the
|
|
33
33
|
* falls unbounded is one bright sample's.
|
|
34
34
|
* - The score is held to the probe's own: moved means past `PROBE_CHANGE_SIGNIFICANCE` of its running
|
|
35
|
-
* deviation, at least one, from its running mean, both over the estimator's variance window
|
|
36
|
-
*
|
|
37
|
-
* steadily off zero.
|
|
35
|
+
* deviation, at least one, from its running mean, both over the estimator's variance window,
|
|
36
|
+
* `PROBE_VARIANCE_BLEND` an update however long since the last. A probe whose means sit off its samples
|
|
37
|
+
* (the estimator's own bias on texels lit by few rays) scores steadily off zero.
|
|
38
38
|
* - Measured, Sponza on the 4090, the camera and the light still, 3,600 frames settled: of the probes
|
|
39
39
|
* past 64 updates, 4.2% asked for the most against a sum of the raw falls held to zero, 3.2% with each
|
|
40
40
|
* texel's fall bounded, and 1.1–1.3% held to their own statistics.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader_probe_clipmap_project.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shader_probe_clipmap_project.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.js"],"names":[],"mappings":"AAoCA;;GAEG;AACH,qCAFU,YAAY,CAmBK;AAW3B;;;;;;;;;GASG;AACH,gDAFU,aAAa,CAuDpB;AAcH;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,2CAFU,aAAa,CA4FpB;6BAzP0B,sCAAsC;8BAHrC,kCAAkC"}
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.js
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
chunk_octahedral_solid_angle
|
|
3
|
+
} from "../../../shader/chunk/geometry/octahedron/chunk_octahedral_solid_angle.js";
|
|
4
|
+
import {
|
|
5
|
+
chunk_uv_octahedral_unit_decode
|
|
6
|
+
} from "../../../shader/chunk/geometry/octahedron/chunk_uv_octahedral_unit_decode.js";
|
|
3
7
|
import { chunk_folded_workgroup_index } from "../../../shader/chunk/grid/chunk_folded_workgroup_index.js";
|
|
4
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
chunk_convert_to_irradiance_sh
|
|
10
|
+
} from "../../../shader/chunk/spherical_harmonics/l1i/chunk_convert_to_irradiance_sh.js";
|
|
5
11
|
import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
|
|
6
12
|
import { ComputeShader } from "../../../shader/ComputeShader.js";
|
|
7
13
|
import { ShaderResourceSetDescriptor } from "../../../shader/resource/ShaderResourceSetDescriptor.js";
|
|
8
|
-
import {
|
|
14
|
+
import { u32 } from "../../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
|
|
9
15
|
import { WebGPUStruct } from "../../../shader/type/WebGPUStruct.js";
|
|
10
16
|
import {
|
|
11
17
|
chunk_probe_clipmap,
|
|
@@ -21,7 +27,12 @@ import {
|
|
|
21
27
|
PROBE_STATES_STORE_RESOURCE,
|
|
22
28
|
PROBE_TRACE_READ_RESOURCE
|
|
23
29
|
} from "./chunk_probe_clipmap.js";
|
|
24
|
-
import {
|
|
30
|
+
import {
|
|
31
|
+
PROBE_CHANGE_SIGNIFICANCE,
|
|
32
|
+
PROBE_RADIANCE_SAMPLES_LIMIT,
|
|
33
|
+
PROBE_THREAD_WORKGROUP_SIZE,
|
|
34
|
+
PROBE_VARIANCE_BLEND
|
|
35
|
+
} from "./PROBE_CLIPMAP.js";
|
|
25
36
|
|
|
26
37
|
/**
|
|
27
38
|
* @type {WebGPUStruct}
|
|
@@ -39,12 +50,10 @@ export const PROBE_PROJECT_SETTINGS = WebGPUStruct.from({
|
|
|
39
50
|
frame: u32,
|
|
40
51
|
/** updates between a probe's uniform ones, `PROBE_UNIFORM_PERIOD` */
|
|
41
52
|
uniform_period: u32,
|
|
42
|
-
/** the fewest rays
|
|
53
|
+
/** the fewest rays a guided update casts, `PROBE_RAYS_PER_TEXEL_MIN` of the texels */
|
|
43
54
|
rays_min: u32,
|
|
44
55
|
/** the most rays an update casts, `PROBE_RAYS_PER_TEXEL_MAX` of the texels */
|
|
45
56
|
rays_max: u32,
|
|
46
|
-
/** the radiance's short mean's response, τ, in frames: the change score's statistics follow it */
|
|
47
|
-
response_frames: f32,
|
|
48
57
|
}, "ProbeProjectSettings");
|
|
49
58
|
|
|
50
59
|
const row_resources = new ShaderResourceSetDescriptor();
|
|
@@ -136,7 +145,7 @@ probe_resources.createGroup()
|
|
|
136
145
|
/**
|
|
137
146
|
* Projection, probes (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.4, §8.8): a thread a listed probe,
|
|
138
147
|
* dispatched through `PROBE_DISPATCH_TRACED`. It sums its rows into its record's SH, and classifies it
|
|
139
|
-
* by the update's resolved rays: dead
|
|
148
|
+
* by the update's resolved rays: dead when every one hit a back face, else alive, its update counted and
|
|
140
149
|
* its time the frame's. An update with no resolved ray keeps the probe's kind.
|
|
141
150
|
*
|
|
142
151
|
* Only uniform rays classify. Those are a uniform update's, and a guided update's whose guide weighs
|
|
@@ -152,9 +161,9 @@ probe_resources.createGroup()
|
|
|
152
161
|
* texel's own noise (measured: the estimator's inconsistency barely moves on a doubling); a sum of the
|
|
153
162
|
* falls unbounded is one bright sample's.
|
|
154
163
|
* - The score is held to the probe's own: moved means past `PROBE_CHANGE_SIGNIFICANCE` of its running
|
|
155
|
-
* deviation, at least one, from its running mean, both over the estimator's variance window
|
|
156
|
-
*
|
|
157
|
-
* steadily off zero.
|
|
164
|
+
* deviation, at least one, from its running mean, both over the estimator's variance window,
|
|
165
|
+
* `PROBE_VARIANCE_BLEND` an update however long since the last. A probe whose means sit off its samples
|
|
166
|
+
* (the estimator's own bias on texels lit by few rays) scores steadily off zero.
|
|
158
167
|
* - Measured, Sponza on the 4090, the camera and the light still, 3,600 frames settled: of the probes
|
|
159
168
|
* past 64 updates, 4.2% asked for the most against a sum of the raw falls held to zero, 3.2% with each
|
|
160
169
|
* texel's fall bounded, and 1.1–1.3% held to their own statistics.
|
|
@@ -208,13 +217,11 @@ fn main(
|
|
|
208
217
|
if (sum.resolved > 0u && uniform) {
|
|
209
218
|
let share = f32(sum.back_faces) / f32(sum.resolved);
|
|
210
219
|
|
|
211
|
-
kind = select(PROBE_STATE_ALIVE, PROBE_STATE_DEAD,
|
|
220
|
+
kind = select(PROBE_STATE_ALIVE, PROBE_STATE_DEAD, sum.back_faces == sum.resolved);
|
|
212
221
|
|
|
213
|
-
probe_records[slot].flags = (probe_records[slot].flags & 0xFFFF0000u) | probe_record_flags(share,
|
|
222
|
+
probe_records[slot].flags = (probe_records[slot].flags & 0xFFFF0000u) | probe_record_flags(share, 0u);
|
|
214
223
|
}
|
|
215
224
|
|
|
216
|
-
let elapsed = f32(settings.frame - probe_records[slot].traced_frame);
|
|
217
|
-
|
|
218
225
|
probe_states[slot].x = probe_state(kind, updates + 1u);
|
|
219
226
|
probe_records[slot].sh = probe_record_sh_encode(sum.sh);
|
|
220
227
|
probe_records[slot].traced_frame = settings.frame;
|
|
@@ -234,7 +241,7 @@ fn main(
|
|
|
234
241
|
// window; a score past their reach counts at it, so a change in the light does not become the probe's
|
|
235
242
|
// own spread, while a lasting shift of its own still does within a few windows
|
|
236
243
|
let held = clamp(score, request.change_mean - reach, request.change_mean + reach);
|
|
237
|
-
let blend = max(1.0 / f32(request.changes + 1u),
|
|
244
|
+
let blend = max(1.0 / f32(request.changes + 1u), ${PROBE_VARIANCE_BLEND});
|
|
238
245
|
let mean = mix(request.change_mean, held, blend);
|
|
239
246
|
|
|
240
247
|
request.change_variance = mix(request.change_variance, (held - request.change_mean) * (held - mean), blend);
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_publish.d.ts
CHANGED
|
@@ -4,11 +4,13 @@
|
|
|
4
4
|
export const PROBE_PUBLISH_SETTINGS: WebGPUStruct;
|
|
5
5
|
/**
|
|
6
6
|
* Publish (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.8): a thread a texel of each listed probe's two
|
|
7
|
-
* tiles, the radiance tile's (n_r +
|
|
8
|
-
* `PROBE_DISPATCH_PUBLISH`. A tile is its map with a
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
7
|
+
* tiles, the radiance tile's (n_r + 2s)² then the depth tile's (n_d + 2)², dispatched through
|
|
8
|
+
* `PROBE_DISPATCH_PUBLISH`. A tile is its map with a skirt of s texels, one for the depth and
|
|
9
|
+
* `radiance_skirt` for the radiance, each skirt texel the interior texel the octahedral fold puts next to it,
|
|
10
|
+
* so a reader's bilinear tap across the edge reads what a wrap would (`texture_octahedral_skirt_uv`). A
|
|
11
|
+
* clipmap whose radiance is never sampled, only loaded texel by texel, has none there
|
|
12
|
+
* (WORLD_PROBE_CACHE_SCOPE_2026_11_01.md §1.8). Every texel is written from the probe's maps, which
|
|
13
|
+
* accumulation wrote whole: the atlases are only ever stored into here.
|
|
12
14
|
*
|
|
13
15
|
* @type {ComputeShader}
|
|
14
16
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader_probe_clipmap_publish.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_publish.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shader_probe_clipmap_publish.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_publish.js"],"names":[],"mappings":"AAmBA;;GAEG;AACH,qCAFU,YAAY,CAeK;AAY3B;;;;;;;;;;;GAWG;AACH,2CAFU,aAAa,CAuDpB;6BAvG0B,sCAAsC;8BAHrC,kCAAkC"}
|