@woosh/meep-engine 3.60.5 → 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/CHANGELOG.md +19 -0
- 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/Renderer.d.ts +11 -0
- package/src/shade/renderer/Renderer.d.ts.map +1 -1
- package/src/shade/renderer/Renderer.js +43 -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 +26 -43
- package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.js +115 -123
- 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/sdf/cards/GPUMeshCardSets.d.ts +20 -2
- package/src/shade/renderer/geometry/sdf/cards/GPUMeshCardSets.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/cards/GPUMeshCardSets.js +66 -2
- package/src/shade/renderer/geometry/virtual/proxy/vgeo_proxy_triangle_limit.d.ts +19 -0
- package/src/shade/renderer/geometry/virtual/proxy/vgeo_proxy_triangle_limit.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/proxy/vgeo_proxy_triangle_limit.js +25 -0
- 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/geometry/virtual/runtime/VirtualGeometry.d.ts +15 -0
- package/src/shade/renderer/geometry/virtual/runtime/VirtualGeometry.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/runtime/VirtualGeometry.js +38 -0
- package/src/shade/renderer/geometry/virtual/sdf/VGeoSDFProxies.d.ts +28 -59
- package/src/shade/renderer/geometry/virtual/sdf/VGeoSDFProxies.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/sdf/VGeoSDFProxies.js +84 -789
- 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/ProbeClipmapSceneHolds.d.ts +2 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSceneHolds.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSceneHolds.js +2 -1
- 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_instance.d.ts +2 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_instance.js +2 -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/material/GPUMaterialManager.d.ts +4 -1
- package/src/shade/renderer/material/GPUMaterialManager.d.ts.map +1 -1
- package/src/shade/renderer/material/GPUMaterialManager.js +5 -8
- 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/GTAO.d.ts +7 -3
- package/src/shade/renderer/postprocess/gtao/GTAO.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/gtao/GTAO.js +26 -13
- package/src/shade/renderer/postprocess/gtao/ao_reproject_shader.d.ts +14 -0
- package/src/shade/renderer/postprocess/gtao/ao_reproject_shader.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/gtao/ao_reproject_shader.js +196 -68
- 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.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/gtao/fragment_shader_gtao.js +42 -28
- 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 +430 -414
- package/src/shade/renderer/postprocess/gtao/shader_gtao_spatial_denoise.d.ts +16 -0
- package/src/shade/renderer/postprocess/gtao/shader_gtao_spatial_denoise.d.ts.map +1 -0
- package/src/shade/renderer/postprocess/gtao/shader_gtao_spatial_denoise.js +156 -0
- 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/scene/GPUSceneContext.d.ts +2 -2
- package/src/shade/renderer/scene/GPUSceneContext.js +5 -5
- 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/geometry/virtual/sdf/VGEO_SDF.d.ts +0 -47
- package/src/shade/renderer/geometry/virtual/sdf/VGEO_SDF.d.ts.map +0 -1
- package/src/shade/renderer/geometry/virtual/sdf/VGEO_SDF.js +0 -80
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_collect.d.ts +0 -16
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_collect.d.ts.map +0 -1
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_collect.js +0 -67
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_decode.d.ts +0 -17
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_decode.d.ts.map +0 -1
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_decode.js +0 -145
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_traverse.d.ts +0 -12
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_traverse.d.ts.map +0 -1
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_traverse.js +0 -105
- 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/chunk_probe_clipmap_pick.js
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { SamplerDescriptor } from "../../../../descriptor/texture/SamplerDescriptor.js";
|
|
2
2
|
import { chunk_clipmap_select_finest } from "../../../shader/chunk/clipmap/chunk_clipmap_select_finest.js";
|
|
3
|
-
import {
|
|
3
|
+
import { CLIPMAP_LEVEL_ARRAY } from "../../../shader/chunk/clipmap/CLIPMAP_LEVEL_STRUCT.js";
|
|
4
|
+
import {
|
|
5
|
+
chunk_uv_octahedral_unit_encode
|
|
6
|
+
} from "../../../shader/chunk/geometry/octahedron/chunk_uv_octahedral_unit_encode.js";
|
|
4
7
|
import { chunk_index_to_grid2d_reciprocal } from "../../../shader/chunk/grid/chunk_index_to_grid2d_reciprocal.js";
|
|
5
8
|
import { chunk_probe_visibility_weight } from "../../../shader/chunk/light/probe/chunk_probe_visibility_weight.js";
|
|
6
9
|
import { chunk_pick2_wrs_mat2x4 } from "../../../shader/chunk/random/reservoir/chunk_pick2_wrs_mat2x4.js";
|
|
7
|
-
import {
|
|
8
|
-
|
|
10
|
+
import {
|
|
11
|
+
METRO_L1_IRRADIANCE_STRUCT
|
|
12
|
+
} from "../../../shader/chunk/spherical_harmonics/l1i/chunk_convert_to_irradiance_sh.js";
|
|
13
|
+
import {
|
|
14
|
+
chunk_texture_octahedral_skirt_uv
|
|
15
|
+
} from "../../../shader/chunk/texture/octahedral/chunk_texture_octahedral_skirt_uv.js";
|
|
9
16
|
import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
|
|
10
17
|
import { ShaderResourceDescriptor } from "../../../shader/resource/ShaderResourceDescriptor.js";
|
|
11
18
|
import { ShaderResourceGroupDescriptor } from "../../../shader/resource/ShaderResourceGroupDescriptor.js";
|
|
@@ -16,10 +23,11 @@ import {
|
|
|
16
23
|
PROBE_DEPTH_HISTORY_RESOURCE,
|
|
17
24
|
PROBE_LEVELS_RESOURCE,
|
|
18
25
|
PROBE_RADIANCE_HISTORY_RESOURCE,
|
|
26
|
+
PROBE_RECORD_STRUCT,
|
|
19
27
|
PROBE_RECORDS_READ_RESOURCE,
|
|
20
28
|
PROBE_STATES_READ_RESOURCE
|
|
21
29
|
} from "./chunk_probe_clipmap.js";
|
|
22
|
-
import {
|
|
30
|
+
import { chunk_probe_clipmap_cage_in } from "./chunk_probe_clipmap_cage.js";
|
|
23
31
|
import { PROBE_RECEIVER_BIAS_VIEW } from "./PROBE_CLIPMAP.js";
|
|
24
32
|
|
|
25
33
|
/**
|
|
@@ -80,16 +88,25 @@ export const PROBE_DEPTH_SAMPLER_DESCRIPTOR = Object.freeze(SamplerDescriptor.fr
|
|
|
80
88
|
*/
|
|
81
89
|
export const PROBE_DEPTH_SAMPLER_RESOURCE = ShaderResourceDescriptor.sampler("probe_depth_sampler", "filtering", PROBE_DEPTH_SAMPLER_DESCRIPTOR);
|
|
82
90
|
|
|
91
|
+
const LEVELS = `ptr<uniform, ${CLIPMAP_LEVEL_ARRAY.wgsl_ref}>`;
|
|
92
|
+
const SAMPLING = `ptr<uniform, ${PROBE_SAMPLING_STRUCT.wgsl_ref}>`;
|
|
93
|
+
const STATES = `ptr<storage, array<vec2<u32>>, read>`;
|
|
94
|
+
const RECORDS = `ptr<storage, array<${PROBE_RECORD_STRUCT.wgsl_ref}>, read>`;
|
|
95
|
+
|
|
83
96
|
/**
|
|
84
|
-
* A point's picked probes (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §9.1), and their SH (§9.2)
|
|
97
|
+
* A point's picked probes in one clipmap (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §9.1), and their SH (§9.2),
|
|
98
|
+
* the clipmap passed whole: its levels, shape, indirection, states and depth atlas to the pick, its records to
|
|
99
|
+
* the SH. It binds nothing but the depth's sampler, so a shader can pick from two clipmaps, as the bounce pass
|
|
100
|
+
* does (`shader_probe_clipmap_bounce`).
|
|
85
101
|
*
|
|
86
102
|
* ```wgsl
|
|
87
|
-
* fn
|
|
88
|
-
* fn
|
|
89
|
-
* fn
|
|
103
|
+
* fn probe_clipmap_pick_in(levels: ptr<uniform, ClipmapLevelArray>, sampling: ptr<uniform, ProbeSampling>, indirection: texture_3d<u32>, states: ptr<storage, array<vec2<u32>>, read>, depth: texture_2d<f32>, position: vec3<f32>, normal: vec3<f32>, view_direction: vec3<f32>, noise: vec2<f32>) -> ProbeClipmapPick
|
|
104
|
+
* fn probe_clipmap_sh_in(records: ptr<storage, array<ProbeRecord>, read>, pick: ProbeClipmapPick) -> ProbeClipmapSH
|
|
105
|
+
* fn probe_clipmap_corner_slot_in(sampling, indirection, cascade: u32, point: vec3<i32>) -> u32
|
|
106
|
+
* fn probe_clipmap_depth_moments_in(sampling, depth, slot: u32, direction: vec3<f32>) -> vec2<f32>
|
|
90
107
|
* ```
|
|
91
108
|
*
|
|
92
|
-
* - **The cage**: `
|
|
109
|
+
* - **The cage**: `probe_clipmap_cage_in` along mix(n, v, 0.2), as want takes it, so a pixel reads the
|
|
93
110
|
* probes it wanted.
|
|
94
111
|
* - **The weights**, visibility only, of the cage's eight corners: a corner without an ALIVE probe weighs
|
|
95
112
|
* nothing; one with weighs its trilinear weight × `probe_visibility_weight`: the wrap back-face term
|
|
@@ -100,9 +117,8 @@ export const PROBE_DEPTH_SAMPLER_RESOURCE = ShaderResourceDescriptor.sampler("pr
|
|
|
100
117
|
* whose corners weigh nothing gives way to the next coarser, without a skirt. With none left the
|
|
101
118
|
* weights are zero, and the fallback is the caller's (§9.1, step 6).
|
|
102
119
|
* - **The SH**: the picked records' Metro L1 structs mixed by their weights; resolved with
|
|
103
|
-
* `resolve_irradiance_sh_to_diffuse` at the caller's normal, it gives E/π. `
|
|
104
|
-
*
|
|
105
|
-
* and takes it.
|
|
120
|
+
* `resolve_irradiance_sh_to_diffuse` at the caller's normal, it gives E/π. `found` says whether any probe
|
|
121
|
+
* weighed anything.
|
|
106
122
|
*
|
|
107
123
|
* Per cascade read: 8 indirection loads, 8 state words and 8 depth taps, then 2 indirection loads for
|
|
108
124
|
* the pair; then two records a cascade read for the SH. A depth tile's place takes no integer division
|
|
@@ -110,7 +126,7 @@ export const PROBE_DEPTH_SAMPLER_RESOURCE = ShaderResourceDescriptor.sampler("pr
|
|
|
110
126
|
*
|
|
111
127
|
* @type {CodeChunk}
|
|
112
128
|
*/
|
|
113
|
-
export const
|
|
129
|
+
export const chunk_probe_clipmap_pick_in = CodeChunk.from(
|
|
114
130
|
//language=WGSL
|
|
115
131
|
`
|
|
116
132
|
struct ProbeClipmapPick {
|
|
@@ -130,11 +146,11 @@ struct ProbeClipmapSH {
|
|
|
130
146
|
found: bool,
|
|
131
147
|
}
|
|
132
148
|
|
|
133
|
-
fn
|
|
134
|
-
let resolution =
|
|
149
|
+
fn probe_clipmap_corner_slot_in(sampling: ${SAMPLING}, indirection: texture_3d<u32>, cascade: u32, point: vec3<i32>) -> u32 {
|
|
150
|
+
let resolution = (*sampling).resolution;
|
|
135
151
|
let storage = vec3<u32>(point) & vec3<u32>(resolution - 1u);
|
|
136
152
|
|
|
137
|
-
return textureLoad(
|
|
153
|
+
return textureLoad(indirection, probe_clipmap_indirection_texel(cascade, storage, resolution), 0).r;
|
|
138
154
|
}
|
|
139
155
|
|
|
140
156
|
fn probe_clipmap_corner(k: u32) -> vec3<i32> {
|
|
@@ -142,30 +158,30 @@ fn probe_clipmap_corner(k: u32) -> vec3<i32> {
|
|
|
142
158
|
}
|
|
143
159
|
|
|
144
160
|
// a slot's depth moments toward a direction, in spacings: one bilinear tap of its tile, through its skirt
|
|
145
|
-
fn
|
|
146
|
-
let side =
|
|
147
|
-
let place = index_to_grid2d_reciprocal(slot,
|
|
161
|
+
fn probe_clipmap_depth_moments_in(sampling: ${SAMPLING}, depth: texture_2d<f32>, slot: u32, direction: vec3<f32>) -> vec2<f32> {
|
|
162
|
+
let side = (*sampling).depth_resolution + 2u;
|
|
163
|
+
let place = index_to_grid2d_reciprocal(slot, (*sampling).depth_tiles_per_row, (*sampling).depth_tiles_per_row_reciprocal);
|
|
148
164
|
let tile = vec2<f32>(place * side);
|
|
149
165
|
let in_tile = texture_octahedral_skirt_uv(uv_octahedral_unit_encode(direction), f32(side)) * f32(side);
|
|
150
166
|
|
|
151
|
-
return textureSampleLevel(
|
|
167
|
+
return textureSampleLevel(depth, probe_depth_sampler, (tile + in_tile) * (*sampling).depth_texel, 0.0).rg;
|
|
152
168
|
}
|
|
153
169
|
|
|
154
|
-
fn
|
|
170
|
+
fn probe_clipmap_corner_weight_in(levels: ${LEVELS}, sampling: ${SAMPLING}, indirection: texture_3d<u32>, states: ${STATES}, depth: texture_2d<f32>, cascade: u32, cage: vec3<i32>, k: u32, position: vec3<f32>, normal: vec3<f32>, biased: vec3<f32>) -> f32 {
|
|
155
171
|
let point = cage + probe_clipmap_corner(k);
|
|
156
|
-
let slot =
|
|
172
|
+
let slot = probe_clipmap_corner_slot_in(sampling, indirection, cascade, point);
|
|
157
173
|
|
|
158
174
|
if (slot == PROBE_CLIPMAP_NONE) {
|
|
159
175
|
return 0.0;
|
|
160
176
|
}
|
|
161
177
|
|
|
162
|
-
let state =
|
|
178
|
+
let state = (*states)[slot];
|
|
163
179
|
|
|
164
180
|
if (probe_state_kind(state.x) != PROBE_STATE_ALIVE) {
|
|
165
181
|
return 0.0;
|
|
166
182
|
}
|
|
167
183
|
|
|
168
|
-
let spacing =
|
|
184
|
+
let spacing = (*levels)[cascade].cell_size;
|
|
169
185
|
let probe = vec3<f32>(point) * spacing + probe_clipmap_offset_decode(state.y, spacing);
|
|
170
186
|
|
|
171
187
|
let f = biased / spacing - vec3<f32>(cage);
|
|
@@ -175,36 +191,36 @@ fn probe_clipmap_corner_weight(cascade: u32, cage: vec3<i32>, k: u32, position:
|
|
|
175
191
|
|
|
176
192
|
let to_point = biased - probe;
|
|
177
193
|
let distance = length(to_point);
|
|
178
|
-
let moments =
|
|
194
|
+
let moments = probe_clipmap_depth_moments_in(sampling, depth, slot, to_point / max(distance, 1e-6));
|
|
179
195
|
let visibility = probe_visibility_chebyshev(moments, distance / spacing);
|
|
180
196
|
|
|
181
197
|
// the back-face term from the point itself, not the biased one
|
|
182
198
|
return trilinear * probe_visibility_weight(normalize(probe - position), normal, visibility);
|
|
183
199
|
}
|
|
184
200
|
|
|
185
|
-
fn
|
|
201
|
+
fn probe_clipmap_pick_cascade_in(levels: ${LEVELS}, sampling: ${SAMPLING}, indirection: texture_3d<u32>, states: ${STATES}, depth: texture_2d<f32>, cascade: u32, position: vec3<f32>, normal: vec3<f32>, bias_direction: vec3<f32>, noise: vec2<f32>) -> ProbeClipmapPair {
|
|
186
202
|
var out: ProbeClipmapPair;
|
|
187
203
|
var cage: vec3<i32>;
|
|
188
204
|
|
|
189
|
-
if (!
|
|
205
|
+
if (!probe_clipmap_cage_in(levels, cascade, position, bias_direction, &cage)) {
|
|
190
206
|
return out;
|
|
191
207
|
}
|
|
192
208
|
|
|
193
|
-
let biased =
|
|
209
|
+
let biased = probe_clipmap_biased_in(levels, cascade, position, bias_direction);
|
|
194
210
|
|
|
195
211
|
// each corner by name: a dynamic index would put the weights in local memory
|
|
196
212
|
let weights = mat2x4<f32>(
|
|
197
213
|
vec4<f32>(
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
214
|
+
probe_clipmap_corner_weight_in(levels, sampling, indirection, states, depth, cascade, cage, 0u, position, normal, biased),
|
|
215
|
+
probe_clipmap_corner_weight_in(levels, sampling, indirection, states, depth, cascade, cage, 1u, position, normal, biased),
|
|
216
|
+
probe_clipmap_corner_weight_in(levels, sampling, indirection, states, depth, cascade, cage, 2u, position, normal, biased),
|
|
217
|
+
probe_clipmap_corner_weight_in(levels, sampling, indirection, states, depth, cascade, cage, 3u, position, normal, biased),
|
|
202
218
|
),
|
|
203
219
|
vec4<f32>(
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
220
|
+
probe_clipmap_corner_weight_in(levels, sampling, indirection, states, depth, cascade, cage, 4u, position, normal, biased),
|
|
221
|
+
probe_clipmap_corner_weight_in(levels, sampling, indirection, states, depth, cascade, cage, 5u, position, normal, biased),
|
|
222
|
+
probe_clipmap_corner_weight_in(levels, sampling, indirection, states, depth, cascade, cage, 6u, position, normal, biased),
|
|
223
|
+
probe_clipmap_corner_weight_in(levels, sampling, indirection, states, depth, cascade, cage, 7u, position, normal, biased),
|
|
208
224
|
),
|
|
209
225
|
);
|
|
210
226
|
|
|
@@ -215,19 +231,19 @@ fn probe_clipmap_pick_cascade(cascade: u32, position: vec3<f32>, normal: vec3<f3
|
|
|
215
231
|
let pick = pick2_wrs_mat2x4(weights, noise);
|
|
216
232
|
|
|
217
233
|
out.slots = vec2<u32>(
|
|
218
|
-
|
|
219
|
-
|
|
234
|
+
probe_clipmap_corner_slot_in(sampling, indirection, cascade, cage + probe_clipmap_corner(pick.indices.x)),
|
|
235
|
+
probe_clipmap_corner_slot_in(sampling, indirection, cascade, cage + probe_clipmap_corner(pick.indices.y)),
|
|
220
236
|
);
|
|
221
237
|
out.weights = vec2<f32>(1.0 - pick.blend, pick.blend);
|
|
222
238
|
|
|
223
239
|
return out;
|
|
224
240
|
}
|
|
225
241
|
|
|
226
|
-
fn
|
|
242
|
+
fn probe_clipmap_pick_in(levels: ${LEVELS}, sampling: ${SAMPLING}, indirection: texture_3d<u32>, states: ${STATES}, depth: texture_2d<f32>, position: vec3<f32>, normal: vec3<f32>, view_direction: vec3<f32>, noise: vec2<f32>) -> ProbeClipmapPick {
|
|
227
243
|
var out: ProbeClipmapPick;
|
|
228
244
|
|
|
229
|
-
let count =
|
|
230
|
-
let selection = clipmap_select_finest(
|
|
245
|
+
let count = (*sampling).cascade_count;
|
|
246
|
+
let selection = clipmap_select_finest(levels, count, position, PROBE_BLEND_SKIRT);
|
|
231
247
|
|
|
232
248
|
if (selection.level == CLIPMAP_LEVEL_NONE) {
|
|
233
249
|
return out;
|
|
@@ -237,7 +253,7 @@ fn probe_clipmap_pick(position: vec3<f32>, normal: vec3<f32>, view_direction: ve
|
|
|
237
253
|
|
|
238
254
|
var cascade = selection.level;
|
|
239
255
|
var skirt = selection.edge_weight;
|
|
240
|
-
var pair =
|
|
256
|
+
var pair = probe_clipmap_pick_cascade_in(levels, sampling, indirection, states, depth, cascade, position, normal, bias_direction, noise);
|
|
241
257
|
|
|
242
258
|
// a cascade whose corners weigh nothing gives way to the next coarser, whole
|
|
243
259
|
for (var next = cascade + 1u; next < count; next++) {
|
|
@@ -247,14 +263,14 @@ fn probe_clipmap_pick(position: vec3<f32>, normal: vec3<f32>, view_direction: ve
|
|
|
247
263
|
|
|
248
264
|
cascade = next;
|
|
249
265
|
skirt = 0.0;
|
|
250
|
-
pair =
|
|
266
|
+
pair = probe_clipmap_pick_cascade_in(levels, sampling, indirection, states, depth, cascade, position, normal, bias_direction, noise);
|
|
251
267
|
}
|
|
252
268
|
|
|
253
269
|
out.slots = vec4<u32>(pair.slots, pair.slots);
|
|
254
270
|
out.weights = vec4<f32>(pair.weights, 0.0, 0.0);
|
|
255
271
|
|
|
256
272
|
if (skirt > 0.0 && cascade + 1u < count && pair.weights.x + pair.weights.y > 0.0) {
|
|
257
|
-
let coarse =
|
|
273
|
+
let coarse = probe_clipmap_pick_cascade_in(levels, sampling, indirection, states, depth, cascade + 1u, position, normal, bias_direction, noise);
|
|
258
274
|
|
|
259
275
|
if (coarse.weights.x + coarse.weights.y > 0.0) {
|
|
260
276
|
out.slots = vec4<u32>(pair.slots, coarse.slots);
|
|
@@ -265,7 +281,7 @@ fn probe_clipmap_pick(position: vec3<f32>, normal: vec3<f32>, view_direction: ve
|
|
|
265
281
|
return out;
|
|
266
282
|
}
|
|
267
283
|
|
|
268
|
-
fn
|
|
284
|
+
fn probe_clipmap_sh_in(records: ${RECORDS}, pick: ProbeClipmapPick) -> ProbeClipmapSH {
|
|
269
285
|
var out: ProbeClipmapSH;
|
|
270
286
|
|
|
271
287
|
out.found = dot(pick.weights, vec4<f32>(1.0)) > 0.0;
|
|
@@ -276,52 +292,92 @@ fn probe_clipmap_sh_of(pick: ProbeClipmapPick) -> ProbeClipmapSH {
|
|
|
276
292
|
|
|
277
293
|
// each by name, the slots of a weight of zero not read
|
|
278
294
|
if (pick.weights.x > 0.0) {
|
|
279
|
-
let sh = probe_record_sh_decode(
|
|
295
|
+
let sh = probe_record_sh_decode((*records)[pick.slots.x].sh);
|
|
280
296
|
out.sh.CoCg += pick.weights.x * sh.CoCg;
|
|
281
297
|
out.sh.Y += pick.weights.x * sh.Y;
|
|
282
298
|
}
|
|
283
299
|
if (pick.weights.y > 0.0) {
|
|
284
|
-
let sh = probe_record_sh_decode(
|
|
300
|
+
let sh = probe_record_sh_decode((*records)[pick.slots.y].sh);
|
|
285
301
|
out.sh.CoCg += pick.weights.y * sh.CoCg;
|
|
286
302
|
out.sh.Y += pick.weights.y * sh.Y;
|
|
287
303
|
}
|
|
288
304
|
if (pick.weights.z > 0.0) {
|
|
289
|
-
let sh = probe_record_sh_decode(
|
|
305
|
+
let sh = probe_record_sh_decode((*records)[pick.slots.z].sh);
|
|
290
306
|
out.sh.CoCg += pick.weights.z * sh.CoCg;
|
|
291
307
|
out.sh.Y += pick.weights.z * sh.Y;
|
|
292
308
|
}
|
|
293
309
|
if (pick.weights.w > 0.0) {
|
|
294
|
-
let sh = probe_record_sh_decode(
|
|
310
|
+
let sh = probe_record_sh_decode((*records)[pick.slots.w].sh);
|
|
295
311
|
out.sh.CoCg += pick.weights.w * sh.CoCg;
|
|
296
312
|
out.sh.Y += pick.weights.w * sh.Y;
|
|
297
313
|
}
|
|
298
314
|
|
|
299
315
|
return out;
|
|
300
316
|
}
|
|
301
|
-
|
|
302
|
-
fn probe_clipmap_sample_sh(position: vec3<f32>, normal: vec3<f32>, view_direction: vec3<f32>, noise: vec2<f32>) -> ProbeClipmapSH {
|
|
303
|
-
return probe_clipmap_sh_of(probe_clipmap_pick(position, normal, view_direction, noise));
|
|
304
|
-
}
|
|
305
|
-
|
|
306
317
|
`, [
|
|
307
318
|
chunk_probe_clipmap,
|
|
308
319
|
chunk_clipmap_select_finest,
|
|
309
|
-
|
|
320
|
+
chunk_probe_clipmap_cage_in,
|
|
310
321
|
chunk_index_to_grid2d_reciprocal,
|
|
311
322
|
chunk_uv_octahedral_unit_encode,
|
|
312
323
|
chunk_texture_octahedral_skirt_uv,
|
|
313
324
|
chunk_probe_visibility_weight,
|
|
314
325
|
chunk_pick2_wrs_mat2x4,
|
|
326
|
+
PROBE_SAMPLING_STRUCT.declaration_chunk,
|
|
315
327
|
METRO_L1_IRRADIANCE_STRUCT.declaration_chunk,
|
|
316
328
|
]);
|
|
317
329
|
|
|
330
|
+
chunk_probe_clipmap_pick_in.requireResource(PROBE_DEPTH_SAMPLER_RESOURCE);
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* {@link chunk_probe_clipmap_pick_in} over the clipmap a shader binds under the probes' names, as every reader
|
|
334
|
+
* of the screen's probes does (§9.5):
|
|
335
|
+
*
|
|
336
|
+
* ```wgsl
|
|
337
|
+
* fn probe_clipmap_pick(position: vec3<f32>, normal: vec3<f32>, view_direction: vec3<f32>, noise: vec2<f32>) -> ProbeClipmapPick
|
|
338
|
+
* fn probe_clipmap_sh_of(pick: ProbeClipmapPick) -> ProbeClipmapSH
|
|
339
|
+
* fn probe_clipmap_sample_sh(position: vec3<f32>, normal: vec3<f32>, view_direction: vec3<f32>, noise: vec2<f32>) -> ProbeClipmapSH
|
|
340
|
+
* fn probe_clipmap_corner_slot(cascade: u32, point: vec3<i32>) -> u32
|
|
341
|
+
* fn probe_clipmap_depth_moments(slot: u32, direction: vec3<f32>) -> vec2<f32>
|
|
342
|
+
* ```
|
|
343
|
+
*
|
|
344
|
+
* `probe_clipmap_sh_of` takes a pick already made, so a pass that samples the specular too picks once;
|
|
345
|
+
* `probe_clipmap_sample_sh` picks and takes it.
|
|
346
|
+
*
|
|
347
|
+
* @type {CodeChunk}
|
|
348
|
+
*/
|
|
349
|
+
export const chunk_probe_clipmap_pick = CodeChunk.from(
|
|
350
|
+
//language=WGSL
|
|
351
|
+
`
|
|
352
|
+
fn probe_clipmap_corner_slot(cascade: u32, point: vec3<i32>) -> u32 {
|
|
353
|
+
return probe_clipmap_corner_slot_in(&probe_sampling, probe_indirection, cascade, point);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
fn probe_clipmap_depth_moments(slot: u32, direction: vec3<f32>) -> vec2<f32> {
|
|
357
|
+
return probe_clipmap_depth_moments_in(&probe_sampling, probe_depth, slot, direction);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
fn probe_clipmap_pick(position: vec3<f32>, normal: vec3<f32>, view_direction: vec3<f32>, noise: vec2<f32>) -> ProbeClipmapPick {
|
|
361
|
+
return probe_clipmap_pick_in(&probe_levels, &probe_sampling, probe_indirection, &probe_states, probe_depth, position, normal, view_direction, noise);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
fn probe_clipmap_sh_of(pick: ProbeClipmapPick) -> ProbeClipmapSH {
|
|
365
|
+
return probe_clipmap_sh_in(&probe_records, pick);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
fn probe_clipmap_sample_sh(position: vec3<f32>, normal: vec3<f32>, view_direction: vec3<f32>, noise: vec2<f32>) -> ProbeClipmapSH {
|
|
369
|
+
return probe_clipmap_sh_of(probe_clipmap_pick(position, normal, view_direction, noise));
|
|
370
|
+
}
|
|
371
|
+
`, [
|
|
372
|
+
chunk_probe_clipmap_pick_in,
|
|
373
|
+
]);
|
|
374
|
+
|
|
318
375
|
chunk_probe_clipmap_pick.requireResource(PROBE_LEVELS_RESOURCE);
|
|
319
376
|
chunk_probe_clipmap_pick.requireResource(PROBE_SAMPLING_RESOURCE);
|
|
320
377
|
chunk_probe_clipmap_pick.requireResource(PROBE_INDIRECTION_READ_RESOURCE);
|
|
321
378
|
chunk_probe_clipmap_pick.requireResource(PROBE_STATES_READ_RESOURCE);
|
|
322
379
|
chunk_probe_clipmap_pick.requireResource(PROBE_RECORDS_READ_RESOURCE);
|
|
323
380
|
chunk_probe_clipmap_pick.requireResource(PROBE_DEPTH_HISTORY_RESOURCE);
|
|
324
|
-
chunk_probe_clipmap_pick.requireResource(PROBE_DEPTH_SAMPLER_RESOURCE);
|
|
325
381
|
|
|
326
382
|
/**
|
|
327
383
|
* What {@link chunk_probe_clipmap_pick} reads, as a group a reader of the probes adds to its shader (§9.5).
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_resample.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What re-sampling a probe's neighbours shares between its passes (`shader_probe_clipmap_resample`,
|
|
3
|
+
* `shader_probe_clipmap_candidate`, `shader_probe_clipmap_resample_rays`):
|
|
4
|
+
*
|
|
5
|
+
* ```wgsl
|
|
6
|
+
* fn probe_resample_offset(j: u32) -> vec3<i32> // the j-th of the 26 neighbours' lattice offsets, the 3×3×3 around the point, its centre skipped
|
|
7
|
+
* fn probe_resample_visibility(moments: vec2<f32>, distance: f32) -> f32 // distance: in the moments' spacings
|
|
8
|
+
* ```
|
|
9
|
+
*
|
|
10
|
+
* `probe_resample_visibility` is how well a probe's depth moments toward a point confirm a surface at its distance:
|
|
11
|
+
* `s² / (s² + (d − μ)²)`, μ the mean depth, s² the depth's variance plus the receiver bias squared
|
|
12
|
+
* (`PROBE_RECEIVER_BIAS`). Two-sided, unlike Chebyshev's: depth nearer than the point is an occluder between, and
|
|
13
|
+
* depth farther sees past the point.
|
|
14
|
+
*
|
|
15
|
+
* @type {CodeChunk}
|
|
16
|
+
*/
|
|
17
|
+
export const chunk_probe_clipmap_resample: CodeChunk;
|
|
18
|
+
import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
|
|
19
|
+
//# sourceMappingURL=chunk_probe_clipmap_resample.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk_probe_clipmap_resample.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_resample.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;GAeG;AACH,2CAFU,SAAS,CAiBhB;0BAlCuB,uCAAuC"}
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_resample.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
|
|
2
|
+
import { PROBE_RECEIVER_BIAS } from "./PROBE_CLIPMAP.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* What re-sampling a probe's neighbours shares between its passes (`shader_probe_clipmap_resample`,
|
|
6
|
+
* `shader_probe_clipmap_candidate`, `shader_probe_clipmap_resample_rays`):
|
|
7
|
+
*
|
|
8
|
+
* ```wgsl
|
|
9
|
+
* fn probe_resample_offset(j: u32) -> vec3<i32> // the j-th of the 26 neighbours' lattice offsets, the 3×3×3 around the point, its centre skipped
|
|
10
|
+
* fn probe_resample_visibility(moments: vec2<f32>, distance: f32) -> f32 // distance: in the moments' spacings
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* `probe_resample_visibility` is how well a probe's depth moments toward a point confirm a surface at its distance:
|
|
14
|
+
* `s² / (s² + (d − μ)²)`, μ the mean depth, s² the depth's variance plus the receiver bias squared
|
|
15
|
+
* (`PROBE_RECEIVER_BIAS`). Two-sided, unlike Chebyshev's: depth nearer than the point is an occluder between, and
|
|
16
|
+
* depth farther sees past the point.
|
|
17
|
+
*
|
|
18
|
+
* @type {CodeChunk}
|
|
19
|
+
*/
|
|
20
|
+
export const chunk_probe_clipmap_resample = CodeChunk.from(
|
|
21
|
+
//language=WGSL
|
|
22
|
+
`
|
|
23
|
+
fn probe_resample_offset(j: u32) -> vec3<i32> {
|
|
24
|
+
let index = j + select(0u, 1u, j >= 13u);
|
|
25
|
+
|
|
26
|
+
return vec3<i32>(vec3<u32>(index % 3u, (index / 3u) % 3u, index / 9u)) - vec3<i32>(1);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
fn probe_resample_visibility(moments: vec2<f32>, distance: f32) -> f32 {
|
|
30
|
+
let spread = max(moments.y - moments.x * moments.x, 0.0) + ${PROBE_RECEIVER_BIAS} * ${PROBE_RECEIVER_BIAS};
|
|
31
|
+
let gap = distance - moments.x;
|
|
32
|
+
|
|
33
|
+
return spread / (spread + gap * gap);
|
|
34
|
+
}
|
|
35
|
+
`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_probe_clipmap_sample_radiance.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_sample_radiance.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chunk_probe_clipmap_sample_radiance.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_sample_radiance.js"],"names":[],"mappings":"AA8BA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,kDAFU,SAAS,CAsIZ;0BA7KmB,uCAAuC"}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { chunk_roughness_to_mip_ratio } from "../../../light/environment/chunk_roughness_to_mip_ratio.js";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
chunk_uv_octahedral_unit_encode
|
|
4
|
+
} from "../../../shader/chunk/geometry/octahedron/chunk_uv_octahedral_unit_encode.js";
|
|
3
5
|
import { chunk_index_to_grid2d_reciprocal } from "../../../shader/chunk/grid/chunk_index_to_grid2d_reciprocal.js";
|
|
4
6
|
import { chunk_probe_visibility_weight } from "../../../shader/chunk/light/probe/chunk_probe_visibility_weight.js";
|
|
5
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
METRO_L1_IRRADIANCE_STRUCT
|
|
9
|
+
} from "../../../shader/chunk/spherical_harmonics/l1i/chunk_convert_to_irradiance_sh.js";
|
|
6
10
|
import {
|
|
7
11
|
chunk_resolve_irradiance_sh_to_specular
|
|
8
12
|
} from "../../../shader/chunk/spherical_harmonics/l1i/chunk_resolve_irradiance_sh_to_specular.js";
|
|
9
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
chunk_texture_octahedral_skirt_uv
|
|
15
|
+
} from "../../../shader/chunk/texture/octahedral/chunk_texture_octahedral_skirt_uv.js";
|
|
10
16
|
import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
|
|
11
17
|
import {
|
|
12
18
|
PROBE_LEVELS_RESOURCE,
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.d.ts
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
* for want's pixels and the hits' wants alike.
|
|
4
4
|
*
|
|
5
5
|
* ```wgsl
|
|
6
|
-
* fn probe_clipmap_want(wants: bool, position: vec3<f32>, bias_direction: vec3<f32>, cascade_count: u32, resolution: u32,
|
|
6
|
+
* fn probe_clipmap_want(wants: bool, position: vec3<f32>, bias_direction: vec3<f32>, cascade_count: u32, resolution: u32, wanted_capacity: u32)
|
|
7
7
|
* ```
|
|
8
8
|
*
|
|
9
9
|
* The cages are the pick's: the finest cascade whose cage window holds the point, the cage of the point
|
|
10
10
|
* biased along `bias_direction` by that cascade's spacing, and in the cascade's blend skirt the next
|
|
11
11
|
* cascade's cage too, biased by its own. A cage a bias moved out of its window is not wanted. Each cage
|
|
12
|
-
* point's bit is set, and a point whose bit was clear goes on the wanted list
|
|
13
|
-
*
|
|
12
|
+
* point's bit is set, and a point whose bit was clear goes on the wanted list by its key, so the list
|
|
13
|
+
* holds every point wanted this frame once.
|
|
14
14
|
*
|
|
15
15
|
* A workgroup's lanes want a few cages between them, so the first lane to want a cage claims it in the
|
|
16
16
|
* workgroup's table and sets its bits; the rest want it through that lane. Measured on the AMD iGPU at
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.js
CHANGED
|
@@ -29,14 +29,14 @@ const WANT_CLAIM_PROBES = 16;
|
|
|
29
29
|
* for want's pixels and the hits' wants alike.
|
|
30
30
|
*
|
|
31
31
|
* ```wgsl
|
|
32
|
-
* fn probe_clipmap_want(wants: bool, position: vec3<f32>, bias_direction: vec3<f32>, cascade_count: u32, resolution: u32,
|
|
32
|
+
* fn probe_clipmap_want(wants: bool, position: vec3<f32>, bias_direction: vec3<f32>, cascade_count: u32, resolution: u32, wanted_capacity: u32)
|
|
33
33
|
* ```
|
|
34
34
|
*
|
|
35
35
|
* The cages are the pick's: the finest cascade whose cage window holds the point, the cage of the point
|
|
36
36
|
* biased along `bias_direction` by that cascade's spacing, and in the cascade's blend skirt the next
|
|
37
37
|
* cascade's cage too, biased by its own. A cage a bias moved out of its window is not wanted. Each cage
|
|
38
|
-
* point's bit is set, and a point whose bit was clear goes on the wanted list
|
|
39
|
-
*
|
|
38
|
+
* point's bit is set, and a point whose bit was clear goes on the wanted list by its key, so the list
|
|
39
|
+
* holds every point wanted this frame once.
|
|
40
40
|
*
|
|
41
41
|
* A workgroup's lanes want a few cages between them, so the first lane to want a cage claims it in the
|
|
42
42
|
* workgroup's table and sets its bits; the rest want it through that lane. Measured on the AMD iGPU at
|
|
@@ -80,7 +80,7 @@ fn probe_want_claim(key: u32) -> bool {
|
|
|
80
80
|
return true;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
fn probe_clipmap_want(wants: bool, position: vec3<f32>, bias_direction: vec3<f32>, cascade_count: u32, resolution: u32,
|
|
83
|
+
fn probe_clipmap_want(wants: bool, position: vec3<f32>, bias_direction: vec3<f32>, cascade_count: u32, resolution: u32, wanted_capacity: u32) {
|
|
84
84
|
let selection = clipmap_select_finest(&probe_levels, cascade_count, position, PROBE_BLEND_SKIRT);
|
|
85
85
|
|
|
86
86
|
let held = wants && selection.level != CLIPMAP_LEVEL_NONE;
|
|
@@ -117,7 +117,7 @@ fn probe_clipmap_want(wants: bool, position: vec3<f32>, bias_direction: vec3<f32
|
|
|
117
117
|
first = (atomicOr(&probe_wanted_bits[key >> 5u], bit) & bit) == 0u;
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
collection_u32_append(&probe_wanted, first, key
|
|
120
|
+
collection_u32_append(&probe_wanted, first, key, wanted_capacity);
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
`, [
|
|
@@ -20,13 +20,12 @@ export const PROBE_ACCUMULATE_SETTINGS: WebGPUStruct;
|
|
|
20
20
|
* - **Radiance**: the mean of the texel's resolved rays, a back face's being zero, is a sample of the
|
|
21
21
|
* texel's multi-scale mean (`chunk_multiscale_mean`), its estimator in `probe_estimators` and its mean
|
|
22
22
|
* in the atlas.
|
|
23
|
-
* -
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* rather than the probe keeps β right where an update covers a subset.
|
|
23
|
+
* - The short mean blends by β = max(1/(a+1), `PROBE_SHORT_BLEND`), its variance by max(1/(a+1),
|
|
24
|
+
* `PROBE_VARIANCE_BLEND`), a the texel's own count of the updates that reached it, held in its alpha.
|
|
25
|
+
* A sample's blend is a sample's however long since the last one: a probe nobody wanted, or a texel the
|
|
26
|
+
* guide passes over, takes no more of its next sample for the wait. A change in the light is the
|
|
27
|
+
* estimator's to find. Counting a texel rather than the probe keeps β right where an update covers a
|
|
28
|
+
* subset.
|
|
30
29
|
* - The mean blends by at least 1/(a+1) until the count reaches its limit: a young texel is its running
|
|
31
30
|
* mean, which the estimator's blend reduction, nothing at its seed, would otherwise hold back. Past it
|
|
32
31
|
* the estimator alone, down to 1/8192 an update on a noisy texel.
|
|
@@ -35,20 +34,17 @@ export const PROBE_ACCUMULATE_SETTINGS: WebGPUStruct;
|
|
|
35
34
|
* - A texel's first sample seeds both means. A texel no ray reached keeps its history.
|
|
36
35
|
* - Where the frame re-samples (`PROBE_CLIPMAP_RESAMPLING`), the sample pools the rays with the texel's
|
|
37
36
|
* re-samples of the probe's neighbours (`shader_probe_clipmap_resample`), each a ray's worth at a
|
|
38
|
-
* visibility of one (`chunk_probe_clipmap_resampled`). Only a texel some ray reached takes them
|
|
39
|
-
* time terms are a sampled texel's.
|
|
37
|
+
* visibility of one (`chunk_probe_clipmap_resampled`). Only a texel some ray reached takes them.
|
|
40
38
|
* - **Depth**: the moments (d, d²) of the rays landing in the texel, in spacings: a miss the limit, a
|
|
41
39
|
* back face 0.2·t (DDGI 2021's shortening), a hit t, every sample held to the limit, the farthest a
|
|
42
40
|
* cage tests a relocated probe, (1 + 0.45)·√3 (`PROBE_DEPTH_LIMIT`, D9). On a uniform update the
|
|
43
|
-
* sample is the plain mean, blended by the probe's α = max(1/(n+1),
|
|
41
|
+
* sample is the plain mean, blended by the probe's α = max(1/(n+1), `PROBE_SHORT_BLEND`), n its updates. At
|
|
44
42
|
* most 64 rays a texel, which the settings hold R to (R ≤ 64·n_d²).
|
|
45
43
|
* - On a guided update the sample is a mean of means: each radiance texel inside the depth texel gives
|
|
46
44
|
* its own mean, since the guide gives the brighter ones more rays, at most 64/f² of its rays,
|
|
47
45
|
* evenly strided. It is taken only when every one of them took rays. The guide gives a dark one,
|
|
48
46
|
* a back face's or a shadowed wall's, none, and the lit ones' depths are not the whole texel's: its
|
|
49
47
|
* depth comes from the uniform updates.
|
|
50
|
-
* - The time term's period is one over the share of updates that reach the depth texel, a uniform
|
|
51
|
-
* update counting as reaching every one, a guided one as often as its least reached radiance texel.
|
|
52
48
|
* - **A new probe's history is another probe's**, its slot's last owner: on its first update a texel
|
|
53
49
|
* no ray reached is cleared, radiance to nothing seen, depth to the moments of a miss.
|
|
54
50
|
* - **Stored rounded stochastically** onto halves (`f16_round_stochastic`), with noise fresh for each
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader_probe_clipmap_accumulate.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shader_probe_clipmap_accumulate.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.js"],"names":[],"mappings":"AA8CA;;GAEG;AACH,wCAFU,YAAY,CAmBQ;AAoB9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,8CAFU,aAAa,CA0TpB;6BApb0B,sCAAsC;8BAHrC,kCAAkC"}
|