@woosh/meep-engine 3.74.0 → 3.76.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 (363) hide show
  1. package/CHANGELOG.md +20 -19
  2. package/package.json +1 -1
  3. package/src/core/geom/2d/hilbert/v2_hilbert_encode.d.ts +11 -0
  4. package/src/core/geom/2d/hilbert/v2_hilbert_encode.d.ts.map +1 -0
  5. package/src/core/geom/2d/hilbert/v2_hilbert_encode.js +46 -0
  6. package/src/engine/asset/GameAssetType.d.ts +1 -0
  7. package/src/engine/asset/GameAssetType.js +5 -1
  8. package/src/engine/asset/loaders/GroomAssetLoader.d.ts +33 -0
  9. package/src/engine/asset/loaders/GroomAssetLoader.d.ts.map +1 -0
  10. package/src/engine/asset/loaders/GroomAssetLoader.js +99 -0
  11. package/src/engine/graphics/ecs/hair/Hair.d.ts +47 -0
  12. package/src/engine/graphics/ecs/hair/Hair.d.ts.map +1 -0
  13. package/src/engine/graphics/ecs/hair/Hair.js +61 -0
  14. package/src/engine/graphics/hair/Groom.d.ts +130 -0
  15. package/src/engine/graphics/hair/Groom.d.ts.map +1 -0
  16. package/src/engine/graphics/hair/Groom.js +193 -0
  17. package/src/engine/graphics/hair/GroomSerializationAdapter.d.ts +24 -0
  18. package/src/engine/graphics/hair/GroomSerializationAdapter.d.ts.map +1 -0
  19. package/src/engine/graphics/hair/GroomSerializationAdapter.js +77 -0
  20. package/src/engine/graphics/hair/groom_build_group.d.ts +85 -0
  21. package/src/engine/graphics/hair/groom_build_group.d.ts.map +1 -0
  22. package/src/engine/graphics/hair/groom_build_group.js +487 -0
  23. package/src/engine/graphics/hair/groom_generate_scalp.d.ts +29 -0
  24. package/src/engine/graphics/hair/groom_generate_scalp.d.ts.map +1 -0
  25. package/src/engine/graphics/hair/groom_generate_scalp.js +184 -0
  26. package/src/engine/graphics/hair/groom_rank_order.d.ts +15 -0
  27. package/src/engine/graphics/hair/groom_rank_order.d.ts.map +1 -0
  28. package/src/engine/graphics/hair/groom_rank_order.js +53 -0
  29. package/src/engine/graphics/hair/groom_root_spacing.d.ts +12 -0
  30. package/src/engine/graphics/hair/groom_root_spacing.d.ts.map +1 -0
  31. package/src/engine/graphics/hair/groom_root_spacing.js +120 -0
  32. package/src/engine/graphics/render/frame_graph/FrameGraph.d.ts +6 -0
  33. package/src/engine/graphics/render/frame_graph/FrameGraph.d.ts.map +1 -1
  34. package/src/engine/graphics/render/frame_graph/FrameGraph.js +9 -0
  35. package/src/engine/graphics3/GPUAcousticSystem.d.ts +29 -32
  36. package/src/engine/graphics3/GPUAcousticSystem.d.ts.map +1 -1
  37. package/src/engine/graphics3/GPUAcousticSystem.js +87 -162
  38. package/src/engine/graphics3/HairSystem.d.ts +102 -0
  39. package/src/engine/graphics3/HairSystem.d.ts.map +1 -0
  40. package/src/engine/graphics3/HairSystem.js +456 -0
  41. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  42. package/src/engine/sound/ecs/audio/AudioEmitterSystem.d.ts.map +1 -1
  43. package/src/engine/sound/ecs/audio/AudioEmitterSystem.js +35 -17
  44. package/src/engine/sound/ecs/audio/LiveEmitterSet.d.ts.map +1 -1
  45. package/src/engine/sound/ecs/audio/LiveEmitterSet.js +2 -3
  46. package/src/engine/sound/simulation/AcousticSimulator.d.ts +7 -0
  47. package/src/engine/sound/simulation/AcousticSimulator.d.ts.map +1 -1
  48. package/src/engine/sound/simulation/AcousticSimulator.js +27 -0
  49. package/src/engine/sound/simulation/README.md +121 -107
  50. package/src/engine/sound/sopra/README.md +8 -3
  51. package/src/engine/sound/sopra/definition/effect/AcousticReverbEffect.d.ts +2 -2
  52. package/src/engine/sound/sopra/definition/effect/AcousticReverbEffect.d.ts.map +1 -1
  53. package/src/engine/sound/sopra/definition/effect/AcousticReverbEffect.js +4 -3
  54. package/src/engine/sound/sopra/runtime/AcousticReverbConvolution.d.ts +118 -0
  55. package/src/engine/sound/sopra/runtime/AcousticReverbConvolution.d.ts.map +1 -0
  56. package/src/engine/sound/sopra/runtime/AcousticReverbConvolution.js +472 -0
  57. package/src/engine/sound/sopra/runtime/AcousticReverbLines.d.ts +166 -0
  58. package/src/engine/sound/sopra/runtime/AcousticReverbLines.d.ts.map +1 -0
  59. package/src/engine/sound/sopra/runtime/AcousticReverbLines.js +447 -0
  60. package/src/engine/sound/sopra/runtime/AcousticReverbNetwork.d.ts +69 -113
  61. package/src/engine/sound/sopra/runtime/AcousticReverbNetwork.d.ts.map +1 -1
  62. package/src/engine/sound/sopra/runtime/AcousticReverbNetwork.js +143 -491
  63. package/src/engine/sound/sopra/runtime/AcousticSpeakers.d.ts +102 -0
  64. package/src/engine/sound/sopra/runtime/AcousticSpeakers.d.ts.map +1 -0
  65. package/src/engine/sound/sopra/runtime/AcousticSpeakers.js +232 -0
  66. package/src/engine/sound/sopra/runtime/BusGraph.d.ts +17 -3
  67. package/src/engine/sound/sopra/runtime/BusGraph.d.ts.map +1 -1
  68. package/src/engine/sound/sopra/runtime/BusGraph.js +55 -5
  69. package/src/engine/sound/sopra/runtime/EventInstance.d.ts +8 -6
  70. package/src/engine/sound/sopra/runtime/EventInstance.d.ts.map +1 -1
  71. package/src/engine/sound/sopra/runtime/EventInstance.js +113 -105
  72. package/src/engine/sound/sopra/runtime/acoustic_reverb_decay.d.ts +13 -0
  73. package/src/engine/sound/sopra/runtime/acoustic_reverb_decay.d.ts.map +1 -0
  74. package/src/engine/sound/sopra/runtime/acoustic_reverb_decay.js +15 -0
  75. package/src/generation/grid/generation/discrete/GridTaskConnectRooms.d.ts.map +1 -1
  76. package/src/generation/grid/generation/discrete/GridTaskConnectRooms.js +4 -6
  77. package/src/shade/assets/textures/hair_scattering.bin +0 -0
  78. package/src/shade/device/pipeline/PipelineEnquiry.d.ts +11 -0
  79. package/src/shade/device/pipeline/PipelineEnquiry.d.ts.map +1 -1
  80. package/src/shade/device/pipeline/PipelineEnquiry.js +13 -0
  81. package/src/shade/playground/hair/index.html +50 -0
  82. package/src/shade/playground/hair/main.d.ts +2 -0
  83. package/src/shade/playground/hair/main.d.ts.map +1 -0
  84. package/src/shade/playground/hair/main.js +274 -0
  85. package/src/shade/playground/screen_probes/README.md +54 -0
  86. package/src/shade/playground/screen_probes/index.html +271 -0
  87. package/src/shade/playground/screen_probes/main.d.ts +8 -0
  88. package/src/shade/playground/screen_probes/main.d.ts.map +1 -0
  89. package/src/shade/playground/screen_probes/main.js +527 -0
  90. package/src/shade/playground/skinned_blas_refit/diff_traced_against_rasterized.d.ts.map +1 -1
  91. package/src/shade/playground/skinned_blas_refit/diff_traced_against_rasterized.js +4 -5
  92. package/src/shade/playground/skinned_blas_refit/main.d.ts.map +1 -1
  93. package/src/shade/playground/skinned_blas_refit/main.js +6 -12
  94. package/src/shade/playground/skinned_mesh_soup/main.d.ts.map +1 -1
  95. package/src/shade/playground/skinned_mesh_soup/main.js +1 -2
  96. package/src/shade/playground/vgeo_scene/README.md +12 -2
  97. package/src/shade/playground/vgeo_scene/main.js +1 -1
  98. package/src/shade/playground/volumetrics_froxel/README.md +191 -191
  99. package/src/shade/playground/volumetrics_froxel/measure.d.ts +3 -3
  100. package/src/shade/playground/volumetrics_froxel/measure.d.ts.map +1 -1
  101. package/src/shade/playground/volumetrics_froxel/measure.js +11 -13
  102. package/src/shade/playground/vsm/main.d.ts.map +1 -1
  103. package/src/shade/playground/vsm/main.js +5 -6
  104. package/src/shade/renderer/Renderer.d.ts.map +1 -1
  105. package/src/shade/renderer/Renderer.js +85 -16
  106. package/src/shade/renderer/STATIC_GRAPHICS_ENGINE_ASSETS.d.ts +6 -0
  107. package/src/shade/renderer/STATIC_GRAPHICS_ENGINE_ASSETS.d.ts.map +1 -1
  108. package/src/shade/renderer/STATIC_GRAPHICS_ENGINE_ASSETS.js +10 -0
  109. package/src/shade/renderer/acoustics/ACOUSTIC_LISTENER_RESOURCES.d.ts +28 -0
  110. package/src/shade/renderer/acoustics/ACOUSTIC_LISTENER_RESOURCES.d.ts.map +1 -0
  111. package/src/shade/renderer/acoustics/ACOUSTIC_LISTENER_RESOURCES.js +42 -0
  112. package/src/shade/renderer/acoustics/ACOUSTIC_PROBE_DATABASE_SPEC.d.ts +58 -0
  113. package/src/shade/renderer/acoustics/ACOUSTIC_PROBE_DATABASE_SPEC.d.ts.map +1 -0
  114. package/src/shade/renderer/acoustics/ACOUSTIC_PROBE_DATABASE_SPEC.js +108 -0
  115. package/src/shade/renderer/acoustics/GPUAcousticLattice.d.ts +1 -1
  116. package/src/shade/renderer/acoustics/GPUAcousticProbes.d.ts +161 -0
  117. package/src/shade/renderer/acoustics/GPUAcousticProbes.d.ts.map +1 -0
  118. package/src/shade/renderer/acoustics/GPUAcousticProbes.js +760 -0
  119. package/src/shade/renderer/acoustics/GPUAcoustics.d.ts +1 -1
  120. package/src/shade/renderer/acoustics/acoustic_listener_order.d.ts +12 -0
  121. package/src/shade/renderer/acoustics/acoustic_listener_order.d.ts.map +1 -0
  122. package/src/shade/renderer/acoustics/acoustic_listener_order.js +56 -0
  123. package/src/shade/renderer/acoustics/chunk_acoustic_direct.d.ts.map +1 -1
  124. package/src/shade/renderer/acoustics/chunk_acoustic_direct.js +5 -0
  125. package/src/shade/renderer/acoustics/chunk_acoustic_direct_cone.d.ts +57 -0
  126. package/src/shade/renderer/acoustics/chunk_acoustic_direct_cone.d.ts.map +1 -0
  127. package/src/shade/renderer/acoustics/chunk_acoustic_direct_cone.js +314 -0
  128. package/src/shade/renderer/acoustics/chunk_acoustic_finite.d.ts +15 -0
  129. package/src/shade/renderer/acoustics/chunk_acoustic_finite.d.ts.map +1 -0
  130. package/src/shade/renderer/acoustics/chunk_acoustic_finite.js +21 -0
  131. package/src/shade/renderer/acoustics/chunk_acoustic_gather.js +1 -1
  132. package/src/shade/renderer/acoustics/chunk_acoustic_lean.d.ts +27 -0
  133. package/src/shade/renderer/acoustics/chunk_acoustic_lean.d.ts.map +1 -0
  134. package/src/shade/renderer/acoustics/chunk_acoustic_lean.js +42 -0
  135. package/src/shade/renderer/acoustics/chunk_acoustic_listener.d.ts +80 -0
  136. package/src/shade/renderer/acoustics/chunk_acoustic_listener.d.ts.map +1 -0
  137. package/src/shade/renderer/acoustics/chunk_acoustic_listener.js +274 -0
  138. package/src/shade/renderer/acoustics/chunk_acoustic_partials.d.ts +2 -2
  139. package/src/shade/renderer/acoustics/chunk_acoustic_partials.js +2 -2
  140. package/src/shade/renderer/acoustics/chunk_acoustic_phonon.d.ts +7 -0
  141. package/src/shade/renderer/acoustics/chunk_acoustic_phonon.d.ts.map +1 -1
  142. package/src/shade/renderer/acoustics/chunk_acoustic_phonon.js +24 -1
  143. package/src/shade/renderer/acoustics/chunk_acoustic_resample.js +1 -1
  144. package/src/shade/renderer/acoustics/chunk_acoustic_reservoir.js +1 -1
  145. package/src/shade/renderer/acoustics/chunk_acoustic_through.d.ts +43 -0
  146. package/src/shade/renderer/acoustics/chunk_acoustic_through.d.ts.map +1 -0
  147. package/src/shade/renderer/acoustics/chunk_acoustic_through.js +153 -0
  148. package/src/shade/renderer/acoustics/chunk_acoustic_trace.d.ts +3 -1
  149. package/src/shade/renderer/acoustics/chunk_acoustic_trace.d.ts.map +1 -1
  150. package/src/shade/renderer/acoustics/chunk_acoustic_trace.js +10 -1
  151. package/src/shade/renderer/acoustics/shader_acoustic_combine.d.ts +7 -3
  152. package/src/shade/renderer/acoustics/shader_acoustic_combine.d.ts.map +1 -1
  153. package/src/shade/renderer/acoustics/shader_acoustic_combine.js +22 -6
  154. package/src/shade/renderer/acoustics/shader_acoustic_coupling.d.ts +14 -0
  155. package/src/shade/renderer/acoustics/shader_acoustic_coupling.d.ts.map +1 -0
  156. package/src/shade/renderer/acoustics/shader_acoustic_coupling.js +102 -0
  157. package/src/shade/renderer/acoustics/shader_acoustic_listener.d.ts +12 -0
  158. package/src/shade/renderer/acoustics/shader_acoustic_listener.d.ts.map +1 -0
  159. package/src/shade/renderer/acoustics/shader_acoustic_listener.js +80 -0
  160. package/src/shade/renderer/acoustics/shader_acoustic_receive.d.ts.map +1 -1
  161. package/src/shade/renderer/acoustics/shader_acoustic_receive.js +27 -6
  162. package/src/shade/renderer/acoustics/shader_acoustic_room.d.ts +11 -0
  163. package/src/shade/renderer/acoustics/shader_acoustic_room.d.ts.map +1 -0
  164. package/src/shade/renderer/acoustics/shader_acoustic_room.js +111 -0
  165. package/src/shade/renderer/acoustics/shader_acoustic_source.d.ts +18 -0
  166. package/src/shade/renderer/acoustics/shader_acoustic_source.d.ts.map +1 -0
  167. package/src/shade/renderer/acoustics/shader_acoustic_source.js +130 -0
  168. package/src/shade/renderer/deferred/chunk_read_gBuffer_material.d.ts.map +1 -1
  169. package/src/shade/renderer/deferred/chunk_read_gBuffer_material.js +3 -1
  170. package/src/shade/renderer/deferred/chunk_shade_direct_lights.d.ts +23 -0
  171. package/src/shade/renderer/deferred/chunk_shade_direct_lights.d.ts.map +1 -0
  172. package/src/shade/renderer/deferred/chunk_shade_direct_lights.js +111 -0
  173. package/src/shade/renderer/deferred/chunk_shade_directional_lights.d.ts +17 -6
  174. package/src/shade/renderer/deferred/chunk_shade_directional_lights.d.ts.map +1 -1
  175. package/src/shade/renderer/deferred/chunk_shade_directional_lights.js +26 -21
  176. package/src/shade/renderer/deferred/chunk_shade_standard_material_direct.d.ts +12 -22
  177. package/src/shade/renderer/deferred/chunk_shade_standard_material_direct.d.ts.map +1 -1
  178. package/src/shade/renderer/deferred/chunk_shade_standard_material_direct.js +20 -100
  179. package/src/shade/renderer/deferred/chunk_shade_standard_material_direct_restir.d.ts.map +1 -1
  180. package/src/shade/renderer/deferred/chunk_shade_standard_material_direct_restir.js +6 -4
  181. package/src/shade/renderer/deferred/chunk_standard_material_direct_light_lobe.d.ts +15 -0
  182. package/src/shade/renderer/deferred/chunk_standard_material_direct_light_lobe.d.ts.map +1 -0
  183. package/src/shade/renderer/deferred/chunk_standard_material_direct_light_lobe.js +47 -0
  184. package/src/shade/renderer/extension/ViewLighting.d.ts +101 -0
  185. package/src/shade/renderer/extension/ViewLighting.d.ts.map +1 -0
  186. package/src/shade/renderer/extension/ViewLighting.js +168 -0
  187. package/src/shade/renderer/fluid/GPUFluidCascade.d.ts +3 -3
  188. package/src/shade/renderer/fluid/GPUFluidCascadeStack.d.ts +1 -1
  189. package/src/shade/renderer/fluid/forcing/GPUFluidForcing.d.ts +7 -7
  190. package/src/shade/renderer/fluid/pressure/GPUFluidPressureSolve.d.ts +1 -1
  191. package/src/shade/renderer/fluid/query/GPUFluidQueries.d.ts +1 -1
  192. package/src/shade/renderer/geometry/virtual/build/level/VGeoFrontier.d.ts +2 -2
  193. package/src/shade/renderer/geometry/virtual/build/level/VGeoFrontier.js +2 -2
  194. package/src/shade/renderer/geometry/virtual/build/level/VGeoLevelOptions.d.ts +5 -2
  195. package/src/shade/renderer/geometry/virtual/build/level/VGeoLevelOptions.d.ts.map +1 -1
  196. package/src/shade/renderer/geometry/virtual/build/level/VGeoLevelOptions.js +5 -2
  197. package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_group_step.d.ts +9 -2
  198. package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_group_step.d.ts.map +1 -1
  199. package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_group_step.js +48 -12
  200. package/src/shade/renderer/geometry/virtual/format/read/VGeoContainerReader.d.ts +0 -22
  201. package/src/shade/renderer/geometry/virtual/format/read/VGeoContainerReader.d.ts.map +1 -1
  202. package/src/shade/renderer/geometry/virtual/format/read/VGeoContainerReader.js +0 -42
  203. package/src/shade/renderer/geometry/virtual/format/read/VGeoReadOptions.d.ts +2 -18
  204. package/src/shade/renderer/geometry/virtual/format/read/VGeoReadOptions.d.ts.map +1 -1
  205. package/src/shade/renderer/geometry/virtual/format/read/VGeoReadOptions.js +2 -19
  206. package/src/shade/renderer/geometry/virtual/format/read/vgeo_page_worker_serve.d.ts.map +1 -1
  207. package/src/shade/renderer/geometry/virtual/format/read/vgeo_page_worker_serve.js +0 -1
  208. package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.d.ts +5 -4
  209. package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.d.ts.map +1 -1
  210. package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.js +3 -1
  211. package/src/shade/renderer/geometry/virtual/runtime/VGeoFeedbackLoop.d.ts.map +1 -1
  212. package/src/shade/renderer/geometry/virtual/runtime/VGeoFeedbackLoop.js +3 -1
  213. package/src/shade/renderer/geometry/virtual/runtime/VGeoPageFetcher.d.ts.map +1 -1
  214. package/src/shade/renderer/geometry/virtual/runtime/VGeoPageFetcher.js +0 -1
  215. package/src/shade/renderer/geometry/virtual/runtime/VGeoViewCut.d.ts +60 -14
  216. package/src/shade/renderer/geometry/virtual/runtime/VGeoViewCut.d.ts.map +1 -1
  217. package/src/shade/renderer/geometry/virtual/runtime/VGeoViewCut.js +75 -39
  218. package/src/shade/renderer/global_illumination/brick4/gpu/draw/shader_brick4_indirect_lighting.d.ts.map +1 -1
  219. package/src/shade/renderer/global_illumination/brick4/gpu/draw/shader_brick4_indirect_lighting.js +3 -1
  220. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts +1 -1
  221. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.d.ts +0 -9
  222. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.d.ts.map +1 -1
  223. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.js +45 -17
  224. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts +7 -3
  225. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts.map +1 -1
  226. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.js +43 -7
  227. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_indirect_lighting.d.ts.map +1 -1
  228. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_indirect_lighting.js +3 -1
  229. package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.d.ts +15 -7
  230. package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.d.ts.map +1 -1
  231. package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.js +40 -9
  232. package/src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.d.ts +23 -0
  233. package/src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.d.ts.map +1 -1
  234. package/src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.js +26 -0
  235. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeDebugView.d.ts +1 -0
  236. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeDebugView.js +6 -0
  237. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.d.ts +13 -1
  238. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.d.ts.map +1 -1
  239. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.js +23 -1
  240. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe.d.ts.map +1 -1
  241. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe.js +2 -0
  242. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_rough_specular.d.ts +29 -0
  243. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_rough_specular.d.ts.map +1 -0
  244. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_rough_specular.js +102 -0
  245. package/src/shade/renderer/global_illumination/screen_probe/graph_screen_probe_debug_view.d.ts +8 -1
  246. package/src/shade/renderer/global_illumination/screen_probe/graph_screen_probe_debug_view.d.ts.map +1 -1
  247. package/src/shade/renderer/global_illumination/screen_probe/graph_screen_probe_debug_view.js +27 -1
  248. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.d.ts +4 -1
  249. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.d.ts.map +1 -1
  250. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.js +4 -1
  251. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_indirect_lighting.d.ts +11 -5
  252. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_indirect_lighting.d.ts.map +1 -1
  253. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_indirect_lighting.js +28 -10
  254. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_resolve.d.ts +36 -2
  255. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_resolve.d.ts.map +1 -1
  256. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_resolve.js +149 -4
  257. package/src/shade/renderer/global_illumination/shader_resolve_indirect_lighting.d.ts.map +1 -1
  258. package/src/shade/renderer/global_illumination/shader_resolve_indirect_lighting.js +3 -1
  259. package/src/shade/renderer/hair/GPUHairSystem.d.ts +159 -0
  260. package/src/shade/renderer/hair/GPUHairSystem.d.ts.map +1 -0
  261. package/src/shade/renderer/hair/GPUHairSystem.js +1132 -0
  262. package/src/shade/renderer/hair/HAIR.d.ts +102 -0
  263. package/src/shade/renderer/hair/HAIR.d.ts.map +1 -0
  264. package/src/shade/renderer/hair/HAIR.js +115 -0
  265. package/src/shade/renderer/hair/HAIR_DATABASE_SPEC.d.ts +17 -0
  266. package/src/shade/renderer/hair/HAIR_DATABASE_SPEC.d.ts.map +1 -0
  267. package/src/shade/renderer/hair/HAIR_DATABASE_SPEC.js +71 -0
  268. package/src/shade/renderer/hair/HAIR_FRAME_STRUCTS.d.ts +11 -0
  269. package/src/shade/renderer/hair/HAIR_FRAME_STRUCTS.d.ts.map +1 -0
  270. package/src/shade/renderer/hair/HAIR_FRAME_STRUCTS.js +48 -0
  271. package/src/shade/renderer/hair/HairFrame.d.ts +41 -0
  272. package/src/shade/renderer/hair/HairFrame.d.ts.map +1 -0
  273. package/src/shade/renderer/hair/HairFrame.js +76 -0
  274. package/src/shade/renderer/hair/chunk_hair_bsdf.d.ts +42 -0
  275. package/src/shade/renderer/hair/chunk_hair_bsdf.d.ts.map +1 -0
  276. package/src/shade/renderer/hair/chunk_hair_bsdf.js +170 -0
  277. package/src/shade/renderer/hair/chunk_hair_dual_scattering.d.ts +30 -0
  278. package/src/shade/renderer/hair/chunk_hair_dual_scattering.d.ts.map +1 -0
  279. package/src/shade/renderer/hair/chunk_hair_dual_scattering.js +131 -0
  280. package/src/shade/renderer/hair/chunk_hair_pixel.d.ts +32 -0
  281. package/src/shade/renderer/hair/chunk_hair_pixel.d.ts.map +1 -0
  282. package/src/shade/renderer/hair/chunk_hair_pixel.js +116 -0
  283. package/src/shade/renderer/hair/chunk_hair_strand.d.ts +40 -0
  284. package/src/shade/renderer/hair/chunk_hair_strand.d.ts.map +1 -0
  285. package/src/shade/renderer/hair/chunk_hair_strand.js +85 -0
  286. package/src/shade/renderer/hair/chunk_hair_volume.d.ts +31 -0
  287. package/src/shade/renderer/hair/chunk_hair_volume.d.ts.map +1 -0
  288. package/src/shade/renderer/hair/chunk_hair_volume.js +106 -0
  289. package/src/shade/renderer/hair/hair_id_draw.d.ts +24 -0
  290. package/src/shade/renderer/hair/hair_id_draw.d.ts.map +1 -0
  291. package/src/shade/renderer/hair/hair_id_draw.js +135 -0
  292. package/src/shade/renderer/hair/hair_lighting.d.ts +53 -0
  293. package/src/shade/renderer/hair/hair_lighting.d.ts.map +1 -0
  294. package/src/shade/renderer/hair/hair_lighting.js +270 -0
  295. package/src/shade/renderer/hair/hair_scattering_lut.d.ts +75 -0
  296. package/src/shade/renderer/hair/hair_scattering_lut.d.ts.map +1 -0
  297. package/src/shade/renderer/hair/hair_scattering_lut.js +271 -0
  298. package/src/shade/renderer/hair/hair_stamp.d.ts +33 -0
  299. package/src/shade/renderer/hair/hair_stamp.d.ts.map +1 -0
  300. package/src/shade/renderer/hair/hair_stamp.js +175 -0
  301. package/src/shade/renderer/hair/shader_hair_classes.d.ts +21 -0
  302. package/src/shade/renderer/hair/shader_hair_classes.d.ts.map +1 -0
  303. package/src/shade/renderer/hair/shader_hair_classes.js +86 -0
  304. package/src/shade/renderer/hair/shader_hair_cull.d.ts +31 -0
  305. package/src/shade/renderer/hair/shader_hair_cull.d.ts.map +1 -0
  306. package/src/shade/renderer/hair/shader_hair_cull.js +194 -0
  307. package/src/shade/renderer/hair/shader_hair_lod.d.ts +33 -0
  308. package/src/shade/renderer/hair/shader_hair_lod.d.ts.map +1 -0
  309. package/src/shade/renderer/hair/shader_hair_lod.js +268 -0
  310. package/src/shade/renderer/hair/shader_hair_volume.d.ts +28 -0
  311. package/src/shade/renderer/hair/shader_hair_volume.d.ts.map +1 -0
  312. package/src/shade/renderer/hair/shader_hair_volume.js +167 -0
  313. package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
  314. package/src/shade/renderer/loader/usd/usd_build_scene.d.ts +31 -0
  315. package/src/shade/renderer/loader/usd/usd_build_scene.d.ts.map +1 -1
  316. package/src/shade/renderer/loader/usd/usd_build_scene.js +36 -21
  317. package/src/shade/renderer/loader/usd/usd_groom_extension.d.ts +60 -0
  318. package/src/shade/renderer/loader/usd/usd_groom_extension.d.ts.map +1 -0
  319. package/src/shade/renderer/loader/usd/usd_groom_extension.js +417 -0
  320. package/src/shade/renderer/path_tracer/shader/chunk_sample_material_data.d.ts.map +1 -1
  321. package/src/shade/renderer/path_tracer/shader/chunk_sample_material_data.js +4 -1
  322. package/src/shade/renderer/path_tracer/shader/chunk_shading_closure_from_material_data.d.ts.map +1 -1
  323. package/src/shade/renderer/path_tracer/shader/chunk_shading_closure_from_material_data.js +3 -1
  324. package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
  325. package/src/shade/renderer/postprocess/ssr/SSR.d.ts +4 -1
  326. package/src/shade/renderer/postprocess/ssr/SSR.d.ts.map +1 -1
  327. package/src/shade/renderer/postprocess/ssr/SSR.js +9 -0
  328. package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_sample_radiance.d.ts +16 -1
  329. package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_sample_radiance.d.ts.map +1 -1
  330. package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_sample_radiance.js +47 -3
  331. package/src/shade/renderer/postprocess/ssr/resolve/ssr_resolve_shader.d.ts.map +1 -1
  332. package/src/shade/renderer/postprocess/ssr/resolve/ssr_resolve_shader.js +5 -3
  333. package/src/shade/renderer/postprocess/ssr/ssr_combine_shader.d.ts.map +1 -1
  334. package/src/shade/renderer/postprocess/ssr/ssr_combine_shader.js +6 -5
  335. package/src/shade/renderer/rasterize/forward/chunk_forward_shade_standard_fragment.d.ts.map +1 -1
  336. package/src/shade/renderer/rasterize/forward/chunk_forward_shade_standard_fragment.js +5 -2
  337. package/src/shade/renderer/rasterize/native/avboit/avboit_draw_fragment_body.d.ts.map +1 -1
  338. package/src/shade/renderer/rasterize/native/avboit/avboit_draw_fragment_body.js +5 -0
  339. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_splat.d.ts.map +1 -1
  340. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_splat.js +4 -1
  341. package/src/shade/renderer/rasterize/native/oit/oit_resolve_fragment_body.d.ts.map +1 -1
  342. package/src/shade/renderer/rasterize/native/oit/oit_resolve_fragment_body.js +5 -1
  343. package/src/shade/renderer/rasterize/native/oit/shader_oit_generate_moments.d.ts.map +1 -1
  344. package/src/shade/renderer/rasterize/native/oit/shader_oit_generate_moments.js +7 -4
  345. package/src/shade/renderer/shader/chunk/brdf/chunk_shadowed_F90.d.ts +13 -8
  346. package/src/shade/renderer/shader/chunk/brdf/chunk_shadowed_F90.d.ts.map +1 -1
  347. package/src/shade/renderer/shader/chunk/brdf/chunk_shadowed_F90.js +18 -14
  348. package/src/shade/renderer/shader/chunk/light/chunk_compute_multiscattering_specular.d.ts +3 -2
  349. package/src/shade/renderer/shader/chunk/light/chunk_compute_multiscattering_specular.d.ts.map +1 -1
  350. package/src/shade/renderer/shader/chunk/light/chunk_compute_multiscattering_specular.js +12 -4
  351. package/src/shade/renderer/shader/chunk/material/MATERIAL_SHADING_INFO_STRUCT.d.ts.map +1 -1
  352. package/src/shade/renderer/shader/chunk/material/MATERIAL_SHADING_INFO_STRUCT.js +1 -0
  353. package/src/shade/renderer/shader/chunk/material/chunk_compute_indirect_specular.js +1 -1
  354. package/src/shade/renderer/shader/chunk/material/chunk_metalness_to_specular_F90.d.ts +16 -0
  355. package/src/shade/renderer/shader/chunk/material/chunk_metalness_to_specular_F90.d.ts.map +1 -0
  356. package/src/shade/renderer/shader/chunk/material/chunk_metalness_to_specular_F90.js +25 -0
  357. package/src/shade/renderer/shader/chunk/material/chunk_re_direct_multiscatter.js +2 -2
  358. package/src/shade/renderer/shader/compiler/ShaderSwitch.d.ts +1 -1
  359. package/src/shade/renderer/shader/compiler/ShaderSwitchSet.d.ts +1 -1
  360. package/src/shade/renderer/shader/resource/ShaderResourceDescriptor.d.ts +1 -1
  361. package/src/shade/renderer/shadow/map/shader/chunk_shadowmap_sample_point2.d.ts +2 -2
  362. package/src/shade/renderer/shadow/map/shader/chunk_shadowmap_sample_point2.js +2 -2
  363. package/src/shade/renderer/water/query/GPUWaterQueries.d.ts +1 -1
@@ -1,7 +1,8 @@
1
1
  import Signal from "../../../../core/events/signal/Signal.js";
2
2
  import { dB2Volume } from "../../dB2Volume.js";
3
3
  import { FADE_EPSILON, rampGain } from "../util/fadeOutAndStop.js";
4
- import { ACOUSTIC_DIRECTION_DEADBAND, acoustic_gains_moved, acoustic_ramp, acoustic_resting } from "./acoustic_writes.js";
4
+ import { acoustic_gains_moved, acoustic_resting } from "./acoustic_writes.js";
5
+ import { AcousticSpeakerFeed } from "./AcousticSpeakers.js";
5
6
  import { SOPRA_PANNING_MODEL_TO_WEBAUDIO, SopraPanningModel } from "../definition/SopraPanningModel.js";
6
7
  import { EffectChain } from "./EffectChain.js";
7
8
  import { VOICE_POOL } from "./VoicePool.js";
@@ -68,7 +69,6 @@ const TOWARD_SOURCE = new Float32Array(3);
68
69
  const RAMP_DIRECT = 0;
69
70
  const RAMP_EARLY = 1;
70
71
  const RAMP_WET = 2;
71
- const RAMP_PANNER = 3;
72
72
 
73
73
  /**
74
74
  * One triggered playing of an {@link EventDescription}. Transient — never serialized.
@@ -282,18 +282,26 @@ export class EventInstance {
282
282
  #directTaps = null;
283
283
 
284
284
  /**
285
- * The early energy's directional share's taps into {@link #earlyPanner}. Null on non-acoustic instances.
285
+ * The early energy's directional share's taps into {@link #earlySum}, or into the bus on an unpanned instance.
286
+ * Null on non-acoustic instances.
286
287
  * @type {{lowTap:GainNode, midTap:GainNode, dryTap:GainNode}|null}
287
288
  */
288
289
  #earlyTaps = null;
289
290
 
290
291
  /**
291
- * The second panner, placed along the early energy's arrival direction at the source's distance (direction
292
- * only, rolloff 0). Null on non-acoustic and unpanned instances: an unpanned source's early energy reaches the
293
- * bus unrotated, as its direct sound does.
294
- * @type {PannerNode|null}
292
+ * What the early taps sum into, ahead of {@link #earlyFeed}. Null on non-acoustic and unpanned instances: an
293
+ * unpanned source's early energy reaches the bus unrotated, as its direct sound does.
294
+ * @type {GainNode|null}
295
295
  */
296
- #earlyPanner = null;
296
+ #earlySum = null;
297
+
298
+ /**
299
+ * The early energy's directional share into the bus's speakers (`BusGraph#getAcousticSpeakers`), from the
300
+ * direction it arrives from: gains on panners that stand still, never a panner moved after a direction estimated
301
+ * afresh each frame. Null where {@link #earlySum} is.
302
+ * @type {AcousticSpeakerFeed|null}
303
+ */
304
+ #earlyFeed = null;
297
305
 
298
306
  /**
299
307
  * The reverberant energy's taps into {@link #reverb}'s side input. Null on non-acoustic instances, and on one
@@ -333,12 +341,6 @@ export class EventInstance {
333
341
  */
334
342
  #solved = false;
335
343
 
336
- /**
337
- * Where the early panner was last sent, NaN before it was ever placed.
338
- * @type {Float64Array}
339
- */
340
- #earlyPlaced = new Float64Array([NaN, NaN, NaN]);
341
-
342
344
  /**
343
345
  * The latest solution handed over while the chain was not built yet (its buffers still loading), written the
344
346
  * moment it is. Null when there is none.
@@ -354,10 +356,22 @@ export class EventInstance {
354
356
  #reverbEnergy = new Float64Array(3);
355
357
  #reverbCentre = new Float64Array(3);
356
358
  #reverbLean = new Float64Array(3);
359
+ #reverbLoudness = 0;
360
+
361
+ /**
362
+ * What this source's propagation has put in the reverb's tail, per band (the network's **Memory**): as of the
363
+ * frame's send in {@link #reverbHeld}, and as the frame before left it, at its context time, in
364
+ * {@link #reverbHeldBase} (NaN time before the first send).
365
+ */
366
+ #reverbHeld = new Float64Array(3);
367
+ #reverbHeldBase = new Float64Array(3);
368
+ #reverbHeldAt = NaN;
369
+ #reverbHeldEpoch = -1;
370
+ #reverbHeldSentAt = NaN;
357
371
  #reverbEpoch = -1;
358
372
 
359
- /** When the last acoustic write to each path's taps, and to the early panner, arrives (`acoustic_resting`). */
360
- #rampEnds = new Float64Array(4);
373
+ /** When the last acoustic write to each path's taps arrives (`acoustic_resting`). */
374
+ #rampEnds = new Float64Array(3);
361
375
 
362
376
  /**
363
377
  * @param {SopraEngine} engine
@@ -644,21 +658,19 @@ export class EventInstance {
644
658
  this.#directTaps = build3BandTaps(ctx, split, spatialSink);
645
659
  set3BandGains(this.#directTaps, 1, 1, 1, 0);
646
660
 
647
- // the early energy's directional share, from where it arrives; silent until a solution has some.
648
- // An unpanned source has no direction to render it from, so it reaches the bus unrotated, as its
649
- // direct sound does
661
+ // the early energy's directional share, from where it arrives, through the bus's speakers; silent
662
+ // until a solution has some. An unpanned source has no direction to render it from, so it reaches the
663
+ // bus unrotated, as its direct sound does
650
664
  let earlySink = busInput;
651
665
 
652
666
  if (panned) {
653
- const earlyPanner = ctx.createPanner();
654
- earlyPanner.panningModel = SOPRA_PANNING_MODEL_TO_WEBAUDIO[description.panningModel] ?? 'HRTF';
655
- earlyPanner.distanceModel = 'linear';
656
- earlyPanner.rolloffFactor = 0;
657
- this.#earlyPanner = earlyPanner;
667
+ const earlySum = ctx.createGain();
668
+ const speakers = engine.busGraph.getAcousticSpeakers(this.busId, SOPRA_PANNING_MODEL_TO_WEBAUDIO[description.panningModel] ?? 'HRTF');
658
669
 
659
- earlyPanner.connect(busInput);
670
+ this.#earlySum = earlySum;
671
+ this.#earlyFeed = new AcousticSpeakerFeed(ctx, earlySum, speakers);
660
672
 
661
- earlySink = earlyPanner;
673
+ earlySink = earlySum;
662
674
  }
663
675
 
664
676
  this.#earlyTaps = build3BandTaps(ctx, split, earlySink);
@@ -777,16 +789,18 @@ export class EventInstance {
777
789
  * band's LOW-ANCHORED air tilt (only the high-vs-low excess darkens — a uniform loss is the distance curve's
778
790
  * job), into the panner at the source.
779
791
  * - **Early**: the directional share ψ of the early energy (the length of `earlyDirection`), per band, into the
780
- * second panner, placed along `earlyDirection` at the source's distance.
792
+ * bus's six speakers that stand still around the listener, by gains that put it along `earlyDirection`
793
+ * (`acoustic_speaker_gains`).
781
794
  * - **Wet**: the reverberant energy and the early energy's diffuse share, `wet + (1 − ψ)·early`, per band, into
782
795
  * the acoustic reverb above the instance's bus, which is told what the source sent: that energy after the
783
- * distance gain, with the source's centre times and lean (`AcousticReverbNetwork#accumulate`).
796
+ * distance gain, with the source's centre times and lean, and how loud the instance plays it, its own gain squared
797
+ * and none while it is out of hearing (`AcousticReverbNetwork#accumulate`). A stopped instance takes no solution.
784
798
  *
785
799
  * **Writes.** A path's band gains are sent only when one has moved more than half a decibel from what was last
786
- * sent, and the early panner moves only when the direction it is heard from has turned more than a degree; each
787
- * write is a straight ramp over the interval between updates (`acoustic_ramp`), so a step in the estimate is
788
- * reached as the next can arrive, without a click, and a still scene writes nothing. The first solution an instance is handed is written at once, its gains and the early
789
- * panner alike: a glide from what they were built with would be heard as no solution says the source sounds.
800
+ * sent, the speakers' gains alike; each write is a straight ramp over the interval between updates
801
+ * (`acoustic_ramp`), so a step in the estimate is reached as the next can arrive, without a click, and a still
802
+ * scene writes nothing. The first solution an instance is handed is written at once: a glide from what the gains
803
+ * were built with would be heard as no solution says the source sounds.
790
804
  *
791
805
  * Every solution term is a fraction of ENERGY and a GainNode takes AMPLITUDE: this is the one seam between the
792
806
  * two domains, so the square roots live here. Written straight in, an energy ratio used as an amplitude ratio
@@ -797,6 +811,11 @@ export class EventInstance {
797
811
  * @param {AcousticSolution} solution
798
812
  */
799
813
  setAcoustic(solution) {
814
+ // a stopped instance plays nothing, and sends the reverb nothing
815
+ if (this.state !== EventInstanceState.Playing) {
816
+ return;
817
+ }
818
+
800
819
  const directTaps = this.#directTaps;
801
820
 
802
821
  if (directTaps === null) {
@@ -860,13 +879,16 @@ export class EventInstance {
860
879
  // a source counts once a frame, however often it is solved in it (a result that lands between frames, a
861
880
  // solve as it starts): what it said before in this frame is taken back
862
881
  if (this.#reverbEpoch === reverb.epoch) {
863
- reverb.retract(this.#reverbEnergy, this.#reverbCentre, this.#reverbLean);
882
+ reverb.retract(this.#reverbEnergy, this.#reverbCentre, this.#reverbLean, this.#reverbLoudness, this.#reverbHeld);
864
883
  }
865
884
 
866
885
  this.#reverbEpoch = -1;
867
886
 
868
- // what reaches the network: the distance gain's square times the send, which the instance last wrote
887
+ // what reaches the network: the send times the distance gain's square; and how loud the instance plays it,
888
+ // its authored level and its own gain (its volume and any fade, as the param holds it now) squared, none
889
+ // while it plays no voice
869
890
  const distance_gain = this.#written_gain;
891
+ const own = this.#audible ? dB2Volume(this.description.gainDb) * this.#instanceGain.gain.value : 0;
870
892
 
871
893
  if (distance_gain > 0) {
872
894
  const energy = distance_gain * distance_gain;
@@ -879,19 +901,25 @@ export class EventInstance {
879
901
  this.#reverbCentre.set(solution.wetCentreTime);
880
902
  this.#reverbLean.set(solution.wetDirection);
881
903
 
882
- reverb.accumulate(kept, this.#reverbCentre, this.#reverbLean);
904
+ this.#reverbLoudness = own * own;
905
+
906
+ this.#hold(reverb, kept);
907
+
908
+ reverb.accumulate(kept, this.#reverbCentre, this.#reverbLean, this.#reverbLoudness, this.#reverbHeld);
883
909
 
884
910
  this.#reverbEpoch = reverb.epoch;
885
911
  }
886
912
  }
887
913
 
888
- const earlyPanner = this.#earlyPanner;
889
- const listener = this.engine.listenerPosition;
914
+ const earlyFeed = this.#earlyFeed;
915
+
916
+ if (earlyFeed !== null) {
917
+ const interval = this.#solved ? this.engine.updateInterval : 0;
918
+ const listener = this.engine.listenerPosition;
890
919
 
891
- if (earlyPanner !== null && listener !== null && this.position !== null) {
892
920
  if (share > 0) {
893
- this.#aim(earlyPanner, listener, toward);
894
- } else if (wetTaps === null) {
921
+ earlyFeed.aim(toward, this.engine.currentTime, interval);
922
+ } else if (wetTaps === null && listener !== null && this.position !== null) {
895
923
  // early energy of no direction, and nowhere diffuse to send it: heard from the source
896
924
  const position = this.position;
897
925
 
@@ -899,15 +927,53 @@ export class EventInstance {
899
927
  TOWARD_SOURCE[1] = position[1] - listener[1];
900
928
  TOWARD_SOURCE[2] = position[2] - listener[2];
901
929
 
902
- if (v3_length(TOWARD_SOURCE[0], TOWARD_SOURCE[1], TOWARD_SOURCE[2]) > 0) {
903
- this.#aim(earlyPanner, listener, TOWARD_SOURCE);
904
- }
930
+ earlyFeed.aim(TOWARD_SOURCE, this.engine.currentTime, interval);
905
931
  }
906
932
  }
907
933
 
908
934
  this.#solved = true;
909
935
  }
910
936
 
937
+ /**
938
+ * Bring this source's model of what it holds in the reverb's tail to now, for the send `energy`: from what the
939
+ * frame before left, decayed by the network's decay over the time since, and filled toward the send. A first
940
+ * send, or a band with no decay yet, holds what it sends. Solved again within a frame, it starts from the same
941
+ * frame before.
942
+ *
943
+ * @param {AcousticReverbNetwork} reverb
944
+ * @param {Float64Array} energy
945
+ */
946
+ #hold(reverb, energy) {
947
+ const held = this.#reverbHeld;
948
+ const base = this.#reverbHeldBase;
949
+ const now = this.engine.currentTime;
950
+
951
+ if (this.#reverbHeldEpoch !== reverb.epoch) {
952
+ // a new frame: what the last one left is where this one starts
953
+ if (this.#reverbHeldEpoch >= 0) {
954
+ base.set(held);
955
+ this.#reverbHeldAt = this.#reverbHeldSentAt;
956
+ }
957
+
958
+ this.#reverbHeldEpoch = reverb.epoch;
959
+ }
960
+
961
+ const since = now - this.#reverbHeldAt;
962
+ const tau = reverb.centre_time;
963
+
964
+ for (let b = 0; b < 3; b++) {
965
+ if (since >= 0 && tau[b] > 0) {
966
+ const keep = Math.exp(-since / tau[b]);
967
+
968
+ held[b] = base[b] * keep + energy[b] * (1 - keep);
969
+ } else {
970
+ held[b] = energy[b];
971
+ }
972
+ }
973
+
974
+ this.#reverbHeldSentAt = now;
975
+ }
976
+
911
977
  /**
912
978
  * Send a path's band gains, unless none moved past the deadband from what was last sent.
913
979
  *
@@ -935,66 +1001,6 @@ export class EventInstance {
935
1001
  sent[2] = bands[2];
936
1002
  }
937
1003
 
938
- /**
939
- * Put the early panner along a direction from the listener, at the source's distance, which a direction-only
940
- * panner does not hear (a source on the listener is put a metre out rather than nowhere) — unless the direction
941
- * it is heard from now, where it was last sent, is within a degree of it.
942
- *
943
- * @param {PannerNode} panner
944
- * @param {ArrayLike<number>} listener
945
- * @param {Float32Array} toward the early energy's direction, of any length above 0
946
- */
947
- #aim(panner, listener, toward) {
948
- const length = v3_length(toward[0], toward[1], toward[2]);
949
- const ux = toward[0] / length;
950
- const uy = toward[1] / length;
951
- const uz = toward[2] / length;
952
-
953
- const placed = this.#earlyPlaced;
954
- const first = Number.isNaN(placed[0]);
955
-
956
- if (!first) {
957
- const hx = placed[0] - listener[0];
958
- const hy = placed[1] - listener[1];
959
- const hz = placed[2] - listener[2];
960
- const heard = v3_length(hx, hy, hz);
961
-
962
- if (heard > 0 && (hx * ux + hy * uy + hz * uz) >= ACOUSTIC_DIRECTION_DEADBAND * heard) {
963
- return;
964
- }
965
- }
966
-
967
- const position = this.position;
968
- const distance = Math.max(1, v3_length(
969
- position[0] - listener[0],
970
- position[1] - listener[1],
971
- position[2] - listener[2]
972
- ));
973
-
974
- const x = listener[0] + ux * distance;
975
- const y = listener[1] + uy * distance;
976
- const z = listener[2] + uz * distance;
977
-
978
- const now = this.engine.currentTime;
979
-
980
- if (first) {
981
- panner.positionX.setValueAtTime(x, now);
982
- panner.positionY.setValueAtTime(y, now);
983
- panner.positionZ.setValueAtTime(z, now);
984
- } else {
985
- const interval = this.engine.updateInterval;
986
- const resting = acoustic_resting(this.#rampEnds, RAMP_PANNER, now, interval);
987
-
988
- acoustic_ramp(panner.positionX, x, now, interval, resting ? placed[0] : NaN);
989
- acoustic_ramp(panner.positionY, y, now, interval, resting ? placed[1] : NaN);
990
- acoustic_ramp(panner.positionZ, z, now, interval, resting ? placed[2] : NaN);
991
- }
992
-
993
- placed[0] = x;
994
- placed[1] = y;
995
- placed[2] = z;
996
- }
997
-
998
1004
  /**
999
1005
  * Ramp the instance gain to a target over `duration` (click-safe). Does not stop the instance.
1000
1006
  * @param {number} targetDb
@@ -1330,8 +1336,10 @@ export class EventInstance {
1330
1336
  if (this.#panner !== null) {
1331
1337
  this.#panner.disconnect();
1332
1338
  }
1333
- if (this.#earlyPanner !== null) {
1334
- this.#earlyPanner.disconnect();
1339
+ if (this.#earlyFeed !== null) {
1340
+ // the speakers are the bus's, shared: only this instance's way into them is taken out
1341
+ this.#earlySum.disconnect();
1342
+ this.#earlyFeed.disconnect();
1335
1343
  }
1336
1344
  if (this.#directTaps !== null) {
1337
1345
  disconnect3BandTaps(this.#directTaps);
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Reverberation time over centre time for an exponential tail: the energy falls by 60 dB in `6 ln 10` of its time
3
+ * constants, and the centre time of an exponential is its time constant.
4
+ * @type {number}
5
+ */
6
+ export const RT60_PER_CENTRE_TIME: number;
7
+ /**
8
+ * The frequencies each band's decay is set at: the geometric centres of 31.25–250 Hz, 250–2,500 Hz and 2.5–20 kHz,
9
+ * the outer bands closed at the audible range's ends.
10
+ * @type {number[]}
11
+ */
12
+ export const ACOUSTIC_REVERB_BAND_CENTRES: number[];
13
+ //# sourceMappingURL=acoustic_reverb_decay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acoustic_reverb_decay.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/sound/sopra/runtime/acoustic_reverb_decay.js"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,mCAFU,MAAM,CAEkC;AAElD;;;;GAIG;AACH,2CAFU,MAAM,EAAE,CAE+H"}
@@ -0,0 +1,15 @@
1
+ import { LOW_MID_HZ, MID_HIGH_HZ } from "../util/reverb_band_tails.js";
2
+
3
+ /**
4
+ * Reverberation time over centre time for an exponential tail: the energy falls by 60 dB in `6 ln 10` of its time
5
+ * constants, and the centre time of an exponential is its time constant.
6
+ * @type {number}
7
+ */
8
+ export const RT60_PER_CENTRE_TIME = 6 * Math.LN10;
9
+
10
+ /**
11
+ * The frequencies each band's decay is set at: the geometric centres of 31.25–250 Hz, 250–2,500 Hz and 2.5–20 kHz,
12
+ * the outer bands closed at the audible range's ends.
13
+ * @type {number[]}
14
+ */
15
+ export const ACOUSTIC_REVERB_BAND_CENTRES = [Math.sqrt(31.25 * LOW_MID_HZ), Math.sqrt(LOW_MID_HZ * MID_HIGH_HZ), Math.sqrt(MID_HIGH_HZ * 20000)];
@@ -1 +1 @@
1
- {"version":3,"file":"GridTaskConnectRooms.d.ts","sourceRoot":"","sources":["../../../../../../src/generation/grid/generation/discrete/GridTaskConnectRooms.js"],"names":[],"mappings":"AAiBA;;;;;;;GAOG;AACH;IAqDI;;;;;;;;OAQG;IACH;;;;;;QAFa,oBAAoB,CAoBhC;IA9ED;;;OAGG;IACH,qBAAe;IAEf;;;OAGG;IACH,wBAAkB;IAElB;;;OAGG;IACH,yBAFU,MAAM,EAAE,CAShB;IAEF;;;OAGG;IACH,uBAFU,MAAM,EAAE,CAahB;IAEF,kBAAc;IAEd;;;OAGG;IACH,uBAAa;IAgCb,qBAEC;IAED;;;;;OAKG;IACH,sCAHW,OAAO,GACL,IAAI,CAqChB;IAED;;;;;;OAMG;IACH,qBALW,MAAM,KACN,MAAM,6BAEN,MAAM,QA8DhB;IAED;;;;;;;OAOG;IACH,mCANW,OAAO,aACP,WAAW,6BAEX,MAAM,GACJ,OAAO,CAqGnB;IAED;;;;;;;;OAQG;IACH,gBAPW,MAAM,KACN,MAAM,aACN,MAAM,6BAEN,WAAW,aACX,MAAM,QAuEhB;IAED;;;;;;;OAOG;IACH,mCALW,MAAM,EAAE,aACR,MAAM,aACN,MAAM,EAAE,GACN,SAAS,CAyBrB;IAED;;;;;;;OAOG;IACH,0BANW,MAAM,0BAEN,MAAM,EAAE,aACR,MAAM,aACN,MAAM,EAAE,QAclB;IAED,iDAuEC;CACJ;kCAhhBiC,4BAA4B;oBAR1C,kCAAkC;iBAErC,uCAAuC;uBAJjC,mCAAmC;0BAQhC,0DAA0D;sBAH9D,4CAA4C"}
1
+ {"version":3,"file":"GridTaskConnectRooms.d.ts","sourceRoot":"","sources":["../../../../../../src/generation/grid/generation/discrete/GridTaskConnectRooms.js"],"names":[],"mappings":"AAkBA;;;;;;;GAOG;AACH;IAqDI;;;;;;;;OAQG;IACH;;;;;;QAFa,oBAAoB,CAoBhC;IA9ED;;;OAGG;IACH,qBAAe;IAEf;;;OAGG;IACH,wBAAkB;IAElB;;;OAGG;IACH,yBAFU,MAAM,EAAE,CAShB;IAEF;;;OAGG;IACH,uBAFU,MAAM,EAAE,CAahB;IAEF,kBAAc;IAEd;;;OAGG;IACH,uBAAa;IAgCb,qBAEC;IAED;;;;;OAKG;IACH,sCAHW,OAAO,GACL,IAAI,CAqChB;IAED;;;;;;OAMG;IACH,qBALW,MAAM,KACN,MAAM,6BAEN,MAAM,QA8DhB;IAED;;;;;;;OAOG;IACH,mCANW,OAAO,aACP,WAAW,6BAEX,MAAM,GACJ,OAAO,CAqGnB;IAED;;;;;;;;OAQG;IACH,gBAPW,MAAM,KACN,MAAM,aACN,MAAM,6BAEN,WAAW,aACX,MAAM,QAuEhB;IAED;;;;;;;OAOG;IACH,mCALW,MAAM,EAAE,aACR,MAAM,aACN,MAAM,EAAE,GACN,SAAS,CAyBrB;IAED;;;;;;;OAOG;IACH,0BANW,MAAM,0BAEN,MAAM,EAAE,aACR,MAAM,aACN,MAAM,EAAE,QAWlB;IAED,iDAuEC;CACJ;kCA7gBiC,4BAA4B;oBAT1C,kCAAkC;iBAErC,uCAAuC;uBAJjC,mCAAmC;0BAQhC,0DAA0D;sBAH9D,4CAA4C"}
@@ -9,6 +9,7 @@ import { TaskSignal } from "../../../../core/process/task/TaskSignal.js";
9
9
  import { actionTask } from "../../../../core/process/task/util/actionTask.js";
10
10
  import { Sampler2D } from "../../../../engine/graphics/texture/sampler/Sampler2D.js";
11
11
  import { bitSet2Sampler2D } from "../../../../engine/graphics/texture/sampler/util/bitSet2Sampler2D.js";
12
+ import { drawSamplerHTML } from "../../../../engine/graphics/texture/sampler/util/drawSamplerHTML.js";
12
13
  import { GridTaskGenerator } from "../../GridTaskGenerator.js";
13
14
  import { buildDistanceMapToObjective } from "../util/buildDistanceMapToObjective.js";
14
15
  import { buildPathFromDistanceMap } from "../util/buildPathFromDistanceMap.js";
@@ -455,13 +456,10 @@ export class GridTaskConnectRooms extends GridTaskGenerator {
455
456
 
456
457
  const d = this.debugState(grid, points, connected, distances);
457
458
 
458
- // imported lazily so that headless use of this class does not pull in DOM-dependent code
459
- import("../../../../engine/graphics/texture/sampler/util/drawSamplerHTML.js").then(({ drawSamplerHTML }) => {
460
- const y = (iteration / 4) | 0;
461
- const x = iteration % 4;
459
+ const y = (iteration / 4) | 0;
460
+ const x = iteration % 4;
462
461
 
463
- drawSamplerHTML(document.body, d, x * 260 + 5, y * 260 + 5, 1, 0, 256);
464
- });
462
+ drawSamplerHTML(document.body, d, x * 260 + 5, y * 260 + 5, 1, 0, 256);
465
463
 
466
464
  }
467
465
 
@@ -52,6 +52,17 @@ export class PipelineEnquiry {
52
52
  * @type {GPUTextureFormat|null}
53
53
  */
54
54
  presentation_format: GPUTextureFormat | null;
55
+ /**
56
+ * The renderer's shader switches, which pick the variant of a pipeline that links switched chunks (the shadow
57
+ * technique, the indirect lighting). Null when the one who asks has none.
58
+ * @type {import("../../renderer/shader/compiler/ShaderSwitchSet.js").ShaderSwitchSet|null}
59
+ */
60
+ shader_switches: import("../../renderer/shader/compiler/ShaderSwitchSet.js").ShaderSwitchSet | null;
61
+ /**
62
+ * The format of the scene colour an extension at a lit phase draws into. Null when the one who asks has none.
63
+ * @type {GPUTextureFormat|null}
64
+ */
65
+ scene_color_format: GPUTextureFormat | null;
55
66
  }
56
67
  export type RenderPipelineDescriptor = import("../../descriptor/pipeline/render/RenderPipelineDescriptor.js").RenderPipelineDescriptor;
57
68
  export type ComputePipelineDescriptor = import("../../descriptor/pipeline/compute/ComputePipelineDescriptor.js").ComputePipelineDescriptor;
@@ -1 +1 @@
1
- {"version":3,"file":"PipelineEnquiry.d.ts","sourceRoot":"","sources":["../../../../../src/shade/device/pipeline/PipelineEnquiry.js"],"names":[],"mappings":"AAEA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH;IA8BI,0CAQC;IArCD;;;;;OAKG;IACH,kBAAO;IAEP;;OAEG;IACH,QAFU,wBAAwB,EAAE,CAExB;IAEZ;;OAEG;IACH,SAFU,yBAAyB,EAAE,CAExB;IAEb;;;OAGG;IACH;;;;OAIG;IACH,qBAFU,mBAAiB,IAAI,CAEJ;CAW9B;uCAlEY,OAAO,8DAA8D,EAAE,wBAAwB;wCAC/F,OAAO,gEAAgE,EAAE,yBAAyB"}
1
+ {"version":3,"file":"PipelineEnquiry.d.ts","sourceRoot":"","sources":["../../../../../src/shade/device/pipeline/PipelineEnquiry.js"],"names":[],"mappings":"AAEA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH;IA2CI,0CAQC;IAlDD;;;;;OAKG;IACH,kBAAO;IAEP;;OAEG;IACH,QAFU,wBAAwB,EAAE,CAExB;IAEZ;;OAEG;IACH,SAFU,yBAAyB,EAAE,CAExB;IAEb;;;OAGG;IACH;;;;OAIG;IACH,qBAFU,mBAAiB,IAAI,CAEJ;IAE3B;;;;OAIG;IACH,iBAFU,OAAO,mDAAmD,EAAE,eAAe,GAAC,IAAI,CAEnE;IAEvB;;;OAGG;IACH,oBAFU,mBAAiB,IAAI,CAEL;CAW7B;uCA/EY,OAAO,8DAA8D,EAAE,wBAAwB;wCAC/F,OAAO,gEAAgE,EAAE,yBAAyB"}
@@ -58,6 +58,19 @@ export class PipelineEnquiry {
58
58
  */
59
59
  presentation_format = null;
60
60
 
61
+ /**
62
+ * The renderer's shader switches, which pick the variant of a pipeline that links switched chunks (the shadow
63
+ * technique, the indirect lighting). Null when the one who asks has none.
64
+ * @type {import("../../renderer/shader/compiler/ShaderSwitchSet.js").ShaderSwitchSet|null}
65
+ */
66
+ shader_switches = null;
67
+
68
+ /**
69
+ * The format of the scene colour an extension at a lit phase draws into. Null when the one who asks has none.
70
+ * @type {GPUTextureFormat|null}
71
+ */
72
+ scene_color_format = null;
73
+
61
74
  static from(device) {
62
75
  assert.defined(device, 'device');
63
76
 
@@ -0,0 +1,50 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Hair</title>
7
+ <style>
8
+ :root {
9
+ color-scheme: dark;
10
+ }
11
+
12
+ html, body {
13
+ margin: 0;
14
+ height: 100%;
15
+ overflow: hidden;
16
+ background: #0b0d10;
17
+ color: #e4e6ea;
18
+ font: 13px system-ui, sans-serif;
19
+ }
20
+
21
+ #viewport {
22
+ position: fixed;
23
+ inset: 0;
24
+ }
25
+
26
+ #hud {
27
+ position: fixed;
28
+ left: 12px;
29
+ top: 10px;
30
+ padding: 6px 10px;
31
+ border-radius: 6px;
32
+ background: rgba(10, 12, 16, 0.7);
33
+ font-variant-numeric: tabular-nums;
34
+ }
35
+
36
+ #message {
37
+ position: fixed;
38
+ inset: 40% 10% auto 10%;
39
+ white-space: pre-wrap;
40
+ text-align: center;
41
+ }
42
+ </style>
43
+ </head>
44
+ <body tabindex="-1">
45
+ <div id="viewport"></div>
46
+ <div id="hud">starting…</div>
47
+ <div id="message"></div>
48
+ <script type="module" src="./main.js"></script>
49
+ </body>
50
+ </html>
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=main.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../../../src/shade/playground/hair/main.js"],"names":[],"mappings":""}