@woosh/meep-engine 3.68.0 → 3.70.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 (584) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/build/bundle-worker-terrain.js +1 -1
  3. package/editor/ecs/component/editors/ecs/Trail3DEditor.d.ts +2 -17
  4. package/editor/ecs/component/editors/ecs/Trail3DEditor.d.ts.map +1 -1
  5. package/editor/ecs/component/editors/ecs/Trail3DEditor.js +3 -18
  6. package/package.json +1 -1
  7. package/src/core/bvh8/build/BVH8Converter.d.ts +16 -0
  8. package/src/core/bvh8/build/BVH8Converter.d.ts.map +1 -1
  9. package/src/core/bvh8/build/BVH8Converter.js +64 -37
  10. package/src/core/bvh8/build/bvh8_assign_slots_greedy.d.ts +25 -0
  11. package/src/core/bvh8/build/bvh8_assign_slots_greedy.d.ts.map +1 -0
  12. package/src/core/bvh8/build/bvh8_assign_slots_greedy.js +68 -0
  13. package/src/core/bvh8/build/bvh8_from_proxy.d.ts.map +1 -1
  14. package/src/core/bvh8/build/bvh8_from_proxy.js +2 -33
  15. package/src/core/bvh8/build/bvh8_node_fit_slots.d.ts +22 -0
  16. package/src/core/bvh8/build/bvh8_node_fit_slots.d.ts.map +1 -0
  17. package/src/core/bvh8/build/bvh8_node_fit_slots.js +115 -0
  18. package/src/core/bvh8/bvh8_depth.d.ts +8 -0
  19. package/src/core/bvh8/bvh8_depth.d.ts.map +1 -0
  20. package/src/core/bvh8/bvh8_depth.js +39 -0
  21. package/src/core/math/complex/complex_fft_radix2.d.ts +19 -0
  22. package/src/core/math/complex/complex_fft_radix2.d.ts.map +1 -0
  23. package/src/core/math/complex/complex_fft_radix2.js +71 -0
  24. package/src/engine/graphics/ecs/trail3d/Trail3D.d.ts +33 -65
  25. package/src/engine/graphics/ecs/trail3d/Trail3D.d.ts.map +1 -1
  26. package/src/engine/graphics/ecs/trail3d/Trail3D.js +37 -245
  27. package/src/engine/graphics/ecs/trail3d/Trail3DFlags.d.ts +0 -4
  28. package/src/engine/graphics/ecs/trail3d/Trail3DFlags.js +4 -10
  29. package/src/engine/graphics/ecs/trail3d/seed_trail_stroke.d.ts +13 -10
  30. package/src/engine/graphics/ecs/trail3d/seed_trail_stroke.d.ts.map +1 -1
  31. package/src/engine/graphics/ecs/trail3d/seed_trail_stroke.js +28 -37
  32. package/src/engine/graphics/ecs/trail3d/trail_knot_count.d.ts +10 -0
  33. package/src/engine/graphics/ecs/trail3d/trail_knot_count.d.ts.map +1 -0
  34. package/src/engine/graphics/ecs/trail3d/trail_knot_count.js +27 -0
  35. package/src/engine/graphics/trail/TrailKnots.d.ts +62 -0
  36. package/src/engine/graphics/trail/TrailKnots.d.ts.map +1 -0
  37. package/src/engine/graphics/trail/TrailKnots.js +137 -0
  38. package/src/engine/graphics/trail/tube/TubeXMaterialSpec.d.ts +1 -1
  39. package/src/engine/graphics/trail/tube/TubeXMaterialSpec.js +1 -1
  40. package/src/engine/graphics3/EntityRowHold.d.ts +48 -0
  41. package/src/engine/graphics3/EntityRowHold.d.ts.map +1 -0
  42. package/src/engine/graphics3/EntityRowHold.js +128 -0
  43. package/src/engine/graphics3/GPUFluidSystem.d.ts +17 -4
  44. package/src/engine/graphics3/GPUFluidSystem.d.ts.map +1 -1
  45. package/src/engine/graphics3/GPUFluidSystem.js +113 -16
  46. package/src/engine/graphics3/GPUParticleEmitterSystem.d.ts +6 -2
  47. package/src/engine/graphics3/GPUParticleEmitterSystem.d.ts.map +1 -1
  48. package/src/engine/graphics3/GPUParticleEmitterSystem.js +11 -44
  49. package/src/engine/graphics3/Trail3DSystem.d.ts +69 -35
  50. package/src/engine/graphics3/Trail3DSystem.d.ts.map +1 -1
  51. package/src/engine/graphics3/Trail3DSystem.js +380 -81
  52. package/src/engine/physics/cloth/playground/wind_main.js +7 -6
  53. package/src/engine/physics/cloth/wind/AbstractClothWind.d.ts +2 -2
  54. package/src/engine/physics/cloth/wind/AbstractClothWind.js +2 -2
  55. package/src/engine/physics/cloth/wind/ClothFluidWind.d.ts +3 -3
  56. package/src/engine/physics/cloth/wind/ClothFluidWind.d.ts.map +1 -1
  57. package/src/engine/physics/cloth/wind/ClothFluidWind.js +7 -9
  58. package/src/engine/physics/cloth/wind/ClothGPUFluidWind.d.ts +10 -10
  59. package/src/engine/physics/cloth/wind/ClothGPUFluidWind.d.ts.map +1 -1
  60. package/src/engine/physics/cloth/wind/ClothGPUFluidWind.js +14 -22
  61. package/src/engine/physics/fluid/FluidAtmosphere.d.ts +16 -2
  62. package/src/engine/physics/fluid/FluidAtmosphere.d.ts.map +1 -1
  63. package/src/engine/physics/fluid/FluidAtmosphere.js +17 -3
  64. package/src/engine/physics/fluid/ecs/FluidEffectorsComponentSerializationAdapter.d.ts +1 -2
  65. package/src/engine/physics/fluid/ecs/FluidEffectorsComponentSerializationAdapter.d.ts.map +1 -1
  66. package/src/engine/physics/fluid/ecs/FluidEffectorsComponentSerializationAdapter.js +1 -2
  67. package/src/engine/physics/fluid/ecs/FluidEffectorsSystem.d.ts +8 -5
  68. package/src/engine/physics/fluid/ecs/FluidEffectorsSystem.d.ts.map +1 -1
  69. package/src/engine/physics/fluid/ecs/FluidEffectorsSystem.js +60 -17
  70. package/src/engine/physics/fluid/ecs/FluidObstacle.d.ts +17 -0
  71. package/src/engine/physics/fluid/ecs/FluidObstacle.d.ts.map +1 -1
  72. package/src/engine/physics/fluid/ecs/FluidObstacle.js +22 -2
  73. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +6 -5
  74. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts.map +1 -1
  75. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.js +14 -3
  76. package/src/engine/physics/fluid/effector/AbstractFluidEffector.d.ts +1 -1
  77. package/src/engine/physics/fluid/effector/AbstractFluidEffector.js +1 -1
  78. package/src/engine/physics/fluid/effector/GlobalFluidEffector.d.ts +33 -47
  79. package/src/engine/physics/fluid/effector/GlobalFluidEffector.d.ts.map +1 -1
  80. package/src/engine/physics/fluid/effector/GlobalFluidEffector.js +38 -176
  81. package/src/engine/physics/fluid/effector/GlobalFluidEffectorSerializationAdapter.d.ts +8 -11
  82. package/src/engine/physics/fluid/effector/GlobalFluidEffectorSerializationAdapter.d.ts.map +1 -1
  83. package/src/engine/physics/fluid/effector/GlobalFluidEffectorSerializationAdapter.js +13 -24
  84. package/src/engine/physics/fluid/effector/GlobalFluidEffectorSerializationUpgrader_0_1.d.ts +16 -0
  85. package/src/engine/physics/fluid/effector/GlobalFluidEffectorSerializationUpgrader_0_1.d.ts.map +1 -0
  86. package/src/engine/physics/fluid/effector/GlobalFluidEffectorSerializationUpgrader_0_1.js +35 -0
  87. package/src/engine/physics/fluid/fluid_apply_atmosphere.d.ts +1 -1
  88. package/src/engine/physics/fluid/fluid_apply_atmosphere.js +1 -1
  89. package/src/engine/physics/fluid/obstacle/FLUID_OBSTACLE_RECORD_STRUCT.d.ts +9 -1
  90. package/src/engine/physics/fluid/obstacle/FLUID_OBSTACLE_RECORD_STRUCT.d.ts.map +1 -1
  91. package/src/engine/physics/fluid/obstacle/FLUID_OBSTACLE_RECORD_STRUCT.js +11 -1
  92. package/src/engine/physics/fluid/obstacle/fluid_obstacle_record_create.d.ts +5 -0
  93. package/src/engine/physics/fluid/obstacle/fluid_obstacle_record_create.d.ts.map +1 -1
  94. package/src/engine/physics/fluid/obstacle/fluid_obstacle_record_create.js +2 -0
  95. package/src/engine/physics/fluid/obstacle/fluid_obstacle_write_gpu_record.d.ts +4 -3
  96. package/src/engine/physics/fluid/obstacle/fluid_obstacle_write_gpu_record.d.ts.map +1 -1
  97. package/src/engine/physics/fluid/obstacle/fluid_obstacle_write_gpu_record.js +11 -3
  98. package/src/engine/physics/fluid/turbulence/FLUID_TURBULENCE_TILE.d.ts +28 -0
  99. package/src/engine/physics/fluid/turbulence/FLUID_TURBULENCE_TILE.d.ts.map +1 -0
  100. package/src/engine/physics/fluid/turbulence/FLUID_TURBULENCE_TILE.js +29 -0
  101. package/src/engine/physics/fluid/turbulence/fluid_atmosphere_velocity_at.d.ts +16 -0
  102. package/src/engine/physics/fluid/turbulence/fluid_atmosphere_velocity_at.d.ts.map +1 -0
  103. package/src/engine/physics/fluid/turbulence/fluid_atmosphere_velocity_at.js +49 -0
  104. package/src/engine/physics/fluid/turbulence/fluid_turbulence_inverse_tile_size.d.ts +11 -0
  105. package/src/engine/physics/fluid/turbulence/fluid_turbulence_inverse_tile_size.d.ts.map +1 -0
  106. package/src/engine/physics/fluid/turbulence/fluid_turbulence_inverse_tile_size.js +18 -0
  107. package/src/engine/physics/fluid/turbulence/fluid_turbulence_tile_data.d.ts +25 -0
  108. package/src/engine/physics/fluid/turbulence/fluid_turbulence_tile_data.d.ts.map +1 -0
  109. package/src/engine/physics/fluid/turbulence/fluid_turbulence_tile_data.js +65 -0
  110. package/src/engine/physics/fluid/turbulence/fluid_turbulence_tile_generate.d.ts +56 -0
  111. package/src/engine/physics/fluid/turbulence/fluid_turbulence_tile_generate.d.ts.map +1 -0
  112. package/src/engine/physics/fluid/turbulence/fluid_turbulence_tile_generate.js +313 -0
  113. package/src/engine/physics/fluid/turbulence/fluid_turbulence_tile_sample.d.ts +16 -0
  114. package/src/engine/physics/fluid/turbulence/fluid_turbulence_tile_sample.d.ts.map +1 -0
  115. package/src/engine/physics/fluid/turbulence/fluid_turbulence_tile_sample.js +69 -0
  116. package/src/generation/foliage/mesh/branch_ring_triangulate.d.ts +1 -1
  117. package/src/generation/foliage/mesh/branch_ring_triangulate.js +1 -1
  118. package/src/shade/playground/bvh_repro/README.md +8 -6
  119. package/src/shade/playground/bvh_repro/index.html +125 -124
  120. package/src/shade/playground/bvh_repro/main.js +259 -254
  121. package/src/shade/playground/foliage_wind/foliage_world.d.ts.map +1 -1
  122. package/src/shade/playground/foliage_wind/foliage_world.js +7 -4
  123. package/src/shade/playground/grass_surfaces/main.js +3 -2
  124. package/src/shade/playground/particle_ecs/bonfire_wind.d.ts +23 -13
  125. package/src/shade/playground/particle_ecs/bonfire_wind.d.ts.map +1 -1
  126. package/src/shade/playground/particle_ecs/bonfire_wind.js +30 -33
  127. package/src/shade/playground/skinned_blas_refit/README.md +26 -14
  128. package/src/shade/playground/skinned_blas_refit/shader_blas_audit_leaf_triangles.d.ts +14 -9
  129. package/src/shade/playground/skinned_blas_refit/shader_blas_audit_leaf_triangles.d.ts.map +1 -1
  130. package/src/shade/playground/skinned_blas_refit/shader_blas_audit_leaf_triangles.js +126 -127
  131. package/src/shade/playground/skinned_blas_refit/shader_blas_audit_points.js +95 -95
  132. package/src/shade/playground/skinned_blas_refit/shader_blas_audit_visibility.d.ts +9 -1
  133. package/src/shade/playground/skinned_blas_refit/shader_blas_audit_visibility.d.ts.map +1 -1
  134. package/src/shade/playground/skinned_blas_refit/shader_blas_audit_visibility.js +146 -135
  135. package/src/shade/playground/skinned_blas_refit/verify_clone_leaves.d.ts +6 -6
  136. package/src/shade/playground/skinned_blas_refit/verify_clone_leaves.d.ts.map +1 -1
  137. package/src/shade/playground/skinned_blas_refit/verify_clone_leaves.js +148 -134
  138. package/src/shade/playground/skinned_blas_refit/verify_leaf_triangles.d.ts +11 -8
  139. package/src/shade/playground/skinned_blas_refit/verify_leaf_triangles.d.ts.map +1 -1
  140. package/src/shade/playground/skinned_blas_refit/verify_leaf_triangles.js +342 -202
  141. package/src/shade/playground/skinned_blas_refit/verify_skinned_blas_refit.d.ts +12 -13
  142. package/src/shade/playground/skinned_blas_refit/verify_skinned_blas_refit.d.ts.map +1 -1
  143. package/src/shade/playground/skinned_blas_refit/verify_skinned_blas_refit.js +136 -116
  144. package/src/shade/playground/skinned_blas_refit/verify_traversal_reachability.d.ts +4 -4
  145. package/src/shade/playground/skinned_blas_refit/verify_traversal_reachability.d.ts.map +1 -1
  146. package/src/shade/playground/skinned_blas_refit/verify_traversal_reachability.js +255 -249
  147. package/src/shade/playground/trails/index.html +50 -0
  148. package/src/shade/playground/trails/main.d.ts +2 -0
  149. package/src/shade/playground/trails/main.d.ts.map +1 -0
  150. package/src/shade/playground/trails/main.js +258 -0
  151. package/src/shade/playground/water_surface/main.js +6 -3
  152. package/src/shade/renderer/animation/GPUAnimationManager.js +2 -2
  153. package/src/shade/renderer/animation/animation_curve_write_keys.d.ts +18 -0
  154. package/src/shade/renderer/animation/animation_curve_write_keys.d.ts.map +1 -0
  155. package/src/shade/renderer/animation/animation_curve_write_keys.js +34 -0
  156. package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.d.ts.map +1 -1
  157. package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.js +7 -8
  158. package/src/shade/renderer/deferred/tonemap/ColorGrade.d.ts.map +1 -1
  159. package/src/shade/renderer/deferred/tonemap/ColorGrade.js +13 -36
  160. package/src/shade/renderer/dynamic/GPUDynamicMeshResidency.js +2 -2
  161. package/src/shade/renderer/dynamic/chunk_dynamic_mesh_avboit_vertex.d.ts +2 -13
  162. package/src/shade/renderer/dynamic/chunk_dynamic_mesh_avboit_vertex.d.ts.map +1 -1
  163. package/src/shade/renderer/dynamic/chunk_dynamic_mesh_avboit_vertex.js +6 -21
  164. package/src/shade/renderer/dynamic/graph_dynamic_mesh_avboit.d.ts +17 -6
  165. package/src/shade/renderer/dynamic/graph_dynamic_mesh_avboit.d.ts.map +1 -1
  166. package/src/shade/renderer/dynamic/graph_dynamic_mesh_avboit.js +38 -178
  167. package/src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_draw.d.ts +7 -9
  168. package/src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_draw.d.ts.map +1 -1
  169. package/src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_draw.js +17 -106
  170. package/src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_splat.d.ts +7 -17
  171. package/src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_splat.d.ts.map +1 -1
  172. package/src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_splat.js +18 -118
  173. package/src/shade/renderer/fluid/FLUID_FAR_FIELD_STRUCT.d.ts +111 -0
  174. package/src/shade/renderer/fluid/FLUID_FAR_FIELD_STRUCT.d.ts.map +1 -0
  175. package/src/shade/renderer/fluid/FLUID_FAR_FIELD_STRUCT.js +162 -0
  176. package/src/shade/renderer/fluid/GPUFluidCascade.d.ts +37 -8
  177. package/src/shade/renderer/fluid/GPUFluidCascade.d.ts.map +1 -1
  178. package/src/shade/renderer/fluid/GPUFluidCascade.js +149 -47
  179. package/src/shade/renderer/fluid/GPUFluidCascadeStack.d.ts +10 -3
  180. package/src/shade/renderer/fluid/GPUFluidCascadeStack.d.ts.map +1 -1
  181. package/src/shade/renderer/fluid/GPUFluidCascadeStack.js +69 -10
  182. package/src/shade/renderer/fluid/chunk_fluid_far_field.d.ts +19 -0
  183. package/src/shade/renderer/fluid/chunk_fluid_far_field.d.ts.map +1 -0
  184. package/src/shade/renderer/fluid/chunk_fluid_far_field.js +43 -0
  185. package/src/shade/renderer/fluid/coupling/FLUID_CASCADE_PARENT_STRUCT.d.ts +10 -9
  186. package/src/shade/renderer/fluid/coupling/FLUID_CASCADE_PARENT_STRUCT.d.ts.map +1 -1
  187. package/src/shade/renderer/fluid/coupling/FLUID_CASCADE_PARENT_STRUCT.js +14 -12
  188. package/src/shade/renderer/fluid/coupling/FLUID_CASCADE_RESTRICT_STRUCT.d.ts +3 -2
  189. package/src/shade/renderer/fluid/coupling/FLUID_CASCADE_RESTRICT_STRUCT.d.ts.map +1 -1
  190. package/src/shade/renderer/fluid/coupling/FLUID_CASCADE_RESTRICT_STRUCT.js +7 -5
  191. package/src/shade/renderer/fluid/coupling/chunk_fluid_cascade_epilogue.d.ts +17 -9
  192. package/src/shade/renderer/fluid/coupling/chunk_fluid_cascade_epilogue.d.ts.map +1 -1
  193. package/src/shade/renderer/fluid/coupling/chunk_fluid_cascade_epilogue.js +58 -18
  194. package/src/shade/renderer/fluid/coupling/chunk_fluid_cascade_parent.d.ts +23 -11
  195. package/src/shade/renderer/fluid/coupling/chunk_fluid_cascade_parent.d.ts.map +1 -1
  196. package/src/shade/renderer/fluid/coupling/chunk_fluid_cascade_parent.js +371 -335
  197. package/src/shade/renderer/fluid/coupling/shader_fluid_cascade_fill.d.ts.map +1 -1
  198. package/src/shade/renderer/fluid/coupling/shader_fluid_cascade_fill.js +2 -1
  199. package/src/shade/renderer/fluid/coupling/shader_fluid_cascade_ghosts.d.ts.map +1 -1
  200. package/src/shade/renderer/fluid/coupling/shader_fluid_cascade_ghosts.js +109 -108
  201. package/src/shade/renderer/fluid/coupling/shader_fluid_cascade_restrict.d.ts +5 -3
  202. package/src/shade/renderer/fluid/coupling/shader_fluid_cascade_restrict.d.ts.map +1 -1
  203. package/src/shade/renderer/fluid/coupling/shader_fluid_cascade_restrict.js +24 -12
  204. package/src/shade/renderer/fluid/forcing/FLUID_FORCING.d.ts +14 -0
  205. package/src/shade/renderer/fluid/forcing/FLUID_FORCING.d.ts.map +1 -1
  206. package/src/shade/renderer/fluid/forcing/FLUID_FORCING.js +18 -0
  207. package/src/shade/renderer/fluid/forcing/FLUID_FORCING_APPLY_STRUCT.d.ts +3 -1
  208. package/src/shade/renderer/fluid/forcing/FLUID_FORCING_APPLY_STRUCT.d.ts.map +1 -1
  209. package/src/shade/renderer/fluid/forcing/FLUID_FORCING_APPLY_STRUCT.js +4 -1
  210. package/src/shade/renderer/fluid/forcing/GPUFluidForcing.d.ts +9 -0
  211. package/src/shade/renderer/fluid/forcing/GPUFluidForcing.d.ts.map +1 -1
  212. package/src/shade/renderer/fluid/forcing/GPUFluidForcing.js +20 -4
  213. package/src/shade/renderer/fluid/forcing/chunk_fluid_forcing_cell.d.ts +11 -2
  214. package/src/shade/renderer/fluid/forcing/chunk_fluid_forcing_cell.d.ts.map +1 -1
  215. package/src/shade/renderer/fluid/forcing/chunk_fluid_forcing_cell.js +59 -2
  216. package/src/shade/renderer/fluid/forcing/shader_fluid_forcing_apply.d.ts +4 -1
  217. package/src/shade/renderer/fluid/forcing/shader_fluid_forcing_apply.d.ts.map +1 -1
  218. package/src/shade/renderer/fluid/forcing/shader_fluid_forcing_apply.js +367 -341
  219. package/src/shade/renderer/fluid/mac/FLUID_MAC_STEP_STRUCT.d.ts +6 -2
  220. package/src/shade/renderer/fluid/mac/FLUID_MAC_STEP_STRUCT.d.ts.map +1 -1
  221. package/src/shade/renderer/fluid/mac/FLUID_MAC_STEP_STRUCT.js +10 -5
  222. package/src/shade/renderer/fluid/mac/FluidMacPasses.d.ts +20 -21
  223. package/src/shade/renderer/fluid/mac/FluidMacPasses.d.ts.map +1 -1
  224. package/src/shade/renderer/fluid/mac/FluidMacPasses.js +453 -427
  225. package/src/shade/renderer/fluid/mac/shader_fluid_mac_advect_correct.d.ts +6 -2
  226. package/src/shade/renderer/fluid/mac/shader_fluid_mac_advect_correct.d.ts.map +1 -1
  227. package/src/shade/renderer/fluid/mac/shader_fluid_mac_advect_correct.js +340 -282
  228. package/src/shade/renderer/fluid/publish/FluidWindPublish.d.ts +13 -5
  229. package/src/shade/renderer/fluid/publish/FluidWindPublish.d.ts.map +1 -1
  230. package/src/shade/renderer/fluid/publish/FluidWindPublish.js +20 -10
  231. package/src/shade/renderer/fluid/publish/chunk_fluid_wind_publish_cell.d.ts +2 -2
  232. package/src/shade/renderer/fluid/publish/chunk_fluid_wind_publish_cell.js +2 -2
  233. package/src/shade/renderer/fluid/publish/shader_fluid_wind_publish.d.ts +5 -3
  234. package/src/shade/renderer/fluid/publish/shader_fluid_wind_publish.d.ts.map +1 -1
  235. package/src/shade/renderer/fluid/publish/shader_fluid_wind_publish.js +147 -142
  236. package/src/shade/renderer/fluid/query/GPUFluidQueries.js +2 -2
  237. package/src/shade/renderer/geometry/GPUGeometryManager.d.ts.map +1 -1
  238. package/src/shade/renderer/geometry/GPUGeometryManager.js +5 -7
  239. package/src/shade/renderer/geometry/MeshletGeometry.d.ts +4 -1
  240. package/src/shade/renderer/geometry/MeshletGeometry.d.ts.map +1 -1
  241. package/src/shade/renderer/geometry/MeshletGeometry.js +4 -1
  242. package/src/shade/renderer/geometry/MeshletGeometrySerializationAdapter.d.ts +20 -0
  243. package/src/shade/renderer/geometry/MeshletGeometrySerializationAdapter.d.ts.map +1 -1
  244. package/src/shade/renderer/geometry/MeshletGeometrySerializationAdapter.js +35 -3
  245. package/src/shade/renderer/geometry/blas_from_meshlets.d.ts +9 -3
  246. package/src/shade/renderer/geometry/blas_from_meshlets.d.ts.map +1 -1
  247. package/src/shade/renderer/geometry/blas_from_meshlets.js +16 -30
  248. package/src/shade/renderer/geometry/bvh/BLAS8_REFIT_TARGET_STRUCT.d.ts +14 -0
  249. package/src/shade/renderer/geometry/bvh/BLAS8_REFIT_TARGET_STRUCT.d.ts.map +1 -0
  250. package/src/shade/renderer/geometry/bvh/BLAS8_REFIT_TARGET_STRUCT.js +33 -0
  251. package/src/shade/renderer/geometry/bvh/GPUBLASRefitBatch.d.ts +18 -21
  252. package/src/shade/renderer/geometry/bvh/GPUBLASRefitBatch.d.ts.map +1 -1
  253. package/src/shade/renderer/geometry/bvh/GPUBLASRefitBatch.js +78 -158
  254. package/src/shade/renderer/geometry/bvh/GPUGeometryBVHManager.d.ts +18 -39
  255. package/src/shade/renderer/geometry/bvh/GPUGeometryBVHManager.d.ts.map +1 -1
  256. package/src/shade/renderer/geometry/bvh/GPUGeometryBVHManager.js +39 -398
  257. package/src/shade/renderer/geometry/bvh/GPUGeometryMeshletsBVH.d.ts +6 -7
  258. package/src/shade/renderer/geometry/bvh/GPUGeometryMeshletsBVH.d.ts.map +1 -1
  259. package/src/shade/renderer/geometry/bvh/GPUGeometryMeshletsBVH.js +5 -7
  260. package/src/shade/renderer/geometry/bvh/bvh8_build_for_meshlets.d.ts +36 -0
  261. package/src/shade/renderer/geometry/bvh/bvh8_build_for_meshlets.d.ts.map +1 -0
  262. package/src/shade/renderer/geometry/bvh/bvh8_build_for_meshlets.js +179 -0
  263. package/src/shade/renderer/geometry/bvh/meshlet_batch_to_clustered_bvh.d.ts +30 -0
  264. package/src/shade/renderer/geometry/bvh/meshlet_batch_to_clustered_bvh.d.ts.map +1 -0
  265. package/src/shade/renderer/geometry/bvh/meshlet_batch_to_clustered_bvh.js +207 -0
  266. package/src/shade/renderer/geometry/bvh/shader_blas8_refit_batch.d.ts +52 -0
  267. package/src/shade/renderer/geometry/bvh/shader_blas8_refit_batch.d.ts.map +1 -0
  268. package/src/shade/renderer/geometry/bvh/shader_blas8_refit_batch.js +464 -0
  269. package/src/shade/renderer/geometry/meshlet/MeshletBatch.d.ts +12 -0
  270. package/src/shade/renderer/geometry/meshlet/MeshletBatch.d.ts.map +1 -1
  271. package/src/shade/renderer/geometry/meshlet/MeshletBatch.js +37 -0
  272. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_classify.d.ts.map +1 -1
  273. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_classify.js +4 -4
  274. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_evaluate.d.ts.map +1 -1
  275. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_evaluate.js +2 -2
  276. package/src/shade/renderer/geometry/sdf/chunk_blas_query_band_sdf.d.ts.map +1 -1
  277. package/src/shade/renderer/geometry/sdf/chunk_blas_query_band_sdf.js +2 -2
  278. package/src/shade/renderer/geometry/sdf/shader_sdf_visualize.d.ts.map +1 -1
  279. package/src/shade/renderer/geometry/sdf/shader_sdf_visualize.js +4 -4
  280. package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_trace.d.ts.map +1 -1
  281. package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_trace.js +2 -2
  282. package/src/shade/renderer/geometry/sr_create_group_RTX.d.ts.map +1 -1
  283. package/src/shade/renderer/geometry/sr_create_group_RTX.js +4 -4
  284. package/src/shade/renderer/global_illumination/brick4/gpu/bake/brick4_bake_basic.d.ts.map +1 -1
  285. package/src/shade/renderer/global_illumination/brick4/gpu/bake/brick4_bake_basic.js +1 -0
  286. package/src/shade/renderer/global_illumination/lpv/bake/GPULightProbeVolumeRenderer.d.ts.map +1 -1
  287. package/src/shade/renderer/global_illumination/lpv/bake/GPULightProbeVolumeRenderer.js +1 -0
  288. package/src/shade/renderer/global_illumination/lpv/placement/graph_generate_probe_locations.d.ts.map +1 -1
  289. package/src/shade/renderer/global_illumination/lpv/placement/graph_generate_probe_locations.js +372 -376
  290. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK.d.ts +9 -10
  291. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK.d.ts.map +1 -1
  292. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK.js +10 -11
  293. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_walk.d.ts +2 -2
  294. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_walk.js +2 -2
  295. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_gather.d.ts +12 -8
  296. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_gather.d.ts.map +1 -1
  297. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_gather.js +109 -60
  298. package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_mesh_sdf.js +2 -2
  299. package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_mesh_surfaces.js +2 -2
  300. package/src/shade/renderer/gpu_primitive/bvh/BVH_BUFFER_LAYOUT.d.ts +2 -2
  301. package/src/shade/renderer/gpu_primitive/bvh/BVH_BUFFER_LAYOUT.js +70 -70
  302. package/src/shade/renderer/gpu_primitive/bvh/BVH_BUILD_SETTINGS_STRUCT.d.ts +6 -7
  303. package/src/shade/renderer/gpu_primitive/bvh/BVH_BUILD_SETTINGS_STRUCT.d.ts.map +1 -1
  304. package/src/shade/renderer/gpu_primitive/bvh/BVH_BUILD_SETTINGS_STRUCT.js +6 -7
  305. package/src/shade/renderer/gpu_primitive/bvh/graph_bvh_build_lbvh.d.ts +3 -3
  306. package/src/shade/renderer/gpu_primitive/bvh/graph_bvh_build_lbvh.js +3 -3
  307. package/src/shade/renderer/gpu_primitive/bvh/shader_bvh_build_single_workgroup.js +1 -1
  308. package/src/shade/renderer/gpu_primitive/bvh/shader_bvh_emit_hierarchy.d.ts +2 -2
  309. package/src/shade/renderer/gpu_primitive/bvh/shader_bvh_emit_hierarchy.js +3 -3
  310. package/src/shade/renderer/gpu_primitive/bvh8/BVH8_TREE_BUFFER_LAYOUT.d.ts +69 -0
  311. package/src/shade/renderer/gpu_primitive/bvh8/BVH8_TREE_BUFFER_LAYOUT.d.ts.map +1 -0
  312. package/src/shade/renderer/gpu_primitive/bvh8/BVH8_TREE_BUFFER_LAYOUT.js +89 -0
  313. package/src/shade/renderer/gpu_primitive/bvh8/bvh8_encode_from_bvh2.d.ts +41 -0
  314. package/src/shade/renderer/gpu_primitive/bvh8/bvh8_encode_from_bvh2.d.ts.map +1 -0
  315. package/src/shade/renderer/gpu_primitive/bvh8/bvh8_encode_from_bvh2.js +348 -0
  316. package/src/shade/renderer/gpu_primitive/bvh8/check_bvh8_tree.d.ts +34 -0
  317. package/src/shade/renderer/gpu_primitive/bvh8/check_bvh8_tree.d.ts.map +1 -0
  318. package/src/shade/renderer/gpu_primitive/bvh8/check_bvh8_tree.js +291 -0
  319. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_assign.d.ts +31 -0
  320. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_assign.d.ts.map +1 -0
  321. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_assign.js +175 -0
  322. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_depth.d.ts +27 -0
  323. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_depth.d.ts.map +1 -0
  324. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_depth.js +48 -0
  325. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_gather.d.ts +26 -0
  326. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_gather.d.ts.map +1 -0
  327. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_gather.js +118 -0
  328. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_node.d.ts +22 -0
  329. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_node.d.ts.map +1 -0
  330. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_node.js +143 -0
  331. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_sums.d.ts +36 -0
  332. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_sums.d.ts.map +1 -0
  333. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_sums.js +97 -0
  334. package/src/shade/renderer/gpu_primitive/bvh8/graph_bvh8_encode_from_bvh2.d.ts +49 -0
  335. package/src/shade/renderer/gpu_primitive/bvh8/graph_bvh8_encode_from_bvh2.d.ts.map +1 -0
  336. package/src/shade/renderer/gpu_primitive/bvh8/graph_bvh8_encode_from_bvh2.js +265 -0
  337. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_assign.d.ts +37 -0
  338. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_assign.d.ts.map +1 -0
  339. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_assign.js +109 -0
  340. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_count.d.ts +15 -0
  341. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_count.d.ts.map +1 -0
  342. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_count.js +85 -0
  343. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_count_single_workgroup.d.ts +26 -0
  344. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_count_single_workgroup.d.ts.map +1 -0
  345. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_count_single_workgroup.js +200 -0
  346. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_parents.d.ts +19 -0
  347. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_parents.d.ts.map +1 -0
  348. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_parents.js +81 -0
  349. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_write.d.ts +14 -0
  350. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_write.d.ts.map +1 -0
  351. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_write.js +101 -0
  352. package/src/shade/renderer/gpu_primitive/bvh8/verify_gpu_bvh8_encode.d.ts +19 -0
  353. package/src/shade/renderer/gpu_primitive/bvh8/verify_gpu_bvh8_encode.d.ts.map +1 -0
  354. package/src/shade/renderer/gpu_primitive/bvh8/verify_gpu_bvh8_encode.js +361 -0
  355. package/src/shade/renderer/grass/press/shader_grass_press_mark.d.ts +3 -2
  356. package/src/shade/renderer/grass/press/shader_grass_press_mark.d.ts.map +1 -1
  357. package/src/shade/renderer/grass/press/shader_grass_press_mark.js +5 -3
  358. package/src/shade/renderer/grass/surface/shader_grass_surface_bake.d.ts.map +1 -1
  359. package/src/shade/renderer/grass/surface/shader_grass_surface_bake.js +5 -6
  360. package/src/shade/renderer/lightmap/GPULightMap.d.ts.map +1 -1
  361. package/src/shade/renderer/lightmap/GPULightMap.js +1 -0
  362. package/src/shade/renderer/path_tracer/accumulating/AccumulatingPathTracer.d.ts.map +1 -1
  363. package/src/shade/renderer/path_tracer/accumulating/AccumulatingPathTracer.js +1 -0
  364. package/src/shade/renderer/path_tracer/graph_path_trace_scene.d.ts.map +1 -1
  365. package/src/shade/renderer/path_tracer/graph_path_trace_scene.js +1 -0
  366. package/src/shade/renderer/rasterize/native/avboit/avboit_unlit_draw.d.ts +49 -0
  367. package/src/shade/renderer/rasterize/native/avboit/avboit_unlit_draw.d.ts.map +1 -0
  368. package/src/shade/renderer/rasterize/native/avboit/avboit_unlit_draw.js +144 -0
  369. package/src/shade/renderer/rasterize/native/avboit/avboit_unlit_splat.d.ts +71 -0
  370. package/src/shade/renderer/rasterize/native/avboit/avboit_unlit_splat.d.ts.map +1 -0
  371. package/src/shade/renderer/rasterize/native/avboit/avboit_unlit_splat.js +152 -0
  372. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_unlit_varyings.d.ts +21 -0
  373. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_unlit_varyings.d.ts.map +1 -0
  374. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_unlit_varyings.js +30 -0
  375. package/src/shade/renderer/rasterize/native/avboit/graph_avboit_unlit.d.ts +101 -0
  376. package/src/shade/renderer/rasterize/native/avboit/graph_avboit_unlit.d.ts.map +1 -0
  377. package/src/shade/renderer/rasterize/native/avboit/graph_avboit_unlit.js +306 -0
  378. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_splat.d.ts +9 -0
  379. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_splat.d.ts.map +1 -1
  380. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_splat.js +11 -4
  381. package/src/shade/renderer/scene/GPUInstancesAccelerationStructure.d.ts +8 -4
  382. package/src/shade/renderer/scene/GPUInstancesAccelerationStructure.d.ts.map +1 -1
  383. package/src/shade/renderer/scene/GPUInstancesAccelerationStructure.js +60 -33
  384. package/src/shade/renderer/scene/verify_gpu_tlas_build.d.ts +6 -6
  385. package/src/shade/renderer/scene/verify_gpu_tlas_build.d.ts.map +1 -1
  386. package/src/shade/renderer/scene/verify_gpu_tlas_build.js +23 -53
  387. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/BVH8_INODE_STRUCT.d.ts +3 -1
  388. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/BVH8_INODE_STRUCT.d.ts.map +1 -1
  389. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/BVH8_INODE_STRUCT.js +5 -3
  390. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/BVH8_MAX_DEPTH.d.ts +28 -0
  391. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/BVH8_MAX_DEPTH.d.ts.map +1 -0
  392. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/BVH8_MAX_DEPTH.js +29 -0
  393. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_node_grid.d.ts +25 -0
  394. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_node_grid.d.ts.map +1 -0
  395. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_node_grid.js +97 -0
  396. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_node_intersect.d.ts +8 -0
  397. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_node_intersect.d.ts.map +1 -1
  398. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_node_intersect.js +23 -14
  399. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_node_slot_distances.d.ts +36 -0
  400. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_node_slot_distances.d.ts.map +1 -0
  401. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_node_slot_distances.js +222 -0
  402. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_ray_direction_rcp.d.ts +20 -0
  403. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_ray_direction_rcp.d.ts.map +1 -0
  404. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_ray_direction_rcp.js +30 -0
  405. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_tree_read.d.ts +30 -0
  406. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_tree_read.d.ts.map +1 -0
  407. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_tree_read.js +91 -0
  408. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_waiting_slots.d.ts +23 -0
  409. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_waiting_slots.d.ts.map +1 -0
  410. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_waiting_slots.js +40 -0
  411. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_blas_nearest.d.ts +22 -0
  412. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_blas_nearest.d.ts.map +1 -1
  413. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_blas_nearest.js +121 -70
  414. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_blas_occluded.d.ts +13 -1
  415. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_blas_occluded.d.ts.map +1 -1
  416. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_blas_occluded.js +117 -61
  417. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_nearest.d.ts +21 -0
  418. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_nearest.d.ts.map +1 -1
  419. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_nearest.js +111 -72
  420. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_nearest_among.d.ts +1 -2
  421. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_nearest_among.d.ts.map +1 -1
  422. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_nearest_among.js +83 -54
  423. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_occluded.d.ts +14 -0
  424. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_occluded.d.ts.map +1 -1
  425. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_occluded.js +92 -60
  426. package/src/shade/renderer/shader/chunk/sdf/chunk_point_query_blas_nearest.d.ts +22 -0
  427. package/src/shade/renderer/shader/chunk/sdf/chunk_point_query_blas_nearest.d.ts.map +1 -1
  428. package/src/shade/renderer/shader/chunk/sdf/chunk_point_query_blas_nearest.js +153 -106
  429. package/src/shade/renderer/shader/chunk/sdf/chunk_scene_point_query_nearest.d.ts +21 -0
  430. package/src/shade/renderer/shader/chunk/sdf/chunk_scene_point_query_nearest.d.ts.map +1 -1
  431. package/src/shade/renderer/shader/chunk/sdf/chunk_scene_point_query_nearest.js +115 -74
  432. package/src/shade/renderer/shader/chunk/sdf/chunk_scene_sdf_raymarch.d.ts +5 -2
  433. package/src/shade/renderer/shader/chunk/sdf/chunk_scene_sdf_raymarch.d.ts.map +1 -1
  434. package/src/shade/renderer/shader/chunk/sdf/chunk_scene_sdf_raymarch.js +89 -63
  435. package/src/shade/renderer/shader/chunk/sdf/chunk_sdf_query_distance.d.ts +15 -0
  436. package/src/shade/renderer/shader/chunk/sdf/chunk_sdf_query_distance.d.ts.map +1 -1
  437. package/src/shade/renderer/shader/chunk/sdf/chunk_sdf_query_distance.js +108 -63
  438. package/src/shade/renderer/shadow/sdf/chunk_ray_query_sdf_raycast.d.ts +14 -0
  439. package/src/shade/renderer/shadow/sdf/chunk_ray_query_sdf_raycast.d.ts.map +1 -1
  440. package/src/shade/renderer/shadow/sdf/chunk_ray_query_sdf_raycast.js +94 -60
  441. package/src/shade/renderer/shadow/sdf/graph_draw_sdf_shadows.d.ts.map +1 -1
  442. package/src/shade/renderer/shadow/sdf/graph_draw_sdf_shadows.js +4 -4
  443. package/src/shade/renderer/trails/GPUTrailAVBOITChannel.d.ts +69 -0
  444. package/src/shade/renderer/trails/GPUTrailAVBOITChannel.d.ts.map +1 -0
  445. package/src/shade/renderer/trails/GPUTrailAVBOITChannel.js +129 -0
  446. package/src/shade/renderer/trails/GPUTrailSystem.d.ts +164 -0
  447. package/src/shade/renderer/trails/GPUTrailSystem.d.ts.map +1 -0
  448. package/src/shade/renderer/trails/GPUTrailSystem.js +725 -0
  449. package/src/shade/renderer/trails/data/TRAIL_DATABASE_SPEC.d.ts +14 -0
  450. package/src/shade/renderer/trails/data/TRAIL_DATABASE_SPEC.d.ts.map +1 -0
  451. package/src/shade/renderer/trails/data/TRAIL_DATABASE_SPEC.js +38 -0
  452. package/src/shade/renderer/trails/data/TRAIL_KNOT.d.ts +66 -0
  453. package/src/shade/renderer/trails/data/TRAIL_KNOT.d.ts.map +1 -0
  454. package/src/shade/renderer/trails/data/TRAIL_KNOT.js +154 -0
  455. package/src/shade/renderer/trails/data/TRAIL_RECORD.d.ts +19 -0
  456. package/src/shade/renderer/trails/data/TRAIL_RECORD.d.ts.map +1 -0
  457. package/src/shade/renderer/trails/data/TRAIL_RECORD.js +68 -0
  458. package/src/shade/renderer/trails/data/TRAIL_STATE.d.ts +18 -0
  459. package/src/shade/renderer/trails/data/TRAIL_STATE.d.ts.map +1 -0
  460. package/src/shade/renderer/trails/data/TRAIL_STATE.js +43 -0
  461. package/src/shade/renderer/trails/graph_trails.d.ts +58 -0
  462. package/src/shade/renderer/trails/graph_trails.d.ts.map +1 -0
  463. package/src/shade/renderer/trails/graph_trails.js +155 -0
  464. package/src/shade/renderer/trails/graph_trails_avboit.d.ts +126 -0
  465. package/src/shade/renderer/trails/graph_trails_avboit.d.ts.map +1 -0
  466. package/src/shade/renderer/trails/graph_trails_avboit.js +300 -0
  467. package/src/shade/renderer/trails/runtime/TrailFadeCurves.d.ts +56 -0
  468. package/src/shade/renderer/trails/runtime/TrailFadeCurves.d.ts.map +1 -0
  469. package/src/shade/renderer/trails/runtime/TrailFadeCurves.js +220 -0
  470. package/src/shade/renderer/trails/runtime/TrailKnotPool.d.ts +49 -0
  471. package/src/shade/renderer/trails/runtime/TrailKnotPool.d.ts.map +1 -0
  472. package/src/shade/renderer/trails/runtime/TrailKnotPool.js +162 -0
  473. package/src/shade/renderer/trails/runtime/TrailParameters.d.ts +52 -0
  474. package/src/shade/renderer/trails/runtime/TrailParameters.d.ts.map +1 -0
  475. package/src/shade/renderer/trails/runtime/TrailParameters.js +126 -0
  476. package/src/shade/renderer/trails/shaders/chunk_trail_frame_transport.d.ts +23 -0
  477. package/src/shade/renderer/trails/shaders/chunk_trail_frame_transport.d.ts.map +1 -0
  478. package/src/shade/renderer/trails/shaders/chunk_trail_frame_transport.js +57 -0
  479. package/src/shade/renderer/trails/shaders/chunk_trail_knot_alpha.d.ts +14 -0
  480. package/src/shade/renderer/trails/shaders/chunk_trail_knot_alpha.d.ts.map +1 -0
  481. package/src/shade/renderer/trails/shaders/chunk_trail_knot_alpha.js +40 -0
  482. package/src/shade/renderer/trails/shaders/chunk_trail_seed.d.ts +18 -0
  483. package/src/shade/renderer/trails/shaders/chunk_trail_seed.d.ts.map +1 -0
  484. package/src/shade/renderer/trails/shaders/chunk_trail_seed.js +64 -0
  485. package/src/shade/renderer/trails/shaders/chunk_trail_segment.d.ts +14 -0
  486. package/src/shade/renderer/trails/shaders/chunk_trail_segment.d.ts.map +1 -0
  487. package/src/shade/renderer/trails/shaders/chunk_trail_segment.js +51 -0
  488. package/src/shade/renderer/trails/shaders/chunk_trail_update.d.ts +48 -0
  489. package/src/shade/renderer/trails/shaders/chunk_trail_update.d.ts.map +1 -0
  490. package/src/shade/renderer/trails/shaders/chunk_trail_update.js +197 -0
  491. package/src/shade/renderer/trails/shaders/chunk_trail_vertex.d.ts +34 -0
  492. package/src/shade/renderer/trails/shaders/chunk_trail_vertex.d.ts.map +1 -0
  493. package/src/shade/renderer/trails/shaders/chunk_trail_vertex.js +111 -0
  494. package/src/shade/renderer/trails/shaders/shader_trail_avboit.d.ts +24 -0
  495. package/src/shade/renderer/trails/shaders/shader_trail_avboit.d.ts.map +1 -0
  496. package/src/shade/renderer/trails/shaders/shader_trail_avboit.js +78 -0
  497. package/src/shade/renderer/trails/shaders/shader_trail_avboit_segments.d.ts +23 -0
  498. package/src/shade/renderer/trails/shaders/shader_trail_avboit_segments.d.ts.map +1 -0
  499. package/src/shade/renderer/trails/shaders/shader_trail_avboit_segments.js +130 -0
  500. package/src/shade/renderer/trails/shaders/shader_trail_draw_args.d.ts +29 -0
  501. package/src/shade/renderer/trails/shaders/shader_trail_draw_args.d.ts.map +1 -0
  502. package/src/shade/renderer/trails/shaders/shader_trail_draw_args.js +78 -0
  503. package/src/shade/renderer/trails/shaders/shader_trail_seed.d.ts +18 -0
  504. package/src/shade/renderer/trails/shaders/shader_trail_seed.d.ts.map +1 -0
  505. package/src/shade/renderer/trails/shaders/shader_trail_seed.js +79 -0
  506. package/src/shade/renderer/trails/shaders/shader_trail_update.d.ts +20 -0
  507. package/src/shade/renderer/trails/shaders/shader_trail_update.d.ts.map +1 -0
  508. package/src/shade/renderer/trails/shaders/shader_trail_update.js +101 -0
  509. package/src/shade/renderer/volumetrics/graph_build_volumetrics.js +2 -2
  510. package/src/shade/renderer/water/query/shader_water_surface_query.d.ts.map +1 -1
  511. package/src/shade/renderer/water/query/shader_water_surface_query.js +227 -227
  512. package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.d.ts.map +1 -1
  513. package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.js +7 -4
  514. package/src/shade/renderer/water/surface/particles/shader_water_particles.js +2 -2
  515. package/src/shade/renderer/wind/GPUSceneWind.d.ts +36 -4
  516. package/src/shade/renderer/wind/GPUSceneWind.d.ts.map +1 -1
  517. package/src/shade/renderer/wind/GPUSceneWind.js +150 -4
  518. package/src/shade/renderer/wind/WIND_FIELD_STRUCT.d.ts +9 -3
  519. package/src/shade/renderer/wind/WIND_FIELD_STRUCT.d.ts.map +1 -1
  520. package/src/shade/renderer/wind/WIND_FIELD_STRUCT.js +13 -3
  521. package/src/shade/renderer/wind/WIND_FIELD_UNIFORM.d.ts +6 -6
  522. package/src/shade/renderer/wind/WIND_FIELD_UNIFORM.js +6 -6
  523. package/src/shade/renderer/wind/chunk_fluid_turbulence.d.ts +39 -0
  524. package/src/shade/renderer/wind/chunk_fluid_turbulence.d.ts.map +1 -0
  525. package/src/shade/renderer/wind/chunk_fluid_turbulence.js +63 -0
  526. package/src/shade/renderer/wind/chunk_wind_field_sample_cascades.d.ts +10 -7
  527. package/src/shade/renderer/wind/chunk_wind_field_sample_cascades.d.ts.map +1 -1
  528. package/src/shade/renderer/wind/chunk_wind_field_sample_cascades.js +34 -11
  529. package/src/shade/renderer/wind/chunk_wind_field_sample_uniform.d.ts +2 -2
  530. package/src/shade/renderer/wind/chunk_wind_field_sample_uniform.js +2 -2
  531. package/src/shade/renderer/wind/wind_field_add_resources.d.ts +6 -4
  532. package/src/shade/renderer/wind/wind_field_add_resources.d.ts.map +1 -1
  533. package/src/shade/renderer/wind/wind_field_add_resources.js +9 -6
  534. package/src/engine/graphics/ecs/trail3d/advance_trail.d.ts +0 -18
  535. package/src/engine/graphics/ecs/trail3d/advance_trail.d.ts.map +0 -1
  536. package/src/engine/graphics/ecs/trail3d/advance_trail.js +0 -42
  537. package/src/engine/graphics/ecs/trail3d/seed_trail_tube.d.ts +0 -14
  538. package/src/engine/graphics/ecs/trail3d/seed_trail_tube.d.ts.map +0 -1
  539. package/src/engine/graphics/ecs/trail3d/seed_trail_tube.js +0 -75
  540. package/src/engine/graphics/ecs/trail3d/trail_head_position.d.ts +0 -17
  541. package/src/engine/graphics/ecs/trail3d/trail_head_position.d.ts.map +0 -1
  542. package/src/engine/graphics/ecs/trail3d/trail_head_position.js +0 -19
  543. package/src/engine/graphics/trail/tube/TubeX.d.ts +0 -186
  544. package/src/engine/graphics/trail/tube/TubeX.d.ts.map +0 -1
  545. package/src/engine/graphics/trail/tube/TubeX.js +0 -575
  546. package/src/engine/graphics/trail/tube/simulator/TubeXFixedPhysicsSimulator.d.ts +0 -16
  547. package/src/engine/graphics/trail/tube/simulator/TubeXFixedPhysicsSimulator.d.ts.map +0 -1
  548. package/src/engine/graphics/trail/tube/simulator/TubeXFixedPhysicsSimulator.js +0 -34
  549. package/src/engine/graphics/trail/tube/tube_attributes_spec.d.ts +0 -27
  550. package/src/engine/graphics/trail/tube/tube_attributes_spec.d.ts.map +0 -1
  551. package/src/engine/graphics/trail/tube/tube_attributes_spec.js +0 -70
  552. package/src/engine/graphics3/trail/trail_tube_write_geometry.d.ts +0 -38
  553. package/src/engine/graphics3/trail/trail_tube_write_geometry.d.ts.map +0 -1
  554. package/src/engine/graphics3/trail/trail_tube_write_geometry.js +0 -119
  555. package/src/shade/renderer/geometry/bvh/BLAS_REFIT_TARGET_STRUCT.d.ts +0 -18
  556. package/src/shade/renderer/geometry/bvh/BLAS_REFIT_TARGET_STRUCT.d.ts.map +0 -1
  557. package/src/shade/renderer/geometry/bvh/BLAS_REFIT_TARGET_STRUCT.js +0 -50
  558. package/src/shade/renderer/geometry/bvh/bvh2_derive_topology.d.ts +0 -23
  559. package/src/shade/renderer/geometry/bvh/bvh2_derive_topology.d.ts.map +0 -1
  560. package/src/shade/renderer/geometry/bvh/bvh2_derive_topology.js +0 -87
  561. package/src/shade/renderer/geometry/bvh/shader_blas_refit_batch.d.ts +0 -42
  562. package/src/shade/renderer/geometry/bvh/shader_blas_refit_batch.d.ts.map +0 -1
  563. package/src/shade/renderer/geometry/bvh/shader_blas_refit_batch.js +0 -141
  564. package/src/shade/renderer/geometry/bvh/shader_blas_refit_batch_seed.d.ts +0 -21
  565. package/src/shade/renderer/geometry/bvh/shader_blas_refit_batch_seed.d.ts.map +0 -1
  566. package/src/shade/renderer/geometry/bvh/shader_blas_refit_batch_seed.js +0 -75
  567. package/src/shade/renderer/geometry/meshlet_batch_to_bvh.d.ts +0 -17
  568. package/src/shade/renderer/geometry/meshlet_batch_to_bvh.d.ts.map +0 -1
  569. package/src/shade/renderer/geometry/meshlet_batch_to_bvh.js +0 -247
  570. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_ray_query_blas_occlusion.d.ts +0 -7
  571. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_ray_query_blas_occlusion.d.ts.map +0 -1
  572. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_ray_query_blas_occlusion.js +0 -226
  573. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mask_visibility_via_rays.d.ts +0 -8
  574. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mask_visibility_via_rays.d.ts.map +0 -1
  575. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mask_visibility_via_rays.js +0 -45
  576. package/src/shade/renderer/shader/chunk/light/sample/chunk_ray_sample_light.d.ts +0 -3
  577. package/src/shade/renderer/shader/chunk/light/sample/chunk_ray_sample_light.d.ts.map +0 -1
  578. package/src/shade/renderer/shader/chunk/light/sample/chunk_ray_sample_light.js +0 -105
  579. package/src/shade/renderer/shadow/sdf/chunk_ray_query_sdf_distance.d.ts +0 -6
  580. package/src/shade/renderer/shadow/sdf/chunk_ray_query_sdf_distance.d.ts.map +0 -1
  581. package/src/shade/renderer/shadow/sdf/chunk_ray_query_sdf_distance.js +0 -86
  582. package/src/shade/renderer/shadow/sdf/chunk_ray_query_sdf_raycast_traversal_count.d.ts +0 -2
  583. package/src/shade/renderer/shadow/sdf/chunk_ray_query_sdf_raycast_traversal_count.d.ts.map +0 -1
  584. package/src/shade/renderer/shadow/sdf/chunk_ray_query_sdf_raycast_traversal_count.js +0 -136
@@ -0,0 +1,57 @@
1
+ import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
2
+
3
+ /**
4
+ * Below this squared length the transported normal is degenerate — the previous normal was nearly
5
+ * parallel to the new tangent — and a fresh basis is built from the tangent instead.
6
+ * @type {number}
7
+ */
8
+ export const TRAIL_FRAME_DEGENERATE_EPSILON_SQR = 1e-10;
9
+
10
+ /**
11
+ * `trail_frame_transport(tangent, previous_normal) -> TrailFrame`: the rotation-minimising frame of a
12
+ * tube's ring, carried from the previous knot's normal onto the plane perpendicular to the unit
13
+ * `tangent` (Gram-Schmidt), with `binormal = tangent × normal`. The ring keeps its orientation as the
14
+ * tangent turns, with no twist.
15
+ *
16
+ * When the previous normal is (nearly) parallel to the tangent the projection collapses, and the frame
17
+ * is built from the tangent alone, by the construction `v3_orthonormal_matrix_from_normal` uses on the
18
+ * CPU, so both paths bootstrap the same frame.
19
+ *
20
+ * The same arithmetic as `tube_frame_transport`.
21
+ *
22
+ * @type {CodeChunk}
23
+ */
24
+ export const chunk_trail_frame_transport = CodeChunk.from(
25
+ //language=WGSL
26
+ `
27
+ struct TrailFrame {
28
+ normal : vec3<f32>,
29
+ binormal : vec3<f32>,
30
+ }
31
+
32
+ fn trail_frame_transport(tangent : vec3<f32>, previous_normal : vec3<f32>) -> TrailFrame {
33
+ let projected = previous_normal - dot(previous_normal, tangent) * tangent;
34
+ let length_sqr = dot(projected, projected);
35
+
36
+ var frame : TrailFrame;
37
+
38
+ if (length_sqr > ${TRAIL_FRAME_DEGENERATE_EPSILON_SQR}) {
39
+ frame.normal = projected * inverseSqrt(length_sqr);
40
+ } else {
41
+ var o : vec3<f32>;
42
+
43
+ if (abs(tangent.x) > abs(tangent.z)) {
44
+ o = vec3<f32>(-tangent.y, tangent.x, 0.0);
45
+ } else {
46
+ o = vec3<f32>(0.0, -tangent.z, tangent.y);
47
+ }
48
+
49
+ frame.normal = normalize(o);
50
+ }
51
+
52
+ frame.binormal = cross(tangent, frame.normal);
53
+
54
+ return frame;
55
+ }
56
+ `
57
+ );
@@ -0,0 +1,14 @@
1
+ /**
2
+ * `trail_knot_alpha(record, head, live, address, now) -> f32`: the opacity a knot is drawn with — the
3
+ * trail's fade at the knot's age as a fraction of `maxAge`, clamped to 0..1, times the trail's base
4
+ * opacity. `head` and `live` are the trail's state; a knot past the live span is not asked its age and
5
+ * counts as at the end of its life, so a tick count that has wrapped is never read.
6
+ *
7
+ * The fade is evaluated exactly, as `AnimationCurve.evaluate` evaluates it, from the keys of the
8
+ * enclosing shader's `fade_keys` (`chunk_animation_curve_evaluate_keys`).
9
+ *
10
+ * @type {CodeChunk}
11
+ */
12
+ export const chunk_trail_knot_alpha: CodeChunk;
13
+ import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
14
+ //# sourceMappingURL=chunk_trail_knot_alpha.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk_trail_knot_alpha.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/trails/shaders/chunk_trail_knot_alpha.js"],"names":[],"mappings":"AAMA;;;;;;;;;;GAUG;AACH,qCAFU,SAAS,CAwBjB;0BAtCwB,oCAAoC"}
@@ -0,0 +1,40 @@
1
+ import { chunk_animation_curve_evaluate_keys } from "../../animation/chunk_animation_curve_evaluate_keys.js";
2
+ import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
3
+ import { chunk_trail_knot_read } from "../data/TRAIL_KNOT.js";
4
+ import { TRAIL_STRUCT } from "../data/TRAIL_RECORD.js";
5
+ import { chunk_trail_common } from "./chunk_trail_update.js";
6
+
7
+ /**
8
+ * `trail_knot_alpha(record, head, live, address, now) -> f32`: the opacity a knot is drawn with — the
9
+ * trail's fade at the knot's age as a fraction of `maxAge`, clamped to 0..1, times the trail's base
10
+ * opacity. `head` and `live` are the trail's state; a knot past the live span is not asked its age and
11
+ * counts as at the end of its life, so a tick count that has wrapped is never read.
12
+ *
13
+ * The fade is evaluated exactly, as `AnimationCurve.evaluate` evaluates it, from the keys of the
14
+ * enclosing shader's `fade_keys` (`chunk_animation_curve_evaluate_keys`).
15
+ *
16
+ * @type {CodeChunk}
17
+ */
18
+ export const chunk_trail_knot_alpha = CodeChunk.from(
19
+ //language=WGSL
20
+ `
21
+ fn trail_knot_alpha(record : ${TRAIL_STRUCT.wgsl_ref}, head : u32, live : u32, address : u32, now : u32) -> f32 {
22
+ let count = record.knot_count;
23
+ let j = (address - record.knot_base + count - head) % count;
24
+
25
+ var relative = 1.0;
26
+
27
+ if (j < live) {
28
+ let age = f32(now - trail_knot_birth(address));
29
+
30
+ relative = clamp(age / f32(max(record.max_age_ticks, 1u)), 0.0, 1.0);
31
+ }
32
+
33
+ return animation_curve_evaluate_keys(&fade_keys, record.fade_first, record.fade_count, relative) * record.color.a;
34
+ }
35
+ `, [
36
+ chunk_trail_common,
37
+ chunk_trail_knot_read,
38
+ chunk_animation_curve_evaluate_keys,
39
+ ]
40
+ );
@@ -0,0 +1,18 @@
1
+ /**
2
+ * A trail's seed, knot by knot and then its state:
3
+ *
4
+ * - `trail_seed_knot(record, row, i, head, now)` collapses knot `i` of the trail's run onto `head`,
5
+ * born `max_age` ago, so it has faded and the first commit finds the ring empty. A build gives it the
6
+ * frame a fresh tube starts with, the trail's width and its row; a `clear()`
7
+ * ({@link TRAIL_FLAG.RESEED}) keeps the knot's frame, thickness and row.
8
+ * - `trail_seed_state(record, &state, now)` starts the simulation over from `now`: nothing live,
9
+ * nothing travelled, the last commit now, the record's epoch seeded. A build also puts the head at
10
+ * slot 0 and the trail's birth at `now`; a `clear()` keeps both, so the warm-up does not run again.
11
+ *
12
+ * The enclosing shader binds `knots` read-write.
13
+ *
14
+ * @type {CodeChunk}
15
+ */
16
+ export const chunk_trail_seed: CodeChunk;
17
+ import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
18
+ //# sourceMappingURL=chunk_trail_seed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk_trail_seed.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/trails/shaders/chunk_trail_seed.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;GAcG;AACH,+BAFU,SAAS,CAyCjB;0BA/DwB,oCAAoC"}
@@ -0,0 +1,64 @@
1
+ import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
2
+ import { chunk_trail_knot_write } from "../data/TRAIL_KNOT.js";
3
+ import { TRAIL_STRUCT } from "../data/TRAIL_RECORD.js";
4
+ import { TRAIL_STATE_STRUCT } from "../data/TRAIL_STATE.js";
5
+ import { chunk_trail_common } from "./chunk_trail_update.js";
6
+
7
+ const RECORD = TRAIL_STRUCT.wgsl_ref;
8
+ const STATE = TRAIL_STATE_STRUCT.wgsl_ref;
9
+
10
+ /**
11
+ * A trail's seed, knot by knot and then its state:
12
+ *
13
+ * - `trail_seed_knot(record, row, i, head, now)` collapses knot `i` of the trail's run onto `head`,
14
+ * born `max_age` ago, so it has faded and the first commit finds the ring empty. A build gives it the
15
+ * frame a fresh tube starts with, the trail's width and its row; a `clear()`
16
+ * ({@link TRAIL_FLAG.RESEED}) keeps the knot's frame, thickness and row.
17
+ * - `trail_seed_state(record, &state, now)` starts the simulation over from `now`: nothing live,
18
+ * nothing travelled, the last commit now, the record's epoch seeded. A build also puts the head at
19
+ * slot 0 and the trail's birth at `now`; a `clear()` keeps both, so the warm-up does not run again.
20
+ *
21
+ * The enclosing shader binds `knots` read-write.
22
+ *
23
+ * @type {CodeChunk}
24
+ */
25
+ export const chunk_trail_seed = CodeChunk.from(
26
+ //language=WGSL
27
+ `
28
+ fn trail_seed_knot(record : ${RECORD}, row : u32, i : u32, head : vec3<f32>, now : u32) {
29
+ let address = record.knot_base + i;
30
+
31
+ var knot : TrailKnot;
32
+
33
+ if ((record.flags & TRAIL_FLAG_RESEED) != 0u) {
34
+ knot = trail_knot_read(address);
35
+ } else {
36
+ knot.normal = vec3<f32>(0.0, 0.0, 1.0);
37
+ knot.binormal = vec3<f32>(1.0, 0.0, 0.0);
38
+ knot.thickness = record.width;
39
+ knot.trail = row;
40
+ }
41
+
42
+ knot.position = head;
43
+ knot.birth = now - record.max_age_ticks;
44
+
45
+ trail_knot_write(address, knot);
46
+ }
47
+
48
+ fn trail_seed_state(record : ${RECORD}, state : ptr<function, ${STATE}>, now : u32) {
49
+ if ((record.flags & TRAIL_FLAG_RESEED) == 0u) {
50
+ (*state).head = 0u;
51
+ (*state).birth = now;
52
+ }
53
+
54
+ (*state).live = 0u;
55
+ (*state).last_commit = now;
56
+ (*state).distance = 0.0;
57
+ (*state).seeded_epoch = record.seed_epoch;
58
+ }
59
+ `, [
60
+ TRAIL_STATE_STRUCT.declaration_chunk,
61
+ chunk_trail_common,
62
+ chunk_trail_knot_write,
63
+ ]
64
+ );
@@ -0,0 +1,14 @@
1
+ /**
2
+ * `trail_segment_bounds(record, head, live, segment, now, &box) -> bool`: whether segment `segment` of a
3
+ * trail (between the knots `segment` and `segment + 1` tailward of the head) can put anything on screen,
4
+ * and the box it does it in.
5
+ *
6
+ * A segment whose two ends have both faded to nothing (`trail_knot_alpha`) cannot, and `box` is left as
7
+ * it was. Any other is bounded by the capsule between its two rings: the box of the two knot centres,
8
+ * grown on every side by the thicker ring's radius, so both rings lie inside it whatever their frames.
9
+ *
10
+ * @type {CodeChunk}
11
+ */
12
+ export const chunk_trail_segment: CodeChunk;
13
+ import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
14
+ //# sourceMappingURL=chunk_trail_segment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk_trail_segment.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/trails/shaders/chunk_trail_segment.js"],"names":[],"mappings":"AAKA;;;;;;;;;;GAUG;AACH,kCAFU,SAAS,CAoCjB;0BAjDwB,oCAAoC"}
@@ -0,0 +1,51 @@
1
+ import { AABB3_STRUCT } from "../../shader/chunk/geometry/aabb3/AABB3_STRUCT.js";
2
+ import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
3
+ import { TRAIL_STRUCT } from "../data/TRAIL_RECORD.js";
4
+ import { chunk_trail_knot_alpha } from "./chunk_trail_knot_alpha.js";
5
+
6
+ /**
7
+ * `trail_segment_bounds(record, head, live, segment, now, &box) -> bool`: whether segment `segment` of a
8
+ * trail (between the knots `segment` and `segment + 1` tailward of the head) can put anything on screen,
9
+ * and the box it does it in.
10
+ *
11
+ * A segment whose two ends have both faded to nothing (`trail_knot_alpha`) cannot, and `box` is left as
12
+ * it was. Any other is bounded by the capsule between its two rings: the box of the two knot centres,
13
+ * grown on every side by the thicker ring's radius, so both rings lie inside it whatever their frames.
14
+ *
15
+ * @type {CodeChunk}
16
+ */
17
+ export const chunk_trail_segment = CodeChunk.from(
18
+ //language=WGSL
19
+ `
20
+ fn trail_segment_bounds(
21
+ record : ${TRAIL_STRUCT.wgsl_ref},
22
+ head : u32,
23
+ live : u32,
24
+ segment : u32,
25
+ now : u32,
26
+ box : ptr<function, ${AABB3_STRUCT.wgsl_ref}>,
27
+ ) -> bool {
28
+ let a0 = trail_knot_address(record, head, segment);
29
+ let a1 = trail_knot_address(record, head, segment + 1u);
30
+
31
+ if (trail_knot_alpha(record, head, live, a0, now) <= 0.0 && trail_knot_alpha(record, head, live, a1, now) <= 0.0) {
32
+ return false;
33
+ }
34
+
35
+ let k0 = trail_knot_read(a0);
36
+ let k1 = trail_knot_read(a1);
37
+
38
+ let radius = vec3<f32>(max(k0.thickness, k1.thickness) * 0.5);
39
+
40
+ *box = ${AABB3_STRUCT.make({
41
+ min: "min(k0.position, k1.position) - radius",
42
+ max: "max(k0.position, k1.position) + radius",
43
+ })};
44
+
45
+ return true;
46
+ }
47
+ `, [
48
+ AABB3_STRUCT.declaration_chunk,
49
+ chunk_trail_knot_alpha,
50
+ ]
51
+ );
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Below this distance from its predecessor the head has no direction yet, and keeps its frame: the
3
+ * engine's `EPSILON`.
4
+ * @type {number}
5
+ */
6
+ export const TRAIL_TANGENT_EPSILON: number;
7
+ /**
8
+ * Shared names for the trail passes: the {@link TRAIL_FLAG} bits as constants;
9
+ * `trail_knot_address(record, head, j)`, the knot `j` knots tailward of the head; and
10
+ * `trail_head_world(world, offset)`, where the head stands: the trail's offset, in the entity's own
11
+ * frame, carried through the entity's world matrix, so it turns and scales with the entity. The seed
12
+ * and the update both place the head by it, so a fresh trail is collapsed where its first update puts
13
+ * the head and that update bridges nothing.
14
+ *
15
+ * @type {CodeChunk}
16
+ */
17
+ export const chunk_trail_common: CodeChunk;
18
+ /**
19
+ * `trail_update(record, &state, head_position, now) -> u32`: one frame of a trail. Returns how many of
20
+ * the trail's segments can be visible.
21
+ *
22
+ * For a trail that is spawning:
23
+ *
24
+ * - The head moved if `head_position` is not where the head knot stands; the distance it moved is
25
+ * added to the state's distance.
26
+ * - It commits a knot when one is due — `commit_ticks` since the last commit in time mode,
27
+ * `spawn_distance` travelled in distance mode — and only if the head moved, at most one a frame. The
28
+ * ring steps back a slot, the knot the head leaves keeps last frame's position, and both the time and
29
+ * the distance start again from the commit.
30
+ * - If it moved, the head's ring frame is carried from its predecessor along the tangent between them
31
+ * (`trail_frame_transport`), unless the two coincide, and the head knot takes the new position.
32
+ * - The head knot is born now, or, with the warm-up, as old as the time the trail has still to live
33
+ * through its first `maxAge`; it takes the trail's width.
34
+ *
35
+ * Then the live span: the knots from the head that can still be visible. Ages grow from the head, so
36
+ * the first knot that has faded ends it, found by binary search over the knots last frame's span
37
+ * covered and the one committed since — at most `⌈log2(1025)⌉` probes. Only those are asked their
38
+ * age, so a tick count that has wrapped is never read. An authored trail's knots have ages of the
39
+ * author's, so every one of them is a candidate. A trail whose fade ends above zero draws its whole
40
+ * ring.
41
+ *
42
+ * The enclosing shader binds `knots` read-write.
43
+ *
44
+ * @type {CodeChunk}
45
+ */
46
+ export const chunk_trail_update: CodeChunk;
47
+ import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
48
+ //# sourceMappingURL=chunk_trail_update.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk_trail_update.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/trails/shaders/chunk_trail_update.js"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,oCAFU,MAAM,CAE8B;AAK9C;;;;;;;;;GASG;AACH,iCAFU,SAAS,CAsBjB;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,iCAFU,SAAS,CA0HjB;0BApMwB,oCAAoC"}
@@ -0,0 +1,197 @@
1
+ import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
2
+ import { chunk_trail_knot_write } from "../data/TRAIL_KNOT.js";
3
+ import { TRAIL_FLAG, TRAIL_STRUCT } from "../data/TRAIL_RECORD.js";
4
+ import { TRAIL_STATE_STRUCT } from "../data/TRAIL_STATE.js";
5
+ import { chunk_trail_frame_transport } from "./chunk_trail_frame_transport.js";
6
+
7
+ /**
8
+ * Below this distance from its predecessor the head has no direction yet, and keeps its frame: the
9
+ * engine's `EPSILON`.
10
+ * @type {number}
11
+ */
12
+ export const TRAIL_TANGENT_EPSILON = 0.000001;
13
+
14
+ const RECORD = TRAIL_STRUCT.wgsl_ref;
15
+ const STATE = TRAIL_STATE_STRUCT.wgsl_ref;
16
+
17
+ /**
18
+ * Shared names for the trail passes: the {@link TRAIL_FLAG} bits as constants;
19
+ * `trail_knot_address(record, head, j)`, the knot `j` knots tailward of the head; and
20
+ * `trail_head_world(world, offset)`, where the head stands: the trail's offset, in the entity's own
21
+ * frame, carried through the entity's world matrix, so it turns and scales with the entity. The seed
22
+ * and the update both place the head by it, so a fresh trail is collapsed where its first update puts
23
+ * the head and that update bridges nothing.
24
+ *
25
+ * @type {CodeChunk}
26
+ */
27
+ export const chunk_trail_common = CodeChunk.from(
28
+ //language=WGSL
29
+ `
30
+ const TRAIL_FLAG_SPAWNING : u32 = ${TRAIL_FLAG.SPAWNING}u;
31
+ const TRAIL_FLAG_DISTANCE : u32 = ${TRAIL_FLAG.DISTANCE}u;
32
+ const TRAIL_FLAG_AUTHORED : u32 = ${TRAIL_FLAG.AUTHORED}u;
33
+ const TRAIL_FLAG_WARMUP : u32 = ${TRAIL_FLAG.WARMUP}u;
34
+ const TRAIL_FLAG_TAIL_VISIBLE : u32 = ${TRAIL_FLAG.TAIL_VISIBLE}u;
35
+ const TRAIL_FLAG_RESEED : u32 = ${TRAIL_FLAG.RESEED}u;
36
+
37
+ fn trail_knot_address(record : ${RECORD}, head : u32, j : u32) -> u32 {
38
+ return record.knot_base + (head + j) % record.knot_count;
39
+ }
40
+
41
+ fn trail_head_world(world : mat4x4<f32>, offset : vec3<f32>) -> vec3<f32> {
42
+ return (world * vec4<f32>(offset, 1.0)).xyz;
43
+ }
44
+ `, [
45
+ TRAIL_STRUCT.declaration_chunk,
46
+ ]
47
+ );
48
+
49
+ /**
50
+ * `trail_update(record, &state, head_position, now) -> u32`: one frame of a trail. Returns how many of
51
+ * the trail's segments can be visible.
52
+ *
53
+ * For a trail that is spawning:
54
+ *
55
+ * - The head moved if `head_position` is not where the head knot stands; the distance it moved is
56
+ * added to the state's distance.
57
+ * - It commits a knot when one is due — `commit_ticks` since the last commit in time mode,
58
+ * `spawn_distance` travelled in distance mode — and only if the head moved, at most one a frame. The
59
+ * ring steps back a slot, the knot the head leaves keeps last frame's position, and both the time and
60
+ * the distance start again from the commit.
61
+ * - If it moved, the head's ring frame is carried from its predecessor along the tangent between them
62
+ * (`trail_frame_transport`), unless the two coincide, and the head knot takes the new position.
63
+ * - The head knot is born now, or, with the warm-up, as old as the time the trail has still to live
64
+ * through its first `maxAge`; it takes the trail's width.
65
+ *
66
+ * Then the live span: the knots from the head that can still be visible. Ages grow from the head, so
67
+ * the first knot that has faded ends it, found by binary search over the knots last frame's span
68
+ * covered and the one committed since — at most `⌈log2(1025)⌉` probes. Only those are asked their
69
+ * age, so a tick count that has wrapped is never read. An authored trail's knots have ages of the
70
+ * author's, so every one of them is a candidate. A trail whose fade ends above zero draws its whole
71
+ * ring.
72
+ *
73
+ * The enclosing shader binds `knots` read-write.
74
+ *
75
+ * @type {CodeChunk}
76
+ */
77
+ export const chunk_trail_update = CodeChunk.from(
78
+ //language=WGSL
79
+ `
80
+ fn trail_update(record : ${RECORD}, state : ptr<function, ${STATE}>, head_position : vec3<f32>, now : u32) -> u32 {
81
+ let count = record.knot_count;
82
+ let spawning = (record.flags & TRAIL_FLAG_SPAWNING) != 0u;
83
+
84
+ var committed = false;
85
+
86
+ if (spawning) {
87
+ var head = (*state).head;
88
+
89
+ let previous = trail_knot_position(record.knot_base + head);
90
+ let moved = any(head_position != previous);
91
+
92
+ if (moved) {
93
+ (*state).distance = (*state).distance + distance(previous, head_position);
94
+ }
95
+
96
+ var due : bool;
97
+
98
+ if ((record.flags & TRAIL_FLAG_DISTANCE) != 0u) {
99
+ due = (*state).distance >= record.spawn_distance;
100
+ } else {
101
+ due = (now - (*state).last_commit) >= record.commit_ticks;
102
+ }
103
+
104
+ if (due && moved) {
105
+ (*state).last_commit = now;
106
+ (*state).distance = 0.0;
107
+
108
+ head = (head + count - 1u) % count;
109
+ (*state).head = head;
110
+
111
+ committed = true;
112
+ }
113
+
114
+ let address = record.knot_base + head;
115
+
116
+ var knot = trail_knot_read(address);
117
+
118
+ if (moved) {
119
+ let predecessor = trail_knot_read(trail_knot_address(record, head, 1u));
120
+ let toward = head_position - predecessor.position;
121
+ let toward_length = length(toward);
122
+
123
+ if (toward_length > ${TRAIL_TANGENT_EPSILON}) {
124
+ let frame = trail_frame_transport(toward / toward_length, predecessor.normal);
125
+
126
+ knot.normal = frame.normal;
127
+ knot.binormal = frame.binormal;
128
+ }
129
+
130
+ knot.position = head_position;
131
+ }
132
+
133
+ var age = 0u;
134
+
135
+ if ((record.flags & TRAIL_FLAG_WARMUP) != 0u) {
136
+ let lived = now - (*state).birth;
137
+
138
+ age = select(0u, record.max_age_ticks - lived, lived < record.max_age_ticks);
139
+ }
140
+
141
+ knot.birth = now - age;
142
+ knot.thickness = record.width;
143
+
144
+ trail_knot_write(address, knot);
145
+ }
146
+
147
+ var live = (*state).live;
148
+
149
+ if ((record.flags & TRAIL_FLAG_AUTHORED) != 0u) {
150
+ live = count;
151
+ } else {
152
+ if (committed) {
153
+ live = min(live + 1u, count);
154
+ }
155
+
156
+ if (spawning) {
157
+ // the head was just written, young or old
158
+ live = max(live, 1u);
159
+ }
160
+
161
+ // the first faded knot in [0, live): before it every knot is younger than maxAge
162
+ var low = 0u;
163
+ var high = live;
164
+
165
+ loop {
166
+ if (low >= high) {
167
+ break;
168
+ }
169
+
170
+ let middle = (low + high) >> 1u;
171
+ let born = trail_knot_birth(trail_knot_address(record, (*state).head, middle));
172
+
173
+ if ((now - born) >= record.max_age_ticks) {
174
+ high = middle;
175
+ } else {
176
+ low = middle + 1u;
177
+ }
178
+ }
179
+
180
+ live = low;
181
+ }
182
+
183
+ (*state).live = live;
184
+
185
+ if ((record.flags & TRAIL_FLAG_TAIL_VISIBLE) != 0u) {
186
+ return count - 1u;
187
+ }
188
+
189
+ return min(live, count - 1u);
190
+ }
191
+ `, [
192
+ TRAIL_STATE_STRUCT.declaration_chunk,
193
+ chunk_trail_common,
194
+ chunk_trail_knot_write,
195
+ chunk_trail_frame_transport,
196
+ ]
197
+ );
@@ -0,0 +1,34 @@
1
+ /**
2
+ * The frame uniform: the clock the knots' ages are counted against.
3
+ */
4
+ export const TRAIL_FRAME_STRUCT: WebGPUStruct;
5
+ /**
6
+ * What the trails' vertex stage reads, the same group in the splat and the draw: the camera, the
7
+ * clock, the frame's segment list, the knots, the trail and state tables and the fade keys.
8
+ *
9
+ * @type {ShaderResourceGroupDescriptor}
10
+ */
11
+ export const TRAIL_VERTEX_GROUP: ShaderResourceGroupDescriptor;
12
+ /**
13
+ * `trail_vertex(vertex_index, instance_index) -> AVBOITUnlitVaryings`: one vertex of one segment of a
14
+ * trail's tube, extruded where the vertex shader runs instead of on the CPU.
15
+ *
16
+ * The instance is the segment: `segment_list[instance_index]` is its head-ward knot, and the knot
17
+ * names its trail, whose record and state it reads. `trail_ring_vertex(record, head, live, head_ward,
18
+ * vertex_index, now)` is the vertex itself: `vertex_index` runs over the two rings of `radial + 1`
19
+ * vertices, the head-ward ring first; the seam vertex closes each ring on its first.
20
+ *
21
+ * A ring vertex sits at its knot's centre displaced by `cos θ · normal + sin θ · binormal`, half the
22
+ * knot's thickness out, at `θ = 2π · r / radial`. Its colour is the trail's; its alpha is the knot's (`trail_knot_alpha`), clamped to 0..1 and
23
+ * split between the tube's two faces as `1 - √(1 - α)`, because a line of sight through the closed tube
24
+ * crosses two faces and the two together must cover `α`.
25
+ *
26
+ * The enclosing shader binds {@link TRAIL_VERTEX_GROUP}.
27
+ *
28
+ * @type {CodeChunk}
29
+ */
30
+ export const chunk_trail_vertex: CodeChunk;
31
+ import { WebGPUStruct } from "../../shader/type/WebGPUStruct.js";
32
+ import { ShaderResourceGroupDescriptor } from "../../shader/resource/ShaderResourceGroupDescriptor.js";
33
+ import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
34
+ //# sourceMappingURL=chunk_trail_vertex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk_trail_vertex.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/trails/shaders/chunk_trail_vertex.js"],"names":[],"mappings":"AAYA;;GAEG;AACH,8CAEmB;AAEnB;;;;;GAKG;AACH,iCAFU,6BAA6B,CAE+B;AAUtE;;;;;;;;;;;;;;;;;GAiBG;AACH,iCAFU,SAAS,CA2DjB;6BAvG2B,mCAAmC;8CAHlB,wDAAwD;0BAD5E,oCAAoC"}