@woosh/meep-engine 3.61.1 → 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/network/sim/SimActionExecutor.d.ts +4 -0
- package/src/engine/network/sim/SimActionExecutor.d.ts.map +1 -1
- package/src/engine/network/sim/SimActionExecutor.js +4 -0
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/generation/foliage/material/foliage_atlas_cutout.d.ts.map +1 -1
- package/src/generation/foliage/material/foliage_atlas_cutout.js +21 -5
- package/src/generation/foliage/mesh/tree_cluster_representatives.d.ts +8 -0
- package/src/generation/foliage/mesh/tree_cluster_representatives.d.ts.map +1 -1
- package/src/generation/foliage/mesh/tree_cluster_representatives.js +178 -78
- package/src/generation/foliage/mesh/tree_mesh_build_bark.d.ts.map +1 -1
- package/src/generation/foliage/mesh/tree_mesh_build_bark.js +178 -97
- package/src/generation/foliage/skeleton/ShootLightField.d.ts +1 -0
- package/src/generation/foliage/skeleton/ShootLightField.d.ts.map +1 -1
- package/src/generation/foliage/skeleton/ShootLightField.js +88 -17
- package/src/generation/foliage/skeleton/ShootWoodHash.d.ts +5 -2
- package/src/generation/foliage/skeleton/ShootWoodHash.d.ts.map +1 -1
- package/src/generation/foliage/skeleton/ShootWoodHash.js +191 -25
- 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 +4 -5
- package/src/shade/playground/probe_clipmap_box/README.md +55 -0
- package/src/shade/playground/probe_clipmap_box/index.html +185 -0
- package/src/shade/playground/probe_clipmap_box/main.d.ts +8 -0
- package/src/shade/playground/probe_clipmap_box/main.d.ts.map +1 -0
- package/src/shade/playground/probe_clipmap_box/main.js +323 -0
- package/src/shade/playground/probe_clipmap_box/scene.d.ts +93 -0
- package/src/shade/playground/probe_clipmap_box/scene.d.ts.map +1 -0
- package/src/shade/playground/probe_clipmap_box/scene.js +256 -0
- package/src/shade/renderer/Renderer.d.ts.map +1 -1
- package/src/shade/renderer/Renderer.js +56 -12
- 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/brick4/gpu/encoding/v2/chunk_brick4_sh3_color_decode.d.ts +12 -0
- package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v2/chunk_brick4_sh3_color_decode.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v2/chunk_brick4_sh3_color_decode.js +49 -24
- package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v2/chunk_brick4_sh3_color_encode.d.ts +12 -0
- package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v2/chunk_brick4_sh3_color_encode.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v2/chunk_brick4_sh3_color_encode.js +50 -19
- package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v2/chunk_sh3_compress.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v2/chunk_sh3_compress.js +6 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts +20 -8
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.js +89 -20
- 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 +23 -12
- 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 +72 -52
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.d.ts +32 -0
- 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 +37 -0
- 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 +55 -23
- 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 +134 -69
- 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 +4 -3
- 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 +19 -24
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_sample_radiance.d.ts +2 -2
- 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 +14 -19
- 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_accumulate.d.ts +1 -1
- 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 +8 -4
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_admit.js +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_bounce.d.ts +5 -4
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_bounce.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_bounce.js +18 -23
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_candidate.d.ts +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_candidate.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_candidate.js +4 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_diffuse.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_diffuse.js +4 -6
- 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 +9 -8
- 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_project.d.ts +4 -3
- 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 +14 -13
- 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 -6
- 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 +19 -21
- 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/light/environment/shader_downsample_environment_map.d.ts.map +1 -1
- package/src/shade/renderer/light/environment/shader_downsample_environment_map.js +5 -1
- 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/eye/GPUCameraExposureManager.d.ts +26 -8
- package/src/shade/renderer/postprocess/eye/GPUCameraExposureManager.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/eye/GPUCameraExposureManager.js +170 -142
- package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
- package/src/shade/renderer/rasterize/forward/chunk_forward_sample_indirect_probe_clipmap.d.ts +1 -1
- package/src/shade/renderer/rasterize/forward/chunk_forward_sample_indirect_probe_clipmap.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/forward/chunk_forward_sample_indirect_probe_clipmap.js +5 -8
- 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/filter/chunk_multiscale_mean.d.ts +15 -4
- package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.js +33 -7
- 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/noise/chunk_sobol_sample_vec2.d.ts +40 -0
- package/src/shade/renderer/shader/chunk/noise/chunk_sobol_sample_vec2.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/noise/chunk_sobol_sample_vec2.js +75 -0
- package/src/shade/renderer/shader/chunk/noise/chunk_vdc_radical_inverse.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/noise/chunk_vdc_radical_inverse.js +3 -1
- package/src/shade/renderer/shader/chunk/random/chunk_hash_lk.d.ts +28 -0
- package/src/shade/renderer/shader/chunk/random/chunk_hash_lk.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/random/chunk_hash_lk.js +41 -0
- package/src/shade/renderer/shader/chunk/spherical_harmonics/chunk_sh3_color_add_scaled.d.ts +12 -0
- package/src/shade/renderer/shader/chunk/spherical_harmonics/chunk_sh3_color_add_scaled.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/spherical_harmonics/chunk_sh3_color_add_scaled.js +24 -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/irradiance_clipmap/GPUIrradianceClipmap.d.ts +3 -2
- package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.js +4 -0
- package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_gi_sample.d.ts +2 -5
- package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_gi_sample.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_gi_sample.js +3 -20
- 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/chunk_water_gi.d.ts +1 -1
- package/src/shade/renderer/water/chunk_water_gi.d.ts.map +1 -1
- package/src/shade/renderer/water/chunk_water_gi.js +6 -8
- package/src/shade/renderer/water/query/GPUWaterQueries.d.ts +1 -1
- package/src/shade/renderer/wind/GPUSceneWind.d.ts +1 -1
- package/src/shade/wgsl/emulator/WGSLLanguageCore.d.ts.map +1 -1
- package/src/shade/wgsl/emulator/WGSLLanguageCore.js +76 -32
- package/src/core/math/hash/squirrel3.d.ts +0 -17
- package/src/core/math/hash/squirrel3.d.ts.map +0 -1
- package/src/core/math/hash/squirrel3.js +0 -30
- 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
- package/src/shade/renderer/shader/chunk/random/chunk_hash_squirrel3.d.ts +0 -12
- package/src/shade/renderer/shader/chunk/random/chunk_hash_squirrel3.d.ts.map +0 -1
- package/src/shade/renderer/shader/chunk/random/chunk_hash_squirrel3.js +0 -30
package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot_compress.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { CodeChunk } from "../../../compiler/CodeChunk.js";
|
|
2
|
+
import { chunk_uv_octahedral_unit_decode } from "../../geometry/octahedron/chunk_uv_octahedral_unit_decode.js";
|
|
3
|
+
import { chunk_uv_octahedral_unit_encode } from "../../geometry/octahedron/chunk_uv_octahedral_unit_encode.js";
|
|
4
|
+
import { chunk_sh2_color_pivot } from "./chunk_sh2_color_pivot.js";
|
|
5
|
+
import {
|
|
6
|
+
chunk_sh2_color_pivot_uncompress,
|
|
7
|
+
SH2_COLOR_PIVOT_EXPONENT_BIAS,
|
|
8
|
+
SH2_COLOR_PIVOT_OCTAHEDRAL_BITS
|
|
9
|
+
} from "./chunk_sh2_color_pivot_uncompress.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* An {@link chunk_sh2_color_pivot} function whose value at the pivot is in [0, 1] per channel, an
|
|
13
|
+
* albedo, in 128 bits, laid out as `sh2_color_pivot_uncompress` reads them:
|
|
14
|
+
*
|
|
15
|
+
* ```wgsl
|
|
16
|
+
* fn sh2_color_pivot_compress(f: Sh2ColorPivot) -> vec4<u32>
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* - **The gradient** goes first: nine snorm8 codes over the least power of two at or above its largest
|
|
20
|
+
* component, so every code lies within ±127 and the largest one at or past 64.
|
|
21
|
+
* - **The pivot** goes next, octahedral, 12 bits a coordinate.
|
|
22
|
+
* - **The value** is then taken at the stored pivot, through the stored gradient: f(pivot′) =
|
|
23
|
+
* value + G′·(pivot′ − pivot). The function keeps its value at the given pivot up to the value's own
|
|
24
|
+
* code, whatever the pivot's quantization and however steep the gradient. The value is clamped to
|
|
25
|
+
* [0, 1] and stored as its square root, unorm8 a channel, which puts more codes in the dark, as
|
|
26
|
+
* `albedo_compress` stores an albedo.
|
|
27
|
+
*
|
|
28
|
+
* A code is never all zero: the exponent byte is at least 1, 1 for a zero gradient. A reader may take
|
|
29
|
+
* an all-zero `vec4<u32>` for no function at all.
|
|
30
|
+
*
|
|
31
|
+
* Nothing is deringed. A function fitted to one side of the sphere takes whatever values its other
|
|
32
|
+
* side gives, and a reader evaluates it near its pivot.
|
|
33
|
+
*
|
|
34
|
+
* @type {CodeChunk}
|
|
35
|
+
*/
|
|
36
|
+
export const chunk_sh2_color_pivot_compress = CodeChunk.from(
|
|
37
|
+
//language=WGSL
|
|
38
|
+
`
|
|
39
|
+
fn sh2_color_pivot_compress(f: Sh2ColorPivot) -> vec4<u32> {
|
|
40
|
+
let g = f.gradient;
|
|
41
|
+
let column_largest = max(max(abs(g[0]), abs(g[1])), abs(g[2]));
|
|
42
|
+
let largest = max(max(column_largest.x, column_largest.y), column_largest.z);
|
|
43
|
+
|
|
44
|
+
// ceil(log2) rounds a component just past a power of two up or down; pack4x8snorm clamps the one
|
|
45
|
+
// that lands a rounding past 1
|
|
46
|
+
let exponent = select(1i, clamp(i32(ceil(log2(largest))) + ${SH2_COLOR_PIVOT_EXPONENT_BIAS}i, 1i, 255i), largest > 0.0);
|
|
47
|
+
// the reciprocal is taken as its own power of two: 2^-127, the scale of byte 1, is subnormal
|
|
48
|
+
let inverse = exp2(f32(${SH2_COLOR_PIVOT_EXPONENT_BIAS}i - exponent));
|
|
49
|
+
|
|
50
|
+
let a = g[0] * inverse;
|
|
51
|
+
let b = g[1] * inverse;
|
|
52
|
+
let c = g[2] * inverse;
|
|
53
|
+
|
|
54
|
+
var code: vec4<u32>;
|
|
55
|
+
|
|
56
|
+
code.y = pack4x8snorm(vec4<f32>(a, b.x));
|
|
57
|
+
code.z = pack4x8snorm(vec4<f32>(b.yz, c.xy));
|
|
58
|
+
code.x = u32(exponent) << 24u;
|
|
59
|
+
|
|
60
|
+
let octahedral = vec2<u32>(round(saturate(uv_octahedral_unit_encode(f.pivot)) * ${2 ** SH2_COLOR_PIVOT_OCTAHEDRAL_BITS - 1}.0));
|
|
61
|
+
let pivot = uv_octahedral_unit_decode(vec2<f32>(octahedral) / ${2 ** SH2_COLOR_PIVOT_OCTAHEDRAL_BITS - 1}.0);
|
|
62
|
+
|
|
63
|
+
code.w = (pack4x8snorm(vec4<f32>(c.z, 0.0, 0.0, 0.0)) & 0xffu)
|
|
64
|
+
| (octahedral.x << 8u)
|
|
65
|
+
| (octahedral.y << ${8 + SH2_COLOR_PIVOT_OCTAHEDRAL_BITS}u);
|
|
66
|
+
|
|
67
|
+
// the value at the stored pivot, through the stored gradient
|
|
68
|
+
let value = f.value + sh2_color_pivot_uncompress_gradient(code) * (pivot - f.pivot);
|
|
69
|
+
|
|
70
|
+
code.x |= pack4x8unorm(vec4<f32>(sqrt(saturate(value)), 0.0));
|
|
71
|
+
|
|
72
|
+
return code;
|
|
73
|
+
}
|
|
74
|
+
`, [
|
|
75
|
+
chunk_sh2_color_pivot,
|
|
76
|
+
chunk_sh2_color_pivot_uncompress,
|
|
77
|
+
chunk_uv_octahedral_unit_encode,
|
|
78
|
+
chunk_uv_octahedral_unit_decode,
|
|
79
|
+
]);
|
package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot_fit.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An {@link chunk_sh2_color_pivot} function fitted to weighted samples of it, a color at a unit normal
|
|
3
|
+
* each:
|
|
4
|
+
*
|
|
5
|
+
* ```wgsl
|
|
6
|
+
* fn sh2_color_pivot_fit_add(fit: ptr<function, Sh2ColorPivotFit>, weight: f32, normal: vec3<f32>, color: vec3<f32>)
|
|
7
|
+
* fn sh2_color_pivot_fit_solve(fit: Sh2ColorPivotFit, noise: f32) -> Sh2ColorPivot
|
|
8
|
+
* ```
|
|
9
|
+
*
|
|
10
|
+
* Weighted least squares, which written about the samples' mean normal n̄ is the regression of color on
|
|
11
|
+
* normal, G = Cov(color, n)·Cov(n)⁻¹, stored about n̄'s direction with its value there. `noise`, above
|
|
12
|
+
* 0, is the variance of the normals' error along an axis, which goes on Cov(n)'s diagonal: a spread no
|
|
13
|
+
* larger than that is the normals' noise, and a slope read from it would turn the colors' contrast into
|
|
14
|
+
* a gradient as steep as the noise is small.
|
|
15
|
+
*
|
|
16
|
+
* The sums are raw moments, so samples add in any order and a fit can be split and joined. Their
|
|
17
|
+
* cancellation in f32 is about 1e-7 of a unit normal's square: a noise under that is lost to it.
|
|
18
|
+
*
|
|
19
|
+
* A fit of no weight is the zero function about +z.
|
|
20
|
+
*
|
|
21
|
+
* @type {CodeChunk}
|
|
22
|
+
*/
|
|
23
|
+
export const chunk_sh2_color_pivot_fit: CodeChunk;
|
|
24
|
+
import { CodeChunk } from "../../../compiler/CodeChunk.js";
|
|
25
|
+
//# sourceMappingURL=chunk_sh2_color_pivot_fit.d.ts.map
|
package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot_fit.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk_sh2_color_pivot_fit.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot_fit.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wCAFU,SAAS,CAgEZ;0BAxFmB,gCAAgC"}
|
package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot_fit.js
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { CodeChunk } from "../../../compiler/CodeChunk.js";
|
|
2
|
+
import { chunk_mat3_inverse } from "../../geometry/mat3/chunk_mat3_inverse.js";
|
|
3
|
+
import { chunk_sh2_color_pivot } from "./chunk_sh2_color_pivot.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* An {@link chunk_sh2_color_pivot} function fitted to weighted samples of it, a color at a unit normal
|
|
7
|
+
* each:
|
|
8
|
+
*
|
|
9
|
+
* ```wgsl
|
|
10
|
+
* fn sh2_color_pivot_fit_add(fit: ptr<function, Sh2ColorPivotFit>, weight: f32, normal: vec3<f32>, color: vec3<f32>)
|
|
11
|
+
* fn sh2_color_pivot_fit_solve(fit: Sh2ColorPivotFit, noise: f32) -> Sh2ColorPivot
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* Weighted least squares, which written about the samples' mean normal n̄ is the regression of color on
|
|
15
|
+
* normal, G = Cov(color, n)·Cov(n)⁻¹, stored about n̄'s direction with its value there. `noise`, above
|
|
16
|
+
* 0, is the variance of the normals' error along an axis, which goes on Cov(n)'s diagonal: a spread no
|
|
17
|
+
* larger than that is the normals' noise, and a slope read from it would turn the colors' contrast into
|
|
18
|
+
* a gradient as steep as the noise is small.
|
|
19
|
+
*
|
|
20
|
+
* The sums are raw moments, so samples add in any order and a fit can be split and joined. Their
|
|
21
|
+
* cancellation in f32 is about 1e-7 of a unit normal's square: a noise under that is lost to it.
|
|
22
|
+
*
|
|
23
|
+
* A fit of no weight is the zero function about +z.
|
|
24
|
+
*
|
|
25
|
+
* @type {CodeChunk}
|
|
26
|
+
*/
|
|
27
|
+
export const chunk_sh2_color_pivot_fit = CodeChunk.from(
|
|
28
|
+
//language=WGSL
|
|
29
|
+
`
|
|
30
|
+
struct Sh2ColorPivotFit {
|
|
31
|
+
weight: f32,
|
|
32
|
+
/** the weighted sums of the samples' normals and colors */
|
|
33
|
+
normal: vec3<f32>,
|
|
34
|
+
color: vec3<f32>,
|
|
35
|
+
/** Σ w n nᵀ */
|
|
36
|
+
normal_normal: mat3x3<f32>,
|
|
37
|
+
/** Σ w c nᵀ: a column a normal axis, its RGB */
|
|
38
|
+
color_normal: mat3x3<f32>,
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
fn sh2_color_pivot_fit_add(fit: ptr<function, Sh2ColorPivotFit>, weight: f32, normal: vec3<f32>, color: vec3<f32>) {
|
|
42
|
+
let wn = weight * normal;
|
|
43
|
+
let wc = weight * color;
|
|
44
|
+
|
|
45
|
+
(*fit).weight += weight;
|
|
46
|
+
(*fit).normal += wn;
|
|
47
|
+
(*fit).color += wc;
|
|
48
|
+
(*fit).normal_normal += mat3x3<f32>(wn * normal.x, wn * normal.y, wn * normal.z);
|
|
49
|
+
(*fit).color_normal += mat3x3<f32>(wc * normal.x, wc * normal.y, wc * normal.z);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
fn sh2_color_pivot_fit_solve(fit: Sh2ColorPivotFit, noise: f32) -> Sh2ColorPivot {
|
|
53
|
+
var out: Sh2ColorPivot;
|
|
54
|
+
|
|
55
|
+
out.pivot = vec3<f32>(0.0, 0.0, 1.0);
|
|
56
|
+
|
|
57
|
+
if (!(fit.weight > 0.0)) {
|
|
58
|
+
return out;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
let inverse_weight = 1.0 / fit.weight;
|
|
62
|
+
let mean_normal = fit.normal * inverse_weight;
|
|
63
|
+
let mean_color = fit.color * inverse_weight;
|
|
64
|
+
|
|
65
|
+
// per unit weight, about the means; the noise on the normals' diagonal
|
|
66
|
+
let covariance = fit.normal_normal * inverse_weight
|
|
67
|
+
- mat3x3<f32>(mean_normal * mean_normal.x, mean_normal * mean_normal.y, mean_normal * mean_normal.z)
|
|
68
|
+
+ mat3x3<f32>(vec3<f32>(noise, 0.0, 0.0), vec3<f32>(0.0, noise, 0.0), vec3<f32>(0.0, 0.0, noise));
|
|
69
|
+
let cross_covariance = fit.color_normal * inverse_weight
|
|
70
|
+
- mat3x3<f32>(mean_color * mean_normal.x, mean_color * mean_normal.y, mean_color * mean_normal.z);
|
|
71
|
+
|
|
72
|
+
let gradient = cross_covariance * mat3_inverse(covariance);
|
|
73
|
+
let reach = length(mean_normal);
|
|
74
|
+
|
|
75
|
+
// normals that cancel, as a thin wall's two faces do, leave no mean direction: then any unit normal
|
|
76
|
+
// is as good a pivot
|
|
77
|
+
if (reach > 0.0) {
|
|
78
|
+
out.pivot = mean_normal / reach;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
out.gradient = gradient;
|
|
82
|
+
out.value = mean_color + gradient * (out.pivot - mean_normal);
|
|
83
|
+
|
|
84
|
+
return out;
|
|
85
|
+
}
|
|
86
|
+
`, [
|
|
87
|
+
chunk_sh2_color_pivot,
|
|
88
|
+
chunk_mat3_inverse,
|
|
89
|
+
]);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the gradient's exponent byte is offset by: the gradient's scale is 2^(e − bias).
|
|
3
|
+
* @type {number}
|
|
4
|
+
*/
|
|
5
|
+
export const SH2_COLOR_PIVOT_EXPONENT_BIAS: number;
|
|
6
|
+
/**
|
|
7
|
+
* Bits of each of the pivot's two octahedral coordinates.
|
|
8
|
+
* @type {number}
|
|
9
|
+
*/
|
|
10
|
+
export const SH2_COLOR_PIVOT_OCTAHEDRAL_BITS: number;
|
|
11
|
+
/**
|
|
12
|
+
* An {@link chunk_sh2_color_pivot} function from the 128 bits `sh2_color_pivot_compress` wrote:
|
|
13
|
+
*
|
|
14
|
+
* ```wgsl
|
|
15
|
+
* fn sh2_color_pivot_uncompress(code: vec4<u32>) -> Sh2ColorPivot
|
|
16
|
+
* fn sh2_color_pivot_uncompress_gradient(code: vec4<u32>) -> mat3x3<f32>
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* The layout, a `vec4<u32>`:
|
|
20
|
+
* - `x`: the value at the pivot, its square root per channel as unorm8 in R, G, B; then the gradient's
|
|
21
|
+
* exponent byte e, never 0, its scale 2^(e − {@link SH2_COLOR_PIVOT_EXPONENT_BIAS}).
|
|
22
|
+
* - `y`, `z` and the low byte of `w`: nine snorm8 codes of the gradient over its scale, column by
|
|
23
|
+
* column: ∂/∂n_x as R, G, B, then ∂/∂n_y, then ∂/∂n_z.
|
|
24
|
+
* - `w` bits 8–31: the pivot, octahedral (`uv_octahedral_unit_encode`), {@link SH2_COLOR_PIVOT_OCTAHEDRAL_BITS}
|
|
25
|
+
* bits a coordinate, x then y.
|
|
26
|
+
*
|
|
27
|
+
* @type {CodeChunk}
|
|
28
|
+
*/
|
|
29
|
+
export const chunk_sh2_color_pivot_uncompress: CodeChunk;
|
|
30
|
+
import { CodeChunk } from "../../../compiler/CodeChunk.js";
|
|
31
|
+
//# sourceMappingURL=chunk_sh2_color_pivot_uncompress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk_sh2_color_pivot_uncompress.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot_uncompress.js"],"names":[],"mappings":"AAIA;;;GAGG;AACH,4CAFU,MAAM,CAEiC;AAEjD;;;GAGG;AACH,8CAFU,MAAM,CAEkC;AAElD;;;;;;;;;;;;;;;;;GAiBG;AACH,+CAFU,SAAS,CAiCZ;0BAjEmB,gCAAgC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { CodeChunk } from "../../../compiler/CodeChunk.js";
|
|
2
|
+
import { chunk_uv_octahedral_unit_decode } from "../../geometry/octahedron/chunk_uv_octahedral_unit_decode.js";
|
|
3
|
+
import { chunk_sh2_color_pivot } from "./chunk_sh2_color_pivot.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* What the gradient's exponent byte is offset by: the gradient's scale is 2^(e − bias).
|
|
7
|
+
* @type {number}
|
|
8
|
+
*/
|
|
9
|
+
export const SH2_COLOR_PIVOT_EXPONENT_BIAS = 128;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Bits of each of the pivot's two octahedral coordinates.
|
|
13
|
+
* @type {number}
|
|
14
|
+
*/
|
|
15
|
+
export const SH2_COLOR_PIVOT_OCTAHEDRAL_BITS = 12;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* An {@link chunk_sh2_color_pivot} function from the 128 bits `sh2_color_pivot_compress` wrote:
|
|
19
|
+
*
|
|
20
|
+
* ```wgsl
|
|
21
|
+
* fn sh2_color_pivot_uncompress(code: vec4<u32>) -> Sh2ColorPivot
|
|
22
|
+
* fn sh2_color_pivot_uncompress_gradient(code: vec4<u32>) -> mat3x3<f32>
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* The layout, a `vec4<u32>`:
|
|
26
|
+
* - `x`: the value at the pivot, its square root per channel as unorm8 in R, G, B; then the gradient's
|
|
27
|
+
* exponent byte e, never 0, its scale 2^(e − {@link SH2_COLOR_PIVOT_EXPONENT_BIAS}).
|
|
28
|
+
* - `y`, `z` and the low byte of `w`: nine snorm8 codes of the gradient over its scale, column by
|
|
29
|
+
* column: ∂/∂n_x as R, G, B, then ∂/∂n_y, then ∂/∂n_z.
|
|
30
|
+
* - `w` bits 8–31: the pivot, octahedral (`uv_octahedral_unit_encode`), {@link SH2_COLOR_PIVOT_OCTAHEDRAL_BITS}
|
|
31
|
+
* bits a coordinate, x then y.
|
|
32
|
+
*
|
|
33
|
+
* @type {CodeChunk}
|
|
34
|
+
*/
|
|
35
|
+
export const chunk_sh2_color_pivot_uncompress = CodeChunk.from(
|
|
36
|
+
//language=WGSL
|
|
37
|
+
`
|
|
38
|
+
fn sh2_color_pivot_uncompress_gradient(code: vec4<u32>) -> mat3x3<f32> {
|
|
39
|
+
let scale = exp2(f32(code.x >> 24u) - ${SH2_COLOR_PIVOT_EXPONENT_BIAS}.0);
|
|
40
|
+
|
|
41
|
+
let a = unpack4x8snorm(code.y) * scale;
|
|
42
|
+
let b = unpack4x8snorm(code.z) * scale;
|
|
43
|
+
let c = unpack4x8snorm(code.w & 0xffu).x * scale;
|
|
44
|
+
|
|
45
|
+
return mat3x3<f32>(a.xyz, vec3<f32>(a.w, b.xy), vec3<f32>(b.zw, c));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
fn sh2_color_pivot_uncompress(code: vec4<u32>) -> Sh2ColorPivot {
|
|
49
|
+
var f: Sh2ColorPivot;
|
|
50
|
+
|
|
51
|
+
let root = unpack4x8unorm(code.x).rgb;
|
|
52
|
+
let octahedral = vec2<u32>(
|
|
53
|
+
extractBits(code.w, 8u, ${SH2_COLOR_PIVOT_OCTAHEDRAL_BITS}u),
|
|
54
|
+
extractBits(code.w, ${8 + SH2_COLOR_PIVOT_OCTAHEDRAL_BITS}u, ${SH2_COLOR_PIVOT_OCTAHEDRAL_BITS}u)
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
f.value = root * root;
|
|
58
|
+
f.gradient = sh2_color_pivot_uncompress_gradient(code);
|
|
59
|
+
f.pivot = uv_octahedral_unit_decode(vec2<f32>(octahedral) / ${2 ** SH2_COLOR_PIVOT_OCTAHEDRAL_BITS - 1}.0);
|
|
60
|
+
|
|
61
|
+
return f;
|
|
62
|
+
}
|
|
63
|
+
`, [
|
|
64
|
+
chunk_sh2_color_pivot,
|
|
65
|
+
chunk_uv_octahedral_unit_decode,
|
|
66
|
+
]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_subgroup_atomic_add.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/shader/chunk/subgroup/chunk_subgroup_atomic_add.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AACH,wCAFU,SAAS,
|
|
1
|
+
{"version":3,"file":"chunk_subgroup_atomic_add.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/shader/chunk/subgroup/chunk_subgroup_atomic_add.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AACH,wCAFU,SAAS,CAehB;0BA3BuB,6BAA6B"}
|
|
@@ -16,6 +16,8 @@ import { CodeChunk } from "../../compiler/CodeChunk.js";
|
|
|
16
16
|
export const chunk_subgroup_atomic_add = CodeChunk.from(
|
|
17
17
|
//language=WGSL
|
|
18
18
|
`
|
|
19
|
+
// uniform in the subgroup by the caller's counter, which the analysis cannot see behind its returns
|
|
20
|
+
@diagnostic(off, subgroup_uniformity)
|
|
19
21
|
fn subgroup_atomic_add_u32(counter: ptr<storage, atomic<u32>, read_write>, value: u32) {
|
|
20
22
|
let total = subgroupAdd(value);
|
|
21
23
|
let elected = subgroupElect();
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Load an atomic every lane of the subgroup reads alike, once a subgroup: its first active lane
|
|
3
|
+
* loads it, and the subgroup hands every lane what that lane read. Lanes that each load the same
|
|
4
|
+
* atomic serialize where `atomicLoad` is a read-modify-write, as it is on D3D12
|
|
5
|
+
* (`InterlockedOr(x, 0)`); one load a subgroup does not.
|
|
6
|
+
*
|
|
7
|
+
* `fn subgroup_atomic_load_u32(word: ptr<storage, atomic<u32>, read_write>) -> u32`
|
|
8
|
+
*
|
|
9
|
+
* Every lane of the subgroup calls it with the same `word`, from subgroup-uniform control flow: a
|
|
10
|
+
* lane passing another word reads the first lane's.
|
|
11
|
+
*
|
|
12
|
+
* @see chunk_subgroup_atomic_add for the writing twin
|
|
13
|
+
* @type {CodeChunk}
|
|
14
|
+
*/
|
|
15
|
+
export const chunk_subgroup_atomic_load: CodeChunk;
|
|
16
|
+
import { CodeChunk } from "../../compiler/CodeChunk.js";
|
|
17
|
+
//# sourceMappingURL=chunk_subgroup_atomic_load.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk_subgroup_atomic_load.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/shader/chunk/subgroup/chunk_subgroup_atomic_load.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;GAaG;AACH,yCAFU,SAAS,CAgBhB;0BA9BuB,6BAA6B"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { WebGPUExtensionType } from "../../../../descriptor/WebGPUExtensionType.js";
|
|
2
|
+
import { CodeChunk } from "../../compiler/CodeChunk.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Load an atomic every lane of the subgroup reads alike, once a subgroup: its first active lane
|
|
6
|
+
* loads it, and the subgroup hands every lane what that lane read. Lanes that each load the same
|
|
7
|
+
* atomic serialize where `atomicLoad` is a read-modify-write, as it is on D3D12
|
|
8
|
+
* (`InterlockedOr(x, 0)`); one load a subgroup does not.
|
|
9
|
+
*
|
|
10
|
+
* `fn subgroup_atomic_load_u32(word: ptr<storage, atomic<u32>, read_write>) -> u32`
|
|
11
|
+
*
|
|
12
|
+
* Every lane of the subgroup calls it with the same `word`, from subgroup-uniform control flow: a
|
|
13
|
+
* lane passing another word reads the first lane's.
|
|
14
|
+
*
|
|
15
|
+
* @see chunk_subgroup_atomic_add for the writing twin
|
|
16
|
+
* @type {CodeChunk}
|
|
17
|
+
*/
|
|
18
|
+
export const chunk_subgroup_atomic_load = CodeChunk.from(
|
|
19
|
+
//language=WGSL
|
|
20
|
+
`
|
|
21
|
+
// uniform in the subgroup by the caller's word, which the analysis cannot see behind its returns
|
|
22
|
+
@diagnostic(off, subgroup_uniformity)
|
|
23
|
+
fn subgroup_atomic_load_u32(word: ptr<storage, atomic<u32>, read_write>) -> u32 {
|
|
24
|
+
var value = 0u;
|
|
25
|
+
|
|
26
|
+
if (subgroupElect()) {
|
|
27
|
+
value = atomicLoad(word);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return subgroupBroadcastFirst(value);
|
|
31
|
+
}
|
|
32
|
+
`);
|
|
33
|
+
|
|
34
|
+
chunk_subgroup_atomic_load.addExtension(WebGPUExtensionType.Subgroups);
|
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The share of a frustum's volume inside the unit box [-0.5, 0.5]³, estimated along 4 rays from its near
|
|
3
|
+
* face to its far face: the mean of the fraction of each ray inside the box.
|
|
4
|
+
*
|
|
5
|
+
* The rays cross the face at points `4 · round` to `4 · round + 3` of the shuffled, Owen-scrambled Sobol
|
|
6
|
+
* sequence of `seed` (`sample_sobol_2d`), in the face's (u, v), u from the left plane to the right and v
|
|
7
|
+
* from the bottom to the top. Each call's 4 points are one per quarter of the face along either axis, and one
|
|
8
|
+
* per quadrant. The 2^m calls of an aligned run of rounds put one point in each dyadic cell of area
|
|
9
|
+
* 2^-(m+2). The points depend only on the seed and the round, and a ray is the planes' blend at its point:
|
|
10
|
+
* the same frustum's planes carried into another space by a rigid or uniformly scaled map, each plane
|
|
11
|
+
* renormalized, cast the same rays there.
|
|
12
|
+
*
|
|
13
|
+
* ```wgsl
|
|
14
|
+
* fn frustum_unit_box_coverage(frustum: array<vec4f, 6>, round: u32, seed: u32) -> f32 // frustum planes [LEFT, RIGHT, BOTTOM, TOP, NEAR, FAR]
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @type {CodeChunk}
|
|
18
|
+
*/
|
|
1
19
|
export const chunk_frustum_unit_box_coverage_multisample: CodeChunk;
|
|
2
20
|
import { CodeChunk } from "../shader/compiler/CodeChunk.js";
|
|
3
21
|
//# sourceMappingURL=chunk_frustum_unit_box_coverage_multisample.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_frustum_unit_box_coverage_multisample.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/volumetrics/chunk_frustum_unit_box_coverage_multisample.js"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"chunk_frustum_unit_box_coverage_multisample.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/volumetrics/chunk_frustum_unit_box_coverage_multisample.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AACH,0DAFU,SAAS,CA8CjB;0BAhEwB,iCAAiC"}
|
|
@@ -1,39 +1,48 @@
|
|
|
1
1
|
import { chunk_frustum_sample_point } from "../shader/chunk/geometry/frustum/chunk_frustum_sample_point.js";
|
|
2
|
-
import {
|
|
2
|
+
import { chunk_sobol_sample_vec2 } from "../shader/chunk/noise/chunk_sobol_sample_vec2.js";
|
|
3
3
|
import { CodeChunk } from "../shader/compiler/CodeChunk.js";
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* The share of a frustum's volume inside the unit box [-0.5, 0.5]³, estimated along 4 rays from its near
|
|
7
|
+
* face to its far face: the mean of the fraction of each ray inside the box.
|
|
8
|
+
*
|
|
9
|
+
* The rays cross the face at points `4 · round` to `4 · round + 3` of the shuffled, Owen-scrambled Sobol
|
|
10
|
+
* sequence of `seed` (`sample_sobol_2d`), in the face's (u, v), u from the left plane to the right and v
|
|
11
|
+
* from the bottom to the top. Each call's 4 points are one per quarter of the face along either axis, and one
|
|
12
|
+
* per quadrant. The 2^m calls of an aligned run of rounds put one point in each dyadic cell of area
|
|
13
|
+
* 2^-(m+2). The points depend only on the seed and the round, and a ray is the planes' blend at its point:
|
|
14
|
+
* the same frustum's planes carried into another space by a rigid or uniformly scaled map, each plane
|
|
15
|
+
* renormalized, cast the same rays there.
|
|
16
|
+
*
|
|
17
|
+
* ```wgsl
|
|
18
|
+
* fn frustum_unit_box_coverage(frustum: array<vec4f, 6>, round: u32, seed: u32) -> f32 // frustum planes [LEFT, RIGHT, BOTTOM, TOP, NEAR, FAR]
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @type {CodeChunk}
|
|
22
|
+
*/
|
|
5
23
|
export const chunk_frustum_unit_box_coverage_multisample = CodeChunk.from(
|
|
6
24
|
//language=WGSL
|
|
7
25
|
`
|
|
8
26
|
fn frustum_unit_box_coverage(
|
|
9
27
|
frustum: array< vec4f, 6>,
|
|
28
|
+
round: u32,
|
|
29
|
+
seed: u32,
|
|
10
30
|
) -> f32 {
|
|
11
|
-
|
|
12
|
-
// 4 Samples is usually the "Sweet Spot" for volumetrics.
|
|
13
|
-
// 1 = Hard Edges
|
|
14
|
-
// 4 = Smooth with slight noise (cleaned up by TAA)
|
|
15
|
-
// 16 = High quality but expensive
|
|
16
31
|
const SAMPLE_COUNT = 4u;
|
|
17
|
-
|
|
32
|
+
|
|
18
33
|
var total_coverage = 0.0;
|
|
19
34
|
|
|
20
35
|
for(var i = 0u; i < SAMPLE_COUNT; i++){
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
//
|
|
24
|
-
let
|
|
25
|
-
let
|
|
26
|
-
|
|
27
|
-
// 2. Construct Ray
|
|
28
|
-
// Note: We must re-calculate direction per-sample because
|
|
29
|
-
// perspective frustums diverge (rays are not parallel).
|
|
30
|
-
let start = frustum_sample_point(frustum, vec3f(u, v, 0.0));
|
|
31
|
-
let end = frustum_sample_point(frustum, vec3f(u, v, 1.0));
|
|
36
|
+
let uv = sample_sobol_2d(round * SAMPLE_COUNT + i, seed);
|
|
37
|
+
|
|
38
|
+
// perspective frustums diverge, so each ray takes its own direction
|
|
39
|
+
let start = frustum_sample_point(frustum, vec3f(uv, 0.0));
|
|
40
|
+
let end = frustum_sample_point(frustum, vec3f(uv, 1.0));
|
|
32
41
|
|
|
33
42
|
let dir = end - start;
|
|
34
43
|
let inv_dir = 1.0 / (dir + vec3f(1e-5));
|
|
35
|
-
|
|
36
|
-
//
|
|
44
|
+
|
|
45
|
+
// slab test against the unit box
|
|
37
46
|
let t0 = (vec3f(-0.5) - start) * inv_dir;
|
|
38
47
|
let t1 = (vec3f( 0.5) - start) * inv_dir;
|
|
39
48
|
|
|
@@ -43,7 +52,6 @@ fn frustum_unit_box_coverage(
|
|
|
43
52
|
let enter = max(max(tmin.x, tmin.y), tmin.z);
|
|
44
53
|
let exit = min(min(tmax.x, tmax.y), tmax.z);
|
|
45
54
|
|
|
46
|
-
// 4. Accumulate Ratio
|
|
47
55
|
let t_start = max(0.0, enter);
|
|
48
56
|
let t_end = min(1.0, exit);
|
|
49
57
|
|
|
@@ -54,6 +62,6 @@ fn frustum_unit_box_coverage(
|
|
|
54
62
|
}
|
|
55
63
|
`, [
|
|
56
64
|
chunk_frustum_sample_point,
|
|
57
|
-
|
|
65
|
+
chunk_sobol_sample_vec2,
|
|
58
66
|
]
|
|
59
|
-
);
|
|
67
|
+
);
|
|
@@ -34,11 +34,11 @@ export class GPUIrradianceClipmap {
|
|
|
34
34
|
/**
|
|
35
35
|
* @returns {GPUTextureContext}
|
|
36
36
|
*/
|
|
37
|
-
get texture_y(): GPUTextureContext;
|
|
37
|
+
get texture_y(): import("../../texture/GPUTextureContext.js").GPUTextureContext;
|
|
38
38
|
/**
|
|
39
39
|
* @returns {GPUTextureContext}
|
|
40
40
|
*/
|
|
41
|
-
get texture_cocg(): GPUTextureContext;
|
|
41
|
+
get texture_cocg(): import("../../texture/GPUTextureContext.js").GPUTextureContext;
|
|
42
42
|
/**
|
|
43
43
|
* @returns {GPUBuffer}
|
|
44
44
|
*/
|
|
@@ -112,6 +112,7 @@ export class GPUIrradianceClipmap {
|
|
|
112
112
|
destroy(): void;
|
|
113
113
|
#private;
|
|
114
114
|
}
|
|
115
|
+
export type GPUTextureContext = import("../../texture/GPUTextureContext.js").GPUTextureContext;
|
|
115
116
|
import { GPUTileAtlas3D } from "../../texture/atlas/GPUTileAtlas3D.js";
|
|
116
117
|
import { IrradianceCascadePlacement } from "./IrradianceCascadePlacement.js";
|
|
117
118
|
import { ShaderSwitchSet } from "../../shader/compiler/ShaderSwitchSet.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GPUIrradianceClipmap.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GPUIrradianceClipmap.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.js"],"names":[],"mappings":"AAiDA;;;;;;;;;;;;;GAaG;AACH;IA2CI;;;;;;;OAOG;IACH;QAL4B,aAAa,GAA9B,MAAM;QAC6B,UAAU,GAA7C,MAAM,GAAC,UAAU,MAAM,CAAC;QACP,SAAS,GAA1B,MAAM;QACW,WAAW,GAA5B,MAAM;OA+DhB;IAED;;OAEG;IACH,4BAEC;IAED;;OAEG;IACH,gFAEC;IAED;;OAEG;IACH,mFAEC;IAED;;OAEG;IACH,yBAEC;IAED;;OAEG;IACH,4BAEC;IAED;;;OAGG;IACH,0BAEC;IAED;;OAEG;IACH,4CAEC;IAED;;OAEG;IACH,uBAEC;IAED;;;;;;;;OAQG;IACH,oBALW,MAAM,KACN,MAAM,KACN,MAAM,oBACN,eAAe,QAgFzB;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH;QAZsG,KAAK,EAAhG,OAAO,8DAA8D,EAAE,UAAU;QACZ,MAAM,EAA3E,OAAO,kCAAkC,EAAE,gBAAgB;QACO,SAAS,EAA3E,OAAO,gCAAgC,EAAE,eAAe;QACxC,eAAe,EAA/B,MAAM;QACoB,eAAe,GAAzC,eAAe;QACuE,MAAM,GAA5F,OAAO,oDAAoD,EAAE,cAAc;QACkB,GAAG,GAAhG,OAAO,sDAAsD,EAAE,mBAAmB;QACgB,MAAM,EAAxG,OAAO,8DAA8D,EAAE,iBAAiB;QAErE,YAAY;QAC7B;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAC,CAkJtD;IAED;;OAEG;IACH,gBAQC;;CACJ;gCAxeY,OAAO,oCAAoC,EAAE,iBAAiB;+BAJ5C,uCAAuC;2CAmB3B,iCAAiC;gCAxB5C,0CAA0C"}
|
|
@@ -10,6 +10,10 @@ import { encoder_prepare_shader_bindings_defaults } from "../../shader/resource/
|
|
|
10
10
|
import { SHADOWMAP_COMPARE_SAMPLER_DESCRIPTOR } from "../../shadow/map/SHADOWMAP_COMPARE_SAMPLER_DESCRIPTOR.js";
|
|
11
11
|
import { GPUTileAtlas3D } from "../../texture/atlas/GPUTileAtlas3D.js";
|
|
12
12
|
import { DEFAULT_RENDER_TARGET_VIEW_DESCRIPTOR } from "../../texture/DEFAULT_RENDER_TARGET_VIEW_DESCRIPTOR.js";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @typedef {import("../../texture/GPUTextureContext.js").GPUTextureContext} GPUTextureContext
|
|
16
|
+
*/
|
|
13
17
|
import {
|
|
14
18
|
IRRADIANCE_CLIPMAP_CASCADE_LIMIT,
|
|
15
19
|
IRRADIANCE_CLIPMAP_DEFAULT_BLEND_SKIRT,
|
package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_gi_sample.d.ts
CHANGED
|
@@ -20,11 +20,8 @@ export const chunk_irradiance_clipmap_gi_sample_lpv: CodeChunk;
|
|
|
20
20
|
* voxel is no surface, so there is no normal to bias the point by or to weigh back faces with, nor a view.
|
|
21
21
|
* Where no probe weighs anything, the environment SH, as under IBL.
|
|
22
22
|
*
|
|
23
|
-
* The probes' SH is
|
|
24
|
-
* `
|
|
25
|
-
* `volumetrics_irradiance_sh_add_radiance` turns back into it: 2π × the luma, band 1 in the basis order
|
|
26
|
-
* (y, z, x), and the chroma, which only the constant band has, over band 0's basis constant. Reads the probes'
|
|
27
|
-
* group, `view` and `environment_sh`.
|
|
23
|
+
* The probes' SH is radiance SH3, as Brick4's: its bands 0 and 1 are the radiance SH2. Reads the probes' group,
|
|
24
|
+
* `view` and `environment_sh`.
|
|
28
25
|
* @type {CodeChunk}
|
|
29
26
|
*/
|
|
30
27
|
export const chunk_irradiance_clipmap_gi_sample_probe_clipmap: CodeChunk;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_irradiance_clipmap_gi_sample.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_gi_sample.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chunk_irradiance_clipmap_gi_sample.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_gi_sample.js"],"names":[],"mappings":"AAYA;;;GAGG;AACH,qDAFU,SAAS,CAcjB;AAIF;;;;GAIG;AACH,wDAFU,SAAS,CAYjB;AAEF;;;GAGG;AACH,qDAFU,SAAS,CAqBjB;AAEF;;;;;;;;;GASG;AACH,+DAFU,SAAS,CAwBjB;AAIF;;;;;GAKG;AACH,iDAFU,eAAe,CAEiE;0BA3GhE,oCAAoC;gCAC9B,0CAA0C"}
|
package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_gi_sample.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { chunk_brick4_sample_sh } from "../../global_illumination/brick4/gpu/draw/chunk_brick4_sample_sh.js";
|
|
2
2
|
import { chunk_probe_clipmap_pick } from "../../global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.js";
|
|
3
3
|
import { INDIRECT_LIGHTING } from "../../INDIRECT_LIGHTING.js";
|
|
4
|
-
import { chunk_YCoCg_to_rgb } from "../../shader/chunk/color/YCoCg/chunk_YCoCg_to_rgb.js";
|
|
5
4
|
import { chunk_jitter_from_vectors } from "../../shader/chunk/random/chunk_jitter_from_vectors.js";
|
|
6
5
|
import { ENVIRONMENT_SH_RESOURCE } from "../../light/environment/ENVIRONMENT_SH_RESOURCE.js";
|
|
7
6
|
import { ShadeIndirectLightingMode } from "../../ShadeIndirectLightingMode.js";
|
|
@@ -79,11 +78,8 @@ fn irradiance_clipmap_gi_sample(position_ws: vec3<f32>) -> array<vec3<f32>, 4> {
|
|
|
79
78
|
* voxel is no surface, so there is no normal to bias the point by or to weigh back faces with, nor a view.
|
|
80
79
|
* Where no probe weighs anything, the environment SH, as under IBL.
|
|
81
80
|
*
|
|
82
|
-
* The probes' SH is
|
|
83
|
-
* `
|
|
84
|
-
* `volumetrics_irradiance_sh_add_radiance` turns back into it: 2π × the luma, band 1 in the basis order
|
|
85
|
-
* (y, z, x), and the chroma, which only the constant band has, over band 0's basis constant. Reads the probes'
|
|
86
|
-
* group, `view` and `environment_sh`.
|
|
81
|
+
* The probes' SH is radiance SH3, as Brick4's: its bands 0 and 1 are the radiance SH2. Reads the probes' group,
|
|
82
|
+
* `view` and `environment_sh`.
|
|
87
83
|
* @type {CodeChunk}
|
|
88
84
|
*/
|
|
89
85
|
export const chunk_irradiance_clipmap_gi_sample_probe_clipmap = CodeChunk.from(
|
|
@@ -102,24 +98,11 @@ fn irradiance_clipmap_gi_sample(position_ws: vec3<f32>) -> array<vec3<f32>, 4> {
|
|
|
102
98
|
);
|
|
103
99
|
}
|
|
104
100
|
|
|
105
|
-
|
|
106
|
-
const TWO_PI: f32 = 6.283185307179586;
|
|
107
|
-
const BAND_0_BASIS: f32 = 0.28209479177387814;
|
|
108
|
-
|
|
109
|
-
let Y = probes.sh.Y * TWO_PI;
|
|
110
|
-
|
|
111
|
-
// the Metro layout is (x, y, z, constant); the basis order is (constant, y, z, x)
|
|
112
|
-
return array<vec3<f32>, 4>(
|
|
113
|
-
YCoCg_to_rgb(vec3<f32>(Y.w, probes.sh.CoCg * (BAND_0_BASIS * TWO_PI))),
|
|
114
|
-
vec3<f32>(Y.y),
|
|
115
|
-
vec3<f32>(Y.z),
|
|
116
|
-
vec3<f32>(Y.x),
|
|
117
|
-
);
|
|
101
|
+
return array<vec3<f32>, 4>(probes.sh[0], probes.sh[1], probes.sh[2], probes.sh[3]);
|
|
118
102
|
}
|
|
119
103
|
`, [
|
|
120
104
|
chunk_probe_clipmap_pick,
|
|
121
105
|
chunk_jitter_from_vectors,
|
|
122
|
-
chunk_YCoCg_to_rgb,
|
|
123
106
|
]
|
|
124
107
|
);
|
|
125
108
|
|
package/src/shade/renderer/volumetrics/shader_volumetrics_build_participating_media.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader_volumetrics_build_participating_media.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/volumetrics/shader_volumetrics_build_participating_media.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shader_volumetrics_build_participating_media.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/volumetrics/shader_volumetrics_build_participating_media.js"],"names":[],"mappings":"AA6QA,yEAIE;8BA3P4B,4BAA4B"}
|
|
@@ -18,8 +18,7 @@ import {
|
|
|
18
18
|
} from "../shader/chunk/geometry/frustum/chunk_frustum_transform_plane_matrix.js";
|
|
19
19
|
import { chunk_mat4_extract_scale } from "../shader/chunk/geometry/mat4/chunk_mat4_extract_scale.js";
|
|
20
20
|
import { chunk_stbn_sample_vec3 } from "../shader/chunk/noise/chunk_stbn_sample_vec3.js";
|
|
21
|
-
import {
|
|
22
|
-
import { chunk_random_initialize } from "../shader/chunk/random/chunk_random_initialize.js";
|
|
21
|
+
import { chunk_pcg4d } from "../shader/chunk/random/pcg/chunk_pcg4d.js";
|
|
23
22
|
import { CodeChunk } from "../shader/compiler/CodeChunk.js";
|
|
24
23
|
import { ComputeShader } from "../shader/ComputeShader.js";
|
|
25
24
|
import { ShaderResourceSetDescriptor } from "../shader/resource/ShaderResourceSetDescriptor.js";
|
|
@@ -69,7 +68,8 @@ fn main(
|
|
|
69
68
|
return;
|
|
70
69
|
}
|
|
71
70
|
|
|
72
|
-
|
|
71
|
+
// the froxel's coverage points: a sequence of its own, a round of it a frame, the same points for every volume
|
|
72
|
+
let coverage_seed = pcg4d(vec4<u32>(voxel_coord, 0x1F83D9ABu)).x;
|
|
73
73
|
|
|
74
74
|
let uv = vec2f(voxel_coord.xy) / vec2f(resolution.xy);
|
|
75
75
|
|
|
@@ -187,7 +187,7 @@ fn main(
|
|
|
187
187
|
// volumetrics_froxel_containment.spec.js keeps the geometry proven if the balance changes.
|
|
188
188
|
|
|
189
189
|
// estimate volume coverage to avoid aliasing and get a better overlap test
|
|
190
|
-
var volume_coverage = frustum_unit_box_coverage(local_frustum);
|
|
190
|
+
var volume_coverage = frustum_unit_box_coverage(local_frustum, view.frame_index, coverage_seed);
|
|
191
191
|
|
|
192
192
|
if(volume_coverage == 0.0){
|
|
193
193
|
// skip
|
|
@@ -252,8 +252,7 @@ fn main(
|
|
|
252
252
|
chunk_frustum_transform_plane_matrix,
|
|
253
253
|
chunk_aabb3_intersects_frustum,
|
|
254
254
|
chunk_compute_near_far_from_projection,
|
|
255
|
-
|
|
256
|
-
chunk_random,
|
|
255
|
+
chunk_pcg4d,
|
|
257
256
|
chunk_rgb_to_luminance,
|
|
258
257
|
chunk_frustum_unit_box_coverage_multisample,
|
|
259
258
|
chunk_compute_volume_fade_factor,
|