@woosh/meep-engine 3.61.2 → 3.62.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +111 -0
- package/package.json +1 -1
- package/src/engine/graphics3/PickingSystem.d.ts.map +1 -1
- package/src/engine/graphics3/PickingSystem.js +415 -413
- package/src/engine/graphics3/decal/GPUDecalRenderer.d.ts.map +1 -1
- package/src/engine/graphics3/decal/GPUDecalRenderer.js +2 -1
- package/src/engine/graphics3/decal/shader_decal_composite.d.ts.map +1 -1
- package/src/engine/graphics3/decal/shader_decal_composite.js +26 -16
- package/src/engine/graphics3/decal/shader_decal_tile_copy.d.ts.map +1 -1
- package/src/engine/graphics3/decal/shader_decal_tile_copy.js +6 -11
- package/src/engine/graphics3/highlight/GPUHighlightRenderer.d.ts.map +1 -1
- package/src/engine/graphics3/highlight/GPUHighlightRenderer.js +6 -2
- package/src/engine/graphics3/highlight/shader_highlight_outline.d.ts.map +1 -1
- package/src/engine/graphics3/highlight/shader_highlight_outline.js +167 -150
- package/src/engine/graphics3/shader_picking_gather.d.ts.map +1 -1
- package/src/engine/graphics3/shader_picking_gather.js +133 -120
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/shade/device/mock/SoftwareGPUTexture.d.ts.map +1 -1
- package/src/shade/device/mock/SoftwareGPUTexture.js +11 -0
- package/src/shade/device/pipeline/rp_validate_and_rewrite_for_color_attachments.js +1 -1
- package/src/shade/playground/contact_shadows/ContactShadowLab.js +6 -6
- package/src/shade/playground/contact_shadows/shader_contact_lab_composite.d.ts.map +1 -1
- package/src/shade/playground/contact_shadows/shader_contact_lab_composite.js +6 -4
- package/src/shade/playground/contact_shadows/shader_contact_lab_reference.d.ts.map +1 -1
- package/src/shade/playground/contact_shadows/shader_contact_lab_reference.js +6 -4
- package/src/shade/playground/contact_shadows/shader_contact_shadow_march.d.ts.map +1 -1
- package/src/shade/playground/contact_shadows/shader_contact_shadow_march.js +6 -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/playground/ssr_reprojection/SpatialFilterProbe.js +1 -1
- package/src/shade/playground/ssr_variance/capture.js +1 -1
- package/src/shade/renderer/Renderer.d.ts +2 -2
- package/src/shade/renderer/Renderer.d.ts.map +1 -1
- package/src/shade/renderer/Renderer.js +90 -64
- package/src/shade/renderer/deferred/chunk_read_gBuffer_material.d.ts.map +1 -1
- package/src/shade/renderer/deferred/chunk_read_gBuffer_material.js +3 -1
- package/src/shade/renderer/deferred/chunk_ss_trace_contact_shadow_soft.d.ts.map +1 -1
- package/src/shade/renderer/deferred/chunk_ss_trace_contact_shadow_soft.js +5 -4
- package/src/shade/renderer/deferred/shader_deferred_main.d.ts.map +1 -1
- package/src/shade/renderer/deferred/shader_deferred_main.js +6 -4
- package/src/shade/renderer/extension/GBufferTextures.d.ts +5 -1
- package/src/shade/renderer/extension/GBufferTextures.d.ts.map +1 -1
- package/src/shade/renderer/extension/GBufferTextures.js +5 -1
- package/src/shade/renderer/extension/ViewTextures.d.ts +11 -7
- package/src/shade/renderer/extension/ViewTextures.d.ts.map +1 -1
- package/src/shade/renderer/extension/ViewTextures.js +17 -13
- 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/gbuffer/G_BUFFER_ALBEDO_FORMAT.d.ts +2 -0
- package/src/shade/renderer/gbuffer/G_BUFFER_ALBEDO_FORMAT.d.ts.map +1 -1
- package/src/shade/renderer/gbuffer/G_BUFFER_ALBEDO_FORMAT.js +2 -0
- package/src/shade/renderer/gbuffer/G_BUFFER_COLOR_TARGETS.d.ts.map +1 -1
- package/src/shade/renderer/gbuffer/G_BUFFER_COLOR_TARGETS.js +8 -5
- 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/shader_sdf_visualize.d.ts +7 -5
- package/src/shade/renderer/geometry/sdf/shader_sdf_visualize.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/shader_sdf_visualize.js +29 -16
- 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/runtime/cut/chunk_vgeo_cut_instance.d.ts +9 -3
- package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_instance.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_instance.js +40 -32
- package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_collect.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_collect.js +14 -15
- 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/draw/shader_brick4_debug_draw.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/brick4/gpu/draw/shader_brick4_debug_draw.js +7 -3
- package/src/shade/renderer/global_illumination/brick4/gpu/draw/shader_brick4_diffuse.js +1 -1
- package/src/shade/renderer/global_illumination/brick4/gpu/draw/shader_brick4_indirect_lighting.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/brick4/gpu/draw/shader_brick4_indirect_lighting.js +5 -3
- package/src/shade/renderer/global_illumination/brick4/gpu/draw/shader_brick4_specular.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/brick4/gpu/draw/shader_brick4_specular.js +1 -3
- package/src/shade/renderer/global_illumination/ibl/shader_diffuse_IBL.js +1 -1
- package/src/shade/renderer/global_illumination/ibl/shader_specular_IBL.js +2 -2
- package/src/shade/renderer/global_illumination/lpv/shader_diffuse_LPV.js +1 -1
- 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 +63 -37
- 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 +73 -45
- 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_diffuse.js +2 -2
- 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 +10 -4
- 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 +7 -3
- 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/global_illumination/shader_resolve_indirect_lighting.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/shader_resolve_indirect_lighting.js +5 -3
- package/src/shade/renderer/global_illumination/sharc/shader/debug/shader_colored_hash.js +1 -1
- package/src/shade/renderer/global_illumination/sharc/shader/debug/shader_sharc_debug_radiance.js +1 -1
- package/src/shade/renderer/global_illumination/sharc/shader/shader_sharc_update.js +1 -1
- 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/GPUMaterialManager.d.ts +22 -9
- package/src/shade/renderer/material/GPUMaterialManager.d.ts.map +1 -1
- package/src/shade/renderer/material/GPUMaterialManager.js +159 -65
- package/src/shade/renderer/material/MATERIAL_MASK.d.ts +19 -0
- package/src/shade/renderer/material/MATERIAL_MASK.d.ts.map +1 -0
- package/src/shade/renderer/material/MATERIAL_MASK.js +19 -0
- package/src/shade/renderer/material/dispatch/GPUMaterialComputeDispatch.d.ts +8 -8
- package/src/shade/renderer/material/dispatch/GPUMaterialComputeDispatch.d.ts.map +1 -1
- package/src/shade/renderer/material/dispatch/GPUMaterialComputeDispatch.js +11 -92
- package/src/shade/renderer/material/dispatch/chunk_material_quad_keys.d.ts.map +1 -1
- package/src/shade/renderer/material/dispatch/chunk_material_quad_keys.js +10 -2
- package/src/shade/renderer/material/dispatch/gbuffer_compute.js +2 -2
- package/src/shade/renderer/material/dispatch/graph_material_dispatch_compute.d.ts +7 -7
- package/src/shade/renderer/material/dispatch/graph_material_dispatch_compute.d.ts.map +1 -1
- package/src/shade/renderer/material/dispatch/graph_material_dispatch_compute.js +20 -16
- package/src/shade/renderer/material/dispatch/shader_material_pixel_count.d.ts.map +1 -1
- package/src/shade/renderer/material/dispatch/shader_material_pixel_count.js +3 -1
- package/src/shade/renderer/material/dispatch/shader_material_pixel_scatter.d.ts.map +1 -1
- package/src/shade/renderer/material/dispatch/shader_material_pixel_scatter.js +3 -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/material/standard/fragment_gbuffer.d.ts.map +1 -1
- package/src/shade/renderer/material/standard/fragment_gbuffer.js +26 -25
- package/src/shade/renderer/material/standard/material_gbuffer_vertex.d.ts +10 -8
- package/src/shade/renderer/material/standard/material_gbuffer_vertex.d.ts.map +1 -1
- package/src/shade/renderer/material/standard/material_gbuffer_vertex.js +16 -13
- package/src/shade/renderer/material/template/ShadeMaterialTemplate.d.ts +1 -1
- package/src/shade/renderer/material/template/ShadeMaterialTemplate.js +1 -1
- 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/denoise/LigmaDenoiser.d.ts +5 -2
- package/src/shade/renderer/postprocess/denoise/LigmaDenoiser.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/denoise/LigmaDenoiser.js +7 -4
- package/src/shade/renderer/postprocess/denoise/debug/graph_pass_debug_reprojection.d.ts +3 -3
- package/src/shade/renderer/postprocess/denoise/debug/graph_pass_debug_reprojection.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/denoise/debug/graph_pass_debug_reprojection.js +12 -10
- package/src/shade/renderer/postprocess/denoise/fragment_shader_denoise_ao.js +2 -2
- package/src/shade/renderer/postprocess/denoise/shader_temporal_reprojection_luma.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/denoise/shader_temporal_reprojection_luma.js +6 -4
- package/src/shade/renderer/postprocess/gtao/GTAO.d.ts +9 -7
- package/src/shade/renderer/postprocess/gtao/GTAO.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/gtao/GTAO.js +11 -8
- package/src/shade/renderer/postprocess/gtao/ao_reproject_shader.d.ts +3 -3
- package/src/shade/renderer/postprocess/gtao/ao_reproject_shader.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/gtao/ao_reproject_shader.js +17 -12
- package/src/shade/renderer/postprocess/gtao/chunk_integrate_lighting_sample.js +1 -1
- package/src/shade/renderer/postprocess/gtao/fragment_shader_gtao.js +1 -1
- package/src/shade/renderer/postprocess/gtao/fragment_shader_gtao_with_irradiance.js +4 -4
- package/src/shade/renderer/postprocess/gtao/shader_gtao_spatial_denoise.js +2 -2
- package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
- package/src/shade/renderer/postprocess/ssr/chunk_ssr_spatial_variance.js +41 -41
- package/src/shade/renderer/postprocess/ssr/prefilter/chunk_load_neighbourhood_sample.js +1 -1
- package/src/shade/renderer/postprocess/ssr/reproject/chunk_ssr_temporal_accumulate.js +3 -3
- package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_add_hit_irradiance.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_add_hit_irradiance.js +5 -2
- package/src/shade/renderer/postprocess/ssr/resolve/ssr_resolve_shader.js +4 -4
- package/src/shade/renderer/postprocess/ssr/ssr_combine_shader.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/ssr/ssr_combine_shader.js +4 -2
- package/src/shade/renderer/postprocess/ssr/ssr_graph_prefilter_color.d.ts +2 -1
- package/src/shade/renderer/postprocess/ssr/ssr_graph_prefilter_color.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/ssr/ssr_graph_prefilter_color.js +10 -2
- package/src/shade/renderer/postprocess/ssr/ssr_reproject_shader.js +1 -1
- package/src/shade/renderer/postprocess/ssr/ssr_spatial_denoise_shader.js +4 -4
- package/src/shade/renderer/postprocess/taa/shader_reprojection_map.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/taa/shader_reprojection_map.js +6 -4
- package/src/shade/renderer/postprocess/velocity/graph_add_per_object_velocity.d.ts +6 -8
- package/src/shade/renderer/postprocess/velocity/graph_add_per_object_velocity.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/velocity/graph_add_per_object_velocity.js +29 -33
- package/src/shade/renderer/rasterize/TemplatePassDescriptor.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/TemplatePassDescriptor.js +1 -0
- package/src/shade/renderer/rasterize/bucket/graph_meshlets_rasterize_by_bucket.d.ts +6 -3
- package/src/shade/renderer/rasterize/bucket/graph_meshlets_rasterize_by_bucket.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/bucket/graph_meshlets_rasterize_by_bucket.js +8 -3
- package/src/shade/renderer/rasterize/expand/GPUCollectionLimits.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/expand/GPUCollectionLimits.js +3 -0
- package/src/shade/renderer/rasterize/expand/RasterizationCollectionType.d.ts +1 -0
- package/src/shade/renderer/rasterize/expand/RasterizationCollectionType.js +5 -0
- package/src/shade/renderer/rasterize/expand/graph_meshlets_rasterize.d.ts +8 -3
- package/src/shade/renderer/rasterize/expand/graph_meshlets_rasterize.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/expand/graph_meshlets_rasterize.js +54 -5
- package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.d.ts +1 -0
- package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.js +1 -1
- package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.d.ts +1 -1
- package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.js +2 -1
- package/src/shade/renderer/rasterize/native/graph_rasterize_meshes_alpha_tested.d.ts +7 -2
- package/src/shade/renderer/rasterize/native/graph_rasterize_meshes_alpha_tested.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/graph_rasterize_meshes_alpha_tested.js +73 -9
- package/src/shade/renderer/rasterize/native/viz/shader_vertex.js +4 -4
- package/src/shade/renderer/rasterize/native/viz/viz_rasterization_alpha_tested_pass_descriptor.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/viz/viz_rasterization_alpha_tested_pass_descriptor.js +23 -40
- package/src/shade/renderer/rasterize/native/viz/viz_rasterization_opaque_pass_descriptor.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/viz/viz_rasterization_opaque_pass_descriptor.js +55 -76
- package/src/shade/renderer/rasterize/standard/graph_rasterize_partial_opaque.d.ts +4 -2
- package/src/shade/renderer/rasterize/standard/graph_rasterize_partial_opaque.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/standard/graph_rasterize_partial_opaque.js +6 -2
- package/src/shade/renderer/rasterize/standard/graph_rasterize_remaining_opaque.d.ts +4 -2
- package/src/shade/renderer/rasterize/standard/graph_rasterize_remaining_opaque.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/standard/graph_rasterize_remaining_opaque.js +6 -2
- package/src/shade/renderer/rasterize/standard/graph_rasterize_scene.d.ts +5 -2
- package/src/shade/renderer/rasterize/standard/graph_rasterize_scene.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/standard/graph_rasterize_scene.js +43 -2
- package/src/shade/renderer/rasterize/visibility/VISIBILITY_BUFFER.d.ts +39 -0
- package/src/shade/renderer/rasterize/visibility/VISIBILITY_BUFFER.d.ts.map +1 -0
- package/src/shade/renderer/rasterize/visibility/VISIBILITY_BUFFER.js +45 -0
- package/src/shade/renderer/rasterize/visibility/chunk_visibility_decode.d.ts +26 -0
- package/src/shade/renderer/rasterize/visibility/chunk_visibility_decode.d.ts.map +1 -0
- package/src/shade/renderer/rasterize/visibility/chunk_visibility_decode.js +48 -0
- package/src/shade/renderer/rasterize/visibility/shader_visible_meshlets_append.d.ts +40 -0
- package/src/shade/renderer/rasterize/visibility/shader_visible_meshlets_append.d.ts.map +1 -0
- package/src/shade/renderer/rasterize/visibility/shader_visible_meshlets_append.js +172 -0
- package/src/shade/renderer/restir/di/chunk_restir_reconstruct_surface.d.ts.map +1 -1
- package/src/shade/renderer/restir/di/chunk_restir_reconstruct_surface.js +6 -4
- package/src/shade/renderer/restir/di/chunk_restir_spatial_reuse.js +1 -1
- package/src/shade/renderer/restir/di/shader_restir_di_denoise.js +2 -2
- 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/color/sRGB/chunk_sRGBTransferEOTF.d.ts +9 -0
- package/src/shade/renderer/shader/chunk/color/sRGB/chunk_sRGBTransferEOTF.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/color/sRGB/chunk_sRGBTransferEOTF.js +18 -0
- package/src/shade/renderer/shader/chunk/geometry/mat3/chunk_mat3_determinant.d.ts +20 -0
- package/src/shade/renderer/shader/chunk/geometry/mat3/chunk_mat3_determinant.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/geometry/mat3/chunk_mat3_determinant.js +26 -0
- package/src/shade/renderer/shader/chunk/geometry/mat3/chunk_mat3_singular_values.d.ts +60 -18
- package/src/shade/renderer/shader/chunk/geometry/mat3/chunk_mat3_singular_values.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/geometry/mat3/chunk_mat3_singular_values.js +163 -45
- package/src/shade/renderer/shader/chunk/geometry/mat4/chunk_mat4_linear_determinant.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/geometry/mat4/chunk_mat4_linear_determinant.js +19 -18
- package/src/shade/renderer/shader/chunk/geometry/normal/chunk_decode_g_buffer_face_normal.d.ts +13 -0
- package/src/shade/renderer/shader/chunk/geometry/normal/chunk_decode_g_buffer_face_normal.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/geometry/normal/chunk_decode_g_buffer_face_normal.js +22 -0
- package/src/shade/renderer/shader/chunk/geometry/normal/chunk_decode_g_buffer_normal.d.ts +8 -1
- package/src/shade/renderer/shader/chunk/geometry/normal/chunk_decode_g_buffer_normal.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/geometry/normal/chunk_decode_g_buffer_normal.js +10 -8
- package/src/shade/renderer/shader/chunk/geometry/normal/chunk_encode_g_buffer_face_normal.d.ts +22 -0
- package/src/shade/renderer/shader/chunk/geometry/normal/chunk_encode_g_buffer_face_normal.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/geometry/normal/chunk_encode_g_buffer_face_normal.js +32 -0
- package/src/shade/renderer/shader/chunk/geometry/normal/chunk_encode_g_buffer_normal.d.ts +11 -1
- package/src/shade/renderer/shader/chunk/geometry/normal/chunk_encode_g_buffer_normal.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/geometry/normal/chunk_encode_g_buffer_normal.js +14 -6
- 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_decode_g_buffer_albedo.d.ts +14 -0
- package/src/shade/renderer/shader/chunk/material/chunk_decode_g_buffer_albedo.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/material/chunk_decode_g_buffer_albedo.js +24 -0
- package/src/shade/renderer/shader/chunk/material/chunk_encode_g_buffer_albedo.d.ts +17 -0
- package/src/shade/renderer/shader/chunk/material/chunk_encode_g_buffer_albedo.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/material/chunk_encode_g_buffer_albedo.js +27 -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/screen_space/SCREEN_SPACE_RESOURCES.d.ts +7 -1
- package/src/shade/renderer/shader/chunk/screen_space/SCREEN_SPACE_RESOURCES.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/screen_space/SCREEN_SPACE_RESOURCES.js +8 -1
- package/src/shade/renderer/shader/chunk/screen_space/chunk_ffx_sssr_load_world_space_normal.js +1 -1
- package/src/shade/renderer/shader/chunk/screen_space/chunk_screen_space_newton_ray.js +10 -10
- 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/shader/pass/RenderPassDescriptor.d.ts +8 -0
- package/src/shade/renderer/shader/pass/RenderPassDescriptor.d.ts.map +1 -1
- package/src/shade/renderer/shader/pass/RenderPassDescriptor.js +9 -0
- package/src/shade/renderer/shader/util/shader_decode_octahedral_normal.js +1 -1
- package/src/shade/renderer/shadow/contact/graph_contact_shadow_linear.d.ts +3 -3
- package/src/shade/renderer/shadow/contact/graph_contact_shadow_linear.d.ts.map +1 -1
- package/src/shade/renderer/shadow/contact/graph_contact_shadow_linear.js +3 -3
- package/src/shade/renderer/shadow/contact/shader_contact_shadow_linear.d.ts.map +1 -1
- package/src/shade/renderer/shadow/contact/shader_contact_shadow_linear.js +6 -4
- package/src/shade/renderer/shadow/ray/RTXShadows.d.ts +6 -4
- package/src/shade/renderer/shadow/ray/RTXShadows.d.ts.map +1 -1
- package/src/shade/renderer/shadow/ray/RTXShadows.js +16 -5
- package/src/shade/renderer/shadow/ray/shader_ray_shadow_code.d.ts.map +1 -1
- package/src/shade/renderer/shadow/ray/shader_ray_shadow_code.js +7 -7
- package/src/shade/renderer/shadow/ray/shader_shadow_upscale.js +2 -2
- package/src/shade/renderer/shadow/ray/staged/gen/graph_gen_rays.d.ts +4 -2
- package/src/shade/renderer/shadow/ray/staged/gen/graph_gen_rays.d.ts.map +1 -1
- package/src/shade/renderer/shadow/ray/staged/gen/graph_gen_rays.js +79 -74
- package/src/shade/renderer/shadow/ray/staged/gen/shader_generate_rays.d.ts.map +1 -1
- package/src/shade/renderer/shadow/ray/staged/gen/shader_generate_rays.js +7 -7
- package/src/shade/renderer/shadow/sdf/cascade/shader_scene_sdf_soft_shadows.d.ts.map +1 -1
- package/src/shade/renderer/shadow/sdf/cascade/shader_scene_sdf_soft_shadows.js +7 -3
- package/src/shade/renderer/shadow/sdf/graph_draw_sdf_shadows.d.ts +7 -5
- package/src/shade/renderer/shadow/sdf/graph_draw_sdf_shadows.d.ts.map +1 -1
- package/src/shade/renderer/shadow/sdf/graph_draw_sdf_shadows.js +29 -16
- package/src/shade/renderer/texture/virtual/VirtualTextureManager.d.ts +5 -5
- package/src/shade/renderer/texture/virtual/VirtualTextureManager.d.ts.map +1 -1
- package/src/shade/renderer/texture/virtual/VirtualTextureManager.js +8 -8
- package/src/shade/renderer/texture/virtual/build_shader_vt_feedback.d.ts.map +1 -1
- package/src/shade/renderer/texture/virtual/build_shader_vt_feedback.js +13 -14
- 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/GPUWaterRenderer.d.ts +2 -1
- package/src/shade/renderer/water/GPUWaterRenderer.d.ts.map +1 -1
- package/src/shade/renderer/water/GPUWaterRenderer.js +6 -4
- package/src/shade/renderer/water/chunk_water_transport.d.ts.map +1 -1
- package/src/shade/renderer/water/chunk_water_transport.js +11 -9
- package/src/shade/renderer/water/query/GPUWaterQueries.d.ts +1 -1
- package/src/shade/renderer/water/shader_water.d.ts.map +1 -1
- package/src/shade/renderer/water/shader_water.js +13 -11
- package/src/shade/renderer/wind/GPUSceneWind.d.ts +1 -1
- package/src/shade/renderer/gbuffer/G_BUFFER_MIP_LEVELS.d.ts +0 -7
- package/src/shade/renderer/gbuffer/G_BUFFER_MIP_LEVELS.d.ts.map +0 -1
- package/src/shade/renderer/gbuffer/G_BUFFER_MIP_LEVELS.js +0 -6
- 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/postprocess/ssr/shader_downsample_encoded_normal.d.ts +0 -3
- package/src/shade/renderer/postprocess/ssr/shader_downsample_encoded_normal.d.ts.map +0 -1
- package/src/shade/renderer/postprocess/ssr/shader_downsample_encoded_normal.js +0 -104
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Determinant of a 3×3 as the triple product of its columns, `dot(m[0], cross(m[1], m[2]))`. Same
|
|
3
|
+
* expression as {@link m4_linear_determinant}, the CPU twin of `mat4_linear_determinant`, which
|
|
4
|
+
* reads it through this.
|
|
5
|
+
*
|
|
6
|
+
* Written out rather than left to WGSL's `determinant`. The specification gives that builtin no
|
|
7
|
+
* accuracy at all ("Infinite ULP"), each backend expands it its own way, and no CPU model can stand
|
|
8
|
+
* in for it. This expression's accuracy is what `dot` and `cross` inherit from their operations. It
|
|
9
|
+
* is exactly zero for a column of zeros at any rotation, because every term of the expansion
|
|
10
|
+
* carries a factor from that column, even where the backend fuses the products.
|
|
11
|
+
*
|
|
12
|
+
* A caller dividing by a determinant tests that very number, not another expansion of it. Two
|
|
13
|
+
* expansions agree in exact arithmetic but not in f32, and near a singular matrix one can read zero
|
|
14
|
+
* where the other does not.
|
|
15
|
+
*
|
|
16
|
+
* @type {CodeChunk}
|
|
17
|
+
*/
|
|
18
|
+
export const chunk_mat3_determinant: CodeChunk;
|
|
19
|
+
import { CodeChunk } from "../../../compiler/CodeChunk.js";
|
|
20
|
+
//# sourceMappingURL=chunk_mat3_determinant.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk_mat3_determinant.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/shader/chunk/geometry/mat3/chunk_mat3_determinant.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AACH,qCAFU,SAAS,CAQZ;0BAzBmB,gCAAgC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CodeChunk } from "../../../compiler/CodeChunk.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Determinant of a 3×3 as the triple product of its columns, `dot(m[0], cross(m[1], m[2]))`. Same
|
|
5
|
+
* expression as {@link m4_linear_determinant}, the CPU twin of `mat4_linear_determinant`, which
|
|
6
|
+
* reads it through this.
|
|
7
|
+
*
|
|
8
|
+
* Written out rather than left to WGSL's `determinant`. The specification gives that builtin no
|
|
9
|
+
* accuracy at all ("Infinite ULP"), each backend expands it its own way, and no CPU model can stand
|
|
10
|
+
* in for it. This expression's accuracy is what `dot` and `cross` inherit from their operations. It
|
|
11
|
+
* is exactly zero for a column of zeros at any rotation, because every term of the expansion
|
|
12
|
+
* carries a factor from that column, even where the backend fuses the products.
|
|
13
|
+
*
|
|
14
|
+
* A caller dividing by a determinant tests that very number, not another expansion of it. Two
|
|
15
|
+
* expansions agree in exact arithmetic but not in f32, and near a singular matrix one can read zero
|
|
16
|
+
* where the other does not.
|
|
17
|
+
*
|
|
18
|
+
* @type {CodeChunk}
|
|
19
|
+
*/
|
|
20
|
+
export const chunk_mat3_determinant = CodeChunk.from(
|
|
21
|
+
//language=WGSL
|
|
22
|
+
`
|
|
23
|
+
fn mat3_determinant(m: mat3x3<f32>) -> f32 {
|
|
24
|
+
return dot(m[0], cross(m[1], m[2]));
|
|
25
|
+
}
|
|
26
|
+
`, []);
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The largest and smallest singular values of a 3×3 matrix.
|
|
2
|
+
* The largest and smallest singular values of a 3×3 matrix. **Expensive but correct**: a couple of
|
|
3
|
+
* hundred ALU operations, a transcendental pair and a handful of square roots, where the longest
|
|
4
|
+
* and shortest column (`mat4_extract_scale`) cost three lengths. Those are the same numbers for any
|
|
5
|
+
* rotation times a scale, and the real-time paths (virtual geometry's cut, the probe clipmap's
|
|
6
|
+
* bricks) read the columns and accept that a shear goes unaccounted. Reach for this only where a
|
|
7
|
+
* shear has to be measured, and not per instance per view per frame.
|
|
3
8
|
*
|
|
4
9
|
* They are what "how much does this transform stretch a distance" actually means: a vector's length
|
|
5
10
|
* is scaled by something between σ_min and σ_max, and both bounds are attained. Column lengths are
|
|
@@ -7,23 +12,60 @@
|
|
|
7
12
|
* `[[1,0,0],[k,1,0],[0,0,1]]`, every column has length 1 or √(1+k²) while the true ratio grows
|
|
8
13
|
* without bound in `k`. A shear has no scale in any column and stretches space anyway.
|
|
9
14
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
15
|
+
* **Method.** M is first scaled by the power of two that brings its largest entry into [1, 2), and
|
|
16
|
+
* the values are scaled back at the end. That is exact, and it keeps every square and product below
|
|
17
|
+
* far inside f32's range whatever the transform's scale.
|
|
18
|
+
*
|
|
19
|
+
* The eigenvalues of `MᵀM` are the squared singular values, and Smith's closed form (1961) gives
|
|
20
|
+
* them as `q + p·β` for the roots `β = 2cos(φ + 2πk/3)` of `β³ − 3β − det B`, with
|
|
21
|
+
* `B = (MᵀM − qI) / p`. Only one root is taken from that form: the one that stands apart from the
|
|
22
|
+
* other two, which is the largest when `det B ≥ 0` and the smallest otherwise (Scherzinger &
|
|
23
|
+
* Dohrmann 2008; Eberly, "A Robust Eigensolver for 3×3 Symmetric Matrices"). The other two are
|
|
24
|
+
* ill-conditioned where two roots meet: `det(B)/2` then sits at ±1, the edge of `acos`'s domain, so
|
|
25
|
+
* one rounding of it moves φ by `acos(1 − 2⁻²⁴)/3 ≈ 1.2e-4`, and those two roots by √3·p times
|
|
26
|
+
* that. For a beam-like scale p is a third of σ_max², which is enough to take σ_min to zero. The
|
|
27
|
+
* root that stands apart is stationary in φ at both edges, and lies at least √3 from the others,
|
|
28
|
+
* where the cubic's slope `3(β² − 1)` is at least 6. One Newton step there squares whatever error
|
|
29
|
+
* the device's `cos` and `acos` leave, which WGSL bounds only loosely.
|
|
30
|
+
*
|
|
31
|
+
* That root is used only for its eigenvector `v`. `B − βI` has rank two, and the longest cross
|
|
32
|
+
* product of two of its rows is normal to both. The complement of `v` is built from `v`'s own
|
|
33
|
+
* components (Eberly's `ComputeOrthogonalComplement`): `u` is `v` crossed with `e_y` or `e_x`,
|
|
34
|
+
* whichever `v` leans on less, and `w = v × u`. So `u` and `w` are off from `v` by no more than the
|
|
35
|
+
* rounding of `v`'s smaller components. That matters, because any component of `v` in the plane
|
|
36
|
+
* lets σ_max leak into the plane's values, which feel it squared and amplified by (σ_max / σ_mid)².
|
|
37
|
+
*
|
|
38
|
+
* Every value returned is measured on M itself, because a small singular value cannot come from
|
|
39
|
+
* `MᵀM`: its rounding is absolute, at the scale of σ_max² (Demmel & Veselić 1992). `v` and the plane
|
|
40
|
+
* split M into `|Mv|` and the 3×2 `[Mu Mw]`, whose larger singular value comes out of a 2×2 form
|
|
41
|
+
* with no cancellation in it. That gives σ_max and σ_mid, and σ_min = |det M| / (σ_max · σ_mid).
|
|
42
|
+
*
|
|
43
|
+
* **Contract.**
|
|
44
|
+
*
|
|
45
|
+
* - **Exact when `MᵀM` comes out diagonal**: any axis-aligned scale, the identity and a uniform
|
|
46
|
+
* scale among them. Both values are then square roots of the diagonal's extremes, scaled back by
|
|
47
|
+
* the same power of two, so a uniform scale returns σ_max equal to σ_min, and both are the column
|
|
48
|
+
* lengths to the accuracy of the device's `sqrt`. That matters more than the general case: a
|
|
49
|
+
* conservative bound that answered 5.2 for an unscaled instance would over-refine every ordinary
|
|
50
|
+
* object in a scene to buy correctness for a sheared one.
|
|
51
|
+
* - **Otherwise each value carries a relative error of order `u·K`**, with `u = 2⁻²⁴` and
|
|
52
|
+
* `K = |m₀|·|m₁|·|m₂| / |det M| ≥ 1`. `K` is 1 when the columns are orthogonal: a rotation times
|
|
53
|
+
* any scale, whatever the ratio of the scales. Rounding in `det M`, and in the three images of M,
|
|
54
|
+
* is first order in `u·K`. The eigenvector's own error enters at second order, amplified by
|
|
55
|
+
* (σ_max / σ_mid)². With orthogonal columns `v` lies on an axis to within u / (σ_max / σ_mid), so
|
|
56
|
+
* that term stays below u. Otherwise σ_max / σ_mid is itself bounded by a multiple of K, so the
|
|
57
|
+
* term stays below u·K while u·K is small.
|
|
58
|
+
* - **Either direction for σ_min, so it can over-estimate, but never past the shortest column's
|
|
59
|
+
* length** as f32 computes it. σ_max can only fall short, and never below the longest column's
|
|
60
|
+
* length. Every column is an image of a unit vector, so its length lies in [σ_min, σ_max] exactly,
|
|
61
|
+
* and the result is held to both bounds. It follows that σ_min ≤ σ_max.
|
|
62
|
+
* - **σ_min is zero exactly when `mat3_determinant(M)` is**, or when it underflows. A column or a
|
|
63
|
+
* row of zeros gives exactly zero at every rotation. A matrix that is singular only in exact
|
|
64
|
+
* arithmetic, such as a child turned under a flattened parent, has a determinant of rounding noise,
|
|
65
|
+
* and so a σ_min of the same noise rather than zero. A caller about to divide by a determinant
|
|
66
|
+
* tests that very number: another expansion can differ from this one in rounding, enough to
|
|
67
|
+
* disagree about zero near a singular matrix.
|
|
68
|
+
* - Valid for any finite M. Values below f32's normal range flush where the device flushes.
|
|
27
69
|
*
|
|
28
70
|
* @type {CodeChunk}
|
|
29
71
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_mat3_singular_values.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/shader/chunk/geometry/mat3/chunk_mat3_singular_values.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chunk_mat3_singular_values.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/shader/chunk/geometry/mat3/chunk_mat3_singular_values.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyEG;AACH,yCALU,SAAS,CAuI0B;0BAhNnB,gCAAgC"}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { CodeChunk } from "../../../compiler/CodeChunk.js";
|
|
2
|
+
import { PI_DECLARATION } from "../../math/PI_DECLARATION.js";
|
|
3
|
+
import { chunk_mat3_determinant } from "./chunk_mat3_determinant.js";
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
|
-
* The largest and smallest singular values of a 3×3 matrix.
|
|
6
|
+
* The largest and smallest singular values of a 3×3 matrix. **Expensive but correct**: a couple of
|
|
7
|
+
* hundred ALU operations, a transcendental pair and a handful of square roots, where the longest
|
|
8
|
+
* and shortest column (`mat4_extract_scale`) cost three lengths. Those are the same numbers for any
|
|
9
|
+
* rotation times a scale, and the real-time paths (virtual geometry's cut, the probe clipmap's
|
|
10
|
+
* bricks) read the columns and accept that a shear goes unaccounted. Reach for this only where a
|
|
11
|
+
* shear has to be measured, and not per instance per view per frame.
|
|
5
12
|
*
|
|
6
13
|
* They are what "how much does this transform stretch a distance" actually means: a vector's length
|
|
7
14
|
* is scaled by something between σ_min and σ_max, and both bounds are attained. Column lengths are
|
|
@@ -9,23 +16,60 @@ import { CodeChunk } from "../../../compiler/CodeChunk.js";
|
|
|
9
16
|
* `[[1,0,0],[k,1,0],[0,0,1]]`, every column has length 1 or √(1+k²) while the true ratio grows
|
|
10
17
|
* without bound in `k`. A shear has no scale in any column and stretches space anyway.
|
|
11
18
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* off-diagonal sum is zero, and both values come back as `s`. That matters more than the general
|
|
16
|
-
* case — a conservative bound that answered 5.2 for an unscaled instance would over-refine every
|
|
17
|
-
* ordinary object in a scene to buy correctness for a sheared one.
|
|
19
|
+
* **Method.** M is first scaled by the power of two that brings its largest entry into [1, 2), and
|
|
20
|
+
* the values are scaled back at the end. That is exact, and it keeps every square and product below
|
|
21
|
+
* far inside f32's range whatever the transform's scale.
|
|
18
22
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
23
|
+
* The eigenvalues of `MᵀM` are the squared singular values, and Smith's closed form (1961) gives
|
|
24
|
+
* them as `q + p·β` for the roots `β = 2cos(φ + 2πk/3)` of `β³ − 3β − det B`, with
|
|
25
|
+
* `B = (MᵀM − qI) / p`. Only one root is taken from that form: the one that stands apart from the
|
|
26
|
+
* other two, which is the largest when `det B ≥ 0` and the smallest otherwise (Scherzinger &
|
|
27
|
+
* Dohrmann 2008; Eberly, "A Robust Eigensolver for 3×3 Symmetric Matrices"). The other two are
|
|
28
|
+
* ill-conditioned where two roots meet: `det(B)/2` then sits at ±1, the edge of `acos`'s domain, so
|
|
29
|
+
* one rounding of it moves φ by `acos(1 − 2⁻²⁴)/3 ≈ 1.2e-4`, and those two roots by √3·p times
|
|
30
|
+
* that. For a beam-like scale p is a third of σ_max², which is enough to take σ_min to zero. The
|
|
31
|
+
* root that stands apart is stationary in φ at both edges, and lies at least √3 from the others,
|
|
32
|
+
* where the cubic's slope `3(β² − 1)` is at least 6. One Newton step there squares whatever error
|
|
33
|
+
* the device's `cos` and `acos` leave, which WGSL bounds only loosely.
|
|
34
|
+
*
|
|
35
|
+
* That root is used only for its eigenvector `v`. `B − βI` has rank two, and the longest cross
|
|
36
|
+
* product of two of its rows is normal to both. The complement of `v` is built from `v`'s own
|
|
37
|
+
* components (Eberly's `ComputeOrthogonalComplement`): `u` is `v` crossed with `e_y` or `e_x`,
|
|
38
|
+
* whichever `v` leans on less, and `w = v × u`. So `u` and `w` are off from `v` by no more than the
|
|
39
|
+
* rounding of `v`'s smaller components. That matters, because any component of `v` in the plane
|
|
40
|
+
* lets σ_max leak into the plane's values, which feel it squared and amplified by (σ_max / σ_mid)².
|
|
41
|
+
*
|
|
42
|
+
* Every value returned is measured on M itself, because a small singular value cannot come from
|
|
43
|
+
* `MᵀM`: its rounding is absolute, at the scale of σ_max² (Demmel & Veselić 1992). `v` and the plane
|
|
44
|
+
* split M into `|Mv|` and the 3×2 `[Mu Mw]`, whose larger singular value comes out of a 2×2 form
|
|
45
|
+
* with no cancellation in it. That gives σ_max and σ_mid, and σ_min = |det M| / (σ_max · σ_mid).
|
|
46
|
+
*
|
|
47
|
+
* **Contract.**
|
|
48
|
+
*
|
|
49
|
+
* - **Exact when `MᵀM` comes out diagonal**: any axis-aligned scale, the identity and a uniform
|
|
50
|
+
* scale among them. Both values are then square roots of the diagonal's extremes, scaled back by
|
|
51
|
+
* the same power of two, so a uniform scale returns σ_max equal to σ_min, and both are the column
|
|
52
|
+
* lengths to the accuracy of the device's `sqrt`. That matters more than the general case: a
|
|
53
|
+
* conservative bound that answered 5.2 for an unscaled instance would over-refine every ordinary
|
|
54
|
+
* object in a scene to buy correctness for a sheared one.
|
|
55
|
+
* - **Otherwise each value carries a relative error of order `u·K`**, with `u = 2⁻²⁴` and
|
|
56
|
+
* `K = |m₀|·|m₁|·|m₂| / |det M| ≥ 1`. `K` is 1 when the columns are orthogonal: a rotation times
|
|
57
|
+
* any scale, whatever the ratio of the scales. Rounding in `det M`, and in the three images of M,
|
|
58
|
+
* is first order in `u·K`. The eigenvector's own error enters at second order, amplified by
|
|
59
|
+
* (σ_max / σ_mid)². With orthogonal columns `v` lies on an axis to within u / (σ_max / σ_mid), so
|
|
60
|
+
* that term stays below u. Otherwise σ_max / σ_mid is itself bounded by a multiple of K, so the
|
|
61
|
+
* term stays below u·K while u·K is small.
|
|
62
|
+
* - **Either direction for σ_min, so it can over-estimate, but never past the shortest column's
|
|
63
|
+
* length** as f32 computes it. σ_max can only fall short, and never below the longest column's
|
|
64
|
+
* length. Every column is an image of a unit vector, so its length lies in [σ_min, σ_max] exactly,
|
|
65
|
+
* and the result is held to both bounds. It follows that σ_min ≤ σ_max.
|
|
66
|
+
* - **σ_min is zero exactly when `mat3_determinant(M)` is**, or when it underflows. A column or a
|
|
67
|
+
* row of zeros gives exactly zero at every rotation. A matrix that is singular only in exact
|
|
68
|
+
* arithmetic, such as a child turned under a flattened parent, has a determinant of rounding noise,
|
|
69
|
+
* and so a σ_min of the same noise rather than zero. A caller about to divide by a determinant
|
|
70
|
+
* tests that very number: another expansion can differ from this one in rounding, enough to
|
|
71
|
+
* disagree about zero near a singular matrix.
|
|
72
|
+
* - Valid for any finite M. Values below f32's normal range flush where the device flushes.
|
|
29
73
|
*
|
|
30
74
|
* @type {CodeChunk}
|
|
31
75
|
*
|
|
@@ -38,8 +82,21 @@ export const chunk_mat3_singular_values = CodeChunk.from(
|
|
|
38
82
|
/**
|
|
39
83
|
* @returns (largest, smallest) singular value
|
|
40
84
|
*/
|
|
41
|
-
fn mat3_singular_values(
|
|
42
|
-
|
|
85
|
+
fn mat3_singular_values(input: mat3x3<f32>) -> vec2<f32> {
|
|
86
|
+
/*
|
|
87
|
+
The power of two that takes the largest entry into [1, 2), and its inverse, both built from the
|
|
88
|
+
entry's exponent bits so that each is exact; clamped to the normal exponents, so that a zero
|
|
89
|
+
matrix stays zero and nothing short of infinity overflows.
|
|
90
|
+
*/
|
|
91
|
+
let magnitudes = max(abs(input[0]), max(abs(input[1]), abs(input[2])));
|
|
92
|
+
let exponent = clamp(
|
|
93
|
+
bitcast<u32>(max(magnitudes.x, max(magnitudes.y, magnitudes.z))) & 0x7f800000u,
|
|
94
|
+
0x00800000u, 0x7e800000u
|
|
95
|
+
);
|
|
96
|
+
let unit = bitcast<f32>(exponent);
|
|
97
|
+
let m = input * bitcast<f32>(0x7f000000u - exponent);
|
|
98
|
+
|
|
99
|
+
// MtM: its eigenvalues are the squared singular values, its diagonal the squared column lengths
|
|
43
100
|
let a00 = dot(m[0], m[0]);
|
|
44
101
|
let a11 = dot(m[1], m[1]);
|
|
45
102
|
let a22 = dot(m[2], m[2]);
|
|
@@ -47,45 +104,106 @@ fn mat3_singular_values(m: mat3x3<f32>) -> vec2<f32> {
|
|
|
47
104
|
let a02 = dot(m[0], m[2]);
|
|
48
105
|
let a12 = dot(m[1], m[2]);
|
|
49
106
|
|
|
50
|
-
let
|
|
51
|
-
|
|
52
|
-
if (p1 <= 0.0) {
|
|
53
|
-
// already diagonal — the uniform-scale case lands here, and lands exactly
|
|
54
|
-
let high = max(a00, max(a11, a22));
|
|
55
|
-
let low = min(a00, min(a11, a22));
|
|
107
|
+
let column_longest_squared = max(a00, max(a11, a22));
|
|
108
|
+
let column_shortest_squared = min(a00, min(a11, a22));
|
|
56
109
|
|
|
57
|
-
|
|
58
|
-
}
|
|
110
|
+
let p1 = a01 * a01 + a02 * a02 + a12 * a12;
|
|
59
111
|
|
|
60
|
-
|
|
112
|
+
/*
|
|
113
|
+
B = (MtM - qI) / p has MtM's eigenvectors, with its roots in [-2, 2]. Only v is taken from B,
|
|
114
|
+
and v's rounding reaches the values at second order, so q, 1/p and phi are left to multiply.
|
|
115
|
+
*/
|
|
116
|
+
let q = (a00 + a11 + a22) * (1.0 / 3.0);
|
|
61
117
|
|
|
62
118
|
let d0 = a00 - q;
|
|
63
119
|
let d1 = a11 - q;
|
|
64
120
|
let d2 = a22 - q;
|
|
65
121
|
|
|
66
|
-
let
|
|
122
|
+
let p_squared = (d0 * d0 + d1 * d1 + d2 * d2 + 2.0 * p1) * (1.0 / 6.0);
|
|
67
123
|
|
|
68
|
-
|
|
124
|
+
/*
|
|
125
|
+
Orthogonal columns, whose lengths are the singular values: a uniform scale lands here, exactly.
|
|
126
|
+
So does a matrix whose deviator is too small to normalise B by, which after the scaling is far
|
|
127
|
+
below what f32 resolves, so that the lengths are the values.
|
|
128
|
+
*/
|
|
129
|
+
if (p1 <= 0.0 || !(p_squared > 0.0)) {
|
|
130
|
+
return vec2<f32>(sqrt(column_longest_squared), sqrt(column_shortest_squared)) * unit;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
let inverse_p = inverseSqrt(p_squared);
|
|
69
134
|
|
|
70
|
-
|
|
71
|
-
let
|
|
72
|
-
let
|
|
73
|
-
let
|
|
74
|
-
let
|
|
75
|
-
let
|
|
76
|
-
let b12 = a12 / p;
|
|
135
|
+
let b00 = d0 * inverse_p;
|
|
136
|
+
let b11 = d1 * inverse_p;
|
|
137
|
+
let b22 = d2 * inverse_p;
|
|
138
|
+
let b01 = a01 * inverse_p;
|
|
139
|
+
let b02 = a02 * inverse_p;
|
|
140
|
+
let b12 = a12 * inverse_p;
|
|
77
141
|
|
|
78
|
-
let
|
|
142
|
+
let det_b = b00 * (b11 * b22 - b12 * b12)
|
|
79
143
|
- b01 * (b01 * b22 - b12 * b02)
|
|
80
144
|
+ b02 * (b01 * b12 - b11 * b02);
|
|
81
145
|
|
|
82
|
-
//
|
|
83
|
-
|
|
84
|
-
let
|
|
146
|
+
// the root apart from the other two: the largest when det(B) >= 0, the smallest when it is negative
|
|
147
|
+
let phi = acos(clamp(det_b * 0.5, -1.0, 1.0)) * (1.0 / 3.0);
|
|
148
|
+
let root = 2.0 * cos(phi + select(2.0 * PI / 3.0, 0.0, det_b >= 0.0));
|
|
149
|
+
|
|
150
|
+
// one Newton step on beta^3 - 3 beta - det(B), whose slope 3 (beta^2 - 1) is at least 6 there
|
|
151
|
+
let beta = root - (root * root * root - 3.0 * root - det_b) / (3.0 * (root * root - 1.0));
|
|
152
|
+
|
|
153
|
+
// B - beta I has rank two, so its eigenvector is normal to its rows; the longest cross product
|
|
154
|
+
// of two of them is that normal at its most accurate
|
|
155
|
+
let r0 = vec3<f32>(b00 - beta, b01, b02);
|
|
156
|
+
let r1 = vec3<f32>(b01, b11 - beta, b12);
|
|
157
|
+
let r2 = vec3<f32>(b02, b12, b22 - beta);
|
|
158
|
+
|
|
159
|
+
let c01 = cross(r0, r1);
|
|
160
|
+
let c02 = cross(r0, r2);
|
|
161
|
+
let c12 = cross(r1, r2);
|
|
162
|
+
|
|
163
|
+
let l01 = dot(c01, c01);
|
|
164
|
+
let l02 = dot(c02, c02);
|
|
165
|
+
let l12 = dot(c12, c12);
|
|
166
|
+
|
|
167
|
+
let c0 = select(c01, c02, l02 > l01);
|
|
168
|
+
let l0 = max(l01, l02);
|
|
169
|
+
|
|
170
|
+
let v = select(c0, c12, l12 > l0) * inverseSqrt(max(l0, l12));
|
|
171
|
+
|
|
172
|
+
/*
|
|
173
|
+
v's complement from v's own components: v crossed with e_y when v leans more on x than on y,
|
|
174
|
+
with e_x otherwise, so the square being normalised is at least 1/2 and u.v vanishes but for
|
|
175
|
+
the rounding of v's smaller components.
|
|
176
|
+
*/
|
|
177
|
+
let across = select(vec3<f32>(0.0, v.z, -v.y), vec3<f32>(-v.z, 0.0, v.x), abs(v.x) > abs(v.y));
|
|
178
|
+
let u = across * inverseSqrt(dot(across, across));
|
|
179
|
+
let w = cross(v, u);
|
|
180
|
+
|
|
181
|
+
let image_v = m * v;
|
|
182
|
+
let image_u = m * u;
|
|
183
|
+
let image_w = m * w;
|
|
184
|
+
|
|
185
|
+
// the 3x2 [Mu Mw]: its larger squared singular value from the 2x2 Gram, where the root adds to the mean
|
|
186
|
+
let g00 = dot(image_u, image_u);
|
|
187
|
+
let g11 = dot(image_w, image_w);
|
|
188
|
+
let g01 = dot(image_u, image_w);
|
|
189
|
+
|
|
190
|
+
let plane_largest_squared = 0.5 * (g00 + g11) + length(vec2<f32>(0.5 * (g00 - g11), g01));
|
|
191
|
+
let plane_normal = cross(image_u, image_w);
|
|
192
|
+
|
|
193
|
+
let along_v_squared = dot(image_v, image_v);
|
|
194
|
+
|
|
195
|
+
/*
|
|
196
|
+
v is the eigenvector of the largest or of the smallest singular value, and the plane holds
|
|
197
|
+
the other two. Either way the larger of along_v and plane_largest is sigma_max, and the larger
|
|
198
|
+
of along_v * plane_largest and the plane's area is sigma_max * sigma_mid.
|
|
199
|
+
*/
|
|
200
|
+
let largest = sqrt(max(max(along_v_squared, plane_largest_squared), column_longest_squared));
|
|
201
|
+
let largest_two_squared = max(along_v_squared * plane_largest_squared, dot(plane_normal, plane_normal));
|
|
202
|
+
|
|
203
|
+
let determinant_m = abs(mat3_determinant(m));
|
|
85
204
|
|
|
86
|
-
let
|
|
87
|
-
let low = q + 2.0 * p * cos(phi + 2.0 * 3.14159265358979 / 3.0);
|
|
205
|
+
let smallest = select(0.0, determinant_m * inverseSqrt(largest_two_squared), largest_two_squared > 0.0);
|
|
88
206
|
|
|
89
|
-
return vec2<f32>(
|
|
207
|
+
return vec2<f32>(largest, min(smallest, sqrt(column_shortest_squared))) * unit;
|
|
90
208
|
}
|
|
91
|
-
`, []);
|
|
209
|
+
`, [PI_DECLARATION, chunk_mat3_determinant]);
|
package/src/shade/renderer/shader/chunk/geometry/mat4/chunk_mat4_linear_determinant.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_mat4_linear_determinant.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/shader/chunk/geometry/mat4/chunk_mat4_linear_determinant.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chunk_mat4_linear_determinant.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/shader/chunk/geometry/mat4/chunk_mat4_linear_determinant.js"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,4CAFU,SAAS,CAQS;0BAlBF,gCAAgC"}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { CodeChunk } from "../../../compiler/CodeChunk.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { CodeChunk } from "../../../compiler/CodeChunk.js";
|
|
2
|
+
import { chunk_mat3_determinant } from "../mat3/chunk_mat3_determinant.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Determinant of the linear (upper-left 3x3) part of a 4x4 transform. WGSL twin of
|
|
6
|
+
* {@link m4_linear_determinant} — keep the two in step.
|
|
7
|
+
*
|
|
8
|
+
* Negative exactly when the transform reflects, which is what reverses triangle winding and
|
|
9
|
+
* tangent-frame handedness under it.
|
|
10
|
+
*
|
|
11
|
+
* @type {CodeChunk}
|
|
12
|
+
*/
|
|
13
|
+
export const chunk_mat4_linear_determinant = CodeChunk.from(
|
|
14
|
+
//language=WGSL
|
|
15
|
+
`
|
|
16
|
+
fn mat4_linear_determinant( m: mat4x4<f32> ) -> f32{
|
|
17
|
+
return mat3_determinant(mat3x3<f32>(m[0].xyz, m[1].xyz, m[2].xyz));
|
|
18
|
+
}
|
|
19
|
+
`, [chunk_mat3_determinant])
|
package/src/shade/renderer/shader/chunk/geometry/normal/chunk_decode_g_buffer_face_normal.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The face normal from a texel of the G-buffer's PBR target, which holds it in `ba` as
|
|
3
|
+
* {@link chunk_encode_g_buffer_face_normal} writes it.
|
|
4
|
+
*
|
|
5
|
+
* ```wgsl
|
|
6
|
+
* fn decode_g_buffer_face_normal(pbr_texel: vec4<f32>) -> vec3<f32>
|
|
7
|
+
* ```
|
|
8
|
+
*
|
|
9
|
+
* @type {CodeChunk}
|
|
10
|
+
*/
|
|
11
|
+
export const chunk_decode_g_buffer_face_normal: CodeChunk;
|
|
12
|
+
import { CodeChunk } from "../../../compiler/CodeChunk.js";
|
|
13
|
+
//# sourceMappingURL=chunk_decode_g_buffer_face_normal.d.ts.map
|
package/src/shade/renderer/shader/chunk/geometry/normal/chunk_decode_g_buffer_face_normal.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk_decode_g_buffer_face_normal.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/shader/chunk/geometry/normal/chunk_decode_g_buffer_face_normal.js"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,gDAFU,SAAS,CAUZ;0BArBmB,gCAAgC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CodeChunk } from "../../../compiler/CodeChunk.js";
|
|
2
|
+
import { chunk_uv_octahedral_unit_decode } from "../octahedron/chunk_uv_octahedral_unit_decode.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The face normal from a texel of the G-buffer's PBR target, which holds it in `ba` as
|
|
6
|
+
* {@link chunk_encode_g_buffer_face_normal} writes it.
|
|
7
|
+
*
|
|
8
|
+
* ```wgsl
|
|
9
|
+
* fn decode_g_buffer_face_normal(pbr_texel: vec4<f32>) -> vec3<f32>
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* @type {CodeChunk}
|
|
13
|
+
*/
|
|
14
|
+
export const chunk_decode_g_buffer_face_normal = CodeChunk.from(
|
|
15
|
+
//language=WGSL
|
|
16
|
+
`
|
|
17
|
+
fn decode_g_buffer_face_normal(pbr_texel: vec4<f32>) -> vec3<f32> {
|
|
18
|
+
return uv_octahedral_unit_decode(pbr_texel.zw * (255.0 / 254.0));
|
|
19
|
+
}
|
|
20
|
+
`, [
|
|
21
|
+
chunk_uv_octahedral_unit_decode,
|
|
22
|
+
]);
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* A shading normal from the `u32` {@link chunk_encode_g_buffer_normal} packs: octahedral, 16 bits per
|
|
3
|
+
* axis, u in the low half and v in the high half (`unpack2x16unorm`).
|
|
4
|
+
*
|
|
5
|
+
* ```wgsl
|
|
6
|
+
* fn decode_g_buffer_normal(encoded: u32) -> vec3<f32>
|
|
7
|
+
* ```
|
|
8
|
+
*
|
|
9
|
+
* @type {CodeChunk}
|
|
3
10
|
*/
|
|
4
11
|
export const chunk_decode_g_buffer_normal: CodeChunk;
|
|
5
12
|
import { CodeChunk } from "../../../compiler/CodeChunk.js";
|
package/src/shade/renderer/shader/chunk/geometry/normal/chunk_decode_g_buffer_normal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_decode_g_buffer_normal.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/shader/chunk/geometry/normal/chunk_decode_g_buffer_normal.js"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"chunk_decode_g_buffer_normal.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/shader/chunk/geometry/normal/chunk_decode_g_buffer_normal.js"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,2CAFU,SAAS,CAUZ;0BArBmB,gCAAgC"}
|
|
@@ -2,19 +2,21 @@ import { CodeChunk } from "../../../compiler/CodeChunk.js";
|
|
|
2
2
|
import { chunk_uv_octahedral_unit_decode } from "../octahedron/chunk_uv_octahedral_unit_decode.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* A shading normal from the `u32` {@link chunk_encode_g_buffer_normal} packs: octahedral, 16 bits per
|
|
6
|
+
* axis, u in the low half and v in the high half (`unpack2x16unorm`).
|
|
7
|
+
*
|
|
8
|
+
* ```wgsl
|
|
9
|
+
* fn decode_g_buffer_normal(encoded: u32) -> vec3<f32>
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* @type {CodeChunk}
|
|
6
13
|
*/
|
|
7
14
|
export const chunk_decode_g_buffer_normal = CodeChunk.from(
|
|
8
15
|
//language=WGSL
|
|
9
16
|
`
|
|
10
|
-
fn decode_g_buffer_normal(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
let scaled = vec2f(encoded_normal) * normalization_constant;
|
|
14
|
-
|
|
15
|
-
return uv_octahedral_unit_decode(scaled.xy);
|
|
17
|
+
fn decode_g_buffer_normal(encoded: u32) -> vec3<f32> {
|
|
18
|
+
return uv_octahedral_unit_decode(unpack2x16unorm(encoded));
|
|
16
19
|
}
|
|
17
20
|
`, [
|
|
18
21
|
chunk_uv_octahedral_unit_decode,
|
|
19
22
|
]);
|
|
20
|
-
|
package/src/shade/renderer/shader/chunk/geometry/normal/chunk_encode_g_buffer_face_normal.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The G-buffer's face normal as its PBR target stores it in `ba`: octahedral, eight bits per axis. The
|
|
3
|
+
* `unorm8` channels round to the nearest of their 256 codes as they are written; the coordinates are
|
|
4
|
+
* scaled by 254 / 255 first, so a channel holds round(uv × 254) and 254 intervals span the octahedron.
|
|
5
|
+
* An even count puts its centre and its edges on codes, which makes every axis-aligned direction — the
|
|
6
|
+
* floors and walls of built geometry — exact. Any direction comes back within 3√2 / 254 rad (0.957°).
|
|
7
|
+
*
|
|
8
|
+
* The face normal sets directions and thresholds — ray origins, shadow normal offsets, back-face and
|
|
9
|
+
* same-surface tests, the tangent plane a screen-space ray refines on — none of which needs the shading
|
|
10
|
+
* normal's precision.
|
|
11
|
+
*
|
|
12
|
+
* ```wgsl
|
|
13
|
+
* fn encode_g_buffer_face_normal(normal: vec3<f32>) -> vec2<f32>
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* Input must be normalized.
|
|
17
|
+
*
|
|
18
|
+
* @type {CodeChunk}
|
|
19
|
+
*/
|
|
20
|
+
export const chunk_encode_g_buffer_face_normal: CodeChunk;
|
|
21
|
+
import { CodeChunk } from "../../../compiler/CodeChunk.js";
|
|
22
|
+
//# sourceMappingURL=chunk_encode_g_buffer_face_normal.d.ts.map
|
package/src/shade/renderer/shader/chunk/geometry/normal/chunk_encode_g_buffer_face_normal.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk_encode_g_buffer_face_normal.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/shader/chunk/geometry/normal/chunk_encode_g_buffer_face_normal.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;GAkBG;AACH,gDAFU,SAAS,CAWjB;0BA/BwB,gCAAgC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { CodeChunk } from "../../../compiler/CodeChunk.js";
|
|
2
|
+
import { chunk_uv_octahedral_unit_encode } from "../octahedron/chunk_uv_octahedral_unit_encode.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The G-buffer's face normal as its PBR target stores it in `ba`: octahedral, eight bits per axis. The
|
|
6
|
+
* `unorm8` channels round to the nearest of their 256 codes as they are written; the coordinates are
|
|
7
|
+
* scaled by 254 / 255 first, so a channel holds round(uv × 254) and 254 intervals span the octahedron.
|
|
8
|
+
* An even count puts its centre and its edges on codes, which makes every axis-aligned direction — the
|
|
9
|
+
* floors and walls of built geometry — exact. Any direction comes back within 3√2 / 254 rad (0.957°).
|
|
10
|
+
*
|
|
11
|
+
* The face normal sets directions and thresholds — ray origins, shadow normal offsets, back-face and
|
|
12
|
+
* same-surface tests, the tangent plane a screen-space ray refines on — none of which needs the shading
|
|
13
|
+
* normal's precision.
|
|
14
|
+
*
|
|
15
|
+
* ```wgsl
|
|
16
|
+
* fn encode_g_buffer_face_normal(normal: vec3<f32>) -> vec2<f32>
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* Input must be normalized.
|
|
20
|
+
*
|
|
21
|
+
* @type {CodeChunk}
|
|
22
|
+
*/
|
|
23
|
+
export const chunk_encode_g_buffer_face_normal = CodeChunk.from(
|
|
24
|
+
//language=WGSL
|
|
25
|
+
`
|
|
26
|
+
fn encode_g_buffer_face_normal(normal: vec3<f32>) -> vec2<f32> {
|
|
27
|
+
return uv_octahedral_unit_encode(normal) * (254.0 / 255.0);
|
|
28
|
+
}
|
|
29
|
+
`, [
|
|
30
|
+
chunk_uv_octahedral_unit_encode
|
|
31
|
+
]
|
|
32
|
+
);
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* A unit normal as one `u32`: octahedral UV through `pack2x16unorm`, each component the nearest 16-bit
|
|
3
|
+
* code, u in the low half and v in the high half — the format of a mesh's vertex normals
|
|
4
|
+
* (`encode_vertex_normal`). What the G-buffer's `r32uint` normal target holds, and every other texture
|
|
5
|
+
* that stores a normal the same way (GTAO's bent normal).
|
|
6
|
+
*
|
|
7
|
+
* ```wgsl
|
|
8
|
+
* fn encode_g_buffer_normal(normal: vec3<f32>) -> u32
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* Input must be normalized.
|
|
12
|
+
*
|
|
3
13
|
* @type {CodeChunk}
|
|
4
14
|
*/
|
|
5
15
|
export const chunk_encode_g_buffer_normal: CodeChunk;
|