@woosh/meep-engine 3.74.0 → 3.75.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 (161) 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/graphics/render/frame_graph/FrameGraph.d.ts +6 -0
  7. package/src/engine/graphics/render/frame_graph/FrameGraph.d.ts.map +1 -1
  8. package/src/engine/graphics/render/frame_graph/FrameGraph.js +9 -0
  9. package/src/engine/graphics3/GPUAcousticSystem.d.ts +29 -32
  10. package/src/engine/graphics3/GPUAcousticSystem.d.ts.map +1 -1
  11. package/src/engine/graphics3/GPUAcousticSystem.js +87 -162
  12. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  13. package/src/engine/sound/ecs/audio/AudioEmitterSystem.d.ts.map +1 -1
  14. package/src/engine/sound/ecs/audio/AudioEmitterSystem.js +35 -17
  15. package/src/engine/sound/ecs/audio/LiveEmitterSet.d.ts.map +1 -1
  16. package/src/engine/sound/ecs/audio/LiveEmitterSet.js +2 -3
  17. package/src/engine/sound/simulation/AcousticSimulator.d.ts +7 -0
  18. package/src/engine/sound/simulation/AcousticSimulator.d.ts.map +1 -1
  19. package/src/engine/sound/simulation/AcousticSimulator.js +27 -0
  20. package/src/engine/sound/simulation/README.md +121 -107
  21. package/src/engine/sound/sopra/README.md +8 -3
  22. package/src/engine/sound/sopra/definition/effect/AcousticReverbEffect.d.ts +2 -2
  23. package/src/engine/sound/sopra/definition/effect/AcousticReverbEffect.d.ts.map +1 -1
  24. package/src/engine/sound/sopra/definition/effect/AcousticReverbEffect.js +4 -3
  25. package/src/engine/sound/sopra/runtime/AcousticReverbConvolution.d.ts +118 -0
  26. package/src/engine/sound/sopra/runtime/AcousticReverbConvolution.d.ts.map +1 -0
  27. package/src/engine/sound/sopra/runtime/AcousticReverbConvolution.js +472 -0
  28. package/src/engine/sound/sopra/runtime/AcousticReverbLines.d.ts +166 -0
  29. package/src/engine/sound/sopra/runtime/AcousticReverbLines.d.ts.map +1 -0
  30. package/src/engine/sound/sopra/runtime/AcousticReverbLines.js +447 -0
  31. package/src/engine/sound/sopra/runtime/AcousticReverbNetwork.d.ts +69 -113
  32. package/src/engine/sound/sopra/runtime/AcousticReverbNetwork.d.ts.map +1 -1
  33. package/src/engine/sound/sopra/runtime/AcousticReverbNetwork.js +143 -491
  34. package/src/engine/sound/sopra/runtime/AcousticSpeakers.d.ts +102 -0
  35. package/src/engine/sound/sopra/runtime/AcousticSpeakers.d.ts.map +1 -0
  36. package/src/engine/sound/sopra/runtime/AcousticSpeakers.js +232 -0
  37. package/src/engine/sound/sopra/runtime/BusGraph.d.ts +17 -3
  38. package/src/engine/sound/sopra/runtime/BusGraph.d.ts.map +1 -1
  39. package/src/engine/sound/sopra/runtime/BusGraph.js +55 -5
  40. package/src/engine/sound/sopra/runtime/EventInstance.d.ts +8 -6
  41. package/src/engine/sound/sopra/runtime/EventInstance.d.ts.map +1 -1
  42. package/src/engine/sound/sopra/runtime/EventInstance.js +113 -105
  43. package/src/engine/sound/sopra/runtime/acoustic_reverb_decay.d.ts +13 -0
  44. package/src/engine/sound/sopra/runtime/acoustic_reverb_decay.d.ts.map +1 -0
  45. package/src/engine/sound/sopra/runtime/acoustic_reverb_decay.js +15 -0
  46. package/src/generation/grid/generation/discrete/GridTaskConnectRooms.d.ts.map +1 -1
  47. package/src/generation/grid/generation/discrete/GridTaskConnectRooms.js +4 -6
  48. package/src/shade/playground/skinned_blas_refit/diff_traced_against_rasterized.d.ts.map +1 -1
  49. package/src/shade/playground/skinned_blas_refit/diff_traced_against_rasterized.js +4 -5
  50. package/src/shade/playground/skinned_blas_refit/main.d.ts.map +1 -1
  51. package/src/shade/playground/skinned_blas_refit/main.js +6 -12
  52. package/src/shade/playground/skinned_mesh_soup/main.d.ts.map +1 -1
  53. package/src/shade/playground/skinned_mesh_soup/main.js +1 -2
  54. package/src/shade/playground/vgeo_scene/README.md +12 -2
  55. package/src/shade/playground/vgeo_scene/main.js +1 -1
  56. package/src/shade/playground/volumetrics_froxel/README.md +191 -191
  57. package/src/shade/playground/volumetrics_froxel/measure.d.ts +3 -3
  58. package/src/shade/playground/volumetrics_froxel/measure.d.ts.map +1 -1
  59. package/src/shade/playground/volumetrics_froxel/measure.js +11 -13
  60. package/src/shade/playground/vsm/main.d.ts.map +1 -1
  61. package/src/shade/playground/vsm/main.js +5 -6
  62. package/src/shade/renderer/Renderer.d.ts.map +1 -1
  63. package/src/shade/renderer/Renderer.js +31 -8
  64. package/src/shade/renderer/acoustics/ACOUSTIC_LISTENER_RESOURCES.d.ts +28 -0
  65. package/src/shade/renderer/acoustics/ACOUSTIC_LISTENER_RESOURCES.d.ts.map +1 -0
  66. package/src/shade/renderer/acoustics/ACOUSTIC_LISTENER_RESOURCES.js +42 -0
  67. package/src/shade/renderer/acoustics/ACOUSTIC_PROBE_DATABASE_SPEC.d.ts +58 -0
  68. package/src/shade/renderer/acoustics/ACOUSTIC_PROBE_DATABASE_SPEC.d.ts.map +1 -0
  69. package/src/shade/renderer/acoustics/ACOUSTIC_PROBE_DATABASE_SPEC.js +108 -0
  70. package/src/shade/renderer/acoustics/GPUAcousticLattice.d.ts +1 -1
  71. package/src/shade/renderer/acoustics/GPUAcousticProbes.d.ts +161 -0
  72. package/src/shade/renderer/acoustics/GPUAcousticProbes.d.ts.map +1 -0
  73. package/src/shade/renderer/acoustics/GPUAcousticProbes.js +760 -0
  74. package/src/shade/renderer/acoustics/GPUAcoustics.d.ts +1 -1
  75. package/src/shade/renderer/acoustics/acoustic_listener_order.d.ts +12 -0
  76. package/src/shade/renderer/acoustics/acoustic_listener_order.d.ts.map +1 -0
  77. package/src/shade/renderer/acoustics/acoustic_listener_order.js +56 -0
  78. package/src/shade/renderer/acoustics/chunk_acoustic_direct.d.ts.map +1 -1
  79. package/src/shade/renderer/acoustics/chunk_acoustic_direct.js +5 -0
  80. package/src/shade/renderer/acoustics/chunk_acoustic_direct_cone.d.ts +57 -0
  81. package/src/shade/renderer/acoustics/chunk_acoustic_direct_cone.d.ts.map +1 -0
  82. package/src/shade/renderer/acoustics/chunk_acoustic_direct_cone.js +314 -0
  83. package/src/shade/renderer/acoustics/chunk_acoustic_finite.d.ts +15 -0
  84. package/src/shade/renderer/acoustics/chunk_acoustic_finite.d.ts.map +1 -0
  85. package/src/shade/renderer/acoustics/chunk_acoustic_finite.js +21 -0
  86. package/src/shade/renderer/acoustics/chunk_acoustic_gather.js +1 -1
  87. package/src/shade/renderer/acoustics/chunk_acoustic_lean.d.ts +27 -0
  88. package/src/shade/renderer/acoustics/chunk_acoustic_lean.d.ts.map +1 -0
  89. package/src/shade/renderer/acoustics/chunk_acoustic_lean.js +42 -0
  90. package/src/shade/renderer/acoustics/chunk_acoustic_listener.d.ts +80 -0
  91. package/src/shade/renderer/acoustics/chunk_acoustic_listener.d.ts.map +1 -0
  92. package/src/shade/renderer/acoustics/chunk_acoustic_listener.js +274 -0
  93. package/src/shade/renderer/acoustics/chunk_acoustic_partials.d.ts +2 -2
  94. package/src/shade/renderer/acoustics/chunk_acoustic_partials.js +2 -2
  95. package/src/shade/renderer/acoustics/chunk_acoustic_phonon.d.ts +7 -0
  96. package/src/shade/renderer/acoustics/chunk_acoustic_phonon.d.ts.map +1 -1
  97. package/src/shade/renderer/acoustics/chunk_acoustic_phonon.js +24 -1
  98. package/src/shade/renderer/acoustics/chunk_acoustic_resample.js +1 -1
  99. package/src/shade/renderer/acoustics/chunk_acoustic_reservoir.js +1 -1
  100. package/src/shade/renderer/acoustics/chunk_acoustic_through.d.ts +43 -0
  101. package/src/shade/renderer/acoustics/chunk_acoustic_through.d.ts.map +1 -0
  102. package/src/shade/renderer/acoustics/chunk_acoustic_through.js +153 -0
  103. package/src/shade/renderer/acoustics/chunk_acoustic_trace.d.ts +3 -1
  104. package/src/shade/renderer/acoustics/chunk_acoustic_trace.d.ts.map +1 -1
  105. package/src/shade/renderer/acoustics/chunk_acoustic_trace.js +10 -1
  106. package/src/shade/renderer/acoustics/shader_acoustic_combine.d.ts +7 -3
  107. package/src/shade/renderer/acoustics/shader_acoustic_combine.d.ts.map +1 -1
  108. package/src/shade/renderer/acoustics/shader_acoustic_combine.js +22 -6
  109. package/src/shade/renderer/acoustics/shader_acoustic_coupling.d.ts +14 -0
  110. package/src/shade/renderer/acoustics/shader_acoustic_coupling.d.ts.map +1 -0
  111. package/src/shade/renderer/acoustics/shader_acoustic_coupling.js +102 -0
  112. package/src/shade/renderer/acoustics/shader_acoustic_listener.d.ts +12 -0
  113. package/src/shade/renderer/acoustics/shader_acoustic_listener.d.ts.map +1 -0
  114. package/src/shade/renderer/acoustics/shader_acoustic_listener.js +80 -0
  115. package/src/shade/renderer/acoustics/shader_acoustic_receive.d.ts.map +1 -1
  116. package/src/shade/renderer/acoustics/shader_acoustic_receive.js +27 -6
  117. package/src/shade/renderer/acoustics/shader_acoustic_room.d.ts +11 -0
  118. package/src/shade/renderer/acoustics/shader_acoustic_room.d.ts.map +1 -0
  119. package/src/shade/renderer/acoustics/shader_acoustic_room.js +111 -0
  120. package/src/shade/renderer/acoustics/shader_acoustic_source.d.ts +18 -0
  121. package/src/shade/renderer/acoustics/shader_acoustic_source.d.ts.map +1 -0
  122. package/src/shade/renderer/acoustics/shader_acoustic_source.js +130 -0
  123. package/src/shade/renderer/fluid/GPUFluidCascade.d.ts +3 -3
  124. package/src/shade/renderer/fluid/GPUFluidCascadeStack.d.ts +1 -1
  125. package/src/shade/renderer/fluid/forcing/GPUFluidForcing.d.ts +7 -7
  126. package/src/shade/renderer/fluid/pressure/GPUFluidPressureSolve.d.ts +1 -1
  127. package/src/shade/renderer/fluid/query/GPUFluidQueries.d.ts +1 -1
  128. package/src/shade/renderer/geometry/virtual/build/level/VGeoFrontier.d.ts +2 -2
  129. package/src/shade/renderer/geometry/virtual/build/level/VGeoFrontier.js +2 -2
  130. package/src/shade/renderer/geometry/virtual/build/level/VGeoLevelOptions.d.ts +5 -2
  131. package/src/shade/renderer/geometry/virtual/build/level/VGeoLevelOptions.d.ts.map +1 -1
  132. package/src/shade/renderer/geometry/virtual/build/level/VGeoLevelOptions.js +5 -2
  133. package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_group_step.d.ts +9 -2
  134. package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_group_step.d.ts.map +1 -1
  135. package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_group_step.js +48 -12
  136. package/src/shade/renderer/geometry/virtual/format/read/VGeoContainerReader.d.ts +0 -22
  137. package/src/shade/renderer/geometry/virtual/format/read/VGeoContainerReader.d.ts.map +1 -1
  138. package/src/shade/renderer/geometry/virtual/format/read/VGeoContainerReader.js +0 -42
  139. package/src/shade/renderer/geometry/virtual/format/read/VGeoReadOptions.d.ts +2 -18
  140. package/src/shade/renderer/geometry/virtual/format/read/VGeoReadOptions.d.ts.map +1 -1
  141. package/src/shade/renderer/geometry/virtual/format/read/VGeoReadOptions.js +2 -19
  142. package/src/shade/renderer/geometry/virtual/format/read/vgeo_page_worker_serve.d.ts.map +1 -1
  143. package/src/shade/renderer/geometry/virtual/format/read/vgeo_page_worker_serve.js +0 -1
  144. package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.d.ts +5 -4
  145. package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.d.ts.map +1 -1
  146. package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.js +3 -1
  147. package/src/shade/renderer/geometry/virtual/runtime/VGeoFeedbackLoop.d.ts.map +1 -1
  148. package/src/shade/renderer/geometry/virtual/runtime/VGeoFeedbackLoop.js +3 -1
  149. package/src/shade/renderer/geometry/virtual/runtime/VGeoPageFetcher.d.ts.map +1 -1
  150. package/src/shade/renderer/geometry/virtual/runtime/VGeoPageFetcher.js +0 -1
  151. package/src/shade/renderer/geometry/virtual/runtime/VGeoViewCut.d.ts +60 -14
  152. package/src/shade/renderer/geometry/virtual/runtime/VGeoViewCut.d.ts.map +1 -1
  153. package/src/shade/renderer/geometry/virtual/runtime/VGeoViewCut.js +75 -39
  154. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.d.ts +0 -9
  155. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.d.ts.map +1 -1
  156. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.js +45 -17
  157. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts +7 -3
  158. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts.map +1 -1
  159. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.js +43 -7
  160. package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
  161. package/src/shade/renderer/water/query/GPUWaterQueries.d.ts +1 -1
package/CHANGELOG.md CHANGED
@@ -19,30 +19,31 @@
19
19
  ### Sound: acoustics traced on the GPU, live, through the world the GI traces
20
20
 
21
21
  - **Added:** `GPUAcousticSystem` (`engine/graphics3/`): the acoustic simulation's propagation, traced through the
22
- scene's brick clipmap every frame with nothing baked. The listener emits phonons, which fly from bounce to bounce by
23
- one cosine lobe tilted toward the mirror direction by the surface's scattering (`acoustic_lobe`). Each live
24
- acoustic source traces its direct path through walls at a fixed pattern of 32 points and gathers the phonons' paths
25
- to it. A source hears its direct sound through what the walls let through, its early reflections from where they
26
- arrive, and its reverberation with a decay that follows the room. A listener-centred lattice of receivers answers a
27
- newborn sound until its own first result lands. Kernels and tables in `shade/renderer/acoustics/`.
28
- - **Added:** nothing of the acoustics is averaged over time. Every stored path is joined to the listener where it is
29
- now (`acoustic_reconnect`). A gather lane weighs 64 phonons by what each would bring with nothing in the way and
30
- traces one drawn in proportion (`acoustic_pick`), and keeps a path from frame to frame, traced again each frame
31
- where the listener and the source are (`acoustic_reservoir_lane`). A source takes one to 16 workgroups of lanes: every
32
- live source has one, and 16 more a frame (`ACOUSTIC_PARTS_BUDGET`) are shared by unoccluded loudness
33
- (`EventInstance#currentGain` squared) times the measured spread of each source's estimate
34
- (`acoustic_allocate_parts`, `GPUAcoustics#set_importance`). On the listening page a lone source's reflected levels
35
- move by 0.1 to 0.35 dB rms from frame to frame.
36
- - **Added:** acoustic results reach Web Audio about 5 ms after the frame's listener pose, on a 4090 and on an
37
- integrated GPU alike. The receivers are submitted ahead of the frame's rendering (`FrameContext#early_graph`, a graph
22
+ scene's brick clipmap with nothing baked (`GPUAcousticProbes`, kernels in `shade/renderer/acoustics/`). One probe at
23
+ the listener: 2,048 fixed rays to their first hits each frame, whose surface, volume and absorption give the room's
24
+ mean free path, Eyring's decay per band and its lean. Each heard acoustic source marches its direct path as one cone
25
+ over its disk, the share each occluder leaves open and the walls' transmission of the rest (within 0.05 of the
26
+ geometry across an edge or a floor, read from the field's own distance), and one path from each of the listener's hits,
27
+ its first-order reflections at the listener, the orders after as the room's absorption and the air have them: its
28
+ reverberant energy, through whatever doorway it has to pass, and through walls darkened as their transmission is per
29
+ band. Paths through walls are read from both ends, their cost the same however many walls stand between. Every ray is
30
+ the same every frame, so a still scene reads the same. A source out of hearing is not traced. About 0.31 ms of an AMD
31
+ iGPU with one source, 64 ms with 1,024.
32
+ - **Added:** the path-traced acoustics it was first built on are kept in the tree, unwired: the phonon ring the listener
33
+ emits, gather lanes with reservoirs and a shared ray budget (`GPUAcoustics`), and the lattice. What was measured on
34
+ them and why they were set aside: `simulation/PATH_TRACED_RESEARCH.md`.
35
+ - **Added:** acoustic results reach Web Audio as soon as the device has produced them, not at the next frame. The
36
+ acoustics are submitted ahead of the frame's rendering (`FrameContext#early_graph`, a graph
38
37
  the renderer submits on its own when `FrameStart` ends; `FrameGraph#pass_count`), `GPUDatabaseReadback` starts a
39
38
  batch's mapping at the submit of the frame that recorded it (was the next apply point) and takes an `on_landed`
40
39
  callback, and results are applied when the mapping lands (`AcousticSimulator#refresh`).
41
40
  - **Added:** the listening page, `src/shade/playground/acoustics/`: a hall, a corridor, a soft room and open ground
42
41
  with one source, to walk and hear the acoustics and to read each frame's direct, early and late levels.
43
- - **Added:** `AcousticReverbEffect`, a bus insert: one feedback delay network whose decay per band follows the
44
- acoustic instances that send to it, retuned every frame, and whose output is corrected from a gain model of what its
45
- tail holds, so leaving a room is heard at the new level at once. An acoustic instance sends to the nearest bus above
42
+ - **Added:** `AcousticReverbEffect`, a bus insert: a convolution with a decaying noise whose decay per band follows
43
+ the acoustic instances that send to it (`AcousticReverbConvolution`: Linkwitz–Riley bands, a new decay warmed in a
44
+ second convolver until its tail has built, then crossed over to), and whose output is corrected from a gain model
45
+ of what its tail holds, so leaving a room is heard at the new level at once. `AcousticReverbNetwork` takes its tank:
46
+ the convolution, or `AcousticReverbLines`, the feedback delay network it was first built with. An acoustic instance sends to the nearest bus above
46
47
  its own that has one; with none, its early taps carry all of its early energy.
47
48
  - **Added:** `GPUSceneContext#brick_clipmap` (`GPUSceneBrickClipmap`): the brick clipmap as a scene service that
48
49
  any reader holds, built under any lighting mode while held. The probe clipmap GI holds it.
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "description": "Advanced 3D game engine",
7
7
  "type": "module",
8
8
  "author": "Alexander Goldring",
9
- "version": "3.74.0",
9
+ "version": "3.75.0",
10
10
  "exports": {
11
11
  "./build/*": "./build/*",
12
12
  "./src/*": "./src/*",
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Index of a cell along the 2-D Hilbert curve through a `2^order × 2^order` grid: cells next along the curve are
3
+ * neighbours on the grid, and every run of the curve covers a compact block of it.
4
+ *
5
+ * @param {number} x integer in `[0, 2^order)`
6
+ * @param {number} y integer in `[0, 2^order)`
7
+ * @param {number} order bits per axis, at most 15
8
+ * @returns {number} integer in `[0, 4^order)`
9
+ */
10
+ export function v2_hilbert_encode(x: number, y: number, order: number): number;
11
+ //# sourceMappingURL=v2_hilbert_encode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v2_hilbert_encode.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/2d/hilbert/v2_hilbert_encode.js"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,qCALW,MAAM,KACN,MAAM,SACN,MAAM,GACJ,MAAM,CAoClB"}
@@ -0,0 +1,46 @@
1
+ import { assert } from "../../../assert.js";
2
+
3
+ /**
4
+ * Index of a cell along the 2-D Hilbert curve through a `2^order × 2^order` grid: cells next along the curve are
5
+ * neighbours on the grid, and every run of the curve covers a compact block of it.
6
+ *
7
+ * @param {number} x integer in `[0, 2^order)`
8
+ * @param {number} y integer in `[0, 2^order)`
9
+ * @param {number} order bits per axis, at most 15
10
+ * @returns {number} integer in `[0, 4^order)`
11
+ */
12
+ export function v2_hilbert_encode(x, y, order) {
13
+ assert.isNonNegativeInteger(order, 'order');
14
+ assert.lessThanOrEqual(order, 15, 'order');
15
+ assert.isNonNegativeInteger(x, 'x');
16
+ assert.isNonNegativeInteger(y, 'y');
17
+
18
+ const n = 1 << order;
19
+
20
+ assert.lessThan(x, n, 'x');
21
+ assert.lessThan(y, n, 'y');
22
+
23
+ let d = 0;
24
+
25
+ for (let s = n >> 1; s > 0; s >>= 1) {
26
+ const rx = (x & s) > 0 ? 1 : 0;
27
+ const ry = (y & s) > 0 ? 1 : 0;
28
+
29
+ d += s * s * ((3 * rx) ^ ry);
30
+
31
+ // turn the quadrant so the curve within it runs the same way as at the top level
32
+ if (ry === 0) {
33
+ if (rx === 1) {
34
+ x = s - 1 - (x & (s - 1));
35
+ y = s - 1 - (y & (s - 1));
36
+ }
37
+
38
+ const t = x;
39
+
40
+ x = y;
41
+ y = t;
42
+ }
43
+ }
44
+
45
+ return d;
46
+ }
@@ -141,6 +141,12 @@ export class FrameGraph {
141
141
  * @returns {number}
142
142
  */
143
143
  get pass_count(): number;
144
+ /**
145
+ * Whether nothing has been recorded into it: no pass, no resource, no scope. Such a graph can be handed to the next
146
+ * frame instead of a new one.
147
+ * @returns {boolean}
148
+ */
149
+ get untouched(): boolean;
144
150
  /**
145
151
  * Innermost open recording scope, or null when recording outside of one.
146
152
  * @returns {FrameGraphScope|null}
@@ -1 +1 @@
1
- {"version":3,"file":"FrameGraph.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/FrameGraph.js"],"names":[],"mappings":"AAoBA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH;IAoHI;;;OAGG;IACH,mBAFW,MAAM,EAOhB;IA5HD;;;;OAIG;IACH,MAFU,MAAM,CAEN;IAEV;;;;;;;;;;;;OAYG;IACH,gBAA0B;IAE1B;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,iBAA2B;IAE3B;;;;;;;;;;OAUG;IACH,eAAyB;IAEzB;;;;OAIG;IACH,qBAAkB;IAElB;;;;OAIG;IACH,yBAAsB;IAEtB;;;;OAIG;IACH,4BAAyB;IA+CzB;;;;;OAKG;IACH,oBAEC;IAED;;;OAGG;IACH,yBAEC;IAED;;;OAGG;IACH,6BAEC;IAED;;;;;;;;;;;OAWG;IACH,iBAHW,MAAM,GACJ,eAAe,CAe3B;IAED;;OAEG;IACH,kBAKC;IAED;;;;OAIG;IACH,qBAHW,MAAM,sBAehB;IAED;;;;OAIG;IACH,oBAHW,MAAM,qBAehB;IAED;;;;OAIG;IACH,qBAHW,MAAM,KAKhB;IAED;;;;;OAKG;IACH,2BAJW,MAAM,oBAEJ,MAAM,CAYlB;IAED;;;;;OAKG;IACH,6BAYC;IAED;;;;;;OAMG;IACH,4BAgBC;IAED;;;;OAIG;IACH,wBAHW,MAAM,GACJ,MAAM,CAqBlB;IAED;;;;;;OAMG;IACH,2BALW,MAAM,oCAGJ,MAAM,CAYlB;IAED;;;OAGG;IACH,4BAHa,OAAO,CAQnB;IAED;;;;;;;OAOG;IACH,eALW,MAAM,6CAEe,kBAAkB,WAAW,kBAAkB,KAAK,IAAI,GAC3E,gBAAgB,CA6B5B;IAED;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,mCAHoB,MAAM,WACb,OAAO,CA2DnB;IAED;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,mDAHoB,MAAM,WACb,MAAM,CA+ClB;IAED,gBAwIC;IA2BD;;;OAGG;IACH,iBAFW,kBAAkB,QA4F5B;IA6BD;;;;;;;;;;;;OAYG;IACH,gBAFY;QAAC,MAAM,EAAE,EAAE,CAAC;QAAC,SAAS,EAAE,EAAE,CAAA;KAAC,CA6DtC;IAED;;;;;OAKG;IACH,eAFY,MAAM,CA6LjB;IAGL;;;;OAIG;IACH,uBAFU,OAAO,CAEgB;;CAPhC;iCAloCY,OAAO,yBAAyB,EAAE,kBAAkB;iCACpD,OAAO,kCAAkC,EAAE,kBAAkB;gCAV1C,sBAAsB;8BAKxB,oBAAoB;6BACrB,mBAAmB;mCAFb,yBAAyB;iCAF3B,uBAAuB"}
1
+ {"version":3,"file":"FrameGraph.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/FrameGraph.js"],"names":[],"mappings":"AAoBA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH;IAoHI;;;OAGG;IACH,mBAFW,MAAM,EAOhB;IA5HD;;;;OAIG;IACH,MAFU,MAAM,CAEN;IAEV;;;;;;;;;;;;OAYG;IACH,gBAA0B;IAE1B;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,iBAA2B;IAE3B;;;;;;;;;;OAUG;IACH,eAAyB;IAEzB;;;;OAIG;IACH,qBAAkB;IAElB;;;;OAIG;IACH,yBAAsB;IAEtB;;;;OAIG;IACH,4BAAyB;IA+CzB;;;;;OAKG;IACH,oBAEC;IAED;;;OAGG;IACH,yBAEC;IAED;;;;OAIG;IACH,yBAEC;IAED;;;OAGG;IACH,6BAEC;IAED;;;;;;;;;;;OAWG;IACH,iBAHW,MAAM,GACJ,eAAe,CAe3B;IAED;;OAEG;IACH,kBAKC;IAED;;;;OAIG;IACH,qBAHW,MAAM,sBAehB;IAED;;;;OAIG;IACH,oBAHW,MAAM,qBAehB;IAED;;;;OAIG;IACH,qBAHW,MAAM,KAKhB;IAED;;;;;OAKG;IACH,2BAJW,MAAM,oBAEJ,MAAM,CAYlB;IAED;;;;;OAKG;IACH,6BAYC;IAED;;;;;;OAMG;IACH,4BAgBC;IAED;;;;OAIG;IACH,wBAHW,MAAM,GACJ,MAAM,CAqBlB;IAED;;;;;;OAMG;IACH,2BALW,MAAM,oCAGJ,MAAM,CAYlB;IAED;;;OAGG;IACH,4BAHa,OAAO,CAQnB;IAED;;;;;;;OAOG;IACH,eALW,MAAM,6CAEe,kBAAkB,WAAW,kBAAkB,KAAK,IAAI,GAC3E,gBAAgB,CA6B5B;IAED;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,mCAHoB,MAAM,WACb,OAAO,CA2DnB;IAED;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,mDAHoB,MAAM,WACb,MAAM,CA+ClB;IAED,gBAwIC;IA2BD;;;OAGG;IACH,iBAFW,kBAAkB,QA4F5B;IA6BD;;;;;;;;;;;;OAYG;IACH,gBAFY;QAAC,MAAM,EAAE,EAAE,CAAC;QAAC,SAAS,EAAE,EAAE,CAAA;KAAC,CA6DtC;IAED;;;;;OAKG;IACH,eAFY,MAAM,CA6LjB;IAGL;;;;OAIG;IACH,uBAFU,OAAO,CAEgB;;CAPhC;iCA3oCY,OAAO,yBAAyB,EAAE,kBAAkB;iCACpD,OAAO,kCAAkC,EAAE,kBAAkB;gCAV1C,sBAAsB;8BAKxB,oBAAoB;6BACrB,mBAAmB;mCAFb,yBAAyB;iCAF3B,uBAAuB"}
@@ -215,6 +215,15 @@ export class FrameGraph {
215
215
  return this.__pass_nodes.length;
216
216
  }
217
217
 
218
+ /**
219
+ * Whether nothing has been recorded into it: no pass, no resource, no scope. Such a graph can be handed to the next
220
+ * frame instead of a new one.
221
+ * @returns {boolean}
222
+ */
223
+ get untouched() {
224
+ return this.#state === FrameGraphState.Recording && this.__pass_nodes.length === 0 && this.__resource_registry.length === 0 && this.#scope_count === 0;
225
+ }
226
+
218
227
  /**
219
228
  * Innermost open recording scope, or null when recording outside of one.
220
229
  * @returns {FrameGraphScope|null}
@@ -1,29 +1,25 @@
1
1
  /**
2
- * The GPU acoustics as the simulator reads them ({@link AcousticPropagation}): a receiver a live source, and its
3
- * terms as they last landed. Neutral where there is no device, and for a source whose first result has not landed.
2
+ * The GPU acoustics as the simulator reads them ({@link AcousticPropagation}): a row a live source, its direct path as
3
+ * it last landed, and the reverb the probe at the listener measures. Neutral where there is no device, and for a
4
+ * source whose first result has not landed.
4
5
  */
5
6
  export class GPUAcousticPropagation extends AcousticPropagation {
6
7
  /** The listener the last solve was handed, and whether any was. */
7
8
  listener: Float64Array;
8
9
  has_listener: boolean;
9
10
  /**
10
- * @returns {GPUAcoustics|null}
11
+ * @returns {GPUAcousticProbes|null}
11
12
  */
12
- get acoustics(): GPUAcoustics;
13
- /**
14
- * @returns {GPUAcousticLattice|null} the lattice that primes a newborn source, while there is a device
15
- */
16
- get lattice(): GPUAcousticLattice;
13
+ get acoustics(): GPUAcousticProbes;
17
14
  /**
18
15
  * Take the acoustics of a device, or none. Rows of the acoustics before are the old device's: every source takes
19
16
  * a row anew at its next solve.
20
17
  *
21
- * @param {GPUAcoustics|null} acoustics
22
- * @param {GPUAcousticLattice|null} lattice its lattice, which primes a source as it starts
18
+ * @param {GPUAcousticProbes|null} acoustics
23
19
  */
24
- set_acoustics(acoustics: GPUAcoustics | null, lattice: GPUAcousticLattice | null): void;
20
+ set_acoustics(acoustics: GPUAcousticProbes | null): void;
25
21
  /**
26
- * Sources with a receiver.
22
+ * Sources with a row.
27
23
  * @returns {number}
28
24
  */
29
25
  get source_count(): number;
@@ -32,9 +28,10 @@ export class GPUAcousticPropagation extends AcousticPropagation {
32
28
  /**
33
29
  * # The GPU acoustics of a scene
34
30
  *
35
- * GPU acoustics design, "A frame on the GPU": sound traced through the scene's brick clipmap, the world the probe
36
- * clipmap GI traces, for the {@link AcousticSimulator} it is handed. The system is the simulator's
37
- * {@link AcousticPropagation}: the simulator asks it for each live source's terms and knows nothing of the device.
31
+ * Sound traced through the scene's brick clipmap, the world the probe clipmap GI traces, for the
32
+ * {@link AcousticSimulator} it is handed: one probe at the listener, its rays' first hits the room it stands in, and
33
+ * each heard source's direct path and the share of that room it lights (`GPUAcousticProbes`). Nothing is baked. The system is the simulator's {@link AcousticPropagation}: the simulator asks
34
+ * it for each live source's terms and knows nothing of the device.
38
35
  *
39
36
  * ```js
40
37
  * const simulator = configureAcousticSimulation(configuration, audio_emitter_system);
@@ -48,18 +45,16 @@ export class GPUAcousticPropagation extends AcousticPropagation {
48
45
  * `acoustic_materials` at its row, which the brick clipmap's acoustic payload reads as each brick is built; a
49
46
  * material that changed is written again, and the cells of its row built again. A mesh with no `AcousticBody`
50
47
  * is the engine's default material, `AcousticMaterial`'s own.
51
- * - **Sources.** A live source the simulator solves is a receiver, written when it starts, moves or turns, freed
52
- * when the simulator forgets it ({@link GPUAcousticPropagation}); its terms are its receiver's results as they
53
- * last landed: the direct path's energy, the early energy and where it comes from, the late energy, its lean and
54
- * its time constant, the late energy's centre time measured from the early/late boundary. Until its first result
55
- * lands it hears its prior, the lattice's terms about it (`GPUAcousticLattice`); where the lattice has none about
56
- * it, the neutral solution.
48
+ * - **Sources.** A live source the simulator solves is a row, written when it starts or moves, freed when the simulator
49
+ * forgets it ({@link GPUAcousticPropagation}); it is traced in the frames it is heard. Its terms are its direct path
50
+ * and its share of the room as they last landed, and the room's reverb; until its first result lands, the neutral
51
+ * solution.
57
52
  * - **The apply point**: the results that landed since the last update.
58
53
  *
59
54
  * ## The GPU half, at `FramePhase.FrameStart`
60
55
  *
61
- * The phonon ring's step from the listener, then every live receiver, a workgroup each, traced through the bricks the
62
- * scene's clipmap holds from the frames before, and the results read back (`GPUAcoustics`). Nothing while the scene's
56
+ * The listener's rays and the room they make, then the heard sources' coupling and direct paths, traced through the
57
+ * bricks the scene's clipmap holds from the frames before, and what they wrote read back. Nothing while the scene's
63
58
  * clipmap is not built yet, or before the simulator has solved with a listener.
64
59
  *
65
60
  * ## Delivery
@@ -70,10 +65,13 @@ export class GPUAcousticPropagation extends AcousticPropagation {
70
65
  *
71
66
  * ## Lifetime
72
67
  *
73
- * Its device state is made when the scene first has a context: the ring and the receivers, the bricks' acoustic
74
- * records, and a hold on the scene's brick clipmap with the records as its payload, which has the clipmap built
75
- * under any lighting mode. A new context (a device restart) drops them with the old device and makes them again;
76
- * shutdown gives them back and the simulator its own propagation back.
68
+ * Its device state is made when the scene first has a context: the rows and the room, the bricks' acoustic records,
69
+ * and a hold on the scene's brick clipmap with the records as its payload, which has the clipmap built under any
70
+ * lighting mode. A new context (a device restart) drops them with the old device and makes them again; shutdown gives
71
+ * them back and the simulator its own propagation back.
72
+ *
73
+ * The path-traced acoustics (`GPUAcoustics`: the phonon ring, its receivers and the lattice) are in the tree, unwired:
74
+ * `simulation/PATH_TRACED_RESEARCH.md`.
77
75
  */
78
76
  export class GPUAcousticSystem extends System<any> {
79
77
  /**
@@ -108,8 +106,8 @@ export class GPUAcousticSystem extends System<any> {
108
106
  unlink(body: AcousticBody, entity: number): void;
109
107
  update(time_delta: any): void;
110
108
  /**
111
- * The frame's GPU work, at `FramePhase.FrameStart`: every live receiver, through the bricks as the frames before
112
- * left them. Recorded into the graph the renderer submits ahead of the frame (`FrameContext#early_graph`), so the
109
+ * The frame's GPU work, at `FramePhase.FrameStart`: the listener's rays and the room, then the heard sources, through
110
+ * the bricks as the frames before left them. Recorded into the graph the renderer submits ahead of the frame (`FrameContext#early_graph`), so the
113
111
  * readback lands as soon as this work is done rather than behind the frame's rendering.
114
112
  *
115
113
  * @param {FrameContext} frame
@@ -123,7 +121,7 @@ export class GPUAcousticSystem extends System<any> {
123
121
  #private;
124
122
  }
125
123
  /**
126
- * Records {@link GPUAcousticSystem}'s ring and receivers at the start of a frame.
124
+ * Records {@link GPUAcousticSystem}'s listener, room and sources at the start of a frame.
127
125
  */
128
126
  export class GPUAcousticExtension extends RenderExtension {
129
127
  /**
@@ -138,8 +136,7 @@ export type AcousticSimulator = import("../sound/simulation/AcousticSimulator.js
138
136
  export type AcousticSolution = import("../sound/simulation/core/AcousticSolution.js").AcousticSolution;
139
137
  export type EventInstance = import("../sound/sopra/runtime/EventInstance.js").EventInstance;
140
138
  import { AcousticPropagation } from "../sound/simulation/core/AcousticPropagation.js";
141
- import { GPUAcoustics } from "../../shade/renderer/acoustics/GPUAcoustics.js";
142
- import { GPUAcousticLattice } from "../../shade/renderer/acoustics/GPUAcousticLattice.js";
139
+ import { GPUAcousticProbes } from "../../shade/renderer/acoustics/GPUAcousticProbes.js";
143
140
  import { System } from "../ecs/System.js";
144
141
  import { AcousticBody } from "../sound/simulation/ecs/AcousticBody.js";
145
142
  import { RenderExtension } from "../../shade/renderer/extension/RenderExtension.js";
@@ -1 +1 @@
1
- {"version":3,"file":"GPUAcousticSystem.d.ts","sourceRoot":"","sources":["../../../../src/engine/graphics3/GPUAcousticSystem.js"],"names":[],"mappings":"AAsFA;;;GAGG;AACH;IAsBI,mEAAmE;IACnE,uBAA+B;IAC/B,sBAAqB;IAErB;;OAEG;IACH,8BAEC;IAED;;OAEG;IACH,kCAEC;IAED;;;;;;OAMG;IACH,yBAHW,YAAY,GAAC,IAAI,WACjB,kBAAkB,GAAC,IAAI,QAMjC;IAED;;;OAGG;IACH,2BAEC;;CAmLJ;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH;IAEI;;;;OAIG;IACH,iCAFW,OAAO,gDAAgD,EAAE,eAAe,QAKlF;IAyDD;;;;OAIG;IACH,sBAJW,OAAO,qBAAqB,EAAE,cAAc,SAC5C,OAAO,qCAAqC,EAAE,KAAK,aACnD,iBAAiB,EAY3B;IAtED,sCAA8B;IAwE9B;;;OAGG;IACH,0CAEC;IAED,2CAKC;IAED,4CAWC;IAED;;;OAGG;IACH,WAHW,YAAY,UACZ,MAAM,QAQhB;IAED;;;OAGG;IACH,aAHW,YAAY,UACZ,MAAM,QAiBhB;IAED,8BAmBC;IAED;;;;;;OAMG;IACH,eAFW,YAAY,QAyCtB;IA8IL;;;OAGG;IACH,8BAFU,OAAO,CAE8B;;CAN9C;AAQD;;GAEG;AACH;IAII;;OAEG;IACH,oBAFW,iBAAiB,EAM3B;IADG,0BAAoB;CAgB3B;8BAxuBY,OAAO,+CAA+C,EAAE,eAAe;2BACvE,OAAO,gDAAgD,EAAE,YAAY;gCACrE,OAAO,0CAA0C,EAAE,iBAAiB;+BACpE,OAAO,8CAA8C,EAAE,gBAAgB;4BACvE,OAAO,yCAAyC,EAAE,aAAa;oCAVxC,iDAAiD;6BAVhC,gDAAgD;mCADjC,sDAAsD;uBAUnG,kBAAkB;6BAGZ,yCAAyC;gCAPtC,mDAAmD"}
1
+ {"version":3,"file":"GPUAcousticSystem.d.ts","sourceRoot":"","sources":["../../../../src/engine/graphics3/GPUAcousticSystem.js"],"names":[],"mappings":"AA2DA;;;;GAIG;AACH;IAgBI,mEAAmE;IACnE,uBAA+B;IAC/B,sBAAqB;IAErB;;OAEG;IACH,mCAEC;IAED;;;;;OAKG;IACH,yBAFW,iBAAiB,GAAC,IAAI,QAKhC;IAED;;;OAGG;IACH,2BAEC;;CAwJJ;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH;IAEI;;;;OAIG;IACH,iCAFW,OAAO,gDAAgD,EAAE,eAAe,QAKlF;IAsDD;;;;OAIG;IACH,sBAJW,OAAO,qBAAqB,EAAE,cAAc,SAC5C,OAAO,qCAAqC,EAAE,KAAK,aACnD,iBAAiB,EAY3B;IAnED,sCAA8B;IAqE9B;;;OAGG;IACH,0CAEC;IAED,2CAKC;IAED,4CAWC;IAED;;;OAGG;IACH,WAHW,YAAY,UACZ,MAAM,QAQhB;IAED;;;OAGG;IACH,aAHW,YAAY,UACZ,MAAM,QAiBhB;IAED,8BAmBC;IAED;;;;;;OAMG;IACH,eAFW,YAAY,QAsCtB;IA2IL;;;OAGG;IACH,8BAFU,OAAO,CAE8B;;CAN9C;AAQD;;GAEG;AACH;IAII;;OAEG;IACH,oBAFW,iBAAiB,EAM3B;IADG,0BAAoB;CAgB3B;8BA7pBY,OAAO,+CAA+C,EAAE,eAAe;2BACvE,OAAO,gDAAgD,EAAE,YAAY;gCACrE,OAAO,0CAA0C,EAAE,iBAAiB;+BACpE,OAAO,8CAA8C,EAAE,gBAAgB;4BACvE,OAAO,yCAAyC,EAAE,aAAa;oCATxC,iDAAiD;kCAT9E,qDAAqD;uBAQrC,kBAAkB;6BAGZ,yCAAyC;gCANtC,mDAAmD"}