@woosh/meep-engine 3.64.0 → 3.65.0
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 +85 -0
- package/build/bundle-worker-image-decoder.js +1 -1
- package/build/bundle-worker-terrain.js +1 -1
- package/package.json +1 -1
- package/src/core/binary/BinaryBuffer.d.ts +5 -0
- package/src/core/binary/BinaryBuffer.d.ts.map +1 -1
- package/src/core/binary/BinaryBuffer.js +39 -5
- package/src/core/geom/3d/topology/struct/binary/io/bt_boundary_loop.d.ts +65 -6
- package/src/core/geom/3d/topology/struct/binary/io/bt_boundary_loop.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/bt_boundary_loop.js +451 -101
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_close_boundary_holes.d.ts +4 -2
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_close_boundary_holes.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_close_boundary_holes.js +4 -2
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_fill_small_holes.d.ts +8 -1
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_fill_small_holes.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_fill_small_holes.js +45 -10
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_face_find_path_polyanya.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_face_find_path_polyanya.js +237 -119
- package/src/engine/graphics/ecs/grass/GrassSpecies.d.ts +143 -0
- package/src/engine/graphics/ecs/grass/GrassSpecies.d.ts.map +1 -0
- package/src/engine/graphics/ecs/grass/GrassSpecies.js +189 -0
- package/src/engine/graphics/ecs/grass/GrassSurface.d.ts +25 -0
- package/src/engine/graphics/ecs/grass/GrassSurface.d.ts.map +1 -0
- package/src/engine/graphics/ecs/grass/GrassSurface.js +32 -0
- package/src/engine/graphics/ecs/grass/GroundCover.d.ts +68 -0
- package/src/engine/graphics/ecs/grass/GroundCover.d.ts.map +1 -0
- package/src/engine/graphics/ecs/grass/GroundCover.js +85 -0
- package/src/engine/graphics/texture/sampler/exr_to_sampler2d.d.ts +27 -0
- package/src/engine/graphics/texture/sampler/exr_to_sampler2d.d.ts.map +1 -0
- package/src/engine/graphics/texture/sampler/exr_to_sampler2d.js +91 -0
- package/src/engine/graphics/texture/sampler/sampler2d_to_exr.d.ts +23 -0
- package/src/engine/graphics/texture/sampler/sampler2d_to_exr.d.ts.map +1 -0
- package/src/engine/graphics/texture/sampler/sampler2d_to_exr.js +64 -0
- package/src/engine/graphics3/GrassSurfaceSystem.d.ts +153 -0
- package/src/engine/graphics3/GrassSurfaceSystem.d.ts.map +1 -0
- package/src/engine/graphics3/GrassSurfaceSystem.js +1076 -0
- package/src/engine/graphics3/GroundCoverSystem.d.ts +33 -0
- package/src/engine/graphics3/GroundCoverSystem.d.ts.map +1 -0
- package/src/engine/graphics3/GroundCoverSystem.js +58 -0
- package/src/engine/network/NetworkSession.d.ts.map +1 -1
- package/src/engine/network/NetworkSession.js +372 -110
- package/src/engine/network/orchestrator/NetworkPeer.d.ts.map +1 -1
- package/src/engine/network/orchestrator/NetworkPeer.js +6 -1
- package/src/engine/network/orchestrator/ServerAuthoritativeClient.d.ts.map +1 -1
- package/src/engine/network/orchestrator/ServerAuthoritativeClient.js +9 -2
- package/src/engine/network/orchestrator/ServerAuthoritativeServer.d.ts.map +1 -1
- package/src/engine/network/orchestrator/ServerAuthoritativeServer.js +325 -140
- package/src/engine/network/sim/SimActionExecutor.d.ts +4 -1
- package/src/engine/network/sim/SimActionExecutor.d.ts.map +1 -1
- package/src/engine/network/sim/SimActionExecutor.js +65 -9
- package/src/engine/network/state/PredictionHistory.d.ts.map +1 -1
- package/src/engine/network/state/PredictionHistory.js +6 -1
- package/src/engine/network/time/AdaptiveRenderDelay.d.ts +25 -14
- package/src/engine/network/time/AdaptiveRenderDelay.d.ts.map +1 -1
- package/src/engine/network/time/AdaptiveRenderDelay.js +38 -20
- package/src/engine/network/time/RenderPlayout.d.ts +23 -3
- package/src/engine/network/time/RenderPlayout.d.ts.map +1 -1
- package/src/engine/network/time/RenderPlayout.js +40 -4
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/engine/physics/fluid/obstacle/chunk_fluid_obstacle_record.d.ts +5 -1
- package/src/engine/physics/fluid/obstacle/chunk_fluid_obstacle_record.d.ts.map +1 -1
- package/src/engine/physics/fluid/obstacle/chunk_fluid_obstacle_record.js +27 -1
- package/src/format/image/exr/ExrCompression.d.ts +22 -0
- package/src/format/image/exr/ExrCompression.d.ts.map +1 -0
- package/src/format/image/exr/ExrCompression.js +27 -0
- package/src/format/image/exr/ExrImage.d.ts +32 -0
- package/src/format/image/exr/ExrImage.d.ts.map +1 -0
- package/src/format/image/exr/ExrImage.js +32 -0
- package/src/format/image/exr/ExrPixelType.d.ts +13 -0
- package/src/format/image/exr/ExrPixelType.d.ts.map +1 -0
- package/src/format/image/exr/ExrPixelType.js +18 -0
- package/src/format/image/exr/exr_compare_names.d.ts +16 -0
- package/src/format/image/exr/exr_compare_names.d.ts.map +1 -0
- package/src/format/image/exr/exr_compare_names.js +25 -0
- package/src/format/image/exr/exr_constants.d.ts +49 -0
- package/src/format/image/exr/exr_constants.d.ts.map +1 -0
- package/src/format/image/exr/exr_constants.js +56 -0
- package/src/format/image/exr/exr_read.d.ts +32 -0
- package/src/format/image/exr/exr_read.d.ts.map +1 -0
- package/src/format/image/exr/exr_read.js +531 -0
- package/src/format/image/exr/exr_sample_bits.d.ts +16 -0
- package/src/format/image/exr/exr_sample_bits.d.ts.map +1 -0
- package/src/format/image/exr/exr_sample_bits.js +21 -0
- package/src/format/image/exr/exr_scanlines_per_chunk.d.ts +17 -0
- package/src/format/image/exr/exr_scanlines_per_chunk.d.ts.map +1 -0
- package/src/format/image/exr/exr_scanlines_per_chunk.js +31 -0
- package/src/format/image/exr/exr_write.d.ts +27 -0
- package/src/format/image/exr/exr_write.d.ts.map +1 -0
- package/src/format/image/exr/exr_write.js +378 -0
- package/src/shade/device/shader/ShaderModuleCompiler.d.ts +2 -0
- package/src/shade/device/shader/ShaderModuleCompiler.d.ts.map +1 -1
- package/src/shade/device/shader/ShaderModuleCompiler.js +25 -2
- package/src/shade/playground/grass_surfaces/index.html +75 -0
- package/src/shade/playground/grass_surfaces/main.d.ts +2 -0
- package/src/shade/playground/grass_surfaces/main.d.ts.map +1 -0
- package/src/shade/playground/grass_surfaces/main.js +593 -0
- package/src/shade/playground/grass_surfaces/read_grass_surfaces.d.ts +62 -0
- package/src/shade/playground/grass_surfaces/read_grass_surfaces.d.ts.map +1 -0
- package/src/shade/playground/grass_surfaces/read_grass_surfaces.js +188 -0
- package/src/shade/playground/probe_clipmap/index.html +5 -0
- package/src/shade/playground/probe_clipmap/main.d.ts.map +1 -1
- package/src/shade/playground/probe_clipmap/main.js +34 -1
- package/src/shade/playground/probe_clipmap_box/README.md +5 -1
- package/src/shade/playground/probe_clipmap_box/index.html +12 -0
- package/src/shade/playground/probe_clipmap_box/main.d.ts.map +1 -1
- package/src/shade/playground/probe_clipmap_box/main.js +15 -0
- package/src/shade/playground/probe_clipmap_box/scene.d.ts +8 -1
- package/src/shade/playground/probe_clipmap_box/scene.d.ts.map +1 -1
- package/src/shade/playground/probe_clipmap_box/scene.js +74 -6
- package/src/shade/renderer/Renderer.d.ts.map +1 -1
- package/src/shade/renderer/Renderer.js +47 -43
- package/src/shade/renderer/extension/ViewTextures.d.ts +12 -5
- package/src/shade/renderer/extension/ViewTextures.d.ts.map +1 -1
- package/src/shade/renderer/extension/ViewTextures.js +19 -5
- package/src/shade/renderer/fluid/GPUFluidCascadeStack.d.ts +3 -1
- package/src/shade/renderer/fluid/GPUFluidCascadeStack.d.ts.map +1 -1
- package/src/shade/renderer/fluid/GPUFluidCascadeStack.js +6 -1
- package/src/shade/renderer/fluid/forcing/GPUFluidForcing.d.ts +7 -0
- package/src/shade/renderer/fluid/forcing/GPUFluidForcing.d.ts.map +1 -1
- package/src/shade/renderer/fluid/forcing/GPUFluidForcing.js +10 -0
- package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts +7 -1
- package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.js +46 -15
- package/src/shade/renderer/geometry/sdf/bundle/ModelCacheBundle.d.ts +3 -2
- package/src/shade/renderer/geometry/sdf/bundle/ModelCacheBundle.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/bundle/ModelCacheBundle.js +3 -2
- package/src/shade/renderer/geometry/sdf/bundle/model_cache_bundle_sort_morton.d.ts +22 -0
- package/src/shade/renderer/geometry/sdf/bundle/model_cache_bundle_sort_morton.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/bundle/model_cache_bundle_sort_morton.js +247 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts +50 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.js +101 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts +2 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.js +2 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.d.ts +8 -0
- 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 +12 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts +12 -6
- 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 +35 -29
- package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_brick_clipmap.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_brick_clipmap.js +4 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_brick_material.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_brick_material.js +6 -4
- package/src/shade/renderer/global_illumination/probe_clipmap/material/GPUBrickMaterial.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/material/GPUBrickMaterial.js +2 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/material/chunk_brick_material.d.ts +6 -5
- package/src/shade/renderer/global_illumination/probe_clipmap/material/chunk_brick_material.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/material/chunk_brick_material.js +15 -14
- package/src/shade/renderer/global_illumination/probe_clipmap/material/shader_brick_material_gather.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/material/shader_brick_material_gather.js +4 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts +19 -2
- 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 +128 -10
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.d.ts +19 -13
- 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 +27 -15
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.d.ts +19 -11
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.js +35 -11
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.d.ts +3 -3
- 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 +18 -14
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_box_cages.d.ts +40 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_box_cages.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_box_cages.js +174 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_hit_material.d.ts +4 -4
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_hit_material.js +10 -10
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_parallax.d.ts +31 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_parallax.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_parallax.js +54 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_sample_radiance.d.ts +8 -4
- 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 +10 -21
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.d.ts +7 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.js +33 -29
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/graph_probe_clipmap_want_meshlets.d.ts +28 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/graph_probe_clipmap_want_meshlets.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/graph_probe_clipmap_want_meshlets.js +138 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.d.ts +7 -3
- 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 +28 -17
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_due.d.ts +13 -9
- 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 +18 -11
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.js +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.d.ts +18 -18
- 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 +44 -48
- 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 +4 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_retire.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_retire.js +2 -3
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_schedule.d.ts +5 -3
- 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 +15 -30
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.js +1 -1
- 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 +4 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want.d.ts +11 -0
- 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 +29 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_late.d.ts +40 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_late.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_late.js +126 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_meshlets.d.ts +36 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_meshlets.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_meshlets.js +221 -0
- package/src/shade/renderer/gpu_primitive/age_eviction/chunk_age_eviction.d.ts +40 -0
- package/src/shade/renderer/gpu_primitive/age_eviction/chunk_age_eviction.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/age_eviction/chunk_age_eviction.js +86 -0
- package/src/shade/renderer/grass/blade/GPUGrassBlades.d.ts +135 -0
- package/src/shade/renderer/grass/blade/GPUGrassBlades.d.ts.map +1 -0
- package/src/shade/renderer/grass/blade/GPUGrassBlades.js +676 -0
- package/src/shade/renderer/grass/blade/GRASS_BLADE.d.ts +145 -0
- package/src/shade/renderer/grass/blade/GRASS_BLADE.d.ts.map +1 -0
- package/src/shade/renderer/grass/blade/GRASS_BLADE.js +179 -0
- package/src/shade/renderer/grass/blade/chunk_grass_blade.d.ts +63 -0
- package/src/shade/renderer/grass/blade/chunk_grass_blade.d.ts.map +1 -0
- package/src/shade/renderer/grass/blade/chunk_grass_blade.js +244 -0
- package/src/shade/renderer/grass/blade/chunk_grass_blade_wind.d.ts +58 -0
- package/src/shade/renderer/grass/blade/chunk_grass_blade_wind.d.ts.map +1 -0
- package/src/shade/renderer/grass/blade/chunk_grass_blade_wind.js +174 -0
- package/src/shade/renderer/grass/blade/grass_blade_id_draw.d.ts +25 -0
- package/src/shade/renderer/grass/blade/grass_blade_id_draw.d.ts.map +1 -0
- package/src/shade/renderer/grass/blade/grass_blade_id_draw.js +133 -0
- package/src/shade/renderer/grass/blade/grass_blade_mechanics.d.ts +80 -0
- package/src/shade/renderer/grass/blade/grass_blade_mechanics.d.ts.map +1 -0
- package/src/shade/renderer/grass/blade/grass_blade_mechanics.js +92 -0
- package/src/shade/renderer/grass/blade/grass_blade_resolve.d.ts +29 -0
- package/src/shade/renderer/grass/blade/grass_blade_resolve.d.ts.map +1 -0
- package/src/shade/renderer/grass/blade/grass_blade_resolve.js +175 -0
- package/src/shade/renderer/grass/blade/shader_grass_blade_draw_args.d.ts +14 -0
- package/src/shade/renderer/grass/blade/shader_grass_blade_draw_args.d.ts.map +1 -0
- package/src/shade/renderer/grass/blade/shader_grass_blade_draw_args.js +45 -0
- package/src/shade/renderer/grass/blade/shader_grass_blade_expand.d.ts +61 -0
- package/src/shade/renderer/grass/blade/shader_grass_blade_expand.d.ts.map +1 -0
- package/src/shade/renderer/grass/blade/shader_grass_blade_expand.js +340 -0
- package/src/shade/renderer/grass/blade/shader_grass_cell_count.d.ts +46 -0
- package/src/shade/renderer/grass/blade/shader_grass_cell_count.d.ts.map +1 -0
- package/src/shade/renderer/grass/blade/shader_grass_cell_count.js +280 -0
- package/src/shade/renderer/grass/population/chunk_grass_population.d.ts +60 -0
- package/src/shade/renderer/grass/population/chunk_grass_population.d.ts.map +1 -0
- package/src/shade/renderer/grass/population/chunk_grass_population.js +171 -0
- package/src/shade/renderer/grass/press/GPUGrassPress.d.ts +99 -0
- package/src/shade/renderer/grass/press/GPUGrassPress.d.ts.map +1 -0
- package/src/shade/renderer/grass/press/GPUGrassPress.js +436 -0
- package/src/shade/renderer/grass/press/GRASS_PRESS.d.ts +179 -0
- package/src/shade/renderer/grass/press/GRASS_PRESS.d.ts.map +1 -0
- package/src/shade/renderer/grass/press/GRASS_PRESS.js +217 -0
- package/src/shade/renderer/grass/press/chunk_grass_press.d.ts +65 -0
- package/src/shade/renderer/grass/press/chunk_grass_press.d.ts.map +1 -0
- package/src/shade/renderer/grass/press/chunk_grass_press.js +296 -0
- package/src/shade/renderer/grass/press/shader_grass_press_mark.d.ts +31 -0
- package/src/shade/renderer/grass/press/shader_grass_press_mark.d.ts.map +1 -0
- package/src/shade/renderer/grass/press/shader_grass_press_mark.js +169 -0
- package/src/shade/renderer/grass/press/shader_grass_press_stamp.d.ts +27 -0
- package/src/shade/renderer/grass/press/shader_grass_press_stamp.d.ts.map +1 -0
- package/src/shade/renderer/grass/press/shader_grass_press_stamp.js +183 -0
- package/src/shade/renderer/grass/surface/GPUGrassSurfaces.d.ts +193 -0
- package/src/shade/renderer/grass/surface/GPUGrassSurfaces.d.ts.map +1 -0
- package/src/shade/renderer/grass/surface/GPUGrassSurfaces.js +1253 -0
- package/src/shade/renderer/grass/surface/GRASS_SURFACE.d.ts +211 -0
- package/src/shade/renderer/grass/surface/GRASS_SURFACE.d.ts.map +1 -0
- package/src/shade/renderer/grass/surface/GRASS_SURFACE.js +241 -0
- package/src/shade/renderer/grass/surface/GRASS_SURFACE_VIEW.d.ts +82 -0
- package/src/shade/renderer/grass/surface/GRASS_SURFACE_VIEW.d.ts.map +1 -0
- package/src/shade/renderer/grass/surface/GRASS_SURFACE_VIEW.js +111 -0
- package/src/shade/renderer/grass/surface/chunk_grass_column_cross.d.ts +39 -0
- package/src/shade/renderer/grass/surface/chunk_grass_column_cross.d.ts.map +1 -0
- package/src/shade/renderer/grass/surface/chunk_grass_column_cross.js +85 -0
- package/src/shade/renderer/grass/surface/chunk_grass_directory.d.ts +29 -0
- package/src/shade/renderer/grass/surface/chunk_grass_directory.d.ts.map +1 -0
- package/src/shade/renderer/grass/surface/chunk_grass_directory.js +112 -0
- package/src/shade/renderer/grass/surface/chunk_grass_slot.d.ts +27 -0
- package/src/shade/renderer/grass/surface/chunk_grass_slot.d.ts.map +1 -0
- package/src/shade/renderer/grass/surface/chunk_grass_slot.js +50 -0
- package/src/shade/renderer/grass/surface/chunk_grass_surface_frame.d.ts +21 -0
- package/src/shade/renderer/grass/surface/chunk_grass_surface_frame.d.ts.map +1 -0
- package/src/shade/renderer/grass/surface/chunk_grass_surface_frame.js +41 -0
- package/src/shade/renderer/grass/surface/chunk_grass_surface_window.d.ts +32 -0
- package/src/shade/renderer/grass/surface/chunk_grass_surface_window.d.ts.map +1 -0
- package/src/shade/renderer/grass/surface/chunk_grass_surface_window.js +136 -0
- package/src/shade/renderer/grass/surface/chunk_grass_surfel.d.ts +37 -0
- package/src/shade/renderer/grass/surface/chunk_grass_surfel.d.ts.map +1 -0
- package/src/shade/renderer/grass/surface/chunk_grass_surfel.js +85 -0
- package/src/shade/renderer/grass/surface/chunk_grass_tile.d.ts +25 -0
- package/src/shade/renderer/grass/surface/chunk_grass_tile.d.ts.map +1 -0
- package/src/shade/renderer/grass/surface/chunk_grass_tile.js +52 -0
- package/src/shade/renderer/grass/surface/shader_grass_directory_fill.d.ts +23 -0
- package/src/shade/renderer/grass/surface/shader_grass_directory_fill.d.ts.map +1 -0
- package/src/shade/renderer/grass/surface/shader_grass_directory_fill.js +87 -0
- package/src/shade/renderer/grass/surface/shader_grass_surface_bake.d.ts +43 -0
- package/src/shade/renderer/grass/surface/shader_grass_surface_bake.d.ts.map +1 -0
- package/src/shade/renderer/grass/surface/shader_grass_surface_bake.js +265 -0
- package/src/shade/renderer/grass/surface/shader_grass_surface_bake_command.d.ts +13 -0
- package/src/shade/renderer/grass/surface/shader_grass_surface_bake_command.d.ts.map +1 -0
- package/src/shade/renderer/grass/surface/shader_grass_surface_bake_command.js +49 -0
- package/src/shade/renderer/grass/surface/shader_grass_surface_invalidate.d.ts +62 -0
- package/src/shade/renderer/grass/surface/shader_grass_surface_invalidate.d.ts.map +1 -0
- package/src/shade/renderer/grass/surface/shader_grass_surface_invalidate.js +162 -0
- package/src/shade/renderer/grass/surface/shader_grass_surface_retire.d.ts +40 -0
- package/src/shade/renderer/grass/surface/shader_grass_surface_retire.d.ts.map +1 -0
- package/src/shade/renderer/grass/surface/shader_grass_surface_retire.js +155 -0
- package/src/shade/renderer/grass/surface/shader_grass_surface_schedule.d.ts +19 -0
- package/src/shade/renderer/grass/surface/shader_grass_surface_schedule.d.ts.map +1 -0
- package/src/shade/renderer/grass/surface/shader_grass_surface_schedule.js +58 -0
- package/src/shade/renderer/grass/surface/shader_grass_surface_want.d.ts +30 -0
- package/src/shade/renderer/grass/surface/shader_grass_surface_want.d.ts.map +1 -0
- package/src/shade/renderer/grass/surface/shader_grass_surface_want.js +251 -0
- package/src/shade/renderer/grass/surface/shader_grass_surface_window_count.d.ts +21 -0
- package/src/shade/renderer/grass/surface/shader_grass_surface_window_count.d.ts.map +1 -0
- package/src/shade/renderer/grass/surface/shader_grass_surface_window_count.js +75 -0
- package/src/shade/renderer/postprocess/velocity/graph_add_per_object_velocity.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/velocity/graph_add_per_object_velocity.js +4 -23
- package/src/shade/renderer/postprocess/velocity/view_velocity_matrices.d.ts +12 -0
- package/src/shade/renderer/postprocess/velocity/view_velocity_matrices.d.ts.map +1 -0
- package/src/shade/renderer/postprocess/velocity/view_velocity_matrices.js +29 -0
- package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.js +22 -0
- package/src/shade/renderer/scene/GPUSceneContext.d.ts.map +1 -1
- package/src/shade/renderer/scene/GPUSceneContext.js +3 -0
- package/src/shade/renderer/scene/GRASS_SURFACE_PARAMS_STRUCT.d.ts +27 -0
- package/src/shade/renderer/scene/GRASS_SURFACE_PARAMS_STRUCT.d.ts.map +1 -0
- package/src/shade/renderer/scene/GRASS_SURFACE_PARAMS_STRUCT.js +38 -0
- package/src/shade/renderer/scene/MESH_GROUND_COVER_STRUCT.d.ts +28 -0
- package/src/shade/renderer/scene/MESH_GROUND_COVER_STRUCT.d.ts.map +1 -0
- package/src/shade/renderer/scene/MESH_GROUND_COVER_STRUCT.js +58 -0
- package/src/shade/renderer/scene/SCENE_DATABASE_SPEC.d.ts.map +1 -1
- package/src/shade/renderer/scene/SCENE_DATABASE_SPEC.js +8 -0
- package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.d.ts +8 -0
- package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.js +21 -3
- package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_nearest_among.d.ts +37 -0
- package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_nearest_among.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_nearest_among.js +148 -0
- package/src/shade/renderer/shader/chunk/sdf/chunk_shape_record_line_span.d.ts +20 -0
- package/src/shade/renderer/shader/chunk/sdf/chunk_shape_record_line_span.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/sdf/chunk_shape_record_line_span.js +169 -0
- package/src/shade/renderer/texture/atlas/chunk_tile_atlas_slot_origin.d.ts +18 -0
- package/src/shade/renderer/texture/atlas/chunk_tile_atlas_slot_origin.d.ts.map +1 -1
- package/src/shade/renderer/texture/atlas/chunk_tile_atlas_slot_origin.js +28 -0
- package/src/shade/renderer/texture/atlas/tile_atlas_slot_shift.d.ts +13 -0
- package/src/shade/renderer/texture/atlas/tile_atlas_slot_shift.d.ts.map +1 -0
- package/src/shade/renderer/texture/atlas/tile_atlas_slot_shift.js +22 -0
- package/src/shade/renderer/water/GPUWaterRenderer.d.ts.map +1 -1
- package/src/shade/renderer/water/GPUWaterRenderer.js +4 -0
- package/src/shade/renderer/wind/GPUSceneWind.d.ts +52 -5
- package/src/shade/renderer/wind/GPUSceneWind.d.ts.map +1 -1
- package/src/shade/renderer/wind/GPUSceneWind.js +164 -8
- package/src/shade/renderer/wind/WIND_FIELD_UNIFORM.d.ts +3 -1
- package/src/shade/renderer/wind/WIND_FIELD_UNIFORM.d.ts.map +1 -1
- package/src/shade/renderer/wind/WIND_FIELD_UNIFORM.js +3 -1
- package/src/shade/renderer/wind/chunk_wind_field_sample_cascades.d.ts +2 -1
- 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 +18 -13
- package/src/shade/renderer/wind/chunk_wind_field_sample_previous.d.ts +13 -0
- package/src/shade/renderer/wind/chunk_wind_field_sample_previous.d.ts.map +1 -0
- package/src/shade/renderer/wind/chunk_wind_field_sample_previous.js +23 -0
- package/src/shade/renderer/wind/chunk_wind_field_sample_uniform.d.ts +1 -0
- package/src/shade/renderer/wind/chunk_wind_field_sample_uniform.d.ts.map +1 -1
- package/src/shade/renderer/wind/chunk_wind_field_sample_uniform.js +6 -1
- package/src/shade/renderer/wind/wind_field_add_resources.d.ts +11 -0
- package/src/shade/renderer/wind/wind_field_add_resources.d.ts.map +1 -1
- package/src/shade/renderer/wind/wind_field_add_resources.js +15 -0
- package/src/shade/wgsl/emulator/WGSLJavaScriptCompiler.js +1 -1
- package/src/shade/wgsl/emulator/WGSLLanguageCore.d.ts.map +1 -1
- package/src/shade/wgsl/emulator/WGSLLanguageCore.js +2 -0
package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_parallax.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A one-step sphere parallax for a probe's radiance tap (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §9.3, "Parallax
|
|
3
|
+
* correction"): the direction along which a probe sees what a ray from another point reaches.
|
|
4
|
+
*
|
|
5
|
+
* ```wgsl
|
|
6
|
+
* fn probe_clipmap_parallax(slot: u32, probe: vec3<f32>, spacing: f32, position: vec3<f32>, direction: vec3<f32>) -> vec3<f32>
|
|
7
|
+
* ```
|
|
8
|
+
*
|
|
9
|
+
* - `probe` is where the slot's probe stands, `spacing` its cascade's; `direction` is unit.
|
|
10
|
+
* - The ray from `position` along `direction` is met with a sphere about the probe whose radius is the probe's
|
|
11
|
+
* mean depth along `direction`, one bilinear tap of its depth tile. The far root is taken, so a point inside
|
|
12
|
+
* the sphere always meets it. The result is the unit direction from the probe to where they meet.
|
|
13
|
+
* - Where the ray misses the sphere, or meets it only behind the point, the result is `direction`.
|
|
14
|
+
*
|
|
15
|
+
* **Misses.** The depth is the visibility's (§8.2): a ray that missed, and a hit further than
|
|
16
|
+
* `PROBE_DEPTH_LIMIT` spacings, are both stored as the limit. The sphere therefore never stands further than
|
|
17
|
+
* the limit, and whatever lies past it, the sky included, is taken to be that near. A point a distance d from
|
|
18
|
+
* the probe has its direction toward such a thing turned by up to asin(d / (limit · spacing)), where the right
|
|
19
|
+
* turn for the sky is none. The probes of a cage each turn by their own angle, so their taps of one distant
|
|
20
|
+
* thing land on different texels. The depth cannot tell a miss from a hit at the limit, and its two moments say
|
|
21
|
+
* what share of a texel's rays went past the limit but not how far: a parallax that is right past the limit
|
|
22
|
+
* needs a distance the probe does not store.
|
|
23
|
+
*
|
|
24
|
+
* `probe_clipmap_sample_radiance` does not take this parallax, for that reason: it taps along the lobe. The
|
|
25
|
+
* chunk is kept for a reader whose probes see nothing past the limit.
|
|
26
|
+
*
|
|
27
|
+
* @type {CodeChunk}
|
|
28
|
+
*/
|
|
29
|
+
export const chunk_probe_clipmap_parallax: CodeChunk;
|
|
30
|
+
import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
|
|
31
|
+
//# sourceMappingURL=chunk_probe_clipmap_parallax.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk_probe_clipmap_parallax.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_parallax.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,2CAFU,SAAS,CAwBZ;0BArDmB,uCAAuC"}
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_parallax.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
|
|
2
|
+
import { chunk_probe_clipmap_pick } from "./chunk_probe_clipmap_pick.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A one-step sphere parallax for a probe's radiance tap (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §9.3, "Parallax
|
|
6
|
+
* correction"): the direction along which a probe sees what a ray from another point reaches.
|
|
7
|
+
*
|
|
8
|
+
* ```wgsl
|
|
9
|
+
* fn probe_clipmap_parallax(slot: u32, probe: vec3<f32>, spacing: f32, position: vec3<f32>, direction: vec3<f32>) -> vec3<f32>
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* - `probe` is where the slot's probe stands, `spacing` its cascade's; `direction` is unit.
|
|
13
|
+
* - The ray from `position` along `direction` is met with a sphere about the probe whose radius is the probe's
|
|
14
|
+
* mean depth along `direction`, one bilinear tap of its depth tile. The far root is taken, so a point inside
|
|
15
|
+
* the sphere always meets it. The result is the unit direction from the probe to where they meet.
|
|
16
|
+
* - Where the ray misses the sphere, or meets it only behind the point, the result is `direction`.
|
|
17
|
+
*
|
|
18
|
+
* **Misses.** The depth is the visibility's (§8.2): a ray that missed, and a hit further than
|
|
19
|
+
* `PROBE_DEPTH_LIMIT` spacings, are both stored as the limit. The sphere therefore never stands further than
|
|
20
|
+
* the limit, and whatever lies past it, the sky included, is taken to be that near. A point a distance d from
|
|
21
|
+
* the probe has its direction toward such a thing turned by up to asin(d / (limit · spacing)), where the right
|
|
22
|
+
* turn for the sky is none. The probes of a cage each turn by their own angle, so their taps of one distant
|
|
23
|
+
* thing land on different texels. The depth cannot tell a miss from a hit at the limit, and its two moments say
|
|
24
|
+
* what share of a texel's rays went past the limit but not how far: a parallax that is right past the limit
|
|
25
|
+
* needs a distance the probe does not store.
|
|
26
|
+
*
|
|
27
|
+
* `probe_clipmap_sample_radiance` does not take this parallax, for that reason: it taps along the lobe. The
|
|
28
|
+
* chunk is kept for a reader whose probes see nothing past the limit.
|
|
29
|
+
*
|
|
30
|
+
* @type {CodeChunk}
|
|
31
|
+
*/
|
|
32
|
+
export const chunk_probe_clipmap_parallax = CodeChunk.from(
|
|
33
|
+
//language=WGSL
|
|
34
|
+
`
|
|
35
|
+
fn probe_clipmap_parallax(slot: u32, probe: vec3<f32>, spacing: f32, position: vec3<f32>, direction: vec3<f32>) -> vec3<f32> {
|
|
36
|
+
// a miss reads the limit here, as a hit at the limit does: see the chunk's notes on misses
|
|
37
|
+
let radius = probe_clipmap_depth_moments(slot, direction).x * spacing;
|
|
38
|
+
let origin = position - probe;
|
|
39
|
+
let b = dot(direction, origin);
|
|
40
|
+
let discriminant = b * b - (dot(origin, origin) - radius * radius);
|
|
41
|
+
|
|
42
|
+
if (discriminant >= 0.0) {
|
|
43
|
+
let t = sqrt(discriminant) - b;
|
|
44
|
+
|
|
45
|
+
if (t > 0.0) {
|
|
46
|
+
return normalize(origin + t * direction);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return direction;
|
|
51
|
+
}
|
|
52
|
+
`, [
|
|
53
|
+
chunk_probe_clipmap_pick,
|
|
54
|
+
]);
|
|
@@ -13,10 +13,14 @@
|
|
|
13
13
|
* picked by, at the visibility it was picked at. The trilinear part cancels.
|
|
14
14
|
* - **The sample vector** is Lagarde's dominant direction, `normalize(mix(r, n, α))` with r the
|
|
15
15
|
* reflection of the view and α the roughness squared.
|
|
16
|
-
* - **A radiance tap** a probe, along the sample vector
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
16
|
+
* - **A radiance tap** a probe, along the sample vector: one bilinear tap of the tile, through its skirt and
|
|
17
|
+
* the depth's sampler. Every picked probe is tapped along the same direction, as if what it sees there were
|
|
18
|
+
* infinitely far.
|
|
19
|
+
* - **No parallax** is taken toward what a probe sees along the vector. The only distance a probe stores is its
|
|
20
|
+
* visibility depth, where a miss and a hit past `PROBE_DEPTH_LIMIT` both read the limit, so a sphere of
|
|
21
|
+
* that depth turns the taps of the sky and of everything distant, each probe's by its own angle
|
|
22
|
+
* (`chunk_probe_clipmap_parallax`, kept beside this chunk and not linked by it; §9.3, "Parallax
|
|
23
|
+
* correction"). A reflection of something nearer than the limit is therefore placed as if it were far.
|
|
20
24
|
* - **The rough end** is the probes' SH, mixed by the same shares and resolved for the GGX lobe
|
|
21
25
|
* (`sh3_color_get_radiance_with_GGX`, as Brick4 resolves its probes). The two are blended by
|
|
22
26
|
* `roughness_to_mip_ratio`: SH alone from roughness 0.7.
|
|
@@ -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":"AA4BA
|
|
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":"AA4BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,kDAFU,SAAS,CAoHZ;0BA/JmB,uCAAuC"}
|
|
@@ -41,10 +41,14 @@ import { PROBE_RECEIVER_BIAS_VIEW } from "./PROBE_CLIPMAP.js";
|
|
|
41
41
|
* picked by, at the visibility it was picked at. The trilinear part cancels.
|
|
42
42
|
* - **The sample vector** is Lagarde's dominant direction, `normalize(mix(r, n, α))` with r the
|
|
43
43
|
* reflection of the view and α the roughness squared.
|
|
44
|
-
* - **A radiance tap** a probe, along the sample vector
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
44
|
+
* - **A radiance tap** a probe, along the sample vector: one bilinear tap of the tile, through its skirt and
|
|
45
|
+
* the depth's sampler. Every picked probe is tapped along the same direction, as if what it sees there were
|
|
46
|
+
* infinitely far.
|
|
47
|
+
* - **No parallax** is taken toward what a probe sees along the vector. The only distance a probe stores is its
|
|
48
|
+
* visibility depth, where a miss and a hit past `PROBE_DEPTH_LIMIT` both read the limit, so a sphere of
|
|
49
|
+
* that depth turns the taps of the sky and of everything distant, each probe's by its own angle
|
|
50
|
+
* (`chunk_probe_clipmap_parallax`, kept beside this chunk and not linked by it; §9.3, "Parallax
|
|
51
|
+
* correction"). A reflection of something nearer than the limit is therefore placed as if it were far.
|
|
48
52
|
* - **The rough end** is the probes' SH, mixed by the same shares and resolved for the GGX lobe
|
|
49
53
|
* (`sh3_color_get_radiance_with_GGX`, as Brick4 resolves its probes). The two are blended by
|
|
50
54
|
* `roughness_to_mip_ratio`: SH alone from roughness 0.7.
|
|
@@ -97,23 +101,8 @@ fn probe_clipmap_lobe(slot: u32, share: f32, position: vec3<f32>, normal: vec3<f
|
|
|
97
101
|
out.weight = share * probe_visibility_weight(toward, lobe, visibility) / probe_visibility_weight(toward, normal, visibility);
|
|
98
102
|
out.sh = probe_record_sh_decode(record.sh);
|
|
99
103
|
|
|
100
|
-
// the
|
|
101
|
-
|
|
102
|
-
let origin = position - probe;
|
|
103
|
-
let b = dot(lobe, origin);
|
|
104
|
-
let discriminant = b * b - (dot(origin, origin) - radius * radius);
|
|
105
|
-
|
|
106
|
-
var direction = lobe;
|
|
107
|
-
|
|
108
|
-
if (discriminant >= 0.0) {
|
|
109
|
-
let t = sqrt(discriminant) - b;
|
|
110
|
-
|
|
111
|
-
if (t > 0.0) {
|
|
112
|
-
direction = normalize(origin + t * lobe);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
out.radiance = probe_clipmap_radiance(slot, direction).rgb;
|
|
104
|
+
// along the lobe itself: no parallax toward what the probe sees there (chunk_probe_clipmap_parallax, on misses)
|
|
105
|
+
out.radiance = probe_clipmap_radiance(slot, lobe).rgb;
|
|
117
106
|
|
|
118
107
|
return out;
|
|
119
108
|
}
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.d.ts
CHANGED
|
@@ -4,8 +4,13 @@
|
|
|
4
4
|
*
|
|
5
5
|
* ```wgsl
|
|
6
6
|
* fn probe_clipmap_want(wants: bool, position: vec3<f32>, bias_direction: vec3<f32>, cascade_count: u32, resolution: u32, anchor: vec3<f32>, select_half: f32, wanted_capacity: u32)
|
|
7
|
+
* fn probe_clipmap_want_cage(wants: bool, cascade: u32, cage: vec3<i32>, resolution: u32, wanted_capacity: u32)
|
|
7
8
|
* ```
|
|
8
9
|
*
|
|
10
|
+
* `probe_clipmap_want_cage` wants one cage by name, the cage whose least point is `cage` in `cascade`, for a
|
|
11
|
+
* caller that knows its cages without a point to read them from; the cascade's cage window must hold it
|
|
12
|
+
* (`clipmap_contains`). `probe_clipmap_want` is the two it reads from a point.
|
|
13
|
+
*
|
|
9
14
|
* The cages are the pick's: the cascade `probe_clipmap_select_in` answers for the point, by the windows'
|
|
10
15
|
* `anchor` and `select_half` as the pick reads them, the cage of the point biased along `bias_direction` by
|
|
11
16
|
* that cascade's spacing, and in the cascade's blend skirt the next cascade's cage too, biased by its own. A cage a bias moved out of its window is not wanted. Each cage
|
|
@@ -16,8 +21,8 @@
|
|
|
16
21
|
* workgroup's table and sets its bits; the rest want it through that lane. Measured on the AMD iGPU at
|
|
17
22
|
* 1280×720 on Sponza before the claims, the bits' atomics were 140 of want's 345 µs and the appends 90.
|
|
18
23
|
*
|
|
19
|
-
* Every lane of the workgroup calls
|
|
20
|
-
* the subgroup's.
|
|
24
|
+
* Every lane of the workgroup calls `probe_clipmap_want` once, or `probe_clipmap_want_cage` at most twice, which
|
|
25
|
+
* the claim table is sized for, wanting or not, from uniform control flow: the appends are the subgroup's.
|
|
21
26
|
*
|
|
22
27
|
* @type {CodeChunk}
|
|
23
28
|
*/
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_probe_clipmap_want.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.js"],"names":[],"mappings":"AA0BA
|
|
1
|
+
{"version":3,"file":"chunk_probe_clipmap_want.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.js"],"names":[],"mappings":"AA0BA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,uCAFU,SAAS,CA+EZ;0BAlImB,uCAAuC"}
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.js
CHANGED
|
@@ -13,7 +13,7 @@ import { PROBE_THREAD_WORKGROUP_SIZE } from "./PROBE_CLIPMAP.js";
|
|
|
13
13
|
/**
|
|
14
14
|
* Slots of a workgroup's claim table: twice the claims its lanes make at most, a cage in each of two
|
|
15
15
|
* cascades a lane, so a probe finds a slot within a few. Sized for {@link PROBE_THREAD_WORKGROUP_SIZE}
|
|
16
|
-
* lanes: want's 8×8 tiles, and the hits' wants' 64.
|
|
16
|
+
* lanes: want's 8×8 tiles, and the hits' wants' 64; the meshlets' wants' lanes are twice as many, a cage each.
|
|
17
17
|
* @type {number}
|
|
18
18
|
*/
|
|
19
19
|
const WANT_CLAIM_SLOTS = 2 * 2 * PROBE_THREAD_WORKGROUP_SIZE;
|
|
@@ -30,8 +30,13 @@ const WANT_CLAIM_PROBES = 16;
|
|
|
30
30
|
*
|
|
31
31
|
* ```wgsl
|
|
32
32
|
* fn probe_clipmap_want(wants: bool, position: vec3<f32>, bias_direction: vec3<f32>, cascade_count: u32, resolution: u32, anchor: vec3<f32>, select_half: f32, wanted_capacity: u32)
|
|
33
|
+
* fn probe_clipmap_want_cage(wants: bool, cascade: u32, cage: vec3<i32>, resolution: u32, wanted_capacity: u32)
|
|
33
34
|
* ```
|
|
34
35
|
*
|
|
36
|
+
* `probe_clipmap_want_cage` wants one cage by name, the cage whose least point is `cage` in `cascade`, for a
|
|
37
|
+
* caller that knows its cages without a point to read them from; the cascade's cage window must hold it
|
|
38
|
+
* (`clipmap_contains`). `probe_clipmap_want` is the two it reads from a point.
|
|
39
|
+
*
|
|
35
40
|
* The cages are the pick's: the cascade `probe_clipmap_select_in` answers for the point, by the windows'
|
|
36
41
|
* `anchor` and `select_half` as the pick reads them, the cage of the point biased along `bias_direction` by
|
|
37
42
|
* that cascade's spacing, and in the cascade's blend skirt the next cascade's cage too, biased by its own. A cage a bias moved out of its window is not wanted. Each cage
|
|
@@ -42,8 +47,8 @@ const WANT_CLAIM_PROBES = 16;
|
|
|
42
47
|
* workgroup's table and sets its bits; the rest want it through that lane. Measured on the AMD iGPU at
|
|
43
48
|
* 1280×720 on Sponza before the claims, the bits' atomics were 140 of want's 345 µs and the appends 90.
|
|
44
49
|
*
|
|
45
|
-
* Every lane of the workgroup calls
|
|
46
|
-
* the subgroup's.
|
|
50
|
+
* Every lane of the workgroup calls `probe_clipmap_want` once, or `probe_clipmap_want_cage` at most twice, which
|
|
51
|
+
* the claim table is sized for, wanting or not, from uniform control flow: the appends are the subgroup's.
|
|
47
52
|
*
|
|
48
53
|
* @type {CodeChunk}
|
|
49
54
|
*/
|
|
@@ -80,46 +85,45 @@ fn probe_want_claim(key: u32) -> bool {
|
|
|
80
85
|
return true;
|
|
81
86
|
}
|
|
82
87
|
|
|
83
|
-
fn
|
|
84
|
-
let selection = probe_clipmap_select_in(&probe_levels, cascade_count, anchor, select_half, position);
|
|
85
|
-
|
|
86
|
-
let held = wants && selection.level != CLIPMAP_LEVEL_NONE;
|
|
87
|
-
let finest = select(0u, selection.level, held);
|
|
88
|
-
let next = min(finest + 1u, cascade_count - 1u);
|
|
89
|
-
|
|
90
|
-
var cage_finest: vec3<i32>;
|
|
91
|
-
var cage_next: vec3<i32>;
|
|
92
|
-
|
|
88
|
+
fn probe_clipmap_want_cage(wants: bool, cascade: u32, cage: vec3<i32>, resolution: u32, wanted_capacity: u32) {
|
|
93
89
|
// storage wraps by the window's side, a power of two: the low bits of a point, negative ones too
|
|
94
90
|
let wrap = vec3<u32>(resolution - 1u);
|
|
95
91
|
|
|
96
|
-
let
|
|
97
|
-
&& probe_want_claim(probe_clipmap_key(finest, vec3<u32>(cage_finest) & wrap, resolution));
|
|
98
|
-
let wants_next = held && selection.edge_weight > 0.0 && finest + 1u < cascade_count
|
|
99
|
-
&& probe_clipmap_cage(next, position, bias_direction, &cage_next)
|
|
100
|
-
&& probe_want_claim(probe_clipmap_key(next, vec3<u32>(cage_next) & wrap, resolution));
|
|
101
|
-
|
|
102
|
-
// every lane through all sixteen corners, so that the appends stay in uniform control flow
|
|
103
|
-
for (var k = 0u; k < 16u; k++) {
|
|
104
|
-
let coarse = k >= 8u;
|
|
105
|
-
let cascade = select(finest, next, coarse);
|
|
106
|
-
let wanted = select(wants_finest, wants_next, coarse);
|
|
107
|
-
let corner = vec3<i32>(vec3<u32>(k & 1u, (k >> 1u) & 1u, (k >> 2u) & 1u));
|
|
108
|
-
let point = select(cage_finest, cage_next, coarse) + corner;
|
|
92
|
+
let claimed = wants && probe_want_claim(probe_clipmap_key(cascade, vec3<u32>(cage) & wrap, resolution));
|
|
109
93
|
|
|
110
|
-
|
|
111
|
-
|
|
94
|
+
// every lane through all eight corners, so that the appends stay in uniform control flow
|
|
95
|
+
for (var k = 0u; k < 8u; k++) {
|
|
96
|
+
let corner = vec3<i32>(vec3<u32>(k & 1u, (k >> 1u) & 1u, (k >> 2u) & 1u));
|
|
97
|
+
let key = probe_clipmap_key(cascade, vec3<u32>(cage + corner) & wrap, resolution);
|
|
112
98
|
let bit = 1u << (key & 31u);
|
|
113
99
|
|
|
114
100
|
var first = false;
|
|
115
101
|
|
|
116
|
-
if (
|
|
102
|
+
if (claimed) {
|
|
117
103
|
first = (atomicOr(&probe_wanted_bits[key >> 5u], bit) & bit) == 0u;
|
|
118
104
|
}
|
|
119
105
|
|
|
120
106
|
collection_u32_append(&probe_wanted, first, key, wanted_capacity);
|
|
121
107
|
}
|
|
122
108
|
}
|
|
109
|
+
|
|
110
|
+
fn probe_clipmap_want(wants: bool, position: vec3<f32>, bias_direction: vec3<f32>, cascade_count: u32, resolution: u32, anchor: vec3<f32>, select_half: f32, wanted_capacity: u32) {
|
|
111
|
+
let selection = probe_clipmap_select_in(&probe_levels, cascade_count, anchor, select_half, position);
|
|
112
|
+
|
|
113
|
+
let held = wants && selection.level != CLIPMAP_LEVEL_NONE;
|
|
114
|
+
let finest = select(0u, selection.level, held);
|
|
115
|
+
let next = min(finest + 1u, cascade_count - 1u);
|
|
116
|
+
|
|
117
|
+
var cage_finest: vec3<i32>;
|
|
118
|
+
var cage_next: vec3<i32>;
|
|
119
|
+
|
|
120
|
+
let wants_finest = held && probe_clipmap_cage(finest, position, bias_direction, &cage_finest);
|
|
121
|
+
let wants_next = held && selection.edge_weight > 0.0 && finest + 1u < cascade_count
|
|
122
|
+
&& probe_clipmap_cage(next, position, bias_direction, &cage_next);
|
|
123
|
+
|
|
124
|
+
probe_clipmap_want_cage(wants_finest, finest, cage_finest, resolution, wanted_capacity);
|
|
125
|
+
probe_clipmap_want_cage(wants_next, next, cage_next, resolution, wanted_capacity);
|
|
126
|
+
}
|
|
123
127
|
`, [
|
|
124
128
|
chunk_probe_clipmap,
|
|
125
129
|
chunk_probe_clipmap_select_in,
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Record the wants of a list of meshlets whose fragments pick probes (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.3):
|
|
3
|
+
* the meshlets a forward pass draws, which no pixel of the G-buffer stands for. Each wants the cages a reader
|
|
4
|
+
* anywhere inside its world box can read, a thread a cage: its cages are counted
|
|
5
|
+
* (`shader_probe_clipmap_want_meshlet_count`), the counts summed (`graph_prefix_scan_csdldf`), and the sums
|
|
6
|
+
* launch the wants (`shader_probe_clipmap_want_meshlets`), as the meshes' expansion to meshlets is launched.
|
|
7
|
+
*
|
|
8
|
+
* The wants go into the clipmap's late set (`GPUProbeClipmap.write_want_bindings`), so the pass belongs after the
|
|
9
|
+
* clipmap's lifetime in the frame, and its probes are admitted by the next frame's.
|
|
10
|
+
*
|
|
11
|
+
* @param {Object} options
|
|
12
|
+
* @param {import("../../../../../engine/graphics/render/frame_graph/FrameGraph.js").FrameGraph} options.graph
|
|
13
|
+
* @param {import("./GPUProbeClipmap.js").GPUProbeClipmap} options.clipmap the clipmap the fragments pick from
|
|
14
|
+
* @param {import("../../../scene/GPUSceneContext.js").GPUSceneContext} options.scene the meshlets' scene
|
|
15
|
+
* @param {number} options.camera graph handle of the view's camera uniform
|
|
16
|
+
* @param {number} options.meshlet_collection graph handle of the list, `MESHLET_COLLECTION_STRUCT`
|
|
17
|
+
* @param {number} options.meshlet_iterator_command graph handle of the indirect dispatch that walks the list, a
|
|
18
|
+
* workgroup of `COMPUTE_SHADER_DEFAULT_GROUP_SIZE` meshlets, folded
|
|
19
|
+
*/
|
|
20
|
+
export function graph_probe_clipmap_want_meshlets({ graph, clipmap, scene, camera, meshlet_collection, meshlet_iterator_command }: {
|
|
21
|
+
graph: import("../../../../../engine/graphics/render/frame_graph/FrameGraph.js").FrameGraph;
|
|
22
|
+
clipmap: import("./GPUProbeClipmap.js").GPUProbeClipmap;
|
|
23
|
+
scene: import("../../../scene/GPUSceneContext.js").GPUSceneContext;
|
|
24
|
+
camera: number;
|
|
25
|
+
meshlet_collection: number;
|
|
26
|
+
meshlet_iterator_command: number;
|
|
27
|
+
}): void;
|
|
28
|
+
//# sourceMappingURL=graph_probe_clipmap_want_meshlets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph_probe_clipmap_want_meshlets.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/graph_probe_clipmap_want_meshlets.js"],"names":[],"mappings":"AAqBA;;;;;;;;;;;;;;;;;;GAkBG;AACH;IARyG,KAAK,EAAnG,OAAO,iEAAiE,EAAE,UAAU;IAC5B,OAAO,EAA/D,OAAO,sBAAsB,EAAE,eAAe;IACuB,KAAK,EAA1E,OAAO,mCAAmC,EAAE,eAAe;IAC3C,MAAM,EAAtB,MAAM;IACU,kBAAkB,EAAlC,MAAM;IACU,wBAAwB,EAAxC,MAAM;SAoGhB"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { assert } from "../../../../../core/assert.js";
|
|
2
|
+
import { BufferResourceDescriptor } from "../../../../device/graph/BufferResourceDescriptor.js";
|
|
3
|
+
import { MESHLET_DEFINITION_STRUCT } from "../../../geometry/meshlet/encoding/MESHLET_DEFINITION_STRUCT.js";
|
|
4
|
+
import { INDIRECT_COMPUTE_COMMAND_DESCRIPTOR } from "../../../gpu_primitive/indirect/IndirectComputeCommandBuildPass.js";
|
|
5
|
+
import {
|
|
6
|
+
graph_prefix_scan_csdldf,
|
|
7
|
+
prefix_scan_csdldf_output_descriptor
|
|
8
|
+
} from "../../../gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.js";
|
|
9
|
+
import { shader_prefix_sum_to_command } from "../../../rasterize/expand/mesh/shader_prefix_sum_to_command.js";
|
|
10
|
+
import { graph_create_buffer } from "../../../shader/graph/graph_create_buffer.js";
|
|
11
|
+
import {
|
|
12
|
+
shader_probe_clipmap_want_meshlet_count,
|
|
13
|
+
shader_probe_clipmap_want_meshlets
|
|
14
|
+
} from "./shader_probe_clipmap_want_meshlets.js";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Bytes a meshlet list's count takes ahead of its elements, which sit on a 16-byte boundary.
|
|
18
|
+
* @type {number}
|
|
19
|
+
*/
|
|
20
|
+
const MESHLET_LIST_HEADER_BYTES = 16;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Record the wants of a list of meshlets whose fragments pick probes (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.3):
|
|
24
|
+
* the meshlets a forward pass draws, which no pixel of the G-buffer stands for. Each wants the cages a reader
|
|
25
|
+
* anywhere inside its world box can read, a thread a cage: its cages are counted
|
|
26
|
+
* (`shader_probe_clipmap_want_meshlet_count`), the counts summed (`graph_prefix_scan_csdldf`), and the sums
|
|
27
|
+
* launch the wants (`shader_probe_clipmap_want_meshlets`), as the meshes' expansion to meshlets is launched.
|
|
28
|
+
*
|
|
29
|
+
* The wants go into the clipmap's late set (`GPUProbeClipmap.write_want_bindings`), so the pass belongs after the
|
|
30
|
+
* clipmap's lifetime in the frame, and its probes are admitted by the next frame's.
|
|
31
|
+
*
|
|
32
|
+
* @param {Object} options
|
|
33
|
+
* @param {import("../../../../../engine/graphics/render/frame_graph/FrameGraph.js").FrameGraph} options.graph
|
|
34
|
+
* @param {import("./GPUProbeClipmap.js").GPUProbeClipmap} options.clipmap the clipmap the fragments pick from
|
|
35
|
+
* @param {import("../../../scene/GPUSceneContext.js").GPUSceneContext} options.scene the meshlets' scene
|
|
36
|
+
* @param {number} options.camera graph handle of the view's camera uniform
|
|
37
|
+
* @param {number} options.meshlet_collection graph handle of the list, `MESHLET_COLLECTION_STRUCT`
|
|
38
|
+
* @param {number} options.meshlet_iterator_command graph handle of the indirect dispatch that walks the list, a
|
|
39
|
+
* workgroup of `COMPUTE_SHADER_DEFAULT_GROUP_SIZE` meshlets, folded
|
|
40
|
+
*/
|
|
41
|
+
export function graph_probe_clipmap_want_meshlets({ graph, clipmap, scene, camera, meshlet_collection, meshlet_iterator_command }) {
|
|
42
|
+
assert.defined(graph, 'graph');
|
|
43
|
+
assert.defined(clipmap, 'clipmap');
|
|
44
|
+
assert.defined(scene, 'scene');
|
|
45
|
+
assert.isNonNegativeInteger(camera, 'camera');
|
|
46
|
+
assert.isNonNegativeInteger(meshlet_collection, 'meshlet_collection');
|
|
47
|
+
assert.isNonNegativeInteger(meshlet_iterator_command, 'meshlet_iterator_command');
|
|
48
|
+
|
|
49
|
+
graph.push_scope("probe clipmap want meshlets");
|
|
50
|
+
|
|
51
|
+
// a count for every meshlet the list has room for
|
|
52
|
+
const capacity = Math.floor((graph.getDescriptor(meshlet_collection).size - MESHLET_LIST_HEADER_BYTES) / MESHLET_DEFINITION_STRUCT.size);
|
|
53
|
+
|
|
54
|
+
// what the clipmap binds for a late want: its levels and settings for both passes, its late list and bits for the wants'
|
|
55
|
+
const want = {};
|
|
56
|
+
|
|
57
|
+
const count_data = {};
|
|
58
|
+
|
|
59
|
+
const count_pass = graph.add("count cages", count_data, (data, resources, context) => {
|
|
60
|
+
clipmap.write_want_bindings(want);
|
|
61
|
+
|
|
62
|
+
shader_probe_clipmap_want_meshlet_count.dispatchIndirect({
|
|
63
|
+
encoder: context.encoder,
|
|
64
|
+
command: resources.get(data.command),
|
|
65
|
+
bindings: {
|
|
66
|
+
scene_database: scene.scene_database_buffer,
|
|
67
|
+
meshlet_metadata: scene.geometries.meshlets.buffer_metadata,
|
|
68
|
+
input: resources.get(data.input),
|
|
69
|
+
output: resources.get(data.output),
|
|
70
|
+
probe_levels: want.probe_levels,
|
|
71
|
+
settings: want.settings,
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
count_data.command = count_pass.read(meshlet_iterator_command);
|
|
77
|
+
count_data.input = count_pass.read(meshlet_collection);
|
|
78
|
+
count_data.output = count_pass.create("cage counts", BufferResourceDescriptor.from(
|
|
79
|
+
MESHLET_LIST_HEADER_BYTES + Math.max(1, Math.ceil(capacity / 4)) * 16,
|
|
80
|
+
GPUBufferUsage.STORAGE,
|
|
81
|
+
// the count, which no thread writes for a list of no meshlet
|
|
82
|
+
0, MESHLET_LIST_HEADER_BYTES,
|
|
83
|
+
));
|
|
84
|
+
|
|
85
|
+
const sums = graph_prefix_scan_csdldf({
|
|
86
|
+
graph,
|
|
87
|
+
input: count_data.output,
|
|
88
|
+
output: graph_create_buffer(graph, "cage offsets", prefix_scan_csdldf_output_descriptor(capacity)),
|
|
89
|
+
element_max_count: capacity,
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
const command_data = {};
|
|
93
|
+
|
|
94
|
+
const command_pass = graph.add("make want command", command_data, (data, resources, context) => {
|
|
95
|
+
shader_prefix_sum_to_command.dispatch({
|
|
96
|
+
encoder: context.encoder,
|
|
97
|
+
bindings: {
|
|
98
|
+
prefix_sums: resources.get(data.prefix_sums),
|
|
99
|
+
command: resources.get(data.command),
|
|
100
|
+
},
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
command_data.prefix_sums = command_pass.read(sums);
|
|
105
|
+
command_data.command = command_pass.create("command", INDIRECT_COMPUTE_COMMAND_DESCRIPTOR);
|
|
106
|
+
|
|
107
|
+
const want_data = {};
|
|
108
|
+
|
|
109
|
+
const want_pass = graph.add("want cages", want_data, (data, resources, context) => {
|
|
110
|
+
clipmap.write_want_bindings(want);
|
|
111
|
+
|
|
112
|
+
shader_probe_clipmap_want_meshlets.dispatchIndirect({
|
|
113
|
+
encoder: context.encoder,
|
|
114
|
+
command: resources.get(data.command),
|
|
115
|
+
bindings: {
|
|
116
|
+
camera: resources.get(data.camera),
|
|
117
|
+
scene_database: scene.scene_database_buffer,
|
|
118
|
+
meshlet_metadata: scene.geometries.meshlets.buffer_metadata,
|
|
119
|
+
input: resources.get(data.input),
|
|
120
|
+
prefix_sums: resources.get(data.prefix_sums),
|
|
121
|
+
probe_levels: want.probe_levels,
|
|
122
|
+
probe_wanted: want.probe_wanted,
|
|
123
|
+
probe_wanted_bits: want.probe_wanted_bits,
|
|
124
|
+
settings: want.settings,
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
want_data.command = want_pass.read(command_data.command);
|
|
130
|
+
want_data.camera = want_pass.read(camera);
|
|
131
|
+
want_data.input = want_pass.read(meshlet_collection);
|
|
132
|
+
want_data.prefix_sums = want_pass.read(sums);
|
|
133
|
+
|
|
134
|
+
// it writes the clipmap's own late set, which the graph does not hold
|
|
135
|
+
want_pass.make_side_effect();
|
|
136
|
+
|
|
137
|
+
graph.pop_scope();
|
|
138
|
+
}
|
|
@@ -9,9 +9,9 @@ export const PROBE_ACCUMULATE_SETTINGS: WebGPUStruct;
|
|
|
9
9
|
* `probe_maps` (`probe_clipmap_maps_words`): two words a radiance texel, rgba as half floats; then a
|
|
10
10
|
* word a radiance texel, its rays this update, resolved in the low half and back faces in the high,
|
|
11
11
|
* which classification sums; then a word a depth texel, its moments as half floats; then a word a
|
|
12
|
-
* radiance texel,
|
|
13
|
-
* `
|
|
14
|
-
*
|
|
12
|
+
* radiance texel, its estimator after the update as the probe's L0 estimator sums it
|
|
13
|
+
* (`shader_probe_clipmap_project`): its short mean less its mean and its deviation (the estimator's own,
|
|
14
|
+
* floored at the display's exposure), luminance, as half floats; nothing for a texel no ray has reached.
|
|
15
15
|
*
|
|
16
16
|
* - **A texel's rays**: on a uniform update (`PROBE_UNIFORM_PERIOD`), `probe_clipmap_texel_ray`'s. On a
|
|
17
17
|
* guided one, the run that begins at its walk position in the probe's guide, at most
|
|
@@ -29,6 +29,10 @@ export const PROBE_ACCUMULATE_SETTINGS: WebGPUStruct;
|
|
|
29
29
|
* - The mean blends by at least 1/(a+1) until the count reaches its limit: a young texel is its running
|
|
30
30
|
* mean, which the estimator's blend reduction, nothing at its seed, would otherwise hold back. Past it
|
|
31
31
|
* the estimator alone, down to 1/8192 an update on a noisy texel.
|
|
32
|
+
* - And by at least the probe's L0 blend (`PROBE_REQUEST_STRUCT`'s `blend`), its L0 estimator's catch-up
|
|
33
|
+
* after its last update: a change in the probe's whole light, which the texels' own tests, a one-ray
|
|
34
|
+
* sample's noise apiece, do not see. The texel's own catch-up stays, for light that moves without
|
|
35
|
+
* changing L0.
|
|
32
36
|
* - Samples are clipped once the variance's window has passed, when 1/(a+1) is no longer its blend:
|
|
33
37
|
* before that it holds no spread to clip to.
|
|
34
38
|
* - A texel's first sample seeds both means. A texel no ray reached keeps its history.
|
|
@@ -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":"AA+CA;;GAEG;AACH,wCAFU,YAAY,CAmBQ;
|
|
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":"AA+CA;;GAEG;AACH,wCAFU,YAAY,CAmBQ;AAwB9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,8CAFU,aAAa,CAgUpB;6BAlc0B,sCAAsC;8BAJrC,kCAAkC"}
|
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
PROBE_RAY_STRUCT,
|
|
30
30
|
PROBE_RAY_SUMS_READ_RESOURCE,
|
|
31
31
|
PROBE_RAYS_READ_RESOURCE,
|
|
32
|
+
PROBE_REQUESTS_READ_RESOURCE,
|
|
32
33
|
PROBE_RESAMPLES_READ_RESOURCE,
|
|
33
34
|
PROBE_STATES_READ_RESOURCE,
|
|
34
35
|
PROBE_TRACE_READ_RESOURCE
|
|
@@ -36,7 +37,6 @@ import {
|
|
|
36
37
|
import { chunk_probe_clipmap_resampled } from "./chunk_probe_clipmap_resampled.js";
|
|
37
38
|
import {
|
|
38
39
|
PROBE_BACK_FACE_DEPTH,
|
|
39
|
-
PROBE_CHANGE_SIGNIFICANCE,
|
|
40
40
|
PROBE_DEPTH_LIMIT,
|
|
41
41
|
PROBE_DEPTH_TEXEL_RAYS,
|
|
42
42
|
PROBE_RADIANCE_SAMPLES_LIMIT,
|
|
@@ -82,6 +82,8 @@ resources.createGroup()
|
|
|
82
82
|
.add(PROBE_RADIANCE_HISTORY_RESOURCE)
|
|
83
83
|
.add(PROBE_DEPTH_HISTORY_RESOURCE)
|
|
84
84
|
.add(PROBE_ESTIMATORS_RESOURCE)
|
|
85
|
+
// the probes' L0 blends, as their last projection left them
|
|
86
|
+
.add(PROBE_REQUESTS_READ_RESOURCE)
|
|
85
87
|
// read only where the frame re-samples (chunk_probe_clipmap_resampled)
|
|
86
88
|
.add(PROBE_RESAMPLES_READ_RESOURCE)
|
|
87
89
|
// the factor the display multiplies radiance by ahead of its tone curve, as the last frame was shown
|
|
@@ -94,9 +96,9 @@ resources.createGroup()
|
|
|
94
96
|
* `probe_maps` (`probe_clipmap_maps_words`): two words a radiance texel, rgba as half floats; then a
|
|
95
97
|
* word a radiance texel, its rays this update, resolved in the low half and back faces in the high,
|
|
96
98
|
* which classification sums; then a word a depth texel, its moments as half floats; then a word a
|
|
97
|
-
* radiance texel,
|
|
98
|
-
* `
|
|
99
|
-
*
|
|
99
|
+
* radiance texel, its estimator after the update as the probe's L0 estimator sums it
|
|
100
|
+
* (`shader_probe_clipmap_project`): its short mean less its mean and its deviation (the estimator's own,
|
|
101
|
+
* floored at the display's exposure), luminance, as half floats; nothing for a texel no ray has reached.
|
|
100
102
|
*
|
|
101
103
|
* - **A texel's rays**: on a uniform update (`PROBE_UNIFORM_PERIOD`), `probe_clipmap_texel_ray`'s. On a
|
|
102
104
|
* guided one, the run that begins at its walk position in the probe's guide, at most
|
|
@@ -114,6 +116,10 @@ resources.createGroup()
|
|
|
114
116
|
* - The mean blends by at least 1/(a+1) until the count reaches its limit: a young texel is its running
|
|
115
117
|
* mean, which the estimator's blend reduction, nothing at its seed, would otherwise hold back. Past it
|
|
116
118
|
* the estimator alone, down to 1/8192 an update on a noisy texel.
|
|
119
|
+
* - And by at least the probe's L0 blend (`PROBE_REQUEST_STRUCT`'s `blend`), its L0 estimator's catch-up
|
|
120
|
+
* after its last update: a change in the probe's whole light, which the texels' own tests, a one-ray
|
|
121
|
+
* sample's noise apiece, do not see. The texel's own catch-up stays, for light that moves without
|
|
122
|
+
* changing L0.
|
|
117
123
|
* - Samples are clipped once the variance's window has passed, when 1/(a+1) is no longer its blend:
|
|
118
124
|
* before that it holds no spread to clip to.
|
|
119
125
|
* - A texel's first sample seeds both means. A texel no ray reached keeps its history.
|
|
@@ -268,34 +274,29 @@ fn main(
|
|
|
268
274
|
let tile = index_to_grid2d(slot, settings.radiance_tiles_per_row) * (n + 2u * settings.radiance_skirt) + settings.radiance_skirt;
|
|
269
275
|
let history = select(textureLoad(probe_radiance, tile + vec2<u32>(i % n, i / n), 0), vec4<f32>(0.0), updates == 0u);
|
|
270
276
|
|
|
277
|
+
let estimator = slot * texels + i;
|
|
278
|
+
|
|
271
279
|
var texel = history;
|
|
272
|
-
//
|
|
273
|
-
|
|
274
|
-
// so that one bright sample is one texel's at most
|
|
275
|
-
var change = vec2<f32>(0.0);
|
|
280
|
+
// the texel's estimator, its history's until a sample is blended
|
|
281
|
+
var e = probe_accumulate_estimator(history.rgb, probe_estimators[estimator]);
|
|
276
282
|
|
|
277
283
|
if (count > 0u) {
|
|
278
284
|
// the rays, and the neighbours' re-samples where the frame took them
|
|
279
285
|
let pooled = probe_clipmap_resampled(k * texels + i, sum, count);
|
|
280
286
|
let sample = pooled.rgb / pooled.w;
|
|
281
|
-
let
|
|
287
|
+
let before = e;
|
|
282
288
|
|
|
283
|
-
|
|
289
|
+
e = multiscale_mean_seed(sample);
|
|
284
290
|
|
|
285
291
|
if (history.a > 0.0) {
|
|
286
292
|
let ramp = 1.0 / (history.a + 1.0);
|
|
287
|
-
let before = probe_accumulate_estimator(history.rgb, probe_estimators[estimator]);
|
|
288
|
-
// the estimator's own floor on the deviation, at the display's exposure
|
|
289
|
-
let deviation = rgb_to_luminance(max(multiscale_mean_deviation_floor(before.short_mean, probe_exposure.value), sqrt(max(vec3<f32>(0.0), before.variance))));
|
|
290
|
-
|
|
291
|
-
change = vec2<f32>(clamp(rgb_to_luminance(sample - history.rgb) / deviation, -${PROBE_CHANGE_SIGNIFICANCE}.0, ${PROBE_CHANGE_SIGNIFICANCE}.0), 1.0);
|
|
292
293
|
|
|
293
294
|
e = multiscale_mean_add(
|
|
294
295
|
before,
|
|
295
296
|
sample,
|
|
296
297
|
max(ramp, ${PROBE_SHORT_BLEND}),
|
|
297
298
|
max(ramp, ${PROBE_VARIANCE_BLEND}),
|
|
298
|
-
select(0.0, ramp, history.a < ${PROBE_RADIANCE_SAMPLES_LIMIT}.0),
|
|
299
|
+
max(select(0.0, ramp, history.a < ${PROBE_RADIANCE_SAMPLES_LIMIT}.0), probe_requests[slot].blend),
|
|
299
300
|
ramp <= ${PROBE_VARIANCE_BLEND},
|
|
300
301
|
probe_exposure.value,
|
|
301
302
|
);
|
|
@@ -306,13 +307,23 @@ fn main(
|
|
|
306
307
|
probe_estimators[estimator] = probe_accumulate_estimator_words(e, slot, per_probe + 2u * i, updates);
|
|
307
308
|
}
|
|
308
309
|
|
|
310
|
+
// the estimator as the probe's L0 estimator sums it, its deviation floored at the display's exposure as
|
|
311
|
+
// the estimator's own; nothing for a texel no ray has reached
|
|
312
|
+
var state = vec2<f32>(0.0);
|
|
313
|
+
|
|
314
|
+
if (texel.a > 0.0) {
|
|
315
|
+
let deviation = max(multiscale_mean_deviation_floor(e.short_mean, probe_exposure.value), sqrt(max(vec3<f32>(0.0), e.variance)));
|
|
316
|
+
|
|
317
|
+
state = vec2<f32>(rgb_to_luminance(e.short_mean - e.mean), rgb_to_luminance(deviation));
|
|
318
|
+
}
|
|
319
|
+
|
|
309
320
|
// the count is whole, which any noise keeps
|
|
310
321
|
let stored = f16_round_stochastic(texel, vec4<f32>(probe_accumulate_store_noise(slot, i, updates), 0.0));
|
|
311
322
|
|
|
312
323
|
probe_maps[maps + 2u * i] = pack2x16float(stored.rg);
|
|
313
324
|
probe_maps[maps + 2u * i + 1u] = pack2x16float(stored.ba);
|
|
314
325
|
probe_maps[maps + 2u * texels + i] = count | (back_faces << 16u);
|
|
315
|
-
probe_maps[maps + 3u * texels + m * m + i] = pack2x16float(
|
|
326
|
+
probe_maps[maps + 3u * texels + m * m + i] = pack2x16float(state);
|
|
316
327
|
|
|
317
328
|
return;
|
|
318
329
|
}
|