@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GPUVirtualGeometryRuntime.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GPUVirtualGeometryRuntime.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.js"],"names":[],"mappings":"AAmCA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH;IAmHI;;;;;;;;;;;;;;;OAeG;IACH;QAd2C,IAAI,EAApC,sBAAsB;QACL,aAAa,GAA9B,MAAM;QACW,qBAAqB,GAAtC,MAAM;QAEW,mBAAmB,GAApC,MAAM;QAEW,cAAc,GAA/B,MAAM;QACW,cAAc,GAA/B,MAAM;QAEW,qBAAqB,GAAtC,MAAM;QACW,aAAa,GAA9B,MAAM;OAgFhB;IA3KD;;;;OAIG;IACH,KAFU,MAAM,CAER;IAER;;OAEG;IACH,cAFU,OAAO,CAEG;IAmKpB;;OAEG;IACH,yEAEC;IAED;;;;OAIG;IACH,4BAEC;IAED;;OAEG;IACH,6BAEC;IAED;;OAEG;IACH,kCAEC;IAED;;;;;OAKG;IACH,6BAEC;IAED;;;;OAIG;IACH,gCAEC;IAWD;;;;;;OAMG;IACH,iCAKC;IArBD;;;;OAIG;IACH,4BAEC;IAgBD;;;;OAIG;IACH,0BAEC;IAED;;;;OAIG;IACH,yDAEC;IAED;;;;;OAKG;IACH,2BAEC;IAED;;OAEG;IACH;;;;;;;;MAEC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH;QAHgC,IAAI,EAAzB,WAAW;QACT,IAAI,CAqChB;IAwBD;;;;;;;;;;OAUG;IACH,cAHW,oBAAoB,GAClB,MAAM,CA0BlB;IAED;;;;;;OAMG;IACH,mBAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;;;;;;OAQG;IACH,oCAHW,MAAM,OAkBhB;IAED;;;;;OAKG;IACH,eAFa,oBAAoB,EAAE,EAAE,CAIpC;IAED;;;;;;;;;OASG;IACH,mBAHW,UAAU,GACR,MAAM,CAkClB;IAED;;;;;;;;;;;;OAYG;IACH,wBAJW,UAAU,UACV,MAAM,GACJ,IAAI,CAOhB;IAED;;;;;;;;;;;;;;;;OAgBG;IACH;QAJ2B,iBAAiB,EAAjC,MAAM;QACU,gBAAgB,EAAhC,MAAM;QACJ,IAAI,CAgBhB;IAED;;OAEG;IACH,gCAEC;IAED;;OAEG;IACH,+BAEC;IAED;;;;;OAKG;IACH,aAFa,IAAI,CAKhB;IAED;;;;;;;;OAQG;IACH,WAFa,IAAI,CAOhB;;CACJ;qCA/pBY,OAAO,6BAA6B,EAAE,sBAAsB;0BAC5D,OAAO,kBAAkB,EAAE,WAAW;yBACtC,OAAO,iEAAiE,EAAE,UAAU;;;;;;;;;;0BAQ1E,WAAW,QAAE,MAAM,QAAE,OAAO,QAAE,yBAAyB,KAAG,IAAI"}
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
vgeo_feedback_slot_want_count,
|
|
7
7
|
vgeo_feedback_slot_wants
|
|
8
8
|
} from "./cut/vgeo_cut_feedback_layout.js";
|
|
9
|
+
import { ceilPowerOfTwo } from "../../../../../core/binary/operations/ceilPowerOfTwo.js";
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* @typedef {import("./GPUVirtualGeometryPool.js").GPUVirtualGeometryPool} GPUVirtualGeometryPool
|
|
@@ -449,7 +450,7 @@ export class GPUVirtualGeometryRuntime {
|
|
|
449
450
|
existing?.destroy();
|
|
450
451
|
|
|
451
452
|
// to the next power of two, so a tier filling a page row at a time re-makes it rarely
|
|
452
|
-
const size = Math.max(256,
|
|
453
|
+
const size = Math.max(256, ceilPowerOfTwo(bytes));
|
|
453
454
|
|
|
454
455
|
this.#feedback_buffer = this.#pool.device.createBuffer({
|
|
455
456
|
label: 'vgeo feedback',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VGeoResidency.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/geometry/virtual/runtime/VGeoResidency.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VGeoResidency.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/geometry/virtual/runtime/VGeoResidency.js"],"names":[],"mappings":"AA6GA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH;IAiKI;;;;;;;OAOG;IACH;QAN2C,IAAI,EAApC,sBAAsB;QACS,OAAO,GAAtC,oBAAoB;QACM,IAAI,GAA9B,eAAe;QACW,OAAO,GAAjC,eAAe;OA8BzB;IAID;;OAEG;IACH,oCAEC;IAED;;OAEG;IACH,4BAEC;IAED;;OAEG;IACH,+BAEC;IAED;;OAEG;IACH,yEAEC;IAED;;;;OAIG;IACH,oBAEC;IAED;;;;OAIG;IACH,gCAGC;IAED,+BAEC;IAED,iCAEC;IAED,6BAEC;IAED,2BAEC;IAED,iCAEC;IAED,gCAEC;IAED;;;;OAIG;IACH,oCAEC;IAED;;;OAGG;IACH,kCAEC;IAED;;;OAGG;IACH,kCAEC;IAED;;;OAGG;IACH,iCAEC;IAED;;;OAGG;IACH,iCAEC;IAED;;;OAGG;IACH,gCAEC;IAED;;;;;OAKG;IACH,gCAEC;IAED;;;OAGG;IACH,iCAEC;IAED,gCAEC;IAED,+BAEC;IAED,8BAEC;IAED;;OAEG;IACH,qCAQC;IAID;;;;;;;;;;OAUG;IACH,iBAHW,mBAAmB,GACjB,MAAM,CA8ClB;IAED;;;;;;OAMG;IACH,mBAHW,mBAAmB,GACjB,OAAO,CAgBnB;IAED;;;OAGG;IACH,sBAHW,mBAAmB,GACjB,OAAO,CAInB;IAED;;;;;;OAMG;IACH,cAJW,mBAAmB,cACnB,MAAM,GACJ,QAAQ,GAAC,UAAU,GAAC,aAAa,GAAC,KAAK,GAAC,MAAM,GAAC,cAAc,CAqBzE;IA6CD;;;;;;;;OAQG;IACH,SAFa,IAAI,CAOhB;IAED;;;;OAIG;IACH,WAFa,IAAI,CAUhB;IAED;;;;OAIG;IACH,qBAFa,MAAM,CAkBlB;IAID;;;;;;;;;OASG;IACH,aANW,WAAW,UACX;QAAC,eAAe,EAAE,MAAM,CAAC;QAAC,gBAAgB,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAChF,UAAgB,EAAE,MAAM,CAAA;KAAC,iBACf,MAAM,GACJ,IAAI,CA6HhB;IAyGD;;;;;;OAMG;IACH,yBAHW,MAAM,GACJ,OAAO,CAgBnB;IAED;;;;;;OAMG;IACH,oBAHW,MAAM,GACJ,OAAO,CAoCnB;;CAgYJ;kCA/3CY,OAAO,uCAAuC,EAAE,mBAAmB;uBACnE,OAAO,4BAA4B,EAAE,QAAQ;qCAC7C,OAAO,6BAA6B,EAAE,sBAAsB;qCANpC,2BAA2B;gCANhC,gDAAgD;gCAKhD,sBAAsB"}
|
|
@@ -6,6 +6,7 @@ import { VGEO_PAGE_ROW_OFFSET } from "./layout/VGEO_PAGE_ROW_OFFSET.js";
|
|
|
6
6
|
import { VGEO_WANT_WORDS } from "./layout/VGEO_WANT_WORDS.js";
|
|
7
7
|
import { VGeoPageFetcher } from "./VGeoPageFetcher.js";
|
|
8
8
|
import { VGeoResidencyOptions } from "./VGeoResidencyOptions.js";
|
|
9
|
+
import { ctz32 } from "../../../../../core/binary/ctz32.js";
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* @typedef {import("../format/read/VGeoContainerReader.js").VGeoContainerReader} VGeoContainerReader
|
|
@@ -889,7 +890,7 @@ export class VGeoResidency {
|
|
|
889
890
|
let bits = words[layout.touch_bits_base + word];
|
|
890
891
|
|
|
891
892
|
while (bits !== 0) {
|
|
892
|
-
const bit =
|
|
893
|
+
const bit = ctz32(bits);
|
|
893
894
|
|
|
894
895
|
bits &= bits - 1;
|
|
895
896
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_brick4_sh3_color_decode_from_storage.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/shade/renderer/global_illumination/brick4/gpu/encoding/v1/chunk_brick4_sh3_color_decode_from_storage.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chunk_brick4_sh3_color_decode_from_storage.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/shade/renderer/global_illumination/brick4/gpu/encoding/v1/chunk_brick4_sh3_color_decode_from_storage.js"],"names":[],"mappings":"AAwBA,mEAiBE;0BAzCwB,6CAA6C"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CodeChunk } from "../../../../../shader/compiler/CodeChunk.js";
|
|
2
|
+
import { chunk_brick4_sh3_color_decode } from "./chunk_brick4_sh3_color_decode.js";
|
|
2
3
|
|
|
3
4
|
/*
|
|
4
5
|
* The v1 brick4 SH3 probe encoding: nine RGB coefficients as fourteen f16 pairs.
|
|
@@ -28,36 +29,14 @@ fn brick4_sh3_color_decode_from_storage_v1(
|
|
|
28
29
|
storage_buf: ptr<storage, array<u32>>,
|
|
29
30
|
offset: u32
|
|
30
31
|
) -> array<vec3<f32>, 9> {
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
let v2 = unpack2x16float((*storage_buf)[offset + 2u]);
|
|
37
|
-
let v3 = unpack2x16float((*storage_buf)[offset + 3u]);
|
|
38
|
-
let v4 = unpack2x16float((*storage_buf)[offset + 4u]);
|
|
39
|
-
let v5 = unpack2x16float((*storage_buf)[offset + 5u]);
|
|
40
|
-
let v6 = unpack2x16float((*storage_buf)[offset + 6u]);
|
|
41
|
-
let v7 = unpack2x16float((*storage_buf)[offset + 7u]);
|
|
42
|
-
let v8 = unpack2x16float((*storage_buf)[offset + 8u]);
|
|
43
|
-
let v9 = unpack2x16float((*storage_buf)[offset + 9u]);
|
|
44
|
-
let v10 = unpack2x16float((*storage_buf)[offset + 10u]);
|
|
45
|
-
let v11 = unpack2x16float((*storage_buf)[offset + 11u]);
|
|
46
|
-
let v12 = unpack2x16float((*storage_buf)[offset + 12u]);
|
|
47
|
-
let v13 = unpack2x16float((*storage_buf)[offset + 13u]);
|
|
48
|
-
|
|
49
|
-
// Reconstruct the vec3s by bridging the u32 boundaries
|
|
50
|
-
sh[0] = vec3<f32>(v0.x, v0.y, v1.x);
|
|
51
|
-
sh[1] = vec3<f32>(v1.y, v2.x, v2.y);
|
|
52
|
-
sh[2] = vec3<f32>(v3.x, v3.y, v4.x);
|
|
53
|
-
sh[3] = vec3<f32>(v4.y, v5.x, v5.y);
|
|
54
|
-
sh[4] = vec3<f32>(v6.x, v6.y, v7.x);
|
|
55
|
-
sh[5] = vec3<f32>(v7.y, v8.x, v8.y);
|
|
56
|
-
sh[6] = vec3<f32>(v9.x, v9.y, v10.x);
|
|
57
|
-
sh[7] = vec3<f32>(v10.y, v11.x, v11.y);
|
|
58
|
-
sh[8] = vec3<f32>(v12.x, v12.y, v13.x);
|
|
59
|
-
|
|
60
|
-
return sh;
|
|
32
|
+
var packed: array<u32, 14>;
|
|
33
|
+
for (var i = 0u; i < 14u; i++) {
|
|
34
|
+
packed[i] = (*storage_buf)[offset + i];
|
|
35
|
+
}
|
|
36
|
+
return brick4_sh3_color_decode_v1(packed);
|
|
61
37
|
}
|
|
62
|
-
|
|
38
|
+
`,
|
|
39
|
+
[
|
|
40
|
+
chunk_brick4_sh3_color_decode,
|
|
41
|
+
]
|
|
63
42
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_brick4_sh3_color_encode_to_storage.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/shade/renderer/global_illumination/brick4/gpu/encoding/v1/chunk_brick4_sh3_color_encode_to_storage.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chunk_brick4_sh3_color_encode_to_storage.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/shade/renderer/global_illumination/brick4/gpu/encoding/v1/chunk_brick4_sh3_color_encode_to_storage.js"],"names":[],"mappings":"AAwBA,iEAiBC;0BAzCyB,6CAA6C"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CodeChunk } from "../../../../../shader/compiler/CodeChunk.js";
|
|
2
|
+
import { chunk_brick4_sh3_color_encode } from "./chunk_brick4_sh3_color_encode.js";
|
|
2
3
|
|
|
3
4
|
/*
|
|
4
5
|
* The v1 brick4 SH3 probe encoding: nine RGB coefficients as fourteen f16 pairs.
|
|
@@ -29,20 +30,13 @@ fn brick4_sh3_color_encode_to_storage_v1(
|
|
|
29
30
|
out_offset: u32,
|
|
30
31
|
sh: array<vec3<f32>,9>
|
|
31
32
|
){
|
|
32
|
-
|
|
33
|
-
(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
(*out)[out_offset + 4u] = pack2x16float(vec2<f32>(sh[2].z, sh[3].x));
|
|
37
|
-
(*out)[out_offset + 5u] = pack2x16float(vec2<f32>(sh[3].y, sh[3].z));
|
|
38
|
-
(*out)[out_offset + 6u] = pack2x16float(vec2<f32>(sh[4].x, sh[4].y));
|
|
39
|
-
(*out)[out_offset + 7u] = pack2x16float(vec2<f32>(sh[4].z, sh[5].x));
|
|
40
|
-
(*out)[out_offset + 8u] = pack2x16float(vec2<f32>(sh[5].y, sh[5].z));
|
|
41
|
-
(*out)[out_offset + 9u] = pack2x16float(vec2<f32>(sh[6].x, sh[6].y));
|
|
42
|
-
(*out)[out_offset + 10u] = pack2x16float(vec2<f32>(sh[6].z, sh[7].x));
|
|
43
|
-
(*out)[out_offset + 11u] = pack2x16float(vec2<f32>(sh[7].y, sh[7].z));
|
|
44
|
-
(*out)[out_offset + 12u] = pack2x16float(vec2<f32>(sh[8].x, sh[8].y));
|
|
45
|
-
(*out)[out_offset + 13u] = pack2x16float(vec2<f32>(sh[8].z, 0.0));
|
|
33
|
+
let packed = brick4_sh3_color_encode_v1(sh);
|
|
34
|
+
for (var i = 0u; i < 14u; i++) {
|
|
35
|
+
(*out)[out_offset + i] = packed[i];
|
|
36
|
+
}
|
|
46
37
|
}
|
|
47
|
-
|
|
38
|
+
`,
|
|
39
|
+
[
|
|
40
|
+
chunk_brick4_sh3_color_encode,
|
|
41
|
+
]
|
|
48
42
|
)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* How the overlay draws a clipmap: how many of its levels are in use, and the width of their edge
|
|
3
|
+
* bands. The levels themselves, finest first, are the uniform `clipmap_levels`, a {@link CLIPMAP_LEVEL_ARRAY}.
|
|
3
4
|
* @type {WebGPUStruct}
|
|
4
5
|
*/
|
|
5
6
|
export const CLIPMAP_DEBUG_STRUCT: WebGPUStruct;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader_debug_clipmap.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/global_illumination/clipmap/shader_debug_clipmap.js"],"names":[],"mappings":"AAaA
|
|
1
|
+
{"version":3,"file":"shader_debug_clipmap.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/global_illumination/clipmap/shader_debug_clipmap.js"],"names":[],"mappings":"AAaA;;;;GAIG;AACH,mCAFU,YAAY,CAWH;AA8DnB;;;;;;;;GAQG;AACH,mCAFU,WAAW,CAWnB;6BAhG2B,mCAAmC;4BAJpC,6BAA6B"}
|
|
@@ -12,25 +12,26 @@ import { f32, u32 } from "../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
|
|
|
12
12
|
import { WebGPUStruct } from "../../shader/type/WebGPUStruct.js";
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* How the overlay draws a clipmap: how many of its levels are in use, and the width of their edge
|
|
16
|
+
* bands. The levels themselves, finest first, are the uniform `clipmap_levels`, a {@link CLIPMAP_LEVEL_ARRAY}.
|
|
16
17
|
* @type {WebGPUStruct}
|
|
17
18
|
*/
|
|
18
19
|
export const CLIPMAP_DEBUG_STRUCT = WebGPUStruct.from({
|
|
19
20
|
/**
|
|
20
|
-
* Levels of
|
|
21
|
+
* Levels of `clipmap_levels` in use.
|
|
21
22
|
*/
|
|
22
23
|
level_count: u32,
|
|
23
24
|
/**
|
|
24
25
|
* Cells, positive: how far into a window its edge band reaches.
|
|
25
26
|
*/
|
|
26
27
|
band_width: f32,
|
|
27
|
-
levels: CLIPMAP_LEVEL_ARRAY,
|
|
28
28
|
}, "ClipmapDebug");
|
|
29
29
|
|
|
30
30
|
const resources = new ShaderResourceSetDescriptor();
|
|
31
31
|
resources.createGroup()
|
|
32
32
|
.addTexture("tDepth")
|
|
33
33
|
.addUniform("clipmap", CLIPMAP_DEBUG_STRUCT)
|
|
34
|
+
.addUniform("clipmap_levels", CLIPMAP_LEVEL_ARRAY)
|
|
34
35
|
.addUniform("camera", CAMERA_UNIFORM_STRUCT)
|
|
35
36
|
;
|
|
36
37
|
|
|
@@ -55,7 +56,7 @@ fn main(
|
|
|
55
56
|
|
|
56
57
|
let position_ws = project_position_from_depth(uv, device_depth, camera.view_projection_matrix_inverse);
|
|
57
58
|
|
|
58
|
-
let selection = clipmap_select_finest(&
|
|
59
|
+
let selection = clipmap_select_finest(&clipmap_levels, clipmap.level_count, position_ws, clipmap.band_width);
|
|
59
60
|
|
|
60
61
|
if(selection.level == CLIPMAP_LEVEL_NONE){
|
|
61
62
|
discard;
|
|
@@ -69,7 +70,7 @@ fn main(
|
|
|
69
70
|
var color = mix(own_color, next_color, selection.edge_weight);
|
|
70
71
|
|
|
71
72
|
// lines on the level's cell faces, two centimetres wide in the world
|
|
72
|
-
let cell_size =
|
|
73
|
+
let cell_size = clipmap_levels[selection.level].cell_size;
|
|
73
74
|
let position_cells = position_ws / cell_size;
|
|
74
75
|
let to_face = min(fract(position_cells), 1.0 - fract(position_cells));
|
|
75
76
|
let nearest_face = min(to_face.x, min(to_face.y, to_face.z));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph_reduce_atlas_to_sh.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_reduce_atlas_to_sh.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"graph_reduce_atlas_to_sh.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_reduce_atlas_to_sh.js"],"names":[],"mappings":"AAiHA;;;;;;;;;;GAUG;AACH;IAR+B,KAAK;IACF,KAAK;IACH,KAAK;IACd,kBAAkB,EAAlC,MAAM;IACU,kBAAkB,EAAlC,MAAM;IACY,mBAAmB,EAArC,MAAM,EAAE;IACQ,SAAS,EAAzB,MAAM;WAwDhB;AA7ID,sCAaM;0BAzCoB,0CAA0C"}
|
package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_reduce_atlas_to_sh.js
CHANGED
|
@@ -13,6 +13,7 @@ import { graph_compute_pass } from "../../../../shader/graph/compute/graph_compu
|
|
|
13
13
|
import { ShaderResourceSetDescriptor } from "../../../../shader/resource/ShaderResourceSetDescriptor.js";
|
|
14
14
|
import { chunk_lpv_atlas_read_patch_texel } from "../sample/chunk_lpv_atlas_read_patch_texel.js";
|
|
15
15
|
import { chunk_compute_coefficient_address } from "./chunk_compute_coefficient_address.js";
|
|
16
|
+
import { msb_32 } from "../../../../../../core/binary/msb_32.js";
|
|
16
17
|
|
|
17
18
|
const PUSH_CONSTANTS = WebGPUStruct.from({
|
|
18
19
|
probe_index_offset: u32,
|
|
@@ -145,7 +146,7 @@ export function graph_reduce_atlas_to_sh({
|
|
|
145
146
|
const probes_per_row = g_buffer_resolution[0] / probe_resolution;
|
|
146
147
|
|
|
147
148
|
// now convolve
|
|
148
|
-
const mip_limit =
|
|
149
|
+
const mip_limit = msb_32(probe_resolution);
|
|
149
150
|
|
|
150
151
|
let coefficients = sh_buffer;
|
|
151
152
|
|
|
@@ -7,8 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
/**
|
|
9
9
|
* {@link ShadeIndirectLightingMode.ProbeClipmap} for one view (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §5):
|
|
10
|
-
* a {@link GPUBrickClipmap}, the world as rays see it, and
|
|
11
|
-
*
|
|
10
|
+
* a {@link GPUBrickClipmap}, the world as rays see it, and two {@link GPUProbeClipmap}s around the view
|
|
11
|
+
* (WORLD_PROBE_CACHE_SCOPE_2026_11_01.md): the frustum's probes, which the frame's pixels want and shading
|
|
12
|
+
* samples, and the world cache, which the frustum's hits want where the frustum has no probe and which only
|
|
13
|
+
* the probes' hits sample, in the frustum's windows at 2^k its lattice.
|
|
12
14
|
*
|
|
13
15
|
* The renderer holds one for its main view, as it holds the view's volumetrics, and hands it the view
|
|
14
16
|
* and the settings on every frame the mode runs ({@link graph_update}). The clipmaps are made on the
|
|
@@ -26,6 +28,12 @@
|
|
|
26
28
|
* Until its probes are traced (§13, S4) the mode lights as IBL.
|
|
27
29
|
*/
|
|
28
30
|
export class GPUProbeClipmapGI {
|
|
31
|
+
/**
|
|
32
|
+
* @param {GPUProbeClipmap} world_cache
|
|
33
|
+
* @param {ProbeClipmapSettings} settings
|
|
34
|
+
* @returns {boolean} whether it is what the settings' world cache describes, in their frustum's windows
|
|
35
|
+
*/
|
|
36
|
+
static "__#206@#world_cache_built_for"(world_cache: GPUProbeClipmap, settings: ProbeClipmapSettings): boolean;
|
|
29
37
|
/**
|
|
30
38
|
* @param {GraphicsContext} graphics
|
|
31
39
|
*/
|
|
@@ -35,9 +43,13 @@ export class GPUProbeClipmapGI {
|
|
|
35
43
|
*/
|
|
36
44
|
get brick_clipmap(): GPUBrickClipmap;
|
|
37
45
|
/**
|
|
38
|
-
* @returns {GPUProbeClipmap|undefined} undefined while the mode is not running
|
|
46
|
+
* @returns {GPUProbeClipmap|undefined} the frustum's probes; undefined while the mode is not running
|
|
39
47
|
*/
|
|
40
48
|
get probe_clipmap(): GPUProbeClipmap;
|
|
49
|
+
/**
|
|
50
|
+
* @returns {GPUProbeClipmap|undefined} the world cache's probes; undefined while the mode is not running
|
|
51
|
+
*/
|
|
52
|
+
get world_cache(): GPUProbeClipmap;
|
|
41
53
|
/**
|
|
42
54
|
* @returns {ProbeClipmapSceneHolds|undefined} undefined while the mode is not running
|
|
43
55
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GPUProbeClipmapGI.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GPUProbeClipmapGI.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.js"],"names":[],"mappings":"AAuBA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH;IAoSI;;;;OAIG;IACH,oDAJW,eAAe,YACf,oBAAoB,GAClB,OAAO,CAUnB;IArOD;;OAEG;IACH,sBAFW,eAAe,EAMzB;IAED;;OAEG;IACH,qCAEC;IAED;;OAEG;IACH,qCAEC;IAED;;OAEG;IACH,mCAEC;IAED;;OAEG;IACH,oCAEC;IAED;;;;;;;;;;;;;;OAcG;IACH;QAT+B,KAAK,EAAzB,UAAU;QACc,IAAI,EAA5B,cAAc;QACgB,QAAQ,EAAtC,oBAAoB;QACJ,KAAK,EAArB,MAAM;QACU,MAAM,EAAtB,MAAM;QACK,IAAI;QACE,MAAM,GAAvB,MAAM;aAiIhB;IAqDD;;;OAGG;IACH,0BAEC;IAED;;;;;;;;;OASG;IACH,4CAUC;IAwDD;;;;;;;;;;OAUG;IACH;QAN+B,KAAK,EAAzB,UAAU;QACc,IAAI,EAA5B,cAAc;QACgB,QAAQ,EAAtC,oBAAoB;QACF,UAAU,EAA5B,MAAM,EAAE;QACN,MAAM,CAmBlB;IAED;;;;;OAKG;IACH,uBAFW,aAAa,QASvB;IAED;;;OAGG;IACH,0BAHW,aAAa,GACX,OAAO,CAanB;IAgED;;;OAGG;IACH,gBAuBC;IAED,gBAcC;;CACJ;yBA5kBY,OAAO,8DAA8D,EAAE,UAAU;8BACjF,OAAO,0BAA0B,EAAE,eAAe;6BAClD,OAAO,8BAA8B,EAAE,cAAc;mCACrD,OAAO,2BAA2B,EAAE,oBAAoB;4BACxD,OAAO,4BAA4B,EAAE,aAAa;gCAnB/B,4BAA4B;gCAQ5B,4BAA4B;uCAIrB,6BAA6B"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { assert } from "../../../../core/assert.js";
|
|
2
|
+
import { ceilPowerOfTwo } from "../../../../core/binary/operations/ceilPowerOfTwo.js";
|
|
2
3
|
import { BufferDescriptor } from "../../../descriptor/buffer/BufferDescriptor.js";
|
|
4
|
+
import {
|
|
5
|
+
graph_build_world_light_clusters,
|
|
6
|
+
world_light_clusters_data_size
|
|
7
|
+
} from "../../light/world_cluster/graph_build_world_light_clusters.js";
|
|
3
8
|
import { CLIPMAP_LEVEL_ARRAY } from "../../shader/chunk/clipmap/CLIPMAP_LEVEL_STRUCT.js";
|
|
9
|
+
import { graph_import_buffer } from "../../shader/graph/graph_import_buffer.js";
|
|
4
10
|
import { GPUBrickClipmap } from "./brick/GPUBrickClipmap.js";
|
|
5
11
|
import { MeshSDFBrickProvider } from "./brick/mesh/MeshSDFBrickProvider.js";
|
|
6
12
|
import { graph_probe_clipmap_debug_brick_clipmap } from "./debug/graph_probe_clipmap_debug_brick_clipmap.js";
|
|
@@ -10,7 +16,9 @@ import { ProbeClipmapDebugView } from "./debug/ProbeClipmapDebugView.js";
|
|
|
10
16
|
import { PROBE_RECORD_STRUCT } from "./probe/chunk_probe_clipmap.js";
|
|
11
17
|
import { PROBE_SAMPLING_STRUCT } from "./probe/chunk_probe_clipmap_pick.js";
|
|
12
18
|
import { GPUProbeClipmap } from "./probe/GPUProbeClipmap.js";
|
|
13
|
-
import { PROBE_DEPTH_TEXEL_RAYS,
|
|
19
|
+
import { PROBE_DEPTH_TEXEL_RAYS, PROBE_RAY_CASCADE_MASK, PROBE_TEXEL_RAYS } from "./probe/PROBE_CLIPMAP.js";
|
|
20
|
+
import { ProbeClipmapHitWants } from "./probe/ProbeClipmapHitWants.js";
|
|
21
|
+
import { ProbeClipmapScreenWants } from "./probe/ProbeClipmapScreenWants.js";
|
|
14
22
|
import { ProbeClipmapSceneHolds } from "./ProbeClipmapSceneHolds.js";
|
|
15
23
|
|
|
16
24
|
/**
|
|
@@ -23,8 +31,10 @@ import { ProbeClipmapSceneHolds } from "./ProbeClipmapSceneHolds.js";
|
|
|
23
31
|
|
|
24
32
|
/**
|
|
25
33
|
* {@link ShadeIndirectLightingMode.ProbeClipmap} for one view (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §5):
|
|
26
|
-
* a {@link GPUBrickClipmap}, the world as rays see it, and
|
|
27
|
-
*
|
|
34
|
+
* a {@link GPUBrickClipmap}, the world as rays see it, and two {@link GPUProbeClipmap}s around the view
|
|
35
|
+
* (WORLD_PROBE_CACHE_SCOPE_2026_11_01.md): the frustum's probes, which the frame's pixels want and shading
|
|
36
|
+
* samples, and the world cache, which the frustum's hits want where the frustum has no probe and which only
|
|
37
|
+
* the probes' hits sample, in the frustum's windows at 2^k its lattice.
|
|
28
38
|
*
|
|
29
39
|
* The renderer holds one for its main view, as it holds the view's volumetrics, and hands it the view
|
|
30
40
|
* and the settings on every frame the mode runs ({@link graph_update}). The clipmaps are made on the
|
|
@@ -53,10 +63,28 @@ export class GPUProbeClipmapGI {
|
|
|
53
63
|
#brick_clipmap = undefined;
|
|
54
64
|
|
|
55
65
|
/**
|
|
66
|
+
* The frustum's probes.
|
|
56
67
|
* @type {GPUProbeClipmap|undefined}
|
|
57
68
|
*/
|
|
58
69
|
#probe_clipmap = undefined;
|
|
59
70
|
|
|
71
|
+
/**
|
|
72
|
+
* The world cache's probes.
|
|
73
|
+
* @type {GPUProbeClipmap|undefined}
|
|
74
|
+
*/
|
|
75
|
+
#world_cache = undefined;
|
|
76
|
+
|
|
77
|
+
/** The frustum's wants, the frame's pixels. */
|
|
78
|
+
#screen_wants = new ProbeClipmapScreenWants();
|
|
79
|
+
|
|
80
|
+
/** The world cache's wants, the frustum's hits. @type {ProbeClipmapHitWants|undefined} */
|
|
81
|
+
#hit_wants = undefined;
|
|
82
|
+
|
|
83
|
+
/** The coarsest brick window's box, metres, which the world light clusters cull lights against. */
|
|
84
|
+
#clusters_min = [0, 0, 0];
|
|
85
|
+
#clusters_max = [0, 0, 0];
|
|
86
|
+
#clusters = { lookup: -1, data: -1 };
|
|
87
|
+
|
|
60
88
|
/**
|
|
61
89
|
* {@link GPUViewContext#id} of the view the clipmaps were made for: they hold what is around that
|
|
62
90
|
* view's camera, in that view's scene.
|
|
@@ -116,12 +144,19 @@ export class GPUProbeClipmapGI {
|
|
|
116
144
|
}
|
|
117
145
|
|
|
118
146
|
/**
|
|
119
|
-
* @returns {GPUProbeClipmap|undefined} undefined while the mode is not running
|
|
147
|
+
* @returns {GPUProbeClipmap|undefined} the frustum's probes; undefined while the mode is not running
|
|
120
148
|
*/
|
|
121
149
|
get probe_clipmap() {
|
|
122
150
|
return this.#probe_clipmap;
|
|
123
151
|
}
|
|
124
152
|
|
|
153
|
+
/**
|
|
154
|
+
* @returns {GPUProbeClipmap|undefined} the world cache's probes; undefined while the mode is not running
|
|
155
|
+
*/
|
|
156
|
+
get world_cache() {
|
|
157
|
+
return this.#world_cache;
|
|
158
|
+
}
|
|
159
|
+
|
|
125
160
|
/**
|
|
126
161
|
* @returns {ProbeClipmapSceneHolds|undefined} undefined while the mode is not running
|
|
127
162
|
*/
|
|
@@ -153,10 +188,14 @@ export class GPUProbeClipmapGI {
|
|
|
153
188
|
assert.notOk(this.#destroyed, 'destroyed');
|
|
154
189
|
|
|
155
190
|
// the relations between fields, checked here because each setter sees only its own field
|
|
156
|
-
assert.
|
|
157
|
-
assert.
|
|
158
|
-
assert.
|
|
191
|
+
assert.lessThanOrEqual(settings.rays_per_probe, PROBE_TEXEL_RAYS * settings.radiance_resolution * settings.radiance_resolution, 'rays_per_probe must be at most 64·radiance_resolution², the rays a radiance texel gathers');
|
|
192
|
+
assert.greaterThanOrEqual(settings.frustum_ray_budget, settings.rays_per_probe, 'frustum_ray_budget, FRUSTUM_RAY_BUDGET_FRACTION of ray_budget, must be at least rays_per_probe');
|
|
193
|
+
assert.lessThanOrEqual(settings.brick_cascade_count, PROBE_RAY_CASCADE_MASK + 1, "brick_cascade_count, the ray's cascade field");
|
|
194
|
+
assert.lessThanOrEqual(world_light_clusters_data_size(settings.brick_cascade_count), this.#graphics.device.limits.maxStorageBufferBindingSize, "brick_cascade_count, the world light clusters' data past maxStorageBufferBindingSize");
|
|
159
195
|
assert.lessThanOrEqual(settings.rays_per_probe, PROBE_DEPTH_TEXEL_RAYS * settings.depth_resolution * settings.depth_resolution, 'rays_per_probe must be at most 64·depth_resolution², the rays a depth texel gathers');
|
|
196
|
+
assert.lessThanOrEqual(settings.world_cache_rays_per_probe, PROBE_TEXEL_RAYS * settings.world_cache_radiance_resolution ** 2, 'world_cache_rays_per_probe must be at most 64·world_cache_radiance_resolution², the rays a radiance texel gathers');
|
|
197
|
+
assert.lessThanOrEqual(settings.world_cache_rays_per_probe, PROBE_DEPTH_TEXEL_RAYS * settings.world_cache_depth_resolution ** 2, 'world_cache_rays_per_probe must be at most 64·world_cache_depth_resolution², the rays a depth texel gathers');
|
|
198
|
+
assert.greaterThanOrEqual(settings.world_ray_budget, settings.world_cache_rays_per_probe, 'world_ray_budget, the rest of ray_budget, must be at least world_cache_rays_per_probe');
|
|
160
199
|
|
|
161
200
|
if (
|
|
162
201
|
this.#brick_clipmap !== undefined
|
|
@@ -164,6 +203,7 @@ export class GPUProbeClipmapGI {
|
|
|
164
203
|
view.id !== this.#view_id
|
|
165
204
|
|| !this.#brick_clipmap.built_for(settings)
|
|
166
205
|
|| !this.#probe_clipmap.built_for(settings)
|
|
206
|
+
|| !GPUProbeClipmapGI.#world_cache_built_for(this.#world_cache, settings)
|
|
167
207
|
)
|
|
168
208
|
) {
|
|
169
209
|
this.release();
|
|
@@ -212,26 +252,110 @@ export class GPUProbeClipmapGI {
|
|
|
212
252
|
movers,
|
|
213
253
|
});
|
|
214
254
|
|
|
215
|
-
|
|
216
|
-
|
|
255
|
+
const clusters = this.#graph_clusters(graph, scene);
|
|
256
|
+
|
|
257
|
+
// the probes around the same anchor, updated through the bricks (§8): the frustum's windows, and the
|
|
258
|
+
// world cache's in them
|
|
259
|
+
const frustum = this.#probe_clipmap;
|
|
260
|
+
const world = this.#world_cache;
|
|
261
|
+
|
|
262
|
+
frustum.place(transform[12], transform[13], transform[14]);
|
|
263
|
+
world.place_within(frustum);
|
|
264
|
+
|
|
265
|
+
// the world cache first: its wants read the frustum's last-frame rays, which the frustum's lifetime
|
|
266
|
+
// writes over
|
|
267
|
+
this.#hit_wants.set({ ray_budget: settings.frustum_ray_budget });
|
|
268
|
+
|
|
269
|
+
world.graph_update({
|
|
217
270
|
graph,
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
271
|
+
wants: this.#hit_wants,
|
|
272
|
+
stbn,
|
|
273
|
+
response_frames: settings.response_frames,
|
|
274
|
+
ray_budget: settings.world_ray_budget,
|
|
275
|
+
rays_per_probe: settings.world_cache_rays_per_probe,
|
|
276
|
+
brick_clipmap: this.#brick_clipmap,
|
|
277
|
+
bricks,
|
|
278
|
+
scene,
|
|
279
|
+
card_rows: this.#holds.rows_buffer,
|
|
280
|
+
// a world cache probe re-samples nothing: its radiance has no skirt for the history's taps, and the
|
|
281
|
+
// rays are the frustum's switch
|
|
282
|
+
history_resampling: false,
|
|
283
|
+
ray_resampling: false,
|
|
284
|
+
clusters,
|
|
285
|
+
bounce_first: frustum,
|
|
286
|
+
bounce_fallback: world,
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
this.#screen_wants.set({ depth, normal, camera: view.camera.buffer, stbn, resolution: view.resolution });
|
|
290
|
+
|
|
291
|
+
frustum.graph_update({
|
|
292
|
+
graph,
|
|
293
|
+
wants: this.#screen_wants,
|
|
224
294
|
stbn,
|
|
225
|
-
resolution: view.resolution,
|
|
226
295
|
response_frames: settings.response_frames,
|
|
227
|
-
ray_budget: settings.
|
|
296
|
+
ray_budget: settings.frustum_ray_budget,
|
|
228
297
|
rays_per_probe: settings.rays_per_probe,
|
|
229
298
|
brick_clipmap: this.#brick_clipmap,
|
|
230
299
|
bricks,
|
|
231
300
|
scene,
|
|
232
301
|
card_rows: this.#holds.rows_buffer,
|
|
233
|
-
|
|
302
|
+
history_resampling: settings.history_resampling,
|
|
303
|
+
ray_resampling: settings.ray_resampling,
|
|
304
|
+
clusters,
|
|
305
|
+
bounce_first: frustum,
|
|
306
|
+
bounce_fallback: world,
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* The world light clusters over the bricks' cascades, where every hit is, which both clipmaps' hits take
|
|
312
|
+
* their local lights from (§8.7).
|
|
313
|
+
*
|
|
314
|
+
* @param {FrameGraph} graph
|
|
315
|
+
* @param {import("../../scene/GPUSceneContext.js").GPUSceneContext} scene
|
|
316
|
+
* @returns {{lookup: number, data: number}} graph handles, held until the next call
|
|
317
|
+
*/
|
|
318
|
+
#graph_clusters(graph, scene) {
|
|
319
|
+
const brick_clipmap = this.#brick_clipmap;
|
|
320
|
+
const coarsest = brick_clipmap.cascade_count - 1;
|
|
321
|
+
const coarsest_cell = brick_clipmap.cell_size(coarsest);
|
|
322
|
+
|
|
323
|
+
for (let axis = 0; axis < 3; axis++) {
|
|
324
|
+
const corner = brick_clipmap.corner(coarsest, axis);
|
|
325
|
+
|
|
326
|
+
this.#clusters_min[axis] = corner * coarsest_cell;
|
|
327
|
+
this.#clusters_max[axis] = (corner + brick_clipmap.resolution) * coarsest_cell;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
const built = graph_build_world_light_clusters({
|
|
331
|
+
graph,
|
|
332
|
+
lights: scene.lights,
|
|
333
|
+
levels: graph_import_buffer(graph, brick_clipmap.levels, "probe_brick_levels"),
|
|
334
|
+
cascade_count: brick_clipmap.cascade_count,
|
|
335
|
+
border: 0,
|
|
336
|
+
coarsest_min: this.#clusters_min,
|
|
337
|
+
coarsest_max: this.#clusters_max,
|
|
234
338
|
});
|
|
339
|
+
|
|
340
|
+
this.#clusters.lookup = built.lookup;
|
|
341
|
+
this.#clusters.data = built.data;
|
|
342
|
+
|
|
343
|
+
return this.#clusters;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* @param {GPUProbeClipmap} world_cache
|
|
348
|
+
* @param {ProbeClipmapSettings} settings
|
|
349
|
+
* @returns {boolean} whether it is what the settings' world cache describes, in their frustum's windows
|
|
350
|
+
*/
|
|
351
|
+
static #world_cache_built_for(world_cache, settings) {
|
|
352
|
+
const ratio = 2 ** settings.world_cache_spacing_shift;
|
|
353
|
+
|
|
354
|
+
return world_cache.cascade_count === settings.probe_cascade_count
|
|
355
|
+
&& world_cache.resolution === settings.probe_cascade_resolution * ratio
|
|
356
|
+
&& world_cache.spacing === settings.probe_spacing / ratio
|
|
357
|
+
&& world_cache.radiance_resolution === settings.world_cache_radiance_resolution
|
|
358
|
+
&& world_cache.depth_resolution === settings.world_cache_depth_resolution;
|
|
235
359
|
}
|
|
236
360
|
|
|
237
361
|
/**
|
|
@@ -408,14 +532,37 @@ export class GPUProbeClipmapGI {
|
|
|
408
532
|
voxel_size: settings.brick_voxel_size,
|
|
409
533
|
});
|
|
410
534
|
|
|
535
|
+
// the frustum's slots start at 2·N²·C, a power of two: a visible surface crosses each cascade as a shell a
|
|
536
|
+
// cell thick, doubled for the cage. The world cache's start there too: the surfaces that want it are the
|
|
537
|
+
// frustum's hits', not the screen's, so its own lattice says nothing of how many there are
|
|
538
|
+
const capacity = ceilPowerOfTwo(2 * settings.probe_cascade_resolution ** 2 * settings.probe_cascade_count);
|
|
539
|
+
|
|
411
540
|
this.#probe_clipmap = new GPUProbeClipmap(device, {
|
|
412
541
|
cascade_count: settings.probe_cascade_count,
|
|
413
542
|
resolution: settings.probe_cascade_resolution,
|
|
414
543
|
spacing: settings.probe_spacing,
|
|
415
544
|
radiance_resolution: settings.radiance_resolution,
|
|
416
545
|
depth_resolution: settings.depth_resolution,
|
|
546
|
+
radiance_skirt: true,
|
|
547
|
+
label: 'Probe clipmap',
|
|
548
|
+
capacity,
|
|
549
|
+
});
|
|
550
|
+
|
|
551
|
+
const ratio = 2 ** settings.world_cache_spacing_shift;
|
|
552
|
+
|
|
553
|
+
this.#world_cache = new GPUProbeClipmap(device, {
|
|
554
|
+
cascade_count: settings.probe_cascade_count,
|
|
555
|
+
resolution: settings.probe_cascade_resolution * ratio,
|
|
556
|
+
spacing: settings.probe_spacing / ratio,
|
|
557
|
+
radiance_resolution: settings.world_cache_radiance_resolution,
|
|
558
|
+
depth_resolution: settings.world_cache_depth_resolution,
|
|
559
|
+
radiance_skirt: false,
|
|
560
|
+
label: 'Probe world cache',
|
|
561
|
+
capacity,
|
|
417
562
|
});
|
|
418
563
|
|
|
564
|
+
this.#hit_wants = new ProbeClipmapHitWants(this.#probe_clipmap);
|
|
565
|
+
|
|
419
566
|
this.#view_id = view.id;
|
|
420
567
|
}
|
|
421
568
|
|
|
@@ -435,6 +582,7 @@ export class GPUProbeClipmapGI {
|
|
|
435
582
|
|
|
436
583
|
this.#brick_clipmap.destroy();
|
|
437
584
|
this.#probe_clipmap.destroy();
|
|
585
|
+
this.#world_cache.destroy();
|
|
438
586
|
this.#mesh_provider.destroy();
|
|
439
587
|
|
|
440
588
|
this.#mesh_provider = undefined;
|
|
@@ -442,6 +590,8 @@ export class GPUProbeClipmapGI {
|
|
|
442
590
|
|
|
443
591
|
this.#brick_clipmap = undefined;
|
|
444
592
|
this.#probe_clipmap = undefined;
|
|
593
|
+
this.#world_cache = undefined;
|
|
594
|
+
this.#hit_wants = undefined;
|
|
445
595
|
this.#view_id = -1;
|
|
446
596
|
}
|
|
447
597
|
|