@woosh/meep-engine 3.69.0 → 3.71.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 (725) hide show
  1. package/CHANGELOG.md +45 -1
  2. package/MIGRATION_2_TO_3.md +1 -1
  3. package/build/bundle-worker-terrain.js +1 -1
  4. package/package.json +1 -1
  5. package/src/core/bvh8/build/BVH8Converter.d.ts +16 -0
  6. package/src/core/bvh8/build/BVH8Converter.d.ts.map +1 -1
  7. package/src/core/bvh8/build/BVH8Converter.js +64 -37
  8. package/src/core/bvh8/build/bvh8_assign_slots_greedy.d.ts +25 -0
  9. package/src/core/bvh8/build/bvh8_assign_slots_greedy.d.ts.map +1 -0
  10. package/src/core/bvh8/build/bvh8_assign_slots_greedy.js +68 -0
  11. package/src/core/bvh8/build/bvh8_from_proxy.d.ts.map +1 -1
  12. package/src/core/bvh8/build/bvh8_from_proxy.js +2 -33
  13. package/src/core/bvh8/build/bvh8_node_fit_slots.d.ts +22 -0
  14. package/src/core/bvh8/build/bvh8_node_fit_slots.d.ts.map +1 -0
  15. package/src/core/bvh8/build/bvh8_node_fit_slots.js +115 -0
  16. package/src/core/bvh8/bvh8_depth.d.ts +8 -0
  17. package/src/core/bvh8/bvh8_depth.d.ts.map +1 -0
  18. package/src/core/bvh8/bvh8_depth.js +39 -0
  19. package/src/core/math/complex/complex_fft_radix2.d.ts +19 -0
  20. package/src/core/math/complex/complex_fft_radix2.d.ts.map +1 -0
  21. package/src/core/math/complex/complex_fft_radix2.js +71 -0
  22. package/src/engine/graphics3/GPUFluidSystem.d.ts +17 -4
  23. package/src/engine/graphics3/GPUFluidSystem.d.ts.map +1 -1
  24. package/src/engine/graphics3/GPUFluidSystem.js +113 -16
  25. package/src/engine/graphics3/VolumetricLightMapSystem.d.ts +1 -1
  26. package/src/engine/graphics3/VolumetricLightMapSystem.js +261 -261
  27. package/src/engine/physics/cloth/playground/wind_main.js +7 -6
  28. package/src/engine/physics/cloth/wind/AbstractClothWind.d.ts +2 -2
  29. package/src/engine/physics/cloth/wind/AbstractClothWind.js +2 -2
  30. package/src/engine/physics/cloth/wind/ClothFluidWind.d.ts +3 -3
  31. package/src/engine/physics/cloth/wind/ClothFluidWind.d.ts.map +1 -1
  32. package/src/engine/physics/cloth/wind/ClothFluidWind.js +7 -9
  33. package/src/engine/physics/cloth/wind/ClothGPUFluidWind.d.ts +10 -10
  34. package/src/engine/physics/cloth/wind/ClothGPUFluidWind.d.ts.map +1 -1
  35. package/src/engine/physics/cloth/wind/ClothGPUFluidWind.js +14 -22
  36. package/src/engine/physics/fluid/FluidAtmosphere.d.ts +16 -2
  37. package/src/engine/physics/fluid/FluidAtmosphere.d.ts.map +1 -1
  38. package/src/engine/physics/fluid/FluidAtmosphere.js +17 -3
  39. package/src/engine/physics/fluid/ecs/FluidEffectorsComponentSerializationAdapter.d.ts +1 -2
  40. package/src/engine/physics/fluid/ecs/FluidEffectorsComponentSerializationAdapter.d.ts.map +1 -1
  41. package/src/engine/physics/fluid/ecs/FluidEffectorsComponentSerializationAdapter.js +1 -2
  42. package/src/engine/physics/fluid/ecs/FluidEffectorsSystem.d.ts +8 -5
  43. package/src/engine/physics/fluid/ecs/FluidEffectorsSystem.d.ts.map +1 -1
  44. package/src/engine/physics/fluid/ecs/FluidEffectorsSystem.js +60 -17
  45. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  46. package/src/engine/physics/fluid/effector/AbstractFluidEffector.d.ts +1 -1
  47. package/src/engine/physics/fluid/effector/AbstractFluidEffector.js +1 -1
  48. package/src/engine/physics/fluid/effector/GlobalFluidEffector.d.ts +33 -47
  49. package/src/engine/physics/fluid/effector/GlobalFluidEffector.d.ts.map +1 -1
  50. package/src/engine/physics/fluid/effector/GlobalFluidEffector.js +38 -176
  51. package/src/engine/physics/fluid/effector/GlobalFluidEffectorSerializationAdapter.d.ts +8 -11
  52. package/src/engine/physics/fluid/effector/GlobalFluidEffectorSerializationAdapter.d.ts.map +1 -1
  53. package/src/engine/physics/fluid/effector/GlobalFluidEffectorSerializationAdapter.js +13 -24
  54. package/src/engine/physics/fluid/effector/GlobalFluidEffectorSerializationUpgrader_0_1.d.ts +16 -0
  55. package/src/engine/physics/fluid/effector/GlobalFluidEffectorSerializationUpgrader_0_1.d.ts.map +1 -0
  56. package/src/engine/physics/fluid/effector/GlobalFluidEffectorSerializationUpgrader_0_1.js +35 -0
  57. package/src/engine/physics/fluid/fluid_apply_atmosphere.d.ts +1 -1
  58. package/src/engine/physics/fluid/fluid_apply_atmosphere.js +1 -1
  59. package/src/engine/physics/fluid/turbulence/FLUID_TURBULENCE_TILE.d.ts +28 -0
  60. package/src/engine/physics/fluid/turbulence/FLUID_TURBULENCE_TILE.d.ts.map +1 -0
  61. package/src/engine/physics/fluid/turbulence/FLUID_TURBULENCE_TILE.js +29 -0
  62. package/src/engine/physics/fluid/turbulence/fluid_atmosphere_velocity_at.d.ts +16 -0
  63. package/src/engine/physics/fluid/turbulence/fluid_atmosphere_velocity_at.d.ts.map +1 -0
  64. package/src/engine/physics/fluid/turbulence/fluid_atmosphere_velocity_at.js +49 -0
  65. package/src/engine/physics/fluid/turbulence/fluid_turbulence_inverse_tile_size.d.ts +11 -0
  66. package/src/engine/physics/fluid/turbulence/fluid_turbulence_inverse_tile_size.d.ts.map +1 -0
  67. package/src/engine/physics/fluid/turbulence/fluid_turbulence_inverse_tile_size.js +18 -0
  68. package/src/engine/physics/fluid/turbulence/fluid_turbulence_tile_data.d.ts +25 -0
  69. package/src/engine/physics/fluid/turbulence/fluid_turbulence_tile_data.d.ts.map +1 -0
  70. package/src/engine/physics/fluid/turbulence/fluid_turbulence_tile_data.js +65 -0
  71. package/src/engine/physics/fluid/turbulence/fluid_turbulence_tile_generate.d.ts +56 -0
  72. package/src/engine/physics/fluid/turbulence/fluid_turbulence_tile_generate.d.ts.map +1 -0
  73. package/src/engine/physics/fluid/turbulence/fluid_turbulence_tile_generate.js +313 -0
  74. package/src/engine/physics/fluid/turbulence/fluid_turbulence_tile_sample.d.ts +16 -0
  75. package/src/engine/physics/fluid/turbulence/fluid_turbulence_tile_sample.d.ts.map +1 -0
  76. package/src/engine/physics/fluid/turbulence/fluid_turbulence_tile_sample.js +69 -0
  77. package/src/engine/sound/simulation/probe/probe_place_sdf_cover.d.ts +1 -2
  78. package/src/engine/sound/simulation/probe/probe_place_sdf_cover.d.ts.map +1 -1
  79. package/src/engine/sound/simulation/probe/probe_place_sdf_cover.js +1 -2
  80. package/src/generation/foliage/mesh/branch_ring_triangulate.d.ts +1 -1
  81. package/src/generation/foliage/mesh/branch_ring_triangulate.js +1 -1
  82. package/src/shade/playground/bvh_repro/README.md +8 -6
  83. package/src/shade/playground/bvh_repro/index.html +125 -124
  84. package/src/shade/playground/bvh_repro/main.js +259 -254
  85. package/src/shade/playground/foliage_wind/foliage_world.d.ts.map +1 -1
  86. package/src/shade/playground/foliage_wind/foliage_world.js +7 -4
  87. package/src/shade/playground/grass_surfaces/main.js +3 -2
  88. package/src/shade/playground/particle_ecs/bonfire_wind.d.ts +23 -13
  89. package/src/shade/playground/particle_ecs/bonfire_wind.d.ts.map +1 -1
  90. package/src/shade/playground/particle_ecs/bonfire_wind.js +30 -33
  91. package/src/shade/playground/skinned_blas_refit/README.md +26 -14
  92. package/src/shade/playground/skinned_blas_refit/shader_blas_audit_leaf_triangles.d.ts +14 -9
  93. package/src/shade/playground/skinned_blas_refit/shader_blas_audit_leaf_triangles.d.ts.map +1 -1
  94. package/src/shade/playground/skinned_blas_refit/shader_blas_audit_leaf_triangles.js +126 -127
  95. package/src/shade/playground/skinned_blas_refit/shader_blas_audit_points.js +95 -95
  96. package/src/shade/playground/skinned_blas_refit/shader_blas_audit_visibility.d.ts +9 -1
  97. package/src/shade/playground/skinned_blas_refit/shader_blas_audit_visibility.d.ts.map +1 -1
  98. package/src/shade/playground/skinned_blas_refit/shader_blas_audit_visibility.js +146 -135
  99. package/src/shade/playground/skinned_blas_refit/verify_clone_leaves.d.ts +6 -6
  100. package/src/shade/playground/skinned_blas_refit/verify_clone_leaves.d.ts.map +1 -1
  101. package/src/shade/playground/skinned_blas_refit/verify_clone_leaves.js +148 -134
  102. package/src/shade/playground/skinned_blas_refit/verify_leaf_triangles.d.ts +11 -8
  103. package/src/shade/playground/skinned_blas_refit/verify_leaf_triangles.d.ts.map +1 -1
  104. package/src/shade/playground/skinned_blas_refit/verify_leaf_triangles.js +342 -202
  105. package/src/shade/playground/skinned_blas_refit/verify_skinned_blas_refit.d.ts +12 -13
  106. package/src/shade/playground/skinned_blas_refit/verify_skinned_blas_refit.d.ts.map +1 -1
  107. package/src/shade/playground/skinned_blas_refit/verify_skinned_blas_refit.js +136 -116
  108. package/src/shade/playground/skinned_blas_refit/verify_traversal_reachability.d.ts +4 -4
  109. package/src/shade/playground/skinned_blas_refit/verify_traversal_reachability.d.ts.map +1 -1
  110. package/src/shade/playground/skinned_blas_refit/verify_traversal_reachability.js +255 -249
  111. package/src/shade/playground/water_surface/main.js +6 -3
  112. package/src/shade/renderer/Renderer.d.ts +0 -12
  113. package/src/shade/renderer/Renderer.d.ts.map +1 -1
  114. package/src/shade/renderer/Renderer.js +0 -101
  115. package/src/shade/renderer/ShadeIndirectLightingMode.d.ts +0 -1
  116. package/src/shade/renderer/ShadeIndirectLightingMode.js +0 -2
  117. package/src/shade/renderer/animation/GPUAnimationManager.js +2 -2
  118. package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.d.ts.map +1 -1
  119. package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.js +7 -8
  120. package/src/shade/renderer/atmosphere/ATMOSPHERE_PARAMETERS_STRUCT.d.ts.map +1 -1
  121. package/src/shade/renderer/atmosphere/ATMOSPHERE_PARAMETERS_STRUCT.js +7 -0
  122. package/src/shade/renderer/atmosphere/shader_sky_irradiance_lut.d.ts.map +1 -1
  123. package/src/shade/renderer/atmosphere/shader_sky_irradiance_lut.js +1 -4
  124. package/src/shade/renderer/fluid/FLUID_FAR_FIELD_STRUCT.d.ts +111 -0
  125. package/src/shade/renderer/fluid/FLUID_FAR_FIELD_STRUCT.d.ts.map +1 -0
  126. package/src/shade/renderer/fluid/FLUID_FAR_FIELD_STRUCT.js +162 -0
  127. package/src/shade/renderer/fluid/GPUFluidCascade.d.ts +40 -11
  128. package/src/shade/renderer/fluid/GPUFluidCascade.d.ts.map +1 -1
  129. package/src/shade/renderer/fluid/GPUFluidCascade.js +149 -47
  130. package/src/shade/renderer/fluid/GPUFluidCascadeStack.d.ts +11 -4
  131. package/src/shade/renderer/fluid/GPUFluidCascadeStack.d.ts.map +1 -1
  132. package/src/shade/renderer/fluid/GPUFluidCascadeStack.js +69 -10
  133. package/src/shade/renderer/fluid/chunk_fluid_far_field.d.ts +19 -0
  134. package/src/shade/renderer/fluid/chunk_fluid_far_field.d.ts.map +1 -0
  135. package/src/shade/renderer/fluid/chunk_fluid_far_field.js +43 -0
  136. package/src/shade/renderer/fluid/coupling/FLUID_CASCADE_PARENT_STRUCT.d.ts +10 -9
  137. package/src/shade/renderer/fluid/coupling/FLUID_CASCADE_PARENT_STRUCT.d.ts.map +1 -1
  138. package/src/shade/renderer/fluid/coupling/FLUID_CASCADE_PARENT_STRUCT.js +14 -12
  139. package/src/shade/renderer/fluid/coupling/FLUID_CASCADE_RESTRICT_STRUCT.d.ts +3 -2
  140. package/src/shade/renderer/fluid/coupling/FLUID_CASCADE_RESTRICT_STRUCT.d.ts.map +1 -1
  141. package/src/shade/renderer/fluid/coupling/FLUID_CASCADE_RESTRICT_STRUCT.js +7 -5
  142. package/src/shade/renderer/fluid/coupling/chunk_fluid_cascade_epilogue.d.ts +17 -9
  143. package/src/shade/renderer/fluid/coupling/chunk_fluid_cascade_epilogue.d.ts.map +1 -1
  144. package/src/shade/renderer/fluid/coupling/chunk_fluid_cascade_epilogue.js +58 -18
  145. package/src/shade/renderer/fluid/coupling/chunk_fluid_cascade_parent.d.ts +23 -11
  146. package/src/shade/renderer/fluid/coupling/chunk_fluid_cascade_parent.d.ts.map +1 -1
  147. package/src/shade/renderer/fluid/coupling/chunk_fluid_cascade_parent.js +371 -335
  148. package/src/shade/renderer/fluid/coupling/shader_fluid_cascade_fill.d.ts.map +1 -1
  149. package/src/shade/renderer/fluid/coupling/shader_fluid_cascade_fill.js +2 -1
  150. package/src/shade/renderer/fluid/coupling/shader_fluid_cascade_ghosts.d.ts.map +1 -1
  151. package/src/shade/renderer/fluid/coupling/shader_fluid_cascade_ghosts.js +109 -108
  152. package/src/shade/renderer/fluid/coupling/shader_fluid_cascade_restrict.d.ts +5 -3
  153. package/src/shade/renderer/fluid/coupling/shader_fluid_cascade_restrict.d.ts.map +1 -1
  154. package/src/shade/renderer/fluid/coupling/shader_fluid_cascade_restrict.js +24 -12
  155. package/src/shade/renderer/fluid/forcing/GPUFluidForcing.d.ts +7 -7
  156. package/src/shade/renderer/fluid/mac/FLUID_MAC_STEP_STRUCT.d.ts +6 -2
  157. package/src/shade/renderer/fluid/mac/FLUID_MAC_STEP_STRUCT.d.ts.map +1 -1
  158. package/src/shade/renderer/fluid/mac/FLUID_MAC_STEP_STRUCT.js +10 -5
  159. package/src/shade/renderer/fluid/mac/FluidMacPasses.d.ts +20 -21
  160. package/src/shade/renderer/fluid/mac/FluidMacPasses.d.ts.map +1 -1
  161. package/src/shade/renderer/fluid/mac/FluidMacPasses.js +453 -427
  162. package/src/shade/renderer/fluid/mac/shader_fluid_mac_advect_correct.d.ts.map +1 -1
  163. package/src/shade/renderer/fluid/mac/shader_fluid_mac_advect_correct.js +2 -1
  164. package/src/shade/renderer/fluid/pressure/GPUFluidPressureSolve.d.ts +1 -1
  165. package/src/shade/renderer/fluid/publish/FluidWindPublish.d.ts +13 -5
  166. package/src/shade/renderer/fluid/publish/FluidWindPublish.d.ts.map +1 -1
  167. package/src/shade/renderer/fluid/publish/FluidWindPublish.js +20 -10
  168. package/src/shade/renderer/fluid/publish/chunk_fluid_wind_publish_cell.d.ts +2 -2
  169. package/src/shade/renderer/fluid/publish/chunk_fluid_wind_publish_cell.js +2 -2
  170. package/src/shade/renderer/fluid/publish/shader_fluid_wind_publish.d.ts +5 -3
  171. package/src/shade/renderer/fluid/publish/shader_fluid_wind_publish.d.ts.map +1 -1
  172. package/src/shade/renderer/fluid/publish/shader_fluid_wind_publish.js +147 -142
  173. package/src/shade/renderer/fluid/query/GPUFluidQueries.d.ts +1 -1
  174. package/src/shade/renderer/fluid/query/GPUFluidQueries.js +2 -2
  175. package/src/shade/renderer/geometry/GPUGeometryManager.d.ts.map +1 -1
  176. package/src/shade/renderer/geometry/GPUGeometryManager.js +5 -7
  177. package/src/shade/renderer/geometry/MeshletGeometry.d.ts +4 -1
  178. package/src/shade/renderer/geometry/MeshletGeometry.d.ts.map +1 -1
  179. package/src/shade/renderer/geometry/MeshletGeometry.js +4 -1
  180. package/src/shade/renderer/geometry/MeshletGeometrySerializationAdapter.d.ts +20 -0
  181. package/src/shade/renderer/geometry/MeshletGeometrySerializationAdapter.d.ts.map +1 -1
  182. package/src/shade/renderer/geometry/MeshletGeometrySerializationAdapter.js +35 -3
  183. package/src/shade/renderer/geometry/blas_from_meshlets.d.ts +9 -3
  184. package/src/shade/renderer/geometry/blas_from_meshlets.d.ts.map +1 -1
  185. package/src/shade/renderer/geometry/blas_from_meshlets.js +16 -30
  186. package/src/shade/renderer/geometry/bvh/BLAS8_REFIT_TARGET_STRUCT.d.ts +14 -0
  187. package/src/shade/renderer/geometry/bvh/BLAS8_REFIT_TARGET_STRUCT.d.ts.map +1 -0
  188. package/src/shade/renderer/geometry/bvh/BLAS8_REFIT_TARGET_STRUCT.js +33 -0
  189. package/src/shade/renderer/geometry/bvh/GPUBLASRefitBatch.d.ts +18 -21
  190. package/src/shade/renderer/geometry/bvh/GPUBLASRefitBatch.d.ts.map +1 -1
  191. package/src/shade/renderer/geometry/bvh/GPUBLASRefitBatch.js +78 -158
  192. package/src/shade/renderer/geometry/bvh/GPUGeometryBVHManager.d.ts +18 -39
  193. package/src/shade/renderer/geometry/bvh/GPUGeometryBVHManager.d.ts.map +1 -1
  194. package/src/shade/renderer/geometry/bvh/GPUGeometryBVHManager.js +39 -398
  195. package/src/shade/renderer/geometry/bvh/GPUGeometryMeshletsBVH.d.ts +6 -7
  196. package/src/shade/renderer/geometry/bvh/GPUGeometryMeshletsBVH.d.ts.map +1 -1
  197. package/src/shade/renderer/geometry/bvh/GPUGeometryMeshletsBVH.js +5 -7
  198. package/src/shade/renderer/geometry/bvh/bvh8_build_for_meshlets.d.ts +36 -0
  199. package/src/shade/renderer/geometry/bvh/bvh8_build_for_meshlets.d.ts.map +1 -0
  200. package/src/shade/renderer/geometry/bvh/bvh8_build_for_meshlets.js +179 -0
  201. package/src/shade/renderer/geometry/bvh/meshlet_batch_to_clustered_bvh.d.ts +30 -0
  202. package/src/shade/renderer/geometry/bvh/meshlet_batch_to_clustered_bvh.d.ts.map +1 -0
  203. package/src/shade/renderer/geometry/bvh/meshlet_batch_to_clustered_bvh.js +207 -0
  204. package/src/shade/renderer/geometry/bvh/shader_blas8_refit_batch.d.ts +52 -0
  205. package/src/shade/renderer/geometry/bvh/shader_blas8_refit_batch.d.ts.map +1 -0
  206. package/src/shade/renderer/geometry/bvh/shader_blas8_refit_batch.js +464 -0
  207. package/src/shade/renderer/geometry/meshlet/MeshletBatch.d.ts +12 -0
  208. package/src/shade/renderer/geometry/meshlet/MeshletBatch.d.ts.map +1 -1
  209. package/src/shade/renderer/geometry/meshlet/MeshletBatch.js +37 -0
  210. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_classify.d.ts.map +1 -1
  211. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_classify.js +4 -4
  212. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_evaluate.d.ts.map +1 -1
  213. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_evaluate.js +2 -2
  214. package/src/shade/renderer/geometry/sdf/chunk_blas_query_band_sdf.d.ts.map +1 -1
  215. package/src/shade/renderer/geometry/sdf/chunk_blas_query_band_sdf.js +2 -2
  216. package/src/shade/renderer/geometry/sdf/shader_sdf_visualize.d.ts.map +1 -1
  217. package/src/shade/renderer/geometry/sdf/shader_sdf_visualize.js +4 -4
  218. package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_trace.d.ts.map +1 -1
  219. package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_trace.js +2 -2
  220. package/src/shade/renderer/geometry/sr_create_group_RTX.d.ts.map +1 -1
  221. package/src/shade/renderer/geometry/sr_create_group_RTX.js +4 -4
  222. package/src/shade/renderer/global_illumination/brick4/gpu/bake/brick4_bake_basic.d.ts.map +1 -1
  223. package/src/shade/renderer/global_illumination/brick4/gpu/bake/brick4_bake_basic.js +1 -0
  224. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts +1 -1
  225. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK.d.ts +9 -10
  226. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK.d.ts.map +1 -1
  227. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK.js +10 -11
  228. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_walk.d.ts +2 -2
  229. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_walk.js +2 -2
  230. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_gather.d.ts +12 -8
  231. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_gather.d.ts.map +1 -1
  232. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_gather.js +109 -60
  233. package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_mesh_sdf.js +2 -2
  234. package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_mesh_surfaces.js +2 -2
  235. package/src/shade/renderer/gpu_primitive/bvh/BVH_BUFFER_LAYOUT.d.ts +2 -2
  236. package/src/shade/renderer/gpu_primitive/bvh/BVH_BUFFER_LAYOUT.js +70 -70
  237. package/src/shade/renderer/gpu_primitive/bvh/BVH_BUILD_SETTINGS_STRUCT.d.ts +6 -7
  238. package/src/shade/renderer/gpu_primitive/bvh/BVH_BUILD_SETTINGS_STRUCT.d.ts.map +1 -1
  239. package/src/shade/renderer/gpu_primitive/bvh/BVH_BUILD_SETTINGS_STRUCT.js +6 -7
  240. package/src/shade/renderer/gpu_primitive/bvh/graph_bvh_build_lbvh.d.ts +3 -3
  241. package/src/shade/renderer/gpu_primitive/bvh/graph_bvh_build_lbvh.js +3 -3
  242. package/src/shade/renderer/gpu_primitive/bvh/shader_bvh_build_single_workgroup.js +1 -1
  243. package/src/shade/renderer/gpu_primitive/bvh/shader_bvh_emit_hierarchy.d.ts +2 -2
  244. package/src/shade/renderer/gpu_primitive/bvh/shader_bvh_emit_hierarchy.js +3 -3
  245. package/src/shade/renderer/gpu_primitive/bvh8/BVH8_TREE_BUFFER_LAYOUT.d.ts +69 -0
  246. package/src/shade/renderer/gpu_primitive/bvh8/BVH8_TREE_BUFFER_LAYOUT.d.ts.map +1 -0
  247. package/src/shade/renderer/gpu_primitive/bvh8/BVH8_TREE_BUFFER_LAYOUT.js +89 -0
  248. package/src/shade/renderer/gpu_primitive/bvh8/bvh8_encode_from_bvh2.d.ts +41 -0
  249. package/src/shade/renderer/gpu_primitive/bvh8/bvh8_encode_from_bvh2.d.ts.map +1 -0
  250. package/src/shade/renderer/gpu_primitive/bvh8/bvh8_encode_from_bvh2.js +348 -0
  251. package/src/shade/renderer/gpu_primitive/bvh8/check_bvh8_tree.d.ts +34 -0
  252. package/src/shade/renderer/gpu_primitive/bvh8/check_bvh8_tree.d.ts.map +1 -0
  253. package/src/shade/renderer/gpu_primitive/bvh8/check_bvh8_tree.js +291 -0
  254. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_assign.d.ts +31 -0
  255. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_assign.d.ts.map +1 -0
  256. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_assign.js +175 -0
  257. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_depth.d.ts +27 -0
  258. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_depth.d.ts.map +1 -0
  259. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_depth.js +48 -0
  260. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_gather.d.ts +26 -0
  261. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_gather.d.ts.map +1 -0
  262. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_gather.js +118 -0
  263. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_node.d.ts +22 -0
  264. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_node.d.ts.map +1 -0
  265. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_node.js +143 -0
  266. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_sums.d.ts +36 -0
  267. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_sums.d.ts.map +1 -0
  268. package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_sums.js +97 -0
  269. package/src/shade/renderer/gpu_primitive/bvh8/graph_bvh8_encode_from_bvh2.d.ts +49 -0
  270. package/src/shade/renderer/gpu_primitive/bvh8/graph_bvh8_encode_from_bvh2.d.ts.map +1 -0
  271. package/src/shade/renderer/gpu_primitive/bvh8/graph_bvh8_encode_from_bvh2.js +265 -0
  272. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_assign.d.ts +37 -0
  273. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_assign.d.ts.map +1 -0
  274. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_assign.js +109 -0
  275. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_count.d.ts +15 -0
  276. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_count.d.ts.map +1 -0
  277. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_count.js +85 -0
  278. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_count_single_workgroup.d.ts +26 -0
  279. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_count_single_workgroup.d.ts.map +1 -0
  280. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_count_single_workgroup.js +200 -0
  281. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_parents.d.ts +19 -0
  282. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_parents.d.ts.map +1 -0
  283. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_parents.js +81 -0
  284. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_write.d.ts +14 -0
  285. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_write.d.ts.map +1 -0
  286. package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_write.js +101 -0
  287. package/src/shade/renderer/gpu_primitive/bvh8/verify_gpu_bvh8_encode.d.ts +19 -0
  288. package/src/shade/renderer/gpu_primitive/bvh8/verify_gpu_bvh8_encode.d.ts.map +1 -0
  289. package/src/shade/renderer/gpu_primitive/bvh8/verify_gpu_bvh8_encode.js +361 -0
  290. package/src/shade/renderer/grass/surface/shader_grass_surface_bake.d.ts.map +1 -1
  291. package/src/shade/renderer/grass/surface/shader_grass_surface_bake.js +5 -6
  292. package/src/shade/renderer/light/GPULightCollection.d.ts +3 -2
  293. package/src/shade/renderer/light/GPULightCollection.d.ts.map +1 -1
  294. package/src/shade/renderer/light/GPULightCollection.js +28 -2
  295. package/src/shade/renderer/light/environment/shader_project_environment_sh.d.ts +2 -2
  296. package/src/shade/renderer/light/environment/shader_project_environment_sh.js +2 -2
  297. package/src/shade/renderer/light/make_sunlight.d.ts +14 -0
  298. package/src/shade/renderer/light/make_sunlight.d.ts.map +1 -1
  299. package/src/shade/renderer/light/make_sunlight.js +16 -2
  300. package/src/shade/renderer/light/model/DirectionalLight.d.ts +9 -0
  301. package/src/shade/renderer/light/model/DirectionalLight.d.ts.map +1 -1
  302. package/src/shade/renderer/light/model/DirectionalLight.js +10 -1
  303. package/src/shade/renderer/light/model/Light.d.ts +4 -2
  304. package/src/shade/renderer/light/model/Light.d.ts.map +1 -1
  305. package/src/shade/renderer/light/model/Light.js +4 -2
  306. package/src/shade/renderer/light/model/io/light_record_directional.d.ts.map +1 -1
  307. package/src/shade/renderer/light/model/io/light_record_directional.js +3 -0
  308. package/src/shade/renderer/light/shader_refresh_light_poses.d.ts +16 -1
  309. package/src/shade/renderer/light/shader_refresh_light_poses.d.ts.map +1 -1
  310. package/src/shade/renderer/light/shader_refresh_light_poses.js +211 -154
  311. package/src/shade/renderer/lightmap/GPULightMap.d.ts.map +1 -1
  312. package/src/shade/renderer/lightmap/GPULightMap.js +1 -0
  313. package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
  314. package/src/shade/renderer/path_tracer/accumulating/AccumulatingPathTracer.d.ts.map +1 -1
  315. package/src/shade/renderer/path_tracer/accumulating/AccumulatingPathTracer.js +1 -0
  316. package/src/shade/renderer/path_tracer/graph_path_trace_scene.d.ts.map +1 -1
  317. package/src/shade/renderer/path_tracer/graph_path_trace_scene.js +1 -0
  318. package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
  319. package/src/shade/renderer/postprocess/ssr/SSR.d.ts +2 -5
  320. package/src/shade/renderer/postprocess/ssr/SSR.d.ts.map +1 -1
  321. package/src/shade/renderer/postprocess/ssr/SSR.js +1 -13
  322. package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_add_hit_irradiance.d.ts +2 -9
  323. package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_add_hit_irradiance.d.ts.map +1 -1
  324. package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_add_hit_irradiance.js +2 -38
  325. package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_sample_radiance.d.ts +0 -5
  326. package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_sample_radiance.d.ts.map +1 -1
  327. package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_sample_radiance.js +0 -16
  328. package/src/shade/renderer/postprocess/ssr/resolve/ssr_resolve_shader.d.ts.map +1 -1
  329. package/src/shade/renderer/postprocess/ssr/resolve/ssr_resolve_shader.js +3 -10
  330. package/src/shade/renderer/rasterize/forward/chunk_forward_sample_indirect.d.ts +0 -2
  331. package/src/shade/renderer/rasterize/forward/chunk_forward_sample_indirect.d.ts.map +1 -1
  332. package/src/shade/renderer/rasterize/forward/chunk_forward_sample_indirect.js +0 -3
  333. package/src/shade/renderer/scene/GPUInstancesAccelerationStructure.d.ts +8 -4
  334. package/src/shade/renderer/scene/GPUInstancesAccelerationStructure.d.ts.map +1 -1
  335. package/src/shade/renderer/scene/GPUInstancesAccelerationStructure.js +60 -33
  336. package/src/shade/renderer/scene/GPUSceneContext.d.ts +0 -6
  337. package/src/shade/renderer/scene/GPUSceneContext.d.ts.map +1 -1
  338. package/src/shade/renderer/scene/GPUSceneContext.js +0 -19
  339. package/src/shade/renderer/scene/Scene.d.ts +1 -7
  340. package/src/shade/renderer/scene/Scene.d.ts.map +1 -1
  341. package/src/shade/renderer/scene/Scene.js +1 -8
  342. package/src/shade/renderer/scene/bvh/sdf_build_from_scene.d.ts.map +1 -0
  343. package/src/shade/renderer/{global_illumination/lpv/placement/software → scene/bvh}/sdf_build_from_scene.js +6 -6
  344. package/src/shade/renderer/scene/bvh/sdf_find_local_maxima.d.ts.map +1 -0
  345. package/src/shade/renderer/{global_illumination/lpv/placement/software → scene/bvh}/sdf_find_local_maxima.js +1 -1
  346. package/src/shade/renderer/scene/verify_gpu_tlas_build.d.ts +6 -6
  347. package/src/shade/renderer/scene/verify_gpu_tlas_build.d.ts.map +1 -1
  348. package/src/shade/renderer/scene/verify_gpu_tlas_build.js +23 -53
  349. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/BVH8_INODE_STRUCT.d.ts +3 -1
  350. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/BVH8_INODE_STRUCT.d.ts.map +1 -1
  351. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/BVH8_INODE_STRUCT.js +5 -3
  352. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/BVH8_MAX_DEPTH.d.ts +28 -0
  353. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/BVH8_MAX_DEPTH.d.ts.map +1 -0
  354. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/BVH8_MAX_DEPTH.js +29 -0
  355. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_node_grid.d.ts +25 -0
  356. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_node_grid.d.ts.map +1 -0
  357. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_node_grid.js +97 -0
  358. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_node_intersect.d.ts +8 -0
  359. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_node_intersect.d.ts.map +1 -1
  360. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_node_intersect.js +23 -14
  361. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_node_slot_distances.d.ts +36 -0
  362. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_node_slot_distances.d.ts.map +1 -0
  363. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_node_slot_distances.js +222 -0
  364. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_ray_direction_rcp.d.ts +20 -0
  365. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_ray_direction_rcp.d.ts.map +1 -0
  366. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_ray_direction_rcp.js +30 -0
  367. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_tree_read.d.ts +30 -0
  368. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_tree_read.d.ts.map +1 -0
  369. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_tree_read.js +91 -0
  370. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_waiting_slots.d.ts +23 -0
  371. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_waiting_slots.d.ts.map +1 -0
  372. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_waiting_slots.js +40 -0
  373. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_blas_nearest.d.ts +22 -0
  374. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_blas_nearest.d.ts.map +1 -1
  375. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_blas_nearest.js +121 -70
  376. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_blas_occluded.d.ts +13 -1
  377. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_blas_occluded.d.ts.map +1 -1
  378. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_blas_occluded.js +117 -61
  379. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_nearest.d.ts +21 -0
  380. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_nearest.d.ts.map +1 -1
  381. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_nearest.js +111 -72
  382. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_nearest_among.d.ts +1 -2
  383. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_nearest_among.d.ts.map +1 -1
  384. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_nearest_among.js +83 -54
  385. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_occluded.d.ts +14 -0
  386. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_occluded.d.ts.map +1 -1
  387. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_occluded.js +92 -60
  388. package/src/shade/renderer/shader/chunk/light/DIRECTIONAL_LIGHT_STRUCT.d.ts.map +1 -1
  389. package/src/shade/renderer/shader/chunk/light/DIRECTIONAL_LIGHT_STRUCT.js +12 -2
  390. package/src/shade/renderer/shader/chunk/light/io/chunk_point_lights_iterate.d.ts +1 -1
  391. package/src/shade/renderer/shader/chunk/light/io/chunk_point_lights_iterate.js +1 -1
  392. package/src/shade/renderer/{global_illumination/probe/octahedral/sample → shader/chunk/light/probe}/chunk_parallax_correct_spherical_probe.d.ts +1 -1
  393. package/src/shade/renderer/shader/chunk/light/probe/chunk_parallax_correct_spherical_probe.d.ts.map +1 -0
  394. package/src/shade/renderer/{global_illumination/probe/octahedral/sample → shader/chunk/light/probe}/chunk_parallax_correct_spherical_probe.js +2 -2
  395. package/src/shade/renderer/shader/chunk/light/probe/chunk_probe_visibility_weight.d.ts +1 -1
  396. package/src/shade/renderer/shader/chunk/light/probe/chunk_probe_visibility_weight.js +1 -1
  397. package/src/shade/renderer/shader/chunk/sdf/chunk_point_query_blas_nearest.d.ts +22 -0
  398. package/src/shade/renderer/shader/chunk/sdf/chunk_point_query_blas_nearest.d.ts.map +1 -1
  399. package/src/shade/renderer/shader/chunk/sdf/chunk_point_query_blas_nearest.js +153 -106
  400. package/src/shade/renderer/shader/chunk/sdf/chunk_scene_point_query_nearest.d.ts +21 -0
  401. package/src/shade/renderer/shader/chunk/sdf/chunk_scene_point_query_nearest.d.ts.map +1 -1
  402. package/src/shade/renderer/shader/chunk/sdf/chunk_scene_point_query_nearest.js +115 -74
  403. package/src/shade/renderer/shader/chunk/sdf/chunk_scene_sdf_raymarch.d.ts +5 -2
  404. package/src/shade/renderer/shader/chunk/sdf/chunk_scene_sdf_raymarch.d.ts.map +1 -1
  405. package/src/shade/renderer/shader/chunk/sdf/chunk_scene_sdf_raymarch.js +89 -63
  406. package/src/shade/renderer/shader/chunk/sdf/chunk_sdf_query_distance.d.ts +15 -0
  407. package/src/shade/renderer/shader/chunk/sdf/chunk_sdf_query_distance.d.ts.map +1 -1
  408. package/src/shade/renderer/shader/chunk/sdf/chunk_sdf_query_distance.js +108 -63
  409. package/src/shade/renderer/shader/chunk/spherical_harmonics/dering/chunk_sh2_dering_optimize_positive.d.ts +1 -2
  410. package/src/shade/renderer/shader/chunk/spherical_harmonics/dering/chunk_sh2_dering_optimize_positive.d.ts.map +1 -1
  411. package/src/shade/renderer/shader/chunk/spherical_harmonics/dering/chunk_sh2_dering_optimize_positive.js +1 -2
  412. package/src/shade/renderer/shadow/sdf/chunk_ray_query_sdf_raycast.d.ts +14 -0
  413. package/src/shade/renderer/shadow/sdf/chunk_ray_query_sdf_raycast.d.ts.map +1 -1
  414. package/src/shade/renderer/shadow/sdf/chunk_ray_query_sdf_raycast.js +94 -60
  415. package/src/shade/renderer/shadow/sdf/graph_draw_sdf_shadows.d.ts.map +1 -1
  416. package/src/shade/renderer/shadow/sdf/graph_draw_sdf_shadows.js +4 -4
  417. package/src/shade/renderer/trails/GPUTrailSystem.d.ts +4 -0
  418. package/src/shade/renderer/trails/GPUTrailSystem.d.ts.map +1 -1
  419. package/src/shade/renderer/trails/GPUTrailSystem.js +9 -3
  420. package/src/shade/renderer/volumetrics/GPUViewVolumetrics.d.ts +1 -3
  421. package/src/shade/renderer/volumetrics/GPUViewVolumetrics.d.ts.map +1 -1
  422. package/src/shade/renderer/volumetrics/GPUViewVolumetrics.js +0 -3
  423. package/src/shade/renderer/volumetrics/chunk_volumetrics_irradiance_sh.d.ts +2 -2
  424. package/src/shade/renderer/volumetrics/chunk_volumetrics_irradiance_sh.js +2 -2
  425. package/src/shade/renderer/volumetrics/graph_build_volumetrics.js +2 -2
  426. package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.d.ts +1 -3
  427. package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.d.ts.map +1 -1
  428. package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.js +0 -9
  429. package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_gi_sample.d.ts +0 -5
  430. package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_gi_sample.d.ts.map +1 -1
  431. package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_gi_sample.js +0 -29
  432. package/src/shade/renderer/volumetrics/irradiance_clipmap/shader_irradiance_clipmap_build.d.ts.map +1 -1
  433. package/src/shade/renderer/volumetrics/irradiance_clipmap/shader_irradiance_clipmap_build.js +0 -2
  434. package/src/shade/renderer/volumetrics/shader_volumetrics_build_lighting.d.ts.map +1 -1
  435. package/src/shade/renderer/volumetrics/shader_volumetrics_build_lighting.js +11 -6
  436. package/src/shade/renderer/volumetrics/shader_volumetrics_build_scattering_lut.d.ts.map +1 -1
  437. package/src/shade/renderer/volumetrics/shader_volumetrics_build_scattering_lut.js +10 -4
  438. package/src/shade/renderer/water/chunk_water_gi.d.ts +1 -1
  439. package/src/shade/renderer/water/chunk_water_gi.d.ts.map +1 -1
  440. package/src/shade/renderer/water/chunk_water_gi.js +1 -3
  441. package/src/shade/renderer/water/query/GPUWaterQueries.d.ts +1 -1
  442. package/src/shade/renderer/water/query/shader_water_surface_query.d.ts.map +1 -1
  443. package/src/shade/renderer/water/query/shader_water_surface_query.js +227 -227
  444. package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.d.ts.map +1 -1
  445. package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.js +7 -4
  446. package/src/shade/renderer/water/surface/particles/shader_water_particles.js +2 -2
  447. package/src/shade/renderer/wind/GPUSceneWind.d.ts +37 -5
  448. package/src/shade/renderer/wind/GPUSceneWind.d.ts.map +1 -1
  449. package/src/shade/renderer/wind/GPUSceneWind.js +150 -4
  450. package/src/shade/renderer/wind/WIND_FIELD_STRUCT.d.ts +9 -3
  451. package/src/shade/renderer/wind/WIND_FIELD_STRUCT.d.ts.map +1 -1
  452. package/src/shade/renderer/wind/WIND_FIELD_STRUCT.js +13 -3
  453. package/src/shade/renderer/wind/WIND_FIELD_UNIFORM.d.ts +6 -6
  454. package/src/shade/renderer/wind/WIND_FIELD_UNIFORM.js +6 -6
  455. package/src/shade/renderer/wind/chunk_fluid_turbulence.d.ts +39 -0
  456. package/src/shade/renderer/wind/chunk_fluid_turbulence.d.ts.map +1 -0
  457. package/src/shade/renderer/wind/chunk_fluid_turbulence.js +63 -0
  458. package/src/shade/renderer/wind/chunk_wind_field_sample_cascades.d.ts +10 -7
  459. package/src/shade/renderer/wind/chunk_wind_field_sample_cascades.d.ts.map +1 -1
  460. package/src/shade/renderer/wind/chunk_wind_field_sample_cascades.js +34 -11
  461. package/src/shade/renderer/wind/chunk_wind_field_sample_uniform.d.ts +2 -2
  462. package/src/shade/renderer/wind/chunk_wind_field_sample_uniform.js +2 -2
  463. package/src/shade/renderer/wind/wind_field_add_resources.d.ts +6 -4
  464. package/src/shade/renderer/wind/wind_field_add_resources.d.ts.map +1 -1
  465. package/src/shade/renderer/wind/wind_field_add_resources.js +9 -6
  466. package/src/shade/renderer/deferred/indirect/chunk_gi_sample_lpv_cache.d.ts +0 -3
  467. package/src/shade/renderer/deferred/indirect/chunk_gi_sample_lpv_cache.d.ts.map +0 -1
  468. package/src/shade/renderer/deferred/indirect/chunk_gi_sample_lpv_cache.js +0 -41
  469. package/src/shade/renderer/deferred/indirect/chunk_lpv_2d_cache_sample_irradiance.d.ts +0 -6
  470. package/src/shade/renderer/deferred/indirect/chunk_lpv_2d_cache_sample_irradiance.d.ts.map +0 -1
  471. package/src/shade/renderer/deferred/indirect/chunk_lpv_2d_cache_sample_irradiance.js +0 -108
  472. package/src/shade/renderer/deferred/indirect/chunk_lpv_sample_light.d.ts +0 -6
  473. package/src/shade/renderer/deferred/indirect/chunk_lpv_sample_light.d.ts.map +0 -1
  474. package/src/shade/renderer/deferred/indirect/chunk_lpv_sample_light.js +0 -100
  475. package/src/shade/renderer/geometry/bvh/BLAS_REFIT_TARGET_STRUCT.d.ts +0 -18
  476. package/src/shade/renderer/geometry/bvh/BLAS_REFIT_TARGET_STRUCT.d.ts.map +0 -1
  477. package/src/shade/renderer/geometry/bvh/BLAS_REFIT_TARGET_STRUCT.js +0 -50
  478. package/src/shade/renderer/geometry/bvh/bvh2_derive_topology.d.ts +0 -23
  479. package/src/shade/renderer/geometry/bvh/bvh2_derive_topology.d.ts.map +0 -1
  480. package/src/shade/renderer/geometry/bvh/bvh2_derive_topology.js +0 -87
  481. package/src/shade/renderer/geometry/bvh/shader_blas_refit_batch.d.ts +0 -42
  482. package/src/shade/renderer/geometry/bvh/shader_blas_refit_batch.d.ts.map +0 -1
  483. package/src/shade/renderer/geometry/bvh/shader_blas_refit_batch.js +0 -141
  484. package/src/shade/renderer/geometry/bvh/shader_blas_refit_batch_seed.d.ts +0 -21
  485. package/src/shade/renderer/geometry/bvh/shader_blas_refit_batch_seed.d.ts.map +0 -1
  486. package/src/shade/renderer/geometry/bvh/shader_blas_refit_batch_seed.js +0 -75
  487. package/src/shade/renderer/geometry/meshlet_batch_to_bvh.d.ts +0 -17
  488. package/src/shade/renderer/geometry/meshlet_batch_to_bvh.d.ts.map +0 -1
  489. package/src/shade/renderer/geometry/meshlet_batch_to_bvh.js +0 -247
  490. package/src/shade/renderer/global_illumination/lpv/GPULightProbeVolume.d.ts +0 -51
  491. package/src/shade/renderer/global_illumination/lpv/GPULightProbeVolume.d.ts.map +0 -1
  492. package/src/shade/renderer/global_illumination/lpv/GPULightProbeVolume.js +0 -384
  493. package/src/shade/renderer/global_illumination/lpv/LIGHT_PROBE_STRUCT.d.ts +0 -3
  494. package/src/shade/renderer/global_illumination/lpv/LIGHT_PROBE_STRUCT.d.ts.map +0 -1
  495. package/src/shade/renderer/global_illumination/lpv/LIGHT_PROBE_STRUCT.js +0 -20
  496. package/src/shade/renderer/global_illumination/lpv/LIGHT_PROBE_VOLUME_METADATA_STRUCT.d.ts +0 -3
  497. package/src/shade/renderer/global_illumination/lpv/LIGHT_PROBE_VOLUME_METADATA_STRUCT.d.ts.map +0 -1
  498. package/src/shade/renderer/global_illumination/lpv/LIGHT_PROBE_VOLUME_METADATA_STRUCT.js +0 -10
  499. package/src/shade/renderer/global_illumination/lpv/LightProbeVolume.d.ts +0 -63
  500. package/src/shade/renderer/global_illumination/lpv/LightProbeVolume.d.ts.map +0 -1
  501. package/src/shade/renderer/global_illumination/lpv/LightProbeVolume.js +0 -177
  502. package/src/shade/renderer/global_illumination/lpv/TETRAHEDRAL_MESH_CELL_STRUCT.d.ts +0 -3
  503. package/src/shade/renderer/global_illumination/lpv/TETRAHEDRAL_MESH_CELL_STRUCT.d.ts.map +0 -1
  504. package/src/shade/renderer/global_illumination/lpv/TETRAHEDRAL_MESH_CELL_STRUCT.js +0 -7
  505. package/src/shade/renderer/global_illumination/lpv/bake/GPULightProbeVolumeRenderer.d.ts +0 -68
  506. package/src/shade/renderer/global_illumination/lpv/bake/GPULightProbeVolumeRenderer.d.ts.map +0 -1
  507. package/src/shade/renderer/global_illumination/lpv/bake/GPULightProbeVolumeRenderer.js +0 -409
  508. package/src/shade/renderer/global_illumination/lpv/bake/PROBE_RAYS_PER_WORKGROUP.d.ts +0 -2
  509. package/src/shade/renderer/global_illumination/lpv/bake/PROBE_RAYS_PER_WORKGROUP.d.ts.map +0 -1
  510. package/src/shade/renderer/global_illumination/lpv/bake/PROBE_RAYS_PER_WORKGROUP.js +0 -1
  511. package/src/shade/renderer/global_illumination/lpv/debug/shader_visualize_probe_depth.d.ts +0 -3
  512. package/src/shade/renderer/global_illumination/lpv/debug/shader_visualize_probe_depth.d.ts.map +0 -1
  513. package/src/shade/renderer/global_illumination/lpv/debug/shader_visualize_probe_depth.js +0 -38
  514. package/src/shade/renderer/global_illumination/lpv/deprecated/LIGHT_PROBE_DEPTH_RESOLUTION.d.ts +0 -8
  515. package/src/shade/renderer/global_illumination/lpv/deprecated/LIGHT_PROBE_DEPTH_RESOLUTION.d.ts.map +0 -1
  516. package/src/shade/renderer/global_illumination/lpv/deprecated/LIGHT_PROBE_DEPTH_RESOLUTION.js +0 -7
  517. package/src/shade/renderer/global_illumination/lpv/deprecated/LIGHT_PROBE_DEPTH_STRUCT.d.ts +0 -3
  518. package/src/shade/renderer/global_illumination/lpv/deprecated/LIGHT_PROBE_DEPTH_STRUCT.d.ts.map +0 -1
  519. package/src/shade/renderer/global_illumination/lpv/deprecated/LIGHT_PROBE_DEPTH_STRUCT.js +0 -8
  520. package/src/shade/renderer/global_illumination/lpv/deprecated/chunk_lpv_get_visibility_mask.d.ts +0 -3
  521. package/src/shade/renderer/global_illumination/lpv/deprecated/chunk_lpv_get_visibility_mask.d.ts.map +0 -1
  522. package/src/shade/renderer/global_illumination/lpv/deprecated/chunk_lpv_get_visibility_mask.js +0 -48
  523. package/src/shade/renderer/global_illumination/lpv/deprecated/chunk_lpv_probe_depth_coordinate_to_address.d.ts +0 -3
  524. package/src/shade/renderer/global_illumination/lpv/deprecated/chunk_lpv_probe_depth_coordinate_to_address.d.ts.map +0 -1
  525. package/src/shade/renderer/global_illumination/lpv/deprecated/chunk_lpv_probe_depth_coordinate_to_address.js +0 -11
  526. package/src/shade/renderer/global_illumination/lpv/deprecated/chunk_lpv_probe_depth_get_pixel.d.ts +0 -3
  527. package/src/shade/renderer/global_illumination/lpv/deprecated/chunk_lpv_probe_depth_get_pixel.d.ts.map +0 -1
  528. package/src/shade/renderer/global_illumination/lpv/deprecated/chunk_lpv_probe_depth_get_pixel.js +0 -20
  529. package/src/shade/renderer/global_illumination/lpv/deprecated/probe_trace_compute_shader_code.d.ts +0 -5
  530. package/src/shade/renderer/global_illumination/lpv/deprecated/probe_trace_compute_shader_code.d.ts.map +0 -1
  531. package/src/shade/renderer/global_illumination/lpv/deprecated/probe_trace_compute_shader_code.js +0 -206
  532. package/src/shade/renderer/global_illumination/lpv/edit/AddProbeAction.d.ts +0 -14
  533. package/src/shade/renderer/global_illumination/lpv/edit/AddProbeAction.d.ts.map +0 -1
  534. package/src/shade/renderer/global_illumination/lpv/edit/AddProbeAction.js +0 -39
  535. package/src/shade/renderer/global_illumination/lpv/graph_bake_irradiance_lookup_2d.d.ts +0 -16
  536. package/src/shade/renderer/global_illumination/lpv/graph_bake_irradiance_lookup_2d.d.ts.map +0 -1
  537. package/src/shade/renderer/global_illumination/lpv/graph_bake_irradiance_lookup_2d.js +0 -201
  538. package/src/shade/renderer/global_illumination/lpv/lpv_jitter_points.d.ts +0 -10
  539. package/src/shade/renderer/global_illumination/lpv/lpv_jitter_points.d.ts.map +0 -1
  540. package/src/shade/renderer/global_illumination/lpv/lpv_jitter_points.js +0 -27
  541. package/src/shade/renderer/global_illumination/lpv/lpv_visualise_probes.d.ts +0 -18
  542. package/src/shade/renderer/global_illumination/lpv/lpv_visualise_probes.d.ts.map +0 -1
  543. package/src/shade/renderer/global_illumination/lpv/lpv_visualise_probes.js +0 -265
  544. package/src/shade/renderer/global_illumination/lpv/placement/chunk_refine_probe_placement.d.ts +0 -7
  545. package/src/shade/renderer/global_illumination/lpv/placement/chunk_refine_probe_placement.d.ts.map +0 -1
  546. package/src/shade/renderer/global_illumination/lpv/placement/chunk_refine_probe_placement.js +0 -126
  547. package/src/shade/renderer/global_illumination/lpv/placement/graph_generate_probe_locations.d.ts +0 -13
  548. package/src/shade/renderer/global_illumination/lpv/placement/graph_generate_probe_locations.d.ts.map +0 -1
  549. package/src/shade/renderer/global_illumination/lpv/placement/graph_generate_probe_locations.js +0 -377
  550. package/src/shade/renderer/global_illumination/lpv/placement/software/lpv_generate_probe_locations2.d.ts +0 -14
  551. package/src/shade/renderer/global_illumination/lpv/placement/software/lpv_generate_probe_locations2.d.ts.map +0 -1
  552. package/src/shade/renderer/global_illumination/lpv/placement/software/lpv_generate_probe_locations2.js +0 -225
  553. package/src/shade/renderer/global_illumination/lpv/placement/software/sdf_build_from_scene.d.ts.map +0 -1
  554. package/src/shade/renderer/global_illumination/lpv/placement/software/sdf_find_local_maxima.d.ts.map +0 -1
  555. package/src/shade/renderer/global_illumination/lpv/shader_diffuse_LPV.d.ts +0 -3
  556. package/src/shade/renderer/global_illumination/lpv/shader_diffuse_LPV.d.ts.map +0 -1
  557. package/src/shade/renderer/global_illumination/lpv/shader_diffuse_LPV.js +0 -91
  558. package/src/shade/renderer/global_illumination/probe/chunk_compute_probe_dering.d.ts +0 -5
  559. package/src/shade/renderer/global_illumination/probe/chunk_compute_probe_dering.d.ts.map +0 -1
  560. package/src/shade/renderer/global_illumination/probe/chunk_compute_probe_dering.js +0 -45
  561. package/src/shade/renderer/global_illumination/probe/compute_pipeline_probe_dering.d.ts +0 -3
  562. package/src/shade/renderer/global_illumination/probe/compute_pipeline_probe_dering.d.ts.map +0 -1
  563. package/src/shade/renderer/global_illumination/probe/compute_pipeline_probe_dering.js +0 -17
  564. package/src/shade/renderer/global_illumination/probe/lpv_dering_software.d.ts +0 -6
  565. package/src/shade/renderer/global_illumination/probe/lpv_dering_software.d.ts.map +0 -1
  566. package/src/shade/renderer/global_illumination/probe/lpv_dering_software.js +0 -21
  567. package/src/shade/renderer/global_illumination/probe/octahedral/GPUProbeAtlas.d.ts +0 -79
  568. package/src/shade/renderer/global_illumination/probe/octahedral/GPUProbeAtlas.d.ts.map +0 -1
  569. package/src/shade/renderer/global_illumination/probe/octahedral/GPUProbeAtlas.js +0 -437
  570. package/src/shade/renderer/global_illumination/probe/octahedral/LPV_ACCUMULATION_PUSH_CONSTANTS.d.ts +0 -3
  571. package/src/shade/renderer/global_illumination/probe/octahedral/LPV_ACCUMULATION_PUSH_CONSTANTS.d.ts.map +0 -1
  572. package/src/shade/renderer/global_illumination/probe/octahedral/LPV_ACCUMULATION_PUSH_CONSTANTS.js +0 -14
  573. package/src/shade/renderer/global_illumination/probe/octahedral/LPV_SHADER_RESOURCE_GROUP.d.ts +0 -42
  574. package/src/shade/renderer/global_illumination/probe/octahedral/LPV_SHADER_RESOURCE_GROUP.d.ts.map +0 -1
  575. package/src/shade/renderer/global_illumination/probe/octahedral/LPV_SHADER_RESOURCE_GROUP.js +0 -68
  576. package/src/shade/renderer/global_illumination/probe/octahedral/ProbeGBufferTypes.d.ts +0 -9
  577. package/src/shade/renderer/global_illumination/probe/octahedral/ProbeGBufferTypes.d.ts.map +0 -1
  578. package/src/shade/renderer/global_illumination/probe/octahedral/ProbeGBufferTypes.js +0 -20
  579. package/src/shade/renderer/global_illumination/probe/octahedral/border/chunk_lpv_map_index_to_border.d.ts +0 -3
  580. package/src/shade/renderer/global_illumination/probe/octahedral/border/chunk_lpv_map_index_to_border.d.ts.map +0 -1
  581. package/src/shade/renderer/global_illumination/probe/octahedral/border/chunk_lpv_map_index_to_border.js +0 -47
  582. package/src/shade/renderer/global_illumination/probe/octahedral/border/chunk_lpv_paint_borders_body.d.ts +0 -3
  583. package/src/shade/renderer/global_illumination/probe/octahedral/border/chunk_lpv_paint_borders_body.d.ts.map +0 -1
  584. package/src/shade/renderer/global_illumination/probe/octahedral/border/chunk_lpv_paint_borders_body.js +0 -55
  585. package/src/shade/renderer/global_illumination/probe/octahedral/border/graph_lpv_paint_border_depth.d.ts +0 -19
  586. package/src/shade/renderer/global_illumination/probe/octahedral/border/graph_lpv_paint_border_depth.d.ts.map +0 -1
  587. package/src/shade/renderer/global_illumination/probe/octahedral/border/graph_lpv_paint_border_depth.js +0 -85
  588. package/src/shade/renderer/global_illumination/probe/octahedral/border/shader_lpv_atlas_border_read.d.ts +0 -3
  589. package/src/shade/renderer/global_illumination/probe/octahedral/border/shader_lpv_atlas_border_read.d.ts.map +0 -1
  590. package/src/shade/renderer/global_illumination/probe/octahedral/border/shader_lpv_atlas_border_read.js +0 -78
  591. package/src/shade/renderer/global_illumination/probe/octahedral/border/shader_lpv_atlas_paint_borders_depth.d.ts +0 -7
  592. package/src/shade/renderer/global_illumination/probe/octahedral/border/shader_lpv_atlas_paint_borders_depth.d.ts.map +0 -1
  593. package/src/shade/renderer/global_illumination/probe/octahedral/border/shader_lpv_atlas_paint_borders_depth.js +0 -70
  594. package/src/shade/renderer/global_illumination/probe/octahedral/border/shader_lpv_atlas_paint_borders_radiance.d.ts +0 -7
  595. package/src/shade/renderer/global_illumination/probe/octahedral/border/shader_lpv_atlas_paint_borders_radiance.d.ts.map +0 -1
  596. package/src/shade/renderer/global_illumination/probe/octahedral/border/shader_lpv_atlas_paint_borders_radiance.js +0 -20
  597. package/src/shade/renderer/global_illumination/probe/octahedral/convolve/chunk_compute_coefficient_address.d.ts +0 -3
  598. package/src/shade/renderer/global_illumination/probe/octahedral/convolve/chunk_compute_coefficient_address.d.ts.map +0 -1
  599. package/src/shade/renderer/global_illumination/probe/octahedral/convolve/chunk_compute_coefficient_address.js +0 -20
  600. package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_lpv_store_sh.d.ts +0 -19
  601. package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_lpv_store_sh.d.ts.map +0 -1
  602. package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_lpv_store_sh.js +0 -128
  603. package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_lvp_atlas_to_sh.d.ts +0 -22
  604. package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_lvp_atlas_to_sh.d.ts.map +0 -1
  605. package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_lvp_atlas_to_sh.js +0 -200
  606. package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_reduce_atlas_to_sh.d.ts +0 -23
  607. package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_reduce_atlas_to_sh.d.ts.map +0 -1
  608. package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_reduce_atlas_to_sh.js +0 -179
  609. package/src/shade/renderer/global_illumination/probe/octahedral/graph_lpv_shade.d.ts +0 -13
  610. package/src/shade/renderer/global_illumination/probe/octahedral/graph_lpv_shade.d.ts.map +0 -1
  611. package/src/shade/renderer/global_illumination/probe/octahedral/graph_lpv_shade.js +0 -416
  612. package/src/shade/renderer/global_illumination/probe/octahedral/graph_sample_light_probes.d.ts +0 -16
  613. package/src/shade/renderer/global_illumination/probe/octahedral/graph_sample_light_probes.d.ts.map +0 -1
  614. package/src/shade/renderer/global_illumination/probe/octahedral/graph_sample_light_probes.js +0 -268
  615. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_patch_texel_coord.d.ts +0 -17
  616. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_patch_texel_coord.d.ts.map +0 -1
  617. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_patch_texel_coord.js +0 -38
  618. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_read_patch_texel.d.ts +0 -3
  619. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_read_patch_texel.d.ts.map +0 -1
  620. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_read_patch_texel.js +0 -34
  621. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_sample_probe_radiance.d.ts +0 -3
  622. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_sample_probe_radiance.d.ts.map +0 -1
  623. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_sample_probe_radiance.js +0 -62
  624. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_sample_probe_radiance_nearest.d.ts +0 -3
  625. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_sample_probe_radiance_nearest.d.ts.map +0 -1
  626. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_sample_probe_radiance_nearest.js +0 -37
  627. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_mesh_interpolate_radiance_via_atlas.d.ts +0 -7
  628. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_mesh_interpolate_radiance_via_atlas.d.ts.map +0 -1
  629. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_mesh_interpolate_radiance_via_atlas.js +0 -62
  630. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_radiance_sample_reflection.d.ts +0 -7
  631. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_radiance_sample_reflection.d.ts.map +0 -1
  632. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_radiance_sample_reflection.js +0 -61
  633. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_parallax_correct_spherical_probe.d.ts.map +0 -1
  634. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_parallax_correct_spherical_probe_iterative.d.ts +0 -3
  635. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_parallax_correct_spherical_probe_iterative.d.ts.map +0 -1
  636. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_parallax_correct_spherical_probe_iterative.js +0 -80
  637. package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_accumulate_depth.d.ts +0 -3
  638. package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_accumulate_depth.d.ts.map +0 -1
  639. package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_accumulate_depth.js +0 -143
  640. package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_atlas_write_depth.d.ts +0 -3
  641. package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_atlas_write_depth.d.ts.map +0 -1
  642. package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_atlas_write_depth.js +0 -59
  643. package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_build_gbuffer.d.ts +0 -3
  644. package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_build_gbuffer.d.ts.map +0 -1
  645. package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_build_gbuffer.js +0 -227
  646. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_ray_query_blas_occlusion.d.ts +0 -7
  647. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_ray_query_blas_occlusion.d.ts.map +0 -1
  648. package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_ray_query_blas_occlusion.js +0 -226
  649. package/src/shade/renderer/shader/chunk/light/lpv/INVALID_TET_DECLARATION.d.ts +0 -7
  650. package/src/shade/renderer/shader/chunk/light/lpv/INVALID_TET_DECLARATION.d.ts.map +0 -1
  651. package/src/shade/renderer/shader/chunk/light/lpv/INVALID_TET_DECLARATION.js +0 -12
  652. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_interpolate_probe_irradiance8.d.ts +0 -7
  653. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_interpolate_probe_irradiance8.d.ts.map +0 -1
  654. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_interpolate_probe_irradiance8.js +0 -37
  655. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mask_visibility_via_rays.d.ts +0 -8
  656. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mask_visibility_via_rays.d.ts.map +0 -1
  657. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mask_visibility_via_rays.js +0 -45
  658. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_get_barycentric_coordinates.d.ts +0 -3
  659. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_get_barycentric_coordinates.d.ts.map +0 -1
  660. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_get_barycentric_coordinates.js +0 -29
  661. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_get_neighbours.d.ts +0 -3
  662. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_get_neighbours.d.ts.map +0 -1
  663. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_get_neighbours.js +0 -20
  664. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_get_vertices.d.ts +0 -3
  665. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_get_vertices.d.ts.map +0 -1
  666. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_get_vertices.js +0 -22
  667. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_interpolate_probe.d.ts +0 -4
  668. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_interpolate_probe.d.ts.map +0 -1
  669. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_interpolate_probe.js +0 -53
  670. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_interpolate_probe_irradiance.d.ts +0 -7
  671. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_interpolate_probe_irradiance.d.ts.map +0 -1
  672. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_interpolate_probe_irradiance.js +0 -48
  673. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_interpolate_probe_irradiance_pre.d.ts +0 -7
  674. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_interpolate_probe_irradiance_pre.d.ts.map +0 -1
  675. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_interpolate_probe_irradiance_pre.js +0 -35
  676. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_interpolation_probe_sh.d.ts +0 -3
  677. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_interpolation_probe_sh.d.ts.map +0 -1
  678. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_interpolation_probe_sh.js +0 -38
  679. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_lookup_nearest_cell.d.ts +0 -3
  680. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_lookup_nearest_cell.d.ts.map +0 -1
  681. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_lookup_nearest_cell.js +0 -67
  682. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_walk_to_tetrahedron.d.ts +0 -3
  683. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_walk_to_tetrahedron.d.ts.map +0 -1
  684. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_walk_to_tetrahedron.js +0 -52
  685. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_probe_get_data.d.ts +0 -3
  686. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_probe_get_data.d.ts.map +0 -1
  687. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_probe_get_data.js +0 -22
  688. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_probe_get_position.d.ts +0 -3
  689. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_probe_get_position.d.ts.map +0 -1
  690. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_probe_get_position.js +0 -17
  691. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_irradiance.d.ts +0 -3
  692. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_irradiance.d.ts.map +0 -1
  693. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_irradiance.js +0 -48
  694. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_irradiance_8.d.ts +0 -9
  695. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_irradiance_8.d.ts.map +0 -1
  696. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_irradiance_8.js +0 -126
  697. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_irradiance_no_depth.d.ts +0 -3
  698. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_irradiance_no_depth.d.ts.map +0 -1
  699. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_irradiance_no_depth.js +0 -45
  700. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_radiance.d.ts +0 -3
  701. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_radiance.d.ts.map +0 -1
  702. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_radiance.js +0 -61
  703. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_sh3_at.d.ts +0 -3
  704. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_sh3_at.d.ts.map +0 -1
  705. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_sh3_at.js +0 -33
  706. package/src/shade/renderer/shader/chunk/light/lpv/depth/chunk_lpv_mask_weights_by_visibility.d.ts +0 -4
  707. package/src/shade/renderer/shader/chunk/light/lpv/depth/chunk_lpv_mask_weights_by_visibility.d.ts.map +0 -1
  708. package/src/shade/renderer/shader/chunk/light/lpv/depth/chunk_lpv_mask_weights_by_visibility.js +0 -161
  709. package/src/shade/renderer/shader/chunk/light/lpv/depth/chunk_lpv_probe_sample_depth_array.d.ts +0 -3
  710. package/src/shade/renderer/shader/chunk/light/lpv/depth/chunk_lpv_probe_sample_depth_array.d.ts.map +0 -1
  711. package/src/shade/renderer/shader/chunk/light/lpv/depth/chunk_lpv_probe_sample_depth_array.js +0 -59
  712. package/src/shade/renderer/shader/chunk/light/lpv/depth/chunk_lpv_sample_depth_atlas.d.ts +0 -4
  713. package/src/shade/renderer/shader/chunk/light/lpv/depth/chunk_lpv_sample_depth_atlas.d.ts.map +0 -1
  714. package/src/shade/renderer/shader/chunk/light/lpv/depth/chunk_lpv_sample_depth_atlas.js +0 -97
  715. package/src/shade/renderer/shader/chunk/light/sample/chunk_ray_sample_light.d.ts +0 -3
  716. package/src/shade/renderer/shader/chunk/light/sample/chunk_ray_sample_light.d.ts.map +0 -1
  717. package/src/shade/renderer/shader/chunk/light/sample/chunk_ray_sample_light.js +0 -105
  718. package/src/shade/renderer/shadow/sdf/chunk_ray_query_sdf_distance.d.ts +0 -6
  719. package/src/shade/renderer/shadow/sdf/chunk_ray_query_sdf_distance.d.ts.map +0 -1
  720. package/src/shade/renderer/shadow/sdf/chunk_ray_query_sdf_distance.js +0 -86
  721. package/src/shade/renderer/shadow/sdf/chunk_ray_query_sdf_raycast_traversal_count.d.ts +0 -2
  722. package/src/shade/renderer/shadow/sdf/chunk_ray_query_sdf_raycast_traversal_count.d.ts.map +0 -1
  723. package/src/shade/renderer/shadow/sdf/chunk_ray_query_sdf_raycast_traversal_count.js +0 -136
  724. /package/src/shade/renderer/{global_illumination/lpv/placement/software → scene/bvh}/sdf_build_from_scene.d.ts +0 -0
  725. /package/src/shade/renderer/{global_illumination/lpv/placement/software → scene/bvh}/sdf_find_local_maxima.d.ts +0 -0
@@ -1,4 +1,8 @@
1
1
  import { assert } from "../../../core/assert.js";
2
+ import { FLUID_TURBULENCE_TEXELS_PER_LENGTH, FLUID_TURBULENCE_TILE_RESOLUTION } from "../../../engine/physics/fluid/turbulence/FLUID_TURBULENCE_TILE.js";
3
+ import { fluid_turbulence_tile_level_size } from "../../../engine/physics/fluid/turbulence/fluid_turbulence_tile_generate.js";
4
+ import { fluid_turbulence_inverse_tile_size } from "../../../engine/physics/fluid/turbulence/fluid_turbulence_inverse_tile_size.js";
5
+ import { fluid_turbulence_tile_data_rgba16 } from "../../../engine/physics/fluid/turbulence/fluid_turbulence_tile_data.js";
2
6
  import { CLIPMAP_LEVEL_STRUCT } from "../shader/chunk/clipmap/CLIPMAP_LEVEL_STRUCT.js";
3
7
  import { GPUTileAtlas3D } from "../texture/atlas/GPUTileAtlas3D.js";
4
8
  import { WIND_FIELD_CASCADE_LIMIT, WIND_FIELD_TILE_BORDER, WIND_FIELD_TILE_FORMAT } from "./WIND_FIELD.js";
@@ -17,6 +21,10 @@ const CASCADE_DECAY = WIND_CASCADE_STRUCT.get('decay').offset >>> 2;
17
21
  const FAR_VELOCITY = WIND_FIELD_STRUCT.get('far_velocity').offset >>> 2;
18
22
  const CASCADE_COUNT = WIND_FIELD_STRUCT.get('cascade_count').offset >>> 2;
19
23
  const INVERSE_ATLAS_SIZE = WIND_FIELD_STRUCT.get('inverse_atlas_size').offset >>> 2;
24
+ const TURBULENCE_SIGMA = WIND_FIELD_STRUCT.get('turbulence_sigma').offset >>> 2;
25
+ const TURBULENCE_SCALE = WIND_FIELD_STRUCT.get('turbulence_scale').offset >>> 2;
26
+ const TURBULENCE_ORIGIN = WIND_FIELD_STRUCT.get('turbulence_origin').offset >>> 2;
27
+ const TURBULENCE_INVERSE_TEXEL = WIND_FIELD_STRUCT.get('turbulence_inverse_texel').offset >>> 2;
20
28
 
21
29
  /**
22
30
  * Content of the atlas before any cascade has a resolution: one texel and its skirt, so there is a
@@ -40,7 +48,11 @@ const PLACEHOLDER_CONTENT = [1, 1, 1];
40
48
  * {@link slot}, from the device; nothing here writes texels;
41
49
  * - {@link uniform}: the table a reader takes, {@link WIND_FIELD_STRUCT}: every cascade's window and
42
50
  * read record, finest first, and `v_far(t)`;
43
- * - {@link previous_uniform}: the table as the frame before read it, over the same atlas.
51
+ * - {@link previous_uniform}: the table as the frame before read it, over the same atlas;
52
+ * - {@link turbulence}: the far field's turbulence tile, `rgba16float`, which every reader of the field
53
+ * samples where the far field has turbulence. One texel of zeros until the far field first has any,
54
+ * then the engine's tile and its band-limited levels as mips (`fluid_turbulence_tile_levels`), uploaded
55
+ * once and kept.
44
56
  *
45
57
  * **The producer's frame**, before any consumer encodes (at `FrameStart`, ahead of the scene's own
46
58
  * update):
@@ -48,7 +60,8 @@ const PLACEHOLDER_CONTENT = [1, 1, 1];
48
60
  * set_cascades(count, resolution) the stack's shape; allocates tiles
49
61
  * set_cascade_window(c, corner, cell_size) where each cascade's window is
50
62
  * set_cascade_decay(c, decay) k_c, each cascade's read record
51
- * set_far_velocity(velocity) v_far(t)
63
+ * set_far_velocity(velocity) u(t), the far field's mean
64
+ * set_turbulence(sigma, offset, length) its turbulence
52
65
  *
53
66
  * and the scene's update ({@link update}) uploads the table once, if anything changed. Nothing here
54
67
  * allocates once the count is fixed: the setters write a retained copy of the table in place.
@@ -86,6 +99,21 @@ export class GPUSceneWind {
86
99
  /** @type {GPUBuffer} */
87
100
  #previous_uniform;
88
101
 
102
+ /**
103
+ * The turbulence tile: one texel until {@link set_turbulence} first has a σ, the engine's tile after.
104
+ * @type {GPUTexture}
105
+ */
106
+ #turbulence;
107
+
108
+ /** {@link #turbulence}'s view, as readers bind it. @type {GPUTextureView} */
109
+ #turbulence_view;
110
+
111
+ /** Whether {@link #turbulence} is the engine's tile yet. */
112
+ #turbulence_tiled = false;
113
+
114
+ /** Scratch for the tile's inverse size. */
115
+ #inverse_tile_size = new Float64Array(3);
116
+
89
117
  /**
90
118
  * The table as the shader reads it, written in place by the setters.
91
119
  * @type {ArrayBuffer}
@@ -101,6 +129,7 @@ export class GPUSceneWind {
101
129
  */
102
130
  #previous_bytes = new ArrayBuffer(WIND_FIELD_STRUCT.size);
103
131
  #previous_u32 = new Uint32Array(this.#previous_bytes);
132
+ #previous_f32 = new Float32Array(this.#previous_bytes);
104
133
 
105
134
  #count = 0;
106
135
 
@@ -162,6 +191,17 @@ export class GPUSceneWind {
162
191
  size: WIND_FIELD_STRUCT.size,
163
192
  usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,
164
193
  });
194
+
195
+ // a new texture is 0: no turbulence, and never read while σ is 0
196
+ this.#turbulence = device.createTexture({
197
+ label: 'GPUSceneWind/turbulence placeholder',
198
+ size: [1, 1, 1],
199
+ dimension: '3d',
200
+ format: 'rgba16float',
201
+ usage: GPUTextureUsage.TEXTURE_BINDING,
202
+ });
203
+
204
+ this.#turbulence_view = this.#turbulence.createView();
165
205
  }
166
206
 
167
207
  /**
@@ -231,6 +271,27 @@ export class GPUSceneWind {
231
271
  return this.#count;
232
272
  }
233
273
 
274
+ /**
275
+ * Whether the field is the far field's mean at every point, this frame and the frame before: no
276
+ * cascades and no turbulence in either. What `WIND_FIELD_UNIFORM` is set from.
277
+ * @returns {boolean}
278
+ */
279
+ get is_uniform() {
280
+ return this.#count === 0
281
+ && this.#previous_u32[CASCADE_COUNT] === 0
282
+ && this.#f32[TURBULENCE_SIGMA] === 0
283
+ && this.#previous_f32[TURBULENCE_SIGMA] === 0;
284
+ }
285
+
286
+ /**
287
+ * A view of the far field's turbulence tile, as the readers bind it, `fluid_turbulence`: replaced
288
+ * once, the first time the far field has turbulence, so a consumer takes it per frame ({@link bind}).
289
+ * @returns {GPUTextureView}
290
+ */
291
+ get turbulence() {
292
+ return this.#turbulence_view;
293
+ }
294
+
234
295
  /**
235
296
  * The atlas slot of a cascade's tile: the one this frame's readers take.
236
297
  *
@@ -420,7 +481,8 @@ export class GPUSceneWind {
420
481
  }
421
482
 
422
483
  /**
423
- * `v_far(t)`: the wind wherever no cascade holds, now.
484
+ * `u(t)`: the far field's mean now, which is the wind wherever no cascade holds when the far field has
485
+ * no turbulence.
424
486
  *
425
487
  * @param {ArrayLike<number>} velocity m/s, x, y, z
426
488
  */
@@ -436,6 +498,88 @@ export class GPUSceneWind {
436
498
  this.#dirty = true;
437
499
  }
438
500
 
501
+ /**
502
+ * The far field's turbulence now: `σ`, its rms on each axis, m/s, 0 for none; `offset`, how far the
503
+ * mean has carried it, m; `length`, its length scale `L`, m. The far field at a world point `p` is then
504
+ * `u + σ·T((p − offset) ⊙ S⁻¹)`, `S` the tile's size for `L`. The first `σ` that is not 0 uploads the
505
+ * engine's tile, once.
506
+ *
507
+ * The offset is folded into one tile here, in f64, so the table holds a coordinate in `[0, 1)` however
508
+ * far the air has carried the turbulence.
509
+ *
510
+ * @param {number} sigma
511
+ * @param {ArrayLike<number>} offset
512
+ * @param {number} length > 0 when `sigma` is not 0
513
+ */
514
+ set_turbulence(sigma, offset, length) {
515
+ assert.isFinite(sigma, 'sigma');
516
+ assert.greaterThanOrEqual(sigma, 0, 'sigma');
517
+
518
+ const f32 = this.#f32;
519
+
520
+ f32[TURBULENCE_SIGMA] = sigma;
521
+
522
+ if (sigma !== 0) {
523
+ assert.isFinite(length, 'length');
524
+ assert.greaterThan(length, 0, 'length');
525
+
526
+ this.#ensure_turbulence_tile();
527
+
528
+ const inverse = fluid_turbulence_inverse_tile_size(this.#inverse_tile_size, length);
529
+
530
+ f32[TURBULENCE_INVERSE_TEXEL] = FLUID_TURBULENCE_TEXELS_PER_LENGTH / length;
531
+
532
+ for (let axis = 0; axis < 3; axis++) {
533
+ assert.isFinite(offset[axis], 'offset');
534
+
535
+ const origin = -offset[axis] * inverse[axis];
536
+
537
+ f32[TURBULENCE_SCALE + axis] = inverse[axis];
538
+ f32[TURBULENCE_ORIGIN + axis] = origin - Math.floor(origin);
539
+ }
540
+ }
541
+
542
+ this.#dirty = true;
543
+ }
544
+
545
+ /**
546
+ * Replace the placeholder with the engine's tile, once.
547
+ */
548
+ #ensure_turbulence_tile() {
549
+ if (this.#turbulence_tiled) {
550
+ return;
551
+ }
552
+
553
+ const levels = fluid_turbulence_tile_data_rgba16();
554
+
555
+ const texture = this.#device.createTexture({
556
+ label: 'GPUSceneWind/turbulence',
557
+ size: Array.from(FLUID_TURBULENCE_TILE_RESOLUTION),
558
+ dimension: '3d',
559
+ format: 'rgba16float',
560
+ mipLevelCount: levels.length,
561
+ usage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST,
562
+ });
563
+
564
+ const size = [0, 0, 0];
565
+
566
+ for (let level = 0; level < levels.length; level++) {
567
+ fluid_turbulence_tile_level_size(size, FLUID_TURBULENCE_TILE_RESOLUTION, level);
568
+
569
+ this.#device.queue.writeTexture(
570
+ { texture, mipLevel: level },
571
+ levels[level],
572
+ { bytesPerRow: 8 * size[0], rowsPerImage: size[1] },
573
+ size
574
+ );
575
+ }
576
+
577
+ this.#turbulence.destroy();
578
+ this.#turbulence = texture;
579
+ this.#turbulence_view = texture.createView();
580
+ this.#turbulence_tiled = true;
581
+ }
582
+
439
583
  /**
440
584
  * Upload the tables that changed since their last upload; once a frame, after the producer
441
585
  * and before any consumer encodes. The tiles' texel origins and the atlas's size are taken here,
@@ -527,13 +671,14 @@ export class GPUSceneWind {
527
671
 
528
672
  /**
529
673
  * Put the field into a dispatch's bindings, under the names `wind_field_add_resources` declares:
530
- * `wind_field` and `wind_field_atlas`; `wind_field_sampler` is the declaration's default.
674
+ * `wind_field`, `wind_field_atlas` and `fluid_turbulence`; the samplers are the declaration's defaults.
531
675
  *
532
676
  * @param {Object} bindings
533
677
  */
534
678
  bind(bindings) {
535
679
  bindings.wind_field = this.#uniform;
536
680
  bindings.wind_field_atlas = this.#atlas.texture;
681
+ bindings.fluid_turbulence = this.#turbulence_view;
537
682
  }
538
683
 
539
684
  /**
@@ -562,5 +707,6 @@ export class GPUSceneWind {
562
707
  this.#atlas.destroy();
563
708
  this.#uniform.destroy();
564
709
  this.#previous_uniform.destroy();
710
+ this.#turbulence.destroy();
565
711
  }
566
712
  }
@@ -18,7 +18,7 @@ export const WIND_LEVEL_ARRAY: WebGPUArray;
18
18
  export const WIND_CASCADE_ARRAY: WebGPUArray;
19
19
  /**
20
20
  * The published wind field as a shader reads it: the uniform `wind_field`
21
- * (GPU_FLUID_CASCADES_PROPOSAL_2026_10_16.md §11). 800 bytes.
21
+ * (GPU_FLUID_CASCADES_PROPOSAL_2026_10_16.md §11). 832 bytes.
22
22
  *
23
23
  * Cascade `c` (finest first, below `cascade_count`) is two rows at index `c`:
24
24
  * - `levels[c]`: its window as a clipmap level (`CLIPMAP_LEVEL_STRUCT`) — the world cell at
@@ -29,10 +29,16 @@ export const WIND_CASCADE_ARRAY: WebGPUArray;
29
29
  *
30
30
  * Rows at and past `cascade_count` are never read.
31
31
  *
32
- * - `far_velocity`: `v_far(t)`, m/s, the far field now: the wind everywhere no cascade holds, and
33
- * what every cascade's deviation decays toward.
32
+ * - `far_velocity`: `u(t)`, m/s, the far field's mean now.
34
33
  * - `inverse_atlas_size`: one over the atlas texture's texels along x, y and z, so a texel coordinate
35
34
  * times it is the normalised one a sample takes.
35
+ * - `turbulence_sigma`, `turbulence_scale`, `turbulence_origin`: the far field's turbulence now, so
36
+ * the far field at a world point `p` is `v_far(t, p) = far_velocity + σ·T(p ⊙ scale + origin)`
37
+ * (`chunk_fluid_turbulence`): `σ` in m/s, 0 for none; `scale` one over the tile's size in the
38
+ * world; `origin` the tile coordinate of the world's origin, the turbulence's offset folded into one
39
+ * tile; `inverse_texel` one over the tile's texel in the world, `8 / L`, from which a read inside a
40
+ * cascade takes the tile's level for the cascade's cell (`fluid_turbulence_lod`). `v_far(t, p)` is the wind everywhere no cascade holds, and what every cascade's deviation
41
+ * decays toward.
36
42
  *
37
43
  * @type {WebGPUStruct}
38
44
  */
@@ -1 +1 @@
1
- {"version":3,"file":"WIND_FIELD_STRUCT.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/wind/WIND_FIELD_STRUCT.js"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,kCAFU,YAAY,CAgBJ;AAElB;;;;GAIG;AACH,+BAFU,WAAW,CAE4E;AAEjG;;;GAGG;AACH,iCAFU,WAAW,CAE6E;AAElG;;;;;;;;;;;;;;;;;;;GAmBG;AACH,gCAFU,YAAY,CAQN;6BAhEa,gCAAgC;4BADjC,+BAA+B"}
1
+ {"version":3,"file":"WIND_FIELD_STRUCT.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/wind/WIND_FIELD_STRUCT.js"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,kCAFU,YAAY,CAgBJ;AAElB;;;;GAIG;AACH,+BAFU,WAAW,CAE4E;AAEjG;;;GAGG;AACH,iCAFU,WAAW,CAE6E;AAElG;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,gCAFU,YAAY,CAYN;6BA1Ea,gCAAgC;4BADjC,+BAA+B"}
@@ -41,7 +41,7 @@ export const WIND_CASCADE_ARRAY = WebGPUArray.from(WIND_CASCADE_STRUCT, WIND_FIE
41
41
 
42
42
  /**
43
43
  * The published wind field as a shader reads it: the uniform `wind_field`
44
- * (GPU_FLUID_CASCADES_PROPOSAL_2026_10_16.md §11). 800 bytes.
44
+ * (GPU_FLUID_CASCADES_PROPOSAL_2026_10_16.md §11). 832 bytes.
45
45
  *
46
46
  * Cascade `c` (finest first, below `cascade_count`) is two rows at index `c`:
47
47
  * - `levels[c]`: its window as a clipmap level (`CLIPMAP_LEVEL_STRUCT`) — the world cell at
@@ -52,10 +52,16 @@ export const WIND_CASCADE_ARRAY = WebGPUArray.from(WIND_CASCADE_STRUCT, WIND_FIE
52
52
  *
53
53
  * Rows at and past `cascade_count` are never read.
54
54
  *
55
- * - `far_velocity`: `v_far(t)`, m/s, the far field now: the wind everywhere no cascade holds, and
56
- * what every cascade's deviation decays toward.
55
+ * - `far_velocity`: `u(t)`, m/s, the far field's mean now.
57
56
  * - `inverse_atlas_size`: one over the atlas texture's texels along x, y and z, so a texel coordinate
58
57
  * times it is the normalised one a sample takes.
58
+ * - `turbulence_sigma`, `turbulence_scale`, `turbulence_origin`: the far field's turbulence now, so
59
+ * the far field at a world point `p` is `v_far(t, p) = far_velocity + σ·T(p ⊙ scale + origin)`
60
+ * (`chunk_fluid_turbulence`): `σ` in m/s, 0 for none; `scale` one over the tile's size in the
61
+ * world; `origin` the tile coordinate of the world's origin, the turbulence's offset folded into one
62
+ * tile; `inverse_texel` one over the tile's texel in the world, `8 / L`, from which a read inside a
63
+ * cascade takes the tile's level for the cascade's cell (`fluid_turbulence_lod`). `v_far(t, p)` is the wind everywhere no cascade holds, and what every cascade's deviation
64
+ * decays toward.
59
65
  *
60
66
  * @type {WebGPUStruct}
61
67
  */
@@ -65,4 +71,8 @@ export const WIND_FIELD_STRUCT = WebGPUStruct.from({
65
71
  far_velocity: vec3f,
66
72
  cascade_count: u32,
67
73
  inverse_atlas_size: vec3f,
74
+ turbulence_sigma: f32,
75
+ turbulence_scale: vec3f,
76
+ turbulence_inverse_texel: f32,
77
+ turbulence_origin: vec3f,
68
78
  }, "WindField");
@@ -1,14 +1,14 @@
1
1
  /**
2
- * Whether the published wind field is uniform: it holds no cascades, so the wind is
3
- * `wind_field.far_velocity` at every point — `GPUSceneWind.cascade_count` is 0, which is every scene
4
- * no producer fills (one without a GPU fluid). Decided by `chunk_wind_field_sample`, whose uniform
2
+ * Whether the published wind field is uniform: it holds no cascades and its far field no turbulence,
3
+ * so the wind is `wind_field.far_velocity` at every point — `GPUSceneWind.is_uniform`, which is every
4
+ * scene no producer fills (one without a GPU fluid). Decided by `chunk_wind_field_sample`, whose uniform
5
5
  * alternative is the far field and nothing else, and by `chunk_participating_media_noise`, whose
6
6
  * uniform alternative is the scroll alone: with no departure from the far field anywhere, the flow
7
7
  * map has nothing to carry.
8
8
  *
9
- * A pass sets it from the field it binds, `scene.wind.cascade_count === 0`, the frame it binds it; a
10
- * pass that also reads the field's history (`chunk_wind_field_sample_previous`) sets it only when
11
- * `scene.wind.previous_cascade_count` is 0 too, since both reads are the one alternative.
9
+ * A pass sets it from the field it binds, `scene.wind.is_uniform`, the frame it binds it; that holds
10
+ * only when the field as the frame before read it was uniform too, so a pass that also reads the
11
+ * history (`chunk_wind_field_sample_previous`) takes the same rule.
12
12
  * `false`, the default, is the field read as it is, cascades or none, so a pass that never sets it
13
13
  * reads the wind exactly as it always did.
14
14
  *
@@ -1,16 +1,16 @@
1
1
  import { ShaderSwitch } from "../shader/compiler/ShaderSwitch.js";
2
2
 
3
3
  /**
4
- * Whether the published wind field is uniform: it holds no cascades, so the wind is
5
- * `wind_field.far_velocity` at every point — `GPUSceneWind.cascade_count` is 0, which is every scene
6
- * no producer fills (one without a GPU fluid). Decided by `chunk_wind_field_sample`, whose uniform
4
+ * Whether the published wind field is uniform: it holds no cascades and its far field no turbulence,
5
+ * so the wind is `wind_field.far_velocity` at every point — `GPUSceneWind.is_uniform`, which is every
6
+ * scene no producer fills (one without a GPU fluid). Decided by `chunk_wind_field_sample`, whose uniform
7
7
  * alternative is the far field and nothing else, and by `chunk_participating_media_noise`, whose
8
8
  * uniform alternative is the scroll alone: with no departure from the far field anywhere, the flow
9
9
  * map has nothing to carry.
10
10
  *
11
- * A pass sets it from the field it binds, `scene.wind.cascade_count === 0`, the frame it binds it; a
12
- * pass that also reads the field's history (`chunk_wind_field_sample_previous`) sets it only when
13
- * `scene.wind.previous_cascade_count` is 0 too, since both reads are the one alternative.
11
+ * A pass sets it from the field it binds, `scene.wind.is_uniform`, the frame it binds it; that holds
12
+ * only when the field as the frame before read it was uniform too, so a pass that also reads the
13
+ * history (`chunk_wind_field_sample_previous`) takes the same rule.
14
14
  * `false`, the default, is the field read as it is, cascades or none, so a pass that never sets it
15
15
  * reads the wind exactly as it always did.
16
16
  *
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Declare the turbulence tile's bindings in a resource group, under the names
3
+ * {@link chunk_fluid_turbulence} reads:
4
+ * - `fluid_turbulence`: the tile, `texture_3d<f32>`, filterable, `rgba16float`, the engine's tile
5
+ * (`fluid_turbulence_tile_data`) as `GPUSceneWind#turbulence` holds it;
6
+ * - `fluid_turbulence_sampler`: {@link FLUID_TURBULENCE_SAMPLER_DESCRIPTOR}, the declaration's default,
7
+ * so a host binds only the texture.
8
+ *
9
+ * @param {import("../shader/resource/ShaderResourceGroupDescriptor.js").ShaderResourceGroupDescriptor} group
10
+ * @returns {import("../shader/resource/ShaderResourceGroupDescriptor.js").ShaderResourceGroupDescriptor} group
11
+ */
12
+ export function fluid_turbulence_add_resources(group: import("../shader/resource/ShaderResourceGroupDescriptor.js").ShaderResourceGroupDescriptor): import("../shader/resource/ShaderResourceGroupDescriptor.js").ShaderResourceGroupDescriptor;
13
+ /**
14
+ * The sampler the far field's turbulence tile is read with: trilinear and repeating on every axis,
15
+ * the tile being one period of an infinite field, and linear between its levels.
16
+ *
17
+ * @type {SamplerDescriptor}
18
+ */
19
+ export const FLUID_TURBULENCE_SAMPLER_DESCRIPTOR: SamplerDescriptor;
20
+ /**
21
+ * `fluid_turbulence_at(q, lod)`: the far field's unit-rms turbulence at tile coordinate `q` (one tile
22
+ * is 1 on each axis, repeating), band-limited to level `lod`: one trilinear tap of `fluid_turbulence`
23
+ * between two of its levels. A caller scales it by `σ` and places `q` from a world point by the far
24
+ * field's offset and length scale.
25
+ *
26
+ * `fluid_turbulence_lod(cell, inverse_texel)`: the level a lattice of cell `cell` reads, the tile's
27
+ * texel being `1 / inverse_texel`: `log2(cell / texel)`, and 0 for a cell no larger than a texel. Level
28
+ * `ℓ` holds the wavelengths of two of its texels and longer (`fluid_turbulence_tile_generate_levels`), so
29
+ * a lattice reads what its cells can hold: nothing aliased into it, and a footprint of about a texel a
30
+ * cell, which is what a tap's cache wants.
31
+ *
32
+ * Bindings as {@link fluid_turbulence_add_resources} declares them.
33
+ *
34
+ * @type {CodeChunk}
35
+ */
36
+ export const chunk_fluid_turbulence: CodeChunk;
37
+ import { SamplerDescriptor } from "../../descriptor/texture/SamplerDescriptor.js";
38
+ import { CodeChunk } from "../shader/compiler/CodeChunk.js";
39
+ //# sourceMappingURL=chunk_fluid_turbulence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk_fluid_turbulence.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/wind/chunk_fluid_turbulence.js"],"names":[],"mappings":"AAkBA;;;;;;;;;;GAUG;AACH,sDAHW,OAAO,qDAAqD,EAAE,6BAA6B,GACzF,OAAO,qDAAqD,EAAE,6BAA6B,CAMvG;AA9BD;;;;;GAKG;AACH,kDAFU,iBAAiB,CASvB;AAmBJ;;;;;;;;;;;;;;;GAeG;AACH,qCAFU,SAAS,CAajB;kCA9DgC,+CAA+C;0BACvD,iCAAiC"}
@@ -0,0 +1,63 @@
1
+ import { SamplerDescriptor } from "../../descriptor/texture/SamplerDescriptor.js";
2
+ import { CodeChunk } from "../shader/compiler/CodeChunk.js";
3
+
4
+ /**
5
+ * The sampler the far field's turbulence tile is read with: trilinear and repeating on every axis,
6
+ * the tile being one period of an infinite field, and linear between its levels.
7
+ *
8
+ * @type {SamplerDescriptor}
9
+ */
10
+ export const FLUID_TURBULENCE_SAMPLER_DESCRIPTOR = Object.freeze(SamplerDescriptor.from({
11
+ magFilter: "linear",
12
+ minFilter: "linear",
13
+ mipmapFilter: "linear",
14
+ addressModeU: "repeat",
15
+ addressModeV: "repeat",
16
+ addressModeW: "repeat",
17
+ }));
18
+
19
+ /**
20
+ * Declare the turbulence tile's bindings in a resource group, under the names
21
+ * {@link chunk_fluid_turbulence} reads:
22
+ * - `fluid_turbulence`: the tile, `texture_3d<f32>`, filterable, `rgba16float`, the engine's tile
23
+ * (`fluid_turbulence_tile_data`) as `GPUSceneWind#turbulence` holds it;
24
+ * - `fluid_turbulence_sampler`: {@link FLUID_TURBULENCE_SAMPLER_DESCRIPTOR}, the declaration's default,
25
+ * so a host binds only the texture.
26
+ *
27
+ * @param {import("../shader/resource/ShaderResourceGroupDescriptor.js").ShaderResourceGroupDescriptor} group
28
+ * @returns {import("../shader/resource/ShaderResourceGroupDescriptor.js").ShaderResourceGroupDescriptor} group
29
+ */
30
+ export function fluid_turbulence_add_resources(group) {
31
+ return group
32
+ .addTexture("fluid_turbulence", "float", "3d")
33
+ .addSampler("fluid_turbulence_sampler", "filtering", FLUID_TURBULENCE_SAMPLER_DESCRIPTOR);
34
+ }
35
+
36
+ /**
37
+ * `fluid_turbulence_at(q, lod)`: the far field's unit-rms turbulence at tile coordinate `q` (one tile
38
+ * is 1 on each axis, repeating), band-limited to level `lod`: one trilinear tap of `fluid_turbulence`
39
+ * between two of its levels. A caller scales it by `σ` and places `q` from a world point by the far
40
+ * field's offset and length scale.
41
+ *
42
+ * `fluid_turbulence_lod(cell, inverse_texel)`: the level a lattice of cell `cell` reads, the tile's
43
+ * texel being `1 / inverse_texel`: `log2(cell / texel)`, and 0 for a cell no larger than a texel. Level
44
+ * `ℓ` holds the wavelengths of two of its texels and longer (`fluid_turbulence_tile_generate_levels`), so
45
+ * a lattice reads what its cells can hold: nothing aliased into it, and a footprint of about a texel a
46
+ * cell, which is what a tap's cache wants.
47
+ *
48
+ * Bindings as {@link fluid_turbulence_add_resources} declares them.
49
+ *
50
+ * @type {CodeChunk}
51
+ */
52
+ export const chunk_fluid_turbulence = CodeChunk.from(
53
+ //language=WGSL
54
+ `
55
+ fn fluid_turbulence_at(q: vec3<f32>, lod: f32) -> vec3<f32> {
56
+ return textureSampleLevel(fluid_turbulence, fluid_turbulence_sampler, q, lod).xyz;
57
+ }
58
+
59
+ fn fluid_turbulence_lod(cell: f32, inverse_texel: f32) -> f32 {
60
+ return max(0.0, log2(cell * inverse_texel));
61
+ }
62
+ `
63
+ );
@@ -3,21 +3,24 @@
3
3
  * `chunk_wind_field_sample` links for a field as it is ({@link WIND_FIELD_UNIFORM} `false`), any
4
4
  * number of cascades, none included.
5
5
  *
6
- * Reads `wind_field` ({@link WIND_FIELD_STRUCT}), `wind_field_atlas` and `wind_field_sampler`, as
7
- * {@link wind_field_add_resources} declares them. `wind_field_sample_in(field, position_ws)` is the
6
+ * Reads `wind_field` ({@link WIND_FIELD_STRUCT}), `wind_field_atlas`, `wind_field_sampler` and the
7
+ * turbulence tile, as {@link wind_field_add_resources} declares them. `wind_field_sample_in(field, position_ws)` is the
8
8
  * same read through any table over that atlas, the previous frame's for one.
9
9
  *
10
10
  * **The read:**
11
11
  * - the cascades' windows are walked finest first, each by `clipmap_level_select`, and the first holding
12
12
  * the point answers, with how far into its edge band of {@link WIND_FIELD_BAND_WIDTH} cells the point is;
13
- * - a cascade's read is the atmosphere identity, `v_far(t) + tap · k_c`: one trilinear tap of its tile,
14
- * which holds `v − v_far(t_s,c)` at cell centres, times its decay;
13
+ * - the far field at the point, `v_far(t, p)`: its mean, plus its turbulence's one tap when it has any
14
+ * (`wind_field_far`), band-limited inside a cascade to the cascade's cell, as the cascade's own far
15
+ * field is, and whole beyond every cascade;
16
+ * - a cascade's read is the atmosphere identity, `v_far(t, p) + tap · k_c`: one trilinear tap of its
17
+ * tile, which holds `v − v_far(t_s,c)` at cell centres, times its decay;
15
18
  * - in the band, a second read blends in linearly, all of it on the window's face: the parent's
16
- * identity read, or `v_far(t)` for the coarsest; deeper than the band, one read;
17
- * - outside every cascade, `v_far(t)`.
19
+ * identity read, or `v_far(t, p)` for the coarsest; deeper than the band, one read;
20
+ * - outside every cascade, `v_far(t, p)`.
18
21
  *
19
22
  * The blend and the decay are taken now, at the sample, so a cascade that last stepped ticks ago reads
20
- * the far field's current gust and drag. Air at the far field publishes a deviation of 0 and reads
23
+ * the far field's current mean, turbulence and drag. Air at the far field publishes a deviation of 0 and reads
21
24
  * back `v_far(t)` exactly, on every cascade, in every band, at every instant: the blend is written as
22
25
  * `inner + (outer − inner)·w`, which leaves equal reads as they are.
23
26
  *
@@ -1 +1 @@
1
- {"version":3,"file":"chunk_wind_field_sample_cascades.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/wind/chunk_wind_field_sample_cascades.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,+CAFU,SAAS,CAgEjB;0BAxGwB,iCAAiC"}
1
+ {"version":3,"file":"chunk_wind_field_sample_cascades.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/wind/chunk_wind_field_sample_cascades.js"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,+CAFU,SAAS,CAmFjB;0BA/HwB,iCAAiC"}
@@ -1,6 +1,7 @@
1
1
  import { chunk_clipmap_select_finest } from "../shader/chunk/clipmap/chunk_clipmap_select_finest.js";
2
2
  import { CodeChunk } from "../shader/compiler/CodeChunk.js";
3
3
  import { WIND_FIELD_BAND_WIDTH, WIND_FIELD_CASCADE_LIMIT } from "./WIND_FIELD.js";
4
+ import { chunk_fluid_turbulence } from "./chunk_fluid_turbulence.js";
4
5
  import { WIND_FIELD_STRUCT } from "./WIND_FIELD_STRUCT.js";
5
6
 
6
7
  /**
@@ -8,21 +9,24 @@ import { WIND_FIELD_STRUCT } from "./WIND_FIELD_STRUCT.js";
8
9
  * `chunk_wind_field_sample` links for a field as it is ({@link WIND_FIELD_UNIFORM} `false`), any
9
10
  * number of cascades, none included.
10
11
  *
11
- * Reads `wind_field` ({@link WIND_FIELD_STRUCT}), `wind_field_atlas` and `wind_field_sampler`, as
12
- * {@link wind_field_add_resources} declares them. `wind_field_sample_in(field, position_ws)` is the
12
+ * Reads `wind_field` ({@link WIND_FIELD_STRUCT}), `wind_field_atlas`, `wind_field_sampler` and the
13
+ * turbulence tile, as {@link wind_field_add_resources} declares them. `wind_field_sample_in(field, position_ws)` is the
13
14
  * same read through any table over that atlas, the previous frame's for one.
14
15
  *
15
16
  * **The read:**
16
17
  * - the cascades' windows are walked finest first, each by `clipmap_level_select`, and the first holding
17
18
  * the point answers, with how far into its edge band of {@link WIND_FIELD_BAND_WIDTH} cells the point is;
18
- * - a cascade's read is the atmosphere identity, `v_far(t) + tap · k_c`: one trilinear tap of its tile,
19
- * which holds `v − v_far(t_s,c)` at cell centres, times its decay;
19
+ * - the far field at the point, `v_far(t, p)`: its mean, plus its turbulence's one tap when it has any
20
+ * (`wind_field_far`), band-limited inside a cascade to the cascade's cell, as the cascade's own far
21
+ * field is, and whole beyond every cascade;
22
+ * - a cascade's read is the atmosphere identity, `v_far(t, p) + tap · k_c`: one trilinear tap of its
23
+ * tile, which holds `v − v_far(t_s,c)` at cell centres, times its decay;
20
24
  * - in the band, a second read blends in linearly, all of it on the window's face: the parent's
21
- * identity read, or `v_far(t)` for the coarsest; deeper than the band, one read;
22
- * - outside every cascade, `v_far(t)`.
25
+ * identity read, or `v_far(t, p)` for the coarsest; deeper than the band, one read;
26
+ * - outside every cascade, `v_far(t, p)`.
23
27
  *
24
28
  * The blend and the decay are taken now, at the sample, so a cascade that last stepped ticks ago reads
25
- * the far field's current gust and drag. Air at the far field publishes a deviation of 0 and reads
29
+ * the far field's current mean, turbulence and drag. Air at the far field publishes a deviation of 0 and reads
26
30
  * back `v_far(t)` exactly, on every cascade, in every band, at every instant: the blend is written as
27
31
  * `inner + (outer − inner)·w`, which leaves equal reads as they are.
28
32
  *
@@ -46,10 +50,26 @@ export const chunk_wind_field_sample_cascades = CodeChunk.from(
46
50
  `
47
51
  const WIND_FIELD_BAND_WIDTH: f32 = ${WIND_FIELD_BAND_WIDTH}.0;
48
52
 
49
- // cascade c's identity read at a world point its window holds
53
+ // the far field at a world point, band-limited to what a lattice of that cell holds: its mean, and its
54
+ // turbulence there when it has any; a cell of 0 reads the tile whole
55
+ fn wind_field_far(field: ptr<uniform, ${WIND_FIELD_STRUCT.wgsl_ref}>, position_ws: vec3<f32>, cell: f32) -> vec3<f32> {
56
+ let sigma = (*field).turbulence_sigma;
57
+
58
+ if (sigma == 0.0) {
59
+ return (*field).far_velocity;
60
+ }
61
+
62
+ let lod = fluid_turbulence_lod(cell, (*field).turbulence_inverse_texel);
63
+
64
+ return (*field).far_velocity + sigma * fluid_turbulence_at(position_ws * (*field).turbulence_scale + (*field).turbulence_origin, lod);
65
+ }
66
+
67
+ // cascade c's identity read at a world point its window holds: its far field at its own level, which is
68
+ // what its tile is a deviation from
50
69
  fn wind_field_cascade_read(field: ptr<uniform, ${WIND_FIELD_STRUCT.wgsl_ref}>, c: u32, position_ws: vec3<f32>) -> vec3<f32> {
51
70
  let level = (*field).levels[c];
52
71
  let cascade = (*field).cascades[c];
72
+ let far = wind_field_far(field, position_ws, level.cell_size);
53
73
 
54
74
  // window-local position in the cascade's cells, which is a texel offset from the tile's content
55
75
  let local = position_ws / level.cell_size - vec3<f32>(level.corner);
@@ -57,7 +77,7 @@ fn wind_field_cascade_read(field: ptr<uniform, ${WIND_FIELD_STRUCT.wgsl_ref}>, c
57
77
 
58
78
  let deviation = textureSampleLevel(wind_field_atlas, wind_field_sampler, uvw, 0.0).xyz;
59
79
 
60
- return (*field).far_velocity + deviation * cascade.decay;
80
+ return far + deviation * cascade.decay;
61
81
  }
62
82
 
63
83
  fn wind_field_sample_in(field: ptr<uniform, ${WIND_FIELD_STRUCT.wgsl_ref}>, position_ws: vec3<f32>) -> vec3<f32> {
@@ -75,7 +95,7 @@ fn wind_field_sample_in(field: ptr<uniform, ${WIND_FIELD_STRUCT.wgsl_ref}>, posi
75
95
  }
76
96
 
77
97
  if (selection.level == CLIPMAP_LEVEL_NONE) {
78
- return (*field).far_velocity;
98
+ return wind_field_far(field, position_ws, 0.0);
79
99
  }
80
100
 
81
101
  let inner = wind_field_cascade_read(field, selection.level, position_ws);
@@ -86,10 +106,12 @@ fn wind_field_sample_in(field: ptr<uniform, ${WIND_FIELD_STRUCT.wgsl_ref}>, posi
86
106
 
87
107
  let parent = selection.level + 1u;
88
108
 
89
- var outer = (*field).far_velocity;
109
+ var outer: vec3<f32>;
90
110
 
91
111
  if (parent < count) {
92
112
  outer = wind_field_cascade_read(field, parent, position_ws);
113
+ } else {
114
+ outer = wind_field_far(field, position_ws, 0.0);
93
115
  }
94
116
 
95
117
  // mix's form, written so that equal reads blend to themselves exactly
@@ -102,5 +124,6 @@ fn wind_field_sample(position_ws: vec3<f32>) -> vec3<f32> {
102
124
  `, [
103
125
  WIND_FIELD_STRUCT.declaration_chunk,
104
126
  chunk_clipmap_select_finest,
127
+ chunk_fluid_turbulence,
105
128
  ]
106
129
  );
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * `wind_field_sample(position_ws)` in a uniform field ({@link WIND_FIELD_UNIFORM} `true`): one with no
3
- * cascades, where the wind is `v_far(t)` at every point, which is what the cascaded read returns there,
4
- * exactly, having found no window that holds the point.
3
+ * cascades and no turbulence, where the wind is `v_far(t)` at every point, which is what the cascaded
4
+ * read returns there, exactly, having found no window that holds the point.
5
5
  *
6
6
  * Reads `wind_field.far_velocity` and nothing else; the atlas and its sampler stay bound and unread.
7
7
  * `wind_field_sample_in(field, position_ws)` is the same read of any table with no cascades.
@@ -3,8 +3,8 @@ import { WIND_FIELD_STRUCT } from "./WIND_FIELD_STRUCT.js";
3
3
 
4
4
  /**
5
5
  * `wind_field_sample(position_ws)` in a uniform field ({@link WIND_FIELD_UNIFORM} `true`): one with no
6
- * cascades, where the wind is `v_far(t)` at every point, which is what the cascaded read returns there,
7
- * exactly, having found no window that holds the point.
6
+ * cascades and no turbulence, where the wind is `v_far(t)` at every point, which is what the cascaded
7
+ * read returns there, exactly, having found no window that holds the point.
8
8
  *
9
9
  * Reads `wind_field.far_velocity` and nothing else; the atlas and its sampler stay bound and unread.
10
10
  * `wind_field_sample_in(field, position_ws)` is the same read of any table with no cascades.