@woosh/meep-engine 3.59.0 → 3.60.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/shade/playground/probe_clipmap/index.html +12 -0
- package/src/shade/playground/probe_clipmap/main.d.ts.map +1 -1
- package/src/shade/playground/probe_clipmap/main.js +5 -0
- package/src/shade/renderer/Renderer.d.ts.map +1 -1
- package/src/shade/renderer/Renderer.js +4 -6
- package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts +63 -1
- package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.js +228 -16
- package/src/shade/renderer/geometry/sdf/cards/GPUMeshCardSets.d.ts +27 -4
- package/src/shade/renderer/geometry/sdf/cards/GPUMeshCardSets.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/cards/GPUMeshCardSets.js +526 -23
- package/src/shade/renderer/geometry/sdf/cards/MeshCardCaptureMode.d.ts +11 -0
- package/src/shade/renderer/geometry/sdf/cards/MeshCardCaptureMode.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/cards/MeshCardCaptureMode.js +21 -0
- package/src/shade/renderer/geometry/sdf/cards/mesh_cards_raster_pass_descriptor.d.ts +65 -0
- package/src/shade/renderer/geometry/sdf/cards/mesh_cards_raster_pass_descriptor.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/cards/mesh_cards_raster_pass_descriptor.js +376 -0
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_capture.d.ts +7 -3
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_capture.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_capture.js +70 -6
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_args.d.ts +20 -0
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_args.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_args.js +80 -0
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_scatter.d.ts +18 -0
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_scatter.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_scatter.js +113 -0
- package/src/shade/renderer/geometry/virtual/sdf/VGEO_SDF.d.ts +47 -0
- package/src/shade/renderer/geometry/virtual/sdf/VGEO_SDF.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/sdf/VGEO_SDF.js +80 -0
- package/src/shade/renderer/geometry/virtual/sdf/VGeoSDFProxies.d.ts +91 -0
- package/src/shade/renderer/geometry/virtual/sdf/VGeoSDFProxies.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/sdf/VGeoSDFProxies.js +902 -0
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_collect.d.ts +16 -0
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_collect.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_collect.js +67 -0
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_decode.d.ts +17 -0
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_decode.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_decode.js +145 -0
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_traverse.d.ts +12 -0
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_traverse.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_traverse.js +105 -0
- package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_build_gbuffer.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_build_gbuffer.js +2 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts +3 -9
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.js +13 -31
- package/src/shade/renderer/global_illumination/probe_clipmap/PROBE_CLIPMAP_PROPOSAL_2026_10_27.md +764 -48
- package/src/shade/renderer/global_illumination/probe_clipmap/PROBE_RAYS_VARIABLE_AND_SORTED_SCOPE_2026_10_30.md +410 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSceneHolds.d.ts +3 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSceneHolds.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSceneHolds.js +4 -3
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts +41 -17
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.js +57 -33
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/BRICK_CLIPMAP.d.ts +11 -3
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/BRICK_CLIPMAP.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/BRICK_CLIPMAP.js +13 -4
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.d.ts +9 -18
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.js +8 -10
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap.d.ts +12 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap.js +28 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts +1 -29
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.js +1 -74
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK.d.ts +161 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK.js +219 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK_INSTANCE_STRUCT.d.ts +1 -8
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK_INSTANCE_STRUCT.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK_INSTANCE_STRUCT.js +1 -9
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MeshSDFBrickProvider.d.ts +40 -12
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MeshSDFBrickProvider.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MeshSDFBrickProvider.js +373 -31
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_instance.d.ts +2 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_instance.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_instance.js +2 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_texel.d.ts +15 -8
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_texel.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_texel.js +28 -14
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_walk.d.ts +23 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_walk.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_walk.js +66 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_batch.d.ts +29 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_batch.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_batch.js +210 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_command.d.ts +29 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_command.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_command.js +86 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_gather.d.ts +41 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_gather.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_gather.js +439 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_resolve.d.ts +23 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_resolve.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_resolve.js +135 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_free.d.ts +3 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_free.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_free.js +12 -3
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts +21 -18
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.js +254 -73
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.d.ts +149 -8
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.js +181 -13
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.d.ts +179 -7
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.js +412 -31
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.js +4 -4
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_sample_radiance.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_sample_radiance.js +4 -3
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.d.ts +36 -10
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.js +218 -29
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_admit.d.ts +5 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_admit.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_admit.js +24 -14
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_due.d.ts +15 -6
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_due.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_due.js +21 -22
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_guide.d.ts +36 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_guide.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_guide.js +257 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.d.ts +18 -7
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.js +157 -51
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_order.d.ts +23 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_order.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_order.js +110 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.d.ts +24 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.js +90 -10
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_ray_layout.d.ts +45 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_ray_layout.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_ray_layout.js +205 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_relocate.js +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_retire.d.ts +16 -3
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_retire.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_retire.js +55 -10
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_schedule.d.ts +19 -4
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_schedule.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_schedule.js +60 -6
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.d.ts +10 -9
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.js +32 -39
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.d.ts +21 -14
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.js +100 -30
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace_command.d.ts +6 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace_command.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace_command.js +26 -10
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.d.ts +3 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.js +12 -12
- package/src/shade/renderer/gpu_primitive/sort/SORT_DIGIT_SETTINGS_STRUCT.d.ts +10 -0
- package/src/shade/renderer/gpu_primitive/sort/SORT_DIGIT_SETTINGS_STRUCT.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/sort/SORT_DIGIT_SETTINGS_STRUCT.js +21 -0
- package/src/shade/renderer/gpu_primitive/sort/SORT_PASS_SETTINGS_STRUCT.d.ts +5 -2
- package/src/shade/renderer/gpu_primitive/sort/SORT_PASS_SETTINGS_STRUCT.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/sort/SORT_PASS_SETTINGS_STRUCT.js +31 -23
- package/src/shade/renderer/gpu_primitive/sort/SORT_SIZE_STRUCT.d.ts +10 -0
- package/src/shade/renderer/gpu_primitive/sort/SORT_SIZE_STRUCT.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/sort/SORT_SIZE_STRUCT.js +22 -0
- package/src/shade/renderer/gpu_primitive/sort/chunk_sort_constants.d.ts +9 -0
- package/src/shade/renderer/gpu_primitive/sort/chunk_sort_constants.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/sort/chunk_sort_constants.js +18 -0
- package/src/shade/renderer/gpu_primitive/sort/chunk_sort_digit.d.ts +8 -3
- package/src/shade/renderer/gpu_primitive/sort/chunk_sort_digit.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/sort/chunk_sort_digit.js +41 -32
- package/src/shade/renderer/gpu_primitive/sort/chunk_sort_histogram_tile.d.ts +31 -0
- package/src/shade/renderer/gpu_primitive/sort/chunk_sort_histogram_tile.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/sort/chunk_sort_histogram_tile.js +71 -0
- package/src/shade/renderer/gpu_primitive/sort/chunk_sort_scatter_tile.d.ts +47 -0
- package/src/shade/renderer/gpu_primitive/sort/chunk_sort_scatter_tile.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/sort/chunk_sort_scatter_tile.js +210 -0
- package/src/shade/renderer/gpu_primitive/sort/defs.d.ts +5 -4
- package/src/shade/renderer/gpu_primitive/sort/defs.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/sort/defs.js +5 -4
- package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.d.ts +56 -15
- package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.js +410 -61
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_histogram.d.ts +4 -1
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_histogram.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_histogram.js +16 -42
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_histogram_indirect.d.ts +15 -0
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_histogram_indirect.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_histogram_indirect.js +60 -0
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_prepare.d.ts +25 -0
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_prepare.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_prepare.js +89 -0
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_scatter.d.ts +3 -8
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_scatter.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_scatter.js +28 -160
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_scatter_indirect.d.ts +12 -0
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_scatter_indirect.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_scatter_indirect.js +74 -0
- package/src/shade/renderer/gpu_primitive/sort/verify_radix_sort.d.ts +3 -1
- package/src/shade/renderer/gpu_primitive/sort/verify_radix_sort.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/sort/verify_radix_sort.js +387 -188
- package/src/shade/renderer/lightmap/bake/shader_lightmap_viz_to_irradiance_flat.js +1 -1
- package/src/shade/renderer/lightmap/bake/shader_lightmap_viz_to_sh.js +1 -1
- package/src/shade/renderer/material/resident/GPUResidentMaterialContext.d.ts.map +1 -1
- package/src/shade/renderer/material/resident/GPUResidentMaterialContext.js +90 -72
- package/src/shade/renderer/material/resident/RESIDENT_MATERIAL_TEXTURE_LAYOUT.d.ts +5 -0
- package/src/shade/renderer/material/resident/RESIDENT_MATERIAL_TEXTURE_LAYOUT.d.ts.map +1 -1
- package/src/shade/renderer/material/resident/RESIDENT_MATERIAL_TEXTURE_LAYOUT.js +9 -0
- package/src/shade/renderer/path_tracer/shader/INDIRECT_TEXTURE_FILTER.d.ts +13 -0
- package/src/shade/renderer/path_tracer/shader/INDIRECT_TEXTURE_FILTER.d.ts.map +1 -0
- package/src/shade/renderer/path_tracer/shader/INDIRECT_TEXTURE_FILTER.js +14 -0
- package/src/shade/renderer/path_tracer/shader/IndirectTextureFilter.d.ts +10 -0
- package/src/shade/renderer/path_tracer/shader/IndirectTextureFilter.d.ts.map +1 -0
- package/src/shade/renderer/path_tracer/shader/IndirectTextureFilter.js +15 -0
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_tangent_normal.d.ts +4 -3
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_tangent_normal.d.ts.map +1 -1
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_tangent_normal.js +6 -5
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_texture.d.ts +17 -2
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_texture.d.ts.map +1 -1
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_texture.js +25 -57
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_texture_exact.d.ts +13 -0
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_texture_exact.d.ts.map +1 -0
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_texture_exact.js +70 -0
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_texture_stochastic.d.ts +10 -0
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_texture_stochastic.d.ts.map +1 -0
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_texture_stochastic.js +59 -0
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_texture_load.d.ts +12 -0
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_texture_load.d.ts.map +1 -0
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_texture_load.js +49 -0
- package/src/shade/renderer/path_tracer/shader/chunk_ray_hit_to_opacity.d.ts.map +1 -1
- package/src/shade/renderer/path_tracer/shader/chunk_ray_hit_to_opacity.js +1 -0
- package/src/shade/renderer/path_tracer/shader/chunk_render_trace_path.d.ts.map +1 -1
- package/src/shade/renderer/path_tracer/shader/chunk_render_trace_path.js +1 -0
- package/src/shade/renderer/path_tracer/shader/chunk_sample_material.d.ts.map +1 -1
- package/src/shade/renderer/path_tracer/shader/chunk_sample_material.js +2 -1
- package/src/shade/renderer/path_tracer/shader/chunk_sample_material_data.d.ts +7 -0
- package/src/shade/renderer/path_tracer/shader/chunk_sample_material_data.d.ts.map +1 -1
- package/src/shade/renderer/path_tracer/shader/chunk_sample_material_data.js +15 -6
- package/src/shade/renderer/scene/GPUSceneContext.d.ts +7 -1
- package/src/shade/renderer/scene/GPUSceneContext.d.ts.map +1 -1
- package/src/shade/renderer/scene/GPUSceneContext.js +26 -1
- package/src/shade/renderer/shader/chunk/bvh/chunk_bvh_query_aabb_cooperative.d.ts +7 -7
- package/src/shade/renderer/shader/chunk/bvh/chunk_bvh_query_aabb_cooperative.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/bvh/chunk_bvh_query_aabb_cooperative.js +262 -294
- package/src/shade/renderer/shader/chunk/filter/MULTISCALE_MEAN_STRUCT.d.ts +9 -0
- package/src/shade/renderer/shader/chunk/filter/MULTISCALE_MEAN_STRUCT.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/filter/MULTISCALE_MEAN_STRUCT.js +21 -0
- package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.d.ts +43 -0
- package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.js +87 -0
- package/src/shade/renderer/shader/chunk/noise/r/chunk_r2_canonical.d.ts +7 -1
- package/src/shade/renderer/shader/chunk/noise/r/chunk_r2_canonical.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/noise/r/chunk_r2_canonical.js +1 -1
- package/src/shade/renderer/shader/chunk/subgroup/chunk_subgroup_reserve_workgroup.d.ts +21 -0
- package/src/shade/renderer/shader/chunk/subgroup/chunk_subgroup_reserve_workgroup.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/subgroup/chunk_subgroup_reserve_workgroup.js +42 -0
- package/src/shade/renderer/wind/GPUSceneWind.d.ts +1 -1
- package/src/shade/wgsl/emulator/CPUBitmapData.d.ts +19 -0
- package/src/shade/wgsl/emulator/CPUBitmapData.d.ts.map +1 -1
- package/src/shade/wgsl/emulator/CPUBitmapData.js +27 -0
- package/src/shade/wgsl/emulator/WGSLLanguageCore.d.ts.map +1 -1
- package/src/shade/wgsl/emulator/WGSLLanguageCore.js +65 -19
- package/src/view/elements/progress/segmented/GhostTrail.d.ts +116 -0
- package/src/view/elements/progress/segmented/GhostTrail.d.ts.map +1 -0
- package/src/view/elements/progress/segmented/GhostTrail.js +280 -0
- package/src/view/elements/progress/segmented/RESOURCE_BAR_SEGMENTS.d.ts +3 -1
- package/src/view/elements/progress/segmented/RESOURCE_BAR_SEGMENTS.d.ts.map +1 -1
- package/src/view/elements/progress/segmented/RESOURCE_BAR_SEGMENTS.js +3 -1
- package/src/view/elements/progress/segmented/SEGMENT_TIERS_DEFAULT.d.ts +11 -0
- package/src/view/elements/progress/segmented/SEGMENT_TIERS_DEFAULT.d.ts.map +1 -0
- package/src/view/elements/progress/segmented/SEGMENT_TIERS_DEFAULT.js +15 -0
- package/src/view/elements/progress/segmented/SegmentDefinition.d.ts +3 -0
- package/src/view/elements/progress/segmented/SegmentDefinition.d.ts.map +1 -1
- package/src/view/elements/progress/segmented/SegmentDefinition.js +3 -0
- package/src/view/elements/progress/segmented/SegmentTier.d.ts +38 -0
- package/src/view/elements/progress/segmented/SegmentTier.d.ts.map +1 -0
- package/src/view/elements/progress/segmented/SegmentTier.js +50 -0
- package/src/view/elements/progress/segmented/SegmentedResourceBarView.d.ts +163 -10
- package/src/view/elements/progress/segmented/SegmentedResourceBarView.d.ts.map +1 -1
- package/src/view/elements/progress/segmented/SegmentedResourceBarView.js +442 -101
- package/src/view/elements/progress/segmented/playground/index.html +78 -0
- package/src/view/elements/progress/segmented/playground/main.d.ts +2 -0
- package/src/view/elements/progress/segmented/playground/main.d.ts.map +1 -0
- package/src/view/elements/progress/segmented/playground/main.js +173 -0
- package/src/view/elements/progress/segmented/segment_cell_layout.d.ts +48 -0
- package/src/view/elements/progress/segmented/segment_cell_layout.d.ts.map +1 -0
- package/src/view/elements/progress/segmented/segment_cell_layout.js +75 -0
- package/src/view/elements/progress/segmented/segment_notch_place.d.ts +18 -0
- package/src/view/elements/progress/segmented/segment_notch_place.d.ts.map +1 -0
- package/src/view/elements/progress/segmented/segment_notch_place.js +28 -0
- package/src/view/elements/progress/segmented/segment_tick_positions.d.ts +32 -0
- package/src/view/elements/progress/segmented/segment_tick_positions.d.ts.map +1 -0
- package/src/view/elements/progress/segmented/segment_tick_positions.js +103 -0
- package/src/view/elements/progress/segmented/segmented-resource-bar.css +142 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_provider.d.ts +0 -35
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_provider.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_provider.js +0 -238
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/VGEO_BRICK.d.ts +0 -99
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/VGEO_BRICK.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/VGEO_BRICK.js +0 -139
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/VGeoBrickProvider.d.ts +0 -65
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/VGeoBrickProvider.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/VGeoBrickProvider.js +0 -393
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_box.d.ts +0 -17
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_box.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_box.js +0 -36
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_pair.d.ts +0 -29
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_pair.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_pair.js +0 -108
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_texel.d.ts +0 -31
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_texel.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_texel.js +0 -113
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_triangle.d.ts +0 -36
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_triangle.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_triangle.js +0 -85
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_distance.d.ts +0 -23
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_distance.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_distance.js +0 -273
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_gather.d.ts +0 -13
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_gather.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_gather.js +0 -151
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_traverse.d.ts +0 -13
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_traverse.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_traverse.js +0 -133
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_wait.d.ts +0 -22
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_wait.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_wait.js +0 -135
|
@@ -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":";IAg3DA;;;;;;;;;;;;;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
|
|
|
@@ -1241,7 +1260,9 @@ export const WGSLLanguageCore = {
|
|
|
1241
1260
|
*
|
|
1242
1261
|
* Filtered sample at normalised UV coords. Honours the sampler's
|
|
1243
1262
|
* address modes and `magFilter`. `coords` length matches the texture
|
|
1244
|
-
* dimensionality. The `level`
|
|
1263
|
+
* dimensionality. The `level` reads that level of a bitmap carrying its levels, as `textureLoad`
|
|
1264
|
+
* does, and zero past them; between two levels, a `linear` `mipmapFilter` blends them and any other
|
|
1265
|
+
* takes the nearer. A bitmap carrying none serves every level from itself.
|
|
1245
1266
|
*
|
|
1246
1267
|
* @param {import("./CPUBitmapData.js").CPUBitmapData} t
|
|
1247
1268
|
* @param {import("../../descriptor/texture/SamplerDescriptor.js").SamplerDescriptor | null} sampler
|
|
@@ -1256,21 +1277,44 @@ export const WGSLLanguageCore = {
|
|
|
1256
1277
|
|
|
1257
1278
|
let array_index = undefined;
|
|
1258
1279
|
let offset = undefined;
|
|
1280
|
+
let level = p3;
|
|
1259
1281
|
|
|
1260
1282
|
if (p5 !== undefined) {
|
|
1261
1283
|
// (t, s, coords, array_index, level, offset)
|
|
1262
1284
|
array_index = p3;
|
|
1285
|
+
level = p4;
|
|
1263
1286
|
offset = p5;
|
|
1264
1287
|
} else if (p4 === undefined) {
|
|
1265
1288
|
// (t, s, coords, level)
|
|
1266
1289
|
} else if (typeof p4 === 'number') {
|
|
1267
1290
|
// (t, s, coords, array_index, level)
|
|
1268
1291
|
array_index = p3;
|
|
1292
|
+
level = p4;
|
|
1269
1293
|
} else {
|
|
1270
1294
|
// (t, s, coords, level, offset)
|
|
1271
1295
|
offset = p4;
|
|
1272
1296
|
}
|
|
1273
1297
|
|
|
1298
|
+
if (t.levels?.length > 0 && level !== 0) {
|
|
1299
|
+
const below = Math.max(Math.floor(level), 0);
|
|
1300
|
+
const fraction = level - below;
|
|
1301
|
+
|
|
1302
|
+
if (fraction > 0 && sampler?.mipmapFilter === 'linear') {
|
|
1303
|
+
const a = WGSLLanguageCore.textureSampleLevel(t, sampler, coords, ...(array_index === undefined ? [below] : [array_index, below]), ...(offset === undefined ? [] : [offset]));
|
|
1304
|
+
const b = WGSLLanguageCore.textureSampleLevel(t, sampler, coords, ...(array_index === undefined ? [below + 1] : [array_index, below + 1]), ...(offset === undefined ? [] : [offset]));
|
|
1305
|
+
|
|
1306
|
+
return a.map((v, i) => v + (b[i] - v) * fraction);
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
const source = texture_level(t, fraction > 0.5 ? below + 1 : below);
|
|
1310
|
+
|
|
1311
|
+
if (source === undefined) {
|
|
1312
|
+
return new Float32Array(4);
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
t = source;
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1274
1318
|
const dim = t.dimensionality;
|
|
1275
1319
|
// Convert UV (normalised) to texel-space coords expected by
|
|
1276
1320
|
// cpu_texture_sample. coords for a 1D texture is a scalar in WGSL.
|
|
@@ -1584,8 +1628,8 @@ export const WGSLLanguageCore = {
|
|
|
1584
1628
|
t.write(x, y, z, value_or_index);
|
|
1585
1629
|
},
|
|
1586
1630
|
|
|
1587
|
-
//
|
|
1588
|
-
textureNumLevels(
|
|
1631
|
+
// the levels the bitmap carries, itself the first (`CPUBitmapData.levels`)
|
|
1632
|
+
textureNumLevels(t) { return 1 + t.levels.length; },
|
|
1589
1633
|
|
|
1590
1634
|
/*
|
|
1591
1635
|
`textureDimensions(t, level)` comes in three variants, one per number of components it returns,
|
|
@@ -1597,35 +1641,37 @@ export const WGSLLanguageCore = {
|
|
|
1597
1641
|
/**
|
|
1598
1642
|
* `textureDimensions` of a `texture_1d` or `texture_storage_1d`.
|
|
1599
1643
|
* @param {import("./CPUBitmapData.js").CPUBitmapData} t
|
|
1600
|
-
* @param {number} [
|
|
1644
|
+
* @param {number} [level] - of a bitmap carrying its levels; see `CPUBitmapData.levels`
|
|
1601
1645
|
* @returns {number}
|
|
1602
1646
|
*/
|
|
1603
|
-
textureDimensions_1d(t,
|
|
1647
|
+
textureDimensions_1d(t, level = 0) {
|
|
1604
1648
|
assert.defined(t, 'texture');
|
|
1605
|
-
return t.size[0];
|
|
1649
|
+
return texture_level(t, level).size[0];
|
|
1606
1650
|
},
|
|
1607
1651
|
|
|
1608
1652
|
/**
|
|
1609
1653
|
* `textureDimensions` of a 2D, array, cube or multisampled texture. An array texture's layers
|
|
1610
1654
|
* are not part of it.
|
|
1611
1655
|
* @param {import("./CPUBitmapData.js").CPUBitmapData} t
|
|
1612
|
-
* @param {number} [
|
|
1656
|
+
* @param {number} [level] - of a bitmap carrying its levels; see `CPUBitmapData.levels`
|
|
1613
1657
|
* @returns {Uint32Array}
|
|
1614
1658
|
*/
|
|
1615
|
-
textureDimensions_2d(t,
|
|
1659
|
+
textureDimensions_2d(t, level = 0) {
|
|
1616
1660
|
assert.defined(t, 'texture');
|
|
1617
|
-
|
|
1661
|
+
const size = texture_level(t, level).size;
|
|
1662
|
+
return new Uint32Array([size[0], size[1]]);
|
|
1618
1663
|
},
|
|
1619
1664
|
|
|
1620
1665
|
/**
|
|
1621
1666
|
* `textureDimensions` of a `texture_3d` or `texture_storage_3d`.
|
|
1622
1667
|
* @param {import("./CPUBitmapData.js").CPUBitmapData} t
|
|
1623
|
-
* @param {number} [
|
|
1668
|
+
* @param {number} [level] - of a bitmap carrying its levels; see `CPUBitmapData.levels`
|
|
1624
1669
|
* @returns {Uint32Array}
|
|
1625
1670
|
*/
|
|
1626
|
-
textureDimensions_3d(t,
|
|
1671
|
+
textureDimensions_3d(t, level = 0) {
|
|
1627
1672
|
assert.defined(t, 'texture');
|
|
1628
|
-
|
|
1673
|
+
const size = texture_level(t, level).size;
|
|
1674
|
+
return new Uint32Array([size[0], size[1], size[2]]);
|
|
1629
1675
|
},
|
|
1630
1676
|
|
|
1631
1677
|
// ---------------------------------------------------------------------
|
|
@@ -0,0 +1,116 @@
|
|
|
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
|
+
* The knobs are the three Dota 2 exposes for its hero bars as console variables: a short hold after a drop
|
|
5
|
+
* (`dota_health_hurt_delay`) and a decay whose length sits between a floor and a ceiling
|
|
6
|
+
* (`dota_health_hurt_decay_time_min` / `_max`). The defaults, 0.1 s / 0.3 s / 0.8 s, are the values players'
|
|
7
|
+
* published configs list as Dota's own; Valve does not document them. Everything else here is this class's own
|
|
8
|
+
* choice, not known Dota behaviour: the decay's length growing linearly with the loss (the whole bar takes the
|
|
9
|
+
* ceiling), the ease-out curve, and how losses that overlap combine.
|
|
10
|
+
*
|
|
11
|
+
* Every drop is a loss with a trail of its own: it holds at the value from before the drop for {@link delay_ms},
|
|
12
|
+
* then eases down over a length sized by that loss alone. The trail shows the highest of the live losses' trails,
|
|
13
|
+
* and never less than the target. Because no loss looks at another, a drop is drawn the same whether the trail
|
|
14
|
+
* was at rest or still moving when it came: a damage tick that lands just before or just after the previous one
|
|
15
|
+
* has faded looks the same, where a single trail that re-plans has to pick one side of that line.
|
|
16
|
+
*
|
|
17
|
+
* Each loss eases toward the lowest the target has been since it happened, never toward the target itself, so a
|
|
18
|
+
* rise that stays under the trail (regeneration after a hit) cannot lift it. When a later drop lowers that floor,
|
|
19
|
+
* the rest of the loss's ease is rescaled toward the new floor from where it is, so it does not jump. The trail
|
|
20
|
+
* is continuous in time and never rises unless the target rises above it; when it does, the trail jumps to the
|
|
21
|
+
* target and every loss is forgotten.
|
|
22
|
+
*
|
|
23
|
+
* A target that is not a finite number is ignored: the trail carries on with what it had, so one bad value cannot
|
|
24
|
+
* leave it NaN, and its owner animating it forever, for every value after.
|
|
25
|
+
*
|
|
26
|
+
* Each loss's start and length are fixed when it happens, so changing the knobs never revives or reshapes a trail
|
|
27
|
+
* already under way.
|
|
28
|
+
*
|
|
29
|
+
* Time is passed in, in milliseconds on any monotonic clock, so the trail can be driven and checked without one.
|
|
30
|
+
*/
|
|
31
|
+
export class GhostTrail {
|
|
32
|
+
/**
|
|
33
|
+
* How long a loss's trail holds before it starts to ease down
|
|
34
|
+
* @type {number}
|
|
35
|
+
*/
|
|
36
|
+
delay_ms: number;
|
|
37
|
+
/**
|
|
38
|
+
* Length of the ease for the smallest loss; 0 with {@link duration_max_ms} 0 snaps once the hold ends
|
|
39
|
+
* @type {number}
|
|
40
|
+
*/
|
|
41
|
+
duration_min_ms: number;
|
|
42
|
+
/**
|
|
43
|
+
* Length of the ease for a loss of the whole bar (1); smaller losses take proportionally less, down to
|
|
44
|
+
* {@link duration_min_ms}
|
|
45
|
+
* @type {number}
|
|
46
|
+
*/
|
|
47
|
+
duration_max_ms: number;
|
|
48
|
+
/**
|
|
49
|
+
* The target, as last set
|
|
50
|
+
* @type {number}
|
|
51
|
+
* @private
|
|
52
|
+
*/
|
|
53
|
+
private __to;
|
|
54
|
+
/**
|
|
55
|
+
* Live losses, {@link LOSS_STRIDE} floats each: when the ease starts (after the hold), the ease's length, the
|
|
56
|
+
* lowest the target has been since the loss, and how far above that the trail is while u is 1
|
|
57
|
+
* @type {Float64Array}
|
|
58
|
+
* @private
|
|
59
|
+
*/
|
|
60
|
+
private __losses;
|
|
61
|
+
/**
|
|
62
|
+
* @type {number}
|
|
63
|
+
* @private
|
|
64
|
+
*/
|
|
65
|
+
private __loss_count;
|
|
66
|
+
/**
|
|
67
|
+
* Length of the ease for a loss of `gap`, a fraction of the bar
|
|
68
|
+
* @param {number} gap
|
|
69
|
+
* @returns {number}
|
|
70
|
+
* @private
|
|
71
|
+
*/
|
|
72
|
+
private __duration_for;
|
|
73
|
+
/**
|
|
74
|
+
* How much of one loss's ease is left at `time_ms`: 1 while it holds, falling to 0 when the ease is over
|
|
75
|
+
* @param {number} index
|
|
76
|
+
* @param {number} time_ms
|
|
77
|
+
* @returns {number}
|
|
78
|
+
* @private
|
|
79
|
+
*/
|
|
80
|
+
private __loss_u;
|
|
81
|
+
/**
|
|
82
|
+
* Where one loss's trail is at `time_ms`; an ease-out, fastest at the start of the ease
|
|
83
|
+
* @param {number} index
|
|
84
|
+
* @param {number} time_ms
|
|
85
|
+
* @returns {number}
|
|
86
|
+
* @private
|
|
87
|
+
*/
|
|
88
|
+
private __loss_at;
|
|
89
|
+
/**
|
|
90
|
+
* @param {number} start
|
|
91
|
+
* @param {number} duration
|
|
92
|
+
* @param {number} low
|
|
93
|
+
* @param {number} amplitude
|
|
94
|
+
* @private
|
|
95
|
+
*/
|
|
96
|
+
private __add_loss;
|
|
97
|
+
/**
|
|
98
|
+
* Tell the trail its target's new value.
|
|
99
|
+
* @param {number} target
|
|
100
|
+
* @param {number} time_ms
|
|
101
|
+
*/
|
|
102
|
+
set(target: number, time_ms: number): void;
|
|
103
|
+
/**
|
|
104
|
+
* Where the trail is at a given time: the highest of the live losses' trails, and never below the target.
|
|
105
|
+
* @param {number} time_ms
|
|
106
|
+
* @returns {number}
|
|
107
|
+
*/
|
|
108
|
+
sample(time_ms: number): number;
|
|
109
|
+
/**
|
|
110
|
+
* Whether the trail shows the target and will not move until {@link set} is called again
|
|
111
|
+
* @param {number} time_ms
|
|
112
|
+
* @returns {boolean}
|
|
113
|
+
*/
|
|
114
|
+
is_settled(time_ms: number): boolean;
|
|
115
|
+
}
|
|
116
|
+
//# 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":"AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH;IACI;;;OAGG;IACH,UAFU,MAAM,CAED;IAEf;;;OAGG;IACH,iBAFU,MAAM,CAEM;IAEtB;;;;OAIG;IACH,iBAFU,MAAM,CAEM;IAEtB;;;;OAIG;IACH,aAAS;IAET;;;;;OAKG;IACH,iBAA6C;IAE7C;;;OAGG;IACH,qBAAiB;IAEjB;;;;;OAKG;IACH,uBAIC;IAED;;;;;;OAMG;IACH,iBAgBC;IAED;;;;;;OAMG;IACH,kBAKC;IAED;;;;;;OAMG;IACH,mBAoBC;IAED;;;;OAIG;IACH,YAHW,MAAM,WACN,MAAM,QAsEhB;IAED;;;;OAIG;IACH,gBAHW,MAAM,GACJ,MAAM,CAgBlB;IAED;;;;OAIG;IACH,oBAHW,MAAM,GACJ,OAAO,CAkBnB;CACJ"}
|