@woosh/meep-engine 3.64.1 → 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/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/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_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 -1
- 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 -2
- 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.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.js +3 -1
- 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_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_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/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/material/chunk_brick_material.js
CHANGED
|
@@ -36,13 +36,14 @@ export const BRICK_MATERIAL_EMISSIVE_RESOURCE = ShaderResourceDescriptor.texture
|
|
|
36
36
|
*
|
|
37
37
|
* ```wgsl
|
|
38
38
|
* fn brick_material_tile(slot: u32) -> vec3<u32>
|
|
39
|
-
* fn brick_material_corners(slot: u32, local: vec3<f32>, normal: vec3<f32
|
|
39
|
+
* fn brick_material_corners(slot: u32, local: vec3<f32>, normal: vec3<f32>, atlas_shift: u32) -> SurfaceMaterialCorners
|
|
40
40
|
* ```
|
|
41
41
|
*
|
|
42
42
|
* `brick_material_tile` is the slot's tile's origin in the planes. `local` is a point by the surface in
|
|
43
43
|
* voxels from the cell's corner, a hit's position, and `normal` the field's normal there. Surfaces
|
|
44
44
|
* within {@link BRICK_TRACE_HIT_VOXELS} of each other are one: a ray stands on a surface from anywhere
|
|
45
|
-
* that far out of it, so it cannot tell closer ones apart.
|
|
45
|
+
* that far out of it, so it cannot tell closer ones apart. `atlas_shift` is the brick atlas's footprint, as
|
|
46
|
+
* `chunk_brick_clipmap_sample` takes it; the material planes' own footprint is read off them, once a read.
|
|
46
47
|
*
|
|
47
48
|
* @type {CodeChunk}
|
|
48
49
|
*/
|
|
@@ -55,11 +56,11 @@ fn brick_material_tile(slot: u32) -> vec3<u32> {
|
|
|
55
56
|
return tile_atlas_slot_origin(slot, textureDimensions(brick_material_albedo_codes, 0).xy / t, vec3<u32>(t));
|
|
56
57
|
}
|
|
57
58
|
|
|
58
|
-
fn brick_material_corners(slot: u32, local: vec3<f32>, normal: vec3<f32
|
|
59
|
-
let point = surface_material_point(local, brick_clipmap_sample(slot, local, 1.0), normal);
|
|
59
|
+
fn brick_material_corners(slot: u32, local: vec3<f32>, normal: vec3<f32>, atlas_shift: u32) -> SurfaceMaterialCorners {
|
|
60
|
+
let point = surface_material_point(local, brick_clipmap_sample(slot, local, 1.0, atlas_shift), normal);
|
|
60
61
|
let present = surface_material_present(brick_material_albedo_codes, brick_material_tile(slot) + surface_material_base(point));
|
|
61
62
|
|
|
62
|
-
return surface_material_corners(brick_atlas, brick_clipmap_slot_texel(slot), point, present, normal, ${BRICK_TRACE_HIT_VOXELS});
|
|
63
|
+
return surface_material_corners(brick_atlas, brick_clipmap_slot_texel(slot, atlas_shift), point, present, normal, ${BRICK_TRACE_HIT_VOXELS});
|
|
63
64
|
}
|
|
64
65
|
`, [
|
|
65
66
|
chunk_surface_material_read,
|
|
@@ -74,7 +75,7 @@ chunk_brick_material_corners.requireResource(BRICK_MATERIAL_ALBEDO_RESOURCE);
|
|
|
74
75
|
* (`surface_material_surface`):
|
|
75
76
|
*
|
|
76
77
|
* ```wgsl
|
|
77
|
-
* fn brick_material_surface(slot: u32, local: vec3<f32>, normal: vec3<f32
|
|
78
|
+
* fn brick_material_surface(slot: u32, local: vec3<f32>, normal: vec3<f32>, atlas_shift: u32) -> SurfaceMaterialSurface
|
|
78
79
|
* ```
|
|
79
80
|
*
|
|
80
81
|
* @type {CodeChunk}
|
|
@@ -82,8 +83,8 @@ chunk_brick_material_corners.requireResource(BRICK_MATERIAL_ALBEDO_RESOURCE);
|
|
|
82
83
|
export const chunk_brick_material_surface = CodeChunk.from(
|
|
83
84
|
//language=WGSL
|
|
84
85
|
`
|
|
85
|
-
fn brick_material_surface(slot: u32, local: vec3<f32>, normal: vec3<f32
|
|
86
|
-
return surface_material_surface(brick_atlas, brick_material_albedo_codes, brick_material_emissive_codes, brick_material_tile(slot), brick_material_corners(slot, local, normal));
|
|
86
|
+
fn brick_material_surface(slot: u32, local: vec3<f32>, normal: vec3<f32>, atlas_shift: u32) -> SurfaceMaterialSurface {
|
|
87
|
+
return surface_material_surface(brick_atlas, brick_material_albedo_codes, brick_material_emissive_codes, brick_material_tile(slot), brick_material_corners(slot, local, normal, atlas_shift));
|
|
87
88
|
}
|
|
88
89
|
`, [
|
|
89
90
|
chunk_brick_material_corners,
|
|
@@ -98,7 +99,7 @@ chunk_brick_material_surface.requireResource(BRICK_MATERIAL_EMISSIVE_RESOURCE);
|
|
|
98
99
|
* average, over the reads a probe's rays make:
|
|
99
100
|
*
|
|
100
101
|
* ```wgsl
|
|
101
|
-
* fn brick_material_surface_pick(slot: u32, local: vec3<f32>, normal: vec3<f32>, u: f32) -> SurfaceMaterialSurface
|
|
102
|
+
* fn brick_material_surface_pick(slot: u32, local: vec3<f32>, normal: vec3<f32>, u: f32, atlas_shift: u32) -> SurfaceMaterialSurface
|
|
102
103
|
* ```
|
|
103
104
|
*
|
|
104
105
|
* @type {CodeChunk}
|
|
@@ -106,8 +107,8 @@ chunk_brick_material_surface.requireResource(BRICK_MATERIAL_EMISSIVE_RESOURCE);
|
|
|
106
107
|
export const chunk_brick_material_surface_pick = CodeChunk.from(
|
|
107
108
|
//language=WGSL
|
|
108
109
|
`
|
|
109
|
-
fn brick_material_surface_pick(slot: u32, local: vec3<f32>, normal: vec3<f32>, u: f32) -> SurfaceMaterialSurface {
|
|
110
|
-
let corners = brick_material_corners(slot, local, normal);
|
|
110
|
+
fn brick_material_surface_pick(slot: u32, local: vec3<f32>, normal: vec3<f32>, u: f32, atlas_shift: u32) -> SurfaceMaterialSurface {
|
|
111
|
+
let corners = brick_material_corners(slot, local, normal, atlas_shift);
|
|
111
112
|
|
|
112
113
|
return surface_material_surface_at(brick_material_albedo_codes, brick_material_emissive_codes, brick_material_tile(slot), corners, surface_material_pick(brick_atlas, corners, u));
|
|
113
114
|
}
|
|
@@ -123,7 +124,7 @@ chunk_brick_material_surface_pick.requireResource(BRICK_MATERIAL_EMISSIVE_RESOUR
|
|
|
123
124
|
* texels {@link chunk_brick_material_surface} takes:
|
|
124
125
|
*
|
|
125
126
|
* ```wgsl
|
|
126
|
-
* fn brick_material_metal_rough(slot: u32, local: vec3<f32>, normal: vec3<f32
|
|
127
|
+
* fn brick_material_metal_rough(slot: u32, local: vec3<f32>, normal: vec3<f32>, atlas_shift: u32) -> SurfaceMaterialMetalRough
|
|
127
128
|
* ```
|
|
128
129
|
*
|
|
129
130
|
* @type {CodeChunk}
|
|
@@ -131,8 +132,8 @@ chunk_brick_material_surface_pick.requireResource(BRICK_MATERIAL_EMISSIVE_RESOUR
|
|
|
131
132
|
export const chunk_brick_material_metal_rough = CodeChunk.from(
|
|
132
133
|
//language=WGSL
|
|
133
134
|
`
|
|
134
|
-
fn brick_material_metal_rough(slot: u32, local: vec3<f32>, normal: vec3<f32
|
|
135
|
-
return surface_material_metal_rough(brick_atlas, brick_material_metal_rough_codes, brick_material_tile(slot), brick_material_corners(slot, local, normal));
|
|
135
|
+
fn brick_material_metal_rough(slot: u32, local: vec3<f32>, normal: vec3<f32>, atlas_shift: u32) -> SurfaceMaterialMetalRough {
|
|
136
|
+
return surface_material_metal_rough(brick_atlas, brick_material_metal_rough_codes, brick_material_tile(slot), brick_material_corners(slot, local, normal, atlas_shift));
|
|
136
137
|
}
|
|
137
138
|
`, [
|
|
138
139
|
chunk_brick_material_corners,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader_brick_material_gather.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/material/shader_brick_material_gather.js"],"names":[],"mappings":"AA0CA;;GAEG;AACH,6CAFU,YAAY,
|
|
1
|
+
{"version":3,"file":"shader_brick_material_gather.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/material/shader_brick_material_gather.js"],"names":[],"mappings":"AA0CA;;GAEG;AACH,6CAFU,YAAY,CASY;AAmClC;;;;;;;;;;;;;;;;;GAiBG;AACH,2CAFU,aAAa,CA0EpB;6BA5J0B,sCAAsC;8BALrC,kCAAkC"}
|
|
@@ -48,6 +48,8 @@ export const BRICK_MATERIAL_GATHER_SETTINGS = WebGPUStruct.from({
|
|
|
48
48
|
ring_capacity: u32,
|
|
49
49
|
/** cells a cascade's window has a side */
|
|
50
50
|
resolution: u32,
|
|
51
|
+
/** the brick atlas's footprint as shifts, `GPUBrickClipmap#atlas_shift` */
|
|
52
|
+
brick_atlas_shift: u32,
|
|
51
53
|
}, "BrickMaterialGatherSettings");
|
|
52
54
|
|
|
53
55
|
/**
|
|
@@ -133,8 +135,8 @@ fn main(
|
|
|
133
135
|
|
|
134
136
|
// in voxels: a voxel of 1
|
|
135
137
|
let local = vec3<f32>(t);
|
|
136
|
-
let d = brick_clipmap_sample(taken.entry, local, 1.0);
|
|
137
|
-
let n = brick_clipmap_normal(taken.entry, local);
|
|
138
|
+
let d = brick_clipmap_sample(taken.entry, local, 1.0, settings.brick_atlas_shift);
|
|
139
|
+
let n = brick_clipmap_normal(taken.entry, local, settings.brick_atlas_shift);
|
|
138
140
|
|
|
139
141
|
if (!(any(n != vec3<f32>(0.0)) && abs(d) * max(max(abs(n.x), abs(n.y)), abs(n.z)) < 1.0)) {
|
|
140
142
|
return;
|
|
@@ -31,8 +31,11 @@
|
|
|
31
31
|
* **A frame's lifetime** ({@link graph_update}, §8.3, §8.5): retire frees the probes whose points left
|
|
32
32
|
* their windows and those the last frame's schedule evicted, the wants mark the cages they read, admit
|
|
33
33
|
* gives each wanted point without a probe a NEW one, schedule sets the period T from the probes waiting
|
|
34
|
-
* for an update and the next frame's eviction from the pressure on the slots
|
|
35
|
-
* the due passes list the frame's updates, NEW probes first.
|
|
34
|
+
* for an update and the idle ones, and the next frame's eviction from the pressure on the slots
|
|
35
|
+
* (`PROBE_FREE_SLACK`), and the due passes list the frame's updates, NEW probes first. Every live probe
|
|
36
|
+
* keeps being updated: one a want waits on every period, an idle one once in
|
|
37
|
+
* `probe_clipmap_idle_periods` of them, so the light a probe holds is no older than that whether or not
|
|
38
|
+
* anything wants it.
|
|
36
39
|
*
|
|
37
40
|
* **The frame's rays** (§8.6): the lifetime's last passes lay them out. Each listed probe's rays this update
|
|
38
41
|
* are a count the budget does not scale (a uniform update's R, a DEAD probe's `PROBE_DEAD_RAYS`) and a request it
|
|
@@ -136,6 +139,20 @@ export class GPUProbeClipmap {
|
|
|
136
139
|
* @returns {Object} bindings
|
|
137
140
|
*/
|
|
138
141
|
write_sampling_bindings(bindings: any): any;
|
|
142
|
+
/**
|
|
143
|
+
* Put what a want recorded after the frame's lifetime binds into `bindings`, under the names
|
|
144
|
+
* `chunk_probe_clipmap_want` reads them by, with its settings as `settings`: the levels, and the late
|
|
145
|
+
* wanted list and bits in place of the frame's. The next frame's lifetime takes what was wanted there into its
|
|
146
|
+
* own wanted set, where its windows still hold the point (§8.3): a probe such a want asks for is admitted
|
|
147
|
+
* a frame later than one the frame's own wants ask for.
|
|
148
|
+
*
|
|
149
|
+
* For a pass that runs after this frame's lifetime; take them each frame. Asking is what makes the next
|
|
150
|
+
* lifetime take the late set.
|
|
151
|
+
*
|
|
152
|
+
* @param {Object} bindings
|
|
153
|
+
* @returns {Object} bindings
|
|
154
|
+
*/
|
|
155
|
+
write_want_bindings(bindings: any): any;
|
|
139
156
|
/**
|
|
140
157
|
* @returns {GPUTexture}
|
|
141
158
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GPUProbeClipmap.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GPUProbeClipmap.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.js"],"names":[],"mappings":"AA6HA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH;IAmTI;;;;;;;;;;;;;;;;;;;OAmBG;IACH;QAjB2B,aAAa,EAA7B,MAAM;QAEU,UAAU,EAA1B,MAAM;QAKU,OAAO,EAAvB,MAAM;QACU,mBAAmB,EAAnC,MAAM;QAEU,gBAAgB,EAAhC,MAAM;QACW,cAAc,EAA/B,OAAO;QAES,KAAK,EAArB,MAAM;QACU,QAAQ,EAAxB,MAAM;OAmHhB;IAtbD;;;OAGG;IACH,wBAHU,MAAM,CAGF;IAEd;;;;OAIG;IACH,qBAHU,MAAM,CAGL;IAEX;;;;OAIG;IACH,kBAHU,MAAM,CAGR;IAER;;;;OAIG;IACH,8BAHU,MAAM,CAGI;IAEpB;;;;OAIG;IACH,2BAHU,MAAM,CAGC;IAEjB;;;;;OAKG;IACH,yBAHU,OAAO,CAGF;IAEf;;;;OAIG;IACH,gBAHU,MAAM,CAGV;IAyYN;;;;;;;;OAQG;IACH,4CAUC;IAED;;;;;;;;;;;;OAYG;IACH,wCAuBC;IAED;;OAEG;IACH,8BAEC;IAED;;;;;OAKG;IACH,uBAEC;IAED;;;OAGG;IACH,yBAEC;IAED;;;OAGG;IACH,sBAEC;IAGD;;;OAGG;IACH,0BAEC;IAED;;;;;OAKG;IACH,wBAEC;IAED;;;OAGG;IACH,uBAEC;IAED;;;;OAIG;IACH,gBAJW,MAAM,QACN,MAAM,GACJ,MAAM,CAIlB;IAED;;;OAGG;IACH,mBAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;OAGG;IACH,oBAHW,oBAAoB,GAClB,OAAO,CAQnB;IAED;;;;;;;OAOG;IACH,SAJW,MAAM,KACN,MAAM,KACN,MAAM,QAkChB;IAED;;;;;;;;OAQG;IACH,sBAFW,eAAe,QA+BzB;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH;QAzB+B,KAAK,EAAzB,UAAU;QACiB,KAAK,EAAhC,iBAAiB;QACD,eAAe,EAA/B,MAAM;QACU,UAAU,EAA1B,MAAM;QACU,cAAc,EAA9B,MAAM;QACyD,aAAa,EAA5E,OAAO,6BAA6B,EAAE,eAAe;QAErC,MAAM,EAAtB,MAAM;QAE+D,KAAK,EAA1E,OAAO,mCAAmC,EAAE,eAAe;QAEP,QAAQ,EAA5D;YAAC,cAAc,qBAA0B;SAAC;QAEzB,kBAAkB,EAAnC,OAAO;QAEU,cAAc,EAA/B,OAAO;QAEiC,QAAQ,EAAhD;YAAC,MAAM,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAC;QAEL,YAAY,EAArC,eAAe;QACU,eAAe,EAAxC,eAAe;QACC,QAAQ,EAAxB,MAAM;aAuQhB;IAkiBD,gBAcC;;CACJ;mCAtkDY,OAAO,4BAA4B,EAAE,oBAAoB;yBACzD,OAAO,iEAAiE,EAAE,UAAU;gCACpF,OAAO,8BAA8B,EAAE,uBAAuB,GAAC,OAAO,2BAA2B,EAAE,oBAAoB"}
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
CLIPMAP_LEVEL_STRUCT
|
|
27
27
|
} from "../../../shader/chunk/clipmap/CLIPMAP_LEVEL_STRUCT.js";
|
|
28
28
|
import { ShaderSwitchSet } from "../../../shader/compiler/ShaderSwitchSet.js";
|
|
29
|
+
import { build_indirect_compute_dispatch_command } from "../../../gpu_primitive/indirect/IndirectComputeCommandBuildPass.js";
|
|
29
30
|
import { graph_import_buffer } from "../../../shader/graph/graph_import_buffer.js";
|
|
30
31
|
import { GPUTileAtlas2D } from "../../../texture/atlas/GPUTileAtlas2D.js";
|
|
31
32
|
import {
|
|
@@ -39,6 +40,7 @@ import {
|
|
|
39
40
|
import { PROBE_SAMPLING_STRUCT } from "./chunk_probe_clipmap_pick.js";
|
|
40
41
|
import {
|
|
41
42
|
probe_clipmap_guide_words,
|
|
43
|
+
probe_clipmap_idle_periods,
|
|
42
44
|
probe_clipmap_maps_words,
|
|
43
45
|
PROBE_CASCADE_HYSTERESIS,
|
|
44
46
|
PROBE_CASCADE_STEP,
|
|
@@ -92,6 +94,7 @@ import { shader_probe_clipmap_schedule } from "./shader_probe_clipmap_schedule.j
|
|
|
92
94
|
import { shader_probe_clipmap_shade } from "./shader_probe_clipmap_shade.js";
|
|
93
95
|
import { shader_probe_clipmap_trace } from "./shader_probe_clipmap_trace.js";
|
|
94
96
|
import { shader_probe_clipmap_trace_command } from "./shader_probe_clipmap_trace_command.js";
|
|
97
|
+
import { shader_probe_clipmap_want_late } from "./shader_probe_clipmap_want_late.js";
|
|
95
98
|
|
|
96
99
|
/**
|
|
97
100
|
* @typedef {import("../ProbeClipmapSettings.js").ProbeClipmapSettings} ProbeClipmapSettings
|
|
@@ -153,8 +156,11 @@ const SAMPLING_SELECT_HALF = PROBE_SAMPLING_STRUCT.get("select_half").offset >>>
|
|
|
153
156
|
* **A frame's lifetime** ({@link graph_update}, §8.3, §8.5): retire frees the probes whose points left
|
|
154
157
|
* their windows and those the last frame's schedule evicted, the wants mark the cages they read, admit
|
|
155
158
|
* gives each wanted point without a probe a NEW one, schedule sets the period T from the probes waiting
|
|
156
|
-
* for an update and the next frame's eviction from the pressure on the slots
|
|
157
|
-
* the due passes list the frame's updates, NEW probes first.
|
|
159
|
+
* for an update and the idle ones, and the next frame's eviction from the pressure on the slots
|
|
160
|
+
* (`PROBE_FREE_SLACK`), and the due passes list the frame's updates, NEW probes first. Every live probe
|
|
161
|
+
* keeps being updated: one a want waits on every period, an idle one once in
|
|
162
|
+
* `probe_clipmap_idle_periods` of them, so the light a probe holds is no older than that whether or not
|
|
163
|
+
* anything wants it.
|
|
158
164
|
*
|
|
159
165
|
* **The frame's rays** (§8.6): the lifetime's last passes lay them out. Each listed probe's rays this update
|
|
160
166
|
* are a count the budget does not scale (a uniform update's R, a DEAD probe's `PROBE_DEAD_RAYS`) and a request it
|
|
@@ -372,6 +378,20 @@ export class GPUProbeClipmap {
|
|
|
372
378
|
/** Points the wanted list holds: the fewer of the keys and what the wants can want, as it last grew. */
|
|
373
379
|
#wanted_capacity = 0;
|
|
374
380
|
|
|
381
|
+
/**
|
|
382
|
+
* The late wants (§8.3): a wanted list and its bits, which a reader drawn after the frame's lifetime wants
|
|
383
|
+
* into; the windows its keys were written in; and the launch that takes them into the next frame's wanted
|
|
384
|
+
* set. Made when a reader first asks for them ({@link write_want_bindings}).
|
|
385
|
+
* @type {{list: GPUBuffer, bits: GPUBuffer, levels: GPUBuffer, command: GPUBuffer}|null}
|
|
386
|
+
*/
|
|
387
|
+
#late = null;
|
|
388
|
+
|
|
389
|
+
/** Whether a reader has asked for the late set since a lifetime last took it. */
|
|
390
|
+
#late_pending = false;
|
|
391
|
+
|
|
392
|
+
/** Whether the frame's lifetime takes the late set: {@link #late_pending} as the frame was recorded. */
|
|
393
|
+
#late_taken = false;
|
|
394
|
+
|
|
375
395
|
/** Whether the next frame is the first, which fills the indirection and the free list. */
|
|
376
396
|
#fill_pending = true;
|
|
377
397
|
|
|
@@ -403,20 +423,27 @@ export class GPUProbeClipmap {
|
|
|
403
423
|
#levels_data = new ArrayBuffer(CLIPMAP_LEVEL_ARRAY.size);
|
|
404
424
|
#levels_i32 = new Int32Array(this.#levels_data);
|
|
405
425
|
#levels_f32 = new Float32Array(this.#levels_data);
|
|
426
|
+
#levels_u8 = new Uint8Array(this.#levels_data);
|
|
427
|
+
|
|
428
|
+
/** The levels as the frame before uploaded them: the windows its late wants were written in. */
|
|
429
|
+
#late_levels_u8 = new Uint8Array(CLIPMAP_LEVEL_ARRAY.size);
|
|
406
430
|
|
|
407
431
|
#retire_settings = { capacity: 0, resolution: 0, frame: 0 };
|
|
408
432
|
#want_settings = { cascade_count: 0, resolution: 0, frame: 0, wanted_capacity: 0, anchor: new Float32Array(3), select_half: 0 };
|
|
433
|
+
/** {@link #want_settings} for the late wants, whose list holds every key. */
|
|
434
|
+
#late_want_settings = { cascade_count: 0, resolution: 0, frame: 0, wanted_capacity: 0, anchor: new Float32Array(3), select_half: 0 };
|
|
435
|
+
#late_settings = { resolution: 0, wanted_capacity: 0, late_capacity: 0 };
|
|
409
436
|
#admit_command_settings = { wanted_capacity: 0 };
|
|
410
437
|
#admit_settings = { capacity: 0, resolution: 0, wanted_capacity: 0, frame: 0 };
|
|
411
|
-
#schedule_settings = { capacity: 0, wanted_capacity: 0, trace_capacity: 0, slack: 0 };
|
|
412
|
-
#due_settings = { capacity: 0, trace_capacity: 0, frame: 0, new_only: 0 };
|
|
438
|
+
#schedule_settings = { capacity: 0, wanted_capacity: 0, trace_capacity: 0, slack: 0, idle_periods: 1 };
|
|
439
|
+
#due_settings = { capacity: 0, trace_capacity: 0, frame: 0, new_only: 0, idle_periods: 1 };
|
|
413
440
|
#trace_command_settings = { trace_capacity: 0, radiance_resolution: 0, depth_resolution: 0, radiance_skirt: 0 };
|
|
414
441
|
#order_settings = { trace_capacity: 0, resolution: 0, axis_bits: 0 };
|
|
415
442
|
#ray_counts_settings = { trace_capacity: 0, rays_per_probe: 0, rays_min: 0, rays_dead: 0, radiance_resolution: 0, uniform_period: PROBE_UNIFORM_PERIOD };
|
|
416
443
|
#ray_layout_settings = { trace_capacity: 0, ray_budget: 0 };
|
|
417
|
-
#relocate_settings = { trace_capacity: 0, brick_cascade_count: 0 };
|
|
444
|
+
#relocate_settings = { trace_capacity: 0, brick_cascade_count: 0, brick_atlas_shift: 0 };
|
|
418
445
|
#guide_settings = { trace_capacity: 0, rays_per_probe: 0, radiance_resolution: 0, radiance_tiles_per_row: 0, radiance_skirt: 0 };
|
|
419
|
-
#trace_settings = { trace_capacity: 0, rays_per_probe: 0, radiance_resolution: 0, brick_cascade_count: 0, t_max: 0, uniform_period: PROBE_UNIFORM_PERIOD };
|
|
446
|
+
#trace_settings = { trace_capacity: 0, rays_per_probe: 0, radiance_resolution: 0, brick_cascade_count: 0, t_max: 0, uniform_period: PROBE_UNIFORM_PERIOD, brick_atlas_shift: 0 };
|
|
420
447
|
#accumulate_settings = { trace_capacity: 0, rays_per_probe: 0, radiance_resolution: 0, depth_resolution: 0, radiance_tiles_per_row: 0, radiance_skirt: 0, depth_tiles_per_row: 0, uniform_period: PROBE_UNIFORM_PERIOD };
|
|
421
448
|
#project_settings = { trace_capacity: 0, rays_per_probe: 0, radiance_resolution: 0, depth_resolution: 0, frame: 0, uniform_period: PROBE_UNIFORM_PERIOD, rays_min: 0, rays_max: 0 };
|
|
422
449
|
#publish_settings = { trace_capacity: 0, radiance_resolution: 0, depth_resolution: 0, radiance_tiles_per_row: 0, radiance_skirt: 0, depth_tiles_per_row: 0 };
|
|
@@ -430,6 +457,9 @@ export class GPUProbeClipmap {
|
|
|
430
457
|
/** What a want binds of this clipmap: its levels, wanted list and bits, and its want settings. */
|
|
431
458
|
#want_bindings = {};
|
|
432
459
|
|
|
460
|
+
/** What taking the late set binds. */
|
|
461
|
+
#late_bindings = {};
|
|
462
|
+
|
|
433
463
|
/** The bounce's sets as their clipmaps hold them, under the bounce pass's names. */
|
|
434
464
|
#set_bindings = {};
|
|
435
465
|
|
|
@@ -613,6 +643,44 @@ export class GPUProbeClipmap {
|
|
|
613
643
|
return bindings;
|
|
614
644
|
}
|
|
615
645
|
|
|
646
|
+
/**
|
|
647
|
+
* Put what a want recorded after the frame's lifetime binds into `bindings`, under the names
|
|
648
|
+
* `chunk_probe_clipmap_want` reads them by, with its settings as `settings`: the levels, and the late
|
|
649
|
+
* wanted list and bits in place of the frame's. The next frame's lifetime takes what was wanted there into its
|
|
650
|
+
* own wanted set, where its windows still hold the point (§8.3): a probe such a want asks for is admitted
|
|
651
|
+
* a frame later than one the frame's own wants ask for.
|
|
652
|
+
*
|
|
653
|
+
* For a pass that runs after this frame's lifetime; take them each frame. Asking is what makes the next
|
|
654
|
+
* lifetime take the late set.
|
|
655
|
+
*
|
|
656
|
+
* @param {Object} bindings
|
|
657
|
+
* @returns {Object} bindings
|
|
658
|
+
*/
|
|
659
|
+
write_want_bindings(bindings) {
|
|
660
|
+
if (this.#late === null) {
|
|
661
|
+
this.#late = {
|
|
662
|
+
// every key once: a late want can want any point of the lattice
|
|
663
|
+
list: this.#create_buffer('probe late wanted', LIST_HEADER_BYTES + 4 * this.#key_count, GPUBufferUsage.COPY_DST),
|
|
664
|
+
bits: this.#create_buffer('probe late wanted bits', 4 * Math.ceil(this.#key_count / 32), 0),
|
|
665
|
+
levels: this.#device.createBuffer(BufferDescriptor.fromJSON({
|
|
666
|
+
label: `${this.label} / probe late levels`,
|
|
667
|
+
size: CLIPMAP_LEVEL_ARRAY.size,
|
|
668
|
+
usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,
|
|
669
|
+
})),
|
|
670
|
+
command: this.#create_buffer('probe late command', 16, GPUBufferUsage.INDIRECT),
|
|
671
|
+
};
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
this.#late_pending = true;
|
|
675
|
+
|
|
676
|
+
bindings.probe_levels = this.#levels;
|
|
677
|
+
bindings.probe_wanted = this.#late.list;
|
|
678
|
+
bindings.probe_wanted_bits = this.#late.bits;
|
|
679
|
+
bindings.settings = this.#late_want_settings;
|
|
680
|
+
|
|
681
|
+
return bindings;
|
|
682
|
+
}
|
|
683
|
+
|
|
616
684
|
/**
|
|
617
685
|
* @returns {GPUTexture}
|
|
618
686
|
*/
|
|
@@ -848,12 +916,24 @@ export class GPUProbeClipmap {
|
|
|
848
916
|
const rays_min = Math.min(PROBE_RAYS_PER_TEXEL_MIN * texels, rays_per_probe);
|
|
849
917
|
const rays_dead = Math.min(PROBE_DEAD_RAYS, rays_per_probe);
|
|
850
918
|
const rays_max = PROBE_RAYS_PER_TEXEL_MAX * texels;
|
|
919
|
+
const idle_periods = probe_clipmap_idle_periods(rays_per_probe, this.radiance_resolution);
|
|
851
920
|
|
|
852
921
|
this.#ensure_trace(trace_capacity);
|
|
853
922
|
// the requests share what the counts leave of the budget, so the frame's rays are at most it
|
|
854
923
|
this.#ensure_rays(ray_budget);
|
|
855
924
|
|
|
856
|
-
|
|
925
|
+
const levels_bytes = this.cascade_count * CLIPMAP_LEVEL_STRUCT.aligned_size;
|
|
926
|
+
|
|
927
|
+
// what was wanted late, in the last frame's windows, is taken in this frame's lifetime
|
|
928
|
+
this.#late_taken = this.#late_pending;
|
|
929
|
+
this.#late_pending = false;
|
|
930
|
+
|
|
931
|
+
if (this.#late_taken) {
|
|
932
|
+
this.#device.queue.writeBuffer(this.#late.levels, 0, this.#late_levels_u8, 0, levels_bytes);
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
this.#device.queue.writeBuffer(this.#levels, 0, this.#levels_data, 0, levels_bytes);
|
|
936
|
+
this.#late_levels_u8.set(this.#levels_u8);
|
|
857
937
|
|
|
858
938
|
// the readers' view of the clipmap: its shape, and the depth and radiance atlases', which grow by rows
|
|
859
939
|
const depth_texture = this.#depth.texture_at(0);
|
|
@@ -884,12 +964,25 @@ export class GPUProbeClipmap {
|
|
|
884
964
|
this.#want_settings.cascade_count = this.cascade_count;
|
|
885
965
|
this.#want_settings.resolution = this.resolution;
|
|
886
966
|
this.#want_settings.frame = this.#frame;
|
|
887
|
-
|
|
967
|
+
// the late wants can want any point, so with them the list holds every key
|
|
968
|
+
this.#ensure_wanted(this.#late !== null ? this.#key_count : Math.min(this.#key_count, wants.wanted_bound()));
|
|
888
969
|
|
|
889
970
|
this.#want_settings.wanted_capacity = this.#wanted_capacity;
|
|
890
971
|
this.#want_settings.anchor.set(this.#anchor);
|
|
891
972
|
this.#want_settings.select_half = this.#select_half;
|
|
892
973
|
|
|
974
|
+
const late_want = this.#late_want_settings;
|
|
975
|
+
|
|
976
|
+
late_want.cascade_count = this.cascade_count;
|
|
977
|
+
late_want.resolution = this.resolution;
|
|
978
|
+
late_want.frame = this.#frame;
|
|
979
|
+
late_want.wanted_capacity = this.#key_count;
|
|
980
|
+
late_want.anchor.set(this.#anchor);
|
|
981
|
+
late_want.select_half = this.#select_half;
|
|
982
|
+
|
|
983
|
+
this.#late_settings.resolution = this.resolution;
|
|
984
|
+
this.#late_settings.wanted_capacity = this.#wanted_capacity;
|
|
985
|
+
this.#late_settings.late_capacity = this.#key_count;
|
|
893
986
|
|
|
894
987
|
this.#admit_command_settings.wanted_capacity = this.#wanted_capacity;
|
|
895
988
|
|
|
@@ -902,10 +995,12 @@ export class GPUProbeClipmap {
|
|
|
902
995
|
this.#schedule_settings.wanted_capacity = this.#wanted_capacity;
|
|
903
996
|
this.#schedule_settings.trace_capacity = trace_capacity;
|
|
904
997
|
this.#schedule_settings.slack = Math.ceil(this.#capacity * PROBE_FREE_SLACK);
|
|
998
|
+
this.#schedule_settings.idle_periods = idle_periods;
|
|
905
999
|
|
|
906
1000
|
this.#due_settings.capacity = this.#capacity;
|
|
907
1001
|
this.#due_settings.trace_capacity = trace_capacity;
|
|
908
1002
|
this.#due_settings.frame = this.#frame;
|
|
1003
|
+
this.#due_settings.idle_periods = idle_periods;
|
|
909
1004
|
|
|
910
1005
|
this.#trace_command_settings.trace_capacity = trace_capacity;
|
|
911
1006
|
this.#trace_command_settings.radiance_resolution = this.radiance_resolution;
|
|
@@ -942,10 +1037,12 @@ export class GPUProbeClipmap {
|
|
|
942
1037
|
this.#trace_settings.rays_per_probe = rays_per_probe;
|
|
943
1038
|
this.#trace_settings.radiance_resolution = this.radiance_resolution;
|
|
944
1039
|
this.#trace_settings.brick_cascade_count = brick_clipmap.cascade_count;
|
|
1040
|
+
this.#trace_settings.brick_atlas_shift = brick_clipmap.atlas_shift;
|
|
945
1041
|
this.#trace_settings.t_max = Math.sqrt(3) * brick_clipmap.resolution * brick_clipmap.cell_size(coarsest);
|
|
946
1042
|
|
|
947
1043
|
this.#relocate_settings.trace_capacity = trace_capacity;
|
|
948
1044
|
this.#relocate_settings.brick_cascade_count = brick_clipmap.cascade_count;
|
|
1045
|
+
this.#relocate_settings.brick_atlas_shift = brick_clipmap.atlas_shift;
|
|
949
1046
|
|
|
950
1047
|
const accumulate = this.#accumulate_settings;
|
|
951
1048
|
|
|
@@ -1239,6 +1336,27 @@ export class GPUProbeClipmap {
|
|
|
1239
1336
|
|
|
1240
1337
|
this.#wants.encode(encoder, data, resources, want);
|
|
1241
1338
|
|
|
1339
|
+
if (this.#late_taken) {
|
|
1340
|
+
// and what was wanted after the last frame's lifetime, a thread a key
|
|
1341
|
+
const late = this.#late;
|
|
1342
|
+
const taken = this.#late_bindings;
|
|
1343
|
+
|
|
1344
|
+
build_indirect_compute_dispatch_command(PROBE_THREAD_WORKGROUP_SIZE, encoder, late.list, 0, late.command, 0);
|
|
1345
|
+
|
|
1346
|
+
taken.probe_levels = this.#levels;
|
|
1347
|
+
taken.probe_late_levels = late.levels;
|
|
1348
|
+
taken.probe_late_wanted = late.list;
|
|
1349
|
+
taken.probe_late_wanted_bits = late.bits;
|
|
1350
|
+
taken.probe_wanted = this.#wanted;
|
|
1351
|
+
taken.probe_wanted_bits = this.#wanted_bits;
|
|
1352
|
+
taken.settings = this.#late_settings;
|
|
1353
|
+
|
|
1354
|
+
shader_probe_clipmap_want_late.dispatchIndirect({ encoder, bindings: taken, command: late.command });
|
|
1355
|
+
|
|
1356
|
+
// its bits the threads cleared, key by key
|
|
1357
|
+
encoder.clearBuffer(late.list, 0, 4);
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1242
1360
|
encoder.clearBuffer(this.#trace, 0, 4);
|
|
1243
1361
|
|
|
1244
1362
|
b.settings = this.#admit_command_settings;
|
|
@@ -1258,7 +1376,7 @@ export class GPUProbeClipmap {
|
|
|
1258
1376
|
|
|
1259
1377
|
shader_probe_clipmap_schedule.dispatch({ encoder, bindings: b });
|
|
1260
1378
|
|
|
1261
|
-
// the frame's updates: the NEW probes first, then those whose turn it is
|
|
1379
|
+
// the frame's updates: the NEW probes first, then those whose turn it is, waiting or idle
|
|
1262
1380
|
const due = this.#due_settings;
|
|
1263
1381
|
|
|
1264
1382
|
b.settings = due;
|
|
@@ -1581,7 +1699,7 @@ export class GPUProbeClipmap {
|
|
|
1581
1699
|
this.#radiance.destroy();
|
|
1582
1700
|
this.#depth.destroy();
|
|
1583
1701
|
|
|
1584
|
-
for (const buffer of [this.#levels, this.#states, this.#estimators, this.#records, this.#free, this.#listed, this.#candidates, this.#counters, this.#dispatch, this.#eviction, ...this.#active, this.#wanted, this.#wanted_bits, this.#trace, this.#origins, this.#maps, this.#guide, this.#resamples, this.#projection, this.#requests, this.#ray_counts, this.#ray_requests, this.#ray_count_sums, this.#ray_request_sums, this.#ray_sums, this.#ray_scan_spine, this.#ray_scan_command, this.#rays, this.#sampling]) {
|
|
1702
|
+
for (const buffer of [this.#levels, this.#states, this.#estimators, this.#records, this.#free, this.#listed, this.#candidates, this.#counters, this.#dispatch, this.#eviction, ...this.#active, this.#wanted, this.#wanted_bits, this.#trace, this.#origins, this.#maps, this.#guide, this.#resamples, this.#projection, this.#requests, this.#ray_counts, this.#ray_requests, this.#ray_count_sums, this.#ray_request_sums, this.#ray_sums, this.#ray_scan_spine, this.#ray_scan_command, this.#rays, this.#sampling, this.#late?.list, this.#late?.bits, this.#late?.levels, this.#late?.command]) {
|
|
1585
1703
|
buffer?.destroy();
|
|
1586
1704
|
}
|
|
1587
1705
|
}
|
|
@@ -9,6 +9,16 @@
|
|
|
9
9
|
* @returns {number}
|
|
10
10
|
*/
|
|
11
11
|
export function probe_clipmap_maps_words(radiance_resolution: number, depth_resolution: number): number;
|
|
12
|
+
/**
|
|
13
|
+
* Periods between an idle probe's updates, and the idle probes the period counts as one waiting: R over
|
|
14
|
+
* the rays a period an idle probe keeps ({@link PROBE_RAYS_PER_TEXEL_IDLE}), a ray at least. So the
|
|
15
|
+
* period is the probes' rays over the budget: R a waiting probe, those an idle one.
|
|
16
|
+
*
|
|
17
|
+
* @param {number} rays_per_probe rays a uniform update casts, R
|
|
18
|
+
* @param {number} radiance_resolution octahedral radiance texels a side, n_r
|
|
19
|
+
* @returns {number} a positive integer
|
|
20
|
+
*/
|
|
21
|
+
export function probe_clipmap_idle_periods(rays_per_probe: number, radiance_resolution: number): number;
|
|
12
22
|
/**
|
|
13
23
|
* Words of a listed probe's guide (`probe_guide`), as the guide passes write it, in this order:
|
|
14
24
|
* - n_r² first rays, by walk position;
|
|
@@ -70,7 +80,8 @@ export const PROBE_COUNTER_FREE: number;
|
|
|
70
80
|
*/
|
|
71
81
|
export const PROBE_COUNTER_STARVED: number;
|
|
72
82
|
/**
|
|
73
|
-
* The frame's period T, as schedule sets it (§8.5): frames between a wanted probe's updates
|
|
83
|
+
* The frame's period T, as schedule sets it (§8.5): frames between a wanted probe's updates, and
|
|
84
|
+
* `probe_clipmap_idle_periods` of them between an idle one's.
|
|
74
85
|
* @type {number}
|
|
75
86
|
*/
|
|
76
87
|
export const PROBE_COUNTER_PERIOD: number;
|
|
@@ -275,6 +286,13 @@ export const PROBE_DEAD_RAYS: number;
|
|
|
275
286
|
* @type {number}
|
|
276
287
|
*/
|
|
277
288
|
export const PROBE_RAYS_PER_TEXEL_MAX: number;
|
|
289
|
+
/**
|
|
290
|
+
* Rays a period an idle probe keeps, of the radiance texels: a sixteenth, Enshrouded's floor of 16 rays on
|
|
291
|
+
* its 16×16 map. An idle probe is a live one no want waits on: past its first update, and not wanted since
|
|
292
|
+
* its last. It keeps them as whole updates, one in {@link probe_clipmap_idle_periods} periods (§8.5).
|
|
293
|
+
* @type {number}
|
|
294
|
+
*/
|
|
295
|
+
export const PROBE_RAYS_PER_TEXEL_IDLE: number;
|
|
278
296
|
/**
|
|
279
297
|
* Rays a guided update gives one radiance texel at most, the same gather budget as a depth texel's
|
|
280
298
|
* ({@link PROBE_DEPTH_TEXEL_RAYS}). The guide holds each texel's weight down to it and spreads what it
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PROBE_CLIPMAP.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PROBE_CLIPMAP.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.js"],"names":[],"mappings":"AAoSA;;;;;;;;;GASG;AACH,8DAJW,MAAM,oBACN,MAAM,GACJ,MAAM,CAIlB;AA4CD;;;;;;;;GAQG;AACH,2DAJW,MAAM,uBACN,MAAM,GACJ,MAAM,CAMlB;AAyBD;;;;;;;;;;;GAWG;AACH,+DAHW,MAAM,GACJ,MAAM,CAIlB;AApYD;;;GAGG;AACH,iCAFU,MAAM,CAE6B;AAS7C;;;GAGG;AACH,+BAFU,MAAM,CAEkB;AAElC;;;GAGG;AACH,8BAFU,MAAM,CAEiB;AAEjC;;;GAGG;AACH,gCAFU,MAAM,CAEmB;AAEnC;;;;GAIG;AACH,+BAFU,MAAM,CAEkB;AAElC;;;GAGG;AACH,oCAFU,MAAM,CAEuB;AAEvC;;;GAGG;AACH,wCAFU,MAAM,CAE2B;AAM3C;;;GAGG;AACH,iCAFU,MAAM,CAEoB;AAEpC;;;;GAIG;AACH,oCAFU,MAAM,CAEuB;AAEvC;;;;GAIG;AACH,mCAFU,MAAM,CAEsB;AAEtC;;;;GAIG;AACH,oCAFU,MAAM,CAEuB;AAEvC;;;;;GAKG;AACH,oCAFU,MAAM,CAEuB;AAEvC;;;;GAIG;AACH,gCAFU,MAAM,CAEsC;AAEtD;;;;GAIG;AACH,iCAFU,MAAM,CAEoB;AAEpC;;;GAGG;AACH,kCAFU,MAAM,CAE0D;AAE1E;;;;GAIG;AACH,+BAFU,MAAM,CAEqB;AAQrC;;;;GAIG;AACH,oCAFU,MAAM,CAEuB;AAEvC;;;GAGG;AACH,mCAFU,MAAM,CAEsB;AAEtC;;;GAGG;AACH,oCAFU,MAAM,CAEuB;AAEvC;;;GAGG;AACH,kCAFU,MAAM,CAEqB;AAErC;;;GAGG;AACH,oCAFU,MAAM,CAEwB;AAExC;;;GAGG;AACH,kCAFU,MAAM,CAEsB;AAEtC;;;GAGG;AACH,qCAFU,MAAM,CAEyB;AAEzC;;;;GAIG;AACH,8BAFU,MAAM,CAEoB;AAEpC;;;GAGG;AACH,mCAFU,MAAM,CAEuB;AAEvC;;;GAGG;AACH,mCAFU,MAAM,CAEuB;AAEvC;;;GAGG;AACH,0CAFU,MAAM,CAE8B;AAE9C;;;;GAIG;AACH,yCAFU,MAAM,CAE+B;AAE/C;;;;GAIG;AACH,qCAFU,MAAM,CAE2B;AAE3C;;;GAGG;AACH,qCAFU,MAAM,CAEwB;AAExC;;;;;;;;GAQG;AACH,sCAFU,MAAM,CAE8B;AAE9C;;;GAGG;AACH,qCAFU,MAAM,CAEiC;AAEjD;;;;;GAKG;AACH,mCAFU,MAAM,CAE+B;AAE/C;;;;;;;GAOG;AACH,gCAFU,MAAM,CAE6D;AAE7E;;;;GAIG;AACH,oCAFU,MAAM,CAEyB;AAEzC;;;;;GAKG;AACH,gCAFU,MAAM,CAEsB;AAEtC;;;;GAIG;AACH,mCAFU,MAAM,CAE0C;AAE1D;;;;GAIG;AACH,2CAFU,MAAM,CAEgC;AAEhD;;;GAGG;AACH,qCAFU,MAAM,CAEyB;AAgBzC;;;;;;;GAOG;AACH,mCAFU,MAAM,CAEsB;AAEtC;;;;;GAKG;AACH,uCAFU,MAAM,CAE8B;AAE9C;;;;;GAKG;AACH,8BAFU,MAAM,CAEkB;AAElC;;;;;GAKG;AACH,uCAFU,MAAM,CAE0B;AAE1C;;;;;GAKG;AACH,wCAFU,MAAM,CAEgC;AAiBhD;;;;;GAKG;AACH,+BAFU,MAAM,CAEuC;AAEvD;;;;GAIG;AACH,0CAFU,MAAM,CAEgC;AAEhD;;;;;GAKG;AACH,gCAFU,MAAM,CAEuB;AAkBvC;;;;GAIG;AACH,kCAFU,MAAM,CAEqB;AAQrC;;;GAGG;AACH,kCAFU,MAAM,CAEqB;AAErC;;;;GAIG;AACH,6BAFU,MAAM,CAEgB;AAEhC;;;GAGG;AACH,kCAFU,MAAM,CAEqB;AAErC;;;GAGG;AACH,sCAFU,MAAM,CAEyB;AAEzC;;;GAGG;AACH,oCAFU,MAAM,CAEuB;AAEvC;;;;GAIG;AACH,qCAFU,MAAM,CAEmF;AAOnG;;;;GAIG;AACH,yCAFU,MAAM,CAE6B;AAE7C;;;GAGG;AACH,8BAFU,MAAM,CAEiB;AAEjC;;;GAGG;AACH,yCAFU,MAAM,CAE4B;AAE5C;;;GAGG;AACH,wCAFU,MAAM,CAE4B;AAE5C;;;GAGG;AACH,gCAFU,MAAM,CAEmB;AAEnC;;;GAGG;AACH,kCAFU,MAAM,CAEuB;AAEvC;;;;GAIG;AACH,uCAFU,MAAM,CAE4B;AAE5C;;;GAGG;AACH,iCAFU,MAAM,CAEoB;AAEpC;;;GAGG;AACH,uCAFU,MAAM,CAE4B;AAE5C;;;;;;;;GAQG;AACH,oCAFU,MAAM,CAEiG;AAEjH;;;;GAIG;AACH,wCAFU,MAAM,CAE2B"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AGE_EVICTION_BUCKETS } from "../../../gpu_primitive/age_eviction/chunk_age_eviction.js";
|
|
1
2
|
import { UINT32_MAX } from "../../../../../core/binary/UINT32_MAX.js";
|
|
2
3
|
|
|
3
4
|
/*
|
|
@@ -77,7 +78,8 @@ export const PROBE_COUNTER_FREE = 0;
|
|
|
77
78
|
export const PROBE_COUNTER_STARVED = 1;
|
|
78
79
|
|
|
79
80
|
/**
|
|
80
|
-
* The frame's period T, as schedule sets it (§8.5): frames between a wanted probe's updates
|
|
81
|
+
* The frame's period T, as schedule sets it (§8.5): frames between a wanted probe's updates, and
|
|
82
|
+
* `probe_clipmap_idle_periods` of them between an idle one's.
|
|
81
83
|
* @type {number}
|
|
82
84
|
*/
|
|
83
85
|
export const PROBE_COUNTER_PERIOD = 2;
|
|
@@ -102,7 +104,7 @@ export const PROBE_COUNTER_EVICTED = 4;
|
|
|
102
104
|
* middle one, so the first holds 2⁻¹⁶ s and under and the last 2¹⁵ s, about nine hours, and over.
|
|
103
105
|
* @type {number}
|
|
104
106
|
*/
|
|
105
|
-
export const PROBE_AGE_BUCKETS =
|
|
107
|
+
export const PROBE_AGE_BUCKETS = AGE_EVICTION_BUCKETS;
|
|
106
108
|
|
|
107
109
|
/**
|
|
108
110
|
* The first of {@link PROBE_AGE_BUCKETS} counters: the probes the frame's retire kept and could have evicted,
|
|
@@ -336,6 +338,29 @@ export const PROBE_DEAD_RAYS = 16;
|
|
|
336
338
|
*/
|
|
337
339
|
export const PROBE_RAYS_PER_TEXEL_MAX = 4;
|
|
338
340
|
|
|
341
|
+
/**
|
|
342
|
+
* Rays a period an idle probe keeps, of the radiance texels: a sixteenth, Enshrouded's floor of 16 rays on
|
|
343
|
+
* its 16×16 map. An idle probe is a live one no want waits on: past its first update, and not wanted since
|
|
344
|
+
* its last. It keeps them as whole updates, one in {@link probe_clipmap_idle_periods} periods (§8.5).
|
|
345
|
+
* @type {number}
|
|
346
|
+
*/
|
|
347
|
+
export const PROBE_RAYS_PER_TEXEL_IDLE = 1 / 16;
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* Periods between an idle probe's updates, and the idle probes the period counts as one waiting: R over
|
|
351
|
+
* the rays a period an idle probe keeps ({@link PROBE_RAYS_PER_TEXEL_IDLE}), a ray at least. So the
|
|
352
|
+
* period is the probes' rays over the budget: R a waiting probe, those an idle one.
|
|
353
|
+
*
|
|
354
|
+
* @param {number} rays_per_probe rays a uniform update casts, R
|
|
355
|
+
* @param {number} radiance_resolution octahedral radiance texels a side, n_r
|
|
356
|
+
* @returns {number} a positive integer
|
|
357
|
+
*/
|
|
358
|
+
export function probe_clipmap_idle_periods(rays_per_probe, radiance_resolution) {
|
|
359
|
+
const rays = Math.max(1, PROBE_RAYS_PER_TEXEL_IDLE * radiance_resolution * radiance_resolution);
|
|
360
|
+
|
|
361
|
+
return Math.max(1, Math.ceil(rays_per_probe / rays));
|
|
362
|
+
}
|
|
363
|
+
|
|
339
364
|
/**
|
|
340
365
|
* Rays a guided update gives one radiance texel at most, the same gather budget as a depth texel's
|
|
341
366
|
* ({@link PROBE_DEPTH_TEXEL_RAYS}). The guide holds each texel's weight down to it and spreads what it
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.d.ts
CHANGED
|
@@ -1,27 +1,35 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A clipmap's probes wanted by the
|
|
3
|
-
* each screen tile wants the cages its pick reads (`shader_probe_clipmap_want`).
|
|
4
|
-
* probes; a {@link GPUProbeClipmap} records them in its lifetime, between retire and admit.
|
|
2
|
+
* A clipmap's probes wanted by the pixels of a screen surface (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.3): one
|
|
3
|
+
* pixel of each screen tile wants the cages its pick reads (`shader_probe_clipmap_want`).
|
|
5
4
|
*
|
|
6
|
-
*
|
|
5
|
+
* The frame's G-buffer is the frustum's probes' own wants, which a {@link GPUProbeClipmap} records in its
|
|
6
|
+
* lifetime, between retire and admit: give it the G-buffer with {@link set} before the clipmap's
|
|
7
|
+
* `graph_update`. A surface drawn apart from the G-buffer, whose reader picks probes per pixel, is another
|
|
8
|
+
* one's, encoded once that surface is drawn into what `GPUProbeClipmap.write_want_bindings` binds.
|
|
7
9
|
*/
|
|
8
10
|
export class ProbeClipmapScreenWants {
|
|
9
11
|
/**
|
|
10
|
-
* The frame's
|
|
12
|
+
* The frame's surface and view.
|
|
11
13
|
*
|
|
12
14
|
* @param {Object} options
|
|
13
|
-
* @param {number} options.depth graph handle of the
|
|
14
|
-
* @param {number} options.normal graph handle of
|
|
15
|
+
* @param {number} options.depth graph handle of the surface's reverse-Z depth, zero where it has none
|
|
16
|
+
* @param {number} options.normal graph handle of its normals, a `uint` texture: a channel holds a normal
|
|
17
|
+
* octahedral, as the G-buffer packs its own
|
|
15
18
|
* @param {GPUBuffer} options.camera the view's camera uniform
|
|
16
19
|
* @param {*} options.stbn the 2-channel spatio-temporal blue noise, `STATIC_GRAPHICS_ENGINE_ASSETS.stbn_vec2`
|
|
17
|
-
* @param {ArrayLike<number>} options.resolution the
|
|
20
|
+
* @param {ArrayLike<number>} options.resolution the surface's pixels, x and y
|
|
21
|
+
* @param {number} [options.normal_channel] the channel that holds the normal, 0 to 3: the G-buffer's is 0
|
|
22
|
+
* @param {boolean} [options.two_sided] whether the surface's reader turns a normal that faces away from the eye
|
|
23
|
+
* to face it, as the reader of a surface seen from both sides does
|
|
18
24
|
*/
|
|
19
|
-
set({ depth, normal, camera, stbn, resolution }: {
|
|
25
|
+
set({ depth, normal, camera, stbn, resolution, normal_channel, two_sided }: {
|
|
20
26
|
depth: number;
|
|
21
27
|
normal: number;
|
|
22
28
|
camera: GPUBuffer;
|
|
23
29
|
stbn: any;
|
|
24
30
|
resolution: ArrayLike<number>;
|
|
31
|
+
normal_channel?: number;
|
|
32
|
+
two_sided?: boolean;
|
|
25
33
|
}): void;
|
|
26
34
|
/**
|
|
27
35
|
* @returns {number} the most points a frame's wants list: a pixel of each tile, the eight points of a cage in
|
|
@@ -29,7 +37,7 @@ export class ProbeClipmapScreenWants {
|
|
|
29
37
|
*/
|
|
30
38
|
wanted_bound(): number;
|
|
31
39
|
/**
|
|
32
|
-
* Declare what the wants read on the
|
|
40
|
+
* Declare what the wants read on the pass that encodes them.
|
|
33
41
|
*
|
|
34
42
|
* @param {import("../../../../../engine/graphics/render/frame_graph/FramePassBuilder.js").FramePassBuilder} pass
|
|
35
43
|
* @param {Object} data the pass's data, which {@link encode} is given back
|
|
@@ -37,7 +45,7 @@ export class ProbeClipmapScreenWants {
|
|
|
37
45
|
graph_declare(pass: import("../../../../../engine/graphics/render/frame_graph/FramePassBuilder.js").FramePassBuilder, data: any): void;
|
|
38
46
|
/**
|
|
39
47
|
* @param {GPUCommandEncoder} encoder
|
|
40
|
-
* @param {Object} data the
|
|
48
|
+
* @param {Object} data the encoding pass's data
|
|
41
49
|
* @param {*} resources the frame graph's resources
|
|
42
50
|
* @param {Object} clipmap what the wanting clipmap binds: `probe_levels`, `probe_wanted`,
|
|
43
51
|
* `probe_wanted_bits` and its want settings as `settings`
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProbeClipmapScreenWants.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.js"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"ProbeClipmapScreenWants.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.js"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AACH;IAsBI;;;;;;;;;;;;;OAaG;IACH;QAV2B,KAAK,EAArB,MAAM;QACU,MAAM,EAAtB,MAAM;QAEa,MAAM;QACd,IAAI;QACY,UAAU,EAArC,UAAU,MAAM,CAAC;QACA,cAAc,GAA/B,MAAM;QACY,SAAS,GAA3B,OAAO;aA2BjB;IAED;;;OAGG;IACH,gBAHa,MAAM,CAKlB;IAED;;;;;OAKG;IACH,oBAHW,OAAO,uEAAuE,EAAE,gBAAgB,mBAQ1G;IAED;;;;;;OAMG;IACH,kFAoBC;;CACJ"}
|