@woosh/meep-engine 3.59.0 → 3.60.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/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 +4 -8
- 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 +21 -36
- 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 +39 -18
- package/src/view/elements/progress/segmented/GhostTrail.d.ts +56 -0
- package/src/view/elements/progress/segmented/GhostTrail.d.ts.map +1 -0
- package/src/view/elements/progress/segmented/GhostTrail.js +98 -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 +155 -10
- package/src/view/elements/progress/segmented/SegmentedResourceBarView.d.ts.map +1 -1
- package/src/view/elements/progress/segmented/SegmentedResourceBarView.js +427 -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/brick/vgeo/chunk_vgeo_brick_texel.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @type {number}
|
|
3
|
-
*/
|
|
4
|
-
export const VGEO_BRICK_TIE: number;
|
|
5
|
-
/**
|
|
6
|
-
* A world brick texel's distance from the triangles of a taken cell's cut (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md
|
|
7
|
-
* §7.8), signed by the nearest triangle's side, and the row it came from.
|
|
8
|
-
*
|
|
9
|
-
* ```wgsl
|
|
10
|
-
* struct VGeoBrickTexel { distance: f32, row: u32 } // F32_MAX and 0 with no triangle within the band
|
|
11
|
-
* fn vgeo_brick_texel(p: vec3<f32>, count: u32, band: f32) -> VGeoBrickTexel
|
|
12
|
-
* ```
|
|
13
|
-
*
|
|
14
|
-
* `p` is in the triangles' space, the cell's own. The triangles come through a seam the enclosing shader defines,
|
|
15
|
-
* as the mesh provider's instances do: `fn vgeo_brick_triangle_at(i: u32) -> VGeoBrickTriangle`. The provider's
|
|
16
|
-
* kernel answers from workgroup memory; a test, from a buffer.
|
|
17
|
-
*
|
|
18
|
-
* Only what lies within `band` is told apart: past it a byte saturates, and a texel no triangle comes within is
|
|
19
|
-
* unsigned, which is positive (§7.8). The nearest triangle decides the sign. Of triangles as near, by
|
|
20
|
-
* {@link VGEO_BRICK_TIE}, which is a point they share, an edge or a corner, the one whose normal lies most along the
|
|
21
|
-
* texel's offset from that point decides: where faces meet at an angle, the face the texel stands over. A
|
|
22
|
-
* triangle with no sides, a material drawn on both, signs positive.
|
|
23
|
-
*
|
|
24
|
-
* Per texel: at most `count` reach tests, and a closest point for each triangle the test lets through, which is
|
|
25
|
-
* one that might come nearer than the nearest so far.
|
|
26
|
-
*
|
|
27
|
-
* @type {CodeChunk}
|
|
28
|
-
*/
|
|
29
|
-
export const chunk_vgeo_brick_texel: CodeChunk;
|
|
30
|
-
import { CodeChunk } from "../../../../shader/compiler/CodeChunk.js";
|
|
31
|
-
//# sourceMappingURL=chunk_vgeo_brick_texel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_vgeo_brick_texel.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_texel.js"],"names":[],"mappings":"AAmBA;;GAEG;AACH,6BAFU,MAAM,CAE6E;AAE7F;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qCAFU,SAAS,CAkEhB;0BA3GuB,0CAA0C"}
|
package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_texel.js
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { MESH_SDF_BAND_VOXELS, MESH_SDF_BRICK_VOXELS } from "../../../../geometry/sdf/MESH_SDF.js";
|
|
2
|
-
import { F32_MAX_DEFINITION } from "../../../../shader/chunk/math/F32_MAX_DEFINITION.js";
|
|
3
|
-
import {
|
|
4
|
-
chunk_triangle_closest_point_to_point_barycentric
|
|
5
|
-
} from "../../../../shader/chunk/sdf/chunk_triangle_closest_point_to_point_barycentric.js";
|
|
6
|
-
import { CodeChunk } from "../../../../shader/compiler/CodeChunk.js";
|
|
7
|
-
import { VGEO_BRICK_TRIANGLE_STRUCT } from "./chunk_vgeo_brick_triangle.js";
|
|
8
|
-
|
|
9
|
-
/*
|
|
10
|
-
How far apart, relative, two squared distances may lie and still be one point's. Two triangles that share the
|
|
11
|
-
nearest point, an edge or a corner, compute it apart by their rounding. In the cell's own space a coordinate is at
|
|
12
|
-
most the cell and the band from texel 0; a closest point is three f32 roundings of that off, and two of them twice
|
|
13
|
-
that apart. Half a step of the encoding from the surface, that is the relative difference below, four times over;
|
|
14
|
-
nearer the surface than that, a texel's sign moves its byte by at most a step.
|
|
15
|
-
*/
|
|
16
|
-
const COORDINATE_VOXELS = MESH_SDF_BRICK_VOXELS + MESH_SDF_BAND_VOXELS;
|
|
17
|
-
const CLOSEST_POINT_ROUNDING_VOXELS = 3 * 2 ** -24 * COORDINATE_VOXELS;
|
|
18
|
-
const HALF_STEP_VOXELS = (2 * MESH_SDF_BAND_VOXELS / 255) / 2;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* @type {number}
|
|
22
|
-
*/
|
|
23
|
-
export const VGEO_BRICK_TIE = 4 * 2 * (2 * CLOSEST_POINT_ROUNDING_VOXELS) / HALF_STEP_VOXELS;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* A world brick texel's distance from the triangles of a taken cell's cut (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md
|
|
27
|
-
* §7.8), signed by the nearest triangle's side, and the row it came from.
|
|
28
|
-
*
|
|
29
|
-
* ```wgsl
|
|
30
|
-
* struct VGeoBrickTexel { distance: f32, row: u32 } // F32_MAX and 0 with no triangle within the band
|
|
31
|
-
* fn vgeo_brick_texel(p: vec3<f32>, count: u32, band: f32) -> VGeoBrickTexel
|
|
32
|
-
* ```
|
|
33
|
-
*
|
|
34
|
-
* `p` is in the triangles' space, the cell's own. The triangles come through a seam the enclosing shader defines,
|
|
35
|
-
* as the mesh provider's instances do: `fn vgeo_brick_triangle_at(i: u32) -> VGeoBrickTriangle`. The provider's
|
|
36
|
-
* kernel answers from workgroup memory; a test, from a buffer.
|
|
37
|
-
*
|
|
38
|
-
* Only what lies within `band` is told apart: past it a byte saturates, and a texel no triangle comes within is
|
|
39
|
-
* unsigned, which is positive (§7.8). The nearest triangle decides the sign. Of triangles as near, by
|
|
40
|
-
* {@link VGEO_BRICK_TIE}, which is a point they share, an edge or a corner, the one whose normal lies most along the
|
|
41
|
-
* texel's offset from that point decides: where faces meet at an angle, the face the texel stands over. A
|
|
42
|
-
* triangle with no sides, a material drawn on both, signs positive.
|
|
43
|
-
*
|
|
44
|
-
* Per texel: at most `count` reach tests, and a closest point for each triangle the test lets through, which is
|
|
45
|
-
* one that might come nearer than the nearest so far.
|
|
46
|
-
*
|
|
47
|
-
* @type {CodeChunk}
|
|
48
|
-
*/
|
|
49
|
-
export const chunk_vgeo_brick_texel = CodeChunk.from(
|
|
50
|
-
//language=WGSL
|
|
51
|
-
`
|
|
52
|
-
const VGEO_BRICK_TIE = ${VGEO_BRICK_TIE};
|
|
53
|
-
|
|
54
|
-
struct VGeoBrickTexel {
|
|
55
|
-
distance: f32,
|
|
56
|
-
row: u32,
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
fn vgeo_brick_texel(p: vec3<f32>, count: u32, band: f32) -> VGeoBrickTexel {
|
|
60
|
-
var nearest = band * band;
|
|
61
|
-
|
|
62
|
-
// the deciding triangle's cos² between its normal and the offset; above any, so the first decides by distance
|
|
63
|
-
var facing = 2.0;
|
|
64
|
-
var side = 1.0;
|
|
65
|
-
var row = 0u;
|
|
66
|
-
var found = false;
|
|
67
|
-
|
|
68
|
-
for (var i = 0u; i < count; i++) {
|
|
69
|
-
let t = vgeo_brick_triangle_at(i);
|
|
70
|
-
|
|
71
|
-
// the whole triangle lies within its reach of a: none of it nearer than this
|
|
72
|
-
let gap = max(distance(p, t.a) - t.reach, 0.0);
|
|
73
|
-
|
|
74
|
-
if (gap * gap >= nearest * (1.0 + VGEO_BRICK_TIE)) {
|
|
75
|
-
continue;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
let uv = triangle_closest_point_to_point_barycentric(p, t.a, t.b, t.c);
|
|
79
|
-
let offset = p - (t.a * uv.x + t.b * uv.y + t.c * (1.0 - uv.x - uv.y));
|
|
80
|
-
let squared = dot(offset, offset);
|
|
81
|
-
|
|
82
|
-
if (squared >= nearest * (1.0 + VGEO_BRICK_TIE)) {
|
|
83
|
-
continue;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
let normal = cross(t.b - t.a, t.c - t.a);
|
|
87
|
-
let along = dot(offset, normal);
|
|
88
|
-
let scale = squared * dot(normal, normal);
|
|
89
|
-
|
|
90
|
-
// 0 for a triangle seen edge-on, or with no area
|
|
91
|
-
let cos2 = select(0.0, along * along / scale, scale > 0.0);
|
|
92
|
-
|
|
93
|
-
if (squared < nearest * (1.0 - VGEO_BRICK_TIE) || cos2 > facing) {
|
|
94
|
-
facing = cos2;
|
|
95
|
-
side = select(1.0, select(-1.0, 1.0, along >= 0.0), t.sided != 0u);
|
|
96
|
-
row = t.row;
|
|
97
|
-
found = true;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
nearest = min(nearest, squared);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
if (!found) {
|
|
104
|
-
return VGeoBrickTexel(F32_MAX, 0u);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
return VGeoBrickTexel(side * sqrt(nearest), row);
|
|
108
|
-
}
|
|
109
|
-
`, [
|
|
110
|
-
F32_MAX_DEFINITION,
|
|
111
|
-
VGEO_BRICK_TRIANGLE_STRUCT.declaration_chunk,
|
|
112
|
-
chunk_triangle_closest_point_to_point_barycentric,
|
|
113
|
-
]);
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A triangle of a taken cell's cut as the distance pass holds it (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §7.8), 48
|
|
3
|
-
* bytes: its corners in the cell's own space, wound so that `(b - a) × (c - a)` points out of the surface; `reach`,
|
|
4
|
-
* how far from `a` its farther corner lies, which bounds the whole triangle; its `meshes` row; and `sided`, 0 for a
|
|
5
|
-
* material drawn on both sides, which has no inside to sign.
|
|
6
|
-
* @type {WebGPUStruct}
|
|
7
|
-
*/
|
|
8
|
-
export const VGEO_BRICK_TRIANGLE_STRUCT: WebGPUStruct;
|
|
9
|
-
/**
|
|
10
|
-
* A triangle of a cluster in a taken cell's cut, for the distance pass (§7.8):
|
|
11
|
-
*
|
|
12
|
-
* ```wgsl
|
|
13
|
-
* fn vgeo_brick_triangle_reaches(pair_base: u32, positions: TrianglePositions) -> bool
|
|
14
|
-
* fn vgeo_brick_triangle(
|
|
15
|
-
* positions: TrianglePositions, global: mat4x4<f32>, origin: vec3<f32>, reversed: bool, sided: bool, row: u32
|
|
16
|
-
* ) -> VGeoBrickTriangle
|
|
17
|
-
* ```
|
|
18
|
-
*
|
|
19
|
-
* `vgeo_brick_triangle_reaches` is the pass's cull, in the instance's own space: the triangle's box meets its
|
|
20
|
-
* pair's, the cell grown by the band. A triangle outside it lies farther than the band from every texel, where a
|
|
21
|
-
* texel's byte saturates, so it could change no byte.
|
|
22
|
-
*
|
|
23
|
-
* `vgeo_brick_triangle` places one. Its corners go into the world by `global`, less `origin`, the cell's texel 0,
|
|
24
|
-
* so that a texel's arithmetic runs on numbers the size of the cell; the translation is taken less `origin` first,
|
|
25
|
-
* so a cell far from the world's origin keeps that precision. `reversed`, where the instance mirrors or its
|
|
26
|
-
* material draws the back (`triangle_winding_is_reversed`), swaps b and c, so the normal points out of the surface
|
|
27
|
-
* the instance draws.
|
|
28
|
-
*
|
|
29
|
-
* Requires the importing shader to declare `instances`, the pair records.
|
|
30
|
-
*
|
|
31
|
-
* @type {CodeChunk}
|
|
32
|
-
*/
|
|
33
|
-
export const chunk_vgeo_brick_triangle: CodeChunk;
|
|
34
|
-
import { WebGPUStruct } from "../../../../shader/type/WebGPUStruct.js";
|
|
35
|
-
import { CodeChunk } from "../../../../shader/compiler/CodeChunk.js";
|
|
36
|
-
//# sourceMappingURL=chunk_vgeo_brick_triangle.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_vgeo_brick_triangle.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_triangle.js"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,yCAFU,YAAY,CASE;AAExB;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wCAFU,SAAS,CAwChB;6BAjF0B,yCAAyC;0BAF5C,0CAA0C"}
|
package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_triangle.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { TRIANGLE_POSITIONS_STRUCT } from "../../../../shader/chunk/geometry/triangle/TRIANGLE_POSITIONS_STRUCT.js";
|
|
2
|
-
import { CodeChunk } from "../../../../shader/compiler/CodeChunk.js";
|
|
3
|
-
import { f32, u32, vec3f } from "../../../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
|
|
4
|
-
import { WebGPUStruct } from "../../../../shader/type/WebGPUStruct.js";
|
|
5
|
-
import { chunk_vgeo_brick_box } from "./chunk_vgeo_brick_box.js";
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* A triangle of a taken cell's cut as the distance pass holds it (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §7.8), 48
|
|
9
|
-
* bytes: its corners in the cell's own space, wound so that `(b - a) × (c - a)` points out of the surface; `reach`,
|
|
10
|
-
* how far from `a` its farther corner lies, which bounds the whole triangle; its `meshes` row; and `sided`, 0 for a
|
|
11
|
-
* material drawn on both sides, which has no inside to sign.
|
|
12
|
-
* @type {WebGPUStruct}
|
|
13
|
-
*/
|
|
14
|
-
export const VGEO_BRICK_TRIANGLE_STRUCT = WebGPUStruct.from({
|
|
15
|
-
a: vec3f,
|
|
16
|
-
row: u32,
|
|
17
|
-
b: vec3f,
|
|
18
|
-
reach: f32,
|
|
19
|
-
c: vec3f,
|
|
20
|
-
sided: u32,
|
|
21
|
-
}, 'VGeoBrickTriangle');
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* A triangle of a cluster in a taken cell's cut, for the distance pass (§7.8):
|
|
25
|
-
*
|
|
26
|
-
* ```wgsl
|
|
27
|
-
* fn vgeo_brick_triangle_reaches(pair_base: u32, positions: TrianglePositions) -> bool
|
|
28
|
-
* fn vgeo_brick_triangle(
|
|
29
|
-
* positions: TrianglePositions, global: mat4x4<f32>, origin: vec3<f32>, reversed: bool, sided: bool, row: u32
|
|
30
|
-
* ) -> VGeoBrickTriangle
|
|
31
|
-
* ```
|
|
32
|
-
*
|
|
33
|
-
* `vgeo_brick_triangle_reaches` is the pass's cull, in the instance's own space: the triangle's box meets its
|
|
34
|
-
* pair's, the cell grown by the band. A triangle outside it lies farther than the band from every texel, where a
|
|
35
|
-
* texel's byte saturates, so it could change no byte.
|
|
36
|
-
*
|
|
37
|
-
* `vgeo_brick_triangle` places one. Its corners go into the world by `global`, less `origin`, the cell's texel 0,
|
|
38
|
-
* so that a texel's arithmetic runs on numbers the size of the cell; the translation is taken less `origin` first,
|
|
39
|
-
* so a cell far from the world's origin keeps that precision. `reversed`, where the instance mirrors or its
|
|
40
|
-
* material draws the back (`triangle_winding_is_reversed`), swaps b and c, so the normal points out of the surface
|
|
41
|
-
* the instance draws.
|
|
42
|
-
*
|
|
43
|
-
* Requires the importing shader to declare `instances`, the pair records.
|
|
44
|
-
*
|
|
45
|
-
* @type {CodeChunk}
|
|
46
|
-
*/
|
|
47
|
-
export const chunk_vgeo_brick_triangle = CodeChunk.from(
|
|
48
|
-
//language=WGSL
|
|
49
|
-
`
|
|
50
|
-
fn vgeo_brick_triangle_reaches(pair_base: u32, positions: ${TRIANGLE_POSITIONS_STRUCT.wgsl_ref}) -> bool {
|
|
51
|
-
let lower = min(min(positions.a, positions.b), positions.c);
|
|
52
|
-
let upper = max(max(positions.a, positions.b), positions.c);
|
|
53
|
-
|
|
54
|
-
return !(any(upper < vgeo_brick_box_lower(pair_base)) || any(lower > vgeo_brick_box_upper(pair_base)));
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
fn vgeo_brick_triangle(
|
|
58
|
-
positions: ${TRIANGLE_POSITIONS_STRUCT.wgsl_ref},
|
|
59
|
-
global: mat4x4<f32>,
|
|
60
|
-
origin: vec3<f32>,
|
|
61
|
-
reversed: bool,
|
|
62
|
-
sided: bool,
|
|
63
|
-
row: u32,
|
|
64
|
-
) -> ${VGEO_BRICK_TRIANGLE_STRUCT.wgsl_ref} {
|
|
65
|
-
let linear = mat3x3<f32>(global[0].xyz, global[1].xyz, global[2].xyz);
|
|
66
|
-
let offset = global[3].xyz - origin;
|
|
67
|
-
|
|
68
|
-
let a = linear * positions.a + offset;
|
|
69
|
-
let b = linear * positions.b + offset;
|
|
70
|
-
let c = linear * positions.c + offset;
|
|
71
|
-
|
|
72
|
-
return ${VGEO_BRICK_TRIANGLE_STRUCT.wgsl_ref}(
|
|
73
|
-
a,
|
|
74
|
-
row,
|
|
75
|
-
select(b, c, reversed),
|
|
76
|
-
sqrt(max(dot(b - a, b - a), dot(c - a, c - a))),
|
|
77
|
-
select(c, b, reversed),
|
|
78
|
-
select(0u, 1u, sided),
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
`, [
|
|
82
|
-
TRIANGLE_POSITIONS_STRUCT.declaration_chunk,
|
|
83
|
-
VGEO_BRICK_TRIANGLE_STRUCT.declaration_chunk,
|
|
84
|
-
chunk_vgeo_brick_box,
|
|
85
|
-
]);
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The vgeo provider's distances (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §7.8): a workgroup a taken cell the box cut
|
|
3
|
-
* put a cluster on the list of, dispatched by their count (`vgeo_brick_filled`), so the cells without virtual
|
|
4
|
-
* geometry cost nothing here.
|
|
5
|
-
*
|
|
6
|
-
* **Triangles.** A lane a triangle of as many of the list's clusters at a time as the lanes hold whole. A triangle
|
|
7
|
-
* whose box misses its pair's, the cell grown by the band in the instance's space, is skipped
|
|
8
|
-
* (`vgeo_brick_triangle_reaches`); the rest go into workgroup memory placed in the cell's own space and wound out
|
|
9
|
-
* of the surface their instance draws (`vgeo_brick_triangle`), up to {@link VGEO_BRICK_CELL_TRIANGLES}. Past it
|
|
10
|
-
* they are dropped and counted. A cell none comes near writes nothing.
|
|
11
|
-
*
|
|
12
|
-
* **512 texels**, shared out evenly, each `vgeo_brick_texel`: the distance to the nearest triangle within the band,
|
|
13
|
-
* signed by its side, and its row.
|
|
14
|
-
*
|
|
15
|
-
* **The merge.** The provider's bytes meet in workgroup memory, then a lane a staged word takes each byte's least
|
|
16
|
-
* (contracts 1 and 2), and a lane an object cell writes the provider's row where its nearest texel is nearer than
|
|
17
|
-
* the staged minimum from before the merge; ties keep the staged object (contract 3).
|
|
18
|
-
*
|
|
19
|
-
* @type {ComputeShader}
|
|
20
|
-
*/
|
|
21
|
-
export const shader_vgeo_brick_distance: ComputeShader;
|
|
22
|
-
import { ComputeShader } from "../../../../shader/ComputeShader.js";
|
|
23
|
-
//# sourceMappingURL=shader_vgeo_brick_distance.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shader_vgeo_brick_distance.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_distance.js"],"names":[],"mappings":"AAwPA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,yCAFU,aAAa,CAMpB;8BAhQ2B,qCAAqC"}
|
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
import { MESH_SDF_BRICK_TEXEL_COUNT, MESH_SDF_BRICK_TEXELS } from "../../../../geometry/sdf/MESH_SDF.js";
|
|
2
|
-
import { GEOMETRY_ATTRIBUTE_DATA_TYPE } from "../../../../geometry/GEOMETRY_ATTRIBUTE_DATA_TYPE.js";
|
|
3
|
-
import { MESHLET_METADATA_STRUCT } from "../../../../geometry/meshlet/encoding/MESHLET_METADATA_STRUCT.js";
|
|
4
|
-
import { VGEO_MAX_CLUSTER_TRIANGLE_COUNT } from "../../../../geometry/virtual/format/cluster/VGEO_MAX_CLUSTER_TRIANGLE_COUNT.js";
|
|
5
|
-
import { VGEO_INSTANCE_OFFSET } from "../../../../geometry/virtual/runtime/layout/VGEO_INSTANCE_OFFSET.js";
|
|
6
|
-
import { VGEO_INSTANCE_WORDS } from "../../../../geometry/virtual/runtime/layout/VGEO_INSTANCE_WORDS.js";
|
|
7
|
-
import { MATERIAL_METADATA_STRUCT } from "../../../../material/MATERIAL_METADATA_STRUCT.js";
|
|
8
|
-
import { ShadeDrawSide } from "../../../../material/ShadeDrawSide.js";
|
|
9
|
-
import { chunk_triangle_winding_is_reversed } from "../../../../rasterize/chunk_triangle_winding_is_reversed.js";
|
|
10
|
-
import { chunk_scene_database_access } from "../../../../scene/chunk_scene_database_access.js";
|
|
11
|
-
import { CLIPMAP_LEVEL_ARRAY } from "../../../../shader/chunk/clipmap/CLIPMAP_LEVEL_STRUCT.js";
|
|
12
|
-
import {
|
|
13
|
-
chunk_read_meshlet_triangle_positions
|
|
14
|
-
} from "../../../../shader/chunk/geometry/meshlet/chunk_read_meshlet_triangle_positions.js";
|
|
15
|
-
import { chunk_folded_workgroup_index } from "../../../../shader/chunk/grid/chunk_folded_workgroup_index.js";
|
|
16
|
-
import { CodeChunk } from "../../../../shader/compiler/CodeChunk.js";
|
|
17
|
-
import { ComputeShader } from "../../../../shader/ComputeShader.js";
|
|
18
|
-
import { ShaderResourceSetDescriptor } from "../../../../shader/resource/ShaderResourceSetDescriptor.js";
|
|
19
|
-
import { atomic_u32, u32 } from "../../../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
|
|
20
|
-
import { WebGPUArray } from "../../../../shader/type/WebGPUArray.js";
|
|
21
|
-
import { BRICK_OBJECT_CELLS, BRICK_OBJECT_CELLS_PER_AXIS } from "../BRICK_CLIPMAP.js";
|
|
22
|
-
import { COLLECTION_U32_STRUCT_READ } from "../../../../gpu_primitive/COLLECTION_U32_STRUCT_READ.js";
|
|
23
|
-
import { COLLECTION_U32_STRUCT_WRITE } from "../../../../gpu_primitive/COLLECTION_U32_STRUCT_WRITE.js";
|
|
24
|
-
import { BRICK_STAGING_RESOURCE, chunk_brick_clipmap } from "../chunk_brick_clipmap.js";
|
|
25
|
-
import { chunk_brick_object } from "../chunk_brick_object.js";
|
|
26
|
-
import { chunk_brick_provider_cell } from "../chunk_brick_provider.js";
|
|
27
|
-
import { chunk_vgeo_brick_texel } from "./chunk_vgeo_brick_texel.js";
|
|
28
|
-
import { chunk_vgeo_brick_triangle, VGEO_BRICK_TRIANGLE_STRUCT } from "./chunk_vgeo_brick_triangle.js";
|
|
29
|
-
import {
|
|
30
|
-
VGEO_BRICK_CELL_CLUSTERS,
|
|
31
|
-
VGEO_BRICK_CELL_OFFSET,
|
|
32
|
-
VGEO_BRICK_CELL_TRIANGLES,
|
|
33
|
-
VGEO_BRICK_CELL_WORDS,
|
|
34
|
-
VGEO_BRICK_DISTANCE_WORKGROUP_SIZE,
|
|
35
|
-
VGEO_BRICK_SETTINGS,
|
|
36
|
-
VGEO_BRICK_STATISTIC_TRIANGLES_DROPPED,
|
|
37
|
-
VGEO_BRICK_STATISTIC_WAITS_DROPPED,
|
|
38
|
-
VGEO_BRICK_WAIT_WORDS
|
|
39
|
-
} from "./VGEO_BRICK.js";
|
|
40
|
-
|
|
41
|
-
const CLUSTERS_PER_STEP = VGEO_BRICK_DISTANCE_WORKGROUP_SIZE / VGEO_MAX_CLUSTER_TRIANGLE_COUNT;
|
|
42
|
-
const TEXELS_PER_LANE = MESH_SDF_BRICK_TEXEL_COUNT / VGEO_BRICK_DISTANCE_WORKGROUP_SIZE;
|
|
43
|
-
const T = MESH_SDF_BRICK_TEXELS;
|
|
44
|
-
|
|
45
|
-
const resources = new ShaderResourceSetDescriptor();
|
|
46
|
-
|
|
47
|
-
resources.setImmediate("settings", VGEO_BRICK_SETTINGS);
|
|
48
|
-
|
|
49
|
-
resources.createGroup()
|
|
50
|
-
.add(BRICK_STAGING_RESOURCE)
|
|
51
|
-
.addUniform("brick_levels", CLIPMAP_LEVEL_ARRAY)
|
|
52
|
-
.addStorageBuffer("vgeo_brick_statistics", WebGPUArray.from(atomic_u32), true);
|
|
53
|
-
|
|
54
|
-
resources.createGroup()
|
|
55
|
-
// the taken cells a cluster went onto the list of, and their lists, as the cut left them
|
|
56
|
-
.addStorageBuffer("vgeo_brick_filled", COLLECTION_U32_STRUCT_READ)
|
|
57
|
-
.addStorageBuffer("vgeo_brick_cells", WebGPUArray.from(u32))
|
|
58
|
-
// the pair records
|
|
59
|
-
.addStorageBuffer("instances", WebGPUArray.from(u32))
|
|
60
|
-
.addStorageBuffer("scene_database", WebGPUArray.from(u32))
|
|
61
|
-
.addStorageBuffer("materials", WebGPUArray.from(MATERIAL_METADATA_STRUCT))
|
|
62
|
-
.addStorageBuffer("meshlet_metadata", WebGPUArray.from(MESHLET_METADATA_STRUCT))
|
|
63
|
-
.addStorageBuffer("meshlet_data", GEOMETRY_ATTRIBUTE_DATA_TYPE)
|
|
64
|
-
// the cells waiting to be built again, `VGEO_BRICK_WAIT_WORDS` each: the next frame's
|
|
65
|
-
.addStorageBuffer("vgeo_brick_waiting", COLLECTION_U32_STRUCT_WRITE, true);
|
|
66
|
-
|
|
67
|
-
const body = CodeChunk.from(
|
|
68
|
-
//language=WGSL
|
|
69
|
-
`
|
|
70
|
-
const VGEO_BRICK_CELL_TRIANGLES = ${VGEO_BRICK_CELL_TRIANGLES}u;
|
|
71
|
-
|
|
72
|
-
var<workgroup> cell_count: u32;
|
|
73
|
-
|
|
74
|
-
/** the cut's triangles that come within the band, as the lanes found them, and their count, past the array too */
|
|
75
|
-
var<workgroup> triangles: array<${VGEO_BRICK_TRIANGLE_STRUCT.wgsl_ref}, VGEO_BRICK_CELL_TRIANGLES>;
|
|
76
|
-
var<workgroup> triangle_count: atomic<u32>;
|
|
77
|
-
var<workgroup> triangle_total: u32;
|
|
78
|
-
|
|
79
|
-
/** the provider's bytes, as the staging packs them; per object cell, its nearest texel's key and its staged minimum */
|
|
80
|
-
var<workgroup> texel_bytes: array<atomic<u32>, BRICK_STAGING_DISTANCE_WORDS>;
|
|
81
|
-
var<workgroup> object_best: array<atomic<u32>, ${BRICK_OBJECT_CELLS}u>;
|
|
82
|
-
var<workgroup> object_staged: array<atomic<u32>, ${BRICK_OBJECT_CELLS}u>;
|
|
83
|
-
|
|
84
|
-
fn vgeo_brick_triangle_at(i: u32) -> ${VGEO_BRICK_TRIANGLE_STRUCT.wgsl_ref} {
|
|
85
|
-
return triangles[i];
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/** texel \`t\`'s object cell: x fastest, then y, then z, a cell 2³ texels */
|
|
89
|
-
fn vgeo_brick_object_of(t: u32) -> u32 {
|
|
90
|
-
let x = t % ${T}u;
|
|
91
|
-
let y = (t / ${T}u) % ${T}u;
|
|
92
|
-
let z = t / ${T * T}u;
|
|
93
|
-
|
|
94
|
-
return (x / 2u) + ${BRICK_OBJECT_CELLS_PER_AXIS}u * ((y / 2u) + ${BRICK_OBJECT_CELLS_PER_AXIS}u * (z / 2u));
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
@compute @workgroup_size(${VGEO_BRICK_DISTANCE_WORKGROUP_SIZE})
|
|
98
|
-
fn main(
|
|
99
|
-
@builtin(workgroup_id) workgroup_id: vec3<u32>,
|
|
100
|
-
@builtin(local_invocation_index) lane: u32,
|
|
101
|
-
) {
|
|
102
|
-
let index = folded_workgroup_index(workgroup_id);
|
|
103
|
-
|
|
104
|
-
if (lane == 0u) {
|
|
105
|
-
cell_count = vgeo_brick_filled.count;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
// a folded dispatch's tail leaves whole
|
|
109
|
-
if (index >= workgroupUniformLoad(&cell_count)) {
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
let build = vgeo_brick_filled.elements[index];
|
|
114
|
-
let list = build * ${VGEO_BRICK_CELL_WORDS}u;
|
|
115
|
-
let key = vgeo_brick_cells[list + ${VGEO_BRICK_CELL_OFFSET.KEY}u];
|
|
116
|
-
|
|
117
|
-
let at = brick_provider_cell(key, settings.resolution);
|
|
118
|
-
let clusters = min(vgeo_brick_cells[list + ${VGEO_BRICK_CELL_OFFSET.COUNT}u], ${VGEO_BRICK_CELL_CLUSTERS}u);
|
|
119
|
-
|
|
120
|
-
// a cell built with a stand-in waits to be built again, on the list the next frame's wait reads
|
|
121
|
-
if (lane == 0u && vgeo_brick_cells[list + ${VGEO_BRICK_CELL_OFFSET.WAITS}u] > 0u) {
|
|
122
|
-
let wait = atomicAdd(&vgeo_brick_waiting.count, 1u);
|
|
123
|
-
|
|
124
|
-
if (wait < settings.wait_capacity) {
|
|
125
|
-
// the header keeps the cell as a waiting cell's words
|
|
126
|
-
for (var w = 0u; w < ${VGEO_BRICK_WAIT_WORDS}u; w++) {
|
|
127
|
-
vgeo_brick_waiting.elements[${VGEO_BRICK_WAIT_WORDS}u * wait + w] = vgeo_brick_cells[list + ${VGEO_BRICK_CELL_OFFSET.WAIT}u + w];
|
|
128
|
-
}
|
|
129
|
-
} else {
|
|
130
|
-
atomicAdd(&vgeo_brick_statistics[${VGEO_BRICK_STATISTIC_WAITS_DROPPED}u], 1u);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
// ----- the cut's triangles that come within the band: a lane a triangle, of ${CLUSTERS_PER_STEP} clusters at a time -----
|
|
135
|
-
|
|
136
|
-
let member = lane % ${VGEO_MAX_CLUSTER_TRIANGLE_COUNT}u;
|
|
137
|
-
|
|
138
|
-
for (var k = lane / ${VGEO_MAX_CLUSTER_TRIANGLE_COUNT}u; k < clusters; k += ${CLUSTERS_PER_STEP}u) {
|
|
139
|
-
let entry = list + ${VGEO_BRICK_CELL_OFFSET.ENTRIES}u + 2u * k;
|
|
140
|
-
let pair_base = vgeo_brick_cells[entry] * ${VGEO_INSTANCE_WORDS}u;
|
|
141
|
-
let meshlet = vgeo_brick_cells[entry + 1u];
|
|
142
|
-
|
|
143
|
-
if (member >= meshlet_metadata[meshlet].primitive_count) {
|
|
144
|
-
continue;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
let positions = read_meshlet_triangle_positions(meshlet, member);
|
|
148
|
-
|
|
149
|
-
if (!vgeo_brick_triangle_reaches(pair_base, positions)) {
|
|
150
|
-
continue;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
let row = instances[pair_base + ${VGEO_INSTANCE_OFFSET.MESH_INDEX}u];
|
|
154
|
-
let mesh = scene_read_mesh(&scene_database, row);
|
|
155
|
-
let node = scene_read_node(&scene_database, mesh.node);
|
|
156
|
-
let side = materials[mesh.material].draw_side;
|
|
157
|
-
|
|
158
|
-
let slot = atomicAdd(&triangle_count, 1u);
|
|
159
|
-
|
|
160
|
-
if (slot < VGEO_BRICK_CELL_TRIANGLES) {
|
|
161
|
-
triangles[slot] = vgeo_brick_triangle(
|
|
162
|
-
positions, node.global, at.corner,
|
|
163
|
-
triangle_winding_is_reversed(node, side), side != ${ShadeDrawSide.Double}u,
|
|
164
|
-
row
|
|
165
|
-
);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
workgroupBarrier();
|
|
170
|
-
|
|
171
|
-
if (lane == 0u) {
|
|
172
|
-
let total = atomicLoad(&triangle_count);
|
|
173
|
-
|
|
174
|
-
triangle_total = total;
|
|
175
|
-
|
|
176
|
-
if (total > VGEO_BRICK_CELL_TRIANGLES) {
|
|
177
|
-
atomicAdd(&vgeo_brick_statistics[${VGEO_BRICK_STATISTIC_TRIANGLES_DROPPED}u], total - VGEO_BRICK_CELL_TRIANGLES);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
let count = min(workgroupUniformLoad(&triangle_total), VGEO_BRICK_CELL_TRIANGLES);
|
|
182
|
-
|
|
183
|
-
// no triangle of the cut comes near the cell: a provider with nothing in a cell writes nothing
|
|
184
|
-
if (count == 0u) {
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
// ----- the texels, ${TEXELS_PER_LANE} a lane, in the cell's own space: texel 0 at its corner -----
|
|
189
|
-
|
|
190
|
-
for (var h = 0u; h < ${TEXELS_PER_LANE}u; h++) {
|
|
191
|
-
let t = lane + h * ${VGEO_BRICK_DISTANCE_WORKGROUP_SIZE}u;
|
|
192
|
-
let p = vec3<f32>(f32(t % ${T}u), f32((t / ${T}u) % ${T}u), f32(t / ${T * T}u)) * at.voxel;
|
|
193
|
-
|
|
194
|
-
let texel = vgeo_brick_texel(p, count, at.band);
|
|
195
|
-
let byte = brick_encode(texel.distance, at.band);
|
|
196
|
-
|
|
197
|
-
atomicOr(&texel_bytes[t / 4u], byte << (8u * (t % 4u)));
|
|
198
|
-
atomicMax(&object_best[vgeo_brick_object_of(t)], brick_object_key(byte, texel.row));
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
workgroupBarrier();
|
|
202
|
-
|
|
203
|
-
// ----- contracts 1 and 2: a lane a staged word, each byte the least of the staged and the provider's -----
|
|
204
|
-
|
|
205
|
-
if (lane < BRICK_STAGING_DISTANCE_WORDS) {
|
|
206
|
-
let word = build * BRICK_STAGING_WORDS + lane;
|
|
207
|
-
let staged = brick_staging[word];
|
|
208
|
-
let provided = atomicLoad(&texel_bytes[lane]);
|
|
209
|
-
|
|
210
|
-
var merged = 0u;
|
|
211
|
-
|
|
212
|
-
for (var b = 0u; b < 4u; b++) {
|
|
213
|
-
let shift = 8u * b;
|
|
214
|
-
let s = (staged >> shift) & 0xffu;
|
|
215
|
-
|
|
216
|
-
merged |= min(s, (provided >> shift) & 0xffu) << shift;
|
|
217
|
-
|
|
218
|
-
// contract 3 weighs the staged minimum from before this provider's merge
|
|
219
|
-
atomicMax(&object_staged[vgeo_brick_object_of(4u * lane + b)], 255u - s);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
brick_staging[word] = merged;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
workgroupBarrier();
|
|
226
|
-
|
|
227
|
-
// ----- contract 3: a lane an object cell, the provider's row where its nearest texel is nearer than the staged -----
|
|
228
|
-
|
|
229
|
-
if (lane < ${BRICK_OBJECT_CELLS}u) {
|
|
230
|
-
let nearest = atomicLoad(&object_best[lane]);
|
|
231
|
-
|
|
232
|
-
if (brick_object_key_byte(nearest) < 255u - atomicLoad(&object_staged[lane])) {
|
|
233
|
-
brick_staging[build * BRICK_STAGING_WORDS + BRICK_STAGING_DISTANCE_WORDS + lane] = brick_object_key_row(nearest);
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
`, [
|
|
238
|
-
chunk_brick_clipmap,
|
|
239
|
-
chunk_brick_provider_cell,
|
|
240
|
-
chunk_brick_object,
|
|
241
|
-
chunk_folded_workgroup_index,
|
|
242
|
-
chunk_scene_database_access,
|
|
243
|
-
chunk_triangle_winding_is_reversed,
|
|
244
|
-
chunk_read_meshlet_triangle_positions,
|
|
245
|
-
chunk_vgeo_brick_triangle,
|
|
246
|
-
chunk_vgeo_brick_texel,
|
|
247
|
-
]);
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* The vgeo provider's distances (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §7.8): a workgroup a taken cell the box cut
|
|
251
|
-
* put a cluster on the list of, dispatched by their count (`vgeo_brick_filled`), so the cells without virtual
|
|
252
|
-
* geometry cost nothing here.
|
|
253
|
-
*
|
|
254
|
-
* **Triangles.** A lane a triangle of as many of the list's clusters at a time as the lanes hold whole. A triangle
|
|
255
|
-
* whose box misses its pair's, the cell grown by the band in the instance's space, is skipped
|
|
256
|
-
* (`vgeo_brick_triangle_reaches`); the rest go into workgroup memory placed in the cell's own space and wound out
|
|
257
|
-
* of the surface their instance draws (`vgeo_brick_triangle`), up to {@link VGEO_BRICK_CELL_TRIANGLES}. Past it
|
|
258
|
-
* they are dropped and counted. A cell none comes near writes nothing.
|
|
259
|
-
*
|
|
260
|
-
* **512 texels**, shared out evenly, each `vgeo_brick_texel`: the distance to the nearest triangle within the band,
|
|
261
|
-
* signed by its side, and its row.
|
|
262
|
-
*
|
|
263
|
-
* **The merge.** The provider's bytes meet in workgroup memory, then a lane a staged word takes each byte's least
|
|
264
|
-
* (contracts 1 and 2), and a lane an object cell writes the provider's row where its nearest texel is nearer than
|
|
265
|
-
* the staged minimum from before the merge; ties keep the staged object (contract 3).
|
|
266
|
-
*
|
|
267
|
-
* @type {ComputeShader}
|
|
268
|
-
*/
|
|
269
|
-
export const shader_vgeo_brick_distance = ComputeShader.from({
|
|
270
|
-
label: "Brick Clipmap VGeo Distance",
|
|
271
|
-
resources,
|
|
272
|
-
body,
|
|
273
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The vgeo provider's gather (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §7.8): a 64-lane workgroup a taken cell,
|
|
3
|
-
* dispatched by take. A cooperative TLAS query with the cell grown by the cascade's band, every leaf filtered by
|
|
4
|
-
* `vgeo_brick_accept`, and a pair record for each candidate (`vgeo_brick_pair`): the instance cut at a world error
|
|
5
|
-
* under half the cascade's voxel, within the cell grown by the band. The records and their claim widths are a cut's
|
|
6
|
-
* collect, so the camera cut's scan, seed and descent run them. Pairs past the records' capacity, and what the query
|
|
7
|
-
* itself dropped, are counted.
|
|
8
|
-
*
|
|
9
|
-
* @type {ComputeShader}
|
|
10
|
-
*/
|
|
11
|
-
export const shader_vgeo_brick_gather: ComputeShader;
|
|
12
|
-
import { ComputeShader } from "../../../../shader/ComputeShader.js";
|
|
13
|
-
//# sourceMappingURL=shader_vgeo_brick_gather.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shader_vgeo_brick_gather.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_gather.js"],"names":[],"mappings":"AAwIA;;;;;;;;;GASG;AACH,uCAFU,aAAa,CAMpB;8BA3I2B,qCAAqC"}
|