@woosh/meep-engine 3.61.2 → 3.61.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +111 -0
- package/package.json +1 -1
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/shade/playground/probe_clipmap/README.md +3 -4
- package/src/shade/playground/probe_clipmap/index.html +5 -13
- package/src/shade/playground/probe_clipmap/main.d.ts.map +1 -1
- package/src/shade/playground/probe_clipmap/main.js +0 -5
- package/src/shade/playground/probe_clipmap_box/README.md +1 -1
- package/src/shade/playground/probe_clipmap_box/index.html +1 -1
- package/src/shade/renderer/Renderer.d.ts.map +1 -1
- package/src/shade/renderer/Renderer.js +50 -11
- package/src/shade/renderer/fluid/GPUFluidCascade.d.ts +3 -3
- package/src/shade/renderer/fluid/GPUFluidCascadeStack.d.ts +1 -1
- package/src/shade/renderer/fluid/forcing/GPUFluidForcing.d.ts +6 -6
- package/src/shade/renderer/fluid/pressure/GPUFluidPressureSolve.d.ts +1 -1
- package/src/shade/renderer/fluid/query/GPUFluidQueries.d.ts +1 -1
- package/src/shade/renderer/geometry/meshlet/meshlet_batch_colored.d.ts +10 -0
- package/src/shade/renderer/geometry/meshlet/meshlet_batch_colored.d.ts.map +1 -0
- package/src/shade/renderer/geometry/meshlet/meshlet_batch_colored.js +54 -0
- package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts +85 -36
- package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.js +813 -412
- package/src/shade/renderer/geometry/sdf/MESH_SDF.d.ts +7 -0
- package/src/shade/renderer/geometry/sdf/MESH_SDF.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/MESH_SDF.js +8 -0
- package/src/shade/renderer/geometry/sdf/MESH_SDF_BRICK_KEY.d.ts +14 -0
- package/src/shade/renderer/geometry/sdf/MESH_SDF_BRICK_KEY.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/MESH_SDF_BRICK_KEY.js +35 -0
- package/src/shade/renderer/geometry/sdf/MESH_SDF_STRUCT.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/MESH_SDF_STRUCT.js +0 -4
- package/src/shade/renderer/geometry/sdf/bake/MESH_SDF_BAKE.d.ts +55 -10
- package/src/shade/renderer/geometry/sdf/bake/MESH_SDF_BAKE.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/bake/MESH_SDF_BAKE.js +86 -16
- package/src/shade/renderer/geometry/sdf/bake/chunk_mesh_sdf_bake.d.ts +2 -2
- package/src/shade/renderer/geometry/sdf/bake/chunk_mesh_sdf_bake.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/bake/chunk_mesh_sdf_bake.js +28 -2
- package/src/shade/renderer/geometry/sdf/bake/chunk_mesh_sdf_contents.d.ts +54 -0
- package/src/shade/renderer/geometry/sdf/bake/chunk_mesh_sdf_contents.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/bake/chunk_mesh_sdf_contents.js +146 -0
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_classify.d.ts +1 -1
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_classify.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_classify.js +2 -1
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_content_rehash.d.ts +18 -0
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_content_rehash.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_content_rehash.js +66 -0
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_count.d.ts +17 -0
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_count.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_count.js +66 -0
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_evaluate.d.ts +5 -3
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_evaluate.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_evaluate.js +15 -14
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_free.d.ts +2 -1
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_free.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_free.js +12 -3
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_key.d.ts +21 -0
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_key.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_key.js +84 -0
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_resolve.d.ts +53 -0
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_resolve.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_resolve.js +343 -0
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_store.d.ts +3 -3
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_store.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_store.js +9 -5
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_take.d.ts +2 -2
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_take.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_take.js +3 -2
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_upload.d.ts +69 -0
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_upload.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_upload.js +294 -0
- package/src/shade/renderer/geometry/sdf/bundle/MODEL_CACHE_BUNDLE.d.ts +16 -0
- package/src/shade/renderer/geometry/sdf/bundle/MODEL_CACHE_BUNDLE.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/bundle/MODEL_CACHE_BUNDLE.js +36 -0
- package/src/shade/renderer/geometry/sdf/bundle/ModelCacheBundle.d.ts +126 -0
- package/src/shade/renderer/geometry/sdf/bundle/ModelCacheBundle.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/bundle/ModelCacheBundle.js +148 -0
- package/src/shade/renderer/geometry/sdf/bundle/model_cache_bundle_read.d.ts +10 -0
- package/src/shade/renderer/geometry/sdf/bundle/model_cache_bundle_read.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/bundle/model_cache_bundle_read.js +140 -0
- package/src/shade/renderer/geometry/sdf/bundle/model_cache_bundle_write.d.ts +8 -0
- package/src/shade/renderer/geometry/sdf/bundle/model_cache_bundle_write.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/bundle/model_cache_bundle_write.js +76 -0
- package/src/shade/renderer/geometry/sdf/chunk_mesh_sdf.d.ts +9 -0
- package/src/shade/renderer/geometry/sdf/chunk_mesh_sdf.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/chunk_mesh_sdf.js +23 -0
- package/src/shade/renderer/geometry/sdf/chunk_mesh_sdf_brick_key.d.ts +13 -0
- package/src/shade/renderer/geometry/sdf/chunk_mesh_sdf_brick_key.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/chunk_mesh_sdf_brick_key.js +23 -0
- package/src/shade/renderer/geometry/sdf/surface/GPUMeshSurfaceCaches.d.ts +262 -0
- package/src/shade/renderer/geometry/sdf/surface/GPUMeshSurfaceCaches.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/surface/GPUMeshSurfaceCaches.js +1819 -0
- package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_BAKE.d.ts +118 -0
- package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_BAKE.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_BAKE.js +204 -0
- package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_BLOCK.d.ts +66 -0
- package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_BLOCK.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_BLOCK.js +103 -0
- package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_RESOURCES.d.ts +19 -0
- package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_RESOURCES.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_RESOURCES.js +23 -0
- package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_STRUCT.d.ts +15 -0
- package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_STRUCT.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_STRUCT.js +70 -0
- package/src/shade/renderer/geometry/sdf/surface/SURFACE_MATERIAL.d.ts +13 -0
- package/src/shade/renderer/geometry/sdf/surface/SURFACE_MATERIAL.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/surface/SURFACE_MATERIAL.js +35 -0
- package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_block.d.ts +32 -0
- package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_block.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_block.js +111 -0
- package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_listed.d.ts +17 -0
- package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_listed.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_listed.js +49 -0
- package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_run_find.d.ts +13 -0
- package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_run_find.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_run_find.js +35 -0
- package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_sample.d.ts +24 -0
- package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_sample.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_sample.js +169 -0
- package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_texel_ray.d.ts +19 -0
- package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_texel_ray.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_texel_ray.js +49 -0
- package/src/shade/renderer/geometry/sdf/surface/chunk_surface_material_fit.d.ts +19 -0
- package/src/shade/renderer/geometry/sdf/surface/chunk_surface_material_fit.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/surface/chunk_surface_material_fit.js +67 -0
- package/src/shade/renderer/geometry/sdf/surface/chunk_surface_material_read.d.ts +78 -0
- package/src/shade/renderer/geometry/sdf/surface/chunk_surface_material_read.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/surface/chunk_surface_material_read.js +320 -0
- package/src/shade/renderer/geometry/sdf/surface/chunk_surface_material_store.d.ts +15 -0
- package/src/shade/renderer/geometry/sdf/surface/chunk_surface_material_store.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/surface/chunk_surface_material_store.js +48 -0
- package/src/shade/renderer/geometry/sdf/surface/mesh_surface_channels.d.ts +51 -0
- package/src/shade/renderer/geometry/sdf/surface/mesh_surface_channels.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/surface/mesh_surface_channels.js +109 -0
- package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_command.d.ts +11 -0
- package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_command.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_command.js +51 -0
- package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_encode.d.ts +26 -0
- package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_encode.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_encode.js +453 -0
- package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_list.d.ts +12 -0
- package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_list.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_list.js +99 -0
- package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_survey.d.ts +22 -0
- package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_survey.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_survey.js +140 -0
- package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_trace.d.ts +32 -0
- package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_trace.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_trace.js +261 -0
- package/src/shade/renderer/geometry/virtual/runtime/VirtualGeometry.d.ts +2 -2
- package/src/shade/renderer/geometry/virtual/runtime/VirtualGeometry.js +2 -2
- package/src/shade/renderer/geometry/virtual/sdf/VGeoSDFProxies.d.ts +6 -6
- package/src/shade/renderer/geometry/virtual/sdf/VGeoSDFProxies.js +7 -7
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts +15 -7
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.js +82 -17
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSceneHolds.d.ts +26 -19
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSceneHolds.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSceneHolds.js +226 -148
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts +25 -52
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.js +29 -69
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/BRICK_CLIPMAP.d.ts +19 -16
- 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 +24 -21
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.d.ts +46 -22
- 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 +49 -36
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap.d.ts +3 -2
- 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 +7 -6
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts +8 -22
- 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 +15 -51
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK.d.ts +1 -6
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK.js +6 -13
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_walk.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_walk.js +0 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_batch.d.ts +4 -4
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_batch.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_batch.js +9 -34
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_resolve.d.ts +4 -6
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_resolve.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_resolve.js +15 -39
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_clear.d.ts +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_clear.js +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_store.d.ts +1 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_store.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_store.js +2 -6
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_take.d.ts +2 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_take.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_take.js +5 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/debug/ProbeClipmapDebugView.d.ts +5 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/debug/ProbeClipmapDebugView.js +16 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_brick_material.d.ts +45 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_brick_material.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_brick_material.js +208 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_indirect.d.ts +24 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_indirect.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_indirect.js +40 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_mesh_surfaces.d.ts +34 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_mesh_surfaces.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/debug/{graph_probe_clipmap_debug_mesh_cards.js → graph_probe_clipmap_debug_mesh_surfaces.js} +38 -57
- package/src/shade/renderer/global_illumination/probe_clipmap/material/GPUBrickMaterial.d.ts +61 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/material/GPUBrickMaterial.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/material/GPUBrickMaterial.js +193 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/material/chunk_brick_material.d.ts +67 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/material/chunk_brick_material.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/material/chunk_brick_material.js +142 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/material/chunk_brick_material_cell.d.ts +32 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/material/chunk_brick_material_cell.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/material/chunk_brick_material_cell.js +70 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/material/chunk_brick_material_store.d.ts +30 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/material/chunk_brick_material_store.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/material/chunk_brick_material_store.js +71 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/material/shader_brick_material_gather.d.ts +26 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/material/shader_brick_material_gather.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/material/shader_brick_material_gather.js +176 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts +18 -9
- 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 +63 -44
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.d.ts +21 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.js +24 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP_INDIRECT_LOBE.d.ts +10 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP_INDIRECT_LOBE.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP_INDIRECT_LOBE.js +11 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapIndirectLobe.d.ts +11 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapIndirectLobe.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapIndirectLobe.js +15 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.d.ts +44 -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 +88 -11
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_hit_material.d.ts +43 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_hit_material.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_hit_material.js +138 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_indirect_lobe.d.ts +21 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_indirect_lobe.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_indirect_lobe.js +49 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.d.ts +2 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.js +10 -4
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_select.d.ts +22 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_select.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_select.js +50 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.d.ts +4 -4
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.js +8 -8
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_bounce.d.ts +3 -3
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_bounce.js +5 -5
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_indirect_lighting.d.ts +2 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_indirect_lighting.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_indirect_lighting.js +5 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.d.ts +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.js +2 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.d.ts +7 -4
- 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 +30 -26
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.d.ts +6 -5
- 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 +22 -16
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want.js +6 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.d.ts +2 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.js +6 -6
- package/src/shade/renderer/gpu_primitive/hash_table/chunk_generate_next_linear_congruential_index.d.ts +14 -0
- package/src/shade/renderer/gpu_primitive/hash_table/chunk_generate_next_linear_congruential_index.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/hash_table/chunk_generate_next_linear_congruential_index.js +22 -0
- package/src/shade/renderer/gpu_primitive/hash_table/chunk_hash_table_atomic.d.ts +37 -0
- package/src/shade/renderer/gpu_primitive/hash_table/chunk_hash_table_atomic.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/hash_table/chunk_hash_table_atomic.js +122 -0
- package/src/shade/renderer/gpu_primitive/hash_table/chunk_hash_table_get.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/hash_table/chunk_hash_table_get.js +1 -11
- package/src/shade/renderer/gpu_primitive/hash_table/cpu_build_hash_table.d.ts +8 -0
- package/src/shade/renderer/gpu_primitive/hash_table/cpu_build_hash_table.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/hash_table/cpu_build_hash_table.js +6 -4
- package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
- package/src/shade/renderer/material/resident/GPUResidentMaterialContext.d.ts +1 -1
- package/src/shade/renderer/material/resident/GPUResidentMaterialContext.d.ts.map +1 -1
- package/src/shade/renderer/material/resident/GPUResidentMaterialContext.js +2 -18
- package/src/shade/renderer/material/resident/NEUTRAL_SURFACE.d.ts +17 -0
- package/src/shade/renderer/material/resident/NEUTRAL_SURFACE.d.ts.map +1 -0
- package/src/shade/renderer/material/resident/NEUTRAL_SURFACE.js +16 -0
- package/src/shade/renderer/path_tracer/shader/INDIRECT_TEXTURE_FILTER.d.ts +1 -1
- package/src/shade/renderer/path_tracer/shader/INDIRECT_TEXTURE_FILTER.js +1 -1
- package/src/shade/renderer/path_tracer/shader/IndirectTextureFilter.js +1 -1
- package/src/shade/renderer/path_tracer/shader/chunk_beam_texture_level.d.ts +20 -0
- package/src/shade/renderer/path_tracer/shader/chunk_beam_texture_level.d.ts.map +1 -0
- package/src/shade/renderer/path_tracer/shader/chunk_beam_texture_level.js +65 -0
- package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
- package/src/shade/renderer/scene/GPUSceneContext.d.ts +1 -1
- package/src/shade/renderer/scene/GPUSceneContext.js +1 -1
- package/src/shade/renderer/shader/chunk/material/albedo_compress.d.ts +12 -0
- package/src/shade/renderer/shader/chunk/material/albedo_compress.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/material/albedo_compress.js +26 -0
- package/src/shade/renderer/shader/chunk/material/chunk_albedo_compress.d.ts +16 -0
- package/src/shade/renderer/shader/chunk/material/chunk_albedo_compress.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/material/chunk_albedo_compress.js +22 -0
- package/src/shade/renderer/shader/chunk/material/chunk_albedo_uncompress.d.ts +15 -0
- package/src/shade/renderer/shader/chunk/material/chunk_albedo_uncompress.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/material/chunk_albedo_uncompress.js +23 -0
- package/src/shade/renderer/shader/chunk/material/chunk_metal_rough_compress.d.ts +16 -0
- package/src/shade/renderer/shader/chunk/material/chunk_metal_rough_compress.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/material/chunk_metal_rough_compress.js +25 -0
- package/src/shade/renderer/shader/chunk/material/chunk_metal_rough_uncompress.d.ts +25 -0
- package/src/shade/renderer/shader/chunk/material/chunk_metal_rough_uncompress.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/material/chunk_metal_rough_uncompress.js +36 -0
- package/src/shade/renderer/shader/chunk/material/metal_rough_compress.d.ts +11 -0
- package/src/shade/renderer/shader/chunk/material/metal_rough_compress.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/material/metal_rough_compress.js +38 -0
- package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot.d.ts +20 -0
- package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot.js +35 -0
- package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot_compress.d.ts +28 -0
- package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot_compress.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot_compress.js +79 -0
- package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot_fit.d.ts +25 -0
- package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot_fit.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot_fit.js +89 -0
- package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot_uncompress.d.ts +31 -0
- package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot_uncompress.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot_uncompress.js +66 -0
- package/src/shade/renderer/shader/chunk/subgroup/chunk_subgroup_atomic_add.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/subgroup/chunk_subgroup_atomic_add.js +2 -0
- package/src/shade/renderer/shader/chunk/subgroup/chunk_subgroup_atomic_load.d.ts +17 -0
- package/src/shade/renderer/shader/chunk/subgroup/chunk_subgroup_atomic_load.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/subgroup/chunk_subgroup_atomic_load.js +34 -0
- package/src/shade/renderer/volumetrics/chunk_frustum_unit_box_coverage_multisample.d.ts +18 -0
- package/src/shade/renderer/volumetrics/chunk_frustum_unit_box_coverage_multisample.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/chunk_frustum_unit_box_coverage_multisample.js +31 -23
- package/src/shade/renderer/volumetrics/shader_volumetrics_build_participating_media.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/shader_volumetrics_build_participating_media.js +5 -6
- package/src/shade/renderer/water/query/GPUWaterQueries.d.ts +1 -1
- package/src/shade/renderer/wind/GPUSceneWind.d.ts +1 -1
- package/src/shade/renderer/geometry/sdf/cards/GPUMeshCardSets.d.ts +0 -213
- package/src/shade/renderer/geometry/sdf/cards/GPUMeshCardSets.d.ts.map +0 -1
- package/src/shade/renderer/geometry/sdf/cards/GPUMeshCardSets.js +0 -1468
- package/src/shade/renderer/geometry/sdf/cards/MESH_CARDS.d.ts +0 -82
- package/src/shade/renderer/geometry/sdf/cards/MESH_CARDS.d.ts.map +0 -1
- package/src/shade/renderer/geometry/sdf/cards/MESH_CARDS.js +0 -127
- package/src/shade/renderer/geometry/sdf/cards/MESH_CARD_RESOURCES.d.ts +0 -24
- package/src/shade/renderer/geometry/sdf/cards/MESH_CARD_RESOURCES.d.ts.map +0 -1
- package/src/shade/renderer/geometry/sdf/cards/MESH_CARD_RESOURCES.js +0 -29
- package/src/shade/renderer/geometry/sdf/cards/MESH_CARD_SET_STRUCT.d.ts +0 -12
- package/src/shade/renderer/geometry/sdf/cards/MESH_CARD_SET_STRUCT.d.ts.map +0 -1
- package/src/shade/renderer/geometry/sdf/cards/MESH_CARD_SET_STRUCT.js +0 -31
- package/src/shade/renderer/geometry/sdf/cards/MeshCardCaptureMode.d.ts +0 -11
- package/src/shade/renderer/geometry/sdf/cards/MeshCardCaptureMode.d.ts.map +0 -1
- package/src/shade/renderer/geometry/sdf/cards/MeshCardCaptureMode.js +0 -21
- package/src/shade/renderer/geometry/sdf/cards/chunk_mesh_card_surface.d.ts +0 -29
- package/src/shade/renderer/geometry/sdf/cards/chunk_mesh_card_surface.d.ts.map +0 -1
- package/src/shade/renderer/geometry/sdf/cards/chunk_mesh_card_surface.js +0 -179
- package/src/shade/renderer/geometry/sdf/cards/chunk_mesh_cards.d.ts +0 -17
- package/src/shade/renderer/geometry/sdf/cards/chunk_mesh_cards.d.ts.map +0 -1
- package/src/shade/renderer/geometry/sdf/cards/chunk_mesh_cards.js +0 -107
- package/src/shade/renderer/geometry/sdf/cards/mesh_cards_raster_pass_descriptor.d.ts +0 -65
- package/src/shade/renderer/geometry/sdf/cards/mesh_cards_raster_pass_descriptor.d.ts.map +0 -1
- package/src/shade/renderer/geometry/sdf/cards/mesh_cards_raster_pass_descriptor.js +0 -376
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_capture.d.ts +0 -40
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_capture.d.ts.map +0 -1
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_capture.js +0 -301
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_compact.d.ts +0 -19
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_compact.d.ts.map +0 -1
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_compact.js +0 -61
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_histogram.d.ts +0 -18
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_histogram.d.ts.map +0 -1
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_histogram.js +0 -102
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_log.d.ts +0 -15
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_log.d.ts.map +0 -1
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_log.js +0 -65
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_merge.d.ts +0 -22
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_merge.d.ts.map +0 -1
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_merge.js +0 -136
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_pages.d.ts +0 -20
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_pages.d.ts.map +0 -1
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_pages.js +0 -104
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_args.d.ts +0 -20
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_args.d.ts.map +0 -1
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_args.js +0 -80
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_scatter.d.ts +0 -18
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_scatter.d.ts.map +0 -1
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_scatter.js +0 -113
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_split.d.ts +0 -30
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_split.d.ts.map +0 -1
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_split.js +0 -146
- package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_mesh_cards.d.ts +0 -34
- package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_mesh_cards.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_hit_surface.d.ts +0 -31
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_hit_surface.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_hit_surface.js +0 -82
|
@@ -6,6 +6,7 @@ import { chunk_rgb_to_luminance } from "../../../shader/chunk/color/chunk_rgb_to
|
|
|
6
6
|
import { chunk_sphere_sample_volume } from "../../../shader/chunk/geometry/sphere/chunk_sphere_sample_volume.js";
|
|
7
7
|
import { chunk_mod_v3i } from "../../../shader/chunk/geometry/vec3/chunk_mod_v3i.js";
|
|
8
8
|
import { chunk_lower_bound_branchless } from "../../../shader/chunk/math/chunk_lower_bound_branchless.js";
|
|
9
|
+
import { chunk_sobol_sample_vec2 } from "../../../shader/chunk/noise/chunk_sobol_sample_vec2.js";
|
|
9
10
|
import { chunk_hash_to_float01 } from "../../../shader/chunk/random/chunk_hash_to_float01.js";
|
|
10
11
|
import { chunk_pcg3d } from "../../../shader/chunk/random/pcg/chunk_pcg3d.js";
|
|
11
12
|
import { chunk_pcg4d } from "../../../shader/chunk/random/pcg/chunk_pcg4d.js";
|
|
@@ -113,10 +114,10 @@ export const PROBE_RAY_STRUCT = WebGPUStruct.from({
|
|
|
113
114
|
/** the hit's normal, octahedral, two unorm16; zero but for a hit */
|
|
114
115
|
normal: u32,
|
|
115
116
|
/**
|
|
116
|
-
*
|
|
117
|
-
*
|
|
117
|
+
* Zero from trace; shade writes a front-face hit's diffuse albedo, `pack4x8unorm`, which the light and
|
|
118
|
+
* bounce passes read, and zero for any other ray.
|
|
118
119
|
*/
|
|
119
|
-
|
|
120
|
+
albedo: u32,
|
|
120
121
|
/** its kind, the back face, and the hit's cascade (`PROBE_CLIPMAP.js`) */
|
|
121
122
|
flags: u32,
|
|
122
123
|
/**
|
|
@@ -131,8 +132,8 @@ export const PROBE_RAY_STRUCT = WebGPUStruct.from({
|
|
|
131
132
|
/**
|
|
132
133
|
* The cascades' cage windows, a {@link CLIPMAP_LEVEL_ARRAY} as a uniform, finest first: a cell of
|
|
133
134
|
* cascade `c` is the cage of the eight lattice points at its corners, so its window is one short of the
|
|
134
|
-
* lattice's on each axis
|
|
135
|
-
*
|
|
135
|
+
* lattice's on each axis. `probe_clipmap_select_in` chooses a point's cascade by boxes on the anchor that lie
|
|
136
|
+
* inside these windows (§9.1, "Selection").
|
|
136
137
|
* @type {ShaderResourceDescriptor}
|
|
137
138
|
*/
|
|
138
139
|
export const PROBE_LEVELS_RESOURCE = ShaderResourceDescriptor.uniform("probe_levels", CLIPMAP_LEVEL_ARRAY);
|
|
@@ -761,12 +762,10 @@ fn probe_clipmap_texel_ray(texel: u32, round: u32, updates: u32, rays: u32, texe
|
|
|
761
762
|
/**
|
|
762
763
|
* A ray's noise (§8.6, §8.7): a hash of the probe's slot, its update count, the ray's place among the
|
|
763
764
|
* update's rays and a stream, the same in every pass that knows the ray. It never repeats over a probe's
|
|
764
|
-
* updates.
|
|
765
|
-
*
|
|
766
|
-
* independent of the jitter that placed the hit.
|
|
765
|
+
* updates. The bounce picks the probes at its hit by stream `PROBE_RAY_NOISE_PICK`, which is independent of
|
|
766
|
+
* the jitter that placed the hit (`probe_clipmap_ray_jitter`).
|
|
767
767
|
*
|
|
768
|
-
* This is white noise.
|
|
769
|
-
* which may clump. Each component lies inside (0, 1), at the centre of one of 2^23 bins, so a weighted
|
|
768
|
+
* This is white noise. Each component lies inside (0, 1), at the centre of one of 2^23 bins, so a weighted
|
|
770
769
|
* draw by it never meets either end.
|
|
771
770
|
*
|
|
772
771
|
* ```wgsl
|
|
@@ -778,7 +777,6 @@ fn probe_clipmap_texel_ray(texel: u32, round: u32, updates: u32, rays: u32, texe
|
|
|
778
777
|
export const chunk_probe_clipmap_ray_noise = CodeChunk.from(
|
|
779
778
|
//language=WGSL
|
|
780
779
|
`
|
|
781
|
-
const PROBE_RAY_NOISE_JITTER = ${PROBE_RAY_NOISE_JITTER}u;
|
|
782
780
|
const PROBE_RAY_NOISE_PICK = ${PROBE_RAY_NOISE_PICK}u;
|
|
783
781
|
|
|
784
782
|
fn probe_clipmap_ray_noise(slot: u32, updates: u32, ray: u32, stream: u32) -> vec2<f32> {
|
|
@@ -791,6 +789,34 @@ fn probe_clipmap_ray_noise(slot: u32, updates: u32, ray: u32, stream: u32) -> ve
|
|
|
791
789
|
chunk_pcg4d,
|
|
792
790
|
]);
|
|
793
791
|
|
|
792
|
+
/**
|
|
793
|
+
* Where a ray lands inside its octahedral texel (§8.6), as a point of the texel's square in [0, 1)²: point
|
|
794
|
+
* `index` of the texel's jitter sequence `sequence`, a shuffled, Owen-scrambled Sobol (0, 2)-sequence
|
|
795
|
+
* (`sample_sobol_2d`) seeded by the probe's slot, the texel and the sequence. Which sequence and index a ray
|
|
796
|
+
* takes is `probe_clipmap_ray_visit`'s.
|
|
797
|
+
*
|
|
798
|
+
* The points of an aligned run of 2^m indices of one sequence put one in each dyadic cell of area 2^-m of the
|
|
799
|
+
* texel. Different slots, texels and sequences draw independent sequences.
|
|
800
|
+
*
|
|
801
|
+
* ```wgsl
|
|
802
|
+
* fn probe_clipmap_ray_jitter(slot: u32, texel: u32, sequence: u32, index: u32) -> vec2<f32>
|
|
803
|
+
* ```
|
|
804
|
+
*
|
|
805
|
+
* @type {CodeChunk}
|
|
806
|
+
*/
|
|
807
|
+
export const chunk_probe_clipmap_ray_jitter = CodeChunk.from(
|
|
808
|
+
//language=WGSL
|
|
809
|
+
`
|
|
810
|
+
fn probe_clipmap_ray_jitter(slot: u32, texel: u32, sequence: u32, index: u32) -> vec2<f32> {
|
|
811
|
+
let seed = pcg4d(vec4<u32>(slot, texel, sequence, ${PROBE_RAY_NOISE_JITTER}u)).x;
|
|
812
|
+
|
|
813
|
+
return sample_sobol_2d(index, seed);
|
|
814
|
+
}
|
|
815
|
+
`, [
|
|
816
|
+
chunk_pcg4d,
|
|
817
|
+
chunk_sobol_sample_vec2,
|
|
818
|
+
]);
|
|
819
|
+
|
|
794
820
|
/**
|
|
795
821
|
* Where a ray of an update starts (§8.6): a point of the ball of `PROBE_RAY_ORIGIN_JITTER` of the spacing
|
|
796
822
|
* around the probe, uniform in its volume, as Brick4's bake jitters its probes. The point is drawn from the
|
|
@@ -923,6 +949,57 @@ fn probe_clipmap_guide_start(before: u32, total: u32, rays: u32, phase: f32) ->
|
|
|
923
949
|
chunk_pcg3d,
|
|
924
950
|
]);
|
|
925
951
|
|
|
952
|
+
/**
|
|
953
|
+
* Which of its texel's jitter sequences a ray of an update takes, and its index there (`.x`, `.y`), for
|
|
954
|
+
* `probe_clipmap_ray_jitter` (§8.6). A texel has a sequence for each round (the ray's place among the
|
|
955
|
+
* texel's rays in the update, from 0) and each kind of update: uniform, guided, and a DEAD probe's. The index
|
|
956
|
+
* counts the texel's earlier visits of that kind:
|
|
957
|
+
* - uniform: the probe's uniform updates before this one (its first n_r²/R, then every `period`-th), over
|
|
958
|
+
* the uniform updates between two of the texel's rays below R = n_r², n_r²/R;
|
|
959
|
+
* - guided: the probe's guided updates before this one;
|
|
960
|
+
* - DEAD: its updates before this one, over n_r²/R where its rays are fewer than the texels.
|
|
961
|
+
*
|
|
962
|
+
* So a texel that takes a ray of a round on every update of a kind has that round's rays of the kind
|
|
963
|
+
* stratified inside it, whichever other updates it takes rays on: those of an aligned run of 2^m indices
|
|
964
|
+
* put one in each dyadic cell of area 2^-m. A texel passed over on some guided updates takes a subset of
|
|
965
|
+
* such a run. The indices of a kind only grow, so no sequence gives a texel a point twice until the 30-bit
|
|
966
|
+
* update count wraps.
|
|
967
|
+
*
|
|
968
|
+
* ```wgsl
|
|
969
|
+
* fn probe_clipmap_ray_visit(state: u32, round: u32, rays: u32, texels: u32, period: u32, rays_per_probe: u32) -> vec2<u32> // state: the first word; rays: the update's
|
|
970
|
+
* ```
|
|
971
|
+
*
|
|
972
|
+
* @type {CodeChunk}
|
|
973
|
+
*/
|
|
974
|
+
export const chunk_probe_clipmap_ray_visit = CodeChunk.from(
|
|
975
|
+
//language=WGSL
|
|
976
|
+
`
|
|
977
|
+
fn probe_clipmap_ray_visit(state: u32, round: u32, rays: u32, texels: u32, period: u32, rays_per_probe: u32) -> vec2<u32> {
|
|
978
|
+
let updates = probe_state_updates(state);
|
|
979
|
+
|
|
980
|
+
// the uniform updates between two of a texel's rays: the subsets of the texels go round in that many
|
|
981
|
+
let spread = max(texels / rays, 1u);
|
|
982
|
+
|
|
983
|
+
if (probe_state_kind(state) == PROBE_STATE_DEAD) {
|
|
984
|
+
return vec2<u32>(3u * round + 2u, updates / spread);
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
// the probe's uniform updates before this one: its first, then the multiples of the period past them
|
|
988
|
+
let early = texels / rays_per_probe;
|
|
989
|
+
let later = select(0u, (updates + period - 1u) / period - (early + period - 1u) / period, updates > early);
|
|
990
|
+
let uniform_before = min(updates, early) + later;
|
|
991
|
+
|
|
992
|
+
if (probe_clipmap_guided(state, period, rays_per_probe, texels)) {
|
|
993
|
+
return vec2<u32>(3u * round + 1u, updates - uniform_before);
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
return vec2<u32>(3u * round, uniform_before / spread);
|
|
997
|
+
}
|
|
998
|
+
`, [
|
|
999
|
+
chunk_probe_clipmap,
|
|
1000
|
+
chunk_probe_clipmap_guide,
|
|
1001
|
+
]);
|
|
1002
|
+
|
|
926
1003
|
/**
|
|
927
1004
|
* The rays a guided update gives a radiance texel, `R·(w + e)/W`, from the probe's guide (§8.6), whose words start
|
|
928
1005
|
* at `base`; nothing for a guide the guide passes never wrote.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The material a probe ray's hit takes its light with:
|
|
3
|
+
*
|
|
4
|
+
* ```wgsl
|
|
5
|
+
* struct ProbeClipmapHitMaterial { found: bool, albedo: vec3<f32>, emissive: vec3<f32> }
|
|
6
|
+
* fn probe_clipmap_hit_material(position: vec3<f32>, normal: vec3<f32>, cascade: u32) -> ProbeClipmapHitMaterial
|
|
7
|
+
* ```
|
|
8
|
+
*
|
|
9
|
+
* The hit is at `position` in brick cascade `cascade`, its field's normal `normal`: the brick holding it,
|
|
10
|
+
* looked up in the brick map at the hit's cascade as the march found it, and its material there
|
|
11
|
+
* (`brick_material_surface`), albedo and emissive. A hit whose brick carries no material for its surface
|
|
12
|
+
* is black, `found` false.
|
|
13
|
+
*
|
|
14
|
+
* @type {CodeChunk}
|
|
15
|
+
*/
|
|
16
|
+
export const chunk_probe_clipmap_hit_material: CodeChunk;
|
|
17
|
+
/**
|
|
18
|
+
* The material a probe ray's hit takes its light with, from one texel of the brick material:
|
|
19
|
+
*
|
|
20
|
+
* ```wgsl
|
|
21
|
+
* fn probe_clipmap_hit_material_pick(position: vec3<f32>, normal: vec3<f32>, cascade: u32, u: f32) -> ProbeClipmapHitMaterial
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* As {@link chunk_probe_clipmap_hit_material} finds the hit's brick, one of the texels its blend weighs
|
|
25
|
+
* drawn by `u` in [0, 1) in proportion to its weight (`brick_material_surface_pick`): the blend on
|
|
26
|
+
* average, which a probe's blend of its rays takes.
|
|
27
|
+
*
|
|
28
|
+
* @type {CodeChunk}
|
|
29
|
+
*/
|
|
30
|
+
export const chunk_probe_clipmap_hit_material_pick: CodeChunk;
|
|
31
|
+
/**
|
|
32
|
+
* A probe ray's hit's metalness and roughness, as {@link chunk_probe_clipmap_hit_material} finds its
|
|
33
|
+
* surface, for the debug views: the GI's light takes none of it yet.
|
|
34
|
+
*
|
|
35
|
+
* ```wgsl
|
|
36
|
+
* fn probe_clipmap_hit_metal_rough(position: vec3<f32>, normal: vec3<f32>, cascade: u32) -> vec3<f32> // (metalness, roughness, 1 if found)
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @type {CodeChunk}
|
|
40
|
+
*/
|
|
41
|
+
export const chunk_probe_clipmap_hit_metal_rough: CodeChunk;
|
|
42
|
+
import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
|
|
43
|
+
//# sourceMappingURL=chunk_probe_clipmap_hit_material.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk_probe_clipmap_hit_material.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_hit_material.js"],"names":[],"mappings":"AA6CA;;;;;;;;;;;;;;GAcG;AACH,+CAFU,SAAS,CAoB+C;AAElE;;;;;;;;;;;;GAYG;AACH,oDAFU,SAAS,CAoBoD;AAEvE;;;;;;;;;GASG;AACH,kDAFU,SAAS,CAgBmD;0BAxI5C,uCAAuC"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { MESH_SDF_BRICK_VOXELS } from "../../../geometry/sdf/MESH_SDF.js";
|
|
2
|
+
import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
|
|
3
|
+
import { chunk_brick_clipmap } from "../brick/chunk_brick_clipmap.js";
|
|
4
|
+
import { BRICK_LEVELS_RESOURCE, BRICK_MAP_TEXTURE_RESOURCE } from "../brick/chunk_brick_clipmap_trace.js";
|
|
5
|
+
import {
|
|
6
|
+
chunk_brick_material_metal_rough,
|
|
7
|
+
chunk_brick_material_surface,
|
|
8
|
+
chunk_brick_material_surface_pick
|
|
9
|
+
} from "../material/chunk_brick_material.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The brick of a hit's cascade holding its position: its slot, or no slot, and the position in voxels
|
|
13
|
+
* from its corner; and the material a hit's read gives.
|
|
14
|
+
*/
|
|
15
|
+
const brick_at = CodeChunk.from(
|
|
16
|
+
//language=WGSL
|
|
17
|
+
`
|
|
18
|
+
struct ProbeClipmapHitBrick {
|
|
19
|
+
entry: u32,
|
|
20
|
+
local: vec3<f32>,
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
struct ProbeClipmapHitMaterial {
|
|
24
|
+
found: bool,
|
|
25
|
+
albedo: vec3<f32>,
|
|
26
|
+
emissive: vec3<f32>,
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
fn probe_clipmap_hit_brick(position: vec3<f32>, cascade: u32) -> ProbeClipmapHitBrick {
|
|
30
|
+
let level = brick_levels[cascade];
|
|
31
|
+
let resolution = u32(level.size.x);
|
|
32
|
+
let cell = vec3<i32>(floor(position / level.cell_size));
|
|
33
|
+
|
|
34
|
+
var out: ProbeClipmapHitBrick;
|
|
35
|
+
|
|
36
|
+
out.entry = textureLoad(brick_map, brick_clipmap_map_texel(cascade, vec3<u32>(cell) & vec3<u32>(resolution - 1u), resolution), 0).x;
|
|
37
|
+
out.local = (position - vec3<f32>(cell) * level.cell_size) / (level.cell_size / ${MESH_SDF_BRICK_VOXELS}.0);
|
|
38
|
+
|
|
39
|
+
return out;
|
|
40
|
+
}
|
|
41
|
+
`, [chunk_brick_clipmap]);
|
|
42
|
+
|
|
43
|
+
brick_at.requireResource(BRICK_LEVELS_RESOURCE);
|
|
44
|
+
brick_at.requireResource(BRICK_MAP_TEXTURE_RESOURCE);
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The material a probe ray's hit takes its light with:
|
|
48
|
+
*
|
|
49
|
+
* ```wgsl
|
|
50
|
+
* struct ProbeClipmapHitMaterial { found: bool, albedo: vec3<f32>, emissive: vec3<f32> }
|
|
51
|
+
* fn probe_clipmap_hit_material(position: vec3<f32>, normal: vec3<f32>, cascade: u32) -> ProbeClipmapHitMaterial
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* The hit is at `position` in brick cascade `cascade`, its field's normal `normal`: the brick holding it,
|
|
55
|
+
* looked up in the brick map at the hit's cascade as the march found it, and its material there
|
|
56
|
+
* (`brick_material_surface`), albedo and emissive. A hit whose brick carries no material for its surface
|
|
57
|
+
* is black, `found` false.
|
|
58
|
+
*
|
|
59
|
+
* @type {CodeChunk}
|
|
60
|
+
*/
|
|
61
|
+
export const chunk_probe_clipmap_hit_material = CodeChunk.from(
|
|
62
|
+
//language=WGSL
|
|
63
|
+
`
|
|
64
|
+
fn probe_clipmap_hit_material(position: vec3<f32>, normal: vec3<f32>, cascade: u32) -> ProbeClipmapHitMaterial {
|
|
65
|
+
var out: ProbeClipmapHitMaterial;
|
|
66
|
+
|
|
67
|
+
let brick = probe_clipmap_hit_brick(position, cascade);
|
|
68
|
+
|
|
69
|
+
if (brick_clipmap_entry_holds_slot(brick.entry)) {
|
|
70
|
+
let seen = brick_material_surface(brick.entry, brick.local, normal);
|
|
71
|
+
|
|
72
|
+
out.found = seen.found;
|
|
73
|
+
out.albedo = seen.albedo;
|
|
74
|
+
out.emissive = seen.emissive;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return out;
|
|
78
|
+
}
|
|
79
|
+
`, [brick_at, chunk_brick_clipmap, chunk_brick_material_surface]);
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* The material a probe ray's hit takes its light with, from one texel of the brick material:
|
|
83
|
+
*
|
|
84
|
+
* ```wgsl
|
|
85
|
+
* fn probe_clipmap_hit_material_pick(position: vec3<f32>, normal: vec3<f32>, cascade: u32, u: f32) -> ProbeClipmapHitMaterial
|
|
86
|
+
* ```
|
|
87
|
+
*
|
|
88
|
+
* As {@link chunk_probe_clipmap_hit_material} finds the hit's brick, one of the texels its blend weighs
|
|
89
|
+
* drawn by `u` in [0, 1) in proportion to its weight (`brick_material_surface_pick`): the blend on
|
|
90
|
+
* average, which a probe's blend of its rays takes.
|
|
91
|
+
*
|
|
92
|
+
* @type {CodeChunk}
|
|
93
|
+
*/
|
|
94
|
+
export const chunk_probe_clipmap_hit_material_pick = CodeChunk.from(
|
|
95
|
+
//language=WGSL
|
|
96
|
+
`
|
|
97
|
+
fn probe_clipmap_hit_material_pick(position: vec3<f32>, normal: vec3<f32>, cascade: u32, u: f32) -> ProbeClipmapHitMaterial {
|
|
98
|
+
var out: ProbeClipmapHitMaterial;
|
|
99
|
+
|
|
100
|
+
let brick = probe_clipmap_hit_brick(position, cascade);
|
|
101
|
+
|
|
102
|
+
if (brick_clipmap_entry_holds_slot(brick.entry)) {
|
|
103
|
+
let seen = brick_material_surface_pick(brick.entry, brick.local, normal, u);
|
|
104
|
+
|
|
105
|
+
out.found = seen.found;
|
|
106
|
+
out.albedo = seen.albedo;
|
|
107
|
+
out.emissive = seen.emissive;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return out;
|
|
111
|
+
}
|
|
112
|
+
`, [brick_at, chunk_brick_clipmap, chunk_brick_material_surface_pick]);
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* A probe ray's hit's metalness and roughness, as {@link chunk_probe_clipmap_hit_material} finds its
|
|
116
|
+
* surface, for the debug views: the GI's light takes none of it yet.
|
|
117
|
+
*
|
|
118
|
+
* ```wgsl
|
|
119
|
+
* fn probe_clipmap_hit_metal_rough(position: vec3<f32>, normal: vec3<f32>, cascade: u32) -> vec3<f32> // (metalness, roughness, 1 if found)
|
|
120
|
+
* ```
|
|
121
|
+
*
|
|
122
|
+
* @type {CodeChunk}
|
|
123
|
+
*/
|
|
124
|
+
export const chunk_probe_clipmap_hit_metal_rough = CodeChunk.from(
|
|
125
|
+
//language=WGSL
|
|
126
|
+
`
|
|
127
|
+
fn probe_clipmap_hit_metal_rough(position: vec3<f32>, normal: vec3<f32>, cascade: u32) -> vec3<f32> {
|
|
128
|
+
let brick = probe_clipmap_hit_brick(position, cascade);
|
|
129
|
+
|
|
130
|
+
if (!brick_clipmap_entry_holds_slot(brick.entry)) {
|
|
131
|
+
return vec3<f32>(0.0);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
let seen = brick_material_metal_rough(brick.entry, brick.local, normal);
|
|
135
|
+
|
|
136
|
+
return vec3<f32>(seen.metal_rough, select(0.0, 1.0, seen.found));
|
|
137
|
+
}
|
|
138
|
+
`, [brick_at, chunk_brick_clipmap, chunk_brick_material_metal_rough]);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the fused indirect pass writes of a pixel's indirect light, by {@link PROBE_CLIPMAP_INDIRECT_LOBE}:
|
|
3
|
+
*
|
|
4
|
+
* ```wgsl
|
|
5
|
+
* fn probe_clipmap_indirect_lobe(
|
|
6
|
+
* specular: vec3<f32>, // the radiance resolved by the surface's material and occluded
|
|
7
|
+
* diffuse: vec3<f32>, // the irradiance resolved by the surface's material and occluded
|
|
8
|
+
* radiance: vec3<f32>, // the probes' radiance along the surface's lobe, as sampled
|
|
9
|
+
* irradiance: vec3<f32>, // the probes' irradiance at the bent normal, as sampled
|
|
10
|
+
* ) -> vec3<f32>
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* - `Both`, the default: `specular + diffuse`, what the frame adds.
|
|
14
|
+
* - `Diffuse`: `irradiance / π`, the light alone, in radiance units: what a white Lambertian surface would send back.
|
|
15
|
+
* - `Specular`: `radiance`, the light alone.
|
|
16
|
+
*
|
|
17
|
+
* @type {CodeChunkChoice}
|
|
18
|
+
*/
|
|
19
|
+
export const chunk_probe_clipmap_indirect_lobe: CodeChunkChoice;
|
|
20
|
+
import { CodeChunkChoice } from "../../../shader/compiler/CodeChunkChoice.js";
|
|
21
|
+
//# sourceMappingURL=chunk_probe_clipmap_indirect_lobe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk_probe_clipmap_indirect_lobe.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_indirect_lobe.js"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;GAiBG;AACH,gDAFU,eAAe,CAE0E;gCAvBnE,6CAA6C"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
|
|
2
|
+
import { CodeChunkChoice } from "../../../shader/compiler/CodeChunkChoice.js";
|
|
3
|
+
import { RECIPROCAL_PI_DECLARATION } from "../../../shader/chunk/math/RECIPROCAL_PI_DECLARATION.js";
|
|
4
|
+
import { PROBE_CLIPMAP_INDIRECT_LOBE } from "./PROBE_CLIPMAP_INDIRECT_LOBE.js";
|
|
5
|
+
import { ProbeClipmapIndirectLobe } from "./ProbeClipmapIndirectLobe.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* What the fused indirect pass writes of a pixel's indirect light, by {@link PROBE_CLIPMAP_INDIRECT_LOBE}:
|
|
9
|
+
*
|
|
10
|
+
* ```wgsl
|
|
11
|
+
* fn probe_clipmap_indirect_lobe(
|
|
12
|
+
* specular: vec3<f32>, // the radiance resolved by the surface's material and occluded
|
|
13
|
+
* diffuse: vec3<f32>, // the irradiance resolved by the surface's material and occluded
|
|
14
|
+
* radiance: vec3<f32>, // the probes' radiance along the surface's lobe, as sampled
|
|
15
|
+
* irradiance: vec3<f32>, // the probes' irradiance at the bent normal, as sampled
|
|
16
|
+
* ) -> vec3<f32>
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* - `Both`, the default: `specular + diffuse`, what the frame adds.
|
|
20
|
+
* - `Diffuse`: `irradiance / π`, the light alone, in radiance units: what a white Lambertian surface would send back.
|
|
21
|
+
* - `Specular`: `radiance`, the light alone.
|
|
22
|
+
*
|
|
23
|
+
* @type {CodeChunkChoice}
|
|
24
|
+
*/
|
|
25
|
+
export const chunk_probe_clipmap_indirect_lobe = CodeChunkChoice.from(PROBE_CLIPMAP_INDIRECT_LOBE);
|
|
26
|
+
|
|
27
|
+
chunk_probe_clipmap_indirect_lobe.add(ProbeClipmapIndirectLobe.Both, CodeChunk.from(
|
|
28
|
+
//language=WGSL
|
|
29
|
+
`
|
|
30
|
+
fn probe_clipmap_indirect_lobe(specular: vec3<f32>, diffuse: vec3<f32>, radiance: vec3<f32>, irradiance: vec3<f32>) -> vec3<f32> {
|
|
31
|
+
return specular + diffuse;
|
|
32
|
+
}
|
|
33
|
+
`));
|
|
34
|
+
|
|
35
|
+
chunk_probe_clipmap_indirect_lobe.add(ProbeClipmapIndirectLobe.Diffuse, CodeChunk.from(
|
|
36
|
+
//language=WGSL
|
|
37
|
+
`
|
|
38
|
+
fn probe_clipmap_indirect_lobe(specular: vec3<f32>, diffuse: vec3<f32>, radiance: vec3<f32>, irradiance: vec3<f32>) -> vec3<f32> {
|
|
39
|
+
return irradiance * RECIPROCAL_PI;
|
|
40
|
+
}
|
|
41
|
+
`, [RECIPROCAL_PI_DECLARATION]));
|
|
42
|
+
|
|
43
|
+
chunk_probe_clipmap_indirect_lobe.add(ProbeClipmapIndirectLobe.Specular, CodeChunk.from(
|
|
44
|
+
//language=WGSL
|
|
45
|
+
`
|
|
46
|
+
fn probe_clipmap_indirect_lobe(specular: vec3<f32>, diffuse: vec3<f32>, radiance: vec3<f32>, irradiance: vec3<f32>) -> vec3<f32> {
|
|
47
|
+
return radiance;
|
|
48
|
+
}
|
|
49
|
+
`));
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.d.ts
CHANGED
|
@@ -37,6 +37,8 @@ export const PROBE_DEPTH_SAMPLER_RESOURCE: ShaderResourceDescriptor;
|
|
|
37
37
|
* fn probe_clipmap_depth_moments_in(sampling, depth, slot: u32, direction: vec3<f32>) -> vec2<f32>
|
|
38
38
|
* ```
|
|
39
39
|
*
|
|
40
|
+
* - **The cascade**: `probe_clipmap_select_in` by the sampling's `anchor` and `select_half`, as want takes it:
|
|
41
|
+
* boxes on the anchor, so the blend between cascades moves with the anchor, not a window's step at a time.
|
|
40
42
|
* - **The cage**: `probe_clipmap_cage_in` along mix(n, v, 0.2), as want takes it, so a pixel reads the
|
|
41
43
|
* probes it wanted.
|
|
42
44
|
* - **The weights**, visibility only, of the cage's eight corners: a corner without an ALIVE probe weighs
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_probe_clipmap_pick.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.js"],"names":[],"mappings":"AA8BA;;;;GAIG;AACH,oCAFU,YAAY,
|
|
1
|
+
{"version":3,"file":"chunk_probe_clipmap_pick.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.js"],"names":[],"mappings":"AA8BA;;;;GAIG;AACH,oCAFU,YAAY,CA2BF;AAEpB;;;GAGG;AACH,sCAFU,wBAAwB,CAE+E;AAEjH;;;GAGG;AACH,8CAFU,wBAAwB,CAEiF;AAEnH;;;GAGG;AACH,6CAFU,iBAAiB,CAQvB;AAEJ;;;GAGG;AACH,2CAFU,wBAAwB,CAE+G;AAOjJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,0CAFU,SAAS,CAiMhB;AAIH;;;;;;;;;;;;;;;;GAgBG;AACH,uCAFU,SAAS,CA0BhB;AASH;;;;;;;GAOG;AACH,2CAFU,6BAA6B,CAWG;6BAzXb,sCAAsC;yCAH1B,sDAAsD;kCAb7D,qDAAqD;0BAY7D,uCAAuC;8CAEnB,2DAA2D"}
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { SamplerDescriptor } from "../../../../descriptor/texture/SamplerDescriptor.js";
|
|
2
|
-
import { chunk_clipmap_select_finest } from "../../../shader/chunk/clipmap/chunk_clipmap_select_finest.js";
|
|
3
2
|
import { CLIPMAP_LEVEL_ARRAY } from "../../../shader/chunk/clipmap/CLIPMAP_LEVEL_STRUCT.js";
|
|
4
3
|
import {
|
|
5
4
|
chunk_uv_octahedral_unit_encode
|
|
@@ -14,7 +13,7 @@ import {
|
|
|
14
13
|
import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
|
|
15
14
|
import { ShaderResourceDescriptor } from "../../../shader/resource/ShaderResourceDescriptor.js";
|
|
16
15
|
import { ShaderResourceGroupDescriptor } from "../../../shader/resource/ShaderResourceGroupDescriptor.js";
|
|
17
|
-
import { f32, u32, vec2f } from "../../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
|
|
16
|
+
import { f32, u32, vec2f, vec3f } from "../../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
|
|
18
17
|
import { WebGPUStruct } from "../../../shader/type/WebGPUStruct.js";
|
|
19
18
|
import {
|
|
20
19
|
chunk_probe_clipmap,
|
|
@@ -26,6 +25,7 @@ import {
|
|
|
26
25
|
PROBE_STATES_READ_RESOURCE
|
|
27
26
|
} from "./chunk_probe_clipmap.js";
|
|
28
27
|
import { chunk_probe_clipmap_cage_in } from "./chunk_probe_clipmap_cage.js";
|
|
28
|
+
import { chunk_probe_clipmap_select_in } from "./chunk_probe_clipmap_select.js";
|
|
29
29
|
import { PROBE_RECEIVER_BIAS_VIEW } from "./PROBE_CLIPMAP.js";
|
|
30
30
|
|
|
31
31
|
/**
|
|
@@ -54,6 +54,10 @@ export const PROBE_SAMPLING_STRUCT = WebGPUStruct.from({
|
|
|
54
54
|
radiance_texel: vec2f,
|
|
55
55
|
/** one over the radiance atlas's tiles a row, rounded to f32 */
|
|
56
56
|
radiance_tiles_per_row_reciprocal: f32,
|
|
57
|
+
/** where the windows were placed around, world metres: the selection boxes' centre */
|
|
58
|
+
anchor: vec3f,
|
|
59
|
+
/** a selection box's half side, in its cascade's cells */
|
|
60
|
+
select_half: f32,
|
|
57
61
|
}, "ProbeSampling");
|
|
58
62
|
|
|
59
63
|
/**
|
|
@@ -104,6 +108,8 @@ const RECORDS = `ptr<storage, array<${PROBE_RECORD_STRUCT.wgsl_ref}>, read>`;
|
|
|
104
108
|
* fn probe_clipmap_depth_moments_in(sampling, depth, slot: u32, direction: vec3<f32>) -> vec2<f32>
|
|
105
109
|
* ```
|
|
106
110
|
*
|
|
111
|
+
* - **The cascade**: `probe_clipmap_select_in` by the sampling's `anchor` and `select_half`, as want takes it:
|
|
112
|
+
* boxes on the anchor, so the blend between cascades moves with the anchor, not a window's step at a time.
|
|
107
113
|
* - **The cage**: `probe_clipmap_cage_in` along mix(n, v, 0.2), as want takes it, so a pixel reads the
|
|
108
114
|
* probes it wanted.
|
|
109
115
|
* - **The weights**, visibility only, of the cage's eight corners: a corner without an ALIVE probe weighs
|
|
@@ -240,7 +246,7 @@ fn probe_clipmap_pick_in(levels: ${LEVELS}, sampling: ${SAMPLING}, indirection:
|
|
|
240
246
|
var out: ProbeClipmapPick;
|
|
241
247
|
|
|
242
248
|
let count = (*sampling).cascade_count;
|
|
243
|
-
let selection =
|
|
249
|
+
let selection = probe_clipmap_select_in(levels, count, (*sampling).anchor, (*sampling).select_half, position);
|
|
244
250
|
|
|
245
251
|
if (selection.level == CLIPMAP_LEVEL_NONE) {
|
|
246
252
|
return out;
|
|
@@ -305,7 +311,7 @@ fn probe_clipmap_sh_in(records: ${RECORDS}, pick: ProbeClipmapPick) -> ProbeClip
|
|
|
305
311
|
}
|
|
306
312
|
`, [
|
|
307
313
|
chunk_probe_clipmap,
|
|
308
|
-
|
|
314
|
+
chunk_probe_clipmap_select_in,
|
|
309
315
|
chunk_probe_clipmap_cage_in,
|
|
310
316
|
chunk_index_to_grid2d_reciprocal,
|
|
311
317
|
chunk_uv_octahedral_unit_encode,
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_select.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The cascade a point reads, and how far into its blend skirt it is (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §9.1,
|
|
3
|
+
* "Selection"), in the clipmap whose levels `levels` points at. Want takes it to choose the cascades a pixel
|
|
4
|
+
* wants, and the pick to read them.
|
|
5
|
+
*
|
|
6
|
+
* ```wgsl
|
|
7
|
+
* fn probe_clipmap_select_in(levels: ptr<uniform, ClipmapLevelArray>, count: u32, anchor: vec3<f32>, select_half: f32, position: vec3<f32>) -> ClipmapSelection
|
|
8
|
+
* ```
|
|
9
|
+
*
|
|
10
|
+
* Each cascade's selection box is centred on the `anchor` the windows were placed around, `select_half` of the
|
|
11
|
+
* cascade's cells to a side. The finest of the first `count` cascades whose box holds the point answers, its
|
|
12
|
+
* `edge_weight` rising from 0 at {@link PROBE_BLEND_SKIRT} cells inside the box's nearest face to 1 on it: the
|
|
13
|
+
* share the next coarser cascade takes. A point no box holds answers `CLIPMAP_LEVEL_NONE`, with a weight of 0.
|
|
14
|
+
*
|
|
15
|
+
* The boxes follow the anchor, not the windows' corners, which move a whole step at a time: a point's weight
|
|
16
|
+
* moves as far as the anchor did over the skirt's depth, never a step's worth in one frame.
|
|
17
|
+
*
|
|
18
|
+
* @type {CodeChunk}
|
|
19
|
+
*/
|
|
20
|
+
export const chunk_probe_clipmap_select_in: CodeChunk;
|
|
21
|
+
import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
|
|
22
|
+
//# sourceMappingURL=chunk_probe_clipmap_select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk_probe_clipmap_select.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_select.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;GAkBG;AACH,4CAFU,SAAS,CA2BhB;0BA/CuB,uCAAuC"}
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_select.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { chunk_clipmap_select_finest } from "../../../shader/chunk/clipmap/chunk_clipmap_select_finest.js";
|
|
2
|
+
import { CLIPMAP_LEVEL_ARRAY, CLIPMAP_LEVEL_LIMIT } from "../../../shader/chunk/clipmap/CLIPMAP_LEVEL_STRUCT.js";
|
|
3
|
+
import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
|
|
4
|
+
import { PROBE_BLEND_SKIRT } from "./PROBE_CLIPMAP.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The cascade a point reads, and how far into its blend skirt it is (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §9.1,
|
|
8
|
+
* "Selection"), in the clipmap whose levels `levels` points at. Want takes it to choose the cascades a pixel
|
|
9
|
+
* wants, and the pick to read them.
|
|
10
|
+
*
|
|
11
|
+
* ```wgsl
|
|
12
|
+
* fn probe_clipmap_select_in(levels: ptr<uniform, ClipmapLevelArray>, count: u32, anchor: vec3<f32>, select_half: f32, position: vec3<f32>) -> ClipmapSelection
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* Each cascade's selection box is centred on the `anchor` the windows were placed around, `select_half` of the
|
|
16
|
+
* cascade's cells to a side. The finest of the first `count` cascades whose box holds the point answers, its
|
|
17
|
+
* `edge_weight` rising from 0 at {@link PROBE_BLEND_SKIRT} cells inside the box's nearest face to 1 on it: the
|
|
18
|
+
* share the next coarser cascade takes. A point no box holds answers `CLIPMAP_LEVEL_NONE`, with a weight of 0.
|
|
19
|
+
*
|
|
20
|
+
* The boxes follow the anchor, not the windows' corners, which move a whole step at a time: a point's weight
|
|
21
|
+
* moves as far as the anchor did over the skirt's depth, never a step's worth in one frame.
|
|
22
|
+
*
|
|
23
|
+
* @type {CodeChunk}
|
|
24
|
+
*/
|
|
25
|
+
export const chunk_probe_clipmap_select_in = CodeChunk.from(
|
|
26
|
+
//language=WGSL
|
|
27
|
+
`
|
|
28
|
+
fn probe_clipmap_select_in(levels: ptr<uniform, ${CLIPMAP_LEVEL_ARRAY.wgsl_ref}>, count: u32, anchor: vec3<f32>, select_half: f32, position: vec3<f32>) -> ClipmapSelection {
|
|
29
|
+
let offset = abs(position - anchor);
|
|
30
|
+
let reach = max(max(offset.x, offset.y), offset.z);
|
|
31
|
+
|
|
32
|
+
for (var i = 0u; i < ${CLIPMAP_LEVEL_LIMIT}u; i++) {
|
|
33
|
+
if (i >= count) {
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// the point's depth inside the box, in the cascade's cells
|
|
38
|
+
let edge = select_half - reach / (*levels)[i].cell_size;
|
|
39
|
+
|
|
40
|
+
if (edge >= 0.0) {
|
|
41
|
+
return ClipmapSelection(i, saturate(1.0 - edge / ${PROBE_BLEND_SKIRT}.0));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return ClipmapSelection(CLIPMAP_LEVEL_NONE, 0.0);
|
|
46
|
+
}
|
|
47
|
+
`, [
|
|
48
|
+
// ClipmapSelection and CLIPMAP_LEVEL_NONE
|
|
49
|
+
chunk_clipmap_select_finest,
|
|
50
|
+
]);
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.d.ts
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
* for want's pixels and the hits' wants alike.
|
|
4
4
|
*
|
|
5
5
|
* ```wgsl
|
|
6
|
-
* fn probe_clipmap_want(wants: bool, position: vec3<f32>, bias_direction: vec3<f32>, cascade_count: u32, resolution: u32, wanted_capacity: u32)
|
|
6
|
+
* fn probe_clipmap_want(wants: bool, position: vec3<f32>, bias_direction: vec3<f32>, cascade_count: u32, resolution: u32, anchor: vec3<f32>, select_half: f32, wanted_capacity: u32)
|
|
7
7
|
* ```
|
|
8
8
|
*
|
|
9
|
-
* The cages are the pick's: the
|
|
10
|
-
*
|
|
11
|
-
* cascade's cage too, biased by its own. A cage a bias moved out of its window is not wanted. Each cage
|
|
9
|
+
* The cages are the pick's: the cascade `probe_clipmap_select_in` answers for the point, by the windows'
|
|
10
|
+
* `anchor` and `select_half` as the pick reads them, the cage of the point biased along `bias_direction` by
|
|
11
|
+
* that cascade's spacing, and in the cascade's blend skirt the next cascade's cage too, biased by its own. A cage a bias moved out of its window is not wanted. Each cage
|
|
12
12
|
* point's bit is set, and a point whose bit was clear goes on the wanted list by its key, so the list
|
|
13
13
|
* holds every point wanted this frame once.
|
|
14
14
|
*
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_probe_clipmap_want.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.js"],"names":[],"mappings":"AA0BA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,uCAFU,SAAS,CAgFZ;
|
|
1
|
+
{"version":3,"file":"chunk_probe_clipmap_want.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.js"],"names":[],"mappings":"AA0BA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,uCAFU,SAAS,CAgFZ;0BA9HmB,uCAAuC"}
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { chunk_collection_u32_append } from "../../../gpu_primitive/chunk_collection_u32_append.js";
|
|
2
|
-
import { chunk_clipmap_select_finest } from "../../../shader/chunk/clipmap/chunk_clipmap_select_finest.js";
|
|
3
2
|
import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
|
|
4
3
|
import {
|
|
5
4
|
chunk_probe_clipmap,
|
|
@@ -8,6 +7,7 @@ import {
|
|
|
8
7
|
PROBE_WANTED_WRITE_RESOURCE
|
|
9
8
|
} from "./chunk_probe_clipmap.js";
|
|
10
9
|
import { chunk_probe_clipmap_cage } from "./chunk_probe_clipmap_cage.js";
|
|
10
|
+
import { chunk_probe_clipmap_select_in } from "./chunk_probe_clipmap_select.js";
|
|
11
11
|
import { PROBE_THREAD_WORKGROUP_SIZE } from "./PROBE_CLIPMAP.js";
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -29,12 +29,12 @@ const WANT_CLAIM_PROBES = 16;
|
|
|
29
29
|
* for want's pixels and the hits' wants alike.
|
|
30
30
|
*
|
|
31
31
|
* ```wgsl
|
|
32
|
-
* fn probe_clipmap_want(wants: bool, position: vec3<f32>, bias_direction: vec3<f32>, cascade_count: u32, resolution: u32, wanted_capacity: u32)
|
|
32
|
+
* fn probe_clipmap_want(wants: bool, position: vec3<f32>, bias_direction: vec3<f32>, cascade_count: u32, resolution: u32, anchor: vec3<f32>, select_half: f32, wanted_capacity: u32)
|
|
33
33
|
* ```
|
|
34
34
|
*
|
|
35
|
-
* The cages are the pick's: the
|
|
36
|
-
*
|
|
37
|
-
* cascade's cage too, biased by its own. A cage a bias moved out of its window is not wanted. Each cage
|
|
35
|
+
* The cages are the pick's: the cascade `probe_clipmap_select_in` answers for the point, by the windows'
|
|
36
|
+
* `anchor` and `select_half` as the pick reads them, the cage of the point biased along `bias_direction` by
|
|
37
|
+
* that cascade's spacing, and in the cascade's blend skirt the next cascade's cage too, biased by its own. A cage a bias moved out of its window is not wanted. Each cage
|
|
38
38
|
* point's bit is set, and a point whose bit was clear goes on the wanted list by its key, so the list
|
|
39
39
|
* holds every point wanted this frame once.
|
|
40
40
|
*
|
|
@@ -80,8 +80,8 @@ fn probe_want_claim(key: u32) -> bool {
|
|
|
80
80
|
return true;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
fn probe_clipmap_want(wants: bool, position: vec3<f32>, bias_direction: vec3<f32>, cascade_count: u32, resolution: u32, wanted_capacity: u32) {
|
|
84
|
-
let selection =
|
|
83
|
+
fn probe_clipmap_want(wants: bool, position: vec3<f32>, bias_direction: vec3<f32>, cascade_count: u32, resolution: u32, anchor: vec3<f32>, select_half: f32, wanted_capacity: u32) {
|
|
84
|
+
let selection = probe_clipmap_select_in(&probe_levels, cascade_count, anchor, select_half, position);
|
|
85
85
|
|
|
86
86
|
let held = wants && selection.level != CLIPMAP_LEVEL_NONE;
|
|
87
87
|
let finest = select(0u, selection.level, held);
|
|
@@ -122,7 +122,7 @@ fn probe_clipmap_want(wants: bool, position: vec3<f32>, bias_direction: vec3<f32
|
|
|
122
122
|
}
|
|
123
123
|
`, [
|
|
124
124
|
chunk_probe_clipmap,
|
|
125
|
-
|
|
125
|
+
chunk_probe_clipmap_select_in,
|
|
126
126
|
chunk_probe_clipmap_cage,
|
|
127
127
|
chunk_collection_u32_append,
|
|
128
128
|
]);
|