@woosh/meep-engine 3.59.0 → 3.60.1
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/package.json +1 -1
- package/src/shade/playground/probe_clipmap/index.html +12 -0
- package/src/shade/playground/probe_clipmap/main.d.ts.map +1 -1
- package/src/shade/playground/probe_clipmap/main.js +5 -0
- package/src/shade/renderer/Renderer.d.ts.map +1 -1
- package/src/shade/renderer/Renderer.js +4 -6
- package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts +63 -1
- package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.js +228 -16
- package/src/shade/renderer/geometry/sdf/cards/GPUMeshCardSets.d.ts +27 -4
- package/src/shade/renderer/geometry/sdf/cards/GPUMeshCardSets.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/cards/GPUMeshCardSets.js +526 -23
- package/src/shade/renderer/geometry/sdf/cards/MeshCardCaptureMode.d.ts +11 -0
- package/src/shade/renderer/geometry/sdf/cards/MeshCardCaptureMode.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/cards/MeshCardCaptureMode.js +21 -0
- package/src/shade/renderer/geometry/sdf/cards/mesh_cards_raster_pass_descriptor.d.ts +65 -0
- package/src/shade/renderer/geometry/sdf/cards/mesh_cards_raster_pass_descriptor.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/cards/mesh_cards_raster_pass_descriptor.js +376 -0
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_capture.d.ts +7 -3
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_capture.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_capture.js +70 -6
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_args.d.ts +20 -0
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_args.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_args.js +80 -0
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_scatter.d.ts +18 -0
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_scatter.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_scatter.js +113 -0
- package/src/shade/renderer/geometry/virtual/sdf/VGEO_SDF.d.ts +47 -0
- package/src/shade/renderer/geometry/virtual/sdf/VGEO_SDF.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/sdf/VGEO_SDF.js +80 -0
- package/src/shade/renderer/geometry/virtual/sdf/VGeoSDFProxies.d.ts +91 -0
- package/src/shade/renderer/geometry/virtual/sdf/VGeoSDFProxies.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/sdf/VGeoSDFProxies.js +902 -0
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_collect.d.ts +16 -0
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_collect.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_collect.js +67 -0
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_decode.d.ts +17 -0
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_decode.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_decode.js +145 -0
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_traverse.d.ts +12 -0
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_traverse.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_traverse.js +105 -0
- package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_build_gbuffer.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_build_gbuffer.js +2 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts +3 -9
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.js +13 -31
- package/src/shade/renderer/global_illumination/probe_clipmap/PROBE_CLIPMAP_PROPOSAL_2026_10_27.md +764 -48
- package/src/shade/renderer/global_illumination/probe_clipmap/PROBE_RAYS_VARIABLE_AND_SORTED_SCOPE_2026_10_30.md +410 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSceneHolds.d.ts +3 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSceneHolds.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSceneHolds.js +4 -3
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts +41 -17
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.js +57 -33
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/BRICK_CLIPMAP.d.ts +11 -3
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/BRICK_CLIPMAP.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/BRICK_CLIPMAP.js +13 -4
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.d.ts +9 -18
- 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 +8 -10
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap.d.ts +12 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap.js +28 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts +1 -29
- 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 +1 -74
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK.d.ts +161 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK.js +219 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK_INSTANCE_STRUCT.d.ts +1 -8
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK_INSTANCE_STRUCT.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK_INSTANCE_STRUCT.js +1 -9
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MeshSDFBrickProvider.d.ts +40 -12
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MeshSDFBrickProvider.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MeshSDFBrickProvider.js +373 -31
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_instance.d.ts +2 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_instance.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_instance.js +2 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_texel.d.ts +15 -8
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_texel.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_texel.js +28 -14
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_walk.d.ts +23 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_walk.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_walk.js +66 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_batch.d.ts +29 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_batch.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_batch.js +210 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_command.d.ts +29 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_command.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_command.js +86 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_gather.d.ts +41 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_gather.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_gather.js +439 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_resolve.d.ts +23 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_resolve.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_resolve.js +135 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_free.d.ts +3 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_free.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_free.js +12 -3
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts +21 -18
- 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 +254 -73
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.d.ts +149 -8
- 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 +181 -13
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.d.ts +179 -7
- 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 +412 -31
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.js +4 -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 +4 -3
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.d.ts +36 -10
- 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 +218 -29
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_admit.d.ts +5 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_admit.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_admit.js +24 -14
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_due.d.ts +15 -6
- 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 +21 -22
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_guide.d.ts +36 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_guide.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_guide.js +257 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.d.ts +18 -7
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.js +157 -51
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_order.d.ts +23 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_order.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_order.js +110 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.d.ts +24 -2
- 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 +90 -10
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_ray_layout.d.ts +45 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_ray_layout.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_ray_layout.js +205 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_relocate.js +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_retire.d.ts +16 -3
- 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 +55 -10
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_schedule.d.ts +19 -4
- 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 +60 -6
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.d.ts +10 -9
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.js +32 -39
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.d.ts +21 -14
- 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 +100 -30
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace_command.d.ts +6 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace_command.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace_command.js +26 -10
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.d.ts +3 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.js +12 -12
- package/src/shade/renderer/gpu_primitive/sort/SORT_DIGIT_SETTINGS_STRUCT.d.ts +10 -0
- package/src/shade/renderer/gpu_primitive/sort/SORT_DIGIT_SETTINGS_STRUCT.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/sort/SORT_DIGIT_SETTINGS_STRUCT.js +21 -0
- package/src/shade/renderer/gpu_primitive/sort/SORT_PASS_SETTINGS_STRUCT.d.ts +5 -2
- package/src/shade/renderer/gpu_primitive/sort/SORT_PASS_SETTINGS_STRUCT.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/sort/SORT_PASS_SETTINGS_STRUCT.js +31 -23
- package/src/shade/renderer/gpu_primitive/sort/SORT_SIZE_STRUCT.d.ts +10 -0
- package/src/shade/renderer/gpu_primitive/sort/SORT_SIZE_STRUCT.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/sort/SORT_SIZE_STRUCT.js +22 -0
- package/src/shade/renderer/gpu_primitive/sort/chunk_sort_constants.d.ts +9 -0
- package/src/shade/renderer/gpu_primitive/sort/chunk_sort_constants.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/sort/chunk_sort_constants.js +18 -0
- package/src/shade/renderer/gpu_primitive/sort/chunk_sort_digit.d.ts +8 -3
- package/src/shade/renderer/gpu_primitive/sort/chunk_sort_digit.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/sort/chunk_sort_digit.js +41 -32
- package/src/shade/renderer/gpu_primitive/sort/chunk_sort_histogram_tile.d.ts +31 -0
- package/src/shade/renderer/gpu_primitive/sort/chunk_sort_histogram_tile.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/sort/chunk_sort_histogram_tile.js +71 -0
- package/src/shade/renderer/gpu_primitive/sort/chunk_sort_scatter_tile.d.ts +47 -0
- package/src/shade/renderer/gpu_primitive/sort/chunk_sort_scatter_tile.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/sort/chunk_sort_scatter_tile.js +210 -0
- package/src/shade/renderer/gpu_primitive/sort/defs.d.ts +5 -4
- package/src/shade/renderer/gpu_primitive/sort/defs.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/sort/defs.js +5 -4
- package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.d.ts +56 -15
- package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.js +410 -61
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_histogram.d.ts +4 -1
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_histogram.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_histogram.js +16 -42
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_histogram_indirect.d.ts +15 -0
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_histogram_indirect.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_histogram_indirect.js +60 -0
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_prepare.d.ts +25 -0
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_prepare.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_prepare.js +89 -0
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_scatter.d.ts +3 -8
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_scatter.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_scatter.js +28 -160
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_scatter_indirect.d.ts +12 -0
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_scatter_indirect.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_scatter_indirect.js +74 -0
- package/src/shade/renderer/gpu_primitive/sort/verify_radix_sort.d.ts +3 -1
- package/src/shade/renderer/gpu_primitive/sort/verify_radix_sort.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/sort/verify_radix_sort.js +387 -188
- package/src/shade/renderer/lightmap/bake/shader_lightmap_viz_to_irradiance_flat.js +1 -1
- package/src/shade/renderer/lightmap/bake/shader_lightmap_viz_to_sh.js +1 -1
- package/src/shade/renderer/material/resident/GPUResidentMaterialContext.d.ts.map +1 -1
- package/src/shade/renderer/material/resident/GPUResidentMaterialContext.js +90 -72
- package/src/shade/renderer/material/resident/RESIDENT_MATERIAL_TEXTURE_LAYOUT.d.ts +5 -0
- package/src/shade/renderer/material/resident/RESIDENT_MATERIAL_TEXTURE_LAYOUT.d.ts.map +1 -1
- package/src/shade/renderer/material/resident/RESIDENT_MATERIAL_TEXTURE_LAYOUT.js +9 -0
- package/src/shade/renderer/path_tracer/shader/INDIRECT_TEXTURE_FILTER.d.ts +13 -0
- package/src/shade/renderer/path_tracer/shader/INDIRECT_TEXTURE_FILTER.d.ts.map +1 -0
- package/src/shade/renderer/path_tracer/shader/INDIRECT_TEXTURE_FILTER.js +14 -0
- package/src/shade/renderer/path_tracer/shader/IndirectTextureFilter.d.ts +10 -0
- package/src/shade/renderer/path_tracer/shader/IndirectTextureFilter.d.ts.map +1 -0
- package/src/shade/renderer/path_tracer/shader/IndirectTextureFilter.js +15 -0
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_tangent_normal.d.ts +4 -3
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_tangent_normal.d.ts.map +1 -1
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_tangent_normal.js +6 -5
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_texture.d.ts +17 -2
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_texture.d.ts.map +1 -1
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_texture.js +25 -57
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_texture_exact.d.ts +13 -0
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_texture_exact.d.ts.map +1 -0
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_texture_exact.js +70 -0
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_texture_stochastic.d.ts +10 -0
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_texture_stochastic.d.ts.map +1 -0
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_texture_stochastic.js +59 -0
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_texture_load.d.ts +12 -0
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_texture_load.d.ts.map +1 -0
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_texture_load.js +49 -0
- package/src/shade/renderer/path_tracer/shader/chunk_ray_hit_to_opacity.d.ts.map +1 -1
- package/src/shade/renderer/path_tracer/shader/chunk_ray_hit_to_opacity.js +1 -0
- package/src/shade/renderer/path_tracer/shader/chunk_render_trace_path.d.ts.map +1 -1
- package/src/shade/renderer/path_tracer/shader/chunk_render_trace_path.js +1 -0
- package/src/shade/renderer/path_tracer/shader/chunk_sample_material.d.ts.map +1 -1
- package/src/shade/renderer/path_tracer/shader/chunk_sample_material.js +2 -1
- package/src/shade/renderer/path_tracer/shader/chunk_sample_material_data.d.ts +7 -0
- package/src/shade/renderer/path_tracer/shader/chunk_sample_material_data.d.ts.map +1 -1
- package/src/shade/renderer/path_tracer/shader/chunk_sample_material_data.js +15 -6
- package/src/shade/renderer/scene/GPUSceneContext.d.ts +7 -1
- package/src/shade/renderer/scene/GPUSceneContext.d.ts.map +1 -1
- package/src/shade/renderer/scene/GPUSceneContext.js +26 -1
- package/src/shade/renderer/shader/chunk/bvh/chunk_bvh_query_aabb_cooperative.d.ts +7 -7
- package/src/shade/renderer/shader/chunk/bvh/chunk_bvh_query_aabb_cooperative.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/bvh/chunk_bvh_query_aabb_cooperative.js +262 -294
- package/src/shade/renderer/shader/chunk/filter/MULTISCALE_MEAN_STRUCT.d.ts +9 -0
- package/src/shade/renderer/shader/chunk/filter/MULTISCALE_MEAN_STRUCT.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/filter/MULTISCALE_MEAN_STRUCT.js +21 -0
- package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.d.ts +43 -0
- package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.js +87 -0
- package/src/shade/renderer/shader/chunk/noise/r/chunk_r2_canonical.d.ts +7 -1
- package/src/shade/renderer/shader/chunk/noise/r/chunk_r2_canonical.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/noise/r/chunk_r2_canonical.js +1 -1
- package/src/shade/renderer/shader/chunk/subgroup/chunk_subgroup_reserve_workgroup.d.ts +21 -0
- package/src/shade/renderer/shader/chunk/subgroup/chunk_subgroup_reserve_workgroup.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/subgroup/chunk_subgroup_reserve_workgroup.js +42 -0
- package/src/shade/renderer/wind/GPUSceneWind.d.ts +1 -1
- package/src/shade/wgsl/emulator/CPUBitmapData.d.ts +19 -0
- package/src/shade/wgsl/emulator/CPUBitmapData.d.ts.map +1 -1
- package/src/shade/wgsl/emulator/CPUBitmapData.js +27 -0
- package/src/shade/wgsl/emulator/WGSLLanguageCore.d.ts.map +1 -1
- package/src/shade/wgsl/emulator/WGSLLanguageCore.js +65 -19
- package/src/view/elements/progress/segmented/GhostTrail.d.ts +116 -0
- package/src/view/elements/progress/segmented/GhostTrail.d.ts.map +1 -0
- package/src/view/elements/progress/segmented/GhostTrail.js +280 -0
- package/src/view/elements/progress/segmented/RESOURCE_BAR_SEGMENTS.d.ts +3 -1
- package/src/view/elements/progress/segmented/RESOURCE_BAR_SEGMENTS.d.ts.map +1 -1
- package/src/view/elements/progress/segmented/RESOURCE_BAR_SEGMENTS.js +3 -1
- package/src/view/elements/progress/segmented/SEGMENT_TIERS_DEFAULT.d.ts +11 -0
- package/src/view/elements/progress/segmented/SEGMENT_TIERS_DEFAULT.d.ts.map +1 -0
- package/src/view/elements/progress/segmented/SEGMENT_TIERS_DEFAULT.js +15 -0
- package/src/view/elements/progress/segmented/SegmentDefinition.d.ts +3 -0
- package/src/view/elements/progress/segmented/SegmentDefinition.d.ts.map +1 -1
- package/src/view/elements/progress/segmented/SegmentDefinition.js +3 -0
- package/src/view/elements/progress/segmented/SegmentTier.d.ts +38 -0
- package/src/view/elements/progress/segmented/SegmentTier.d.ts.map +1 -0
- package/src/view/elements/progress/segmented/SegmentTier.js +50 -0
- package/src/view/elements/progress/segmented/SegmentedResourceBarView.d.ts +163 -10
- package/src/view/elements/progress/segmented/SegmentedResourceBarView.d.ts.map +1 -1
- package/src/view/elements/progress/segmented/SegmentedResourceBarView.js +442 -101
- package/src/view/elements/progress/segmented/playground/index.html +78 -0
- package/src/view/elements/progress/segmented/playground/main.d.ts +2 -0
- package/src/view/elements/progress/segmented/playground/main.d.ts.map +1 -0
- package/src/view/elements/progress/segmented/playground/main.js +173 -0
- package/src/view/elements/progress/segmented/segment_cell_layout.d.ts +48 -0
- package/src/view/elements/progress/segmented/segment_cell_layout.d.ts.map +1 -0
- package/src/view/elements/progress/segmented/segment_cell_layout.js +75 -0
- package/src/view/elements/progress/segmented/segment_notch_place.d.ts +18 -0
- package/src/view/elements/progress/segmented/segment_notch_place.d.ts.map +1 -0
- package/src/view/elements/progress/segmented/segment_notch_place.js +28 -0
- package/src/view/elements/progress/segmented/segment_tick_positions.d.ts +32 -0
- package/src/view/elements/progress/segmented/segment_tick_positions.d.ts.map +1 -0
- package/src/view/elements/progress/segmented/segment_tick_positions.js +103 -0
- package/src/view/elements/progress/segmented/segmented-resource-bar.css +142 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_provider.d.ts +0 -35
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_provider.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_provider.js +0 -238
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/VGEO_BRICK.d.ts +0 -99
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/VGEO_BRICK.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/VGEO_BRICK.js +0 -139
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/VGeoBrickProvider.d.ts +0 -65
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/VGeoBrickProvider.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/VGeoBrickProvider.js +0 -393
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_box.d.ts +0 -17
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_box.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_box.js +0 -36
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_pair.d.ts +0 -29
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_pair.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_pair.js +0 -108
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_texel.d.ts +0 -31
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_texel.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_texel.js +0 -113
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_triangle.d.ts +0 -36
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_triangle.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_triangle.js +0 -85
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_distance.d.ts +0 -23
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_distance.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_distance.js +0 -273
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_gather.d.ts +0 -13
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_gather.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_gather.js +0 -151
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_traverse.d.ts +0 -13
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_traverse.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_traverse.js +0 -133
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_wait.d.ts +0 -22
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_wait.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_wait.js +0 -135
package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_schedule.js
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
PROBE_ACTIVE_WRITTEN_RESOURCE,
|
|
10
10
|
PROBE_COUNTERS_RESOURCE,
|
|
11
11
|
PROBE_DISPATCH_RESOURCE,
|
|
12
|
+
PROBE_EVICTION_WRITE_RESOURCE,
|
|
12
13
|
PROBE_WANTED_READ_RESOURCE
|
|
13
14
|
} from "./chunk_probe_clipmap.js";
|
|
14
15
|
|
|
@@ -22,6 +23,8 @@ export const PROBE_SCHEDULE_SETTINGS = WebGPUStruct.from({
|
|
|
22
23
|
key_count: u32,
|
|
23
24
|
/** probes a frame updates at most, U = ⌊ray_budget / rays_per_probe⌋ */
|
|
24
25
|
trace_capacity: u32,
|
|
26
|
+
/** slots kept free beyond the frame's wanted points, ⌈capacity · PROBE_FREE_SLACK⌉ */
|
|
27
|
+
slack: u32,
|
|
25
28
|
}, "ProbeScheduleSettings");
|
|
26
29
|
|
|
27
30
|
const resources = new ShaderResourceSetDescriptor();
|
|
@@ -32,17 +35,33 @@ resources.createGroup()
|
|
|
32
35
|
.add(PROBE_ACTIVE_WRITTEN_RESOURCE)
|
|
33
36
|
.add(PROBE_WANTED_READ_RESOURCE)
|
|
34
37
|
.add(PROBE_COUNTERS_RESOURCE)
|
|
38
|
+
.add(PROBE_EVICTION_WRITE_RESOURCE)
|
|
35
39
|
.add(PROBE_DISPATCH_RESOURCE);
|
|
36
40
|
|
|
37
41
|
/**
|
|
38
|
-
* Schedule (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.5): one thread, after admit, when the frame's
|
|
39
|
-
* list is whole.
|
|
40
|
-
* - The period: with P_w the
|
|
41
|
-
*
|
|
42
|
+
* Schedule (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.3, §8.5): one thread, after admit, when the frame's
|
|
43
|
+
* active list is whole.
|
|
44
|
+
* - The period: with P_w the probes waiting for an update, the NEW and those wanted since their last
|
|
45
|
+
* update, `T = max(1, ⌈P_w / U⌉)` frames, so that every probe a want waits on is updated within a period
|
|
46
|
+
* and the period follows the live count. Retire and admit counted them in
|
|
47
|
+
* `probe_counters[PROBE_COUNTER_WAITING]`, which it empties for the next frame's; the period goes to
|
|
42
48
|
* `probe_counters[PROBE_COUNTER_PERIOD]` for the due passes.
|
|
49
|
+
* - The next frame's eviction, `probe_eviction`: as many slots as the free ones fall short of the frame's
|
|
50
|
+
* wanted points and the slack, the probes wanted longest ago first. Walking retire's age buckets from the
|
|
51
|
+
* oldest, it asks for each bucket whole while the shortfall takes it, then for what is left of the
|
|
52
|
+
* shortfall from the next; past the youngest bucket it counted anything in, it asks for nothing, so a
|
|
53
|
+
* shortfall the evictable probes cannot cover frees them all and no more. It empties the buckets and
|
|
54
|
+
* the count of a bucket's probes retire evicted.
|
|
43
55
|
* - A thread an entry of the frame's active list, at `PROBE_DISPATCH_ACTIVE`: the due passes' launch, and
|
|
44
56
|
* the next frame's retire's, which reads this list.
|
|
45
57
|
*
|
|
58
|
+
* A hit wants a probe the frame after its probe's update, so a probe hits keep may be wanted on few of
|
|
59
|
+
* its turns. The waiting count is what due lists over a period, where this frame's wanted points would
|
|
60
|
+
* count the probes a pixel wants every frame and miss most of those hits want between their turns.
|
|
61
|
+
*
|
|
62
|
+
* The frame's wanted points are the most a frame can admit, so the next frame's admissions find slots
|
|
63
|
+
* for as many points as this one wanted, and the slack more, before an admission starves.
|
|
64
|
+
*
|
|
46
65
|
* @type {ComputeShader}
|
|
47
66
|
*/
|
|
48
67
|
export const shader_probe_clipmap_schedule = ComputeShader.from({
|
|
@@ -53,10 +72,45 @@ export const shader_probe_clipmap_schedule = ComputeShader.from({
|
|
|
53
72
|
`
|
|
54
73
|
@compute @workgroup_size(1)
|
|
55
74
|
fn main() {
|
|
56
|
-
let
|
|
75
|
+
let waiting = atomicLoad(&probe_counters[PROBE_COUNTER_WAITING]);
|
|
57
76
|
let traced = max(settings.trace_capacity, 1u);
|
|
58
77
|
|
|
59
|
-
atomicStore(&probe_counters[
|
|
78
|
+
atomicStore(&probe_counters[PROBE_COUNTER_WAITING], 0u);
|
|
79
|
+
atomicStore(&probe_counters[PROBE_COUNTER_PERIOD], max((waiting + traced - 1u) / traced, 1u));
|
|
80
|
+
|
|
81
|
+
// the slots short of the frame's wanted points and the slack
|
|
82
|
+
let wanted = min(probe_wanted.count, settings.key_count);
|
|
83
|
+
let room = wanted + settings.slack;
|
|
84
|
+
let free = atomicLoad(&probe_counters[PROBE_COUNTER_FREE]);
|
|
85
|
+
|
|
86
|
+
var lacking = select(0u, room - free, room > free);
|
|
87
|
+
var buckets = 0u;
|
|
88
|
+
var remaining = 0u;
|
|
89
|
+
|
|
90
|
+
for (var k = 0u; k < PROBE_AGE_BUCKETS; k++) {
|
|
91
|
+
let at = PROBE_COUNTER_AGES + PROBE_AGE_BUCKETS - 1u - k;
|
|
92
|
+
let aged = atomicLoad(&probe_counters[at]);
|
|
93
|
+
|
|
94
|
+
atomicStore(&probe_counters[at], 0u);
|
|
95
|
+
|
|
96
|
+
// a bucket nothing was counted in is taken only for an older one: what ages into a bucket below every
|
|
97
|
+
// probe counted is not asked for
|
|
98
|
+
if (lacking > 0u && aged > 0u) {
|
|
99
|
+
if (aged <= lacking) {
|
|
100
|
+
lacking -= aged;
|
|
101
|
+
buckets = k + 1u;
|
|
102
|
+
} else {
|
|
103
|
+
buckets = k;
|
|
104
|
+
remaining = lacking;
|
|
105
|
+
lacking = 0u;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
probe_eviction.buckets = buckets;
|
|
111
|
+
probe_eviction.remaining = remaining;
|
|
112
|
+
|
|
113
|
+
atomicStore(&probe_counters[PROBE_COUNTER_EVICTED], 0u);
|
|
60
114
|
|
|
61
115
|
let live = min(probe_active_write.count, settings.capacity);
|
|
62
116
|
let folded = folded_dispatch((live + PROBE_THREAD_WORKGROUP_SIZE - 1u) / PROBE_THREAD_WORKGROUP_SIZE);
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.d.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* Shade (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.7): a thread a ray of the frame's updates, R a listed
|
|
7
|
-
* probe, dispatched through `PROBE_DISPATCH_RAYS` after trace. The radiance the ray brings back goes
|
|
8
|
-
* over its light, three half floats:
|
|
2
|
+
* Shade (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.7): a thread a ray of the frame's updates, dispatched
|
|
3
|
+
* through `PROBE_DISPATCH_RAYS` after trace, its probe the one trace wrote into its flags; a record of no
|
|
4
|
+
* ray (`PROBE_RAY_NONE`) is past the frame's last. The radiance the ray brings back goes over its light,
|
|
5
|
+
* three half floats:
|
|
9
6
|
*
|
|
10
|
-
* - a **miss** sees the environment along its direction, `
|
|
7
|
+
* - a **miss** sees the prefiltered environment along its direction, `sample_environment_map`, at the
|
|
8
|
+
* roughness whose lobe covers the solid angle of a radiance texel, 4π/n_r². The prefilter's lobe is the
|
|
9
|
+
* spherical Gaussian exp(2(N·H − 1)/m²), m the roughness squared, whose integral over the sphere is
|
|
10
|
+
* 4πm²·(1 − (1 − e^(−k))/k), k = 2/m²: m = 1/n_r to 0.2% at n_r = 16, so the roughness is 1/√n_r. A sun
|
|
11
|
+
* a few texels wide at level 0 is then a lobe a texel wide, which a texel's jittered rays all see,
|
|
12
|
+
* rather than a point that only some probes' jitter ever lands on;
|
|
11
13
|
* - a **front-face hit** is `emissive + ρ_d·E_dir/π` (D7), its surface from `probe_clipmap_hit_surface`
|
|
12
14
|
* at the hit's position, the probe's origin plus t along the ray, with the hit's normal, at its
|
|
13
15
|
* cascade's voxel; E_dir is what trace left in the light;
|
|
@@ -20,6 +22,5 @@ export const PROBE_SHADE_SETTINGS: WebGPUStruct;
|
|
|
20
22
|
* @type {ComputeShader}
|
|
21
23
|
*/
|
|
22
24
|
export const shader_probe_clipmap_shade: ComputeShader;
|
|
23
|
-
import { WebGPUStruct } from "../../../shader/type/WebGPUStruct.js";
|
|
24
25
|
import { ComputeShader } from "../../../shader/ComputeShader.js";
|
|
25
26
|
//# sourceMappingURL=shader_probe_clipmap_shade.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader_probe_clipmap_shade.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shader_probe_clipmap_shade.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.js"],"names":[],"mappings":"AA2DA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,yCAFU,aAAa,CAyDpB;8BAxH2B,kCAAkC"}
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { chunk_sample_environment_color } from "../../../atmosphere/chunk_sample_environment_color.js";
|
|
2
1
|
import {
|
|
3
2
|
MESH_CARD_ALBEDO_RESOURCE,
|
|
4
3
|
MESH_CARD_EMISSIVE_RESOURCE,
|
|
@@ -9,14 +8,15 @@ import { MESH_SDF_BRICK_VOXELS } from "../../../geometry/sdf/MESH_SDF.js";
|
|
|
9
8
|
import { MESH_SDF_HEADERS_RESOURCE, MESH_SDF_INDIRECTION_RESOURCE } from "../../../geometry/sdf/MESH_SDF_RESOURCES.js";
|
|
10
9
|
import { ENVIRONMENT_MAP_SAMPLER_RESOURCE } from "../../../light/environment/ENVIRONMENT_MAP_SAMPLER_RESOURCE.js";
|
|
11
10
|
import { SCENE_DATABASE_RESOURCE } from "../../../scene/SCENE_DATABASE_RESOURCE.js";
|
|
11
|
+
import { chunk_rgbe9995_decode } from "../../../shader/chunk/color/rgbe9995/chunk_rgbe9995_decode.js";
|
|
12
|
+
import { chunk_rgbe9995_encode } from "../../../shader/chunk/color/rgbe9995/chunk_rgbe9995_encode.js";
|
|
13
|
+
import { chunk_sample_environment_map } from "../../../shader/chunk/texture/sample/chunk_sample_environment_map.js";
|
|
12
14
|
import { chunk_uv_octahedral_unit_decode } from "../../../shader/chunk/geometry/octahedron/chunk_uv_octahedral_unit_decode.js";
|
|
13
15
|
import { chunk_folded_workgroup_index } from "../../../shader/chunk/grid/chunk_folded_workgroup_index.js";
|
|
14
16
|
import { RECIPROCAL_PI_DECLARATION } from "../../../shader/chunk/math/RECIPROCAL_PI_DECLARATION.js";
|
|
15
17
|
import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
|
|
16
18
|
import { ComputeShader } from "../../../shader/ComputeShader.js";
|
|
17
19
|
import { ShaderResourceSetDescriptor } from "../../../shader/resource/ShaderResourceSetDescriptor.js";
|
|
18
|
-
import { u32 } from "../../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
|
|
19
|
-
import { WebGPUStruct } from "../../../shader/type/WebGPUStruct.js";
|
|
20
20
|
import { BRICK_TRACE_HIT, BRICK_TRACE_MISS } from "../brick/BRICK_CLIPMAP.js";
|
|
21
21
|
import { BRICK_LEVELS_RESOURCE } from "../brick/chunk_brick_clipmap_trace.js";
|
|
22
22
|
import {
|
|
@@ -26,32 +26,17 @@ import {
|
|
|
26
26
|
} from "./chunk_probe_clipmap_hit_surface.js";
|
|
27
27
|
import {
|
|
28
28
|
chunk_probe_clipmap,
|
|
29
|
+
chunk_probe_clipmap_ray_origin,
|
|
29
30
|
PROBE_ORIGINS_READ_RESOURCE,
|
|
30
31
|
PROBE_RAYS_WRITE_RESOURCE,
|
|
31
32
|
PROBE_TRACE_READ_RESOURCE
|
|
32
33
|
} from "./chunk_probe_clipmap.js";
|
|
33
34
|
import { PROBE_THREAD_WORKGROUP_SIZE } from "./PROBE_CLIPMAP.js";
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* The largest finite half float: radiance past it would be infinite in the ray's record and in the
|
|
37
|
-
* atlas after it, and an infinity times a zero weight is a NaN in every sum it reaches.
|
|
38
|
-
* @type {number}
|
|
39
|
-
*/
|
|
40
|
-
const HALF_MAX = 65504;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* @type {WebGPUStruct}
|
|
44
|
-
*/
|
|
45
|
-
export const PROBE_SHADE_SETTINGS = WebGPUStruct.from({
|
|
46
|
-
/** probes a frame updates at most: the trace list's bound */
|
|
47
|
-
trace_capacity: u32,
|
|
48
|
-
/** rays an update casts, R */
|
|
49
|
-
rays_per_probe: u32,
|
|
50
|
-
}, "ProbeShadeSettings");
|
|
35
|
+
import { PROBE_TRACE_SETTINGS } from "./shader_probe_clipmap_trace.js";
|
|
51
36
|
|
|
52
37
|
const resources = new ShaderResourceSetDescriptor();
|
|
53
38
|
|
|
54
|
-
resources.setImmediate("settings",
|
|
39
|
+
resources.setImmediate("settings", PROBE_TRACE_SETTINGS);
|
|
55
40
|
|
|
56
41
|
resources.createGroup()
|
|
57
42
|
.add(PROBE_TRACE_READ_RESOURCE)
|
|
@@ -73,11 +58,17 @@ resources.createGroup()
|
|
|
73
58
|
.add(MESH_CARD_EMISSIVE_RESOURCE);
|
|
74
59
|
|
|
75
60
|
/**
|
|
76
|
-
* Shade (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.7): a thread a ray of the frame's updates,
|
|
77
|
-
*
|
|
78
|
-
* over its light,
|
|
61
|
+
* Shade (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.7): a thread a ray of the frame's updates, dispatched
|
|
62
|
+
* through `PROBE_DISPATCH_RAYS` after trace, its probe the one trace wrote into its flags; a record of no
|
|
63
|
+
* ray (`PROBE_RAY_NONE`) is past the frame's last. The radiance the ray brings back goes over its light,
|
|
64
|
+
* three half floats:
|
|
79
65
|
*
|
|
80
|
-
* - a **miss** sees the environment along its direction, `
|
|
66
|
+
* - a **miss** sees the prefiltered environment along its direction, `sample_environment_map`, at the
|
|
67
|
+
* roughness whose lobe covers the solid angle of a radiance texel, 4π/n_r². The prefilter's lobe is the
|
|
68
|
+
* spherical Gaussian exp(2(N·H − 1)/m²), m the roughness squared, whose integral over the sphere is
|
|
69
|
+
* 4πm²·(1 − (1 − e^(−k))/k), k = 2/m²: m = 1/n_r to 0.2% at n_r = 16, so the roughness is 1/√n_r. A sun
|
|
70
|
+
* a few texels wide at level 0 is then a lobe a texel wide, which a texel's jittered rays all see,
|
|
71
|
+
* rather than a point that only some probes' jitter ever lands on;
|
|
81
72
|
* - a **front-face hit** is `emissive + ρ_d·E_dir/π` (D7), its surface from `probe_clipmap_hit_surface`
|
|
82
73
|
* at the hit's position, the probe's origin plus t along the ray, with the hit's normal, at its
|
|
83
74
|
* cascade's voxel; E_dir is what trace left in the light;
|
|
@@ -101,45 +92,47 @@ fn main(
|
|
|
101
92
|
@builtin(local_invocation_index) lane: u32,
|
|
102
93
|
) {
|
|
103
94
|
let ray = folded_workgroup_index(workgroup_id) * PROBE_THREAD_WORKGROUP_SIZE + lane;
|
|
104
|
-
let
|
|
95
|
+
let record = probe_rays[ray];
|
|
96
|
+
let kind = record.flags & PROBE_RAY_KIND_MASK;
|
|
105
97
|
|
|
106
|
-
if (
|
|
98
|
+
if (kind == PROBE_RAY_NONE) {
|
|
107
99
|
return;
|
|
108
100
|
}
|
|
109
|
-
|
|
110
|
-
let record = probe_rays[ray];
|
|
111
|
-
let kind = record.flags & PROBE_RAY_KIND_MASK;
|
|
112
101
|
let direction = uv_octahedral_unit_decode(unpack2x16unorm(record.direction));
|
|
113
102
|
|
|
114
103
|
var radiance = vec3<f32>(0.0);
|
|
115
104
|
var albedo = vec3<f32>(0.0);
|
|
116
105
|
|
|
117
106
|
if (kind == ${BRICK_TRACE_MISS}u) {
|
|
118
|
-
radiance =
|
|
107
|
+
radiance = sample_environment_map(tEnvironment, sEnvironment, direction, inverseSqrt(f32(settings.radiance_resolution)));
|
|
119
108
|
} else if (kind == ${BRICK_TRACE_HIT}u && (record.flags & PROBE_RAY_BACK_FACE) == 0u) {
|
|
120
|
-
let
|
|
109
|
+
let k = record.flags >> PROBE_RAY_PROBE_SHIFT;
|
|
110
|
+
let origin = probe_clipmap_ray_origin(probe_origins[k], probe_trace.elements[k], record.direction);
|
|
111
|
+
let position = origin + record.t * direction;
|
|
121
112
|
let normal = uv_octahedral_unit_decode(unpack2x16unorm(record.normal));
|
|
122
|
-
let voxel = brick_levels[record.flags >> PROBE_RAY_CASCADE_SHIFT].cell_size / ${MESH_SDF_BRICK_VOXELS}.0;
|
|
113
|
+
let voxel = brick_levels[(record.flags >> PROBE_RAY_CASCADE_SHIFT) & PROBE_RAY_CASCADE_MASK].cell_size / ${MESH_SDF_BRICK_VOXELS}.0;
|
|
123
114
|
|
|
124
115
|
let surface = probe_clipmap_hit_surface(record.row, position, normal, voxel);
|
|
125
|
-
let direct =
|
|
116
|
+
let direct = rgbe9995_decode(record.light);
|
|
126
117
|
|
|
127
118
|
radiance = surface.emissive + surface.albedo * direct * RECIPROCAL_PI;
|
|
128
119
|
albedo = surface.albedo;
|
|
129
120
|
}
|
|
130
121
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
probe_rays[ray].
|
|
134
|
-
probe_rays[ray].light_b = pack2x16float(vec2<f32>(held.b, 0.0));
|
|
122
|
+
// held to RGB9E5's largest value, which the half-float atlas also holds: an infinity there times a
|
|
123
|
+
// zero weight would be a NaN in every sum it reaches
|
|
124
|
+
probe_rays[ray].light = rgbe9995_encode(radiance);
|
|
135
125
|
probe_rays[ray].row = pack4x8unorm(vec4<f32>(albedo, 0.0));
|
|
136
126
|
}
|
|
137
127
|
`, [
|
|
138
128
|
chunk_probe_clipmap,
|
|
129
|
+
chunk_probe_clipmap_ray_origin,
|
|
139
130
|
chunk_folded_workgroup_index,
|
|
140
131
|
chunk_uv_octahedral_unit_decode,
|
|
141
|
-
|
|
132
|
+
chunk_sample_environment_map,
|
|
142
133
|
chunk_probe_clipmap_hit_surface,
|
|
134
|
+
chunk_rgbe9995_decode,
|
|
135
|
+
chunk_rgbe9995_encode,
|
|
143
136
|
RECIPROCAL_PI_DECLARATION,
|
|
144
137
|
]),
|
|
145
138
|
});
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.d.ts
CHANGED
|
@@ -3,27 +3,34 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const PROBE_TRACE_SETTINGS: WebGPUStruct;
|
|
5
5
|
/**
|
|
6
|
-
* Trace (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.6): a thread a ray of the frame's updates,
|
|
7
|
-
*
|
|
6
|
+
* Trace (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.6): a thread a ray of the frame's updates, dispatched
|
|
7
|
+
* through `PROBE_DISPATCH_RAYS`. The rays are laid out by listed probe (`probe_ray_sums`): a ray finds
|
|
8
|
+
* its probe by bisecting the sums, and its place among the probe's rays from the probe's first. A thread
|
|
9
|
+
* past the frame's last ray writes a record of no ray (`PROBE_RAY_NONE`), where the passes after stop.
|
|
8
10
|
*
|
|
9
|
-
* - **Texel**: `probe_clipmap_ray_texel
|
|
11
|
+
* - **Texel**: on a uniform update (`PROBE_UNIFORM_PERIOD`), `probe_clipmap_ray_texel`: all of them,
|
|
12
|
+
* or a spread subset below R = n_r². On a guided one, the walk position whose rays the ray is among
|
|
13
|
+
* in the probe's guide (`chunk_probe_clipmap_guide`), found by bisecting the first rays. A texel's rays
|
|
14
|
+
* then follow one another, in the walk's order.
|
|
10
15
|
* - **Direction**: the texel's octahedral square, jittered by STBN at the texel, moved by the slot's
|
|
11
16
|
* hash so that neighbouring probes do not jitter alike, and at the update count: one stratified,
|
|
12
|
-
* jittered ray a texel, LPV's own pattern.
|
|
13
|
-
*
|
|
14
|
-
*
|
|
17
|
+
* jittered ray a texel, LPV's own pattern. A guided texel's later rays rotate that jitter by R2
|
|
18
|
+
* (`probe_clipmap_guided_ray_jitter`).
|
|
19
|
+
* - **Origin**: a point of a small ball around the probe where relocation left it, `probe_origins`, one a
|
|
20
|
+
* ray (`probe_clipmap_ray_origin`); t_min one voxel of the brick cascade there.
|
|
15
21
|
* - **Direct light**: a hit off a front face takes E_dir = Σ colour·max(0, n·l)·visibility over the
|
|
16
|
-
* directional lights (§8.7). The visibility is
|
|
17
|
-
* first {@link PROBE_SHADOWED_SUNS} lights that cast shadows, in the
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
22
|
+
* directional lights (§8.7). The visibility is a shadow ray, traced through the brick clipmap as the
|
|
23
|
+
* ray itself was, toward each of the first {@link PROBE_SHADOWED_SUNS} lights that cast shadows, in the
|
|
24
|
+
* table's order; lights past them are unshadowed at hits. It starts a voxel off the hit along its
|
|
25
|
+
* normal, outside the half-voxel expand, and heads for a point of the light's disk drawn as the path
|
|
26
|
+
* tracer draws it (`cone_sample_direction`), from the ray's slot and direction, so that the probe's
|
|
27
|
+
* blend of its rays integrates the penumbra. The light is seen whole if the ray misses, and not at all
|
|
28
|
+
* if it hits or spends its steps: what the march could not answer is no light, not all of it. A
|
|
29
|
+
* surface turned from a light traces no ray toward it, since the light gives it nothing.
|
|
23
30
|
* - **Back face**: a hit whose field's gradient is along the ray, so it came from inside a solid.
|
|
24
31
|
*
|
|
25
32
|
* Writes the ray's `PROBE_RAY_STRUCT`, with the `meshes` row of the hit's surface and E_dir as its
|
|
26
|
-
* light, which shade turns into the ray's radiance.
|
|
33
|
+
* light, which shade turns into the ray's radiance, and its probe's place in the list in its flags.
|
|
27
34
|
*
|
|
28
35
|
* @type {ComputeShader}
|
|
29
36
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader_probe_clipmap_trace.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shader_probe_clipmap_trace.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.js"],"names":[],"mappings":"AA+CA;;GAEG;AACH,mCAFU,YAAY,CAeG;AAwBzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,yCAFU,aAAa,CAoJpB;6BAzP0B,sCAAsC;8BAHrC,kCAAkC"}
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.js
CHANGED
|
@@ -2,10 +2,14 @@ import { MESH_SDF_BRICK_VOXELS } from "../../../geometry/sdf/MESH_SDF.js";
|
|
|
2
2
|
import { LIGHT_DATA_RESOURCE } from "../../../light/LIGHT_DATA_RESOURCE.js";
|
|
3
3
|
import { LIGHT_DATABASE_SPEC } from "../../../light/LIGHT_DATABASE_SPEC.js";
|
|
4
4
|
import { LIGHT_FLAGS } from "../../../light/model/io/LIGHT_FLAGS.js";
|
|
5
|
+
import { chunk_cone_sample_direction } from "../../../shader/chunk/geometry/cone/chunk_cone_sample_direction.js";
|
|
5
6
|
import { chunk_uv_octahedral_unit_decode } from "../../../shader/chunk/geometry/octahedron/chunk_uv_octahedral_unit_decode.js";
|
|
6
7
|
import { chunk_uv_octahedral_unit_encode } from "../../../shader/chunk/geometry/octahedron/chunk_uv_octahedral_unit_encode.js";
|
|
8
|
+
import { chunk_rgbe9995_encode } from "../../../shader/chunk/color/rgbe9995/chunk_rgbe9995_encode.js";
|
|
7
9
|
import { chunk_folded_workgroup_index } from "../../../shader/chunk/grid/chunk_folded_workgroup_index.js";
|
|
8
10
|
import { chunk_directional_lights_iteration_mask } from "../../../shader/chunk/light/io/chunk_directional_lights_iteration_mask.js";
|
|
11
|
+
import { chunk_hash_to_float01 } from "../../../shader/chunk/random/chunk_hash_to_float01.js";
|
|
12
|
+
import { chunk_pcg3d } from "../../../shader/chunk/random/pcg/chunk_pcg3d.js";
|
|
9
13
|
import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
|
|
10
14
|
import { ComputeShader } from "../../../shader/ComputeShader.js";
|
|
11
15
|
import { ShaderResourceSetDescriptor } from "../../../shader/resource/ShaderResourceSetDescriptor.js";
|
|
@@ -20,14 +24,19 @@ import {
|
|
|
20
24
|
BRICK_OCCUPANCY_TEXTURE_RESOURCE,
|
|
21
25
|
BRICK_SAMPLER_RESOURCE,
|
|
22
26
|
chunk_brick_clipmap_object,
|
|
23
|
-
chunk_brick_clipmap_soft_shadow,
|
|
24
27
|
chunk_brick_clipmap_trace
|
|
25
28
|
} from "../brick/chunk_brick_clipmap_trace.js";
|
|
26
29
|
import {
|
|
27
30
|
chunk_probe_clipmap,
|
|
31
|
+
chunk_probe_clipmap_guide,
|
|
32
|
+
chunk_probe_clipmap_guided_ray_jitter,
|
|
28
33
|
chunk_probe_clipmap_ray_jitter,
|
|
34
|
+
chunk_probe_clipmap_ray_layout,
|
|
35
|
+
chunk_probe_clipmap_ray_origin,
|
|
29
36
|
chunk_probe_clipmap_ray_texel,
|
|
37
|
+
PROBE_GUIDE_READ_RESOURCE,
|
|
30
38
|
PROBE_ORIGINS_READ_RESOURCE,
|
|
39
|
+
PROBE_RAY_SUMS_READ_RESOURCE,
|
|
31
40
|
PROBE_RAYS_WRITE_RESOURCE,
|
|
32
41
|
PROBE_STATES_READ_RESOURCE,
|
|
33
42
|
PROBE_TRACE_READ_RESOURCE
|
|
@@ -42,7 +51,7 @@ const DIRECTIONAL = LIGHT_DATABASE_SPEC.get('light_directional');
|
|
|
42
51
|
export const PROBE_TRACE_SETTINGS = WebGPUStruct.from({
|
|
43
52
|
/** probes a frame updates at most: the trace list's bound */
|
|
44
53
|
trace_capacity: u32,
|
|
45
|
-
/** rays
|
|
54
|
+
/** rays a uniform update casts, R, a power of two; a guided update casts its probe's own (`probe_ray_sums`) */
|
|
46
55
|
rays_per_probe: u32,
|
|
47
56
|
/** octahedral radiance texels a side, n_r, a power of two */
|
|
48
57
|
radiance_resolution: u32,
|
|
@@ -50,6 +59,8 @@ export const PROBE_TRACE_SETTINGS = WebGPUStruct.from({
|
|
|
50
59
|
brick_cascade_count: u32,
|
|
51
60
|
/** how far a ray goes before it is a miss, metres: across the coarsest window */
|
|
52
61
|
t_max: f32,
|
|
62
|
+
/** updates between a probe's uniform ones, `PROBE_UNIFORM_PERIOD` */
|
|
63
|
+
uniform_period: u32,
|
|
53
64
|
}, "ProbeTraceSettings");
|
|
54
65
|
|
|
55
66
|
const resources = new ShaderResourceSetDescriptor();
|
|
@@ -61,6 +72,8 @@ resources.createGroup()
|
|
|
61
72
|
.add(PROBE_TRACE_READ_RESOURCE)
|
|
62
73
|
.add(PROBE_ORIGINS_READ_RESOURCE)
|
|
63
74
|
.add(PROBE_RAYS_WRITE_RESOURCE)
|
|
75
|
+
.add(PROBE_RAY_SUMS_READ_RESOURCE)
|
|
76
|
+
.add(PROBE_GUIDE_READ_RESOURCE)
|
|
64
77
|
.add(STBN_VEC2_RESOURCE)
|
|
65
78
|
.add(LIGHT_DATA_RESOURCE);
|
|
66
79
|
|
|
@@ -73,27 +86,34 @@ resources.createGroup()
|
|
|
73
86
|
.add(BRICK_OBJECTS_RESOURCE);
|
|
74
87
|
|
|
75
88
|
/**
|
|
76
|
-
* Trace (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.6): a thread a ray of the frame's updates,
|
|
77
|
-
*
|
|
89
|
+
* Trace (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.6): a thread a ray of the frame's updates, dispatched
|
|
90
|
+
* through `PROBE_DISPATCH_RAYS`. The rays are laid out by listed probe (`probe_ray_sums`): a ray finds
|
|
91
|
+
* its probe by bisecting the sums, and its place among the probe's rays from the probe's first. A thread
|
|
92
|
+
* past the frame's last ray writes a record of no ray (`PROBE_RAY_NONE`), where the passes after stop.
|
|
78
93
|
*
|
|
79
|
-
* - **Texel**: `probe_clipmap_ray_texel
|
|
94
|
+
* - **Texel**: on a uniform update (`PROBE_UNIFORM_PERIOD`), `probe_clipmap_ray_texel`: all of them,
|
|
95
|
+
* or a spread subset below R = n_r². On a guided one, the walk position whose rays the ray is among
|
|
96
|
+
* in the probe's guide (`chunk_probe_clipmap_guide`), found by bisecting the first rays. A texel's rays
|
|
97
|
+
* then follow one another, in the walk's order.
|
|
80
98
|
* - **Direction**: the texel's octahedral square, jittered by STBN at the texel, moved by the slot's
|
|
81
99
|
* hash so that neighbouring probes do not jitter alike, and at the update count: one stratified,
|
|
82
|
-
* jittered ray a texel, LPV's own pattern.
|
|
83
|
-
*
|
|
84
|
-
*
|
|
100
|
+
* jittered ray a texel, LPV's own pattern. A guided texel's later rays rotate that jitter by R2
|
|
101
|
+
* (`probe_clipmap_guided_ray_jitter`).
|
|
102
|
+
* - **Origin**: a point of a small ball around the probe where relocation left it, `probe_origins`, one a
|
|
103
|
+
* ray (`probe_clipmap_ray_origin`); t_min one voxel of the brick cascade there.
|
|
85
104
|
* - **Direct light**: a hit off a front face takes E_dir = Σ colour·max(0, n·l)·visibility over the
|
|
86
|
-
* directional lights (§8.7). The visibility is
|
|
87
|
-
* first {@link PROBE_SHADOWED_SUNS} lights that cast shadows, in the
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
105
|
+
* directional lights (§8.7). The visibility is a shadow ray, traced through the brick clipmap as the
|
|
106
|
+
* ray itself was, toward each of the first {@link PROBE_SHADOWED_SUNS} lights that cast shadows, in the
|
|
107
|
+
* table's order; lights past them are unshadowed at hits. It starts a voxel off the hit along its
|
|
108
|
+
* normal, outside the half-voxel expand, and heads for a point of the light's disk drawn as the path
|
|
109
|
+
* tracer draws it (`cone_sample_direction`), from the ray's slot and direction, so that the probe's
|
|
110
|
+
* blend of its rays integrates the penumbra. The light is seen whole if the ray misses, and not at all
|
|
111
|
+
* if it hits or spends its steps: what the march could not answer is no light, not all of it. A
|
|
112
|
+
* surface turned from a light traces no ray toward it, since the light gives it nothing.
|
|
93
113
|
* - **Back face**: a hit whose field's gradient is along the ray, so it came from inside a solid.
|
|
94
114
|
*
|
|
95
115
|
* Writes the ray's `PROBE_RAY_STRUCT`, with the `meshes` row of the hit's surface and E_dir as its
|
|
96
|
-
* light, which shade turns into the ray's radiance.
|
|
116
|
+
* light, which shade turns into the ray's radiance, and its probe's place in the list in its flags.
|
|
97
117
|
*
|
|
98
118
|
* @type {ComputeShader}
|
|
99
119
|
*/
|
|
@@ -103,32 +123,71 @@ export const shader_probe_clipmap_trace = ComputeShader.from({
|
|
|
103
123
|
body: CodeChunk.from(
|
|
104
124
|
//language=WGSL
|
|
105
125
|
`
|
|
126
|
+
// the walk position among whose rays a ray of the probe falls, its guide starting at word base: the last
|
|
127
|
+
// whose first ray is at most it
|
|
128
|
+
fn probe_trace_guided_position(base: u32, ray: u32, texels: u32) -> u32 {
|
|
129
|
+
var low = 0u;
|
|
130
|
+
var high = texels;
|
|
131
|
+
|
|
132
|
+
// the first ray of position 0 is 0, so the low end always qualifies; log2(n_r²) steps
|
|
133
|
+
while (high - low > 1u) {
|
|
134
|
+
let middle = low + ((high - low) >> 1u);
|
|
135
|
+
|
|
136
|
+
if (probe_guide[base + middle] <= ray) {
|
|
137
|
+
low = middle;
|
|
138
|
+
} else {
|
|
139
|
+
high = middle;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return low;
|
|
144
|
+
}
|
|
145
|
+
|
|
106
146
|
@compute @workgroup_size(${PROBE_THREAD_WORKGROUP_SIZE})
|
|
107
147
|
fn main(
|
|
108
148
|
@builtin(workgroup_id) workgroup_id: vec3<u32>,
|
|
109
149
|
@builtin(local_invocation_index) lane: u32,
|
|
110
150
|
) {
|
|
111
151
|
let ray = folded_workgroup_index(workgroup_id) * PROBE_THREAD_WORKGROUP_SIZE + lane;
|
|
112
|
-
let
|
|
152
|
+
let k = probe_clipmap_ray_probe(ray);
|
|
153
|
+
|
|
154
|
+
if (k >= probe_ray_sums.count) {
|
|
155
|
+
probe_rays[ray].row = 0u;
|
|
156
|
+
probe_rays[ray].flags = PROBE_RAY_NONE;
|
|
113
157
|
|
|
114
|
-
if (ray >= min(probe_trace.count, settings.trace_capacity) * rays) {
|
|
115
158
|
return;
|
|
116
159
|
}
|
|
117
160
|
|
|
118
|
-
|
|
119
|
-
let
|
|
161
|
+
// the update's rays, and this one's place among them
|
|
162
|
+
let span = probe_clipmap_probe_rays(k);
|
|
163
|
+
let rays = span.y;
|
|
164
|
+
let i = ray - span.x;
|
|
165
|
+
|
|
166
|
+
let slot = probe_trace.elements[k];
|
|
120
167
|
|
|
121
168
|
let n = settings.radiance_resolution;
|
|
122
169
|
let texels = n * n;
|
|
123
170
|
let state = probe_states[slot];
|
|
124
171
|
let updates = probe_state_updates(state.x);
|
|
125
172
|
|
|
126
|
-
|
|
127
|
-
|
|
173
|
+
var texel: u32;
|
|
174
|
+
var jitter: vec2<f32>;
|
|
175
|
+
|
|
176
|
+
if (probe_clipmap_guided(state.x, settings.uniform_period, settings.rays_per_probe, texels)) {
|
|
177
|
+
let base = k * probe_clipmap_guide_words(n);
|
|
178
|
+
let position = probe_trace_guided_position(base, i, texels);
|
|
179
|
+
|
|
180
|
+
texel = probe_clipmap_guide_texel(position, updates, n);
|
|
181
|
+
jitter = probe_clipmap_guided_ray_jitter(slot, texel, i - probe_guide[base + position], updates, rays, n);
|
|
182
|
+
} else {
|
|
183
|
+
texel = probe_clipmap_ray_texel(i, updates, rays, texels);
|
|
184
|
+
jitter = probe_clipmap_ray_jitter(slot, texel, i, updates, rays, n);
|
|
185
|
+
}
|
|
128
186
|
|
|
129
187
|
let direction = uv_octahedral_unit_decode((vec2<f32>(f32(texel % n), f32(texel / n)) + jitter) / f32(n));
|
|
188
|
+
let packed = pack2x16unorm(uv_octahedral_unit_encode(direction));
|
|
130
189
|
|
|
131
|
-
let origin = probe_origins[
|
|
190
|
+
let origin = probe_clipmap_ray_origin(probe_origins[k], slot, packed);
|
|
132
191
|
|
|
133
192
|
let cascade_count = settings.brick_cascade_count;
|
|
134
193
|
let start = brick_clipmap_start(origin, cascade_count);
|
|
@@ -159,10 +218,15 @@ fn main(
|
|
|
159
218
|
var visible = 1.0;
|
|
160
219
|
|
|
161
220
|
if ((light.flags & ${LIGHT_FLAGS.CASTS_SHADOW_BIT}u) != 0u && shadowed < ${PROBE_SHADOWED_SUNS}u) {
|
|
162
|
-
// a surface turned from the light takes none of it whatever the shadow, so it
|
|
221
|
+
// a surface turned from the light takes none of it whatever the shadow, so it traces none;
|
|
163
222
|
// the light keeps its place among the shadowed all the same
|
|
164
223
|
if (n_dot_l > 0.0) {
|
|
165
|
-
|
|
224
|
+
// a point of the disk of its own for each light, apart from the origin's draw
|
|
225
|
+
let hash = pcg3d(vec3<u32>(slot, packed, 0x3C6EF372u + shadowed));
|
|
226
|
+
let toward = cone_sample_direction(-light.direction, light.disk_radius, vec2<f32>(hash_to_float01(hash.x), hash_to_float01(hash.y)));
|
|
227
|
+
let shadow = brick_clipmap_trace(lifted, toward, 0.0, settings.t_max, cascade_count);
|
|
228
|
+
|
|
229
|
+
visible = select(0.0, 1.0, shadow.kind == BRICK_TRACE_MISS);
|
|
166
230
|
}
|
|
167
231
|
|
|
168
232
|
shadowed++;
|
|
@@ -173,24 +237,30 @@ fn main(
|
|
|
173
237
|
}
|
|
174
238
|
|
|
175
239
|
probe_rays[ray].t = hit.t;
|
|
176
|
-
probe_rays[ray].direction =
|
|
240
|
+
probe_rays[ray].direction = packed;
|
|
177
241
|
probe_rays[ray].normal = select(0u, pack2x16unorm(uv_octahedral_unit_encode(hit.normal)), is_hit);
|
|
178
242
|
probe_rays[ray].row = brick_clipmap_object(hit);
|
|
179
|
-
probe_rays[ray].flags = hit.kind | select(0u, PROBE_RAY_BACK_FACE, back_face) | (select(0u, hit.cascade, is_hit) << PROBE_RAY_CASCADE_SHIFT);
|
|
180
|
-
probe_rays[ray].
|
|
181
|
-
probe_rays[ray].light_b = pack2x16float(vec2<f32>(direct.b, 0.0));
|
|
243
|
+
probe_rays[ray].flags = hit.kind | select(0u, PROBE_RAY_BACK_FACE, back_face) | (select(0u, hit.cascade, is_hit) << PROBE_RAY_CASCADE_SHIFT) | (k << PROBE_RAY_PROBE_SHIFT);
|
|
244
|
+
probe_rays[ray].light = rgbe9995_encode(direct);
|
|
182
245
|
}
|
|
183
246
|
`, [
|
|
184
247
|
chunk_probe_clipmap,
|
|
248
|
+
chunk_probe_clipmap_ray_layout,
|
|
185
249
|
chunk_probe_clipmap_ray_texel,
|
|
186
250
|
chunk_probe_clipmap_ray_jitter,
|
|
251
|
+
chunk_probe_clipmap_ray_origin,
|
|
252
|
+
chunk_probe_clipmap_guide,
|
|
253
|
+
chunk_probe_clipmap_guided_ray_jitter,
|
|
187
254
|
chunk_folded_workgroup_index,
|
|
188
255
|
chunk_uv_octahedral_unit_decode,
|
|
189
256
|
chunk_uv_octahedral_unit_encode,
|
|
190
257
|
chunk_brick_clipmap_trace,
|
|
191
258
|
chunk_brick_clipmap_object,
|
|
192
|
-
|
|
259
|
+
chunk_cone_sample_direction,
|
|
260
|
+
chunk_pcg3d,
|
|
261
|
+
chunk_hash_to_float01,
|
|
193
262
|
chunk_directional_lights_iteration_mask,
|
|
263
|
+
chunk_rgbe9995_encode,
|
|
194
264
|
DIRECTIONAL.chunk_read,
|
|
195
265
|
]),
|
|
196
266
|
});
|
|
@@ -5,12 +5,16 @@ export const PROBE_TRACE_COMMAND_SETTINGS: WebGPUStruct;
|
|
|
5
5
|
/**
|
|
6
6
|
* The update's commands (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.5): one thread, once the due passes
|
|
7
7
|
* have listed the frame's updates, the list's count clamped to U:
|
|
8
|
-
* - a thread a listed probe, at `PROBE_DISPATCH_TRACED`: relocation and the probes'
|
|
9
|
-
*
|
|
8
|
+
* - a thread a listed probe, at `PROBE_DISPATCH_TRACED`: relocation, the ray counts and the probes'
|
|
9
|
+
* projection;
|
|
10
10
|
* - a thread a texel of their maps, n_r² + n_d² a probe, at `PROBE_DISPATCH_TEXELS`: accumulate;
|
|
11
11
|
* - a thread a row of their radiance maps, n_r a probe, at `PROBE_DISPATCH_ROWS`: the projection's rows;
|
|
12
12
|
* - a thread a texel of their tiles, (n_r + 2)² + (n_d + 2)² a probe, at `PROBE_DISPATCH_PUBLISH`.
|
|
13
13
|
*
|
|
14
|
+
* It writes the count of the ray counts, the ray requests and the rays' layout, the probes listed, which
|
|
15
|
+
* the passes after fill in (`shader_probe_clipmap_ray_layout.js`): a probe's rays are its own update's,
|
|
16
|
+
* even when none is listed.
|
|
17
|
+
*
|
|
14
18
|
* @type {ComputeShader}
|
|
15
19
|
*/
|
|
16
20
|
export const shader_probe_clipmap_trace_command: ComputeShader;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader_probe_clipmap_trace_command.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace_command.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shader_probe_clipmap_trace_command.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace_command.js"],"names":[],"mappings":"AAeA;;GAEG;AACH,2CAFU,YAAY,CASU;AAahC;;;;;;;;;;;;;;GAcG;AACH,iDAFU,aAAa,CAoDpB;6BAlG0B,sCAAsC;8BAHrC,kCAAkC"}
|