@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
@@ -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
 
@@ -1 +1 @@
1
- {"version":3,"file":"diff_traced_against_rasterized.d.ts","sourceRoot":"","sources":["../../../../../src/shade/playground/skinned_blas_refit/diff_traced_against_rasterized.js"],"names":[],"mappings":"AAuaA;;GAEG;AACH,2CAEC;AAoED;;;;;;;;;;;;;;;GAeG;AACH;IAT6B,QAAQ;IACC,MAAM;IAClB,KAAK;IACc,OAAO,UAAhC,OAAO,KAAG,IAAI;IAEN,OAAO,GAAxB,MAAM;IAEJ,QAAQ,MAAM,CAAC,CA2O3B"}
1
+ {"version":3,"file":"diff_traced_against_rasterized.d.ts","sourceRoot":"","sources":["../../../../../src/shade/playground/skinned_blas_refit/diff_traced_against_rasterized.js"],"names":[],"mappings":"AAsaA;;GAEG;AACH,2CAEC;AAoED;;;;;;;;;;;;;;;GAeG;AACH;IAT6B,QAAQ;IACC,MAAM;IAClB,KAAK;IACc,OAAO,UAAhC,OAAO,KAAG,IAAI;IAEN,OAAO,GAAxB,MAAM;IAEJ,QAAQ,MAAM,CAAC,CA2O3B"}
@@ -1,5 +1,6 @@
1
1
  import { use_flat_environment } from "./flat_environment.js";
2
2
  import { number_compare_descending } from "../../../core/primitives/numbers/number_compare_descending.js";
3
+ import { GPUTextureContext } from "../../renderer/texture/GPUTextureContext.js";
3
4
 
4
5
  /**
5
6
  * Render the current view both ways and show, pixel by pixel, where they disagree.
@@ -163,11 +164,9 @@ function is_background(data, i, sky, tolerance) {
163
164
  * them identical. `render_to_target` exists for precisely this, and its own documentation says so.
164
165
  *
165
166
  * @param {Renderer} renderer
166
- * @returns {Promise<{texture: GPUTexture, target: GPUTextureContext, width: number, height: number, bytes_per_row: number, buffer: GPUBuffer, destroy: function(): void}>}
167
+ * @returns {{texture: GPUTexture, target: GPUTextureContext, width: number, height: number, bytes_per_row: number, buffer: GPUBuffer, destroy: function(): void}}
167
168
  */
168
- async function make_capture_target(renderer) {
169
- const { GPUTextureContext } = await import('../../renderer/texture/GPUTextureContext.js');
170
-
169
+ function make_capture_target(renderer) {
171
170
  const device = renderer.graphics.device;
172
171
 
173
172
  const resolution = renderer.output_resolution;
@@ -550,7 +549,7 @@ export async function diff_traced_against_rasterized({
550
549
  // long one, the number is still falling and no verdict off it is worth anything yet.
551
550
  let control;
552
551
 
553
- const capture = await make_capture_target(renderer);
552
+ const capture = make_capture_target(renderer);
554
553
 
555
554
  try {
556
555
  control = await render_and_read(renderer, camera, scene, capture, true, control_frames);
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../../../src/shade/playground/skinned_blas_refit/main.js"],"names":[],"mappings":"AAiQA;;;;;GAKG;AACH,yBAFa,QAAQ,IAAI,CAAC,CAiiBzB"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../../../src/shade/playground/skinned_blas_refit/main.js"],"names":[],"mappings":"AAoQA;;;;;GAKG;AACH,yBAFa,QAAQ,IAAI,CAAC,CAwhBzB"}
@@ -22,7 +22,10 @@ import { load_default_environment } from "../load_default_environment.js";
22
22
  import { make_playground_asset_manager } from "../make_playground_asset_manager.js";
23
23
  import { render_submitted_frames } from "../render_submitted_frames.js";
24
24
  import { add_floor } from "./add_floor.js";
25
+ import { clear_diff_overlay, diff_traced_against_rasterized } from "./diff_traced_against_rasterized.js";
25
26
  import { geometry_of, grid_position, place_character } from "./place_character.js";
27
+ import { verify_clone_leaves } from "./verify_clone_leaves.js";
28
+ import { verify_leaf_correspondence, verify_skinned_blas_refit } from "./verify_skinned_blas_refit.js";
26
29
 
27
30
  /**
28
31
  * A dancing character under the path tracer — the browser tier for the per-frame BLAS refit.
@@ -324,9 +327,7 @@ export async function start() {
324
327
  // root box against the bounds-refresh chain's box over the same deformed vertices. Useful when
325
328
  // the page cannot be looked at — a browser stops calling `requestAnimationFrame` for a page it
326
329
  // is not compositing, so a hidden tab renders no frames to look at in the first place.
327
- globalThis.verify = async () => paused(async () => {
328
- const { verify_skinned_blas_refit } = await import('./verify_skinned_blas_refit.js');
329
-
330
+ globalThis.verify = async () => paused(() => {
330
331
  return verify_skinned_blas_refit({ renderer, camera, scene, entity: globalThis.dancers[0] });
331
332
  });
332
333
 
@@ -334,18 +335,14 @@ export async function start() {
334
335
  // names. Run against the character's *source* geometry — skinning deforms the clone's vertex
335
336
  // region and leaves the source's alone, so the tree the builder wrote for it is still the right
336
337
  // answer and is there to compare against.
337
- globalThis.verify_leaves = async () => {
338
- const { verify_leaf_correspondence } = await import('./verify_skinned_blas_refit.js');
339
-
338
+ globalThis.verify_leaves = () => {
340
339
  return verify_leaf_correspondence({ renderer, geometry: geometry_of(dataset, globalThis.dancers[0]) });
341
340
  };
342
341
 
343
342
  // The same question of the *clone*, live: after the frame's refit, does every leaf of the
344
343
  // dancer's own tree bound the deformed triangle the intersector fetches for it? Reports the
345
344
  // pattern of any that do not — runs of leaves, and the workgroups they fall in.
346
- globalThis.verify_clone_leaves = async () => paused(async () => {
347
- const { verify_clone_leaves } = await import('./verify_clone_leaves.js');
348
-
345
+ globalThis.verify_clone_leaves = async () => paused(() => {
349
346
  return verify_clone_leaves({ renderer, scene, entity: globalThis.dancers[0] });
350
347
  });
351
348
 
@@ -417,9 +414,6 @@ export async function start() {
417
414
  let frame_loop_suspended = false;
418
415
 
419
416
  element('diff').addEventListener('click', async () => {
420
- const { clear_diff_overlay, diff_traced_against_rasterized } =
421
- await import('./diff_traced_against_rasterized.js');
422
-
423
417
  if (diff_showing) {
424
418
  clear_diff_overlay();
425
419
 
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../../../src/shade/playground/skinned_mesh_soup/main.js"],"names":[],"mappings":"AAgMA;;;;GAIG;AACH,yBAFa,QAAQ,IAAI,CAAC,CAiTzB"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../../../src/shade/playground/skinned_mesh_soup/main.js"],"names":[],"mappings":"AAiMA;;;;GAIG;AACH,yBAFa,QAAQ,IAAI,CAAC,CA+SzB"}
@@ -26,6 +26,7 @@ import { Scene } from "../../renderer/scene/Scene.js";
26
26
  import { load_default_environment } from "../load_default_environment.js";
27
27
  import { render_submitted_frames } from "../render_submitted_frames.js";
28
28
  import { grid_position, place_character } from "../skinned_blas_refit/place_character.js";
29
+ import { verify_clone_vertices } from "./verify_clone_vertices.js";
29
30
 
30
31
  /**
31
32
  * A skinned character, loaded the way the game loads one, with the pieces that could be making soup
@@ -439,8 +440,6 @@ export async function start() {
439
440
  * and address patch are right, which is worth knowing on its own.
440
441
  */
441
442
  globalThis.diagnose = async () => {
442
- const { verify_clone_vertices } = await import('./verify_clone_vertices.js');
443
-
444
443
  const was_animating = animating;
445
444
 
446
445
  animating = false;
@@ -383,8 +383,8 @@ at that size. A quarter-sized window is not a smaller version of this test.
383
383
 
384
384
  ### The bound raises itself
385
385
 
386
- Nothing here pins it. `GPUVirtualGeometryRuntime.note_incomplete_descent` takes the one reading that
387
- says the descent was truncated and **doubles the bound, permanently**, which is the same shape the
386
+ Nothing here pins it. `VGeoViewCut.note_incomplete_descent` takes the one reading that says a view's
387
+ descent was truncated and **doubles that view's bound, permanently**, which is the same shape the
388
388
  rasterizer already uses for meshlet counts: a quantity that cannot be known before the work runs,
389
389
  learned from what the work reported, kept as a high-water mark.
390
390
 
@@ -397,6 +397,16 @@ and a bound that fell back would re-learn the same lesson at a hole a time every
397
397
  turned away and back. An unused wavefront is an empty indirect dispatch, which is the cheap side of
398
398
  that trade.
399
399
 
400
+ Only a frame cut under the current bound can raise it. Readings land frames after their cut, two at
401
+ a time, so the frame after a truncated one was cut under the same bound and reports the same
402
+ shortfall; counting both would double past what the view needs. A bound above what the view uses —
403
+ up to twice it — is the bound working, not slack to win back.
404
+
405
+ **The panel shows when either rule breaks.** A view escalates at most three times from 8, so an `↑`
406
+ count past three, or a bound that moves *down*, means something is lowering it — and every time it
407
+ falls below what the view needs is a frame with a hole in it, camera still. On this scene at the
408
+ Zorah dome that read `13 / 8 (335↑)` and blinked ironwork about twice a second.
409
+
400
410
  **What it costs when it is wrong is one frame.** Measured cold at 3419×1286 on the reported
401
411
  viewpoint: `queue_remaining` non-zero on **1 frame of 600**, and zero for the rest of the session.
402
412
  The ceiling is 64, so the worst case is three such frames, once, ever.
@@ -1682,7 +1682,7 @@ async function start() {
1682
1682
  queue_capacity: 1 << 18,
1683
1683
  /*
1684
1684
  The wavefront bound is the engine's and is deliberately **not** set here. It starts at 8
1685
- and `GPUVirtualGeometryRuntime.note_incomplete_descent` raises it from what the cut
1685
+ and `VGeoViewCut.note_incomplete_descent` raises it from what the view's cut
1686
1686
  reports, so this page gets the same escalation any host does — and pinning it here would
1687
1687
  hide the one behaviour worth watching from the page best placed to watch it.
1688
1688