@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":"GPUWaterRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/water/GPUWaterRenderer.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GPUWaterRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/water/GPUWaterRenderer.js"],"names":[],"mappings":"AAsBA,sFAAsF;AACtF;IACI,WAAa;IACb,mBAAe;IACf,yBAAqB;IACrB,aAAS;IACT,WAAa;IACb;;;;;;;;;;;MAE6B;IAmB7B;;;OAGG;IACH;;;;;MAA8F;IAC9F;;;OAGG;IACH,wBAAyD;IAMzD,oCAIC;IAED,8FAA8F;IAC9F,qCAgBC;IAED,gBASC;IAuDD;;;;;;;;;;;;;;;;;MAyIC;IAQD;;;;;YAMC;IAED;;;;;;;;;;MAOC;IAED;;;;;;;;;;;;;;MAwBC;IAED,gGAAgG;IAChG,mEAYC;;CAyBJ;gCAvX+B,uCAAuC"}
|
|
@@ -18,6 +18,7 @@ import { create_water_finalize_pipeline, create_water_pipeline, WATER_FINALIZE_R
|
|
|
18
18
|
import { WATER_BAND_SAMPLER } from "./surface/GPUWaterSurface.js";
|
|
19
19
|
import { shader_water_background_copy, shader_water_debug, shader_water_draw,
|
|
20
20
|
shader_water_occupancy, shader_water_splat } from "./shader_water_avboit.js";
|
|
21
|
+
import { ceilPowerOfTwo } from "../../../core/binary/operations/ceilPowerOfTwo.js";
|
|
21
22
|
|
|
22
23
|
/** Production water channel. Only AVBOIT's shared resolve composites its radiance. */
|
|
23
24
|
export class GPUWaterRenderer {
|
|
@@ -118,7 +119,7 @@ export class GPUWaterRenderer {
|
|
|
118
119
|
// statistics words: candidates, interior, boundary, flat triangles (sized by the scene, not grown), patches
|
|
119
120
|
const keys = { candidates: 0, interior: 1, boundary: 2, patches: 4 };
|
|
120
121
|
for (const [key, i] of Object.entries(keys)) {
|
|
121
|
-
if (totals[i] > budgets[key]) { budgets[key] =
|
|
122
|
+
if (totals[i] > budgets[key]) { budgets[key] = ceilPowerOfTwo(Math.ceil(totals[i] * 1.25)); }
|
|
122
123
|
}
|
|
123
124
|
}
|
|
124
125
|
|
|
@@ -24,7 +24,7 @@ export class GPUWaterQueries {
|
|
|
24
24
|
* @param {PipelineEnquiry} enquiry
|
|
25
25
|
*/
|
|
26
26
|
static enquirePipelines(enquiry: PipelineEnquiry): void;
|
|
27
|
-
static "__#
|
|
27
|
+
static "__#277@#execute"(pass: any, resources: any, context: any): void;
|
|
28
28
|
/**
|
|
29
29
|
* @param {object} options
|
|
30
30
|
* @param {GPUDevice} options.device
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader_water_lod.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/water/surface/lod/shader_water_lod.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shader_water_lod.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/water/surface/lod/shader_water_lod.js"],"names":[],"mappings":"AA6BA,sHAAsH;AACtH,4CAA6C;AAC7C,6CAA8C;AAC9C,4CAA6C;AAC7C,sFAAsF;AACtF,iDAAkD;AAClD,iDAAkD;AAClD,kFAAkF;AAClF,8CAA+C;AAC/C,oFAAoF;AACpF,qCAAsC;AAEtC;;;;GAIG;AACH,kDASK;AAEL,kHAAkH;AAClH,0CAA2C;AAC3C,0EAA0E;AAC1E,+CAA+E;AAE/E,yGAAyG;AACzG,wCAAyC;AAEzC,wEAAwE;AACxE;;;;;GAA+F;AAE/F;;;;GAIG;AACH,sDAEwB;AAExB;;;;GAIG;AACH,mDAE4B;AAE5B;;;GAGG;AACH,2CAA4C;AA0I5C;;;;;;GAMG;AACH,oDAuD0E;AAsD1E;;;;;GAKG;AACH,uDAkCsH;AAWtH;;;GAGG;AACH,mDAYoE;AAIpE,kFAAkF;AAClF,+CAAgD;AAiBhD;;;;;;;GAOG;AACH,wDAqF0C;AAiB1C;;;;;;;GAOG;AACH,mDAqEmF;AAInF,oEAAoE;AACpE;IACI,6EAA6E;;IAE7E,oCAAoC;;IAEpC,0EAA0E;;IAE1E,qCAAqC;;IAErC,oDAAoD;;IAEpD,iCAAiC;;GAElC;AACH,0CAA2C;AA2B3C;;;GAGG;AACH,+DAc0D;AAS1D,mHAAmH;AACnH,2DA4BqF;6BA5rBxD,sCAAsC;AAuFnE,+CAIgD;8BAzGlB,kCAAkC;AA4GhE,kDAgG6G;AAkF7G,8FAA8F;AAC9F,+CAmCsH;0BAjU5F,uCAAuC"}
|
|
@@ -3,9 +3,7 @@ import { GEOMETRY_METADATA_STRUCT } from "../../../geometry/GEOMETRY_METADATA_ST
|
|
|
3
3
|
import { GEOMETRY_MESHLET_TRIANGLE_LIMIT } from "../../../geometry/meshlet/GEOMETRY_MESHLET_TRIANGLE_LIMIT.js";
|
|
4
4
|
import { MESHLET_METADATA_STRUCT } from "../../../geometry/meshlet/encoding/MESHLET_METADATA_STRUCT.js";
|
|
5
5
|
import { COLLECTION_U32_STRUCT_READ } from "../../../gpu_primitive/COLLECTION_U32_STRUCT_READ.js";
|
|
6
|
-
import {
|
|
7
|
-
WEBGPU_GUARANTEED_MAX_COMPUTE_WORKGROUPS_PER_DIMENSION
|
|
8
|
-
} from "../../../gpu_primitive/indirect/WEBGPU_GUARANTEED_MAX_COMPUTE_WORKGROUPS_PER_DIMENSION.js";
|
|
6
|
+
import { chunk_folded_dispatch } from "../../../gpu_primitive/indirect/chunk_folded_dispatch.js";
|
|
9
7
|
import { MESHLET_COLLECTION_STRUCT } from "../../../rasterize/MESHLET_COLLECTION_STRUCT.js";
|
|
10
8
|
import { chunk_scene_database_access } from "../../../scene/chunk_scene_database_access.js";
|
|
11
9
|
import { ComputeShader } from "../../../shader/ComputeShader.js";
|
|
@@ -17,6 +15,7 @@ import { chunk_mat3_inverse } from "../../../shader/chunk/geometry/mat3/chunk_ma
|
|
|
17
15
|
import { chunk_mat4_linear_determinant } from "../../../shader/chunk/geometry/mat4/chunk_mat4_linear_determinant.js";
|
|
18
16
|
import { chunk_read_meshlet_vertex_by_draw_index } from "../../../shader/chunk/geometry/meshlet/chunk_read_meshlet_vertex_by_draw_index.js";
|
|
19
17
|
import { chunk_folded_workgroup_index } from "../../../shader/chunk/grid/chunk_folded_workgroup_index.js";
|
|
18
|
+
import { chunk_divide_round_up_u32 } from "../../../shader/chunk/math/chunk_divide_round_up_u32.js";
|
|
20
19
|
import { chunk_lower_bound_branchless } from "../../../shader/chunk/math/chunk_lower_bound_branchless.js";
|
|
21
20
|
import { ShaderResourceSetDescriptor } from "../../../shader/resource/ShaderResourceSetDescriptor.js";
|
|
22
21
|
import { atomic_u32, f32, u32, vec2i } from "../../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
|
|
@@ -642,11 +641,10 @@ export const WATER_LOD_COMMAND_BYTES = 160;
|
|
|
642
641
|
|
|
643
642
|
const fold = `
|
|
644
643
|
fn water_lod_dispatch(at: u32, groups: u32) {
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
commands[at] =
|
|
648
|
-
commands[at +
|
|
649
|
-
commands[at + 2u] = max((rows + LIMIT - 1u) / LIMIT, 1u);
|
|
644
|
+
let folded = folded_dispatch(groups);
|
|
645
|
+
commands[at] = folded.x;
|
|
646
|
+
commands[at + 1u] = folded.y;
|
|
647
|
+
commands[at + 2u] = folded.z;
|
|
650
648
|
}
|
|
651
649
|
fn water_lod_total(sums_count: u32, last: u32) -> u32 { return select(0u, last, sums_count > 0u); }
|
|
652
650
|
fn water_lod_draw(list: u32, count: u32, vertices: u32, first: u32) {
|
|
@@ -679,12 +677,12 @@ fn main() {
|
|
|
679
677
|
let flats = water_lod_total(flat_sums.count, flat_sums.elements[max(flat_sums.count, 1u) - 1u]);
|
|
680
678
|
statistics[0] = total;
|
|
681
679
|
statistics[3] = flats;
|
|
682
|
-
water_lod_dispatch(${WaterLodCommand.Candidates / 4}u, (min(total, limits.candidates)
|
|
680
|
+
water_lod_dispatch(${WaterLodCommand.Candidates / 4}u, divide_round_up_u32(min(total, limits.candidates), 64u));
|
|
683
681
|
let drawn = min(flats, limits.triangles);
|
|
684
|
-
water_lod_dispatch(${WaterLodCommand.Flats / 4}u, (drawn
|
|
682
|
+
water_lod_dispatch(${WaterLodCommand.Flats / 4}u, divide_round_up_u32(drawn, 64u));
|
|
685
683
|
water_lod_draw(${WaterLodList.Triangle}u, drawn, ${WATER_LOD_TRIANGLE_VERTICES}u, ${WATER_LOD_TRIANGLE_FIRST_VERTEX}u);
|
|
686
684
|
}
|
|
687
|
-
|
|
685
|
+
`, [chunk_folded_dispatch, chunk_divide_round_up_u32]) });
|
|
688
686
|
|
|
689
687
|
const draw_command_resources = new ShaderResourceSetDescriptor();
|
|
690
688
|
draw_command_resources.createGroup()
|
|
@@ -700,7 +698,7 @@ ${fold}
|
|
|
700
698
|
fn water_lod_list(list: u32, total: u32, budget: u32, vertices: u32, first: u32) {
|
|
701
699
|
statistics[1u + list] = total;
|
|
702
700
|
let count = min(total, budget);
|
|
703
|
-
water_lod_dispatch(${WaterLodCommand.Cells / 4}u + 4u * list, (count
|
|
701
|
+
water_lod_dispatch(${WaterLodCommand.Cells / 4}u + 4u * list, divide_round_up_u32(count, 64u));
|
|
704
702
|
water_lod_draw(list, count, vertices, first);
|
|
705
703
|
}
|
|
706
704
|
|
|
@@ -714,7 +712,7 @@ fn main() {
|
|
|
714
712
|
let patches = water_lod_list_span(&sums.elements, sums.count, 2u).y;
|
|
715
713
|
statistics[4] = patches;
|
|
716
714
|
let count = min(patches, limits.patches);
|
|
717
|
-
water_lod_dispatch(${WaterLodCommand.PatchCells / 4}u, (count
|
|
715
|
+
water_lod_dispatch(${WaterLodCommand.PatchCells / 4}u, divide_round_up_u32(count, 64u));
|
|
718
716
|
let draw = ${WaterLodCommand.PatchDraw / 4}u;
|
|
719
717
|
commands[draw] = ${WATER_LOD_PATCH_INDICES.length}u;
|
|
720
718
|
commands[draw + 1u] = count;
|
|
@@ -722,6 +720,6 @@ fn main() {
|
|
|
722
720
|
commands[draw + 3u] = ${WATER_LOD_PATCH_FIRST_VERTEX}u;
|
|
723
721
|
commands[draw + 4u] = 0u;
|
|
724
722
|
}
|
|
725
|
-
`, [chunk_water_lod_list_sums]) });
|
|
723
|
+
`, [chunk_water_lod_list_sums, chunk_folded_dispatch, chunk_divide_round_up_u32]) });
|
|
726
724
|
|
|
727
725
|
export { chunk_water_lod_candidate, chunk_water_lod_source };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GPUWaterParticles.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/water/surface/particles/GPUWaterParticles.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GPUWaterParticles.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/water/surface/particles/GPUWaterParticles.js"],"names":[],"mappings":"AAmCA,kHAAkH;AAClH,+CAAgD;AAEhD;;;;GAIG;AACH;IAwBI,uFAAuF;IACvF,yBAAuC;IACvC,kGAAkG;IAClG,yBAAuC;IACvC,uGAAuG;IACvG,6BAA+C;IAC/C,mEAAmE;IACnE,2BAAyD;IACzD,uBAAyC;IAEzC;;;;;;;;;;;OAWG;IACH,qCALW,MAAM,QACN,MAAM,UACK,OAAO,8CAA8C,EAAE,sBAAsB,KAAE,IAAI,GAAC,IAAI,CA4D7G;IAED,gBAeC;IAED;;;;;;;;;;;;;;;OAeG;IACH;QATyG,KAAK,EAAnG,OAAO,iEAAiE,EAAE,UAAU;QACpE,KAAK,EAArB,MAAM;QACa,KAAK;QACL,QAAQ;QACR,SAAS;QACT,QAAQ;QACX,YAAY,EAA5B,MAAM;QACU,EAAE,EAAlB,MAAM;aA8FhB;;CACJ"}
|
|
@@ -31,18 +31,11 @@ import {
|
|
|
31
31
|
WATER_PARTICLE_CROWD_WORDS,
|
|
32
32
|
WATER_PARTICLE_NEST_WORDS
|
|
33
33
|
} from "./shader_water_particles.js";
|
|
34
|
+
import { ceilPowerOfTwo } from "../../../../../core/binary/operations/ceilPowerOfTwo.js";
|
|
34
35
|
|
|
35
36
|
/** The longest step a particle takes in one frame, seconds: a stalled tab does not fling fronts across a lake. */
|
|
36
37
|
export const WATER_PARTICLE_STEP_LIMIT = 1 / 15;
|
|
37
38
|
|
|
38
|
-
/**
|
|
39
|
-
* @param {number} value
|
|
40
|
-
* @returns {number} the smallest power of two at least value
|
|
41
|
-
*/
|
|
42
|
-
function power_of_two_at_least(value) {
|
|
43
|
-
return 2 ** Math.ceil(Math.log2(Math.max(value, 1)));
|
|
44
|
-
}
|
|
45
|
-
|
|
46
39
|
/**
|
|
47
40
|
* The wave particles of every water body of a scene, on the device (WATER_SURFACE_SIMULATION_PLAN_2026_10_06.md
|
|
48
41
|
* §5.4): ping-pong particle arrays, and each frame's hash of them for the surface sampler. Counts never leave
|
|
@@ -101,7 +94,7 @@ export class GPUWaterParticles {
|
|
|
101
94
|
this.dispose();
|
|
102
95
|
this.#device = device;
|
|
103
96
|
this.#capacity = capacity;
|
|
104
|
-
this.#table_limit =
|
|
97
|
+
this.#table_limit = ceilPowerOfTwo(2 * WATER_PARTICLE_CORNERS * capacity);
|
|
105
98
|
const buffer = (label, size, usage = 0) => device.createBuffer({ label: `Water / particles ${label}`,
|
|
106
99
|
size: Math.max(16, size), usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST | GPUBufferUsage.COPY_SRC | usage });
|
|
107
100
|
const array_size = 16 + capacity * WATER_PARTICLE_STRUCT.size;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_water_particle.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/water/surface/particles/chunk_water_particle.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chunk_water_particle.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/water/surface/particles/chunk_water_particle.js"],"names":[],"mappings":"AAMA;;;GAGG;AACH,uCAAwC;AAKxC,yHAAyH;AACzH,gDAAkD;AAElD;;;;;;;;;;;;GAYG;AACH,8CAIE;AAKF,+GAA+G;AAC/G,oDAAqD;AAErD,qHAAqH;AACrH,uDAAwD;AAExD,wEAAwE;AACxE,qDAAsD;AAEtD,wFAAwF;AACxF,yCAA2G;AAE3G;;;;;;;;;;;;;;;;;;;GAmBG;AACH,mCAFU,SAAS,CAgP6G;0BAtTtG,uCAAuC"}
|
|
@@ -2,6 +2,7 @@ import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
|
|
|
2
2
|
import { chunk_pcg3d } from "../../../shader/chunk/random/pcg/chunk_pcg3d.js";
|
|
3
3
|
import { WATER_PARTICLE_ENTRY_STRUCT, WATER_PARTICLE_STRUCT } from "./WATER_PARTICLE_STRUCT.js";
|
|
4
4
|
import { chunk_water_spectrum } from "../spectrum/chunk_water_spectrum.js";
|
|
5
|
+
import { ceil_log2 } from "../../../../../core/binary/operations/ceil_log2.js";
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Levels of the particle hash: cell sizes 4 mm · 2^level, so supports up to 256 m, which a 2 m splash's stretched
|
|
@@ -10,7 +11,7 @@ import { chunk_water_spectrum } from "../spectrum/chunk_water_spectrum.js";
|
|
|
10
11
|
export const WATER_PARTICLE_LEVELS = 18;
|
|
11
12
|
|
|
12
13
|
/** Bits of a hash key that hold the level, below the body's row. */
|
|
13
|
-
const WATER_PARTICLE_LEVEL_BITS =
|
|
14
|
+
const WATER_PARTICLE_LEVEL_BITS = ceil_log2(WATER_PARTICLE_LEVELS);
|
|
14
15
|
|
|
15
16
|
/** Cell size of level 0, metres. A particle sits at the smallest level whose cell is at least its support's diameter. */
|
|
16
17
|
export const WATER_PARTICLE_LEVEL0_CELL = 1 / 256;
|
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
* a reader takes it through the atmosphere identity (`chunk_wind_field_sample`).
|
|
9
9
|
*/
|
|
10
10
|
/**
|
|
11
|
-
* Cascades the field holds at most: the
|
|
11
|
+
* Cascades the field holds at most: the rows of its windows and its read records, which sit in
|
|
12
|
+
* {@link WIND_FIELD_STRUCT}, the one uniform every reader binds and the host writes whole each frame.
|
|
13
|
+
* The wind's own figure, not the shared clipmap table's, which is a uniform of its own.
|
|
12
14
|
* @type {number}
|
|
13
15
|
*/
|
|
14
16
|
export const WIND_FIELD_CASCADE_LIMIT: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WIND_FIELD.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/wind/WIND_FIELD.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WIND_FIELD.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/wind/WIND_FIELD.js"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH;;;;;GAKG;AACH,uCAFU,MAAM,CAE2B;AAE3C;;;;;;;;;;;;GAYG;AACH,sDAAoD;AAEpD;;;;GAIG;AACH,qCAFU,MAAM,CAEwB;AAExC;;;;;;;;;;GAUG;AACH,oCAFU,MAAM,CAEuB;AAEvC;;;;GAIG;AACH,4CAFU,OAAO,+CAA+C,EAAE,iBAAiB,CAEf"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { CLIPMAP_LEVEL_LIMIT } from "../shader/chunk/clipmap/CLIPMAP_LEVEL_STRUCT.js";
|
|
2
1
|
import { SAMPLER_LINEAR_UPSCALE } from "../texture/SAMPLER_LINEAR_UPSCALE.js";
|
|
3
2
|
|
|
4
3
|
/**
|
|
@@ -12,10 +11,12 @@ import { SAMPLER_LINEAR_UPSCALE } from "../texture/SAMPLER_LINEAR_UPSCALE.js";
|
|
|
12
11
|
*/
|
|
13
12
|
|
|
14
13
|
/**
|
|
15
|
-
* Cascades the field holds at most: the
|
|
14
|
+
* Cascades the field holds at most: the rows of its windows and its read records, which sit in
|
|
15
|
+
* {@link WIND_FIELD_STRUCT}, the one uniform every reader binds and the host writes whole each frame.
|
|
16
|
+
* The wind's own figure, not the shared clipmap table's, which is a uniform of its own.
|
|
16
17
|
* @type {number}
|
|
17
18
|
*/
|
|
18
|
-
export const WIND_FIELD_CASCADE_LIMIT =
|
|
19
|
+
export const WIND_FIELD_CASCADE_LIMIT = 16;
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
22
|
* A tile's texel format.
|
|
@@ -5,6 +5,12 @@
|
|
|
5
5
|
* @type {WebGPUStruct}
|
|
6
6
|
*/
|
|
7
7
|
export const WIND_CASCADE_STRUCT: WebGPUStruct;
|
|
8
|
+
/**
|
|
9
|
+
* The cascades' windows, finest first, as a field of {@link WIND_FIELD_STRUCT}: clipmap levels, walked
|
|
10
|
+
* with `clipmap_level_select`.
|
|
11
|
+
* @type {WebGPUArray}
|
|
12
|
+
*/
|
|
13
|
+
export const WIND_LEVEL_ARRAY: WebGPUArray;
|
|
8
14
|
/**
|
|
9
15
|
* The cascades' read records, finest first, as a field of {@link WIND_FIELD_STRUCT}.
|
|
10
16
|
* @type {WebGPUArray}
|
|
@@ -17,8 +23,8 @@ export const WIND_CASCADE_ARRAY: WebGPUArray;
|
|
|
17
23
|
* Cascade `c` (finest first, below `cascade_count`) is two rows at index `c`:
|
|
18
24
|
* - `levels[c]`: its window as a clipmap level (`CLIPMAP_LEVEL_STRUCT`) — the world cell at
|
|
19
25
|
* window-local 0 (`corner`, in the cascade's cells), the cell's edge in metres (`cell_size`), and
|
|
20
|
-
* the window's cells on each axis (`size`). A world corner is `corner · cell_size`.
|
|
21
|
-
* the shared clipmap module's, so `
|
|
26
|
+
* the window's cells on each axis (`size`). A world corner is `corner · cell_size`. Its rows are
|
|
27
|
+
* the shared clipmap module's, so `clipmap_level_select` tests each as it is;
|
|
22
28
|
* - `cascades[c]`: its tile and its decay ({@link WIND_CASCADE_STRUCT}).
|
|
23
29
|
*
|
|
24
30
|
* Rows at and past `cascade_count` are never read.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WIND_FIELD_STRUCT.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/wind/WIND_FIELD_STRUCT.js"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,kCAFU,YAAY,CAgBJ;AAElB;;;GAGG;AACH,iCAFU,WAAW,CAE6E;AAElG;;;;;;;;;;;;;;;;;;;GAmBG;AACH,gCAFU,YAAY,CAQN;
|
|
1
|
+
{"version":3,"file":"WIND_FIELD_STRUCT.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/wind/WIND_FIELD_STRUCT.js"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,kCAFU,YAAY,CAgBJ;AAElB;;;;GAIG;AACH,+BAFU,WAAW,CAE4E;AAEjG;;;GAGG;AACH,iCAFU,WAAW,CAE6E;AAElG;;;;;;;;;;;;;;;;;;;GAmBG;AACH,gCAFU,YAAY,CAQN;6BAhEa,gCAAgC;4BADjC,+BAA+B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CLIPMAP_LEVEL_STRUCT } from "../shader/chunk/clipmap/CLIPMAP_LEVEL_STRUCT.js";
|
|
2
2
|
import { f32, u32, vec3f } from "../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
|
|
3
3
|
import { WebGPUArray } from "../shader/type/WebGPUArray.js";
|
|
4
4
|
import { WebGPUStruct } from "../shader/type/WebGPUStruct.js";
|
|
@@ -26,6 +26,13 @@ export const WIND_CASCADE_STRUCT = WebGPUStruct.from({
|
|
|
26
26
|
decay: f32,
|
|
27
27
|
}, "WindCascade");
|
|
28
28
|
|
|
29
|
+
/**
|
|
30
|
+
* The cascades' windows, finest first, as a field of {@link WIND_FIELD_STRUCT}: clipmap levels, walked
|
|
31
|
+
* with `clipmap_level_select`.
|
|
32
|
+
* @type {WebGPUArray}
|
|
33
|
+
*/
|
|
34
|
+
export const WIND_LEVEL_ARRAY = WebGPUArray.from(CLIPMAP_LEVEL_STRUCT, WIND_FIELD_CASCADE_LIMIT);
|
|
35
|
+
|
|
29
36
|
/**
|
|
30
37
|
* The cascades' read records, finest first, as a field of {@link WIND_FIELD_STRUCT}.
|
|
31
38
|
* @type {WebGPUArray}
|
|
@@ -39,8 +46,8 @@ export const WIND_CASCADE_ARRAY = WebGPUArray.from(WIND_CASCADE_STRUCT, WIND_FIE
|
|
|
39
46
|
* Cascade `c` (finest first, below `cascade_count`) is two rows at index `c`:
|
|
40
47
|
* - `levels[c]`: its window as a clipmap level (`CLIPMAP_LEVEL_STRUCT`) — the world cell at
|
|
41
48
|
* window-local 0 (`corner`, in the cascade's cells), the cell's edge in metres (`cell_size`), and
|
|
42
|
-
* the window's cells on each axis (`size`). A world corner is `corner · cell_size`.
|
|
43
|
-
* the shared clipmap module's, so `
|
|
49
|
+
* the window's cells on each axis (`size`). A world corner is `corner · cell_size`. Its rows are
|
|
50
|
+
* the shared clipmap module's, so `clipmap_level_select` tests each as it is;
|
|
44
51
|
* - `cascades[c]`: its tile and its decay ({@link WIND_CASCADE_STRUCT}).
|
|
45
52
|
*
|
|
46
53
|
* Rows at and past `cascade_count` are never read.
|
|
@@ -53,7 +60,7 @@ export const WIND_CASCADE_ARRAY = WebGPUArray.from(WIND_CASCADE_STRUCT, WIND_FIE
|
|
|
53
60
|
* @type {WebGPUStruct}
|
|
54
61
|
*/
|
|
55
62
|
export const WIND_FIELD_STRUCT = WebGPUStruct.from({
|
|
56
|
-
levels:
|
|
63
|
+
levels: WIND_LEVEL_ARRAY,
|
|
57
64
|
cascades: WIND_CASCADE_ARRAY,
|
|
58
65
|
far_velocity: vec3f,
|
|
59
66
|
cascade_count: u32,
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* {@link wind_field_add_resources} declares them.
|
|
8
8
|
*
|
|
9
9
|
* **The read:**
|
|
10
|
-
* -
|
|
11
|
-
* answers, with how far into its edge band of {@link WIND_FIELD_BAND_WIDTH} cells the point is;
|
|
10
|
+
* - the cascades' windows are walked finest first, each by `clipmap_level_select`, and the first holding
|
|
11
|
+
* the point answers, with how far into its edge band of {@link WIND_FIELD_BAND_WIDTH} cells the point is;
|
|
12
12
|
* - a cascade's read is the atmosphere identity, `v_far(t) + tap · k_c`: one trilinear tap of its tile,
|
|
13
13
|
* which holds `v − v_far(t_s,c)` at cell centres, times its decay;
|
|
14
14
|
* - in the band, a second read blends in linearly, all of it on the window's face: the parent's
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_wind_field_sample_cascades.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/wind/chunk_wind_field_sample_cascades.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,+CAFU,SAAS,
|
|
1
|
+
{"version":3,"file":"chunk_wind_field_sample_cascades.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/wind/chunk_wind_field_sample_cascades.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,+CAFU,SAAS,CA4DjB;0BAnGwB,iCAAiC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { chunk_clipmap_select_finest } from "../shader/chunk/clipmap/chunk_clipmap_select_finest.js";
|
|
2
2
|
import { CodeChunk } from "../shader/compiler/CodeChunk.js";
|
|
3
|
-
import { WIND_FIELD_BAND_WIDTH } from "./WIND_FIELD.js";
|
|
3
|
+
import { WIND_FIELD_BAND_WIDTH, WIND_FIELD_CASCADE_LIMIT } from "./WIND_FIELD.js";
|
|
4
4
|
import { WIND_FIELD_STRUCT } from "./WIND_FIELD_STRUCT.js";
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -12,8 +12,8 @@ import { WIND_FIELD_STRUCT } from "./WIND_FIELD_STRUCT.js";
|
|
|
12
12
|
* {@link wind_field_add_resources} declares them.
|
|
13
13
|
*
|
|
14
14
|
* **The read:**
|
|
15
|
-
* -
|
|
16
|
-
* answers, with how far into its edge band of {@link WIND_FIELD_BAND_WIDTH} cells the point is;
|
|
15
|
+
* - the cascades' windows are walked finest first, each by `clipmap_level_select`, and the first holding
|
|
16
|
+
* the point answers, with how far into its edge band of {@link WIND_FIELD_BAND_WIDTH} cells the point is;
|
|
17
17
|
* - a cascade's read is the atmosphere identity, `v_far(t) + tap · k_c`: one trilinear tap of its tile,
|
|
18
18
|
* which holds `v − v_far(t_s,c)` at cell centres, times its decay;
|
|
19
19
|
* - in the band, a second read blends in linearly, all of it on the window's face: the parent's
|
|
@@ -62,7 +62,16 @@ fn wind_field_cascade_read(c: u32, position_ws: vec3<f32>) -> vec3<f32> {
|
|
|
62
62
|
fn wind_field_sample(position_ws: vec3<f32>) -> vec3<f32> {
|
|
63
63
|
let count = wind_field.cascade_count;
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
var selection = ClipmapSelection(CLIPMAP_LEVEL_NONE, 0.0);
|
|
66
|
+
|
|
67
|
+
for (var i = 0u; i < min(count, ${WIND_FIELD_CASCADE_LIMIT}u); i++) {
|
|
68
|
+
let weight = clipmap_level_select(wind_field.levels[i], position_ws, WIND_FIELD_BAND_WIDTH);
|
|
69
|
+
|
|
70
|
+
if (weight >= 0.0) {
|
|
71
|
+
selection = ClipmapSelection(i, weight);
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
66
75
|
|
|
67
76
|
if (selection.level == CLIPMAP_LEVEL_NONE) {
|
|
68
77
|
return wind_field.far_velocity;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"texture_mip_extent.d.ts","sourceRoot":"","sources":["../../../../src/shade/util/texture_mip_extent.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"texture_mip_extent.d.ts","sourceRoot":"","sources":["../../../../src/shade/util/texture_mip_extent.js"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,uCAJW,MAAM,SACN,MAAM,GACJ,MAAM,CAIlB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,0CARW,MAAM,UACN,MAAM,mBACN,MAAM,aACN,sBAAoB,MAAM,SAC1B,MAAM,GACJ,MAAM,EAAE,CAYpB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,+CANW,MAAM,UACN,MAAM,mBACN,MAAM,aACN,sBAAoB,MAAM,GACxB,MAAM,CA0BlB"}
|
|
@@ -1,87 +1,88 @@
|
|
|
1
|
-
import { assert } from "../../core/assert.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* @param {number} level
|
|
12
|
-
* @
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* @param {number}
|
|
29
|
-
* @param {number}
|
|
30
|
-
* @param {
|
|
31
|
-
* @param {
|
|
32
|
-
* @
|
|
33
|
-
* `
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
assert.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
texture_mip_size(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* @param {number}
|
|
59
|
-
* @param {number}
|
|
60
|
-
* @param {
|
|
61
|
-
* @
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
assert.isNumber(
|
|
68
|
-
assert.isNumber(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
assert.notNaN(
|
|
72
|
-
assert.notNaN(
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
assert.greaterThanOrEqual(
|
|
76
|
-
assert.greaterThanOrEqual(
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
1
|
+
import { assert } from "../../core/assert.js";
|
|
2
|
+
import { msb_32 } from "../../core/binary/msb_32.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* One dimension of a texture at `level`.
|
|
6
|
+
*
|
|
7
|
+
* Halving, floored at 1 — a 1024-wide texture is still 1 texel wide at level 10 and at level 20.
|
|
8
|
+
* Trivial, and re-derived in enough places that getting it wrong is a real event rather than a
|
|
9
|
+
* hypothetical one.
|
|
10
|
+
*
|
|
11
|
+
* @param {number} size texels, at the base level
|
|
12
|
+
* @param {number} level
|
|
13
|
+
* @returns {number} texels, at `level`
|
|
14
|
+
*/
|
|
15
|
+
export function texture_mip_size(size, level) {
|
|
16
|
+
return Math.max(size >> level, 1);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The extent of a texture at `level`.
|
|
21
|
+
*
|
|
22
|
+
* **Only a 3D texture's depth halves.** The third component of an array texture is a layer count,
|
|
23
|
+
* and every layer carries every mip — so it does not shrink with the others. That single distinction
|
|
24
|
+
* is the reason this exists as a named thing: written out by hand it reads as an obvious `>> level`
|
|
25
|
+
* on all three components, and that mistake under-reported a six-layer cube map's memory by close to
|
|
26
|
+
* half and would have uploaded its levels at the wrong extent.
|
|
27
|
+
*
|
|
28
|
+
* @param {number} width texels, at the base level
|
|
29
|
+
* @param {number} height texels, at the base level
|
|
30
|
+
* @param {number} depth_or_layers depth for a 3D texture, layer count otherwise
|
|
31
|
+
* @param {GPUTextureDimension|string} dimension
|
|
32
|
+
* @param {number} level
|
|
33
|
+
* @returns {number[]} `[width, height, depthOrArrayLayers]` at `level`, in the shape
|
|
34
|
+
* `GPUExtent3D` takes
|
|
35
|
+
*/
|
|
36
|
+
export function texture_mip_extent(width, height, depth_or_layers, dimension, level) {
|
|
37
|
+
assert.isString(dimension, 'dimension');
|
|
38
|
+
assert.isNonNegativeInteger(level, 'level');
|
|
39
|
+
|
|
40
|
+
return [
|
|
41
|
+
texture_mip_size(width, level),
|
|
42
|
+
texture_mip_size(height, level),
|
|
43
|
+
dimension === "3d" ? texture_mip_size(depth_or_layers, level) : depth_or_layers,
|
|
44
|
+
];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The number of levels in a texture's full mip chain.
|
|
49
|
+
*
|
|
50
|
+
* The count that {@link texture_mip_extent} implies: the chain runs until every halving axis has
|
|
51
|
+
* reached 1, so it is as long as the longest axis that halves. **Only a 3D texture's depth halves**
|
|
52
|
+
* — the same distinction, one derivative up. Written as `max(width, height)` it silently truncates
|
|
53
|
+
* every volume deeper than it is wide: a 4x4x16 has five levels and that reading gives three, while
|
|
54
|
+
* `texture_mip_extent` will happily report the extent of all five.
|
|
55
|
+
*
|
|
56
|
+
* A zero-sized texture has no levels. Any other size has at least one, which is what the `+ 1` is.
|
|
57
|
+
*
|
|
58
|
+
* @param {number} width texels, at the base level
|
|
59
|
+
* @param {number} height texels, at the base level
|
|
60
|
+
* @param {number} depth_or_layers depth for a 3D texture, layer count otherwise
|
|
61
|
+
* @param {GPUTextureDimension|string} dimension
|
|
62
|
+
* @returns {number}
|
|
63
|
+
*/
|
|
64
|
+
export function texture_mip_level_count(width, height, depth_or_layers, dimension) {
|
|
65
|
+
assert.isString(dimension, 'dimension');
|
|
66
|
+
|
|
67
|
+
assert.isNumber(width, 'width');
|
|
68
|
+
assert.isNumber(height, 'height');
|
|
69
|
+
assert.isNumber(depth_or_layers, 'depth_or_layers');
|
|
70
|
+
|
|
71
|
+
assert.notNaN(width, 'width');
|
|
72
|
+
assert.notNaN(height, 'height');
|
|
73
|
+
assert.notNaN(depth_or_layers, 'depth_or_layers');
|
|
74
|
+
|
|
75
|
+
assert.greaterThanOrEqual(width, 0, 'width');
|
|
76
|
+
assert.greaterThanOrEqual(height, 0, 'height');
|
|
77
|
+
assert.greaterThanOrEqual(depth_or_layers, 0, 'depth_or_layers');
|
|
78
|
+
|
|
79
|
+
const longest = dimension === "3d"
|
|
80
|
+
? Math.max(width, height, depth_or_layers)
|
|
81
|
+
: Math.max(width, height);
|
|
82
|
+
|
|
83
|
+
if (longest === 0) {
|
|
84
|
+
return 0;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return msb_32(longest) + 1;
|
|
88
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WGSLLanguageCore.d.ts","sourceRoot":"","sources":["../../../../../src/shade/wgsl/emulator/WGSLLanguageCore.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"WGSLLanguageCore.d.ts","sourceRoot":"","sources":["../../../../../src/shade/wgsl/emulator/WGSLLanguageCore.js"],"names":[],"mappings":";IAk3DA;;;;;;;;;;;;;OAaG;IACH,+DAyFC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { assert } from "../../../core/assert.js";
|
|
2
2
|
import { cpu_texture_gather, evaluate_gpu_compare_function } from "./cpu_texture_gather.js";
|
|
3
3
|
import { cpu_texture_sample } from "./cpu_texture_sample.js";
|
|
4
|
+
import { msb_32 } from "../../../core/binary/msb_32.js";
|
|
5
|
+
import { ctz32 } from "../../../core/binary/ctz32.js";
|
|
4
6
|
|
|
5
7
|
/**
|
|
6
8
|
* Default sampler descriptor for `textureSample` / `textureSampleLevel`
|
|
@@ -728,7 +730,7 @@ export const WGSLLanguageCore = {
|
|
|
728
730
|
countLeadingZeros: (e) => unop(e, x => Math.clz32(x)),
|
|
729
731
|
|
|
730
732
|
/** `countTrailingZeros(e)` — number of consecutive zero bits below the least significant set bit; 32 for 0. */
|
|
731
|
-
countTrailingZeros: (e) => unop(e, x => (x
|
|
733
|
+
countTrailingZeros: (e) => unop(e, x => ctz32(x)),
|
|
732
734
|
|
|
733
735
|
/** `countOneBits(e)` — population count. */
|
|
734
736
|
countOneBits: (e) => unop(e, x => {
|
|
@@ -744,10 +746,10 @@ export const WGSLLanguageCore = {
|
|
|
744
746
|
}),
|
|
745
747
|
|
|
746
748
|
/** `firstLeadingBit(e)` — index of the most significant set bit; `0xffffffff` for 0 (u32 reading). */
|
|
747
|
-
firstLeadingBit: (e) => unop(e, x => (x === 0 ? 0xffffffff :
|
|
749
|
+
firstLeadingBit: (e) => unop(e, x => (x === 0 ? 0xffffffff : msb_32(x))),
|
|
748
750
|
|
|
749
751
|
/** `firstLeadingBit(e: u32)` — as above; named so the compiler can pick it by operand type. */
|
|
750
|
-
firstLeadingBit_u32: (e) => unop(e, x => (x === 0 ? 0xffffffff :
|
|
752
|
+
firstLeadingBit_u32: (e) => unop(e, x => (x === 0 ? 0xffffffff : msb_32(x))),
|
|
751
753
|
|
|
752
754
|
/**
|
|
753
755
|
* `firstLeadingBit(e: i32)` — the position of the most significant bit DIFFERENT from the sign
|
|
@@ -765,17 +767,17 @@ export const WGSLLanguageCore = {
|
|
|
765
767
|
}
|
|
766
768
|
|
|
767
769
|
// for a negative value the search is for the most significant ZERO
|
|
768
|
-
return
|
|
770
|
+
return msb_32(v < 0 ? ~v : v);
|
|
769
771
|
}),
|
|
770
772
|
|
|
771
773
|
/** `firstTrailingBit(e)` — index of the least significant set bit; `0xffffffff` for 0. */
|
|
772
|
-
firstTrailingBit: (e) => unop(e, x => (x === 0 ? 0xffffffff :
|
|
774
|
+
firstTrailingBit: (e) => unop(e, x => (x === 0 ? 0xffffffff : ctz32(x))),
|
|
773
775
|
|
|
774
776
|
/** `firstTrailingBit(e: u32)` — as above. */
|
|
775
|
-
firstTrailingBit_u32: (e) => unop(e, x => (x === 0 ? 0xffffffff :
|
|
777
|
+
firstTrailingBit_u32: (e) => unop(e, x => (x === 0 ? 0xffffffff : ctz32(x))),
|
|
776
778
|
|
|
777
779
|
/** `firstTrailingBit(e: i32)` — as above, but the "no bit" answer is -1, in this type's sign. */
|
|
778
|
-
firstTrailingBit_i32: (e) => unop(e, x => ((x | 0) === 0 ? -1 :
|
|
780
|
+
firstTrailingBit_i32: (e) => unop(e, x => ((x | 0) === 0 ? -1 : ctz32(x))),
|
|
779
781
|
|
|
780
782
|
/** `reverseBits(e)` — reverse the order of all 32 bits. */
|
|
781
783
|
reverseBits: (e) => unop(e, x => {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ceil_log2.d.ts","sourceRoot":"","sources":["../../../../../../../src/format/image/avif/av1/util/ceil_log2.js"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,6BAPW,MAAM,GACJ,MAAM,CAYlB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=chunk_hash_squirrel3.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_hash_squirrel3.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/shader/chunk/color/chunk_hash_squirrel3.js"],"names":[],"mappings":""}
|
|
File without changes
|