@woosh/meep-engine 3.69.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 (398) hide show
  1. package/CHANGELOG.md +30 -1
  2. package/build/bundle-worker-terrain.js +1 -1
  3. package/package.json +1 -1
  4. package/src/core/bvh8/build/BVH8Converter.d.ts +16 -0
  5. package/src/core/bvh8/build/BVH8Converter.d.ts.map +1 -1
  6. package/src/core/bvh8/build/BVH8Converter.js +64 -37
  7. package/src/core/bvh8/build/bvh8_assign_slots_greedy.d.ts +25 -0
  8. package/src/core/bvh8/build/bvh8_assign_slots_greedy.d.ts.map +1 -0
  9. package/src/core/bvh8/build/bvh8_assign_slots_greedy.js +68 -0
  10. package/src/core/bvh8/build/bvh8_from_proxy.d.ts.map +1 -1
  11. package/src/core/bvh8/build/bvh8_from_proxy.js +2 -33
  12. package/src/core/bvh8/build/bvh8_node_fit_slots.d.ts +22 -0
  13. package/src/core/bvh8/build/bvh8_node_fit_slots.d.ts.map +1 -0
  14. package/src/core/bvh8/build/bvh8_node_fit_slots.js +115 -0
  15. package/src/core/bvh8/bvh8_depth.d.ts +8 -0
  16. package/src/core/bvh8/bvh8_depth.d.ts.map +1 -0
  17. package/src/core/bvh8/bvh8_depth.js +39 -0
  18. package/src/core/math/complex/complex_fft_radix2.d.ts +19 -0
  19. package/src/core/math/complex/complex_fft_radix2.d.ts.map +1 -0
  20. package/src/core/math/complex/complex_fft_radix2.js +71 -0
  21. package/src/engine/graphics3/GPUFluidSystem.d.ts +17 -4
  22. package/src/engine/graphics3/GPUFluidSystem.d.ts.map +1 -1
  23. package/src/engine/graphics3/GPUFluidSystem.js +113 -16
  24. package/src/engine/physics/cloth/playground/wind_main.js +7 -6
  25. package/src/engine/physics/cloth/wind/AbstractClothWind.d.ts +2 -2
  26. package/src/engine/physics/cloth/wind/AbstractClothWind.js +2 -2
  27. package/src/engine/physics/cloth/wind/ClothFluidWind.d.ts +3 -3
  28. package/src/engine/physics/cloth/wind/ClothFluidWind.d.ts.map +1 -1
  29. package/src/engine/physics/cloth/wind/ClothFluidWind.js +7 -9
  30. package/src/engine/physics/cloth/wind/ClothGPUFluidWind.d.ts +10 -10
  31. package/src/engine/physics/cloth/wind/ClothGPUFluidWind.d.ts.map +1 -1
  32. package/src/engine/physics/cloth/wind/ClothGPUFluidWind.js +14 -22
  33. package/src/engine/physics/fluid/FluidAtmosphere.d.ts +16 -2
  34. package/src/engine/physics/fluid/FluidAtmosphere.d.ts.map +1 -1
  35. package/src/engine/physics/fluid/FluidAtmosphere.js +17 -3
  36. package/src/engine/physics/fluid/ecs/FluidEffectorsComponentSerializationAdapter.d.ts +1 -2
  37. package/src/engine/physics/fluid/ecs/FluidEffectorsComponentSerializationAdapter.d.ts.map +1 -1
  38. package/src/engine/physics/fluid/ecs/FluidEffectorsComponentSerializationAdapter.js +1 -2
  39. package/src/engine/physics/fluid/ecs/FluidEffectorsSystem.d.ts +8 -5
  40. package/src/engine/physics/fluid/ecs/FluidEffectorsSystem.d.ts.map +1 -1
  41. package/src/engine/physics/fluid/ecs/FluidEffectorsSystem.js +60 -17
  42. package/src/engine/physics/fluid/effector/AbstractFluidEffector.d.ts +1 -1
  43. package/src/engine/physics/fluid/effector/AbstractFluidEffector.js +1 -1
  44. package/src/engine/physics/fluid/effector/GlobalFluidEffector.d.ts +33 -47
  45. package/src/engine/physics/fluid/effector/GlobalFluidEffector.d.ts.map +1 -1
  46. package/src/engine/physics/fluid/effector/GlobalFluidEffector.js +38 -176
  47. package/src/engine/physics/fluid/effector/GlobalFluidEffectorSerializationAdapter.d.ts +8 -11
  48. package/src/engine/physics/fluid/effector/GlobalFluidEffectorSerializationAdapter.d.ts.map +1 -1
  49. package/src/engine/physics/fluid/effector/GlobalFluidEffectorSerializationAdapter.js +13 -24
  50. package/src/engine/physics/fluid/effector/GlobalFluidEffectorSerializationUpgrader_0_1.d.ts +16 -0
  51. package/src/engine/physics/fluid/effector/GlobalFluidEffectorSerializationUpgrader_0_1.d.ts.map +1 -0
  52. package/src/engine/physics/fluid/effector/GlobalFluidEffectorSerializationUpgrader_0_1.js +35 -0
  53. package/src/engine/physics/fluid/fluid_apply_atmosphere.d.ts +1 -1
  54. package/src/engine/physics/fluid/fluid_apply_atmosphere.js +1 -1
  55. package/src/engine/physics/fluid/turbulence/FLUID_TURBULENCE_TILE.d.ts +28 -0
  56. package/src/engine/physics/fluid/turbulence/FLUID_TURBULENCE_TILE.d.ts.map +1 -0
  57. package/src/engine/physics/fluid/turbulence/FLUID_TURBULENCE_TILE.js +29 -0
  58. package/src/engine/physics/fluid/turbulence/fluid_atmosphere_velocity_at.d.ts +16 -0
  59. package/src/engine/physics/fluid/turbulence/fluid_atmosphere_velocity_at.d.ts.map +1 -0
  60. package/src/engine/physics/fluid/turbulence/fluid_atmosphere_velocity_at.js +49 -0
  61. package/src/engine/physics/fluid/turbulence/fluid_turbulence_inverse_tile_size.d.ts +11 -0
  62. package/src/engine/physics/fluid/turbulence/fluid_turbulence_inverse_tile_size.d.ts.map +1 -0
  63. package/src/engine/physics/fluid/turbulence/fluid_turbulence_inverse_tile_size.js +18 -0
  64. package/src/engine/physics/fluid/turbulence/fluid_turbulence_tile_data.d.ts +25 -0
  65. package/src/engine/physics/fluid/turbulence/fluid_turbulence_tile_data.d.ts.map +1 -0
  66. package/src/engine/physics/fluid/turbulence/fluid_turbulence_tile_data.js +65 -0
  67. package/src/engine/physics/fluid/turbulence/fluid_turbulence_tile_generate.d.ts +56 -0
  68. package/src/engine/physics/fluid/turbulence/fluid_turbulence_tile_generate.d.ts.map +1 -0
  69. package/src/engine/physics/fluid/turbulence/fluid_turbulence_tile_generate.js +313 -0
  70. package/src/engine/physics/fluid/turbulence/fluid_turbulence_tile_sample.d.ts +16 -0
  71. package/src/engine/physics/fluid/turbulence/fluid_turbulence_tile_sample.d.ts.map +1 -0
  72. package/src/engine/physics/fluid/turbulence/fluid_turbulence_tile_sample.js +69 -0
  73. package/src/generation/foliage/mesh/branch_ring_triangulate.d.ts +1 -1
  74. package/src/generation/foliage/mesh/branch_ring_triangulate.js +1 -1
  75. package/src/shade/playground/bvh_repro/README.md +8 -6
  76. package/src/shade/playground/bvh_repro/index.html +125 -124
  77. package/src/shade/playground/bvh_repro/main.js +259 -254
  78. package/src/shade/playground/foliage_wind/foliage_world.d.ts.map +1 -1
  79. package/src/shade/playground/foliage_wind/foliage_world.js +7 -4
  80. package/src/shade/playground/grass_surfaces/main.js +3 -2
  81. package/src/shade/playground/particle_ecs/bonfire_wind.d.ts +23 -13
  82. package/src/shade/playground/particle_ecs/bonfire_wind.d.ts.map +1 -1
  83. package/src/shade/playground/particle_ecs/bonfire_wind.js +30 -33
  84. package/src/shade/playground/skinned_blas_refit/README.md +26 -14
  85. package/src/shade/playground/skinned_blas_refit/shader_blas_audit_leaf_triangles.d.ts +14 -9
  86. package/src/shade/playground/skinned_blas_refit/shader_blas_audit_leaf_triangles.d.ts.map +1 -1
  87. package/src/shade/playground/skinned_blas_refit/shader_blas_audit_leaf_triangles.js +126 -127
  88. package/src/shade/playground/skinned_blas_refit/shader_blas_audit_points.js +95 -95
  89. package/src/shade/playground/skinned_blas_refit/shader_blas_audit_visibility.d.ts +9 -1
  90. package/src/shade/playground/skinned_blas_refit/shader_blas_audit_visibility.d.ts.map +1 -1
  91. package/src/shade/playground/skinned_blas_refit/shader_blas_audit_visibility.js +146 -135
  92. package/src/shade/playground/skinned_blas_refit/verify_clone_leaves.d.ts +6 -6
  93. package/src/shade/playground/skinned_blas_refit/verify_clone_leaves.d.ts.map +1 -1
  94. package/src/shade/playground/skinned_blas_refit/verify_clone_leaves.js +148 -134
  95. package/src/shade/playground/skinned_blas_refit/verify_leaf_triangles.d.ts +11 -8
  96. package/src/shade/playground/skinned_blas_refit/verify_leaf_triangles.d.ts.map +1 -1
  97. package/src/shade/playground/skinned_blas_refit/verify_leaf_triangles.js +342 -202
  98. package/src/shade/playground/skinned_blas_refit/verify_skinned_blas_refit.d.ts +12 -13
  99. package/src/shade/playground/skinned_blas_refit/verify_skinned_blas_refit.d.ts.map +1 -1
  100. package/src/shade/playground/skinned_blas_refit/verify_skinned_blas_refit.js +136 -116
  101. package/src/shade/playground/skinned_blas_refit/verify_traversal_reachability.d.ts +4 -4
  102. package/src/shade/playground/skinned_blas_refit/verify_traversal_reachability.d.ts.map +1 -1
  103. package/src/shade/playground/skinned_blas_refit/verify_traversal_reachability.js +255 -249
  104. package/src/shade/playground/water_surface/main.js +6 -3
  105. package/src/shade/renderer/animation/GPUAnimationManager.js +2 -2
  106. package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.d.ts.map +1 -1
  107. package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.js +7 -8
  108. package/src/shade/renderer/fluid/FLUID_FAR_FIELD_STRUCT.d.ts +111 -0
  109. package/src/shade/renderer/fluid/FLUID_FAR_FIELD_STRUCT.d.ts.map +1 -0
  110. package/src/shade/renderer/fluid/FLUID_FAR_FIELD_STRUCT.js +162 -0
  111. package/src/shade/renderer/fluid/GPUFluidCascade.d.ts +37 -8
  112. package/src/shade/renderer/fluid/GPUFluidCascade.d.ts.map +1 -1
  113. package/src/shade/renderer/fluid/GPUFluidCascade.js +149 -47
  114. package/src/shade/renderer/fluid/GPUFluidCascadeStack.d.ts +10 -3
  115. package/src/shade/renderer/fluid/GPUFluidCascadeStack.d.ts.map +1 -1
  116. package/src/shade/renderer/fluid/GPUFluidCascadeStack.js +69 -10
  117. package/src/shade/renderer/fluid/chunk_fluid_far_field.d.ts +19 -0
  118. package/src/shade/renderer/fluid/chunk_fluid_far_field.d.ts.map +1 -0
  119. package/src/shade/renderer/fluid/chunk_fluid_far_field.js +43 -0
  120. package/src/shade/renderer/fluid/coupling/FLUID_CASCADE_PARENT_STRUCT.d.ts +10 -9
  121. package/src/shade/renderer/fluid/coupling/FLUID_CASCADE_PARENT_STRUCT.d.ts.map +1 -1
  122. package/src/shade/renderer/fluid/coupling/FLUID_CASCADE_PARENT_STRUCT.js +14 -12
  123. package/src/shade/renderer/fluid/coupling/FLUID_CASCADE_RESTRICT_STRUCT.d.ts +3 -2
  124. package/src/shade/renderer/fluid/coupling/FLUID_CASCADE_RESTRICT_STRUCT.d.ts.map +1 -1
  125. package/src/shade/renderer/fluid/coupling/FLUID_CASCADE_RESTRICT_STRUCT.js +7 -5
  126. package/src/shade/renderer/fluid/coupling/chunk_fluid_cascade_epilogue.d.ts +17 -9
  127. package/src/shade/renderer/fluid/coupling/chunk_fluid_cascade_epilogue.d.ts.map +1 -1
  128. package/src/shade/renderer/fluid/coupling/chunk_fluid_cascade_epilogue.js +58 -18
  129. package/src/shade/renderer/fluid/coupling/chunk_fluid_cascade_parent.d.ts +23 -11
  130. package/src/shade/renderer/fluid/coupling/chunk_fluid_cascade_parent.d.ts.map +1 -1
  131. package/src/shade/renderer/fluid/coupling/chunk_fluid_cascade_parent.js +371 -335
  132. package/src/shade/renderer/fluid/coupling/shader_fluid_cascade_fill.d.ts.map +1 -1
  133. package/src/shade/renderer/fluid/coupling/shader_fluid_cascade_fill.js +2 -1
  134. package/src/shade/renderer/fluid/coupling/shader_fluid_cascade_ghosts.d.ts.map +1 -1
  135. package/src/shade/renderer/fluid/coupling/shader_fluid_cascade_ghosts.js +109 -108
  136. package/src/shade/renderer/fluid/coupling/shader_fluid_cascade_restrict.d.ts +5 -3
  137. package/src/shade/renderer/fluid/coupling/shader_fluid_cascade_restrict.d.ts.map +1 -1
  138. package/src/shade/renderer/fluid/coupling/shader_fluid_cascade_restrict.js +24 -12
  139. package/src/shade/renderer/fluid/mac/FLUID_MAC_STEP_STRUCT.d.ts +6 -2
  140. package/src/shade/renderer/fluid/mac/FLUID_MAC_STEP_STRUCT.d.ts.map +1 -1
  141. package/src/shade/renderer/fluid/mac/FLUID_MAC_STEP_STRUCT.js +10 -5
  142. package/src/shade/renderer/fluid/mac/FluidMacPasses.d.ts +20 -21
  143. package/src/shade/renderer/fluid/mac/FluidMacPasses.d.ts.map +1 -1
  144. package/src/shade/renderer/fluid/mac/FluidMacPasses.js +453 -427
  145. package/src/shade/renderer/fluid/mac/shader_fluid_mac_advect_correct.d.ts.map +1 -1
  146. package/src/shade/renderer/fluid/mac/shader_fluid_mac_advect_correct.js +2 -1
  147. package/src/shade/renderer/fluid/publish/FluidWindPublish.d.ts +13 -5
  148. package/src/shade/renderer/fluid/publish/FluidWindPublish.d.ts.map +1 -1
  149. package/src/shade/renderer/fluid/publish/FluidWindPublish.js +20 -10
  150. package/src/shade/renderer/fluid/publish/chunk_fluid_wind_publish_cell.d.ts +2 -2
  151. package/src/shade/renderer/fluid/publish/chunk_fluid_wind_publish_cell.js +2 -2
  152. package/src/shade/renderer/fluid/publish/shader_fluid_wind_publish.d.ts +5 -3
  153. package/src/shade/renderer/fluid/publish/shader_fluid_wind_publish.d.ts.map +1 -1
  154. package/src/shade/renderer/fluid/publish/shader_fluid_wind_publish.js +147 -142
  155. package/src/shade/renderer/fluid/query/GPUFluidQueries.js +2 -2
  156. package/src/shade/renderer/geometry/GPUGeometryManager.d.ts.map +1 -1
  157. package/src/shade/renderer/geometry/GPUGeometryManager.js +5 -7
  158. package/src/shade/renderer/geometry/MeshletGeometry.d.ts +4 -1
  159. package/src/shade/renderer/geometry/MeshletGeometry.d.ts.map +1 -1
  160. package/src/shade/renderer/geometry/MeshletGeometry.js +4 -1
  161. package/src/shade/renderer/geometry/MeshletGeometrySerializationAdapter.d.ts +20 -0
  162. package/src/shade/renderer/geometry/MeshletGeometrySerializationAdapter.d.ts.map +1 -1
  163. package/src/shade/renderer/geometry/MeshletGeometrySerializationAdapter.js +35 -3
  164. package/src/shade/renderer/geometry/blas_from_meshlets.d.ts +9 -3
  165. package/src/shade/renderer/geometry/blas_from_meshlets.d.ts.map +1 -1
  166. package/src/shade/renderer/geometry/blas_from_meshlets.js +16 -30
  167. package/src/shade/renderer/geometry/bvh/BLAS8_REFIT_TARGET_STRUCT.d.ts +14 -0
  168. package/src/shade/renderer/geometry/bvh/BLAS8_REFIT_TARGET_STRUCT.d.ts.map +1 -0
  169. package/src/shade/renderer/geometry/bvh/BLAS8_REFIT_TARGET_STRUCT.js +33 -0
  170. package/src/shade/renderer/geometry/bvh/GPUBLASRefitBatch.d.ts +18 -21
  171. package/src/shade/renderer/geometry/bvh/GPUBLASRefitBatch.d.ts.map +1 -1
  172. package/src/shade/renderer/geometry/bvh/GPUBLASRefitBatch.js +78 -158
  173. package/src/shade/renderer/geometry/bvh/GPUGeometryBVHManager.d.ts +18 -39
  174. package/src/shade/renderer/geometry/bvh/GPUGeometryBVHManager.d.ts.map +1 -1
  175. package/src/shade/renderer/geometry/bvh/GPUGeometryBVHManager.js +39 -398
  176. package/src/shade/renderer/geometry/bvh/GPUGeometryMeshletsBVH.d.ts +6 -7
  177. package/src/shade/renderer/geometry/bvh/GPUGeometryMeshletsBVH.d.ts.map +1 -1
  178. package/src/shade/renderer/geometry/bvh/GPUGeometryMeshletsBVH.js +5 -7
  179. package/src/shade/renderer/geometry/bvh/bvh8_build_for_meshlets.d.ts +36 -0
  180. package/src/shade/renderer/geometry/bvh/bvh8_build_for_meshlets.d.ts.map +1 -0
  181. package/src/shade/renderer/geometry/bvh/bvh8_build_for_meshlets.js +179 -0
  182. package/src/shade/renderer/geometry/bvh/meshlet_batch_to_clustered_bvh.d.ts +30 -0
  183. package/src/shade/renderer/geometry/bvh/meshlet_batch_to_clustered_bvh.d.ts.map +1 -0
  184. package/src/shade/renderer/geometry/bvh/meshlet_batch_to_clustered_bvh.js +207 -0
  185. package/src/shade/renderer/geometry/bvh/shader_blas8_refit_batch.d.ts +52 -0
  186. package/src/shade/renderer/geometry/bvh/shader_blas8_refit_batch.d.ts.map +1 -0
  187. package/src/shade/renderer/geometry/bvh/shader_blas8_refit_batch.js +464 -0
  188. package/src/shade/renderer/geometry/meshlet/MeshletBatch.d.ts +12 -0
  189. package/src/shade/renderer/geometry/meshlet/MeshletBatch.d.ts.map +1 -1
  190. package/src/shade/renderer/geometry/meshlet/MeshletBatch.js +37 -0
  191. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_classify.d.ts.map +1 -1
  192. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_classify.js +4 -4
  193. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_evaluate.d.ts.map +1 -1
  194. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_evaluate.js +2 -2
  195. package/src/shade/renderer/geometry/sdf/chunk_blas_query_band_sdf.d.ts.map +1 -1
  196. package/src/shade/renderer/geometry/sdf/chunk_blas_query_band_sdf.js +2 -2
  197. package/src/shade/renderer/geometry/sdf/shader_sdf_visualize.d.ts.map +1 -1
  198. package/src/shade/renderer/geometry/sdf/shader_sdf_visualize.js +4 -4
  199. package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_trace.d.ts.map +1 -1
  200. package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_trace.js +2 -2
  201. package/src/shade/renderer/geometry/sr_create_group_RTX.d.ts.map +1 -1
  202. package/src/shade/renderer/geometry/sr_create_group_RTX.js +4 -4
  203. package/src/shade/renderer/global_illumination/brick4/gpu/bake/brick4_bake_basic.d.ts.map +1 -1
  204. package/src/shade/renderer/global_illumination/brick4/gpu/bake/brick4_bake_basic.js +1 -0
  205. package/src/shade/renderer/global_illumination/lpv/bake/GPULightProbeVolumeRenderer.d.ts.map +1 -1
  206. package/src/shade/renderer/global_illumination/lpv/bake/GPULightProbeVolumeRenderer.js +1 -0
  207. package/src/shade/renderer/global_illumination/lpv/placement/graph_generate_probe_locations.d.ts.map +1 -1
  208. package/src/shade/renderer/global_illumination/lpv/placement/graph_generate_probe_locations.js +372 -376
  209. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK.d.ts +9 -10
  210. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK.d.ts.map +1 -1
  211. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK.js +10 -11
  212. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_walk.d.ts +2 -2
  213. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_walk.js +2 -2
  214. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_gather.d.ts +12 -8
  215. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_gather.d.ts.map +1 -1
  216. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_gather.js +109 -60
  217. package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_mesh_sdf.js +2 -2
  218. package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_mesh_surfaces.js +2 -2
  219. package/src/shade/renderer/gpu_primitive/bvh/BVH_BUFFER_LAYOUT.d.ts +2 -2
  220. package/src/shade/renderer/gpu_primitive/bvh/BVH_BUFFER_LAYOUT.js +70 -70
  221. package/src/shade/renderer/gpu_primitive/bvh/BVH_BUILD_SETTINGS_STRUCT.d.ts +6 -7
  222. package/src/shade/renderer/gpu_primitive/bvh/BVH_BUILD_SETTINGS_STRUCT.d.ts.map +1 -1
  223. package/src/shade/renderer/gpu_primitive/bvh/BVH_BUILD_SETTINGS_STRUCT.js +6 -7
  224. package/src/shade/renderer/gpu_primitive/bvh/graph_bvh_build_lbvh.d.ts +3 -3
  225. package/src/shade/renderer/gpu_primitive/bvh/graph_bvh_build_lbvh.js +3 -3
  226. package/src/shade/renderer/gpu_primitive/bvh/shader_bvh_build_single_workgroup.js +1 -1
  227. package/src/shade/renderer/gpu_primitive/bvh/shader_bvh_emit_hierarchy.d.ts +2 -2
  228. package/src/shade/renderer/gpu_primitive/bvh/shader_bvh_emit_hierarchy.js +3 -3
  229. package/src/shade/renderer/gpu_primitive/bvh8/BVH8_TREE_BUFFER_LAYOUT.d.ts +69 -0
  230. package/src/shade/renderer/gpu_primitive/bvh8/BVH8_TREE_BUFFER_LAYOUT.d.ts.map +1 -0
  231. package/src/shade/renderer/gpu_primitive/bvh8/BVH8_TREE_BUFFER_LAYOUT.js +89 -0
  232. package/src/shade/renderer/gpu_primitive/bvh8/bvh8_encode_from_bvh2.d.ts +41 -0
  233. package/src/shade/renderer/gpu_primitive/bvh8/bvh8_encode_from_bvh2.d.ts.map +1 -0
  234. package/src/shade/renderer/gpu_primitive/bvh8/bvh8_encode_from_bvh2.js +348 -0
  235. package/src/shade/renderer/gpu_primitive/bvh8/check_bvh8_tree.d.ts +34 -0
  236. package/src/shade/renderer/gpu_primitive/bvh8/check_bvh8_tree.d.ts.map +1 -0
  237. package/src/shade/renderer/gpu_primitive/bvh8/check_bvh8_tree.js +291 -0
  238. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_assign.d.ts +31 -0
  239. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_assign.d.ts.map +1 -0
  240. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_assign.js +175 -0
  241. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_depth.d.ts +27 -0
  242. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_depth.d.ts.map +1 -0
  243. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_depth.js +48 -0
  244. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_gather.d.ts +26 -0
  245. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_gather.d.ts.map +1 -0
  246. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_gather.js +118 -0
  247. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_node.d.ts +22 -0
  248. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_node.d.ts.map +1 -0
  249. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_node.js +143 -0
  250. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_sums.d.ts +36 -0
  251. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_sums.d.ts.map +1 -0
  252. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_sums.js +97 -0
  253. package/src/shade/renderer/gpu_primitive/bvh8/graph_bvh8_encode_from_bvh2.d.ts +49 -0
  254. package/src/shade/renderer/gpu_primitive/bvh8/graph_bvh8_encode_from_bvh2.d.ts.map +1 -0
  255. package/src/shade/renderer/gpu_primitive/bvh8/graph_bvh8_encode_from_bvh2.js +265 -0
  256. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_assign.d.ts +37 -0
  257. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_assign.d.ts.map +1 -0
  258. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_assign.js +109 -0
  259. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_count.d.ts +15 -0
  260. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_count.d.ts.map +1 -0
  261. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_count.js +85 -0
  262. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_count_single_workgroup.d.ts +26 -0
  263. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_count_single_workgroup.d.ts.map +1 -0
  264. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_count_single_workgroup.js +200 -0
  265. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_parents.d.ts +19 -0
  266. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_parents.d.ts.map +1 -0
  267. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_parents.js +81 -0
  268. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_write.d.ts +14 -0
  269. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_write.d.ts.map +1 -0
  270. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_write.js +101 -0
  271. package/src/shade/renderer/gpu_primitive/bvh8/verify_gpu_bvh8_encode.d.ts +19 -0
  272. package/src/shade/renderer/gpu_primitive/bvh8/verify_gpu_bvh8_encode.d.ts.map +1 -0
  273. package/src/shade/renderer/gpu_primitive/bvh8/verify_gpu_bvh8_encode.js +361 -0
  274. package/src/shade/renderer/grass/surface/shader_grass_surface_bake.d.ts.map +1 -1
  275. package/src/shade/renderer/grass/surface/shader_grass_surface_bake.js +5 -6
  276. package/src/shade/renderer/lightmap/GPULightMap.d.ts.map +1 -1
  277. package/src/shade/renderer/lightmap/GPULightMap.js +1 -0
  278. package/src/shade/renderer/path_tracer/accumulating/AccumulatingPathTracer.d.ts.map +1 -1
  279. package/src/shade/renderer/path_tracer/accumulating/AccumulatingPathTracer.js +1 -0
  280. package/src/shade/renderer/path_tracer/graph_path_trace_scene.d.ts.map +1 -1
  281. package/src/shade/renderer/path_tracer/graph_path_trace_scene.js +1 -0
  282. package/src/shade/renderer/scene/GPUInstancesAccelerationStructure.d.ts +8 -4
  283. package/src/shade/renderer/scene/GPUInstancesAccelerationStructure.d.ts.map +1 -1
  284. package/src/shade/renderer/scene/GPUInstancesAccelerationStructure.js +60 -33
  285. package/src/shade/renderer/scene/verify_gpu_tlas_build.d.ts +6 -6
  286. package/src/shade/renderer/scene/verify_gpu_tlas_build.d.ts.map +1 -1
  287. package/src/shade/renderer/scene/verify_gpu_tlas_build.js +23 -53
  288. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/BVH8_INODE_STRUCT.d.ts +3 -1
  289. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/BVH8_INODE_STRUCT.d.ts.map +1 -1
  290. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/BVH8_INODE_STRUCT.js +5 -3
  291. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/BVH8_MAX_DEPTH.d.ts +28 -0
  292. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/BVH8_MAX_DEPTH.d.ts.map +1 -0
  293. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/BVH8_MAX_DEPTH.js +29 -0
  294. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_node_grid.d.ts +25 -0
  295. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_node_grid.d.ts.map +1 -0
  296. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_node_grid.js +97 -0
  297. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_node_intersect.d.ts +8 -0
  298. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_node_intersect.d.ts.map +1 -1
  299. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_node_intersect.js +23 -14
  300. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_node_slot_distances.d.ts +36 -0
  301. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_node_slot_distances.d.ts.map +1 -0
  302. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_node_slot_distances.js +222 -0
  303. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_ray_direction_rcp.d.ts +20 -0
  304. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_ray_direction_rcp.d.ts.map +1 -0
  305. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_ray_direction_rcp.js +30 -0
  306. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_tree_read.d.ts +30 -0
  307. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_tree_read.d.ts.map +1 -0
  308. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_tree_read.js +91 -0
  309. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_waiting_slots.d.ts +23 -0
  310. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_waiting_slots.d.ts.map +1 -0
  311. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_waiting_slots.js +40 -0
  312. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_blas_nearest.d.ts +22 -0
  313. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_blas_nearest.d.ts.map +1 -1
  314. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_blas_nearest.js +121 -70
  315. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_blas_occluded.d.ts +13 -1
  316. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_blas_occluded.d.ts.map +1 -1
  317. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_blas_occluded.js +117 -61
  318. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_nearest.d.ts +21 -0
  319. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_nearest.d.ts.map +1 -1
  320. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_nearest.js +111 -72
  321. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_nearest_among.d.ts +1 -2
  322. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_nearest_among.d.ts.map +1 -1
  323. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_nearest_among.js +83 -54
  324. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_occluded.d.ts +14 -0
  325. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_occluded.d.ts.map +1 -1
  326. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_occluded.js +92 -60
  327. package/src/shade/renderer/shader/chunk/sdf/chunk_point_query_blas_nearest.d.ts +22 -0
  328. package/src/shade/renderer/shader/chunk/sdf/chunk_point_query_blas_nearest.d.ts.map +1 -1
  329. package/src/shade/renderer/shader/chunk/sdf/chunk_point_query_blas_nearest.js +153 -106
  330. package/src/shade/renderer/shader/chunk/sdf/chunk_scene_point_query_nearest.d.ts +21 -0
  331. package/src/shade/renderer/shader/chunk/sdf/chunk_scene_point_query_nearest.d.ts.map +1 -1
  332. package/src/shade/renderer/shader/chunk/sdf/chunk_scene_point_query_nearest.js +115 -74
  333. package/src/shade/renderer/shader/chunk/sdf/chunk_scene_sdf_raymarch.d.ts +5 -2
  334. package/src/shade/renderer/shader/chunk/sdf/chunk_scene_sdf_raymarch.d.ts.map +1 -1
  335. package/src/shade/renderer/shader/chunk/sdf/chunk_scene_sdf_raymarch.js +89 -63
  336. package/src/shade/renderer/shader/chunk/sdf/chunk_sdf_query_distance.d.ts +15 -0
  337. package/src/shade/renderer/shader/chunk/sdf/chunk_sdf_query_distance.d.ts.map +1 -1
  338. package/src/shade/renderer/shader/chunk/sdf/chunk_sdf_query_distance.js +108 -63
  339. package/src/shade/renderer/shadow/sdf/chunk_ray_query_sdf_raycast.d.ts +14 -0
  340. package/src/shade/renderer/shadow/sdf/chunk_ray_query_sdf_raycast.d.ts.map +1 -1
  341. package/src/shade/renderer/shadow/sdf/chunk_ray_query_sdf_raycast.js +94 -60
  342. package/src/shade/renderer/shadow/sdf/graph_draw_sdf_shadows.d.ts.map +1 -1
  343. package/src/shade/renderer/shadow/sdf/graph_draw_sdf_shadows.js +4 -4
  344. package/src/shade/renderer/volumetrics/graph_build_volumetrics.js +2 -2
  345. package/src/shade/renderer/water/query/shader_water_surface_query.d.ts.map +1 -1
  346. package/src/shade/renderer/water/query/shader_water_surface_query.js +227 -227
  347. package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.d.ts.map +1 -1
  348. package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.js +7 -4
  349. package/src/shade/renderer/water/surface/particles/shader_water_particles.js +2 -2
  350. package/src/shade/renderer/wind/GPUSceneWind.d.ts +36 -4
  351. package/src/shade/renderer/wind/GPUSceneWind.d.ts.map +1 -1
  352. package/src/shade/renderer/wind/GPUSceneWind.js +150 -4
  353. package/src/shade/renderer/wind/WIND_FIELD_STRUCT.d.ts +9 -3
  354. package/src/shade/renderer/wind/WIND_FIELD_STRUCT.d.ts.map +1 -1
  355. package/src/shade/renderer/wind/WIND_FIELD_STRUCT.js +13 -3
  356. package/src/shade/renderer/wind/WIND_FIELD_UNIFORM.d.ts +6 -6
  357. package/src/shade/renderer/wind/WIND_FIELD_UNIFORM.js +6 -6
  358. package/src/shade/renderer/wind/chunk_fluid_turbulence.d.ts +39 -0
  359. package/src/shade/renderer/wind/chunk_fluid_turbulence.d.ts.map +1 -0
  360. package/src/shade/renderer/wind/chunk_fluid_turbulence.js +63 -0
  361. package/src/shade/renderer/wind/chunk_wind_field_sample_cascades.d.ts +10 -7
  362. package/src/shade/renderer/wind/chunk_wind_field_sample_cascades.d.ts.map +1 -1
  363. package/src/shade/renderer/wind/chunk_wind_field_sample_cascades.js +34 -11
  364. package/src/shade/renderer/wind/chunk_wind_field_sample_uniform.d.ts +2 -2
  365. package/src/shade/renderer/wind/chunk_wind_field_sample_uniform.js +2 -2
  366. package/src/shade/renderer/wind/wind_field_add_resources.d.ts +6 -4
  367. package/src/shade/renderer/wind/wind_field_add_resources.d.ts.map +1 -1
  368. package/src/shade/renderer/wind/wind_field_add_resources.js +9 -6
  369. package/src/shade/renderer/geometry/bvh/BLAS_REFIT_TARGET_STRUCT.d.ts +0 -18
  370. package/src/shade/renderer/geometry/bvh/BLAS_REFIT_TARGET_STRUCT.d.ts.map +0 -1
  371. package/src/shade/renderer/geometry/bvh/BLAS_REFIT_TARGET_STRUCT.js +0 -50
  372. package/src/shade/renderer/geometry/bvh/bvh2_derive_topology.d.ts +0 -23
  373. package/src/shade/renderer/geometry/bvh/bvh2_derive_topology.d.ts.map +0 -1
  374. package/src/shade/renderer/geometry/bvh/bvh2_derive_topology.js +0 -87
  375. package/src/shade/renderer/geometry/bvh/shader_blas_refit_batch.d.ts +0 -42
  376. package/src/shade/renderer/geometry/bvh/shader_blas_refit_batch.d.ts.map +0 -1
  377. package/src/shade/renderer/geometry/bvh/shader_blas_refit_batch.js +0 -141
  378. package/src/shade/renderer/geometry/bvh/shader_blas_refit_batch_seed.d.ts +0 -21
  379. package/src/shade/renderer/geometry/bvh/shader_blas_refit_batch_seed.d.ts.map +0 -1
  380. package/src/shade/renderer/geometry/bvh/shader_blas_refit_batch_seed.js +0 -75
  381. package/src/shade/renderer/geometry/meshlet_batch_to_bvh.d.ts +0 -17
  382. package/src/shade/renderer/geometry/meshlet_batch_to_bvh.d.ts.map +0 -1
  383. package/src/shade/renderer/geometry/meshlet_batch_to_bvh.js +0 -247
  384. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_ray_query_blas_occlusion.d.ts +0 -7
  385. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_ray_query_blas_occlusion.d.ts.map +0 -1
  386. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_ray_query_blas_occlusion.js +0 -226
  387. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mask_visibility_via_rays.d.ts +0 -8
  388. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mask_visibility_via_rays.d.ts.map +0 -1
  389. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mask_visibility_via_rays.js +0 -45
  390. package/src/shade/renderer/shader/chunk/light/sample/chunk_ray_sample_light.d.ts +0 -3
  391. package/src/shade/renderer/shader/chunk/light/sample/chunk_ray_sample_light.d.ts.map +0 -1
  392. package/src/shade/renderer/shader/chunk/light/sample/chunk_ray_sample_light.js +0 -105
  393. package/src/shade/renderer/shadow/sdf/chunk_ray_query_sdf_distance.d.ts +0 -6
  394. package/src/shade/renderer/shadow/sdf/chunk_ray_query_sdf_distance.d.ts.map +0 -1
  395. package/src/shade/renderer/shadow/sdf/chunk_ray_query_sdf_distance.js +0 -86
  396. package/src/shade/renderer/shadow/sdf/chunk_ray_query_sdf_raycast_traversal_count.d.ts +0 -2
  397. package/src/shade/renderer/shadow/sdf/chunk_ray_query_sdf_raycast_traversal_count.d.ts.map +0 -1
  398. package/src/shade/renderer/shadow/sdf/chunk_ray_query_sdf_raycast_traversal_count.js +0 -136
@@ -1 +1 @@
1
- {"version":3,"file":"shader_fluid_mac_advect_correct.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/fluid/mac/shader_fluid_mac_advect_correct.js"],"names":[],"mappings":"AAkSA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,8CAFU,aAAa,CAMpB;8BA/U2B,+BAA+B"}
1
+ {"version":3,"file":"shader_fluid_mac_advect_correct.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/fluid/mac/shader_fluid_mac_advect_correct.js"],"names":[],"mappings":"AAmSA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,8CAFU,aAAa,CAMpB;8BAhV2B,+BAA+B"}
@@ -19,10 +19,11 @@ import {
19
19
  chunk_fluid_mac_seam_source
20
20
  } from "./chunk_fluid_mac_seams.js";
21
21
  import { FLUID_MAC_STEP_STRUCT } from "./FLUID_MAC_STEP_STRUCT.js";
22
+ import { fluid_turbulence_add_resources } from "../../wind/chunk_fluid_turbulence.js";
22
23
 
23
24
  const resources = new ShaderResourceSetDescriptor();
24
25
 
25
- resources.createGroup()
26
+ fluid_turbulence_add_resources(resources.createGroup())
26
27
  .addUniform("step", FLUID_MAC_STEP_STRUCT)
27
28
  .addUniform("parent", FLUID_CASCADE_PARENT_STRUCT)
28
29
  .addTexture("source_u", "unfilterable-float", "3d")
@@ -20,7 +20,7 @@ export class FluidWindPublish {
20
20
  */
21
21
  static enquirePipelines(enquiry: import("../../../device/pipeline/PipelineEnquiry.js").PipelineEnquiry): void;
22
22
  /**
23
- * Write a cascade's tile from its velocity: the deviation from `far_velocity` at every cell centre
23
+ * Write a cascade's tile from its velocity: the deviation from `far` at every cell centre
24
24
  * and the skirt around them. The tile's content is the cascade's window: `atlas.content_size` is
25
25
  * its resolution.
26
26
  *
@@ -28,8 +28,10 @@ export class FluidWindPublish {
28
28
  * @param {ShadeGPUCommandContext} options.encoder
29
29
  * @param {FluidMacVelocityViews} options.velocity the cascade's persistent velocity after its step, toroidal
30
30
  * @param {ArrayLike<number>} options.corner the world cell at window-local (0, 0, 0)
31
- * @param {ArrayLike<number>} options.far_velocity `v_far(t_s,c)`, m/s: the far field of the cascade's read
32
- * record, what the deviation is from
31
+ * @param {{mean: ArrayLike<number>, sigma: number, origin: ArrayLike<number>, scale: ArrayLike<number>}} options.far
32
+ * `v_far(t_s,c)`, the far field of the cascade's read record over its window's cells
33
+ * ({@link FLUID_FAR_FIELD_STRUCT}, `GPUFluidCascade#describe_far`): what the deviation is from
34
+ * @param {GPUTextureView} options.turbulence the turbulence tile the far field and the parent read
33
35
  * @param {object} options.parent what lies beyond the window, as {@link FLUID_CASCADE_PARENT_STRUCT}
34
36
  * lays it out, read as of the cascade's record (`GPUFluidCascade#describe_parent`); the far field
35
37
  * is a parent with no window
@@ -38,11 +40,17 @@ export class FluidWindPublish {
38
40
  * @param {GPUTileAtlas3D} options.atlas the wind field's atlas, `rgba16float`, border 1
39
41
  * @param {number} options.slot the cascade's live slot in it
40
42
  */
41
- record({ encoder, velocity, corner, far_velocity, parent, parent_faces, atlas, slot }: {
43
+ record({ encoder, velocity, corner, far, turbulence, parent, parent_faces, atlas, slot }: {
42
44
  encoder: ShadeGPUCommandContext;
43
45
  velocity: FluidMacVelocityViews;
44
46
  corner: ArrayLike<number>;
45
- far_velocity: ArrayLike<number>;
47
+ far: {
48
+ mean: ArrayLike<number>;
49
+ sigma: number;
50
+ origin: ArrayLike<number>;
51
+ scale: ArrayLike<number>;
52
+ };
53
+ turbulence: GPUTextureView;
46
54
  parent: object;
47
55
  parent_faces: FluidMacVelocityViews;
48
56
  atlas: GPUTileAtlas3D;
@@ -1 +1 @@
1
- {"version":3,"file":"FluidWindPublish.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/fluid/publish/FluidWindPublish.js"],"names":[],"mappings":"AAQA;;;;GAIG;AAEH;;;;;;;GAOG;AACH;IACI;;;;;OAKG;IACH,iCAFW,OAAO,6CAA6C,EAAE,eAAe,QAI/E;IAmCD;;;;;;;;;;;;;;;;;;OAkBG;IACH;QAb2C,OAAO,EAAvC,sBAAsB;QACS,QAAQ,EAAvC,qBAAqB;QACM,MAAM,EAAjC,UAAU,MAAM,CAAC;QACU,YAAY,EAAvC,UAAU,MAAM,CAAC;QAED,MAAM,EAAtB,MAAM;QAGyB,YAAY,EAA3C,qBAAqB;QAEG,KAAK,EAA7B,cAAc;QACE,IAAI,EAApB,MAAM;aA6DhB;;CACJ;qCAxIY,OAAO,2CAA2C,EAAE,sBAAsB;oCAC1E,OAAO,0BAA0B,EAAE,qBAAqB;6BACxD,OAAO,uCAAuC,EAAE,cAAc"}
1
+ {"version":3,"file":"FluidWindPublish.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/fluid/publish/FluidWindPublish.js"],"names":[],"mappings":"AASA;;;;GAIG;AAEH;;;;;;;GAOG;AACH;IACI;;;;;OAKG;IACH,iCAFW,OAAO,6CAA6C,EAAE,eAAe,QAI/E;IAmCD;;;;;;;;;;;;;;;;;;;;OAoBG;IACH;QAf2C,OAAO,EAAvC,sBAAsB;QACS,QAAQ,EAAvC,qBAAqB;QACM,MAAM,EAAjC,UAAU,MAAM,CAAC;QACsF,GAAG,EAA1G;YAAC,IAAI,EAAE,UAAU,MAAM,CAAC,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,UAAU,MAAM,CAAC,CAAC;YAAC,KAAK,EAAE,UAAU,MAAM,CAAC,CAAA;SAAC;QAGrE,UAAU;QAClB,MAAM,EAAtB,MAAM;QAGyB,YAAY,EAA3C,qBAAqB;QAEG,KAAK,EAA7B,cAAc;QACE,IAAI,EAApB,MAAM;aAoEhB;;CACJ;qCAjJY,OAAO,2CAA2C,EAAE,sBAAsB;oCAC1E,OAAO,0BAA0B,EAAE,qBAAqB;6BACxD,OAAO,uCAAuC,EAAE,cAAc"}
@@ -5,6 +5,7 @@ import { FLUID_CASCADE_PARENT_STRUCT } from "../coupling/FLUID_CASCADE_PARENT_ST
5
5
  import { fluid_cascade_window_place, fluid_cascade_window_value } from "../fluid_cascade_window.js";
6
6
  import { FLUID_WIND_PUBLISH_STRUCT } from "./FLUID_WIND_PUBLISH_STRUCT.js";
7
7
  import { FLUID_WIND_PUBLISH_GROUP_SIZE, shader_fluid_wind_publish } from "./shader_fluid_wind_publish.js";
8
+ import { FLUID_FAR_FIELD_STRUCT, fluid_far_field_value } from "../FLUID_FAR_FIELD_STRUCT.js";
8
9
 
9
10
  /**
10
11
  * @typedef {import("../../../device/ShadeGPUCommandContext.js").ShadeGPUCommandContext} ShadeGPUCommandContext
@@ -37,9 +38,9 @@ export class FluidWindPublish {
37
38
  faces_u: fluid_cascade_window_value(),
38
39
  faces_v: fluid_cascade_window_value(),
39
40
  faces_w: fluid_cascade_window_value(),
40
- far_velocity: new Float32Array(3),
41
+ far: fluid_far_field_value(),
42
+ far_end: fluid_far_field_value(),
41
43
  dt_over_h: 0,
42
- far_velocity_end: new Float32Array(3),
43
44
  rhs_scale: 0,
44
45
  keep: 1,
45
46
  deviation_limit: 0,
@@ -57,7 +58,7 @@ export class FluidWindPublish {
57
58
  encoder: null,
58
59
  bindings: {
59
60
  step: null, publish: null, parent: null, source_u: null, source_v: null, source_w: null,
60
- parent_u: null, parent_v: null, parent_w: null, tile: null,
61
+ parent_u: null, parent_v: null, parent_w: null, tile: null, fluid_turbulence: null,
61
62
  },
62
63
  group_count_x: 1,
63
64
  group_count_y: 1,
@@ -65,7 +66,7 @@ export class FluidWindPublish {
65
66
  };
66
67
 
67
68
  /**
68
- * Write a cascade's tile from its velocity: the deviation from `far_velocity` at every cell centre
69
+ * Write a cascade's tile from its velocity: the deviation from `far` at every cell centre
69
70
  * and the skirt around them. The tile's content is the cascade's window: `atlas.content_size` is
70
71
  * its resolution.
71
72
  *
@@ -73,8 +74,10 @@ export class FluidWindPublish {
73
74
  * @param {ShadeGPUCommandContext} options.encoder
74
75
  * @param {FluidMacVelocityViews} options.velocity the cascade's persistent velocity after its step, toroidal
75
76
  * @param {ArrayLike<number>} options.corner the world cell at window-local (0, 0, 0)
76
- * @param {ArrayLike<number>} options.far_velocity `v_far(t_s,c)`, m/s: the far field of the cascade's read
77
- * record, what the deviation is from
77
+ * @param {{mean: ArrayLike<number>, sigma: number, origin: ArrayLike<number>, scale: ArrayLike<number>}} options.far
78
+ * `v_far(t_s,c)`, the far field of the cascade's read record over its window's cells
79
+ * ({@link FLUID_FAR_FIELD_STRUCT}, `GPUFluidCascade#describe_far`): what the deviation is from
80
+ * @param {GPUTextureView} options.turbulence the turbulence tile the far field and the parent read
78
81
  * @param {object} options.parent what lies beyond the window, as {@link FLUID_CASCADE_PARENT_STRUCT}
79
82
  * lays it out, read as of the cascade's record (`GPUFluidCascade#describe_parent`); the far field
80
83
  * is a parent with no window
@@ -83,11 +86,12 @@ export class FluidWindPublish {
83
86
  * @param {GPUTileAtlas3D} options.atlas the wind field's atlas, `rgba16float`, border 1
84
87
  * @param {number} options.slot the cascade's live slot in it
85
88
  */
86
- record({ encoder, velocity, corner, far_velocity, parent, parent_faces, atlas, slot }) {
89
+ record({ encoder, velocity, corner, far, turbulence, parent, parent_faces, atlas, slot }) {
87
90
  assert.defined(encoder, 'encoder');
88
91
  assert.defined(velocity, 'velocity');
89
92
  assert.defined(parent, 'parent');
90
93
  assert.defined(parent_faces, 'parent_faces');
94
+ assert.defined(turbulence, 'turbulence');
91
95
  assert.equal(atlas.format, WIND_FIELD_TILE_FORMAT, 'atlas.format');
92
96
  assert.equal(atlas.border, WIND_FIELD_TILE_BORDER, 'atlas.border');
93
97
  assert.ok(atlas.is_live(slot), 'slot is a live tile of the atlas');
@@ -97,11 +101,16 @@ export class FluidWindPublish {
97
101
 
98
102
  for (let axis = 0; axis < 3; axis++) {
99
103
  assert.isInteger(corner[axis], 'corner');
100
- assert.isFinite(far_velocity[axis], 'far_velocity');
104
+ assert.isFinite(far.mean[axis], 'far.mean');
101
105
 
102
- step.far_velocity[axis] = far_velocity[axis];
106
+ step.far.mean[axis] = far.mean[axis];
107
+ step.far.origin[axis] = far.origin[axis];
108
+ step.far.scale[axis] = far.scale[axis];
103
109
  }
104
110
 
111
+ step.far.sigma = far.sigma;
112
+ step.far.lod = far.lod ?? 0;
113
+
105
114
  fluid_cascade_window_place(step.cells, corner, resolution, -1);
106
115
  fluid_cascade_window_place(step.faces_u, corner, resolution, 0);
107
116
  fluid_cascade_window_place(step.faces_v, corner, resolution, 1);
@@ -127,6 +136,7 @@ export class FluidWindPublish {
127
136
  b.parent_v = parent_faces.v;
128
137
  b.parent_w = parent_faces.w;
129
138
  b.tile = atlas.texture;
139
+ b.fluid_turbulence = turbulence;
130
140
 
131
141
  const tile = atlas.tile_size;
132
142
 
@@ -140,7 +150,7 @@ export class FluidWindPublish {
140
150
  } finally {
141
151
  pass.encoder = null;
142
152
  b.step = b.publish = b.parent = b.source_u = b.source_v = b.source_w = b.tile = null;
143
- b.parent_u = b.parent_v = b.parent_w = null;
153
+ b.parent_u = b.parent_v = b.parent_w = b.fluid_turbulence = null;
144
154
  }
145
155
  }
146
156
  }
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * What a cascade publishes into the wind field at one cell (GPU_FLUID_CASCADES_PROPOSAL_2026_10_16.md
3
3
  * §11): `fluid_wind_publish_cell(cell, far_velocity)`, the velocity at window-local cell `cell`'s
4
- * centre — on each axis the mean of the cell's two faces — less the far field the step ran under,
5
- * `v_far(t_s,c)`, m/s.
4
+ * centre — on each axis the mean of the cell's two faces — less `far_velocity`, the far field the step
5
+ * ran under there, `v_far(t_s,c)`, m/s.
6
6
  *
7
7
  * The deviation, not the velocity, is what a tile holds, and the read adds the far field back
8
8
  * through the atmosphere identity (`chunk_wind_field_sample`): `v_far(t) + (v − v_far(t_s,c))·k_c` is
@@ -3,8 +3,8 @@ import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
3
3
  /**
4
4
  * What a cascade publishes into the wind field at one cell (GPU_FLUID_CASCADES_PROPOSAL_2026_10_16.md
5
5
  * §11): `fluid_wind_publish_cell(cell, far_velocity)`, the velocity at window-local cell `cell`'s
6
- * centre — on each axis the mean of the cell's two faces — less the far field the step ran under,
7
- * `v_far(t_s,c)`, m/s.
6
+ * centre — on each axis the mean of the cell's two faces — less `far_velocity`, the far field the step
7
+ * ran under there, `v_far(t_s,c)`, m/s.
8
8
  *
9
9
  * The deviation, not the velocity, is what a tile holds, and the read adds the far field back
10
10
  * through the atmosphere identity (`chunk_wind_field_sample`): `v_far(t) + (v − v_far(t_s,c))·k_c` is
@@ -25,14 +25,16 @@ export const FLUID_WIND_PUBLISH_GROUP_SIZE: number[];
25
25
  * workgroup memory already.
26
26
  *
27
27
  * Bindings:
28
- * - `step`: {@link FLUID_MAC_STEP_STRUCT}: the cascade's windows and `far_velocity`, `v_far(t_s,c)`;
29
- * `cells.size` is the window, and the tile's content;
28
+ * - `step`: {@link FLUID_MAC_STEP_STRUCT}: the cascade's windows and `far`, `v_far(t_s,c)` over the
29
+ * window's cells; `cells.size` is the window, and the tile's content;
30
30
  * - `publish`: {@link FLUID_WIND_PUBLISH_STRUCT}: the tile's texel origin in the atlas;
31
31
  * - `parent`: {@link FLUID_CASCADE_PARENT_STRUCT}, and `parent_u`, `parent_v`, `parent_w` the parent's
32
32
  * persistent faces, read for the skirt;
33
33
  * - `source_u`, `source_v`, `source_w`: the cascade's persistent velocity after its step, `r32float`
34
34
  * 3-D textures, toroidal through `step.faces_*`;
35
- * - `tile`: written, the atlas, `rgba16float` 3-D storage texture.
35
+ * - `tile`: written, the atlas, `rgba16float` 3-D storage texture;
36
+ * - the turbulence tile (`fluid_turbulence_add_resources`), which the far field reads a texel at a time
37
+ * with turbulence.
36
38
  *
37
39
  * @type {ComputeShader}
38
40
  */
@@ -1 +1 @@
1
- {"version":3,"file":"shader_fluid_wind_publish.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/fluid/publish/shader_fluid_wind_publish.js"],"names":[],"mappings":"AAWA;;;GAGG;AACH,4CAFU,MAAM,EAAE,CAEoD;AAyFtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wCAFU,aAAa,CAMpB;8BA7I2B,+BAA+B"}
1
+ {"version":3,"file":"shader_fluid_wind_publish.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/fluid/publish/shader_fluid_wind_publish.js"],"names":[],"mappings":"AAaA;;;GAGG;AACH,4CAFU,MAAM,EAAE,CAEoD;AA0FtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wCAFU,aAAa,CAMpB;8BAlJ2B,+BAA+B"}
@@ -1,142 +1,147 @@
1
- import { ComputeShader } from "../../shader/ComputeShader.js";
2
- import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
3
- import { ShaderResourceSetDescriptor } from "../../shader/resource/ShaderResourceSetDescriptor.js";
4
- import { WIND_FIELD_TILE_BORDER, WIND_FIELD_TILE_FORMAT } from "../../wind/WIND_FIELD.js";
5
- import { chunk_grid_tile_window } from "../../shader/chunk/grid/chunk_grid_tile_window.js";
6
- import { chunk_fluid_cascade_parent_velocity } from "../coupling/chunk_fluid_cascade_parent.js";
7
- import { FLUID_MAC_STEP_STRUCT } from "../mac/FLUID_MAC_STEP_STRUCT.js";
8
- import { FLUID_CASCADE_PARENT_STRUCT } from "../coupling/FLUID_CASCADE_PARENT_STRUCT.js";
9
- import { chunk_fluid_wind_publish_cell } from "./chunk_fluid_wind_publish_cell.js";
10
- import { FLUID_WIND_PUBLISH_STRUCT } from "./FLUID_WIND_PUBLISH_STRUCT.js";
11
-
12
- /**
13
- * Invocations along each axis of a workgroup: one per texel of the tile, whose sides are N + 2.
14
- * @type {number[]}
15
- */
16
- export const FLUID_WIND_PUBLISH_GROUP_SIZE = Object.freeze([4, 4, 4]);
17
-
18
- const resources = new ShaderResourceSetDescriptor();
19
-
20
- resources.createGroup()
21
- .addUniform("step", FLUID_MAC_STEP_STRUCT)
22
- .addUniform("publish", FLUID_WIND_PUBLISH_STRUCT)
23
- .addUniform("parent", FLUID_CASCADE_PARENT_STRUCT)
24
- .addTexture("source_u", "unfilterable-float", "3d")
25
- .addTexture("source_v", "unfilterable-float", "3d")
26
- .addTexture("source_w", "unfilterable-float", "3d")
27
- .addTexture("parent_u", "unfilterable-float", "3d")
28
- .addTexture("parent_v", "unfilterable-float", "3d")
29
- .addTexture("parent_w", "unfilterable-float", "3d")
30
- .addStorageTexture("tile", WIND_FIELD_TILE_FORMAT, "3d", "write-only");
31
-
32
- const body = CodeChunk.from(
33
- //language=WGSL
34
- `
35
- const FLUID_WIND_PUBLISH_BORDER: u32 = ${WIND_FIELD_TILE_BORDER}u;
36
-
37
- // the step's end velocity, the persistent set, through its toroidal windows; beyond the window, the
38
- // cascade's boundary: its parent's identity read as of its record, as its seams read it (the skirt is
39
- // one face deep, so the read itself, not a step's ghosts)
40
- fn fluid_wind_publish_face_u(face: vec3<i32>) -> f32 {
41
- if (grid_tile_window_contains(face, step.faces_u.size)) {
42
- return textureLoad(source_u, grid_tile_window_storage(face, step.faces_u.corner_storage, step.faces_u.period), 0).r;
43
- }
44
-
45
- return fluid_parent_face_u(face, step.cells.corner - parent.origin);
46
- }
47
-
48
- fn fluid_wind_publish_face_v(face: vec3<i32>) -> f32 {
49
- if (grid_tile_window_contains(face, step.faces_v.size)) {
50
- return textureLoad(source_v, grid_tile_window_storage(face, step.faces_v.corner_storage, step.faces_v.period), 0).r;
51
- }
52
-
53
- return fluid_parent_face_v(face, step.cells.corner - parent.origin);
54
- }
55
-
56
- fn fluid_wind_publish_face_w(face: vec3<i32>) -> f32 {
57
- if (grid_tile_window_contains(face, step.faces_w.size)) {
58
- return textureLoad(source_w, grid_tile_window_storage(face, step.faces_w.corner_storage, step.faces_w.period), 0).r;
59
- }
60
-
61
- return fluid_parent_face_w(face, step.cells.corner - parent.origin);
62
- }
63
-
64
- @compute @workgroup_size(${FLUID_WIND_PUBLISH_GROUP_SIZE.join(', ')})
65
- fn main(@builtin(global_invocation_id) id: vec3<u32>) {
66
- // the window's cells and a skirt on every side
67
- let tile_size = step.cells.size + vec3<u32>(2u * FLUID_WIND_PUBLISH_BORDER);
68
-
69
- if (any(id >= tile_size)) {
70
- return;
71
- }
72
-
73
- // tile texel t holds window-local cell t - border
74
- let cell = vec3<i32>(id) - vec3<i32>(i32(FLUID_WIND_PUBLISH_BORDER));
75
- var deviation: vec3<f32>;
76
-
77
- if (grid_tile_window_contains(cell, step.cells.size)) {
78
- let su0 = grid_tile_window_storage(cell, step.faces_u.corner_storage, step.faces_u.period);
79
- let su1_x = select(su0.x + 1u, 0u, su0.x + 1u == step.faces_u.period.x);
80
- let sv0 = grid_tile_window_storage(cell, step.faces_v.corner_storage, step.faces_v.period);
81
- let sv1_y = select(sv0.y + 1u, 0u, sv0.y + 1u == step.faces_v.period.y);
82
- let sw0 = grid_tile_window_storage(cell, step.faces_w.corner_storage, step.faces_w.period);
83
- let sw1_z = select(sw0.z + 1u, 0u, sw0.z + 1u == step.faces_w.period.z);
84
-
85
- let faces = vec3<f32>(
86
- textureLoad(source_u, su0, 0).r + textureLoad(source_u, vec3<u32>(su1_x, su0.y, su0.z), 0).r,
87
- textureLoad(source_v, sv0, 0).r + textureLoad(source_v, vec3<u32>(sv0.x, sv1_y, sv0.z), 0).r,
88
- textureLoad(source_w, sw0, 0).r + textureLoad(source_w, vec3<u32>(sw0.x, sw0.y, sw1_z), 0).r,
89
- );
90
-
91
- deviation = 0.5 * faces - step.far_velocity;
92
- } else {
93
- deviation = fluid_wind_publish_cell(cell, step.far_velocity);
94
- }
95
-
96
- textureStore(tile, publish.tile_origin + id, vec4<f32>(deviation, 0.0));
97
- }
98
- `, [
99
- chunk_grid_tile_window,
100
- chunk_fluid_cascade_parent_velocity,
101
- chunk_fluid_wind_publish_cell,
102
- ]
103
- );
104
-
105
- /**
106
- * A cascade's publish into the wind field (GPU_FLUID_CASCADES_PROPOSAL_2026_10_16.md §11, the publish
107
- * half of pass 6): every texel of its atlas tile, the window's cells and the one-texel skirt around
108
- * them, gets `chunk_fluid_wind_publish_cell` — the velocity at that cell's centre less the step's far
109
- * field — as `rgba16float`, alpha 0.
110
- *
111
- * The skirt is the cells one past the window. Each takes the window's faces where it has them (along
112
- * an axis, the boundary face plane) and, for the rest, what the MAC seams answer beyond the window:
113
- * the parent's identity read as of the cascade's read record (`chunk_fluid_cascade_parent_velocity`),
114
- * which for the coarsest is the far field. Beside the far field, a skirt cell beside a face of the
115
- * window takes half that boundary face's deviation on the face's axis and none on the others, and one
116
- * past an edge or a corner none at all.
117
- *
118
- * It writes its own tile and never samples the atlas: the atlas is bound as a write-only storage
119
- * texture and nothing else.
120
- *
121
- * One invocation a texel, in 4 × 4 × 4 workgroups over the tile, dispatched
122
- * `ceil((N + 2) / 4)` on each axis; each reads its cell's six faces (`textureLoad`) and stores one
123
- * texel. Standalone until it is fused into the gradient pass (proposal §8 (3)), where the faces are in
124
- * workgroup memory already.
125
- *
126
- * Bindings:
127
- * - `step`: {@link FLUID_MAC_STEP_STRUCT}: the cascade's windows and `far_velocity`, `v_far(t_s,c)`;
128
- * `cells.size` is the window, and the tile's content;
129
- * - `publish`: {@link FLUID_WIND_PUBLISH_STRUCT}: the tile's texel origin in the atlas;
130
- * - `parent`: {@link FLUID_CASCADE_PARENT_STRUCT}, and `parent_u`, `parent_v`, `parent_w` the parent's
131
- * persistent faces, read for the skirt;
132
- * - `source_u`, `source_v`, `source_w`: the cascade's persistent velocity after its step, `r32float`
133
- * 3-D textures, toroidal through `step.faces_*`;
134
- * - `tile`: written, the atlas, `rgba16float` 3-D storage texture.
135
- *
136
- * @type {ComputeShader}
137
- */
138
- export const shader_fluid_wind_publish = ComputeShader.from({
139
- label: "Fluid / wind publish",
140
- body,
141
- resources,
142
- });
1
+ import { ComputeShader } from "../../shader/ComputeShader.js";
2
+ import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
3
+ import { ShaderResourceSetDescriptor } from "../../shader/resource/ShaderResourceSetDescriptor.js";
4
+ import { WIND_FIELD_TILE_BORDER, WIND_FIELD_TILE_FORMAT } from "../../wind/WIND_FIELD.js";
5
+ import { chunk_grid_tile_window } from "../../shader/chunk/grid/chunk_grid_tile_window.js";
6
+ import { chunk_fluid_cascade_parent_velocity } from "../coupling/chunk_fluid_cascade_parent.js";
7
+ import { FLUID_MAC_STEP_STRUCT } from "../mac/FLUID_MAC_STEP_STRUCT.js";
8
+ import { FLUID_CASCADE_PARENT_STRUCT } from "../coupling/FLUID_CASCADE_PARENT_STRUCT.js";
9
+ import { chunk_fluid_wind_publish_cell } from "./chunk_fluid_wind_publish_cell.js";
10
+ import { FLUID_WIND_PUBLISH_STRUCT } from "./FLUID_WIND_PUBLISH_STRUCT.js";
11
+ import { fluid_turbulence_add_resources } from "../../wind/chunk_fluid_turbulence.js";
12
+ import { chunk_fluid_far_field } from "../chunk_fluid_far_field.js";
13
+
14
+ /**
15
+ * Invocations along each axis of a workgroup: one per texel of the tile, whose sides are N + 2.
16
+ * @type {number[]}
17
+ */
18
+ export const FLUID_WIND_PUBLISH_GROUP_SIZE = Object.freeze([4, 4, 4]);
19
+
20
+ const resources = new ShaderResourceSetDescriptor();
21
+
22
+ fluid_turbulence_add_resources(resources.createGroup())
23
+ .addUniform("step", FLUID_MAC_STEP_STRUCT)
24
+ .addUniform("publish", FLUID_WIND_PUBLISH_STRUCT)
25
+ .addUniform("parent", FLUID_CASCADE_PARENT_STRUCT)
26
+ .addTexture("source_u", "unfilterable-float", "3d")
27
+ .addTexture("source_v", "unfilterable-float", "3d")
28
+ .addTexture("source_w", "unfilterable-float", "3d")
29
+ .addTexture("parent_u", "unfilterable-float", "3d")
30
+ .addTexture("parent_v", "unfilterable-float", "3d")
31
+ .addTexture("parent_w", "unfilterable-float", "3d")
32
+ .addStorageTexture("tile", WIND_FIELD_TILE_FORMAT, "3d", "write-only");
33
+
34
+ const body = CodeChunk.from(
35
+ //language=WGSL
36
+ `
37
+ const FLUID_WIND_PUBLISH_BORDER: u32 = ${WIND_FIELD_TILE_BORDER}u;
38
+
39
+ // the step's end velocity, the persistent set, through its toroidal windows; beyond the window, the
40
+ // cascade's boundary: its parent's identity read as of its record, as its seams read it (the skirt is
41
+ // one face deep, so the read itself, not a step's ghosts)
42
+ fn fluid_wind_publish_face_u(face: vec3<i32>) -> f32 {
43
+ if (grid_tile_window_contains(face, step.faces_u.size)) {
44
+ return textureLoad(source_u, grid_tile_window_storage(face, step.faces_u.corner_storage, step.faces_u.period), 0).r;
45
+ }
46
+
47
+ return fluid_parent_face_u(face, step.cells.corner - parent.origin);
48
+ }
49
+
50
+ fn fluid_wind_publish_face_v(face: vec3<i32>) -> f32 {
51
+ if (grid_tile_window_contains(face, step.faces_v.size)) {
52
+ return textureLoad(source_v, grid_tile_window_storage(face, step.faces_v.corner_storage, step.faces_v.period), 0).r;
53
+ }
54
+
55
+ return fluid_parent_face_v(face, step.cells.corner - parent.origin);
56
+ }
57
+
58
+ fn fluid_wind_publish_face_w(face: vec3<i32>) -> f32 {
59
+ if (grid_tile_window_contains(face, step.faces_w.size)) {
60
+ return textureLoad(source_w, grid_tile_window_storage(face, step.faces_w.corner_storage, step.faces_w.period), 0).r;
61
+ }
62
+
63
+ return fluid_parent_face_w(face, step.cells.corner - parent.origin);
64
+ }
65
+
66
+ @compute @workgroup_size(${FLUID_WIND_PUBLISH_GROUP_SIZE.join(', ')})
67
+ fn main(@builtin(global_invocation_id) id: vec3<u32>) {
68
+ // the window's cells and a skirt on every side
69
+ let tile_size = step.cells.size + vec3<u32>(2u * FLUID_WIND_PUBLISH_BORDER);
70
+
71
+ if (any(id >= tile_size)) {
72
+ return;
73
+ }
74
+
75
+ // tile texel t holds window-local cell t - border
76
+ let cell = vec3<i32>(id) - vec3<i32>(i32(FLUID_WIND_PUBLISH_BORDER));
77
+ var deviation: vec3<f32>;
78
+
79
+ if (grid_tile_window_contains(cell, step.cells.size)) {
80
+ let su0 = grid_tile_window_storage(cell, step.faces_u.corner_storage, step.faces_u.period);
81
+ let su1_x = select(su0.x + 1u, 0u, su0.x + 1u == step.faces_u.period.x);
82
+ let sv0 = grid_tile_window_storage(cell, step.faces_v.corner_storage, step.faces_v.period);
83
+ let sv1_y = select(sv0.y + 1u, 0u, sv0.y + 1u == step.faces_v.period.y);
84
+ let sw0 = grid_tile_window_storage(cell, step.faces_w.corner_storage, step.faces_w.period);
85
+ let sw1_z = select(sw0.z + 1u, 0u, sw0.z + 1u == step.faces_w.period.z);
86
+
87
+ let faces = vec3<f32>(
88
+ textureLoad(source_u, su0, 0).r + textureLoad(source_u, vec3<u32>(su1_x, su0.y, su0.z), 0).r,
89
+ textureLoad(source_v, sv0, 0).r + textureLoad(source_v, vec3<u32>(sv0.x, sv1_y, sv0.z), 0).r,
90
+ textureLoad(source_w, sw0, 0).r + textureLoad(source_w, vec3<u32>(sw0.x, sw0.y, sw1_z), 0).r,
91
+ );
92
+
93
+ deviation = 0.5 * faces - fluid_far_field(step.far, vec3<f32>(cell));
94
+ } else {
95
+ deviation = fluid_wind_publish_cell(cell, fluid_far_field(step.far, vec3<f32>(cell)));
96
+ }
97
+
98
+ textureStore(tile, publish.tile_origin + id, vec4<f32>(deviation, 0.0));
99
+ }
100
+ `, [
101
+ chunk_grid_tile_window,
102
+ chunk_fluid_cascade_parent_velocity,
103
+ chunk_fluid_wind_publish_cell,
104
+ chunk_fluid_far_field,
105
+ ]
106
+ );
107
+
108
+ /**
109
+ * A cascade's publish into the wind field (GPU_FLUID_CASCADES_PROPOSAL_2026_10_16.md §11, the publish
110
+ * half of pass 6): every texel of its atlas tile, the window's cells and the one-texel skirt around
111
+ * them, gets `chunk_fluid_wind_publish_cell` — the velocity at that cell's centre less the step's far
112
+ * field — as `rgba16float`, alpha 0.
113
+ *
114
+ * The skirt is the cells one past the window. Each takes the window's faces where it has them (along
115
+ * an axis, the boundary face plane) and, for the rest, what the MAC seams answer beyond the window:
116
+ * the parent's identity read as of the cascade's read record (`chunk_fluid_cascade_parent_velocity`),
117
+ * which for the coarsest is the far field. Beside the far field, a skirt cell beside a face of the
118
+ * window takes half that boundary face's deviation on the face's axis and none on the others, and one
119
+ * past an edge or a corner none at all.
120
+ *
121
+ * It writes its own tile and never samples the atlas: the atlas is bound as a write-only storage
122
+ * texture and nothing else.
123
+ *
124
+ * One invocation a texel, in 4 × 4 × 4 workgroups over the tile, dispatched
125
+ * `ceil((N + 2) / 4)` on each axis; each reads its cell's six faces (`textureLoad`) and stores one
126
+ * texel. Standalone until it is fused into the gradient pass (proposal §8 (3)), where the faces are in
127
+ * workgroup memory already.
128
+ *
129
+ * Bindings:
130
+ * - `step`: {@link FLUID_MAC_STEP_STRUCT}: the cascade's windows and `far`, `v_far(t_s,c)` over the
131
+ * window's cells; `cells.size` is the window, and the tile's content;
132
+ * - `publish`: {@link FLUID_WIND_PUBLISH_STRUCT}: the tile's texel origin in the atlas;
133
+ * - `parent`: {@link FLUID_CASCADE_PARENT_STRUCT}, and `parent_u`, `parent_v`, `parent_w` the parent's
134
+ * persistent faces, read for the skirt;
135
+ * - `source_u`, `source_v`, `source_w`: the cascade's persistent velocity after its step, `r32float`
136
+ * 3-D textures, toroidal through `step.faces_*`;
137
+ * - `tile`: written, the atlas, `rgba16float` 3-D storage texture;
138
+ * - the turbulence tile (`fluid_turbulence_add_resources`), which the far field reads a texel at a time
139
+ * with turbulence.
140
+ *
141
+ * @type {ComputeShader}
142
+ */
143
+ export const shader_fluid_wind_publish = ComputeShader.from({
144
+ label: "Fluid / wind publish",
145
+ body,
146
+ resources,
147
+ });
@@ -204,7 +204,7 @@ export class GPUFluidQueries {
204
204
  thread_count_x: 0,
205
205
  thread_count_y: 1,
206
206
  thread_count_z: 1,
207
- bindings: { settings: null, database: null, list: null, wind_field: null, wind_field_atlas: null },
207
+ bindings: { settings: null, database: null, list: null, wind_field: null, wind_field_atlas: null, fluid_turbulence: null },
208
208
  };
209
209
 
210
210
  #destroyed = false;
@@ -565,7 +565,7 @@ export class GPUFluidQueries {
565
565
  shader_fluid_query_gather.dispatchThreads(dispatch);
566
566
 
567
567
  dispatch.encoder = null;
568
- b.settings = b.database = b.list = b.wind_field = b.wind_field_atlas = null;
568
+ b.settings = b.database = b.list = b.wind_field = b.wind_field_atlas = b.fluid_turbulence = null;
569
569
 
570
570
  // right after the gather: the copy reads what it wrote
571
571
  this.#readback.encode(encoder);
@@ -1 +1 @@
1
- {"version":3,"file":"GPUGeometryManager.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/geometry/GPUGeometryManager.js"],"names":[],"mappings":"AAmBA;;;;GAIG;AACH;IAwKI;;;OAGG;IACH,+BAWC;IAjLD;;;OAGG;IACH,iBAFU,YAAU,IAAI,CAED;IAsDvB;;;OAGG;IACH,4GAEC;IAED;;;;OAIG;IACH,8BAA0B;IAE1B;;;;OAIG;IACH,uBAAsB;IAOtB;;;OAGG;IACH,kCAEC;IAwBD;;;OAGG;IACH,kCAEC;IAQD;;;;;OAKG;IACH,iCAEC;IAED;;;OAGG;IACH,+BAiBC;IAmBD;;;;OAIG;IACH,qBAHW,mBAAmB,GAClB,MAAM,CAMjB;IAED;;;;OAIG;IACH,cAHW,eAAe,GACd,OAAO,CAIlB;IAGD;;;;OAIG;IACH,cAHW,eAAe,GACb,OAAO,CAwEnB;IAED;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,2BAPW,eAAe,GACb,mBAAmB,CAmC/B;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,uBAHW,mBAAmB,GACjB,OAAO,CAmBnB;IAED;;;;;;;OAOG;IACH,uBAHW,eAAe,GACb,mBAAmB,GAAC,SAAS,CAIzC;IAED;;;;OAIG;IACH,iBAHW,eAAe,GACb,OAAO,CAwCnB;IAyBD,gBAWC;IAED;;;;;;OAMG;IACH,qBANW,sBAAsB,QAuChC;IAmDD,cAqCC;IAED,0CAWC;;CAuFJ;qCA3sBY,OAAO,wCAAwC,EAAE,sBAAsB;8BACvE,OAAO,sBAAsB,EAAE,eAAe;oCANvB,0BAA0B;kCAC5B,gCAAgC;sCAH5B,gCAAgC;sCAIhC,gCAAgC"}
1
+ {"version":3,"file":"GPUGeometryManager.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/geometry/GPUGeometryManager.js"],"names":[],"mappings":"AAmBA;;;;GAIG;AACH;IAwKI;;;OAGG;IACH,+BAWC;IAjLD;;;OAGG;IACH,iBAFU,YAAU,IAAI,CAED;IAsDvB;;;OAGG;IACH,4GAEC;IAED;;;;OAIG;IACH,8BAA0B;IAE1B;;;;OAIG;IACH,uBAAsB;IAOtB;;;OAGG;IACH,kCAEC;IAwBD;;;OAGG;IACH,kCAEC;IAQD;;;;;OAKG;IACH,iCAEC;IAED;;;OAGG;IACH,+BAiBC;IAmBD;;;;OAIG;IACH,qBAHW,mBAAmB,GAClB,MAAM,CAMjB;IAED;;;;OAIG;IACH,cAHW,eAAe,GACd,OAAO,CAIlB;IAGD;;;;OAIG;IACH,cAHW,eAAe,GACb,OAAO,CAwEnB;IAED;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,2BAPW,eAAe,GACb,mBAAmB,CAkC/B;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,uBAHW,mBAAmB,GACjB,OAAO,CAmBnB;IAED;;;;;;;OAOG;IACH,uBAHW,eAAe,GACb,mBAAmB,GAAC,SAAS,CAIzC;IAED;;;;OAIG;IACH,iBAHW,eAAe,GACb,OAAO,CAwCnB;IAyBD,gBAWC;IAED;;;;;;OAMG;IACH,qBANW,sBAAsB,QAuChC;IAkDD,cAqCC;IAED,0CAWC;;CAuFJ;qCAzsBY,OAAO,wCAAwC,EAAE,sBAAsB;8BACvE,OAAO,sBAAsB,EAAE,eAAe;oCANvB,0BAA0B;kCAC5B,gCAAgC;sCAH5B,gCAAgC;sCAIhC,gCAAgC"}
@@ -346,8 +346,7 @@ export class GPUGeometryManager {
346
346
 
347
347
  const metadata = new GPUGeometryMetadata();
348
348
  // The record's geometry, not the object the caller passed: the two are equal in content,
349
- // but the BLAS manager keys a tree's *shape* by geometry object, and every clone of one
350
- // record sharing one shape is what keeps N dancers from deriving and uploading N copies of it.
349
+ // and the record's is the one whose tree the clone's starts as a copy of.
351
350
  metadata.geometry = source_metadata.geometry;
352
351
  metadata.allocated = false;
353
352
  metadata.index = this.__last_geometry_index++;
@@ -568,9 +567,8 @@ export class GPUGeometryManager {
568
567
  *
569
568
  * One id, one tree, and the id is the key — which is the whole answer to a clone. A clone has a
570
569
  * geometry id of its own because it has a vertex region of its own, and a tree of its own for
571
- * the same reason: what deformation changes is its bounds, and those cannot be written into the
572
- * tree every other instance is still tracing. What it does *not* need its own of is the shape,
573
- * which the BLAS manager shares between them.
570
+ * the same reason: what deformation changes is its boxes, and those cannot be written into the
571
+ * tree every other instance is still tracing.
574
572
  *
575
573
  * Must run after {@link GPUGeometryBVHManager#update}, which is what makes addresses real.
576
574
  */
@@ -599,8 +597,8 @@ export class GPUGeometryManager {
599
597
 
600
598
  // One tree per geometry id, clones included — keyed by the metadata row rather than by the
601
599
  // geometry, because a clone and its source share a `MeshletGeometry` and would otherwise
602
- // collide on it. The nodes are duplicated per clone on purpose (they are what deformation
603
- // rewrites); the shape behind them is not.
600
+ // collide on it. The nodes are duplicated per clone on purpose: they are what deformation
601
+ // rewrites.
604
602
  if (this.#enable_bvh) {
605
603
  for (const meta of all_metadata) {
606
604
  this.#blas.obtain(meta, meta.geometry);
@@ -22,8 +22,11 @@ export class MeshletGeometry {
22
22
  */
23
23
  meshlets: MeshletBatch;
24
24
  /**
25
+ * The bottom-level tree over {@link meshlets}: BVH8 nodes, root first, as
26
+ * {@link blas_from_meshlets} makes them. It names triangles by their place inside each meshlet,
27
+ * so it belongs to these meshlets as they are ordered now and to no others.
28
+ *
25
29
  * @see GPUGeometryMeshletsBVH
26
- * @see bvh2_compress
27
30
  * @type {ArrayBuffer}
28
31
  */
29
32
  bvh: ArrayBuffer;
@@ -1 +1 @@
1
- {"version":3,"file":"MeshletGeometry.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/geometry/MeshletGeometry.js"],"names":[],"mappings":"AAIA;;;GAGG;AACH;IACI,WAAkB;IAElB;;;OAGG;IACH,MAFU,MAAM,CAEN;IAEV,2BAAmC;IACnC,8BAAsC;IAEtC;;;OAGG;IACH,iBAFU,MAAM,CAEI;IAEpB,wBAGC;IAED;;OAEG;IACH,UAFU,YAAY,CAEQ;IAE9B;;;;OAIG;IACH,KAFU,WAAW,CAEG;IAExB,eAEC;IAED;;;OAGG;IACH,cAFW,eAAe,WAMzB;IAGL,2BAA2C;CAF1C;;;;6BAxD4B,2BAA2B"}
1
+ {"version":3,"file":"MeshletGeometry.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/geometry/MeshletGeometry.js"],"names":[],"mappings":"AAIA;;;GAGG;AACH;IACI,WAAkB;IAElB;;;OAGG;IACH,MAFU,MAAM,CAEN;IAEV,2BAAmC;IACnC,8BAAsC;IAEtC;;;OAGG;IACH,iBAFU,MAAM,CAEI;IAEpB,wBAGC;IAED;;OAEG;IACH,UAFU,YAAY,CAEQ;IAE9B;;;;;;;OAOG;IACH,KAFU,WAAW,CAEG;IAExB,eAEC;IAED;;;OAGG;IACH,cAFW,eAAe,WAMzB;IAGL,2BAA2C;CAF1C;;;;6BA3D4B,2BAA2B"}
@@ -35,8 +35,11 @@ export class MeshletGeometry {
35
35
  meshlets = new MeshletBatch();
36
36
 
37
37
  /**
38
+ * The bottom-level tree over {@link meshlets}: BVH8 nodes, root first, as
39
+ * {@link blas_from_meshlets} makes them. It names triangles by their place inside each meshlet,
40
+ * so it belongs to these meshlets as they are ordered now and to no others.
41
+ *
38
42
  * @see GPUGeometryMeshletsBVH
39
- * @see bvh2_compress
40
43
  * @type {ArrayBuffer}
41
44
  */
42
45
  bvh = new ArrayBuffer();