@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
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The multi-scale mean estimator (MSME) of a stream of RGB samples: a long mean that blends slowly while the
|
|
3
|
+
* stream is steady and noisy, and catches up with a short mean once the two disagree by more than the stream's
|
|
4
|
+
* deviation explains. Barré-Brisebois et al., *Hybrid Rendering for Real-Time Ray Tracing*, Ray Tracing Gems
|
|
5
|
+
* (2019) ch. 25; Enshrouded's probes (Kolesik, GPC 2024) keep it a texel.
|
|
6
|
+
*
|
|
7
|
+
* ```wgsl
|
|
8
|
+
* fn multiscale_mean_seed(sample: vec3f) -> MultiscaleMean
|
|
9
|
+
* fn multiscale_mean_add(e: MultiscaleMean, sample: vec3f, short_blend: f32, variance_blend: f32, mean_blend_min: f32, clip: bool) -> MultiscaleMean
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* `MultiscaleMean` is {@link MULTISCALE_MEAN_STRUCT}.
|
|
13
|
+
*
|
|
14
|
+
* - **Seed**: both means at the first sample, nothing of variance, no blend reduction, an inconsistency of one,
|
|
15
|
+
* as WickedEngine's surfels seed it.
|
|
16
|
+
* - **Clip**: a sample past `0.1 + short_mean + 8·deviation` a channel is held there, a firefly. The 0.1 is
|
|
17
|
+
* the reference's, in the radiance's own units. A caller whose variance does not yet rest on a window of
|
|
18
|
+
* samples passes `clip` false: there is no spread to clip to.
|
|
19
|
+
* - **Short mean**: blended by `short_blend`; the variance by `variance_blend`, the reference's half of it, so
|
|
20
|
+
* that its window outlasts the short mean's.
|
|
21
|
+
* - **Long mean**: blended by the catch-up, `smoothstep(relative · max(0.02, inconsistency − 0.2))` held to
|
|
22
|
+
* [1/256, 1], times the blend reduction, and at least `mean_blend_min`. `relative` is the luminance of the
|
|
23
|
+
* means' gap over the deviation; the inconsistency its smoothed history; the reduction the luminance of half
|
|
24
|
+
* the short mean over the deviation, held to [1/32, 1], a noisy stream's longer window. The inconsistency
|
|
25
|
+
* follows by `short_blend`, where the reference's 0.08 a sample stands at its default short blend of 0.08.
|
|
26
|
+
* - **The reduction follows by the reference's 0.1 a sample**, whatever the short blend. The catch-up takes the
|
|
27
|
+
* last sample's reduction, so following by a large short blend (rare samples) it would track each one: the
|
|
28
|
+
* long mean's weight would rise after the bright samples it is about to fall back from, and it settles low.
|
|
29
|
+
* Measured through the probe accumulate pass (2026-10-29, the emulator, samples of mean 1 and deviation 1,
|
|
30
|
+
* four streams averaged): 7, 18, 28 and 39% low at short blends of 0.55, 0.63, 0.78 and 0.9 that way; 2, 3,
|
|
31
|
+
* 7 and 15% at 0.1 a sample, with the same step response.
|
|
32
|
+
*
|
|
33
|
+
* Measured on a CPU model (2026-10-29, 200 runs averaged), against an exponential mean of the short blend, over
|
|
34
|
+
* samples that are 0 or twice the mean, a ray of two lit: at a short blend of 1/4 the long mean wanders 0.19 of
|
|
35
|
+
* the mean against 0.38, and reaches 90% of a tripling in 14 samples against 9; at 1/8, 0.077 against 0.25, in
|
|
36
|
+
* 88 against 18. An exponential mean as steady takes 35 and 197. Over a noiseless stream it takes a step about
|
|
37
|
+
* twice as slowly as the short blend, the clip holding the first samples past the step.
|
|
38
|
+
*
|
|
39
|
+
* @type {CodeChunk}
|
|
40
|
+
*/
|
|
41
|
+
export const chunk_multiscale_mean: CodeChunk;
|
|
42
|
+
import { CodeChunk } from "../../compiler/CodeChunk.js";
|
|
43
|
+
//# sourceMappingURL=chunk_multiscale_mean.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk_multiscale_mean.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,oCAFU,SAAS,CA4CZ;0BAtFmB,6BAA6B"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { CodeChunk } from "../../compiler/CodeChunk.js";
|
|
2
|
+
import { chunk_rgb_to_luminance } from "../color/chunk_rgb_to_luminance.js";
|
|
3
|
+
import { MULTISCALE_MEAN_STRUCT } from "./MULTISCALE_MEAN_STRUCT.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The multi-scale mean estimator (MSME) of a stream of RGB samples: a long mean that blends slowly while the
|
|
7
|
+
* stream is steady and noisy, and catches up with a short mean once the two disagree by more than the stream's
|
|
8
|
+
* deviation explains. Barré-Brisebois et al., *Hybrid Rendering for Real-Time Ray Tracing*, Ray Tracing Gems
|
|
9
|
+
* (2019) ch. 25; Enshrouded's probes (Kolesik, GPC 2024) keep it a texel.
|
|
10
|
+
*
|
|
11
|
+
* ```wgsl
|
|
12
|
+
* fn multiscale_mean_seed(sample: vec3f) -> MultiscaleMean
|
|
13
|
+
* fn multiscale_mean_add(e: MultiscaleMean, sample: vec3f, short_blend: f32, variance_blend: f32, mean_blend_min: f32, clip: bool) -> MultiscaleMean
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* `MultiscaleMean` is {@link MULTISCALE_MEAN_STRUCT}.
|
|
17
|
+
*
|
|
18
|
+
* - **Seed**: both means at the first sample, nothing of variance, no blend reduction, an inconsistency of one,
|
|
19
|
+
* as WickedEngine's surfels seed it.
|
|
20
|
+
* - **Clip**: a sample past `0.1 + short_mean + 8·deviation` a channel is held there, a firefly. The 0.1 is
|
|
21
|
+
* the reference's, in the radiance's own units. A caller whose variance does not yet rest on a window of
|
|
22
|
+
* samples passes `clip` false: there is no spread to clip to.
|
|
23
|
+
* - **Short mean**: blended by `short_blend`; the variance by `variance_blend`, the reference's half of it, so
|
|
24
|
+
* that its window outlasts the short mean's.
|
|
25
|
+
* - **Long mean**: blended by the catch-up, `smoothstep(relative · max(0.02, inconsistency − 0.2))` held to
|
|
26
|
+
* [1/256, 1], times the blend reduction, and at least `mean_blend_min`. `relative` is the luminance of the
|
|
27
|
+
* means' gap over the deviation; the inconsistency its smoothed history; the reduction the luminance of half
|
|
28
|
+
* the short mean over the deviation, held to [1/32, 1], a noisy stream's longer window. The inconsistency
|
|
29
|
+
* follows by `short_blend`, where the reference's 0.08 a sample stands at its default short blend of 0.08.
|
|
30
|
+
* - **The reduction follows by the reference's 0.1 a sample**, whatever the short blend. The catch-up takes the
|
|
31
|
+
* last sample's reduction, so following by a large short blend (rare samples) it would track each one: the
|
|
32
|
+
* long mean's weight would rise after the bright samples it is about to fall back from, and it settles low.
|
|
33
|
+
* Measured through the probe accumulate pass (2026-10-29, the emulator, samples of mean 1 and deviation 1,
|
|
34
|
+
* four streams averaged): 7, 18, 28 and 39% low at short blends of 0.55, 0.63, 0.78 and 0.9 that way; 2, 3,
|
|
35
|
+
* 7 and 15% at 0.1 a sample, with the same step response.
|
|
36
|
+
*
|
|
37
|
+
* Measured on a CPU model (2026-10-29, 200 runs averaged), against an exponential mean of the short blend, over
|
|
38
|
+
* samples that are 0 or twice the mean, a ray of two lit: at a short blend of 1/4 the long mean wanders 0.19 of
|
|
39
|
+
* the mean against 0.38, and reaches 90% of a tripling in 14 samples against 9; at 1/8, 0.077 against 0.25, in
|
|
40
|
+
* 88 against 18. An exponential mean as steady takes 35 and 197. Over a noiseless stream it takes a step about
|
|
41
|
+
* twice as slowly as the short blend, the clip holding the first samples past the step.
|
|
42
|
+
*
|
|
43
|
+
* @type {CodeChunk}
|
|
44
|
+
*/
|
|
45
|
+
export const chunk_multiscale_mean = CodeChunk.from(
|
|
46
|
+
//language=WGSL
|
|
47
|
+
`
|
|
48
|
+
fn multiscale_mean_seed(sample: vec3f) -> ${MULTISCALE_MEAN_STRUCT.wgsl_ref} {
|
|
49
|
+
return ${MULTISCALE_MEAN_STRUCT.make({
|
|
50
|
+
mean: 'sample',
|
|
51
|
+
short_mean: 'sample',
|
|
52
|
+
variance: 'vec3f(0.0)',
|
|
53
|
+
reduction: '0.0',
|
|
54
|
+
inconsistency: '1.0',
|
|
55
|
+
})};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
fn multiscale_mean_add(e: ${MULTISCALE_MEAN_STRUCT.wgsl_ref}, sample: vec3f, short_blend: f32, variance_blend: f32, mean_blend_min: f32, clip: bool) -> ${MULTISCALE_MEAN_STRUCT.wgsl_ref} {
|
|
59
|
+
var y = sample;
|
|
60
|
+
|
|
61
|
+
if (clip) {
|
|
62
|
+
y = min(y, 0.1 + e.short_mean + 8.0 * sqrt(max(vec3f(1e-5), e.variance)));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
let delta = y - e.short_mean;
|
|
66
|
+
let short_mean = mix(e.short_mean, y, short_blend);
|
|
67
|
+
let variance = mix(e.variance, delta * (y - short_mean), variance_blend);
|
|
68
|
+
let deviation = sqrt(max(vec3f(1e-5), variance));
|
|
69
|
+
|
|
70
|
+
let relative = rgb_to_luminance(abs(e.mean - short_mean) / deviation);
|
|
71
|
+
let inconsistency = mix(e.inconsistency, relative, short_blend);
|
|
72
|
+
let reduction = clamp(rgb_to_luminance(0.5 * short_mean / deviation), 1.0 / 32.0, 1.0);
|
|
73
|
+
|
|
74
|
+
let catch_up = clamp(smoothstep(0.0, 1.0, relative * max(0.02, inconsistency - 0.2)), 1.0 / 256.0, 1.0) * e.reduction;
|
|
75
|
+
|
|
76
|
+
return ${MULTISCALE_MEAN_STRUCT.make({
|
|
77
|
+
mean: 'mix(e.mean, y, max(saturate(catch_up), mean_blend_min))',
|
|
78
|
+
short_mean: 'short_mean',
|
|
79
|
+
variance: 'variance',
|
|
80
|
+
reduction: 'mix(e.reduction, reduction, 0.1)',
|
|
81
|
+
inconsistency: 'inconsistency',
|
|
82
|
+
})};
|
|
83
|
+
}
|
|
84
|
+
`, [
|
|
85
|
+
chunk_rgb_to_luminance,
|
|
86
|
+
MULTISCALE_MEAN_STRUCT.declaration_chunk,
|
|
87
|
+
]);
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
We are sampling an R2 sequence - see http://extremelearning.com.au/unreasonable-effectiveness-of-quasirandom-sequences/
|
|
3
|
+
@see https://github.com/GameTechDev/XeGTAO/blob/a5b1686c7ea37788eeb3576b5be47f7c03db532c/Source/Rendering/Shaders/vaGTAO.hlsl#L74C71-L74C112
|
|
4
|
+
* @type {CodeChunk}
|
|
5
|
+
*/
|
|
6
|
+
export const chunk_r2_canonical: CodeChunk;
|
|
7
|
+
import { CodeChunk } from "../../../compiler/CodeChunk.js";
|
|
2
8
|
//# sourceMappingURL=chunk_r2_canonical.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_r2_canonical.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/shader/chunk/noise/r/chunk_r2_canonical.js"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"chunk_r2_canonical.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/shader/chunk/noise/r/chunk_r2_canonical.js"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,iCAFU,SAAS,CASjB;0BAdwB,gCAAgC"}
|
|
@@ -5,7 +5,7 @@ import { CodeChunk } from "../../../compiler/CodeChunk.js";
|
|
|
5
5
|
@see https://github.com/GameTechDev/XeGTAO/blob/a5b1686c7ea37788eeb3576b5be47f7c03db532c/Source/Rendering/Shaders/vaGTAO.hlsl#L74C71-L74C112
|
|
6
6
|
* @type {CodeChunk}
|
|
7
7
|
*/
|
|
8
|
-
const chunk_r2_canonical = CodeChunk.from(
|
|
8
|
+
export const chunk_r2_canonical = CodeChunk.from(
|
|
9
9
|
//language=WGSL
|
|
10
10
|
`
|
|
11
11
|
fn r2_canonical(index:u32) -> vec2<f32> {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claim a run of a workgroup list's places for each lane, one atomic per subgroup: the subgroup sums
|
|
3
|
+
* the lanes' `count`s, its first active lane adds the sum to `counter` with one `atomicAdd`, and each
|
|
4
|
+
* lane takes its run at its exclusive prefix over the subgroup.
|
|
5
|
+
*
|
|
6
|
+
* `fn subgroup_reserve_workgroup(counter: ptr<workgroup, atomic<u32>>, count: u32) -> u32`
|
|
7
|
+
*
|
|
8
|
+
* Returns the first place of the lane's run, `count` long; a lane that asks for none gets where its
|
|
9
|
+
* run would have been. Nothing is bounded here: the counter rises past whatever the list holds, and
|
|
10
|
+
* the caller decides what a place past its capacity means.
|
|
11
|
+
*
|
|
12
|
+
* Every lane of the subgroup calls it, asking or not, from subgroup-uniform control flow. Runs of
|
|
13
|
+
* different subgroups land in whatever order their atomics do. Nothing here assumes how subgroups map
|
|
14
|
+
* onto `local_invocation_index`.
|
|
15
|
+
*
|
|
16
|
+
* @see chunk_subgroup_append_slot for a list in storage, a place a lane
|
|
17
|
+
* @type {CodeChunk}
|
|
18
|
+
*/
|
|
19
|
+
export const chunk_subgroup_reserve_workgroup: CodeChunk;
|
|
20
|
+
import { CodeChunk } from "../../compiler/CodeChunk.js";
|
|
21
|
+
//# sourceMappingURL=chunk_subgroup_reserve_workgroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk_subgroup_reserve_workgroup.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/shader/chunk/subgroup/chunk_subgroup_reserve_workgroup.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;GAiBG;AACH,+CAFU,SAAS,CAoBhB;0BAtCuB,6BAA6B"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { WebGPUExtensionType } from "../../../../descriptor/WebGPUExtensionType.js";
|
|
2
|
+
import { CodeChunk } from "../../compiler/CodeChunk.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Claim a run of a workgroup list's places for each lane, one atomic per subgroup: the subgroup sums
|
|
6
|
+
* the lanes' `count`s, its first active lane adds the sum to `counter` with one `atomicAdd`, and each
|
|
7
|
+
* lane takes its run at its exclusive prefix over the subgroup.
|
|
8
|
+
*
|
|
9
|
+
* `fn subgroup_reserve_workgroup(counter: ptr<workgroup, atomic<u32>>, count: u32) -> u32`
|
|
10
|
+
*
|
|
11
|
+
* Returns the first place of the lane's run, `count` long; a lane that asks for none gets where its
|
|
12
|
+
* run would have been. Nothing is bounded here: the counter rises past whatever the list holds, and
|
|
13
|
+
* the caller decides what a place past its capacity means.
|
|
14
|
+
*
|
|
15
|
+
* Every lane of the subgroup calls it, asking or not, from subgroup-uniform control flow. Runs of
|
|
16
|
+
* different subgroups land in whatever order their atomics do. Nothing here assumes how subgroups map
|
|
17
|
+
* onto `local_invocation_index`.
|
|
18
|
+
*
|
|
19
|
+
* @see chunk_subgroup_append_slot for a list in storage, a place a lane
|
|
20
|
+
* @type {CodeChunk}
|
|
21
|
+
*/
|
|
22
|
+
export const chunk_subgroup_reserve_workgroup = CodeChunk.from(
|
|
23
|
+
//language=WGSL
|
|
24
|
+
`
|
|
25
|
+
fn subgroup_reserve_workgroup(counter: ptr<workgroup, atomic<u32>>, count: u32) -> u32 {
|
|
26
|
+
let offset = subgroupExclusiveAdd(count);
|
|
27
|
+
let total = subgroupAdd(count);
|
|
28
|
+
|
|
29
|
+
// elected before the branch, which then holds no subgroup operation and may be non-uniform
|
|
30
|
+
let elected = subgroupElect();
|
|
31
|
+
|
|
32
|
+
var base = 0u;
|
|
33
|
+
|
|
34
|
+
if (elected && total > 0u) {
|
|
35
|
+
base = atomicAdd(counter, total);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return subgroupBroadcastFirst(base) + offset;
|
|
39
|
+
}
|
|
40
|
+
`);
|
|
41
|
+
|
|
42
|
+
chunk_subgroup_reserve_workgroup.addExtension(WebGPUExtensionType.Subgroups);
|
|
@@ -42,7 +42,7 @@ export class GPUSceneWind {
|
|
|
42
42
|
* @param {number} capacity
|
|
43
43
|
* @returns {GPUTileAtlas3D}
|
|
44
44
|
*/
|
|
45
|
-
static "__#
|
|
45
|
+
static "__#169@#make_atlas"(device: GPUDevice, content: ArrayLike<number>, capacity: number): GPUTileAtlas3D;
|
|
46
46
|
/**
|
|
47
47
|
* @param {GPUDevice} device
|
|
48
48
|
*/
|
|
@@ -126,6 +126,25 @@ export class CPUBitmapData {
|
|
|
126
126
|
* @type {boolean}
|
|
127
127
|
*/
|
|
128
128
|
is_depth: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* The texture's mip levels past its first, finest first: level `k` is `levels[k - 1]`, and this
|
|
131
|
+
* bitmap is level 0. Each level's extent is its own bitmap's, so a caller says which axes halve —
|
|
132
|
+
* an array texture's layers do not, a volume's depth does.
|
|
133
|
+
*
|
|
134
|
+
* Empty by default: a texture whose mipmaps are not modelled, every level a shader names reading
|
|
135
|
+
* this bitmap, as the emulator always did. One that carries levels serves each from its own, and a
|
|
136
|
+
* level past them reads zero, as robust access may on a device.
|
|
137
|
+
*
|
|
138
|
+
* @type {CPUBitmapData[]}
|
|
139
|
+
*/
|
|
140
|
+
levels: CPUBitmapData[];
|
|
141
|
+
/**
|
|
142
|
+
* The bitmap holding mip `level`; see {@link levels}.
|
|
143
|
+
*
|
|
144
|
+
* @param {number} level
|
|
145
|
+
* @returns {CPUBitmapData|undefined} undefined for a level past those carried
|
|
146
|
+
*/
|
|
147
|
+
level(level: number): CPUBitmapData | undefined;
|
|
129
148
|
/** @returns {number} */
|
|
130
149
|
get width(): number;
|
|
131
150
|
/** @returns {number} */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CPUBitmapData.d.ts","sourceRoot":"","sources":["../../../../../src/shade/wgsl/emulator/CPUBitmapData.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH;
|
|
1
|
+
{"version":3,"file":"CPUBitmapData.d.ts","sourceRoot":"","sources":["../../../../../src/shade/wgsl/emulator/CPUBitmapData.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH;IA2KI;;;;;OAKG;IACH,wBALW,MAAM,SACN,MAAM,WACN,MAAM,UACN,MAAM,iBAIhB;IAED;;;;;OAKG;IACH,yBALW,MAAM,SACN,MAAM,WACN,MAAM,UACN,MAAM,iBAIhB;IAED;;;;;OAKG;IACH,yBALW,MAAM,SACN,MAAM,WACN,MAAM,UACN,MAAM,iBAIhB;IAED;;;;;OAKG;IACH,uBALW,MAAM,SACN,MAAM,WACN,MAAM,UACN,MAAM,iBAIhB;IAED;;;;;OAKG;IACH,wBALW,MAAM,SACN,MAAM,WACN,MAAM,UACN,MAAM,iBAIhB;IAED;;;;;OAKG;IACH,wBALW,MAAM,SACN,MAAM,WACN,MAAM,UACN,MAAM,iBAIhB;IAED;;;;;OAKG;IACH,0BALW,MAAM,SACN,MAAM,WACN,MAAM,UACN,MAAM,iBAIhB;IAED;;;;;OAKG;IACH,0BALW,MAAM,SACN,MAAM,WACN,MAAM,UACN,MAAM,iBAIhB;IAED;;;;;;;;OAQG;IACH,sBALW,MAAM,WACN,MAAM,UACN,MAAM,GACJ,aAAa,CAQzB;IA3MD;;;;;;OAMG;IACH,kBANW,UAAU,MAAM,CAAC,aACjB,MAAM,SACN,MAAM,WACN,MAAM,UACN,MAAM,EAmBhB;IAtFD;;;OAGG;IACH,MAFU,YAAY,kBAAkB,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,WAAW,GAAG,WAAW,GAAG,MAAM,EAAE,CAE1H;IAEL;;;OAGG;IACH,WAFU,MAAM,CAEN;IAEV;;;;OAIG;IACH,MAFU,WAAW,CAEhB;IAEL;;;;;;;;;;;;;OAaG;IACH,UAFU,OAAO,CAEA;IAEjB;;;;;;;;;;OAUG;IACH,QAFU,aAAa,EAAE,CAEb;IAEZ;;;;;OAKG;IACH,aAHW,MAAM,GACJ,aAAa,GAAC,SAAS,CAQnC;IA4BD,wBAAwB;IACxB,oBAAoC;IACpC,wBAAwB;IACxB,qBAAqC;IACrC,wBAAwB;IACxB,oBAAoC;IAEpC;;;;;;;;;OASG;IACH,gCAIC;IAED;;;;;;;OAOG;IACH,gBALW,MAAM,KACN,MAAM,KACN,MAAM,GACJ,MAAM,CAMlB;IAED;;;;;;;;;OASG;IACH,QANW,MAAM,KACN,MAAM,KACN,MAAM,OACN,UAAU,MAAM,CAAC,GAAG;QAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,eAC3C,MAAM,QAWhB;IAED;;;;;;;;;OASG;IACH,SANW,MAAM,KACN,MAAM,KACN,MAAM,OACN,UAAU,MAAM,CAAC,eACjB,MAAM,QAQhB;CAwGJ"}
|
|
@@ -58,6 +58,33 @@ export class CPUBitmapData {
|
|
|
58
58
|
*/
|
|
59
59
|
is_depth = false;
|
|
60
60
|
|
|
61
|
+
/**
|
|
62
|
+
* The texture's mip levels past its first, finest first: level `k` is `levels[k - 1]`, and this
|
|
63
|
+
* bitmap is level 0. Each level's extent is its own bitmap's, so a caller says which axes halve —
|
|
64
|
+
* an array texture's layers do not, a volume's depth does.
|
|
65
|
+
*
|
|
66
|
+
* Empty by default: a texture whose mipmaps are not modelled, every level a shader names reading
|
|
67
|
+
* this bitmap, as the emulator always did. One that carries levels serves each from its own, and a
|
|
68
|
+
* level past them reads zero, as robust access may on a device.
|
|
69
|
+
*
|
|
70
|
+
* @type {CPUBitmapData[]}
|
|
71
|
+
*/
|
|
72
|
+
levels = [];
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* The bitmap holding mip `level`; see {@link levels}.
|
|
76
|
+
*
|
|
77
|
+
* @param {number} level
|
|
78
|
+
* @returns {CPUBitmapData|undefined} undefined for a level past those carried
|
|
79
|
+
*/
|
|
80
|
+
level(level) {
|
|
81
|
+
if (level === 0 || this.levels.length === 0) {
|
|
82
|
+
return this;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return this.levels[level - 1];
|
|
86
|
+
}
|
|
87
|
+
|
|
61
88
|
/**
|
|
62
89
|
* @param {ArrayLike<number>} data
|
|
63
90
|
* @param {number} item_size
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WGSLLanguageCore.d.ts","sourceRoot":"","sources":["../../../../../src/shade/wgsl/emulator/WGSLLanguageCore.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"WGSLLanguageCore.d.ts","sourceRoot":"","sources":["../../../../../src/shade/wgsl/emulator/WGSLLanguageCore.js"],"names":[],"mappings":";IAu1DA;;;;;;;;;;;;;OAaG;IACH,+DAyFC"}
|
|
@@ -26,6 +26,18 @@ const FALLBACK_LINEAR_CLAMP_SAMPLER = Object.freeze({
|
|
|
26
26
|
* @param {import("./CPUBitmapData.js").CPUBitmapData} texture
|
|
27
27
|
* @returns {number[]}
|
|
28
28
|
*/
|
|
29
|
+
/**
|
|
30
|
+
* The bitmap holding mip `level` of texture `t` — `t` itself at level 0, so whatever a spec binds in
|
|
31
|
+
* place of a {@link CPUBitmapData} still serves its one level; see `CPUBitmapData.levels`.
|
|
32
|
+
*
|
|
33
|
+
* @param {import("./CPUBitmapData.js").CPUBitmapData} t
|
|
34
|
+
* @param {number} level
|
|
35
|
+
* @returns {import("./CPUBitmapData.js").CPUBitmapData|undefined} undefined past the levels `t` carries
|
|
36
|
+
*/
|
|
37
|
+
function texture_level(t, level) {
|
|
38
|
+
return level === 0 ? t : t.level(level);
|
|
39
|
+
}
|
|
40
|
+
|
|
29
41
|
/**
|
|
30
42
|
* How many axes a texel coordinate addresses: a scalar for a 1D texture, a vector of the texture's
|
|
31
43
|
* dimension otherwise. WGSL makes a coordinate match the texture's declaration, so this is the
|
|
@@ -1182,8 +1194,9 @@ export const WGSLLanguageCore = {
|
|
|
1182
1194
|
// load and store builtins count the axes of their coordinate, and `textureDimensions` is
|
|
1183
1195
|
// compiled to the variant its declaration selects. Sampling routes through
|
|
1184
1196
|
// `cpu_texture_sample`, which honours the bound `SamplerDescriptor`'s
|
|
1185
|
-
// address modes and filter.
|
|
1186
|
-
//
|
|
1197
|
+
// address modes and filter. Sampling reads LOD 0 only - see cpu_texture_sample
|
|
1198
|
+
// header for details. `textureLoad` and `textureDimensions` read the level they
|
|
1199
|
+
// name of a bitmap that carries its levels (`CPUBitmapData.levels`).
|
|
1187
1200
|
// ---------------------------------------------------------------------
|
|
1188
1201
|
|
|
1189
1202
|
/**
|
|
@@ -1199,9 +1212,13 @@ export const WGSLLanguageCore = {
|
|
|
1199
1212
|
* as such. Handing that code a vec4 would turn every use into a component-wise broadcast that
|
|
1200
1213
|
* neither throws nor matches the device.
|
|
1201
1214
|
*
|
|
1215
|
+
* The level named reads that level of a bitmap carrying its levels, and zero past them; a bitmap
|
|
1216
|
+
* carrying none serves every level from itself (`CPUBitmapData.levels`).
|
|
1217
|
+
*
|
|
1202
1218
|
* @param {import("./CPUBitmapData.js").CPUBitmapData} t
|
|
1203
1219
|
* @param {Int32Array | Uint32Array | number[] | number} coords
|
|
1204
|
-
* @param {number} [
|
|
1220
|
+
* @param {number} [_level_or_index] - the level, or the array index in the four-argument form
|
|
1221
|
+
* @param {number} [_array_level] - the level in the four-argument form
|
|
1205
1222
|
* @returns {Float32Array | number}
|
|
1206
1223
|
*/
|
|
1207
1224
|
textureLoad(t, coords, _level_or_index = 0, _array_level = undefined) {
|
|
@@ -1218,20 +1235,22 @@ export const WGSLLanguageCore = {
|
|
|
1218
1235
|
CPUBitmapData, exactly like a 3D texture; only the call shape tells them apart.
|
|
1219
1236
|
*/
|
|
1220
1237
|
const z = (_array_level !== undefined ? _level_or_index : (dim >= 3 ? coords[2] : 0)) | 0;
|
|
1238
|
+
const level = texture_level(t, (_array_level !== undefined ? _array_level : _level_or_index) | 0);
|
|
1221
1239
|
const item_size = t.item_size;
|
|
1222
|
-
const out_of_bounds =
|
|
1240
|
+
const out_of_bounds = level === undefined
|
|
1241
|
+
|| x < 0 || x >= level.size[0] || y < 0 || y >= level.size[1] || z < 0 || z >= level.size[2];
|
|
1223
1242
|
|
|
1224
1243
|
if (t.is_depth === true) {
|
|
1225
|
-
return out_of_bounds ? 0.0 :
|
|
1244
|
+
return out_of_bounds ? 0.0 : level.data[level.pixel_offset(x, y, z)];
|
|
1226
1245
|
}
|
|
1227
1246
|
|
|
1228
1247
|
if (item_size < 4) out[3] = 1.0;
|
|
1229
1248
|
if (out_of_bounds) {
|
|
1230
1249
|
return out;
|
|
1231
1250
|
}
|
|
1232
|
-
const base =
|
|
1251
|
+
const base = level.pixel_offset(x, y, z);
|
|
1233
1252
|
const n = Math.min(item_size, 4);
|
|
1234
|
-
for (let i = 0; i < n; i++) out[i] =
|
|
1253
|
+
for (let i = 0; i < n; i++) out[i] = level.data[base + i];
|
|
1235
1254
|
return out;
|
|
1236
1255
|
},
|
|
1237
1256
|
|
|
@@ -1584,8 +1603,8 @@ export const WGSLLanguageCore = {
|
|
|
1584
1603
|
t.write(x, y, z, value_or_index);
|
|
1585
1604
|
},
|
|
1586
1605
|
|
|
1587
|
-
//
|
|
1588
|
-
textureNumLevels(
|
|
1606
|
+
// the levels the bitmap carries, itself the first (`CPUBitmapData.levels`)
|
|
1607
|
+
textureNumLevels(t) { return 1 + t.levels.length; },
|
|
1589
1608
|
|
|
1590
1609
|
/*
|
|
1591
1610
|
`textureDimensions(t, level)` comes in three variants, one per number of components it returns,
|
|
@@ -1597,35 +1616,37 @@ export const WGSLLanguageCore = {
|
|
|
1597
1616
|
/**
|
|
1598
1617
|
* `textureDimensions` of a `texture_1d` or `texture_storage_1d`.
|
|
1599
1618
|
* @param {import("./CPUBitmapData.js").CPUBitmapData} t
|
|
1600
|
-
* @param {number} [
|
|
1619
|
+
* @param {number} [level] - of a bitmap carrying its levels; see `CPUBitmapData.levels`
|
|
1601
1620
|
* @returns {number}
|
|
1602
1621
|
*/
|
|
1603
|
-
textureDimensions_1d(t,
|
|
1622
|
+
textureDimensions_1d(t, level = 0) {
|
|
1604
1623
|
assert.defined(t, 'texture');
|
|
1605
|
-
return t.size[0];
|
|
1624
|
+
return texture_level(t, level).size[0];
|
|
1606
1625
|
},
|
|
1607
1626
|
|
|
1608
1627
|
/**
|
|
1609
1628
|
* `textureDimensions` of a 2D, array, cube or multisampled texture. An array texture's layers
|
|
1610
1629
|
* are not part of it.
|
|
1611
1630
|
* @param {import("./CPUBitmapData.js").CPUBitmapData} t
|
|
1612
|
-
* @param {number} [
|
|
1631
|
+
* @param {number} [level] - of a bitmap carrying its levels; see `CPUBitmapData.levels`
|
|
1613
1632
|
* @returns {Uint32Array}
|
|
1614
1633
|
*/
|
|
1615
|
-
textureDimensions_2d(t,
|
|
1634
|
+
textureDimensions_2d(t, level = 0) {
|
|
1616
1635
|
assert.defined(t, 'texture');
|
|
1617
|
-
|
|
1636
|
+
const size = texture_level(t, level).size;
|
|
1637
|
+
return new Uint32Array([size[0], size[1]]);
|
|
1618
1638
|
},
|
|
1619
1639
|
|
|
1620
1640
|
/**
|
|
1621
1641
|
* `textureDimensions` of a `texture_3d` or `texture_storage_3d`.
|
|
1622
1642
|
* @param {import("./CPUBitmapData.js").CPUBitmapData} t
|
|
1623
|
-
* @param {number} [
|
|
1643
|
+
* @param {number} [level] - of a bitmap carrying its levels; see `CPUBitmapData.levels`
|
|
1624
1644
|
* @returns {Uint32Array}
|
|
1625
1645
|
*/
|
|
1626
|
-
textureDimensions_3d(t,
|
|
1646
|
+
textureDimensions_3d(t, level = 0) {
|
|
1627
1647
|
assert.defined(t, 'texture');
|
|
1628
|
-
|
|
1648
|
+
const size = texture_level(t, level).size;
|
|
1649
|
+
return new Uint32Array([size[0], size[1], size[2]]);
|
|
1629
1650
|
},
|
|
1630
1651
|
|
|
1631
1652
|
// ---------------------------------------------------------------------
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A value that trails another one down: the "ghost" behind a bar's fill that shows how much was just lost.
|
|
3
|
+
*
|
|
4
|
+
* When the target drops, the trail holds where it was for {@link delay_ms}, then eases down to the target over
|
|
5
|
+
* {@link duration_ms}. A further drop while it holds or eases restarts the hold from wherever the trail is. When
|
|
6
|
+
* the target rises above the trail, the trail jumps to it at once.
|
|
7
|
+
*
|
|
8
|
+
* Time is passed in, in milliseconds on any monotonic clock, so the trail can be driven and checked without one.
|
|
9
|
+
*/
|
|
10
|
+
export class GhostTrail {
|
|
11
|
+
/**
|
|
12
|
+
* How long the trail holds after a drop before it starts to move
|
|
13
|
+
* @type {number}
|
|
14
|
+
*/
|
|
15
|
+
delay_ms: number;
|
|
16
|
+
/**
|
|
17
|
+
* How long the ease from the held value down to the target takes; 0 snaps once the hold ends
|
|
18
|
+
* @type {number}
|
|
19
|
+
*/
|
|
20
|
+
duration_ms: number;
|
|
21
|
+
/**
|
|
22
|
+
* @type {number}
|
|
23
|
+
* @private
|
|
24
|
+
*/
|
|
25
|
+
private __from;
|
|
26
|
+
/**
|
|
27
|
+
* @type {number}
|
|
28
|
+
* @private
|
|
29
|
+
*/
|
|
30
|
+
private __to;
|
|
31
|
+
/**
|
|
32
|
+
* When the current hold began
|
|
33
|
+
* @type {number}
|
|
34
|
+
* @private
|
|
35
|
+
*/
|
|
36
|
+
private __drop_time;
|
|
37
|
+
/**
|
|
38
|
+
* Tell the trail its target's new value.
|
|
39
|
+
* @param {number} target
|
|
40
|
+
* @param {number} time_ms
|
|
41
|
+
*/
|
|
42
|
+
set(target: number, time_ms: number): void;
|
|
43
|
+
/**
|
|
44
|
+
* Where the trail is at a given time; never below its target.
|
|
45
|
+
* @param {number} time_ms
|
|
46
|
+
* @returns {number}
|
|
47
|
+
*/
|
|
48
|
+
sample(time_ms: number): number;
|
|
49
|
+
/**
|
|
50
|
+
* Whether the trail has reached its target and will not move until {@link set} is called again
|
|
51
|
+
* @param {number} time_ms
|
|
52
|
+
* @returns {boolean}
|
|
53
|
+
*/
|
|
54
|
+
is_settled(time_ms: number): boolean;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=GhostTrail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GhostTrail.d.ts","sourceRoot":"","sources":["../../../../../../src/view/elements/progress/segmented/GhostTrail.js"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH;IACI;;;OAGG;IACH,UAFU,MAAM,CAED;IAEf;;;OAGG;IACH,aAFU,MAAM,CAEE;IAElB;;;OAGG;IACH,eAAW;IAEX;;;OAGG;IACH,aAAS;IAET;;;;OAIG;IACH,oBAAgB;IAEhB;;;;OAIG;IACH,YAHW,MAAM,WACN,MAAM,QAahB;IAED;;;;OAIG;IACH,gBAHW,MAAM,GACJ,MAAM,CAuBlB;IAED;;;;OAIG;IACH,oBAHW,MAAM,GACJ,OAAO,CAInB;CACJ"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { smoothStep } from "../../../../core/math/smoothStep.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A value that trails another one down: the "ghost" behind a bar's fill that shows how much was just lost.
|
|
5
|
+
*
|
|
6
|
+
* When the target drops, the trail holds where it was for {@link delay_ms}, then eases down to the target over
|
|
7
|
+
* {@link duration_ms}. A further drop while it holds or eases restarts the hold from wherever the trail is. When
|
|
8
|
+
* the target rises above the trail, the trail jumps to it at once.
|
|
9
|
+
*
|
|
10
|
+
* Time is passed in, in milliseconds on any monotonic clock, so the trail can be driven and checked without one.
|
|
11
|
+
*/
|
|
12
|
+
export class GhostTrail {
|
|
13
|
+
/**
|
|
14
|
+
* How long the trail holds after a drop before it starts to move
|
|
15
|
+
* @type {number}
|
|
16
|
+
*/
|
|
17
|
+
delay_ms = 450;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* How long the ease from the held value down to the target takes; 0 snaps once the hold ends
|
|
21
|
+
* @type {number}
|
|
22
|
+
*/
|
|
23
|
+
duration_ms = 350;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @type {number}
|
|
27
|
+
* @private
|
|
28
|
+
*/
|
|
29
|
+
__from = 0;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @type {number}
|
|
33
|
+
* @private
|
|
34
|
+
*/
|
|
35
|
+
__to = 0;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* When the current hold began
|
|
39
|
+
* @type {number}
|
|
40
|
+
* @private
|
|
41
|
+
*/
|
|
42
|
+
__drop_time = 0;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Tell the trail its target's new value.
|
|
46
|
+
* @param {number} target
|
|
47
|
+
* @param {number} time_ms
|
|
48
|
+
*/
|
|
49
|
+
set(target, time_ms) {
|
|
50
|
+
const current = this.sample(time_ms);
|
|
51
|
+
|
|
52
|
+
if (target >= current) {
|
|
53
|
+
this.__from = target;
|
|
54
|
+
this.__to = target;
|
|
55
|
+
} else {
|
|
56
|
+
this.__from = current;
|
|
57
|
+
this.__to = target;
|
|
58
|
+
this.__drop_time = time_ms;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Where the trail is at a given time; never below its target.
|
|
64
|
+
* @param {number} time_ms
|
|
65
|
+
* @returns {number}
|
|
66
|
+
*/
|
|
67
|
+
sample(time_ms) {
|
|
68
|
+
const from = this.__from;
|
|
69
|
+
const to = this.__to;
|
|
70
|
+
|
|
71
|
+
if (from === to) {
|
|
72
|
+
return to;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const start = this.__drop_time + this.delay_ms;
|
|
76
|
+
|
|
77
|
+
if (time_ms < start) {
|
|
78
|
+
return from;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const end = start + this.duration_ms;
|
|
82
|
+
|
|
83
|
+
if (time_ms >= end) {
|
|
84
|
+
return to;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return from + (to - from) * smoothStep(start, end, time_ms);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Whether the trail has reached its target and will not move until {@link set} is called again
|
|
92
|
+
* @param {number} time_ms
|
|
93
|
+
* @returns {boolean}
|
|
94
|
+
*/
|
|
95
|
+
is_settled(time_ms) {
|
|
96
|
+
return this.__from === this.__to || time_ms >= this.__drop_time + this.delay_ms + this.duration_ms;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* @deprecated {@link SegmentedResourceBarView} no longer reads this: its canvas notches gave way to DOM notches
|
|
3
|
+
* styled by `segmented-resource-bar.css`, and this ladder's tiers changed meaning with the bar's max. Pass
|
|
4
|
+
* {@link SegmentTier}s as `tiers`, or rely on {@link SEGMENT_TIERS_DEFAULT}.
|
|
3
5
|
* @type {SegmentDefinition[]}
|
|
4
6
|
*/
|
|
5
7
|
export const RESOURCE_BAR_SEGMENTS: SegmentDefinition[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RESOURCE_BAR_SEGMENTS.d.ts","sourceRoot":"","sources":["../../../../../../src/view/elements/progress/segmented/RESOURCE_BAR_SEGMENTS.js"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"RESOURCE_BAR_SEGMENTS.d.ts","sourceRoot":"","sources":["../../../../../../src/view/elements/progress/segmented/RESOURCE_BAR_SEGMENTS.js"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,oCAFU,iBAAiB,EAAE,CAiL3B;kCAvLgC,wBAAwB"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { SegmentDefinition } from "./SegmentDefinition.js";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* @deprecated {@link SegmentedResourceBarView} no longer reads this: its canvas notches gave way to DOM notches
|
|
5
|
+
* styled by `segmented-resource-bar.css`, and this ladder's tiers changed meaning with the bar's max. Pass
|
|
6
|
+
* {@link SegmentTier}s as `tiers`, or rely on {@link SEGMENT_TIERS_DEFAULT}.
|
|
5
7
|
* @type {SegmentDefinition[]}
|
|
6
8
|
*/
|
|
7
9
|
export const RESOURCE_BAR_SEGMENTS = [
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decade ladder a {@link SegmentedResourceBarView} uses when given no tiers: a short notch every 10, a full one
|
|
3
|
+
* every 100, a wide one every 1000. Each marks the same amount on every bar; the finer ones drop out on bars
|
|
4
|
+
* where they would crowd. The class names are styled by `segmented-resource-bar.css`, and a caller's own tiers
|
|
5
|
+
* may reuse them.
|
|
6
|
+
*
|
|
7
|
+
* @type {SegmentTier[]}
|
|
8
|
+
*/
|
|
9
|
+
export const SEGMENT_TIERS_DEFAULT: SegmentTier[];
|
|
10
|
+
import { SegmentTier } from "./SegmentTier.js";
|
|
11
|
+
//# sourceMappingURL=SEGMENT_TIERS_DEFAULT.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SEGMENT_TIERS_DEFAULT.d.ts","sourceRoot":"","sources":["../../../../../../src/view/elements/progress/segmented/SEGMENT_TIERS_DEFAULT.js"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,oCAFU,WAAW,EAAE,CAMrB;4BAd0B,kBAAkB"}
|