@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_publish.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { chunk_folded_workgroup_index } from "../../../shader/chunk/grid/chunk_folded_workgroup_index.js";
|
|
2
2
|
import { chunk_index_to_grid2d } from "../../../shader/chunk/grid/chunk_index_to_grid2d.js";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
chunk_texture_octahedral_wrap_texel_coordinates
|
|
5
|
+
} from "../../../shader/chunk/texture/octahedral/chunk_texture_octahedral_wrap_texel_coordinates.js";
|
|
4
6
|
import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
|
|
5
7
|
import { ComputeShader } from "../../../shader/ComputeShader.js";
|
|
6
8
|
import { ShaderResourceSetDescriptor } from "../../../shader/resource/ShaderResourceSetDescriptor.js";
|
|
@@ -27,6 +29,8 @@ export const PROBE_PUBLISH_SETTINGS = WebGPUStruct.from({
|
|
|
27
29
|
depth_resolution: u32,
|
|
28
30
|
/** tiles a row of the radiance atlas */
|
|
29
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,
|
|
30
34
|
/** tiles a row of the depth atlas */
|
|
31
35
|
depth_tiles_per_row: u32,
|
|
32
36
|
}, "ProbePublishSettings");
|
|
@@ -43,11 +47,13 @@ resources.createGroup()
|
|
|
43
47
|
|
|
44
48
|
/**
|
|
45
49
|
* Publish (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.8): a thread a texel of each listed probe's two
|
|
46
|
-
* tiles, the radiance tile's (n_r +
|
|
47
|
-
* `PROBE_DISPATCH_PUBLISH`. A tile is its map with a
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
50
|
+
* tiles, the radiance tile's (n_r + 2s)² then the depth tile's (n_d + 2)², dispatched through
|
|
51
|
+
* `PROBE_DISPATCH_PUBLISH`. A tile is its map with a skirt of s texels, one for the depth and
|
|
52
|
+
* `radiance_skirt` for the radiance, each skirt texel the interior texel the octahedral fold puts next to it,
|
|
53
|
+
* so a reader's bilinear tap across the edge reads what a wrap would (`texture_octahedral_skirt_uv`). A
|
|
54
|
+
* clipmap whose radiance is never sampled, only loaded texel by texel, has none there
|
|
55
|
+
* (WORLD_PROBE_CACHE_SCOPE_2026_11_01.md §1.8). Every texel is written from the probe's maps, which
|
|
56
|
+
* accumulation wrote whole: the atlases are only ever stored into here.
|
|
51
57
|
*
|
|
52
58
|
* @type {ComputeShader}
|
|
53
59
|
*/
|
|
@@ -66,7 +72,9 @@ fn main(
|
|
|
66
72
|
|
|
67
73
|
let n = settings.radiance_resolution;
|
|
68
74
|
let m = settings.depth_resolution;
|
|
69
|
-
let
|
|
75
|
+
let skirt = settings.radiance_skirt;
|
|
76
|
+
let side = n + 2u * skirt;
|
|
77
|
+
let radiance_tile = side * side;
|
|
70
78
|
let per_probe = radiance_tile + (m + 2u) * (m + 2u);
|
|
71
79
|
|
|
72
80
|
if (thread >= min(probe_trace.count, settings.trace_capacity) * per_probe) {
|
|
@@ -79,12 +87,12 @@ fn main(
|
|
|
79
87
|
let maps = k * probe_clipmap_maps_words(n, m);
|
|
80
88
|
|
|
81
89
|
if (i < radiance_tile) {
|
|
82
|
-
let at = vec2<u32>(i %
|
|
83
|
-
let source = texture_octahedral_wrap_texel_coordinates(vec2<i32>(at) -
|
|
90
|
+
let at = vec2<u32>(i % side, i / side);
|
|
91
|
+
let source = texture_octahedral_wrap_texel_coordinates(vec2<i32>(at) - i32(skirt), i32(n));
|
|
84
92
|
let texel = source.y * n + source.x;
|
|
85
93
|
let value = vec4<f32>(unpack2x16float(probe_maps[maps + 2u * texel]), unpack2x16float(probe_maps[maps + 2u * texel + 1u]));
|
|
86
94
|
|
|
87
|
-
textureStore(probe_radiance, index_to_grid2d(slot, settings.radiance_tiles_per_row) *
|
|
95
|
+
textureStore(probe_radiance, index_to_grid2d(slot, settings.radiance_tiles_per_row) * side + at, value);
|
|
88
96
|
|
|
89
97
|
return;
|
|
90
98
|
}
|
|
@@ -7,8 +7,8 @@ export const PROBE_RAY_COUNTS_SETTINGS: WebGPUStruct;
|
|
|
7
7
|
* `PROBE_DISPATCH_TRACED`, writes the rays its update casts, as two parts whose counts the trace command
|
|
8
8
|
* wrote:
|
|
9
9
|
* - `probe_ray_counts`, what the budget does not scale: a uniform update's R, a NEW probe's among them,
|
|
10
|
-
* and a DEAD probe's
|
|
11
|
-
* takes a power of two, and U = ⌊budget / R⌋ makes room for a frame of them.
|
|
10
|
+
* and a DEAD probe's `PROBE_DEAD_RAYS`, whose updates are all uniform. A uniform update's map of rays
|
|
11
|
+
* to texels takes a power of two, and U = ⌊budget / R⌋ makes room for a frame of them.
|
|
12
12
|
* - `probe_ray_requests`, what it does: a guided update's request, the rays the probe asked for after its
|
|
13
13
|
* last update (`probe_requests`), at least the fewest.
|
|
14
14
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader_probe_clipmap_ray_layout.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_ray_layout.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shader_probe_clipmap_ray_layout.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_ray_layout.js"],"names":[],"mappings":"AAwBA;;GAEG;AACH,wCAFU,YAAY,CAeO;AAa7B;;;;;;;;;;;;;GAaG;AACH,8CAFU,aAAa,CAyCpB;AAEH;;GAEG;AACH,wCAFU,YAAY,CAOO;AAW7B;;;;;;;;;GASG;AACH,8CAFU,aAAa,CA+BpB;AAQH;;;;;;GAMG;AACH,+CAFU,aAAa,CA6BpB;6BAzM0B,sCAAsC;8BAHrC,kCAAkC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { chunk_folded_dispatch } from "../../../gpu_primitive/indirect/chunk_folded_dispatch.js";
|
|
2
|
+
import { chunk_divide_round_up_u32 } from "../../../shader/chunk/math/chunk_divide_round_up_u32.js";
|
|
2
3
|
import { chunk_folded_workgroup_index } from "../../../shader/chunk/grid/chunk_folded_workgroup_index.js";
|
|
3
4
|
import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
|
|
4
5
|
import { ComputeShader } from "../../../shader/ComputeShader.js";
|
|
@@ -29,8 +30,10 @@ export const PROBE_RAY_COUNTS_SETTINGS = WebGPUStruct.from({
|
|
|
29
30
|
trace_capacity: u32,
|
|
30
31
|
/** rays a uniform update casts, R */
|
|
31
32
|
rays_per_probe: u32,
|
|
32
|
-
/** the fewest rays
|
|
33
|
+
/** the fewest rays a guided update casts, `PROBE_RAYS_PER_TEXEL_MIN` of the texels */
|
|
33
34
|
rays_min: u32,
|
|
35
|
+
/** rays a DEAD probe's update casts, `PROBE_DEAD_RAYS` or R where R is fewer */
|
|
36
|
+
rays_dead: u32,
|
|
34
37
|
/** octahedral radiance texels a side, n_r */
|
|
35
38
|
radiance_resolution: u32,
|
|
36
39
|
/** updates between a probe's uniform ones, `PROBE_UNIFORM_PERIOD` */
|
|
@@ -53,8 +56,8 @@ counts_resources.createGroup()
|
|
|
53
56
|
* `PROBE_DISPATCH_TRACED`, writes the rays its update casts, as two parts whose counts the trace command
|
|
54
57
|
* wrote:
|
|
55
58
|
* - `probe_ray_counts`, what the budget does not scale: a uniform update's R, a NEW probe's among them,
|
|
56
|
-
* and a DEAD probe's
|
|
57
|
-
* takes a power of two, and U = ⌊budget / R⌋ makes room for a frame of them.
|
|
59
|
+
* and a DEAD probe's `PROBE_DEAD_RAYS`, whose updates are all uniform. A uniform update's map of rays
|
|
60
|
+
* to texels takes a power of two, and U = ⌊budget / R⌋ makes room for a frame of them.
|
|
58
61
|
* - `probe_ray_requests`, what it does: a guided update's request, the rays the probe asked for after its
|
|
59
62
|
* last update (`probe_requests`), at least the fewest.
|
|
60
63
|
*
|
|
@@ -87,7 +90,7 @@ fn main(
|
|
|
87
90
|
var request = 0u;
|
|
88
91
|
|
|
89
92
|
if (probe_state_kind(state) == PROBE_STATE_DEAD) {
|
|
90
|
-
fixed = settings.
|
|
93
|
+
fixed = settings.rays_dead;
|
|
91
94
|
} else if (probe_clipmap_guided(state, settings.uniform_period, settings.rays_per_probe, n * n)) {
|
|
92
95
|
fixed = 0u;
|
|
93
96
|
request = max(probe_requests[slot].rays, settings.rays_min);
|
|
@@ -192,7 +195,7 @@ fn main() {
|
|
|
192
195
|
total = probe_ray_sums.elements[listed - 1u];
|
|
193
196
|
}
|
|
194
197
|
|
|
195
|
-
let rays = folded_dispatch((total
|
|
198
|
+
let rays = folded_dispatch(divide_round_up_u32(total, PROBE_THREAD_WORKGROUP_SIZE));
|
|
196
199
|
|
|
197
200
|
probe_dispatch[PROBE_DISPATCH_RAYS] = rays.x;
|
|
198
201
|
probe_dispatch[PROBE_DISPATCH_RAYS + 1u] = rays.y;
|
|
@@ -200,6 +203,7 @@ fn main() {
|
|
|
200
203
|
}
|
|
201
204
|
`, [
|
|
202
205
|
chunk_probe_clipmap,
|
|
206
|
+
chunk_divide_round_up_u32,
|
|
203
207
|
chunk_folded_dispatch,
|
|
204
208
|
]),
|
|
205
209
|
});
|
|
@@ -17,6 +17,9 @@ export const PROBE_RELOCATE_SETTINGS: WebGPUStruct;
|
|
|
17
17
|
* the probe's origin at that offset, as the encoding holds it, to `probe_origins` at its place in the
|
|
18
18
|
* list, where the update's passes after it find it.
|
|
19
19
|
*
|
|
20
|
+
* Its place in the list goes to `probe_listed` at its slot, where a probe updated in the same frame finds it as a
|
|
21
|
+
* neighbour (`probe_clipmap_listed`).
|
|
22
|
+
*
|
|
20
23
|
* @type {ComputeShader}
|
|
21
24
|
*/
|
|
22
25
|
export const shader_probe_clipmap_relocate: ComputeShader;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader_probe_clipmap_relocate.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_relocate.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shader_probe_clipmap_relocate.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_relocate.js"],"names":[],"mappings":"AAyBA;;GAEG;AACH,sCAFU,YAAY,CAOM;AAkB5B;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4CAFU,aAAa,CAyDpB;6BAzH0B,sCAAsC;8BAHrC,kCAAkC"}
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_relocate.js
CHANGED
|
@@ -15,17 +15,13 @@ import {
|
|
|
15
15
|
import {
|
|
16
16
|
chunk_probe_clipmap,
|
|
17
17
|
PROBE_LEVELS_RESOURCE,
|
|
18
|
+
PROBE_LISTED_WRITE_RESOURCE,
|
|
18
19
|
PROBE_ORIGINS_WRITE_RESOURCE,
|
|
19
20
|
PROBE_RECORDS_READ_RESOURCE,
|
|
20
21
|
PROBE_STATES_STORE_RESOURCE,
|
|
21
22
|
PROBE_TRACE_READ_RESOURCE
|
|
22
23
|
} from "./chunk_probe_clipmap.js";
|
|
23
|
-
import {
|
|
24
|
-
PROBE_RELOCATION_CLEARANCE,
|
|
25
|
-
PROBE_RELOCATION_LIMIT,
|
|
26
|
-
PROBE_RELOCATION_STEPS,
|
|
27
|
-
PROBE_THREAD_WORKGROUP_SIZE
|
|
28
|
-
} from "./PROBE_CLIPMAP.js";
|
|
24
|
+
import { PROBE_RELOCATION_CLEARANCE, PROBE_RELOCATION_STEPS, PROBE_THREAD_WORKGROUP_SIZE } from "./PROBE_CLIPMAP.js";
|
|
29
25
|
|
|
30
26
|
/**
|
|
31
27
|
* @type {WebGPUStruct}
|
|
@@ -47,6 +43,7 @@ resources.createGroup()
|
|
|
47
43
|
.add(PROBE_RECORDS_READ_RESOURCE)
|
|
48
44
|
.add(PROBE_TRACE_READ_RESOURCE)
|
|
49
45
|
.add(PROBE_ORIGINS_WRITE_RESOURCE)
|
|
46
|
+
.add(PROBE_LISTED_WRITE_RESOURCE)
|
|
50
47
|
.add(BRICK_LEVELS_RESOURCE)
|
|
51
48
|
.add(BRICK_MAP_TEXTURE_RESOURCE)
|
|
52
49
|
.add(BRICK_ATLAS_TEXTURE_RESOURCE)
|
|
@@ -67,6 +64,9 @@ resources.createGroup()
|
|
|
67
64
|
* the probe's origin at that offset, as the encoding holds it, to `probe_origins` at its place in the
|
|
68
65
|
* list, where the update's passes after it find it.
|
|
69
66
|
*
|
|
67
|
+
* Its place in the list goes to `probe_listed` at its slot, where a probe updated in the same frame finds it as a
|
|
68
|
+
* neighbour (`probe_clipmap_listed`).
|
|
69
|
+
*
|
|
70
70
|
* @type {ComputeShader}
|
|
71
71
|
*/
|
|
72
72
|
export const shader_probe_clipmap_relocate = ComputeShader.from({
|
|
@@ -87,6 +87,9 @@ fn main(
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
let slot = probe_trace.elements[index];
|
|
90
|
+
|
|
91
|
+
probe_listed[slot] = index;
|
|
92
|
+
|
|
90
93
|
let spacing = probe_levels[probe_record_cascade(probe_records[slot].flags)].cell_size;
|
|
91
94
|
let lattice = vec3<f32>(probe_records[slot].cell) * spacing;
|
|
92
95
|
let clearance = ${PROBE_RELOCATION_CLEARANCE} * spacing;
|
|
@@ -36,7 +36,7 @@ export const PROBE_RESAMPLE_SETTINGS: WebGPUStruct;
|
|
|
36
36
|
* B's own samples of its texel. Both are absolute, each held to the estimator's own floor of 10⁻⁵, so a
|
|
37
37
|
* dark neighbour is not taken less for being dark;
|
|
38
38
|
* - its freshness, `e^(−age / τ)`: age the frames since the neighbour's last update, τ
|
|
39
|
-
* `response_frames`, the time over which a
|
|
39
|
+
* `response_frames`, the time over which a neighbour's history goes stale.
|
|
40
40
|
* - A neighbour's texel no ray has reached, its count zero, is not taken.
|
|
41
41
|
* - A probe whose first update this is, or a DEAD one, takes nothing: its depth is not yet its own, or
|
|
42
42
|
* it is inside a solid.
|
|
@@ -1 +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":"
|
|
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":"AAwCA;;GAEG;AACH,sCAFU,YAAY,CAaM;AAsB5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,4CAFU,aAAa,CAmIpB;6BA5O0B,sCAAsC;8BAHrC,kCAAkC"}
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_resample.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { chunk_rgb_to_luminance } from "../../../shader/chunk/color/chunk_rgb_to_luminance.js";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
chunk_uv_octahedral_unit_decode
|
|
4
|
+
} from "../../../shader/chunk/geometry/octahedron/chunk_uv_octahedral_unit_decode.js";
|
|
5
|
+
import {
|
|
6
|
+
chunk_uv_octahedral_unit_encode
|
|
7
|
+
} from "../../../shader/chunk/geometry/octahedron/chunk_uv_octahedral_unit_encode.js";
|
|
4
8
|
import { chunk_folded_workgroup_index } from "../../../shader/chunk/grid/chunk_folded_workgroup_index.js";
|
|
5
9
|
import { chunk_pcg3d } from "../../../shader/chunk/random/pcg/chunk_pcg3d.js";
|
|
6
10
|
import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
|
|
@@ -26,8 +30,13 @@ import {
|
|
|
26
30
|
PROBE_INDIRECTION_READ_RESOURCE,
|
|
27
31
|
PROBE_SAMPLING_RESOURCE
|
|
28
32
|
} from "./chunk_probe_clipmap_pick.js";
|
|
33
|
+
import { chunk_probe_clipmap_resample } from "./chunk_probe_clipmap_resample.js";
|
|
29
34
|
import { chunk_probe_clipmap_sample_radiance } from "./chunk_probe_clipmap_sample_radiance.js";
|
|
30
|
-
import {
|
|
35
|
+
import {
|
|
36
|
+
PROBE_DEPTH_LIMIT,
|
|
37
|
+
PROBE_RESAMPLE_NEIGHBOURS,
|
|
38
|
+
PROBE_THREAD_WORKGROUP_SIZE
|
|
39
|
+
} from "./PROBE_CLIPMAP.js";
|
|
31
40
|
|
|
32
41
|
/**
|
|
33
42
|
* @type {WebGPUStruct}
|
|
@@ -41,7 +50,7 @@ export const PROBE_RESAMPLE_SETTINGS = WebGPUStruct.from({
|
|
|
41
50
|
depth_resolution: u32,
|
|
42
51
|
/** the frame, of the frames the clipmap has recorded */
|
|
43
52
|
frame: u32,
|
|
44
|
-
/**
|
|
53
|
+
/** τ, in frames: how fast a neighbour's history goes stale */
|
|
45
54
|
response_frames: f32,
|
|
46
55
|
}, "ProbeResampleSettings");
|
|
47
56
|
|
|
@@ -99,7 +108,7 @@ resources.createGroup()
|
|
|
99
108
|
* B's own samples of its texel. Both are absolute, each held to the estimator's own floor of 10⁻⁵, so a
|
|
100
109
|
* dark neighbour is not taken less for being dark;
|
|
101
110
|
* - its freshness, `e^(−age / τ)`: age the frames since the neighbour's last update, τ
|
|
102
|
-
* `response_frames`, the time over which a
|
|
111
|
+
* `response_frames`, the time over which a neighbour's history goes stale.
|
|
103
112
|
* - A neighbour's texel no ray has reached, its count zero, is not taken.
|
|
104
113
|
* - A probe whose first update this is, or a DEAD one, takes nothing: its depth is not yet its own, or
|
|
105
114
|
* it is inside a solid.
|
|
@@ -115,13 +124,6 @@ export const shader_probe_clipmap_resample = ComputeShader.from({
|
|
|
115
124
|
body: CodeChunk.from(
|
|
116
125
|
//language=WGSL
|
|
117
126
|
`
|
|
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
127
|
// the variance of a texel's samples, luminance, from its estimator's words: the deviation's r in the second word's
|
|
126
128
|
// high half, its g and b in the third; held to the estimator's own floor
|
|
127
129
|
fn probe_resample_variance(words: vec4<u32>) -> f32 {
|
|
@@ -215,10 +217,7 @@ fn main(
|
|
|
215
217
|
continue;
|
|
216
218
|
}
|
|
217
219
|
|
|
218
|
-
let
|
|
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);
|
|
220
|
+
let visibility = probe_resample_visibility(probe_clipmap_depth_moments(neighbour, toward), distance);
|
|
222
221
|
|
|
223
222
|
// the neighbour's texel the point is in: the variance of the mean read, its samples' over their count
|
|
224
223
|
let uv = min(vec2<u32>(uv_octahedral_unit_encode(toward) * f32(n)), vec2<u32>(n - 1u));
|
|
@@ -239,6 +238,7 @@ fn main(
|
|
|
239
238
|
}
|
|
240
239
|
`, [
|
|
241
240
|
chunk_probe_clipmap,
|
|
241
|
+
chunk_probe_clipmap_resample,
|
|
242
242
|
chunk_probe_clipmap_pick,
|
|
243
243
|
chunk_probe_clipmap_sample_radiance,
|
|
244
244
|
chunk_folded_workgroup_index,
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @type {WebGPUStruct}
|
|
3
|
+
*/
|
|
4
|
+
export const PROBE_RESAMPLE_RAYS_SETTINGS: WebGPUStruct;
|
|
5
|
+
/**
|
|
6
|
+
* Re-sample rays (Enshrouded's "share rays"): each listed probe B takes every ray its candidate A traced this
|
|
7
|
+
* frame (`shader_probe_clipmap_candidate`), each in the radiance texel of B's its hit is in, and traces nothing.
|
|
8
|
+
* Hits are diffuse only, so what a ray brings back is the same seen from B. A thread a radiance texel of each
|
|
9
|
+
* listed probe, through accumulate's launch, `PROBE_DISPATCH_TEXELS`; thread `i` of B takes A's rays
|
|
10
|
+
* `i, i + n_r², …`, so each is read once; the depth texels' threads do nothing. It adds each taken ray's radiance
|
|
11
|
+
* times its weight, and the weight, to B's texel's `probe_resamples` (`atomic_add_f32_storage`), over what the
|
|
12
|
+
* history re-sample pass wrote there, or over nothing, the buffer cleared. Accumulate pools them with the texel's
|
|
13
|
+
* own rays (`chunk_probe_clipmap_resampled`).
|
|
14
|
+
*
|
|
15
|
+
* - **A ray**: a front-face hit, or a miss. An unresolved ray and a back face are not taken.
|
|
16
|
+
* - A hit at `p`, from A's ray origin along its direction: B sees it along `p − o_B`, and only if the surface
|
|
17
|
+
* faces B, by the hit's normal.
|
|
18
|
+
* - A miss sees the sky along its own direction from anywhere, at the depth limit.
|
|
19
|
+
* - **Its weight**:
|
|
20
|
+
* - The weight A was drawn at, the draw's density divided out.
|
|
21
|
+
* - B's visibility of it, `probe_resample_visibility` over B's depth moments that way, its distance in B's
|
|
22
|
+
* spacings held to the depth limit, as the moments are: the hit at the distance B's own rays found there is
|
|
23
|
+
* taken, an occluder between or a gap past it weighs it down. A sky ray or a far hit is at the limit, taken where
|
|
24
|
+
* B's own rays went past it too.
|
|
25
|
+
* - Where A's update was guided, its rays' density: `(R_A / n_r²) / expected`, `expected` the rays A's guide gave
|
|
26
|
+
* the texel the ray left from (`probe_clipmap_guide_expected`), so that the brighter texels the guide favours
|
|
27
|
+
* are not over-represented in B's. A uniform update's rays weigh one.
|
|
28
|
+
*
|
|
29
|
+
* Reads the depth atlas as the last publish left it, and the frame's rays after light has added to them.
|
|
30
|
+
*
|
|
31
|
+
* @type {ComputeShader}
|
|
32
|
+
*/
|
|
33
|
+
export const shader_probe_clipmap_resample_rays: ComputeShader;
|
|
34
|
+
import { WebGPUStruct } from "../../../shader/type/WebGPUStruct.js";
|
|
35
|
+
import { ComputeShader } from "../../../shader/ComputeShader.js";
|
|
36
|
+
//# sourceMappingURL=shader_probe_clipmap_resample_rays.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shader_probe_clipmap_resample_rays.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_resample_rays.js"],"names":[],"mappings":"AA0CA;;GAEG;AACH,2CAFU,YAAY,CAaU;AAwBhC;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,iDAFU,aAAa,CA8HpB;6BA3N0B,sCAAsC;8BAHrC,kCAAkC"}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { chunk_atomic_add_f32_storage } from "../../../shader/chunk/atomic/chunk_atomic_add_f32_storage.js";
|
|
2
|
+
import { chunk_rgbe9995_decode } from "../../../shader/chunk/color/rgbe9995/chunk_rgbe9995_decode.js";
|
|
3
|
+
import {
|
|
4
|
+
chunk_uv_octahedral_unit_decode
|
|
5
|
+
} from "../../../shader/chunk/geometry/octahedron/chunk_uv_octahedral_unit_decode.js";
|
|
6
|
+
import {
|
|
7
|
+
chunk_uv_octahedral_unit_encode
|
|
8
|
+
} from "../../../shader/chunk/geometry/octahedron/chunk_uv_octahedral_unit_encode.js";
|
|
9
|
+
import { chunk_folded_workgroup_index } from "../../../shader/chunk/grid/chunk_folded_workgroup_index.js";
|
|
10
|
+
import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
|
|
11
|
+
import { ComputeShader } from "../../../shader/ComputeShader.js";
|
|
12
|
+
import { ShaderResourceSetDescriptor } from "../../../shader/resource/ShaderResourceSetDescriptor.js";
|
|
13
|
+
import { u32 } from "../../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
|
|
14
|
+
import { WebGPUStruct } from "../../../shader/type/WebGPUStruct.js";
|
|
15
|
+
import { BRICK_TRACE_HIT, BRICK_TRACE_MISS } from "../brick/BRICK_CLIPMAP.js";
|
|
16
|
+
import {
|
|
17
|
+
chunk_probe_clipmap,
|
|
18
|
+
chunk_probe_clipmap_guide,
|
|
19
|
+
chunk_probe_clipmap_guide_expected,
|
|
20
|
+
chunk_probe_clipmap_ray_layout,
|
|
21
|
+
chunk_probe_clipmap_ray_origin,
|
|
22
|
+
PROBE_CANDIDATES_READ_RESOURCE,
|
|
23
|
+
PROBE_DEPTH_HISTORY_RESOURCE,
|
|
24
|
+
PROBE_GUIDE_READ_RESOURCE,
|
|
25
|
+
PROBE_LEVELS_RESOURCE,
|
|
26
|
+
PROBE_ORIGINS_READ_RESOURCE,
|
|
27
|
+
PROBE_RAY_SUMS_READ_RESOURCE,
|
|
28
|
+
PROBE_RAYS_READ_RESOURCE,
|
|
29
|
+
PROBE_RECORDS_READ_RESOURCE,
|
|
30
|
+
PROBE_RESAMPLES_ADD_RESOURCE,
|
|
31
|
+
PROBE_STATES_READ_RESOURCE,
|
|
32
|
+
PROBE_TRACE_READ_RESOURCE
|
|
33
|
+
} from "./chunk_probe_clipmap.js";
|
|
34
|
+
import {
|
|
35
|
+
chunk_probe_clipmap_pick,
|
|
36
|
+
PROBE_DEPTH_SAMPLER_RESOURCE,
|
|
37
|
+
PROBE_INDIRECTION_READ_RESOURCE,
|
|
38
|
+
PROBE_SAMPLING_RESOURCE
|
|
39
|
+
} from "./chunk_probe_clipmap_pick.js";
|
|
40
|
+
import { chunk_probe_clipmap_resample } from "./chunk_probe_clipmap_resample.js";
|
|
41
|
+
import { PROBE_DEPTH_LIMIT, PROBE_THREAD_WORKGROUP_SIZE } from "./PROBE_CLIPMAP.js";
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @type {WebGPUStruct}
|
|
45
|
+
*/
|
|
46
|
+
export const PROBE_RESAMPLE_RAYS_SETTINGS = WebGPUStruct.from({
|
|
47
|
+
/** probes a frame updates at most: the trace list's bound */
|
|
48
|
+
trace_capacity: u32,
|
|
49
|
+
/** octahedral radiance texels a side, n_r */
|
|
50
|
+
radiance_resolution: u32,
|
|
51
|
+
/** octahedral depth texels a side, n_d: the texels' launch is accumulate's, n_r² + n_d² a probe */
|
|
52
|
+
depth_resolution: u32,
|
|
53
|
+
/** rays a uniform update casts, R, which decides whether an update is guided */
|
|
54
|
+
rays_per_probe: u32,
|
|
55
|
+
/** updates between a probe's uniform ones, `PROBE_UNIFORM_PERIOD` */
|
|
56
|
+
uniform_period: u32,
|
|
57
|
+
}, "ProbeResampleRaysSettings");
|
|
58
|
+
|
|
59
|
+
const resources = new ShaderResourceSetDescriptor();
|
|
60
|
+
|
|
61
|
+
resources.setImmediate("settings", PROBE_RESAMPLE_RAYS_SETTINGS);
|
|
62
|
+
|
|
63
|
+
resources.createGroup()
|
|
64
|
+
.add(PROBE_TRACE_READ_RESOURCE)
|
|
65
|
+
.add(PROBE_ORIGINS_READ_RESOURCE)
|
|
66
|
+
.add(PROBE_CANDIDATES_READ_RESOURCE)
|
|
67
|
+
.add(PROBE_RAYS_READ_RESOURCE)
|
|
68
|
+
.add(PROBE_RAY_SUMS_READ_RESOURCE)
|
|
69
|
+
.add(PROBE_GUIDE_READ_RESOURCE)
|
|
70
|
+
.add(PROBE_RESAMPLES_ADD_RESOURCE);
|
|
71
|
+
|
|
72
|
+
resources.createGroup()
|
|
73
|
+
.add(PROBE_LEVELS_RESOURCE)
|
|
74
|
+
.add(PROBE_SAMPLING_RESOURCE)
|
|
75
|
+
.add(PROBE_INDIRECTION_READ_RESOURCE)
|
|
76
|
+
.add(PROBE_STATES_READ_RESOURCE)
|
|
77
|
+
.add(PROBE_RECORDS_READ_RESOURCE)
|
|
78
|
+
.add(PROBE_DEPTH_HISTORY_RESOURCE)
|
|
79
|
+
.add(PROBE_DEPTH_SAMPLER_RESOURCE);
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Re-sample rays (Enshrouded's "share rays"): each listed probe B takes every ray its candidate A traced this
|
|
83
|
+
* frame (`shader_probe_clipmap_candidate`), each in the radiance texel of B's its hit is in, and traces nothing.
|
|
84
|
+
* Hits are diffuse only, so what a ray brings back is the same seen from B. A thread a radiance texel of each
|
|
85
|
+
* listed probe, through accumulate's launch, `PROBE_DISPATCH_TEXELS`; thread `i` of B takes A's rays
|
|
86
|
+
* `i, i + n_r², …`, so each is read once; the depth texels' threads do nothing. It adds each taken ray's radiance
|
|
87
|
+
* times its weight, and the weight, to B's texel's `probe_resamples` (`atomic_add_f32_storage`), over what the
|
|
88
|
+
* history re-sample pass wrote there, or over nothing, the buffer cleared. Accumulate pools them with the texel's
|
|
89
|
+
* own rays (`chunk_probe_clipmap_resampled`).
|
|
90
|
+
*
|
|
91
|
+
* - **A ray**: a front-face hit, or a miss. An unresolved ray and a back face are not taken.
|
|
92
|
+
* - A hit at `p`, from A's ray origin along its direction: B sees it along `p − o_B`, and only if the surface
|
|
93
|
+
* faces B, by the hit's normal.
|
|
94
|
+
* - A miss sees the sky along its own direction from anywhere, at the depth limit.
|
|
95
|
+
* - **Its weight**:
|
|
96
|
+
* - The weight A was drawn at, the draw's density divided out.
|
|
97
|
+
* - B's visibility of it, `probe_resample_visibility` over B's depth moments that way, its distance in B's
|
|
98
|
+
* spacings held to the depth limit, as the moments are: the hit at the distance B's own rays found there is
|
|
99
|
+
* taken, an occluder between or a gap past it weighs it down. A sky ray or a far hit is at the limit, taken where
|
|
100
|
+
* B's own rays went past it too.
|
|
101
|
+
* - Where A's update was guided, its rays' density: `(R_A / n_r²) / expected`, `expected` the rays A's guide gave
|
|
102
|
+
* the texel the ray left from (`probe_clipmap_guide_expected`), so that the brighter texels the guide favours
|
|
103
|
+
* are not over-represented in B's. A uniform update's rays weigh one.
|
|
104
|
+
*
|
|
105
|
+
* Reads the depth atlas as the last publish left it, and the frame's rays after light has added to them.
|
|
106
|
+
*
|
|
107
|
+
* @type {ComputeShader}
|
|
108
|
+
*/
|
|
109
|
+
export const shader_probe_clipmap_resample_rays = ComputeShader.from({
|
|
110
|
+
label: "Probe Clipmap Resample Rays",
|
|
111
|
+
resources,
|
|
112
|
+
body: CodeChunk.from(
|
|
113
|
+
//language=WGSL
|
|
114
|
+
`
|
|
115
|
+
@compute @workgroup_size(${PROBE_THREAD_WORKGROUP_SIZE})
|
|
116
|
+
fn main(
|
|
117
|
+
@builtin(workgroup_id) workgroup_id: vec3<u32>,
|
|
118
|
+
@builtin(local_invocation_index) lane: u32,
|
|
119
|
+
) {
|
|
120
|
+
let thread = folded_workgroup_index(workgroup_id) * PROBE_THREAD_WORKGROUP_SIZE + lane;
|
|
121
|
+
|
|
122
|
+
let n = settings.radiance_resolution;
|
|
123
|
+
let texels = n * n;
|
|
124
|
+
let per_probe = texels + settings.depth_resolution * settings.depth_resolution;
|
|
125
|
+
|
|
126
|
+
if (thread >= min(probe_trace.count, settings.trace_capacity) * per_probe) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
let k = thread / per_probe;
|
|
131
|
+
let i = thread % per_probe;
|
|
132
|
+
|
|
133
|
+
if (i >= texels) {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
let drawn = probe_candidates[k];
|
|
138
|
+
let candidate = drawn.listed;
|
|
139
|
+
|
|
140
|
+
if (candidate == PROBE_CLIPMAP_NONE) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
let slot = probe_trace.elements[k];
|
|
145
|
+
let origin = probe_origins[k];
|
|
146
|
+
let spacing = origin.w;
|
|
147
|
+
|
|
148
|
+
let source = probe_trace.elements[candidate];
|
|
149
|
+
let source_origin = probe_origins[candidate];
|
|
150
|
+
let span = probe_clipmap_probe_rays(candidate);
|
|
151
|
+
let guided = probe_clipmap_guided(probe_states[source].x, settings.uniform_period, settings.rays_per_probe, texels);
|
|
152
|
+
let base = candidate * probe_clipmap_guide_words(n);
|
|
153
|
+
|
|
154
|
+
// every ray of the candidate once, n_r² threads apart
|
|
155
|
+
let rounds = (span.y + texels - 1u) / texels;
|
|
156
|
+
|
|
157
|
+
for (var round = 0u; round < rounds; round++) {
|
|
158
|
+
let r = i + round * texels;
|
|
159
|
+
|
|
160
|
+
if (r >= span.y) {
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
let ray = probe_rays[span.x + r];
|
|
165
|
+
let kind = ray.flags & PROBE_RAY_KIND_MASK;
|
|
166
|
+
|
|
167
|
+
if ((kind != ${BRICK_TRACE_HIT}u && kind != ${BRICK_TRACE_MISS}u) || (ray.flags & PROBE_RAY_BACK_FACE) != 0u) {
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
let direction = uv_octahedral_unit_decode(unpack2x16unorm(ray.direction));
|
|
172
|
+
|
|
173
|
+
var seen = direction;
|
|
174
|
+
var distance = ${PROBE_DEPTH_LIMIT};
|
|
175
|
+
|
|
176
|
+
if (kind == ${BRICK_TRACE_HIT}u) {
|
|
177
|
+
let hit = probe_clipmap_ray_origin(source_origin, source, ray.direction) + ray.t * direction;
|
|
178
|
+
let to_hit = hit - origin.xyz;
|
|
179
|
+
let length_to_hit = length(to_hit);
|
|
180
|
+
let normal = uv_octahedral_unit_decode(unpack2x16unorm(ray.normal));
|
|
181
|
+
|
|
182
|
+
// B sees the surface's back, or stands on it
|
|
183
|
+
if (dot(normal, to_hit) >= 0.0 || length_to_hit <= 0.0) {
|
|
184
|
+
continue;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
seen = to_hit / length_to_hit;
|
|
188
|
+
distance = min(length_to_hit / spacing, ${PROBE_DEPTH_LIMIT});
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
var weight = drawn.weight * probe_resample_visibility(probe_clipmap_depth_moments(slot, seen), distance);
|
|
192
|
+
|
|
193
|
+
if (guided) {
|
|
194
|
+
// the texel of A's the ray left from: its jitter keeps it inside
|
|
195
|
+
let left = min(vec2<u32>(uv_octahedral_unit_encode(direction) * f32(n)), vec2<u32>(n - 1u));
|
|
196
|
+
let expected = probe_clipmap_guide_expected(base, left.y * n + left.x, span.y, n);
|
|
197
|
+
|
|
198
|
+
if (expected <= 0.0) {
|
|
199
|
+
continue;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
weight *= f32(span.y) / (f32(texels) * expected);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
if (weight <= 0.0) {
|
|
206
|
+
continue;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
let at = min(vec2<u32>(uv_octahedral_unit_encode(seen) * f32(n)), vec2<u32>(n - 1u));
|
|
210
|
+
let cell = 4u * (k * texels + at.y * n + at.x);
|
|
211
|
+
let radiance = rgbe9995_decode(ray.light) * weight;
|
|
212
|
+
|
|
213
|
+
atomic_add_f32_storage(&probe_resamples[cell], radiance.r);
|
|
214
|
+
atomic_add_f32_storage(&probe_resamples[cell + 1u], radiance.g);
|
|
215
|
+
atomic_add_f32_storage(&probe_resamples[cell + 2u], radiance.b);
|
|
216
|
+
atomic_add_f32_storage(&probe_resamples[cell + 3u], weight);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
`, [
|
|
220
|
+
chunk_probe_clipmap,
|
|
221
|
+
chunk_probe_clipmap_ray_layout,
|
|
222
|
+
chunk_probe_clipmap_ray_origin,
|
|
223
|
+
chunk_probe_clipmap_guide,
|
|
224
|
+
chunk_probe_clipmap_guide_expected,
|
|
225
|
+
chunk_probe_clipmap_pick,
|
|
226
|
+
chunk_probe_clipmap_resample,
|
|
227
|
+
chunk_folded_workgroup_index,
|
|
228
|
+
chunk_uv_octahedral_unit_decode,
|
|
229
|
+
chunk_uv_octahedral_unit_encode,
|
|
230
|
+
chunk_rgbe9995_decode,
|
|
231
|
+
chunk_atomic_add_f32_storage,
|
|
232
|
+
]),
|
|
233
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader_probe_clipmap_schedule.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_schedule.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shader_probe_clipmap_schedule.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_schedule.js"],"names":[],"mappings":"AAgBA;;GAEG;AACH,sCAFU,YAAY,CAWM;AAa5B;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,4CAFU,aAAa,CA8DpB;6BAzH0B,sCAAsC;8BAHrC,kCAAkC"}
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_schedule.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { chunk_folded_dispatch } from "../../../gpu_primitive/indirect/chunk_folded_dispatch.js";
|
|
2
|
+
import { chunk_divide_round_up_u32 } from "../../../shader/chunk/math/chunk_divide_round_up_u32.js";
|
|
2
3
|
import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
|
|
3
4
|
import { ComputeShader } from "../../../shader/ComputeShader.js";
|
|
4
5
|
import { ShaderResourceSetDescriptor } from "../../../shader/resource/ShaderResourceSetDescriptor.js";
|
|
@@ -19,8 +20,8 @@ import {
|
|
|
19
20
|
export const PROBE_SCHEDULE_SETTINGS = WebGPUStruct.from({
|
|
20
21
|
/** slots, which no active list outgrows */
|
|
21
22
|
capacity: u32,
|
|
22
|
-
/**
|
|
23
|
-
|
|
23
|
+
/** what the wanted list holds at most: every key, or fewer where the wants cannot want more */
|
|
24
|
+
wanted_capacity: u32,
|
|
24
25
|
/** probes a frame updates at most, U = ⌊ray_budget / rays_per_probe⌋ */
|
|
25
26
|
trace_capacity: u32,
|
|
26
27
|
/** slots kept free beyond the frame's wanted points, ⌈capacity · PROBE_FREE_SLACK⌉ */
|
|
@@ -76,10 +77,10 @@ fn main() {
|
|
|
76
77
|
let traced = max(settings.trace_capacity, 1u);
|
|
77
78
|
|
|
78
79
|
atomicStore(&probe_counters[PROBE_COUNTER_WAITING], 0u);
|
|
79
|
-
atomicStore(&probe_counters[PROBE_COUNTER_PERIOD], max((waiting
|
|
80
|
+
atomicStore(&probe_counters[PROBE_COUNTER_PERIOD], max(divide_round_up_u32(waiting, traced), 1u));
|
|
80
81
|
|
|
81
82
|
// the slots short of the frame's wanted points and the slack
|
|
82
|
-
let wanted = min(probe_wanted.count, settings.
|
|
83
|
+
let wanted = min(probe_wanted.count, settings.wanted_capacity);
|
|
83
84
|
let room = wanted + settings.slack;
|
|
84
85
|
let free = atomicLoad(&probe_counters[PROBE_COUNTER_FREE]);
|
|
85
86
|
|
|
@@ -113,7 +114,7 @@ fn main() {
|
|
|
113
114
|
atomicStore(&probe_counters[PROBE_COUNTER_EVICTED], 0u);
|
|
114
115
|
|
|
115
116
|
let live = min(probe_active_write.count, settings.capacity);
|
|
116
|
-
let folded = folded_dispatch((live
|
|
117
|
+
let folded = folded_dispatch(divide_round_up_u32(live, PROBE_THREAD_WORKGROUP_SIZE));
|
|
117
118
|
|
|
118
119
|
probe_dispatch[PROBE_DISPATCH_ACTIVE] = folded.x;
|
|
119
120
|
probe_dispatch[PROBE_DISPATCH_ACTIVE + 1u] = folded.y;
|
|
@@ -121,6 +122,7 @@ fn main() {
|
|
|
121
122
|
}
|
|
122
123
|
`, [
|
|
123
124
|
chunk_probe_clipmap,
|
|
125
|
+
chunk_divide_round_up_u32,
|
|
124
126
|
chunk_folded_dispatch,
|
|
125
127
|
]),
|
|
126
128
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader_probe_clipmap_shade.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shader_probe_clipmap_shade.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.js"],"names":[],"mappings":"AAuDA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,yCAFU,aAAa,CAyDpB;8BAlH2B,kCAAkC"}
|