@woosh/meep-engine 3.33.0 → 3.34.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.
Files changed (419) hide show
  1. package/editor/Editor.d.ts.map +1 -1
  2. package/editor/Editor.js +0 -3
  3. package/editor/ecs/component/prototypeObjectEditor.js +1 -165
  4. package/editor/ecs/component/registerBasicTypeEditors.d.ts.map +1 -1
  5. package/editor/ecs/component/registerBasicTypeEditors.js +0 -5
  6. package/editor/ecs/component/registerEngineComponentEditors.d.ts.map +1 -1
  7. package/editor/ecs/component/registerEngineComponentEditors.js +0 -20
  8. package/editor/process/SymbolicDisplayProcess.d.ts.map +1 -1
  9. package/editor/process/SymbolicDisplayProcess.js +100 -106
  10. package/editor/prototypeEditorShell.d.ts.map +1 -1
  11. package/editor/prototypeEditorShell.js +190 -186
  12. package/editor/templates/entity_templates.d.ts.map +1 -1
  13. package/editor/templates/entity_templates.js +10 -27
  14. package/editor/view/makeEntityDecorators.js +2 -2
  15. package/package.json +1 -1
  16. package/src/{engine/graphics/particles/particular/engine → core/geom/3d/aabb}/MovingBoundingBox.d.ts +3 -3
  17. package/src/core/geom/3d/aabb/MovingBoundingBox.d.ts.map +1 -0
  18. package/src/{engine/graphics/particles/particular/engine → core/geom/3d/aabb}/MovingBoundingBox.js +5 -5
  19. package/src/core/math/lookup/RGBA_LUT_HEATMAP_IR.d.ts +3 -0
  20. package/src/core/math/lookup/RGBA_LUT_HEATMAP_IR.d.ts.map +1 -0
  21. package/src/{engine/graphics/particles/particular/engine/parameter/sample → core/math/lookup}/RGBA_LUT_HEATMAP_IR.js +1 -1
  22. package/src/core/math/lookup/RGB_LUT_INFERNO.d.ts +6 -0
  23. package/src/core/math/lookup/RGB_LUT_INFERNO.d.ts.map +1 -0
  24. package/src/{engine/graphics/particles/particular/engine/parameter/sample → core/math/lookup}/RGB_LUT_INFERNO.js +1 -1
  25. package/src/{engine/graphics/particles/particular/engine/parameter/sample → core/math/lookup}/RGB_LUT_TURBO.d.ts +1 -1
  26. package/src/core/math/lookup/RGB_LUT_TURBO.d.ts.map +1 -0
  27. package/src/{engine/graphics/particles/particular/engine/parameter/sample → core/math/lookup}/RGB_LUT_TURBO.js +1 -1
  28. package/src/{engine/graphics/particles/particular/engine/parameter/sample → core/math/lookup}/RGB_LUT_VIRIDIS.d.ts +1 -1
  29. package/src/core/math/lookup/RGB_LUT_VIRIDIS.d.ts.map +1 -0
  30. package/src/{engine/graphics/particles/particular/engine/parameter/sample → core/math/lookup}/RGB_LUT_VIRIDIS.js +1 -1
  31. package/src/engine/animation/AnimatedActions.d.ts.map +1 -1
  32. package/src/engine/animation/AnimatedActions.js +2 -4
  33. package/src/engine/animation/AnimationUtils.d.ts +1 -17
  34. package/src/engine/animation/AnimationUtils.d.ts.map +1 -1
  35. package/src/engine/animation/AnimationUtils.js +138 -246
  36. package/src/engine/ecs/EntityManager.d.ts +1 -1
  37. package/src/engine/ecs/EntityManager.d.ts.map +1 -1
  38. package/src/engine/ecs/EntityManager.js +2 -2
  39. package/src/engine/ecs/storage/binary/SERIALIZATION_COVERAGE.md +268 -275
  40. package/src/engine/ecs/storage/populateEngineSerializationRegistry.d.ts.map +1 -1
  41. package/src/engine/ecs/storage/populateEngineSerializationRegistry.js +0 -10
  42. package/src/engine/graphics/geometry/distribute_points_on_indexed_triangles.d.ts.map +1 -0
  43. package/src/engine/graphics/{particles/particular/engine/utils → geometry}/distribute_points_on_indexed_triangles.js +3 -3
  44. package/src/engine/graphics/{particles/particular/engine/utils/volume → texture/sampler}/lut_to_sampler.d.ts +1 -1
  45. package/src/engine/graphics/texture/sampler/lut_to_sampler.d.ts.map +1 -0
  46. package/src/engine/graphics/{particles/particular/engine/utils/volume → texture/sampler}/lut_to_sampler.js +1 -1
  47. package/src/engine/graphics3/GPUParticleEmitterSystem.d.ts +0 -3
  48. package/src/engine/graphics3/GPUParticleEmitterSystem.d.ts.map +1 -1
  49. package/src/engine/graphics3/GPUParticleEmitterSystem.js +0 -3
  50. package/src/engine/network/NetworkSession.d.ts +1 -1
  51. package/src/engine/network/NetworkSession.js +1 -1
  52. package/src/engine/physics/cloth/MEASUREMENTS.md +115 -0
  53. package/src/engine/physics/cloth/solver/cloth_contact_find.d.ts.map +1 -1
  54. package/src/engine/physics/cloth/solver/cloth_contact_find.js +2 -0
  55. package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.d.ts +9 -0
  56. package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.d.ts.map +1 -1
  57. package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.js +30 -7
  58. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  59. package/src/engine/sound/ecs/audio/AudioEmitterSystem.d.ts.map +1 -1
  60. package/src/engine/sound/ecs/audio/AudioEmitterSystem.js +12 -2
  61. package/src/engine/sound/ecs/audio/LiveEmitterSet.d.ts +11 -2
  62. package/src/engine/sound/ecs/audio/LiveEmitterSet.d.ts.map +1 -1
  63. package/src/engine/sound/ecs/audio/LiveEmitterSet.js +14 -7
  64. package/src/engine/sound/ecs/audio/SpatialAudioIndex.d.ts +6 -15
  65. package/src/engine/sound/ecs/audio/SpatialAudioIndex.d.ts.map +1 -1
  66. package/src/engine/sound/ecs/audio/SpatialAudioIndex.js +161 -174
  67. package/src/shade/device/mock/SoftwareGPUBuffer.d.ts +5 -3
  68. package/src/shade/device/mock/SoftwareGPUBuffer.d.ts.map +1 -1
  69. package/src/shade/device/mock/SoftwareGPUBuffer.js +32 -3
  70. package/src/shade/playground/caldera/main.js +73 -60
  71. package/src/shade/playground/vgeo_runtime/main.js +25 -77
  72. package/src/shade/playground/vgeo_scene/main.js +2231 -2217
  73. package/src/shade/renderer/GraphicsContext.d.ts +7 -0
  74. package/src/shade/renderer/GraphicsContext.d.ts.map +1 -1
  75. package/src/shade/renderer/GraphicsContext.js +11 -2
  76. package/src/shade/renderer/Renderer.d.ts.map +1 -1
  77. package/src/shade/renderer/Renderer.js +38 -0
  78. package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.d.ts +8 -0
  79. package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.d.ts.map +1 -1
  80. package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.js +21 -0
  81. package/src/shade/renderer/extension/RENDER_EXTENSION_DESIGN.md +1 -1
  82. package/src/shade/renderer/geometry/GPUGeometryManager.d.ts.map +1 -1
  83. package/src/shade/renderer/geometry/GPUGeometryManager.js +9 -10
  84. package/src/shade/renderer/geometry/bvh/GPUGeometryBVHManager.d.ts +5 -0
  85. package/src/shade/renderer/geometry/bvh/GPUGeometryBVHManager.d.ts.map +1 -1
  86. package/src/shade/renderer/geometry/bvh/GPUGeometryBVHManager.js +11 -0
  87. package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryPool.d.ts +12 -0
  88. package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryPool.d.ts.map +1 -1
  89. package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryPool.js +25 -0
  90. package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.d.ts +115 -101
  91. package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.d.ts.map +1 -1
  92. package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.js +282 -140
  93. package/src/shade/renderer/geometry/virtual/runtime/REVIEW_LEDGER.md +30 -0
  94. package/src/shade/renderer/geometry/virtual/runtime/RUNTIME_PLAN_2026_09_14.md +4 -1
  95. package/src/shade/renderer/geometry/virtual/runtime/SHADOW_PLAN_2026_09_28.md +536 -0
  96. package/src/shade/renderer/geometry/virtual/runtime/VGeoFeedbackLoop.d.ts +6 -2
  97. package/src/shade/renderer/geometry/virtual/runtime/VGeoFeedbackLoop.d.ts.map +1 -1
  98. package/src/shade/renderer/geometry/virtual/runtime/VGeoFeedbackLoop.js +68 -19
  99. package/src/shade/renderer/geometry/virtual/runtime/VGeoPageFetcher.d.ts +2 -1
  100. package/src/shade/renderer/geometry/virtual/runtime/VGeoPageFetcher.d.ts.map +1 -1
  101. package/src/shade/renderer/geometry/virtual/runtime/VGeoPageFetcher.js +17 -1
  102. package/src/shade/renderer/geometry/virtual/runtime/VGeoResidency.d.ts +4 -0
  103. package/src/shade/renderer/geometry/virtual/runtime/VGeoResidency.d.ts.map +1 -1
  104. package/src/shade/renderer/geometry/virtual/runtime/VGeoResidency.js +42 -12
  105. package/src/shade/renderer/geometry/virtual/runtime/VGeoViewCut.d.ts +93 -12
  106. package/src/shade/renderer/geometry/virtual/runtime/VGeoViewCut.d.ts.map +1 -1
  107. package/src/shade/renderer/geometry/virtual/runtime/VGeoViewCut.js +166 -20
  108. package/src/shade/renderer/geometry/virtual/runtime/cut/VGEO_CUT_PARAMS_STRUCT.d.ts.map +1 -1
  109. package/src/shade/renderer/geometry/virtual/runtime/cut/VGEO_CUT_PARAMS_STRUCT.js +30 -7
  110. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_access.d.ts.map +1 -1
  111. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_access.js +12 -5
  112. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_claim.d.ts.map +1 -1
  113. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_claim.js +2 -2
  114. package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_collect.d.ts.map +1 -1
  115. package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_collect.js +23 -13
  116. package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_queue_remainder.d.ts.map +1 -1
  117. package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_queue_remainder.js +1 -2
  118. package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_seed.d.ts.map +1 -1
  119. package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_seed.js +1 -2
  120. package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_traverse.d.ts.map +1 -1
  121. package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_traverse.js +10 -6
  122. package/src/shade/renderer/geometry/virtual/runtime/cut/vgeo_cut_feedback_layout.d.ts +45 -17
  123. package/src/shade/renderer/geometry/virtual/runtime/cut/vgeo_cut_feedback_layout.d.ts.map +1 -1
  124. package/src/shade/renderer/geometry/virtual/runtime/cut/vgeo_cut_feedback_layout.js +61 -19
  125. package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_if_enabled.d.ts +8 -11
  126. package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_if_enabled.d.ts.map +1 -1
  127. package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_if_enabled.js +9 -16
  128. package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_instances_to_meshlets.d.ts.map +1 -1
  129. package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_instances_to_meshlets.js +25 -10
  130. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_FEEDBACK_OFFSET.js +10 -8
  131. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_INSTANCE_OFFSET.d.ts +1 -0
  132. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_INSTANCE_OFFSET.js +19 -7
  133. package/src/shade/renderer/geometry/virtual/runtime/make_vgeo_page_worker.d.ts +4 -2
  134. package/src/shade/renderer/geometry/virtual/runtime/make_vgeo_page_worker.d.ts.map +1 -1
  135. package/src/shade/renderer/geometry/virtual/runtime/make_vgeo_page_worker.js +4 -2
  136. package/src/shade/renderer/global_illumination/brick4/Brick4LightMap.d.ts +4 -0
  137. package/src/shade/renderer/global_illumination/brick4/Brick4LightMap.d.ts.map +1 -1
  138. package/src/shade/renderer/global_illumination/brick4/Brick4LightMap.js +7 -0
  139. package/src/shade/renderer/global_illumination/lpv/GPULightProbeVolume.d.ts.map +1 -1
  140. package/src/shade/renderer/global_illumination/lpv/GPULightProbeVolume.js +1 -0
  141. package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
  142. package/src/shade/renderer/material/GPUMaterialManager.d.ts.map +1 -1
  143. package/src/shade/renderer/material/GPUMaterialManager.js +2 -0
  144. package/src/shade/renderer/particles/DESIGN.md +4 -10
  145. package/src/shade/renderer/particles/ParticleConstants.d.ts +1 -3
  146. package/src/shade/renderer/particles/ParticleConstants.d.ts.map +1 -1
  147. package/src/shade/renderer/particles/ParticleConstants.js +1 -3
  148. package/src/shade/renderer/particles/shaders/chunk_particle_billboard_vertex.d.ts +3 -4
  149. package/src/shade/renderer/particles/shaders/chunk_particle_billboard_vertex.d.ts.map +1 -1
  150. package/src/shade/renderer/particles/shaders/chunk_particle_billboard_vertex.js +3 -4
  151. package/src/shade/renderer/rasterize/bucket/graph_meshlets_rasterize_by_bucket.d.ts +45 -0
  152. package/src/shade/renderer/rasterize/bucket/graph_meshlets_rasterize_by_bucket.d.ts.map +1 -0
  153. package/src/shade/renderer/rasterize/bucket/graph_meshlets_rasterize_by_bucket.js +99 -0
  154. package/src/shade/renderer/rasterize/bucket/rasterization_opaque_buckets.d.ts +4 -4
  155. package/src/shade/renderer/rasterize/bucket/rasterization_opaque_buckets.js +36 -36
  156. package/src/shade/renderer/rasterize/bucket/shader_gather_bucket.d.ts +15 -0
  157. package/src/shade/renderer/rasterize/bucket/shader_gather_bucket.d.ts.map +1 -0
  158. package/src/shade/renderer/rasterize/bucket/shader_gather_bucket.js +103 -0
  159. package/src/shade/renderer/rasterize/expand/GPUCollectionLimits.d.ts +3 -0
  160. package/src/shade/renderer/rasterize/expand/GPUCollectionLimits.d.ts.map +1 -1
  161. package/src/shade/renderer/rasterize/expand/GPUCollectionLimits.js +6 -1
  162. package/src/shade/renderer/rasterize/expand/bucket/meshlet/graph_extract_meshlets_from_bucket.d.ts +26 -0
  163. package/src/shade/renderer/rasterize/expand/bucket/meshlet/graph_extract_meshlets_from_bucket.d.ts.map +1 -0
  164. package/src/shade/renderer/rasterize/expand/bucket/meshlet/graph_extract_meshlets_from_bucket.js +91 -0
  165. package/src/shade/renderer/rasterize/fast/graph_gather_meshes_from_buckets.d.ts +22 -0
  166. package/src/shade/renderer/rasterize/fast/graph_gather_meshes_from_buckets.d.ts.map +1 -0
  167. package/src/shade/renderer/rasterize/fast/graph_gather_meshes_from_buckets.js +102 -0
  168. package/src/shade/renderer/rasterize/fast/graph_rasterize_scene_fast.d.ts +2 -1
  169. package/src/shade/renderer/rasterize/fast/graph_rasterize_scene_fast.d.ts.map +1 -1
  170. package/src/shade/renderer/rasterize/fast/graph_rasterize_scene_fast.js +28 -24
  171. package/src/shade/renderer/rasterize/standard/graph_rasterize_partial_opaque.d.ts.map +1 -1
  172. package/src/shade/renderer/rasterize/standard/graph_rasterize_partial_opaque.js +32 -28
  173. package/src/shade/renderer/rasterize/standard/graph_rasterize_remaining_opaque.d.ts.map +1 -1
  174. package/src/shade/renderer/rasterize/standard/graph_rasterize_remaining_opaque.js +9 -105
  175. package/src/shade/renderer/scene/GPUInstancesAccelerationStructure.d.ts +5 -0
  176. package/src/shade/renderer/scene/GPUInstancesAccelerationStructure.d.ts.map +1 -1
  177. package/src/shade/renderer/scene/GPUInstancesAccelerationStructure.js +11 -0
  178. package/src/shade/renderer/scene/GPUSceneContext.d.ts +11 -3
  179. package/src/shade/renderer/scene/GPUSceneContext.d.ts.map +1 -1
  180. package/src/shade/renderer/scene/GPUSceneContext.js +93 -21
  181. package/src/shade/renderer/scene/rows/GPUSceneRows.d.ts +4 -1
  182. package/src/shade/renderer/scene/rows/GPUSceneRows.d.ts.map +1 -1
  183. package/src/shade/renderer/scene/rows/GPUSceneRows.js +5 -23
  184. package/src/shade/renderer/shadow/map/GPUSceneShadowmapContext.d.ts.map +1 -1
  185. package/src/shade/renderer/shadow/map/GPUSceneShadowmapContext.js +63 -0
  186. package/src/shade/renderer/shadow/map/SHADOWMAP_VGEO_TAU_SCALE.d.ts +12 -0
  187. package/src/shade/renderer/shadow/map/SHADOWMAP_VGEO_TAU_SCALE.d.ts.map +1 -0
  188. package/src/shade/renderer/shadow/map/SHADOWMAP_VGEO_TAU_SCALE.js +11 -0
  189. package/src/shade/renderer/shadow/map/Shadowmap.d.ts +15 -0
  190. package/src/shade/renderer/shadow/map/Shadowmap.d.ts.map +1 -1
  191. package/src/shade/renderer/shadow/map/Shadowmap.js +17 -0
  192. package/src/shade/renderer/shadow/map/shadowmap_caster_detail_pending.d.ts +25 -0
  193. package/src/shade/renderer/shadow/map/shadowmap_caster_detail_pending.d.ts.map +1 -0
  194. package/src/shade/renderer/shadow/map/shadowmap_caster_detail_pending.js +22 -0
  195. package/src/shade/renderer/shadow/map/shadowmap_update_score.d.ts.map +1 -1
  196. package/src/shade/renderer/shadow/map/shadowmap_update_score.js +5 -2
  197. package/src/shade/renderer/texture/TextureManager.d.ts +2 -1
  198. package/src/shade/renderer/texture/TextureManager.d.ts.map +1 -1
  199. package/src/shade/renderer/texture/TextureManager.js +4 -1
  200. package/src/shade/renderer/texture/mipmaps/WebGPUMipmapGenerator.js +1 -1
  201. package/src/shade/renderer/util/Uint32BufferSamplingStats.d.ts +9 -1
  202. package/src/shade/renderer/util/Uint32BufferSamplingStats.d.ts.map +1 -1
  203. package/src/shade/renderer/util/Uint32BufferSamplingStats.js +55 -5
  204. package/src/shade/renderer/view/ViewManager.d.ts +7 -1
  205. package/src/shade/renderer/view/ViewManager.d.ts.map +1 -1
  206. package/src/shade/renderer/view/ViewManager.js +17 -1
  207. package/src/shade/renderer/volumetrics/GPUSceneVolumetrics.d.ts.map +1 -1
  208. package/src/shade/renderer/volumetrics/GPUSceneVolumetrics.js +1 -0
  209. package/editor/ecs/component/editors/ecs/ParameterLookupTableEditor.d.ts +0 -20
  210. package/editor/ecs/component/editors/ecs/ParameterLookupTableEditor.d.ts.map +0 -1
  211. package/editor/ecs/component/editors/ecs/ParameterLookupTableEditor.js +0 -35
  212. package/editor/ecs/component/editors/ecs/ParameterTrackEditor.d.ts +0 -12
  213. package/editor/ecs/component/editors/ecs/ParameterTrackEditor.d.ts.map +0 -1
  214. package/editor/ecs/component/editors/ecs/ParameterTrackEditor.js +0 -17
  215. package/editor/ecs/component/editors/ecs/ParameterTrackSetEditor.d.ts +0 -14
  216. package/editor/ecs/component/editors/ecs/ParameterTrackSetEditor.d.ts.map +0 -1
  217. package/editor/ecs/component/editors/ecs/ParameterTrackSetEditor.js +0 -18
  218. package/editor/ecs/component/editors/ecs/ParticleEmitterEditor.d.ts +0 -52
  219. package/editor/ecs/component/editors/ecs/ParticleEmitterEditor.d.ts.map +0 -1
  220. package/editor/ecs/component/editors/ecs/ParticleEmitterEditor.js +0 -58
  221. package/editor/ecs/component/editors/ecs/ParticleEmitterLayerEditor.d.ts +0 -47
  222. package/editor/ecs/component/editors/ecs/ParticleEmitterLayerEditor.d.ts.map +0 -1
  223. package/editor/ecs/component/editors/ecs/ParticleEmitterLayerEditor.js +0 -58
  224. package/editor/ecs/component/editors/ecs/SimulationStepDefinitionEditor.d.ts +0 -16
  225. package/editor/ecs/component/editors/ecs/SimulationStepDefinitionEditor.d.ts.map +0 -1
  226. package/editor/ecs/component/editors/ecs/SimulationStepDefinitionEditor.js +0 -21
  227. package/editor/particles/rebuildParticleEmitter.d.ts +0 -11
  228. package/editor/particles/rebuildParticleEmitter.d.ts.map +0 -1
  229. package/editor/particles/rebuildParticleEmitter.js +0 -31
  230. package/editor/process/ParticleEmitterRebuildProcess.d.ts +0 -66
  231. package/editor/process/ParticleEmitterRebuildProcess.d.ts.map +0 -1
  232. package/editor/process/ParticleEmitterRebuildProcess.js +0 -217
  233. package/editor/process/symbolic/ParticleEmitterSymbolicDisplay.d.ts +0 -18
  234. package/editor/process/symbolic/ParticleEmitterSymbolicDisplay.d.ts.map +0 -1
  235. package/editor/process/symbolic/ParticleEmitterSymbolicDisplay.js +0 -140
  236. package/src/engine/animation/removeEntityGenericEffect.d.ts +0 -18
  237. package/src/engine/animation/removeEntityGenericEffect.d.ts.map +0 -1
  238. package/src/engine/animation/removeEntityGenericEffect.js +0 -160
  239. package/src/engine/animation/removeEntityWithMeshParticlesEffect.d.ts +0 -16
  240. package/src/engine/animation/removeEntityWithMeshParticlesEffect.d.ts.map +0 -1
  241. package/src/engine/animation/removeEntityWithMeshParticlesEffect.js +0 -194
  242. package/src/engine/graphics/ecs/sprite/Sprite.d.ts +0 -15
  243. package/src/engine/graphics/ecs/sprite/Sprite.d.ts.map +0 -1
  244. package/src/engine/graphics/ecs/sprite/Sprite.js +0 -14
  245. package/src/engine/graphics/ecs/sprite/SpriteSystemPE.d.ts +0 -11
  246. package/src/engine/graphics/ecs/sprite/SpriteSystemPE.d.ts.map +0 -1
  247. package/src/engine/graphics/ecs/sprite/SpriteSystemPE.js +0 -144
  248. package/src/engine/graphics/particles/particular/engine/MovingBoundingBox.d.ts.map +0 -1
  249. package/src/engine/graphics/particles/particular/engine/ParticularEngine.d.ts +0 -61
  250. package/src/engine/graphics/particles/particular/engine/ParticularEngine.d.ts.map +0 -1
  251. package/src/engine/graphics/particles/particular/engine/ParticularEngine.js +0 -229
  252. package/src/engine/graphics/particles/particular/engine/emitter/EmissionFromType.d.ts +0 -6
  253. package/src/engine/graphics/particles/particular/engine/emitter/EmissionFromType.d.ts.map +0 -1
  254. package/src/engine/graphics/particles/particular/engine/emitter/EmissionFromType.js +0 -8
  255. package/src/engine/graphics/particles/particular/engine/emitter/EmissionShapeType.d.ts +0 -7
  256. package/src/engine/graphics/particles/particular/engine/emitter/EmissionShapeType.d.ts.map +0 -1
  257. package/src/engine/graphics/particles/particular/engine/emitter/EmissionShapeType.js +0 -9
  258. package/src/engine/graphics/particles/particular/engine/emitter/PARTICLE_ATTRIBUTES.d.ts +0 -13
  259. package/src/engine/graphics/particles/particular/engine/emitter/PARTICLE_ATTRIBUTES.d.ts.map +0 -1
  260. package/src/engine/graphics/particles/particular/engine/emitter/PARTICLE_ATTRIBUTES.js +0 -12
  261. package/src/engine/graphics/particles/particular/engine/emitter/PARTICULAR_PARTICLE_SPECIFICATION.d.ts +0 -3
  262. package/src/engine/graphics/particles/particular/engine/emitter/PARTICULAR_PARTICLE_SPECIFICATION.d.ts.map +0 -1
  263. package/src/engine/graphics/particles/particular/engine/emitter/PARTICULAR_PARTICLE_SPECIFICATION.js +0 -84
  264. package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.d.ts +0 -285
  265. package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.d.ts.map +0 -1
  266. package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.js +0 -1201
  267. package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitterFlag.d.ts +0 -19
  268. package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitterFlag.d.ts.map +0 -1
  269. package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitterFlag.js +0 -67
  270. package/src/engine/graphics/particles/particular/engine/emitter/ParticleLayer.d.ts +0 -197
  271. package/src/engine/graphics/particles/particular/engine/emitter/ParticleLayer.d.ts.map +0 -1
  272. package/src/engine/graphics/particles/particular/engine/emitter/ParticleLayer.js +0 -398
  273. package/src/engine/graphics/particles/particular/engine/emitter/ParticleParameters.d.ts +0 -5
  274. package/src/engine/graphics/particles/particular/engine/emitter/ParticleParameters.d.ts.map +0 -1
  275. package/src/engine/graphics/particles/particular/engine/emitter/ParticleParameters.js +0 -4
  276. package/src/engine/graphics/particles/particular/engine/emitter/ParticlePool.d.ts +0 -162
  277. package/src/engine/graphics/particles/particular/engine/emitter/ParticlePool.d.ts.map +0 -1
  278. package/src/engine/graphics/particles/particular/engine/emitter/ParticlePool.js +0 -472
  279. package/src/engine/graphics/particles/particular/engine/emitter/computeEmissionFunction.d.ts +0 -10
  280. package/src/engine/graphics/particles/particular/engine/emitter/computeEmissionFunction.d.ts.map +0 -1
  281. package/src/engine/graphics/particles/particular/engine/emitter/computeEmissionFunction.js +0 -37
  282. package/src/engine/graphics/particles/particular/engine/emitter/distance_to_camera.d.ts +0 -9
  283. package/src/engine/graphics/particles/particular/engine/emitter/distance_to_camera.d.ts.map +0 -1
  284. package/src/engine/graphics/particles/particular/engine/emitter/distance_to_camera.js +0 -25
  285. package/src/engine/graphics/particles/particular/engine/emitter/serde/ParameterLookupTableSerializationAdapter.d.ts +0 -19
  286. package/src/engine/graphics/particles/particular/engine/emitter/serde/ParameterLookupTableSerializationAdapter.d.ts.map +0 -1
  287. package/src/engine/graphics/particles/particular/engine/emitter/serde/ParameterLookupTableSerializationAdapter.js +0 -28
  288. package/src/engine/graphics/particles/particular/engine/emitter/serde/ParticleEmitterSerializationAdapter.d.ts +0 -19
  289. package/src/engine/graphics/particles/particular/engine/emitter/serde/ParticleEmitterSerializationAdapter.d.ts.map +0 -1
  290. package/src/engine/graphics/particles/particular/engine/emitter/serde/ParticleEmitterSerializationAdapter.js +0 -162
  291. package/src/engine/graphics/particles/particular/engine/emitter/serde/ParticleEmitterSerializationUpgrader_0_1.d.ts +0 -5
  292. package/src/engine/graphics/particles/particular/engine/emitter/serde/ParticleEmitterSerializationUpgrader_0_1.d.ts.map +0 -1
  293. package/src/engine/graphics/particles/particular/engine/emitter/serde/ParticleEmitterSerializationUpgrader_0_1.js +0 -103
  294. package/src/engine/graphics/particles/particular/engine/emitter/write_particle_patch_uv.d.ts +0 -8
  295. package/src/engine/graphics/particles/particular/engine/emitter/write_particle_patch_uv.d.ts.map +0 -1
  296. package/src/engine/graphics/particles/particular/engine/emitter/write_particle_patch_uv.js +0 -28
  297. package/src/engine/graphics/particles/particular/engine/parameter/ParameterLookupTable.d.ts +0 -2
  298. package/src/engine/graphics/particles/particular/engine/parameter/ParameterLookupTable.d.ts.map +0 -1
  299. package/src/engine/graphics/particles/particular/engine/parameter/ParameterLookupTable.js +0 -2
  300. package/src/engine/graphics/particles/particular/engine/parameter/ParameterLookupTableFlags.d.ts +0 -2
  301. package/src/engine/graphics/particles/particular/engine/parameter/ParameterLookupTableFlags.d.ts.map +0 -1
  302. package/src/engine/graphics/particles/particular/engine/parameter/ParameterLookupTableFlags.js +0 -2
  303. package/src/engine/graphics/particles/particular/engine/parameter/ParameterSet.d.ts +0 -60
  304. package/src/engine/graphics/particles/particular/engine/parameter/ParameterSet.d.ts.map +0 -1
  305. package/src/engine/graphics/particles/particular/engine/parameter/ParameterSet.js +0 -128
  306. package/src/engine/graphics/particles/particular/engine/parameter/ParameterTrack.d.ts +0 -47
  307. package/src/engine/graphics/particles/particular/engine/parameter/ParameterTrack.d.ts.map +0 -1
  308. package/src/engine/graphics/particles/particular/engine/parameter/ParameterTrack.js +0 -77
  309. package/src/engine/graphics/particles/particular/engine/parameter/ParameterTrackSet.d.ts +0 -45
  310. package/src/engine/graphics/particles/particular/engine/parameter/ParameterTrackSet.d.ts.map +0 -1
  311. package/src/engine/graphics/particles/particular/engine/parameter/ParameterTrackSet.js +0 -93
  312. package/src/engine/graphics/particles/particular/engine/parameter/ParticleParameter.d.ts +0 -95
  313. package/src/engine/graphics/particles/particular/engine/parameter/ParticleParameter.d.ts.map +0 -1
  314. package/src/engine/graphics/particles/particular/engine/parameter/ParticleParameter.js +0 -239
  315. package/src/engine/graphics/particles/particular/engine/parameter/sample/RGBA_LUT_HEATMAP_IR.d.ts +0 -3
  316. package/src/engine/graphics/particles/particular/engine/parameter/sample/RGBA_LUT_HEATMAP_IR.d.ts.map +0 -1
  317. package/src/engine/graphics/particles/particular/engine/parameter/sample/RGB_LUT_INFERNO.d.ts +0 -6
  318. package/src/engine/graphics/particles/particular/engine/parameter/sample/RGB_LUT_INFERNO.d.ts.map +0 -1
  319. package/src/engine/graphics/particles/particular/engine/parameter/sample/RGB_LUT_TURBO.d.ts.map +0 -1
  320. package/src/engine/graphics/particles/particular/engine/parameter/sample/RGB_LUT_VIRIDIS.d.ts.map +0 -1
  321. package/src/engine/graphics/particles/particular/engine/renderers/ParticleRenderer.d.ts +0 -13
  322. package/src/engine/graphics/particles/particular/engine/renderers/ParticleRenderer.d.ts.map +0 -1
  323. package/src/engine/graphics/particles/particular/engine/renderers/ParticleRenderer.js +0 -28
  324. package/src/engine/graphics/particles/particular/engine/renderers/billboard/BILLBOARD_PARTICLE_SPECIFICATION.d.ts +0 -9
  325. package/src/engine/graphics/particles/particular/engine/renderers/billboard/BILLBOARD_PARTICLE_SPECIFICATION.d.ts.map +0 -1
  326. package/src/engine/graphics/particles/particular/engine/renderers/billboard/BILLBOARD_PARTICLE_SPECIFICATION.js +0 -24
  327. package/src/engine/graphics/particles/particular/engine/renderers/billboard/SoftBillboardParticlePool.d.ts +0 -13
  328. package/src/engine/graphics/particles/particular/engine/renderers/billboard/SoftBillboardParticlePool.d.ts.map +0 -1
  329. package/src/engine/graphics/particles/particular/engine/renderers/billboard/SoftBillboardParticlePool.js +0 -27
  330. package/src/engine/graphics/particles/particular/engine/renderers/billboard/SoftBillboardParticleRenderer.d.ts +0 -33
  331. package/src/engine/graphics/particles/particular/engine/renderers/billboard/SoftBillboardParticleRenderer.d.ts.map +0 -1
  332. package/src/engine/graphics/particles/particular/engine/renderers/billboard/SoftBillboardParticleRenderer.js +0 -80
  333. package/src/engine/graphics/particles/particular/engine/shader/ShaderManager.d.ts +0 -49
  334. package/src/engine/graphics/particles/particular/engine/shader/ShaderManager.d.ts.map +0 -1
  335. package/src/engine/graphics/particles/particular/engine/shader/ShaderManager.js +0 -135
  336. package/src/engine/graphics/particles/particular/engine/shader/debugAtlas.d.ts +0 -7
  337. package/src/engine/graphics/particles/particular/engine/shader/debugAtlas.d.ts.map +0 -1
  338. package/src/engine/graphics/particles/particular/engine/shader/debugAtlas.js +0 -14
  339. package/src/engine/graphics/particles/particular/engine/simulator/AbstractSimulationStep.d.ts +0 -41
  340. package/src/engine/graphics/particles/particular/engine/simulator/AbstractSimulationStep.d.ts.map +0 -1
  341. package/src/engine/graphics/particles/particular/engine/simulator/AbstractSimulationStep.js +0 -59
  342. package/src/engine/graphics/particles/particular/engine/simulator/SimulationStepApplyForce.d.ts +0 -4
  343. package/src/engine/graphics/particles/particular/engine/simulator/SimulationStepApplyForce.d.ts.map +0 -1
  344. package/src/engine/graphics/particles/particular/engine/simulator/SimulationStepApplyForce.js +0 -56
  345. package/src/engine/graphics/particles/particular/engine/simulator/SimulationStepCurlNoiseAcceleration.d.ts +0 -4
  346. package/src/engine/graphics/particles/particular/engine/simulator/SimulationStepCurlNoiseAcceleration.d.ts.map +0 -1
  347. package/src/engine/graphics/particles/particular/engine/simulator/SimulationStepCurlNoiseAcceleration.js +0 -84
  348. package/src/engine/graphics/particles/particular/engine/simulator/SimulationStepCurlNoiseVelocity.d.ts +0 -4
  349. package/src/engine/graphics/particles/particular/engine/simulator/SimulationStepCurlNoiseVelocity.d.ts.map +0 -1
  350. package/src/engine/graphics/particles/particular/engine/simulator/SimulationStepCurlNoiseVelocity.js +0 -80
  351. package/src/engine/graphics/particles/particular/engine/simulator/SimulationStepDefinition.d.ts +0 -29
  352. package/src/engine/graphics/particles/particular/engine/simulator/SimulationStepDefinition.d.ts.map +0 -1
  353. package/src/engine/graphics/particles/particular/engine/simulator/SimulationStepDefinition.js +0 -43
  354. package/src/engine/graphics/particles/particular/engine/simulator/SimulationStepFixedPhysics.d.ts +0 -5
  355. package/src/engine/graphics/particles/particular/engine/simulator/SimulationStepFixedPhysics.d.ts.map +0 -1
  356. package/src/engine/graphics/particles/particular/engine/simulator/SimulationStepFixedPhysics.js +0 -104
  357. package/src/engine/graphics/particles/particular/engine/simulator/SimulationStepType.d.ts +0 -9
  358. package/src/engine/graphics/particles/particular/engine/simulator/SimulationStepType.d.ts.map +0 -1
  359. package/src/engine/graphics/particles/particular/engine/simulator/SimulationStepType.js +0 -11
  360. package/src/engine/graphics/particles/particular/engine/simulator/update_parameters.d.ts +0 -9
  361. package/src/engine/graphics/particles/particular/engine/simulator/update_parameters.d.ts.map +0 -1
  362. package/src/engine/graphics/particles/particular/engine/simulator/update_parameters.js +0 -64
  363. package/src/engine/graphics/particles/particular/engine/utils/distributeParticlesOnObject3D.d.ts +0 -9
  364. package/src/engine/graphics/particles/particular/engine/utils/distributeParticlesOnObject3D.d.ts.map +0 -1
  365. package/src/engine/graphics/particles/particular/engine/utils/distributeParticlesOnObject3D.js +0 -172
  366. package/src/engine/graphics/particles/particular/engine/utils/distribute_points_on_indexed_triangles.d.ts.map +0 -1
  367. package/src/engine/graphics/particles/particular/engine/utils/distrubuteParticlesOnMesh.d.ts +0 -20
  368. package/src/engine/graphics/particles/particular/engine/utils/distrubuteParticlesOnMesh.d.ts.map +0 -1
  369. package/src/engine/graphics/particles/particular/engine/utils/distrubuteParticlesOnMesh.js +0 -84
  370. package/src/engine/graphics/particles/particular/engine/utils/volume/AttributeValue.d.ts +0 -81
  371. package/src/engine/graphics/particles/particular/engine/utils/volume/AttributeValue.d.ts.map +0 -1
  372. package/src/engine/graphics/particles/particular/engine/utils/volume/AttributeValue.js +0 -200
  373. package/src/engine/graphics/particles/particular/engine/utils/volume/SamplingFunctionKind.d.ts +0 -6
  374. package/src/engine/graphics/particles/particular/engine/utils/volume/SamplingFunctionKind.d.ts.map +0 -1
  375. package/src/engine/graphics/particles/particular/engine/utils/volume/SamplingFunctionKind.js +0 -8
  376. package/src/engine/graphics/particles/particular/engine/utils/volume/lut_to_sampler.d.ts.map +0 -1
  377. package/src/engine/graphics/particles/particular/group/Operation.d.ts +0 -20
  378. package/src/engine/graphics/particles/particular/group/Operation.d.ts.map +0 -1
  379. package/src/engine/graphics/particles/particular/group/Operation.js +0 -20
  380. package/src/engine/graphics/particles/particular/group/OperationType.d.ts +0 -7
  381. package/src/engine/graphics/particles/particular/group/OperationType.d.ts.map +0 -1
  382. package/src/engine/graphics/particles/particular/group/OperationType.js +0 -9
  383. package/src/engine/graphics/particles/particular/group/ParticleAttribute.d.ts +0 -27
  384. package/src/engine/graphics/particles/particular/group/ParticleAttribute.d.ts.map +0 -1
  385. package/src/engine/graphics/particles/particular/group/ParticleAttribute.js +0 -27
  386. package/src/engine/graphics/particles/particular/group/ParticleAttributeType.d.ts +0 -8
  387. package/src/engine/graphics/particles/particular/group/ParticleAttributeType.d.ts.map +0 -1
  388. package/src/engine/graphics/particles/particular/group/ParticleAttributeType.js +0 -11
  389. package/src/engine/graphics/particles/particular/group/ParticleDataType.d.ts +0 -7
  390. package/src/engine/graphics/particles/particular/group/ParticleDataType.d.ts.map +0 -1
  391. package/src/engine/graphics/particles/particular/group/ParticleDataType.js +0 -10
  392. package/src/engine/graphics/particles/particular/group/ParticleSpecification.d.ts +0 -24
  393. package/src/engine/graphics/particles/particular/group/ParticleSpecification.d.ts.map +0 -1
  394. package/src/engine/graphics/particles/particular/group/ParticleSpecification.js +0 -48
  395. package/src/engine/graphics/particles/particular/group/itemSizeFromAttributeType.d.ts +0 -7
  396. package/src/engine/graphics/particles/particular/group/itemSizeFromAttributeType.d.ts.map +0 -1
  397. package/src/engine/graphics/particles/particular/group/itemSizeFromAttributeType.js +0 -20
  398. package/src/engine/graphics/particles/particular/group/optimizeCommandQueue.d.ts +0 -6
  399. package/src/engine/graphics/particles/particular/group/optimizeCommandQueue.d.ts.map +0 -1
  400. package/src/engine/graphics/particles/particular/group/optimizeCommandQueue.js +0 -162
  401. package/src/engine/graphics/particles/particular/group/typedArrayConstructorFromDataType.d.ts +0 -8
  402. package/src/engine/graphics/particles/particular/group/typedArrayConstructorFromDataType.d.ts.map +0 -1
  403. package/src/engine/graphics/particles/particular/group/typedArrayConstructorFromDataType.js +0 -19
  404. package/src/engine/graphics3/ParticleEmitterSystem.d.ts +0 -77
  405. package/src/engine/graphics3/ParticleEmitterSystem.d.ts.map +0 -1
  406. package/src/engine/graphics3/ParticleEmitterSystem.js +0 -307
  407. package/src/engine/graphics3/ParticleEmitterSystem3.d.ts +0 -10
  408. package/src/engine/graphics3/ParticleEmitterSystem3.d.ts.map +0 -1
  409. package/src/engine/graphics3/ParticleEmitterSystem3.js +0 -10
  410. package/src/engine/graphics3/particles/GPUParticularRenderer.d.ts +0 -61
  411. package/src/engine/graphics3/particles/GPUParticularRenderer.d.ts.map +0 -1
  412. package/src/engine/graphics3/particles/GPUParticularRenderer.js +0 -627
  413. package/src/engine/graphics3/particles/particle_gpu_records.d.ts +0 -85
  414. package/src/engine/graphics3/particles/particle_gpu_records.d.ts.map +0 -1
  415. package/src/engine/graphics3/particles/particle_gpu_records.js +0 -227
  416. package/src/shade/renderer/particles/shaders/shader_particle_render.d.ts +0 -35
  417. package/src/shade/renderer/particles/shaders/shader_particle_render.d.ts.map +0 -1
  418. package/src/shade/renderer/particles/shaders/shader_particle_render.js +0 -135
  419. /package/src/engine/graphics/{particles/particular/engine/utils → geometry}/distribute_points_on_indexed_triangles.d.ts +0 -0
@@ -2,6 +2,12 @@ import { assert } from "../../../../../core/assert.js";
2
2
  import { VGEO_CUT_FLAG_COARSEN } from "./cut/VGEO_CUT_FLAG_COARSEN.js";
3
3
  import { VGEO_CUT_FLAG_CULL } from "./cut/VGEO_CUT_FLAG_CULL.js";
4
4
  import { VGEO_CUT_PARAMS_STRUCT } from "./cut/VGEO_CUT_PARAMS_STRUCT.js";
5
+ import {
6
+ vgeo_feedback_slot_stats,
7
+ vgeo_feedback_slot_want_count,
8
+ vgeo_feedback_slot_wants
9
+ } from "./cut/vgeo_cut_feedback_layout.js";
10
+ import { VGEO_CUT_STAT_COUNT } from "./layout/VGEO_CUT_STAT_COUNT.js";
5
11
  import { vgeo_frontier_words } from "./vgeo_frontier_words.js";
6
12
  import { write_gpu_typed_buffer } from "../../../shader/type/serde/write_gpu_typed_buffer.js";
7
13
 
@@ -27,8 +33,9 @@ let ZEROES = new Uint8Array(0);
27
33
  *
28
34
  * ## Why the params are here and not on the runtime
29
35
  *
30
- * `projection_k` is `screen_height / (2·tan(fov_y/2))`: a property of a render target and a camera,
31
- * which is to say of a view. One buffer on the runtime meant one value for the frame, written from
36
+ * `projection_k` is pixels per unit — `screen_height / (2·tan(fov_y/2))` for a perspective view:
37
+ * a property of a render target and a camera, which is to say of a view. One buffer on the runtime
38
+ * meant one value for the frame, written from
32
39
  * whichever view opened it — so a shadow cascade cut against the main view's projection and
33
40
  * selected a level for a screen it is not drawn to. That is a live defect independent of anything
34
41
  * a kept cut needs, and the fix is that each view writes its own.
@@ -63,11 +70,18 @@ export class VGeoViewCut {
63
70
  #scratch;
64
71
 
65
72
  /**
66
- * `screen_height / (2 · tan(fov_y / 2))`, this view's.
73
+ * Pixels per unit, this view's; see {@link set_projection}.
67
74
  * @type {number}
68
75
  */
69
76
  #projection_k = 1;
70
77
 
78
+ /**
79
+ * 1 when distance divides this view's projected error, 0 when it does not; see
80
+ * {@link set_projection}.
81
+ * @type {number}
82
+ */
83
+ #distance_weight = 1;
84
+
71
85
  /**
72
86
  * One bit per page row: the pages this view's cut drew from, kept between frames.
73
87
  * Undefined until the first frame that knows how big the tier is.
@@ -80,6 +94,36 @@ export class VGeoViewCut {
80
94
  */
81
95
  #frontier_word_count = 0;
82
96
 
97
+ /**
98
+ * How much coarser than the runtime's threshold this view cuts: its τ is `runtime.tau ×
99
+ * tau_scale`. A scale rather than a τ of its own, so the runtime's τ stays the one lever — a
100
+ * view set to twice the error stays twice it wherever the lever goes. Nothing in the runtime
101
+ * knows what kind of view this is; whoever owns the view may set it.
102
+ *
103
+ * @type {number}
104
+ */
105
+ tau_scale = 1;
106
+
107
+ /**
108
+ * This view's wavefront bound as its own readings have raised it; 0 until one has. The view cuts
109
+ * at the larger of this and the runtime's starting bound — see {@link iterations_under}.
110
+ *
111
+ * @type {number}
112
+ */
113
+ #max_iterations = 0;
114
+
115
+ /**
116
+ * @type {number}
117
+ */
118
+ #iteration_escalations = 0;
119
+
120
+ /**
121
+ * What the last reading of this view's slot said, indexed by `VGEO_CUT_STAT`.
122
+ *
123
+ * @type {Uint32Array}
124
+ */
125
+ stats = new Uint32Array(VGEO_CUT_STAT_COUNT);
126
+
83
127
  /**
84
128
  * @param {Object} options
85
129
  * @param {GPUDevice} options.device
@@ -116,6 +160,13 @@ export class VGeoViewCut {
116
160
  return this.#projection_k;
117
161
  }
118
162
 
163
+ /**
164
+ * @returns {number}
165
+ */
166
+ get distance_weight() {
167
+ return this.#distance_weight;
168
+ }
169
+
119
170
  /**
120
171
  * Where this view's last cut stood, as one bit per page row.
121
172
  *
@@ -192,53 +243,148 @@ export class VGeoViewCut {
192
243
  }
193
244
 
194
245
  /**
195
- * Take this view's projection from the target it draws to and the camera it draws with.
246
+ * Take this view's projection from the target it draws to and the matrix it draws with.
247
+ *
248
+ * **From the matrix, not from the camera's kind.** `P[0]` and `P[5]` are clip units per view
249
+ * unit on each axis for a perspective and an orthographic projection alike, so half of pixels
250
+ * times either is pixels per unit: `height / (2·tan(fov_y/2))` for this engine's infinite
251
+ * reverse-Z perspective, and `height / (top − bottom)` for its reverse-Z orthographic. The finer
252
+ * of the two axes is taken, which is the one a cascade needs — its rect is square and its
253
+ * extent is not — and which for a perspective view whose aspect matches its target is the
254
+ * same number either way. `−P[11]` is 1 for perspective, whose clip w is the view depth, and 0
255
+ * for orthographic, whose is not; that is the weight distance divides the error by.
256
+ *
257
+ * Anything else is refused: an oblique or otherwise unusual projection has no single pixels per
258
+ * unit, and a cut selected against a guess at one draws a level for a screen nobody has.
196
259
  *
197
260
  * @param {Object} options
198
- * @param {number} options.screen_height pixels of the render target
199
- * @param {number} options.fov_y radians
261
+ * @param {number} options.width pixels of the render target
262
+ * @param {number} options.height pixels of the render target
263
+ * @param {ArrayLike<number>} options.projection_matrix column-major, as `Camera.projection_matrix`
200
264
  * @returns {void}
201
265
  */
202
- set_projection({ screen_height, fov_y }) {
203
- assert.isNumber(screen_height, 'screen_height');
204
- assert.greaterThan(screen_height, 0, 'screen_height');
205
- assert.isNumber(fov_y, 'fov_y');
206
- assert.greaterThan(fov_y, 0, 'fov_y');
266
+ set_projection({ width, height, projection_matrix }) {
267
+ assert.isNumber(width, 'width');
268
+ assert.greaterThan(width, 0, 'width');
269
+ assert.isNumber(height, 'height');
270
+ assert.greaterThan(height, 0, 'height');
271
+ assert.defined(projection_matrix, 'projection_matrix');
272
+
273
+ const m = projection_matrix;
274
+
275
+ assert.ok(
276
+ (m[11] === -1 && m[15] === 0) || (m[11] === 0 && m[15] === 1),
277
+ `projection is neither perspective nor orthographic: P[11] = ${m[11]}, P[15] = ${m[15]}`
278
+ );
279
+
280
+ this.#projection_k = 0.5 * Math.max(width * Math.abs(m[0]), height * Math.abs(m[5]));
281
+ // written out rather than negated, which would make an orthographic weight −0
282
+ this.#distance_weight = m[11] === -1 ? 1 : 0;
283
+ }
284
+
285
+ /**
286
+ * Wavefronts this view's descent may run in a frame of `runtime`: the runtime's starting bound,
287
+ * or what this view's own readings have raised it to.
288
+ *
289
+ * @param {GPUVirtualGeometryRuntime} runtime
290
+ * @returns {number}
291
+ */
292
+ iterations_under(runtime) {
293
+ return Math.max(this.#max_iterations, runtime.max_iterations);
294
+ }
295
+
296
+ /**
297
+ * Times this view's bound has been raised. Zero for the life of almost every view.
298
+ *
299
+ * @returns {number}
300
+ */
301
+ get iteration_escalations() {
302
+ return this.#iteration_escalations;
303
+ }
304
+
305
+ /**
306
+ * A reading of this view's slot saying its descent stopped with work still queued — raise this
307
+ * view's bound and keep it raised.
308
+ *
309
+ * **This is the only place the engine can learn it.** How many wavefronts a cut needs is a
310
+ * function of the frontier's *breadth*, which is a function of the scene, the viewpoint and the
311
+ * render target together; the kernel cannot know it before it runs and the host cannot know it
312
+ * at all. So the bound is guessed low, and the one reading that says the guess was wrong —
313
+ * `VGEO_CUT_STAT.QUEUE_REMAINING`, non-zero exactly when items were abandoned — pays for
314
+ * correcting it. It is the same shape as the rasterizer's meshlet counts, which cannot be known
315
+ * before the expansion runs either and are grown from what the frame reported.
316
+ *
317
+ * **Per view.** One bound for the frame let one hungry view — a far cascade, a point face in the
318
+ * shadow budget for one frame — double every site's ladder for the life of the scene
319
+ * (SHADOW_PLAN_2026_09_28 §2.4).
320
+ *
321
+ * **Doubling, because the reading does not say how much more was needed.** A remainder is a
322
+ * count of *items*, and what they cost in wavefronts depends on how they spill; there is no
323
+ * ratio to convert one into the other. So it goes up by a factor until it drains, which is at
324
+ * most three steps from 8 to the ceiling.
325
+ *
326
+ * **Never lowered.** A frame that drained is evidence about that frame, not that the scene got
327
+ * smaller — and a bound that fell back would re-learn the same lesson every time the camera
328
+ * turned away and back, at a hole a time. An unused wavefront is an empty indirect dispatch,
329
+ * which is the cheap side of that trade.
330
+ *
331
+ * @param {number} remaining items the descent still held when it was abandoned
332
+ * @param {GPUVirtualGeometryRuntime} runtime whose starting bound and ceiling apply
333
+ * @returns {boolean} whether the bound moved
334
+ */
335
+ note_incomplete_descent(remaining, runtime) {
336
+ assert.isNonNegativeInteger(remaining, 'remaining');
337
+ assert.defined(runtime, 'runtime');
338
+
339
+ const current = this.iterations_under(runtime);
340
+
341
+ if (remaining === 0 || current >= runtime.iteration_ceiling) {
342
+ return false;
343
+ }
344
+
345
+ this.#max_iterations = Math.min(current * 2, runtime.iteration_ceiling);
346
+ this.#iteration_escalations++;
207
347
 
208
- this.#projection_k = screen_height / (2 * Math.tan(fov_y * 0.5));
348
+ return true;
209
349
  }
210
350
 
211
351
  /**
212
352
  * Publish the frame's shared settings and this view's own, as one uniform.
213
353
  *
214
- * Everything but `projection_k` and `flags` is a property of the runtime or the frame, so it is
215
- * read from the runtime at write time rather than mirrored here — a second copy of `tau` is a
216
- * second thing to forget to update.
354
+ * Everything but the projection, the threshold's scale, the slot and `flags` is a property of the
355
+ * runtime or the frame, so it is read from the runtime at write time rather than mirrored here —
356
+ * a second copy of `tau` is a second thing to forget to update.
217
357
  *
218
358
  * @param {Object} options
219
359
  * @param {GPUVirtualGeometryRuntime} options.runtime inside an open frame
360
+ * @param {number} options.slot this view's slot in the frame's feedback
220
361
  * @param {boolean} [options.coarsen] whether this view's cut may walk up
221
362
  * @returns {void}
222
363
  */
223
- write_params({ runtime, coarsen = false }) {
364
+ write_params({ runtime, slot, coarsen = false }) {
224
365
  assert.defined(runtime, 'runtime');
366
+ assert.isNonNegativeInteger(slot, 'slot');
225
367
 
226
368
  const layout = runtime.feedback_layout;
227
369
 
228
370
  assert.defined(layout, 'runtime.feedback_layout — begin_frame must have run');
371
+ assert.lessThan(slot, layout.slot_count, 'slot');
229
372
 
230
373
  write_gpu_typed_buffer({
231
- tau: runtime.tau,
374
+ tau: runtime.tau * this.tau_scale,
232
375
  projection_k: this.#projection_k,
376
+ distance_weight: this.#distance_weight,
233
377
  queue_capacity: runtime.queue_capacity,
234
378
  claim_word_count: runtime.claim_word_capacity,
235
379
  descent_steps: runtime.descent_steps,
236
380
  page_slot_words: runtime.pool.page_slot_words,
237
381
  touch_bits_base: layout.touch_bits_base,
238
- want_base: layout.want_base,
239
- want_capacity: runtime.want_capacity,
382
+ stats_base: vgeo_feedback_slot_stats(slot),
383
+ want_count_offset: vgeo_feedback_slot_want_count(slot),
384
+ want_base: vgeo_feedback_slot_wants(layout, slot),
385
+ want_capacity: layout.slot_want_capacity,
240
386
  frontier_word_count: this.#frontier_word_count,
241
- frame_tag: runtime.pool.frame,
387
+ frame_tag: runtime.frame_tag_of(slot),
242
388
  instance_capacity: runtime.instance_capacity,
243
389
  meshlet_capacity: runtime.meshlet_capacity,
244
390
  flags: (runtime.cull_enabled ? VGEO_CUT_FLAG_CULL : 0)
@@ -1 +1 @@
1
- {"version":3,"file":"VGEO_CUT_PARAMS_STRUCT.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/geometry/virtual/runtime/cut/VGEO_CUT_PARAMS_STRUCT.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;GAeG;AACH,kDAiF2B;6BAnGE,yCAAyC"}
1
+ {"version":3,"file":"VGEO_CUT_PARAMS_STRUCT.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/geometry/virtual/runtime/cut/VGEO_CUT_PARAMS_STRUCT.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;GAeG;AACH,kDAwG2B;6BA1HE,yCAAyC"}
@@ -19,17 +19,24 @@ import { WebGPUStruct } from "../../../../shader/type/WebGPUStruct.js";
19
19
  */
20
20
  export const VGEO_CUT_PARAMS_STRUCT = WebGPUStruct.from({
21
21
  /**
22
- * Pixels of permitted error — design §4's single quality/perf lever, defaulting to 1.
22
+ * Pixels of permitted error for this view — design §4's single quality/perf lever, the
23
+ * runtime's `tau` times the view's `tau_scale`.
23
24
  */
24
25
  tau: f32,
25
26
  /**
26
- * `screen_height / (2 * tan(fov_y / 2))` — the projection's numerator, which is a property of
27
- * the render target and the camera rather than of any instance.
27
+ * Pixels per unit — `screen_height / (2 * tan(fov_y / 2))` for a perspective view, pixels over
28
+ * extent for an orthographic one; see `VGeoViewCut.set_projection`. A property of the render
29
+ * target and the camera rather than of any instance.
28
30
  *
29
31
  * The collect pass multiplies it by each instance's own scale correction and stores the result
30
32
  * per instance, so the traversal reads one number and never touches a transform.
31
33
  */
32
34
  projection_k: f32,
35
+ /**
36
+ * 1 for a perspective view, 0 for an orthographic one. Read by the collect pass alone, which
37
+ * copies it into every instance record — see `VGEO_INSTANCE_OFFSET.DISTANCE_WEIGHT`.
38
+ */
39
+ distance_weight: f32,
33
40
  /**
34
41
  * Items one queue holds. The wavefront clamps its own count to this, so an overflowing
35
42
  * iteration loses work rather than dispatching over a buffer's end.
@@ -74,14 +81,30 @@ export const VGEO_CUT_PARAMS_STRUCT = WebGPUStruct.from({
74
81
  * is no list to overflow and nothing per row to clear beyond the transient itself.
75
82
  */
76
83
  touch_bits_base: u32,
84
+ /**
85
+ * Word offset of this view's counters in the feedback buffer — its slot's, so each view's
86
+ * reading says what its own cut did.
87
+ */
88
+ stats_base: u32,
89
+ /**
90
+ * Word offset of this view's want counter, and the next two: where its want slice starts and
91
+ * how many records it holds. A slice per view, so a view recording early in the frame cannot
92
+ * fill the list a later one records into.
93
+ */
94
+ want_count_offset: u32,
77
95
  want_base: u32,
78
96
  want_capacity: u32,
79
97
  /**
80
- * What this frame writes into the want-stamp buffer to claim a want, and what it compares
98
+ * What this view writes into the want-stamp buffer to claim a want, and what it compares
81
99
  * against to dedup one. The stamps are persistent and one per lookup word — one per page of
82
- * every registered geometry — so they are not cleared per frame; a stamp holding this frame's
83
- * tag was written this frame, and any other value was not. Never zero, which is what a fresh
84
- * buffer holds.
100
+ * every registered geometry — so they are not cleared per frame; a stamp holding this tag was
101
+ * written by this view this frame, and any other value was not. Never zero, which is what a
102
+ * fresh buffer holds.
103
+ *
104
+ * **Per view, not per frame.** One tag for the frame let the first view to reach a page stamp it
105
+ * whether or not its list had room — so a full slice silenced every later view's want for that
106
+ * page. With a tag each, each view dedups its own wants into its own slice, and a page two views
107
+ * want is written twice and collapsed by the residency, which finds it pending the second time.
85
108
  */
86
109
  frame_tag: u32,
87
110
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"chunk_vgeo_cut_access.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_access.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AACH,oCAFU,SAAS,CAiHQ;0BAnID,0CAA0C"}
1
+ {"version":3,"file":"chunk_vgeo_cut_access.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_access.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AACH,oCAFU,SAAS,CAwHQ;0BA1ID,0CAA0C"}
@@ -44,9 +44,16 @@ fn vg_instance_eye(instance_base: u32) -> vec3<f32> {
44
44
  }
45
45
 
46
46
  /**
47
- * \`err_px = r_e * screen_height / (2 * tan(fov_y / 2) * d)\`, with \`d\` the distance to the
48
- * **closest point** of the sphere — design §4, and written in that order so that it agrees with
49
- * \`vgeo_select_cut\` term for term rather than merely in the limit.
47
+ * \`err_px = r_e * k / d\`, with \`d\` the distance to the **closest point** of the sphere — design
48
+ * §4, and written in that order so that it agrees with \`vgeo_select_cut\` term for term rather than
49
+ * merely in the limit.
50
+ *
51
+ * **One expression for both projections.** The divisor is \`w * d + (1 - w)\`: at a perspective
52
+ * view's w = 1 it is \`d\`, exactly, and at an orthographic view's w = 0 it is 1 — a parallel
53
+ * projection's error covers the same pixels wherever the cluster is. The inside-the-sphere rule is on
54
+ * the divisor rather than on \`d\`, because an orthographic camera's position is the centre of a box
55
+ * rather than an eye: a cascade's centre usually sits inside a root sphere, and testing \`d\` there
56
+ * would refine the whole asset to its leaves.
50
57
  *
51
58
  * Two conventions carry real weight. A zero error projects to zero **unconditionally**, so a leaf
52
59
  * — whose error is exactly zero — does not become undrawable the moment the camera enters its
@@ -54,7 +61,7 @@ fn vg_instance_eye(instance_base: u32) -> vec3<f32> {
54
61
  * cluster refines; the two rules meet at the same \`if\` and disagreeing about which comes first is
55
62
  * how a leaf disappears at point-blank range.
56
63
  */
57
- fn vg_project(error: f32, sphere: vec4<f32>, eye: vec3<f32>, k: f32) -> f32 {
64
+ fn vg_project(error: f32, sphere: vec4<f32>, eye: vec3<f32>, k: f32, w: f32) -> f32 {
58
65
  if (error == 0.0) {
59
66
  return 0.0;
60
67
  }
@@ -63,7 +70,7 @@ fn vg_project(error: f32, sphere: vec4<f32>, eye: vec3<f32>, k: f32) -> f32 {
63
70
  return VG_PROJECTION_MAX;
64
71
  }
65
72
 
66
- let distance = length(eye - sphere.xyz) - sphere.w;
73
+ let distance = w * (length(eye - sphere.xyz) - sphere.w) + (1.0 - w);
67
74
 
68
75
  if (distance <= 0.0) {
69
76
  return VG_PROJECTION_MAX;
@@ -1 +1 @@
1
- {"version":3,"file":"chunk_vgeo_cut_claim.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_claim.js"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,mCAFU,SAAS,CAiEQ;0BAlGD,0CAA0C"}
1
+ {"version":3,"file":"chunk_vgeo_cut_claim.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_claim.js"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,mCAFU,SAAS,CAkEQ;0BAlGD,0CAA0C"}
@@ -1,6 +1,5 @@
1
1
  import { CodeChunk } from "../../../../shader/compiler/CodeChunk.js";
2
2
  import { VGEO_CUT_STAT } from "../layout/VGEO_CUT_STAT.js";
3
- import { VGEO_FEEDBACK_OFFSET } from "../layout/VGEO_FEEDBACK_OFFSET.js";
4
3
  import { VGEO_INSTANCE_OFFSET } from "../layout/VGEO_INSTANCE_OFFSET.js";
5
4
  import { VGEO_PAGE_ROW_OFFSET } from "../layout/VGEO_PAGE_ROW_OFFSET.js";
6
5
  import { chunk_vgeo_cut_arena } from "./chunk_vgeo_cut_arena.js";
@@ -37,7 +36,8 @@ export const chunk_vgeo_cut_claim = CodeChunk.from(
37
36
  //language=WGSL
38
37
  `
39
38
  fn vg_stat(slot: u32, amount: u32) {
40
- atomicAdd(&feedback[${VGEO_FEEDBACK_OFFSET.STATS}u + slot], amount);
39
+ // this view's counters: every view of a frame has its own, so a reading says what its cut did
40
+ atomicAdd(&feedback[params.stats_base + slot], amount);
41
41
  }
42
42
 
43
43
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"shader_vgeo_cut_collect.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_collect.js"],"names":[],"mappings":"AA2QA,oDAIG;8BAzQ2B,qCAAqC"}
1
+ {"version":3,"file":"shader_vgeo_cut_collect.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_collect.js"],"names":[],"mappings":"AAqRA,oDAIG;8BAnR2B,qCAAqC"}
@@ -11,7 +11,6 @@ import { chunk_mat4_inverse } from "../../../../shader/chunk/geometry/mat4/chunk
11
11
  import { chunk_scene_database_access } from "../../../../scene/chunk_scene_database_access.js";
12
12
  import { ShaderResourceSetDescriptor } from "../../../../shader/resource/ShaderResourceSetDescriptor.js";
13
13
  import { VGEO_CUT_STAT } from "../layout/VGEO_CUT_STAT.js";
14
- import { VGEO_FEEDBACK_OFFSET } from "../layout/VGEO_FEEDBACK_OFFSET.js";
15
14
  import { VGEO_GEOMETRY_ROW_NONE } from "../layout/VGEO_GEOMETRY_ROW_NONE.js";
16
15
  import { VGEO_GEOMETRY_ROW_OFFSET } from "../layout/VGEO_GEOMETRY_ROW_OFFSET.js";
17
16
  import { VGEO_GEOMETRY_ROW_WORDS } from "../layout/VGEO_GEOMETRY_ROW_WORDS.js";
@@ -73,9 +72,11 @@ fn vg_store(base: u32, field: u32, value: f32) {
73
72
  * One frustum plane out of a row combination of the object-space view-projection, normalized so a
74
73
  * sphere test is a plain signed distance.
75
74
  *
76
- * Gribb-Hartmann, and the far plane is simply not extracted: the projection is infinite reverse-Z,
77
- * so its row is degenerate and normalizing it produces nothing a test can use. Ordering near last
78
- * is what makes the traversal's "test the first five" true by construction.
75
+ * Gribb-Hartmann, and the far plane is simply not extracted: a perspective projection is infinite
76
+ * reverse-Z, so its row is degenerate and normalizing it produces nothing a test can use. An
77
+ * orthographic one — a shadow cascade — has a real far plane, and skipping it is conservative:
78
+ * what lies behind a cascade's far plane casts onto nothing it covers, and rasterization clips it.
79
+ * Ordering near last is what makes the traversal's "test the first five" true by construction.
79
80
  *
80
81
  * **The near plane is w − z, and it was w + z here.** Under reverse-Z the near plane is the one
81
82
  * clip space bounds by z <= w; w + z is the row an *infinite* projection makes degenerate, which is
@@ -141,12 +142,16 @@ fn main(@builtin(global_invocation_id) global_id: vec3<u32>) {
141
142
  );
142
143
 
143
144
  /*
144
- Error and distance are both object-space, so a **uniform** scale cancels out of r_e * k / d
145
- exactly and needs no term at all. A non-uniform one does not, and the correction is the ratio
146
- of the largest stretch this transform applies to any direction to the smallest — which is the
147
- ratio of its singular values, not of its column lengths. A shear has unit columns and stretches
148
- space without bound, so column lengths report 1 and under-refine, which is the direction a
149
- conservative correction is not allowed to fail in.
145
+ In perspective, error and distance are both object-space, so a **uniform** scale cancels out of
146
+ r_e * k / d exactly and needs no term at all. A non-uniform one does not, and the correction is
147
+ the ratio of the largest stretch this transform applies to any direction to the smallest —
148
+ which is the ratio of its singular values, not of its column lengths. A shear has unit columns
149
+ and stretches space without bound, so column lengths report 1 and under-refine, which is the
150
+ direction a conservative correction is not allowed to fail in.
151
+
152
+ An orthographic view has no distance for a scale to cancel against: an object-space error
153
+ becomes world units by the largest stretch, and the correction is sigma_max alone. The weight
154
+ picks between them without a branch, and at w = 1 the expression is today's x / y exactly.
150
155
  */
151
156
  let stretch = mat3_singular_values(linear);
152
157
 
@@ -177,7 +182,7 @@ fn main(@builtin(global_invocation_id) global_id: vec3<u32>) {
177
182
  everything — is caught rather than passed through.
178
183
  */
179
184
  atomicAdd(
180
- &feedback[${VGEO_FEEDBACK_OFFSET.STATS}u + ${VGEO_CUT_STAT.INSTANCES_DROPPED}u], 1u
185
+ &feedback[params.stats_base + ${VGEO_CUT_STAT.INSTANCES_DROPPED}u], 1u
181
186
  );
182
187
 
183
188
  return;
@@ -194,7 +199,7 @@ fn main(@builtin(global_invocation_id) global_id: vec3<u32>) {
194
199
  slice draws every page once per parent that reaches it.
195
200
  */
196
201
  atomicAdd(
197
- &feedback[${VGEO_FEEDBACK_OFFSET.STATS}u + ${VGEO_CUT_STAT.INSTANCES_DROPPED}u], 1u
202
+ &feedback[params.stats_base + ${VGEO_CUT_STAT.INSTANCES_DROPPED}u], 1u
198
203
  );
199
204
 
200
205
  return;
@@ -211,11 +216,16 @@ fn main(@builtin(global_invocation_id) global_id: vec3<u32>) {
211
216
  vg_store(base, ${VGEO_INSTANCE_OFFSET.EYE + 1}u, eye.y / eye.w);
212
217
  vg_store(base, ${VGEO_INSTANCE_OFFSET.EYE + 2}u, eye.z / eye.w);
213
218
 
219
+ let w = params.distance_weight;
220
+
214
221
  vg_store(
215
222
  base, ${VGEO_INSTANCE_OFFSET.PROJECTION_K}u,
216
- params.projection_k * (stretch.x / stretch.y)
223
+ params.projection_k * (stretch.x / (w * stretch.y + (1.0 - w)))
217
224
  );
218
225
 
226
+ // with the record rather than read from the params again, so the traversal binds no view's copy
227
+ vg_store(base, ${VGEO_INSTANCE_OFFSET.DISTANCE_WEIGHT}u, w);
228
+
219
229
  // one matrix multiply, and every plane below comes out of it
220
230
  let object_view_projection = camera.view_projection_matrix * node.global;
221
231
 
@@ -1 +1 @@
1
- {"version":3,"file":"shader_vgeo_cut_queue_remainder.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_queue_remainder.js"],"names":[],"mappings":"AAwEA,4DAIG;8BAxE2B,qCAAqC"}
1
+ {"version":3,"file":"shader_vgeo_cut_queue_remainder.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_queue_remainder.js"],"names":[],"mappings":"AAuEA,4DAIG;8BAvE2B,qCAAqC"}
@@ -5,7 +5,6 @@ import { COLLECTION_U32_STRUCT_READ } from "../../../../gpu_primitive/COLLECTION
5
5
  import { ComputeShader } from "../../../../shader/ComputeShader.js";
6
6
  import { ShaderResourceSetDescriptor } from "../../../../shader/resource/ShaderResourceSetDescriptor.js";
7
7
  import { VGEO_CUT_STAT } from "../layout/VGEO_CUT_STAT.js";
8
- import { VGEO_FEEDBACK_OFFSET } from "../layout/VGEO_FEEDBACK_OFFSET.js";
9
8
  import { VGEO_CUT_PARAMS_STRUCT } from "./VGEO_CUT_PARAMS_STRUCT.js";
10
9
 
11
10
  /**
@@ -64,7 +63,7 @@ fn main() {
64
63
  }
65
64
 
66
65
  atomicAdd(
67
- &feedback[${VGEO_FEEDBACK_OFFSET.STATS}u + ${VGEO_CUT_STAT.QUEUE_REMAINING}u],
66
+ &feedback[params.stats_base + ${VGEO_CUT_STAT.QUEUE_REMAINING}u],
68
67
  outstanding
69
68
  );
70
69
  }
@@ -1 +1 @@
1
- {"version":3,"file":"shader_vgeo_cut_seed.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_seed.js"],"names":[],"mappings":"AAsIA,iDAIG;8BArI2B,qCAAqC"}
1
+ {"version":3,"file":"shader_vgeo_cut_seed.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_seed.js"],"names":[],"mappings":"AAqIA,iDAIG;8BApI2B,qCAAqC"}
@@ -8,7 +8,6 @@ import { ShaderResourceSetDescriptor } from "../../../../shader/resource/ShaderR
8
8
  import { chunk_vgeo_cut_claim } from "./chunk_vgeo_cut_claim.js";
9
9
  import { chunk_vgeo_cut_queue } from "./chunk_vgeo_cut_queue.js";
10
10
  import { VGEO_CUT_STAT } from "../layout/VGEO_CUT_STAT.js";
11
- import { VGEO_FEEDBACK_OFFSET } from "../layout/VGEO_FEEDBACK_OFFSET.js";
12
11
  import { VGEO_INSTANCE_OFFSET } from "../layout/VGEO_INSTANCE_OFFSET.js";
13
12
  import { VGEO_INSTANCE_WORDS } from "../layout/VGEO_INSTANCE_WORDS.js";
14
13
  import { VGEO_PAGE_ROW_NONE } from "../layout/VGEO_PAGE_ROW_NONE.js";
@@ -89,7 +88,7 @@ fn main(@builtin(global_invocation_id) global_id: vec3<u32>) {
89
88
 
90
89
  if ((claim_base + capacity + 31u) >> 5u > params.claim_word_count) {
91
90
  atomicAdd(
92
- &feedback[${VGEO_FEEDBACK_OFFSET.STATS}u + ${VGEO_CUT_STAT.INSTANCES_DROPPED}u], 1u
91
+ &feedback[params.stats_base + ${VGEO_CUT_STAT.INSTANCES_DROPPED}u], 1u
93
92
  );
94
93
 
95
94
  // left with a capacity of zero, so nothing downstream can claim on its behalf either
@@ -1 +1 @@
1
- {"version":3,"file":"shader_vgeo_cut_traverse.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_traverse.js"],"names":[],"mappings":"AAm4BA,qDAIG;8BAp4B2B,qCAAqC"}
1
+ {"version":3,"file":"shader_vgeo_cut_traverse.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_traverse.js"],"names":[],"mappings":"AAu4BA,qDAIG;8BAx4B2B,qCAAqC"}
@@ -10,7 +10,6 @@ import { MESHLET_COLLECTION_WRITE_STRUCT } from "../../../../rasterize/MESHLET_C
10
10
  import { MESHLET_DEFINITION_STRUCT } from "../../../meshlet/encoding/MESHLET_DEFINITION_STRUCT.js";
11
11
  import { VGEO_CLUSTER_ROW_OFFSET } from "../layout/VGEO_CLUSTER_ROW_OFFSET.js";
12
12
  import { VGEO_CUT_STAT } from "../layout/VGEO_CUT_STAT.js";
13
- import { VGEO_FEEDBACK_OFFSET } from "../layout/VGEO_FEEDBACK_OFFSET.js";
14
13
  import { VGEO_GROUP_FLAG_SELECTABLE } from "../layout/VGEO_GROUP_FLAG_SELECTABLE.js";
15
14
  import { VGEO_GROUP_ROW_OFFSET } from "../layout/VGEO_GROUP_ROW_OFFSET.js";
16
15
  import { VGEO_INSTANCE_OFFSET } from "../layout/VGEO_INSTANCE_OFFSET.js";
@@ -272,7 +271,8 @@ fn vg_want(source_page_row: u32, child_ref: u32, child_page_index: u32, lookup_b
272
271
  return;
273
272
  }
274
273
 
275
- let slot = atomicAdd(&feedback[${VGEO_FEEDBACK_OFFSET.WANT_COUNT}u], 1u);
274
+ // this view's slice and this view's counter, so an earlier view's full list takes no room here
275
+ let slot = atomicAdd(&feedback[params.want_count_offset], 1u);
276
276
 
277
277
  if (slot >= params.want_capacity) {
278
278
  vg_stat(${VGEO_CUT_STAT.WANTS_DROPPED}u, 1u);
@@ -284,7 +284,9 @@ fn vg_want(source_page_row: u32, child_ref: u32, child_page_index: u32, lookup_b
284
284
  atomicStore(&feedback[base], source_page_row);
285
285
  atomicStore(&feedback[base + 1u], child_ref);
286
286
  atomicStore(&feedback[base + 2u], child_page_index);
287
- atomicStore(&feedback[base + 3u], bitcast<u32>(projected));
287
+ // over this view's own threshold, so the residency can rank wants from views that count in
288
+ // different units at different thresholds on one scale
289
+ atomicStore(&feedback[base + 3u], bitcast<u32>(projected / params.tau));
288
290
  }
289
291
 
290
292
  /**
@@ -354,6 +356,7 @@ fn vg_visit_node(instance_base: u32, page_row: u32, node: u32) -> VGExpand {
354
356
 
355
357
  let eye = vg_instance_eye(instance_base);
356
358
  let k = vg_instance_f32(instance_base, ${VGEO_INSTANCE_OFFSET.PROJECTION_K}u);
359
+ let w = vg_instance_f32(instance_base, ${VGEO_INSTANCE_OFFSET.DISTANCE_WEIGHT}u);
357
360
 
358
361
  /*
359
362
  Format §6.2's load-bearing field. A cluster draws only while project(parent) > tau, so if the
@@ -376,7 +379,7 @@ fn vg_visit_node(instance_base: u32, page_row: u32, node: u32) -> VGExpand {
376
379
  one, and why the frontier is what makes this affordable rather than this pass.
377
380
  */
378
381
  if ((params.flags & ${VGEO_CUT_FLAG_COARSEN}u) == 0u
379
- && vg_project(vg_arena_f32(row + ${VGEO_NODE_ROW_OFFSET.MAX_PARENT_ERROR}u), sphere, eye, k)
382
+ && vg_project(vg_arena_f32(row + ${VGEO_NODE_ROW_OFFSET.MAX_PARENT_ERROR}u), sphere, eye, k, w)
380
383
  <= params.tau) {
381
384
  vg_stat(${VGEO_CUT_STAT.CULLED_LOD}u, 1u);
382
385
  return vg_expand_none();
@@ -473,6 +476,7 @@ fn vg_visit_cluster(
473
476
 
474
477
  let eye = vg_instance_eye(instance_base);
475
478
  let k = vg_instance_f32(instance_base, ${VGEO_INSTANCE_OFFSET.PROJECTION_K}u);
479
+ let w = vg_instance_f32(instance_base, ${VGEO_INSTANCE_OFFSET.DISTANCE_WEIGHT}u);
476
480
  let mesh_index = instances[instance_base + ${VGEO_INSTANCE_OFFSET.MESH_INDEX}u];
477
481
  let lookup_base = instances[instance_base + ${VGEO_INSTANCE_OFFSET.LOOKUP_WORD_OFFSET}u];
478
482
 
@@ -481,7 +485,7 @@ fn vg_visit_cluster(
481
485
  let parent_projected = vg_project(
482
486
  vg_arena_f32(row + ${VGEO_CLUSTER_ROW_OFFSET.PARENT_ERROR}u),
483
487
  vg_sphere_at(row + ${VGEO_CLUSTER_ROW_OFFSET.PARENT_SPHERE}u),
484
- eye, k
488
+ eye, k, w
485
489
  );
486
490
 
487
491
  if (parent_projected <= params.tau) {
@@ -556,7 +560,7 @@ fn vg_visit_cluster(
556
560
  let self_projected = vg_project(
557
561
  vg_arena_f32(row + ${VGEO_CLUSTER_ROW_OFFSET.SELF_ERROR}u),
558
562
  vg_sphere_at(row + ${VGEO_CLUSTER_ROW_OFFSET.SELF_SPHERE}u),
559
- eye, k
563
+ eye, k, w
560
564
  );
561
565
 
562
566
  let child_page_index = vg_arena[row + ${VGEO_CLUSTER_ROW_OFFSET.CHILD_PAGE_INDEX}u];