@woosh/meep-engine 3.68.0 → 3.69.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 (190) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/editor/ecs/component/editors/ecs/Trail3DEditor.d.ts +2 -17
  3. package/editor/ecs/component/editors/ecs/Trail3DEditor.d.ts.map +1 -1
  4. package/editor/ecs/component/editors/ecs/Trail3DEditor.js +3 -18
  5. package/package.json +1 -1
  6. package/src/engine/graphics/ecs/trail3d/Trail3D.d.ts +33 -65
  7. package/src/engine/graphics/ecs/trail3d/Trail3D.d.ts.map +1 -1
  8. package/src/engine/graphics/ecs/trail3d/Trail3D.js +37 -245
  9. package/src/engine/graphics/ecs/trail3d/Trail3DFlags.d.ts +0 -4
  10. package/src/engine/graphics/ecs/trail3d/Trail3DFlags.js +4 -10
  11. package/src/engine/graphics/ecs/trail3d/seed_trail_stroke.d.ts +13 -10
  12. package/src/engine/graphics/ecs/trail3d/seed_trail_stroke.d.ts.map +1 -1
  13. package/src/engine/graphics/ecs/trail3d/seed_trail_stroke.js +28 -37
  14. package/src/engine/graphics/ecs/trail3d/trail_knot_count.d.ts +10 -0
  15. package/src/engine/graphics/ecs/trail3d/trail_knot_count.d.ts.map +1 -0
  16. package/src/engine/graphics/ecs/trail3d/trail_knot_count.js +27 -0
  17. package/src/engine/graphics/trail/TrailKnots.d.ts +62 -0
  18. package/src/engine/graphics/trail/TrailKnots.d.ts.map +1 -0
  19. package/src/engine/graphics/trail/TrailKnots.js +137 -0
  20. package/src/engine/graphics/trail/tube/TubeXMaterialSpec.d.ts +1 -1
  21. package/src/engine/graphics/trail/tube/TubeXMaterialSpec.js +1 -1
  22. package/src/engine/graphics3/EntityRowHold.d.ts +48 -0
  23. package/src/engine/graphics3/EntityRowHold.d.ts.map +1 -0
  24. package/src/engine/graphics3/EntityRowHold.js +128 -0
  25. package/src/engine/graphics3/GPUParticleEmitterSystem.d.ts +6 -2
  26. package/src/engine/graphics3/GPUParticleEmitterSystem.d.ts.map +1 -1
  27. package/src/engine/graphics3/GPUParticleEmitterSystem.js +11 -44
  28. package/src/engine/graphics3/Trail3DSystem.d.ts +69 -35
  29. package/src/engine/graphics3/Trail3DSystem.d.ts.map +1 -1
  30. package/src/engine/graphics3/Trail3DSystem.js +380 -81
  31. package/src/engine/physics/fluid/ecs/FluidObstacle.d.ts +17 -0
  32. package/src/engine/physics/fluid/ecs/FluidObstacle.d.ts.map +1 -1
  33. package/src/engine/physics/fluid/ecs/FluidObstacle.js +22 -2
  34. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +6 -5
  35. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts.map +1 -1
  36. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.js +14 -3
  37. package/src/engine/physics/fluid/obstacle/FLUID_OBSTACLE_RECORD_STRUCT.d.ts +9 -1
  38. package/src/engine/physics/fluid/obstacle/FLUID_OBSTACLE_RECORD_STRUCT.d.ts.map +1 -1
  39. package/src/engine/physics/fluid/obstacle/FLUID_OBSTACLE_RECORD_STRUCT.js +11 -1
  40. package/src/engine/physics/fluid/obstacle/fluid_obstacle_record_create.d.ts +5 -0
  41. package/src/engine/physics/fluid/obstacle/fluid_obstacle_record_create.d.ts.map +1 -1
  42. package/src/engine/physics/fluid/obstacle/fluid_obstacle_record_create.js +2 -0
  43. package/src/engine/physics/fluid/obstacle/fluid_obstacle_write_gpu_record.d.ts +4 -3
  44. package/src/engine/physics/fluid/obstacle/fluid_obstacle_write_gpu_record.d.ts.map +1 -1
  45. package/src/engine/physics/fluid/obstacle/fluid_obstacle_write_gpu_record.js +11 -3
  46. package/src/shade/playground/trails/index.html +50 -0
  47. package/src/shade/playground/trails/main.d.ts +2 -0
  48. package/src/shade/playground/trails/main.d.ts.map +1 -0
  49. package/src/shade/playground/trails/main.js +258 -0
  50. package/src/shade/renderer/animation/animation_curve_write_keys.d.ts +18 -0
  51. package/src/shade/renderer/animation/animation_curve_write_keys.d.ts.map +1 -0
  52. package/src/shade/renderer/animation/animation_curve_write_keys.js +34 -0
  53. package/src/shade/renderer/deferred/tonemap/ColorGrade.d.ts.map +1 -1
  54. package/src/shade/renderer/deferred/tonemap/ColorGrade.js +13 -36
  55. package/src/shade/renderer/dynamic/GPUDynamicMeshResidency.js +2 -2
  56. package/src/shade/renderer/dynamic/chunk_dynamic_mesh_avboit_vertex.d.ts +2 -13
  57. package/src/shade/renderer/dynamic/chunk_dynamic_mesh_avboit_vertex.d.ts.map +1 -1
  58. package/src/shade/renderer/dynamic/chunk_dynamic_mesh_avboit_vertex.js +6 -21
  59. package/src/shade/renderer/dynamic/graph_dynamic_mesh_avboit.d.ts +17 -6
  60. package/src/shade/renderer/dynamic/graph_dynamic_mesh_avboit.d.ts.map +1 -1
  61. package/src/shade/renderer/dynamic/graph_dynamic_mesh_avboit.js +38 -178
  62. package/src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_draw.d.ts +7 -9
  63. package/src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_draw.d.ts.map +1 -1
  64. package/src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_draw.js +17 -106
  65. package/src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_splat.d.ts +7 -17
  66. package/src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_splat.d.ts.map +1 -1
  67. package/src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_splat.js +18 -118
  68. package/src/shade/renderer/fluid/forcing/FLUID_FORCING.d.ts +14 -0
  69. package/src/shade/renderer/fluid/forcing/FLUID_FORCING.d.ts.map +1 -1
  70. package/src/shade/renderer/fluid/forcing/FLUID_FORCING.js +18 -0
  71. package/src/shade/renderer/fluid/forcing/FLUID_FORCING_APPLY_STRUCT.d.ts +3 -1
  72. package/src/shade/renderer/fluid/forcing/FLUID_FORCING_APPLY_STRUCT.d.ts.map +1 -1
  73. package/src/shade/renderer/fluid/forcing/FLUID_FORCING_APPLY_STRUCT.js +4 -1
  74. package/src/shade/renderer/fluid/forcing/GPUFluidForcing.d.ts +9 -0
  75. package/src/shade/renderer/fluid/forcing/GPUFluidForcing.d.ts.map +1 -1
  76. package/src/shade/renderer/fluid/forcing/GPUFluidForcing.js +20 -4
  77. package/src/shade/renderer/fluid/forcing/chunk_fluid_forcing_cell.d.ts +11 -2
  78. package/src/shade/renderer/fluid/forcing/chunk_fluid_forcing_cell.d.ts.map +1 -1
  79. package/src/shade/renderer/fluid/forcing/chunk_fluid_forcing_cell.js +59 -2
  80. package/src/shade/renderer/fluid/forcing/shader_fluid_forcing_apply.d.ts +4 -1
  81. package/src/shade/renderer/fluid/forcing/shader_fluid_forcing_apply.d.ts.map +1 -1
  82. package/src/shade/renderer/fluid/forcing/shader_fluid_forcing_apply.js +367 -341
  83. package/src/shade/renderer/fluid/mac/shader_fluid_mac_advect_correct.d.ts +6 -2
  84. package/src/shade/renderer/fluid/mac/shader_fluid_mac_advect_correct.d.ts.map +1 -1
  85. package/src/shade/renderer/fluid/mac/shader_fluid_mac_advect_correct.js +339 -282
  86. package/src/shade/renderer/grass/press/shader_grass_press_mark.d.ts +3 -2
  87. package/src/shade/renderer/grass/press/shader_grass_press_mark.d.ts.map +1 -1
  88. package/src/shade/renderer/grass/press/shader_grass_press_mark.js +5 -3
  89. package/src/shade/renderer/rasterize/native/avboit/avboit_unlit_draw.d.ts +49 -0
  90. package/src/shade/renderer/rasterize/native/avboit/avboit_unlit_draw.d.ts.map +1 -0
  91. package/src/shade/renderer/rasterize/native/avboit/avboit_unlit_draw.js +144 -0
  92. package/src/shade/renderer/rasterize/native/avboit/avboit_unlit_splat.d.ts +71 -0
  93. package/src/shade/renderer/rasterize/native/avboit/avboit_unlit_splat.d.ts.map +1 -0
  94. package/src/shade/renderer/rasterize/native/avboit/avboit_unlit_splat.js +152 -0
  95. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_unlit_varyings.d.ts +21 -0
  96. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_unlit_varyings.d.ts.map +1 -0
  97. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_unlit_varyings.js +30 -0
  98. package/src/shade/renderer/rasterize/native/avboit/graph_avboit_unlit.d.ts +101 -0
  99. package/src/shade/renderer/rasterize/native/avboit/graph_avboit_unlit.d.ts.map +1 -0
  100. package/src/shade/renderer/rasterize/native/avboit/graph_avboit_unlit.js +306 -0
  101. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_splat.d.ts +9 -0
  102. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_splat.d.ts.map +1 -1
  103. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_splat.js +11 -4
  104. package/src/shade/renderer/trails/GPUTrailAVBOITChannel.d.ts +69 -0
  105. package/src/shade/renderer/trails/GPUTrailAVBOITChannel.d.ts.map +1 -0
  106. package/src/shade/renderer/trails/GPUTrailAVBOITChannel.js +129 -0
  107. package/src/shade/renderer/trails/GPUTrailSystem.d.ts +164 -0
  108. package/src/shade/renderer/trails/GPUTrailSystem.d.ts.map +1 -0
  109. package/src/shade/renderer/trails/GPUTrailSystem.js +725 -0
  110. package/src/shade/renderer/trails/data/TRAIL_DATABASE_SPEC.d.ts +14 -0
  111. package/src/shade/renderer/trails/data/TRAIL_DATABASE_SPEC.d.ts.map +1 -0
  112. package/src/shade/renderer/trails/data/TRAIL_DATABASE_SPEC.js +38 -0
  113. package/src/shade/renderer/trails/data/TRAIL_KNOT.d.ts +66 -0
  114. package/src/shade/renderer/trails/data/TRAIL_KNOT.d.ts.map +1 -0
  115. package/src/shade/renderer/trails/data/TRAIL_KNOT.js +154 -0
  116. package/src/shade/renderer/trails/data/TRAIL_RECORD.d.ts +19 -0
  117. package/src/shade/renderer/trails/data/TRAIL_RECORD.d.ts.map +1 -0
  118. package/src/shade/renderer/trails/data/TRAIL_RECORD.js +68 -0
  119. package/src/shade/renderer/trails/data/TRAIL_STATE.d.ts +18 -0
  120. package/src/shade/renderer/trails/data/TRAIL_STATE.d.ts.map +1 -0
  121. package/src/shade/renderer/trails/data/TRAIL_STATE.js +43 -0
  122. package/src/shade/renderer/trails/graph_trails.d.ts +58 -0
  123. package/src/shade/renderer/trails/graph_trails.d.ts.map +1 -0
  124. package/src/shade/renderer/trails/graph_trails.js +155 -0
  125. package/src/shade/renderer/trails/graph_trails_avboit.d.ts +126 -0
  126. package/src/shade/renderer/trails/graph_trails_avboit.d.ts.map +1 -0
  127. package/src/shade/renderer/trails/graph_trails_avboit.js +300 -0
  128. package/src/shade/renderer/trails/runtime/TrailFadeCurves.d.ts +56 -0
  129. package/src/shade/renderer/trails/runtime/TrailFadeCurves.d.ts.map +1 -0
  130. package/src/shade/renderer/trails/runtime/TrailFadeCurves.js +220 -0
  131. package/src/shade/renderer/trails/runtime/TrailKnotPool.d.ts +49 -0
  132. package/src/shade/renderer/trails/runtime/TrailKnotPool.d.ts.map +1 -0
  133. package/src/shade/renderer/trails/runtime/TrailKnotPool.js +162 -0
  134. package/src/shade/renderer/trails/runtime/TrailParameters.d.ts +52 -0
  135. package/src/shade/renderer/trails/runtime/TrailParameters.d.ts.map +1 -0
  136. package/src/shade/renderer/trails/runtime/TrailParameters.js +126 -0
  137. package/src/shade/renderer/trails/shaders/chunk_trail_frame_transport.d.ts +23 -0
  138. package/src/shade/renderer/trails/shaders/chunk_trail_frame_transport.d.ts.map +1 -0
  139. package/src/shade/renderer/trails/shaders/chunk_trail_frame_transport.js +57 -0
  140. package/src/shade/renderer/trails/shaders/chunk_trail_knot_alpha.d.ts +14 -0
  141. package/src/shade/renderer/trails/shaders/chunk_trail_knot_alpha.d.ts.map +1 -0
  142. package/src/shade/renderer/trails/shaders/chunk_trail_knot_alpha.js +40 -0
  143. package/src/shade/renderer/trails/shaders/chunk_trail_seed.d.ts +18 -0
  144. package/src/shade/renderer/trails/shaders/chunk_trail_seed.d.ts.map +1 -0
  145. package/src/shade/renderer/trails/shaders/chunk_trail_seed.js +64 -0
  146. package/src/shade/renderer/trails/shaders/chunk_trail_segment.d.ts +14 -0
  147. package/src/shade/renderer/trails/shaders/chunk_trail_segment.d.ts.map +1 -0
  148. package/src/shade/renderer/trails/shaders/chunk_trail_segment.js +51 -0
  149. package/src/shade/renderer/trails/shaders/chunk_trail_update.d.ts +48 -0
  150. package/src/shade/renderer/trails/shaders/chunk_trail_update.d.ts.map +1 -0
  151. package/src/shade/renderer/trails/shaders/chunk_trail_update.js +197 -0
  152. package/src/shade/renderer/trails/shaders/chunk_trail_vertex.d.ts +34 -0
  153. package/src/shade/renderer/trails/shaders/chunk_trail_vertex.d.ts.map +1 -0
  154. package/src/shade/renderer/trails/shaders/chunk_trail_vertex.js +111 -0
  155. package/src/shade/renderer/trails/shaders/shader_trail_avboit.d.ts +24 -0
  156. package/src/shade/renderer/trails/shaders/shader_trail_avboit.d.ts.map +1 -0
  157. package/src/shade/renderer/trails/shaders/shader_trail_avboit.js +78 -0
  158. package/src/shade/renderer/trails/shaders/shader_trail_avboit_segments.d.ts +23 -0
  159. package/src/shade/renderer/trails/shaders/shader_trail_avboit_segments.d.ts.map +1 -0
  160. package/src/shade/renderer/trails/shaders/shader_trail_avboit_segments.js +130 -0
  161. package/src/shade/renderer/trails/shaders/shader_trail_draw_args.d.ts +29 -0
  162. package/src/shade/renderer/trails/shaders/shader_trail_draw_args.d.ts.map +1 -0
  163. package/src/shade/renderer/trails/shaders/shader_trail_draw_args.js +78 -0
  164. package/src/shade/renderer/trails/shaders/shader_trail_seed.d.ts +18 -0
  165. package/src/shade/renderer/trails/shaders/shader_trail_seed.d.ts.map +1 -0
  166. package/src/shade/renderer/trails/shaders/shader_trail_seed.js +79 -0
  167. package/src/shade/renderer/trails/shaders/shader_trail_update.d.ts +20 -0
  168. package/src/shade/renderer/trails/shaders/shader_trail_update.d.ts.map +1 -0
  169. package/src/shade/renderer/trails/shaders/shader_trail_update.js +101 -0
  170. package/src/engine/graphics/ecs/trail3d/advance_trail.d.ts +0 -18
  171. package/src/engine/graphics/ecs/trail3d/advance_trail.d.ts.map +0 -1
  172. package/src/engine/graphics/ecs/trail3d/advance_trail.js +0 -42
  173. package/src/engine/graphics/ecs/trail3d/seed_trail_tube.d.ts +0 -14
  174. package/src/engine/graphics/ecs/trail3d/seed_trail_tube.d.ts.map +0 -1
  175. package/src/engine/graphics/ecs/trail3d/seed_trail_tube.js +0 -75
  176. package/src/engine/graphics/ecs/trail3d/trail_head_position.d.ts +0 -17
  177. package/src/engine/graphics/ecs/trail3d/trail_head_position.d.ts.map +0 -1
  178. package/src/engine/graphics/ecs/trail3d/trail_head_position.js +0 -19
  179. package/src/engine/graphics/trail/tube/TubeX.d.ts +0 -186
  180. package/src/engine/graphics/trail/tube/TubeX.d.ts.map +0 -1
  181. package/src/engine/graphics/trail/tube/TubeX.js +0 -575
  182. package/src/engine/graphics/trail/tube/simulator/TubeXFixedPhysicsSimulator.d.ts +0 -16
  183. package/src/engine/graphics/trail/tube/simulator/TubeXFixedPhysicsSimulator.d.ts.map +0 -1
  184. package/src/engine/graphics/trail/tube/simulator/TubeXFixedPhysicsSimulator.js +0 -34
  185. package/src/engine/graphics/trail/tube/tube_attributes_spec.d.ts +0 -27
  186. package/src/engine/graphics/trail/tube/tube_attributes_spec.d.ts.map +0 -1
  187. package/src/engine/graphics/trail/tube/tube_attributes_spec.js +0 -70
  188. package/src/engine/graphics3/trail/trail_tube_write_geometry.d.ts +0 -38
  189. package/src/engine/graphics3/trail/trail_tube_write_geometry.d.ts.map +0 -1
  190. package/src/engine/graphics3/trail/trail_tube_write_geometry.js +0 -119
@@ -1,6 +1,7 @@
1
1
  import { assert } from "../../../../core/assert.js";
2
2
  import { Vector4 } from "../../../../core/geom/Vector4.js";
3
3
  import { AnimationCurve } from "../../../../engine/animation/curve/AnimationCurve.js";
4
+ import { ANIMATION_CURVE_KEYFRAME_FLOATS, animation_curve_write_keys } from "../../animation/animation_curve_write_keys.js";
4
5
  import { vec4f, vec4u } from "../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
5
6
  import { WebGPUStruct } from "../../shader/type/WebGPUStruct.js";
6
7
  import { m3_white_balance_rec709, WHITE_BALANCE_NEUTRAL_TEMPERATURE, WHITE_BALANCE_NEUTRAL_TINT } from "./m3_white_balance_rec709.js";
@@ -60,7 +61,7 @@ export const COLOR_GRADE_HEADER_FLOATS = 88;
60
61
  * Floats of one keyframe in `grade_keys`: time, value, in tangent, out tangent.
61
62
  * @type {number}
62
63
  */
63
- export const COLOR_GRADE_KEY_FLOATS = 4;
64
+ export const COLOR_GRADE_KEY_FLOATS = ANIMATION_CURVE_KEYFRAME_FLOATS;
64
65
 
65
66
  /**
66
67
  * One zone of Unreal's primary grade: shadows, midtones, highlights, or all of them. Each vector is RGB and a master
@@ -148,30 +149,6 @@ function write_zone(out, at, zone, global) {
148
149
  write_sum(out, at + 16, zone.offset, global.offset);
149
150
  }
150
151
 
151
- /**
152
- * @param {Float32Array} out
153
- * @param {number} at float index
154
- * @param {AnimationCurve} curve
155
- * @returns {number} the float index after the curve's keys
156
- */
157
- function write_keys(out, at, curve) {
158
- const keys = curve.keys;
159
- const count = keys.length;
160
-
161
- for (let i = 0; i < count; i++) {
162
- const key = keys[i];
163
-
164
- out[at] = key.time;
165
- out[at + 1] = key.value;
166
- out[at + 2] = key.inTangent;
167
- out[at + 3] = key.outTangent;
168
-
169
- at += COLOR_GRADE_KEY_FLOATS;
170
- }
171
-
172
- return at;
173
- }
174
-
175
152
  /**
176
153
  * A colour grade on the exposed scene colour, ahead of the tone-mapping operator, baked into the tone mapper's LUTs.
177
154
  * Neutral as constructed. In order:
@@ -424,17 +401,17 @@ export class ColorGrade {
424
401
  words[87] = exposure_count;
425
402
 
426
403
  let at = COLOR_GRADE_HEADER_FLOATS;
427
- at = write_keys(out, at, this.hue_shift);
428
- at = write_keys(out, at, this.hue_saturation);
429
- at = write_keys(out, at, this.hue_lightness);
430
- at = write_keys(out, at, this.luma_saturation_red);
431
- at = write_keys(out, at, this.luma_saturation_green);
432
- at = write_keys(out, at, this.luma_saturation_blue);
433
- at = write_keys(out, at, this.luma_saturation);
434
- at = write_keys(out, at, this.luma_gain_red);
435
- at = write_keys(out, at, this.luma_gain_green);
436
- at = write_keys(out, at, this.luma_gain_blue);
437
- at = write_keys(out, at, this.luma_exposure);
404
+ at = animation_curve_write_keys(out, at, this.hue_shift);
405
+ at = animation_curve_write_keys(out, at, this.hue_saturation);
406
+ at = animation_curve_write_keys(out, at, this.hue_lightness);
407
+ at = animation_curve_write_keys(out, at, this.luma_saturation_red);
408
+ at = animation_curve_write_keys(out, at, this.luma_saturation_green);
409
+ at = animation_curve_write_keys(out, at, this.luma_saturation_blue);
410
+ at = animation_curve_write_keys(out, at, this.luma_saturation);
411
+ at = animation_curve_write_keys(out, at, this.luma_gain_red);
412
+ at = animation_curve_write_keys(out, at, this.luma_gain_green);
413
+ at = animation_curve_write_keys(out, at, this.luma_gain_blue);
414
+ at = animation_curve_write_keys(out, at, this.luma_exposure);
438
415
 
439
416
  out.fill(0, at);
440
417
 
@@ -126,8 +126,8 @@ export class GPUDynamicMeshResidency {
126
126
  guard; index_count is left truthful, and the draw-time index_count === 0 test skips it.
127
127
 
128
128
  Reachable on the first upload rather than on a shrink: a geometry that shrinks has already
129
- grown its buffers, and Trail3DSystem.link and PathDisplaySystem both build a DynamicMesh
130
- from a Geometry that can already be empty.
129
+ grown its buffers, and PathDisplaySystem builds a DynamicMesh from a Geometry that can
130
+ already be empty.
131
131
  */
132
132
  if (vertex_bytes > 0) {
133
133
  device.queue.writeBuffer(this.#vertices, 0, staging.buffer, staging.byteOffset, vertex_bytes);
@@ -1,19 +1,8 @@
1
1
  /**
2
2
  * The vertex stage both AVBOIT passes draw a dynamic mesh with — the splat at the volume's
3
3
  * resolution and the draw at internal resolution — so the two see the same fragments at the same
4
- * depths.
5
- *
6
- * `view_depth` is the vertex's own view-space depth, interpolated across the triangle: what the
7
- * splat positions a fragment's extinction by and what the draw looks the volume up at. Both passes
8
- * take it from here rather than reconstructing it from `@builtin(position).z`, the arrangement the
9
- * particles' billboard stage has for the same reason. `color` is straight — not premultiplied — as
10
- * the vertices hold it.
11
- *
12
- * Both are interpolated at the **centroid** of the samples the triangle covers. The splat is
13
- * multisampled, and a thin triangle can cover some of a pixel's samples but not its centre; at the
14
- * centre its depth and alpha would be extrapolated off the triangle's edge, which on a ribbon seen
15
- * nearly edge-on lands the extinction slices away from the ribbon. The draw has one sample, where a
16
- * fragment exists only if the centre is covered and the centroid is the centre.
4
+ * depths. It hands the unlit fragment stages their `AVBOITUnlitVaryings`: the clip position, the
5
+ * vertex colour straight as the vertices hold it, and the vertex's own view-space depth.
17
6
  *
18
7
  * The enclosing shader binds the dynamic-mesh groups (`DYNAMIC_MESH_RESOURCES`), `camera` included,
19
8
  * and hands over `instance_index` as the draw's row, as for {@link chunk_dynamic_mesh_vertex}.
@@ -1 +1 @@
1
- {"version":3,"file":"chunk_dynamic_mesh_avboit_vertex.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/dynamic/chunk_dynamic_mesh_avboit_vertex.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,+CAFU,SAAS,CA0BjB;0BAjDwB,iCAAiC"}
1
+ {"version":3,"file":"chunk_dynamic_mesh_avboit_vertex.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/dynamic/chunk_dynamic_mesh_avboit_vertex.js"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AACH,+CAFU,SAAS,CAqBjB;0BAjCwB,iCAAiC"}
@@ -1,22 +1,12 @@
1
+ import { chunk_avboit_unlit_varyings } from "../rasterize/native/avboit/chunk_avboit_unlit_varyings.js";
1
2
  import { CodeChunk } from "../shader/compiler/CodeChunk.js";
2
3
  import { chunk_dynamic_mesh_vertex } from "./chunk_dynamic_mesh_vertex.js";
3
4
 
4
5
  /**
5
6
  * The vertex stage both AVBOIT passes draw a dynamic mesh with — the splat at the volume's
6
7
  * resolution and the draw at internal resolution — so the two see the same fragments at the same
7
- * depths.
8
- *
9
- * `view_depth` is the vertex's own view-space depth, interpolated across the triangle: what the
10
- * splat positions a fragment's extinction by and what the draw looks the volume up at. Both passes
11
- * take it from here rather than reconstructing it from `@builtin(position).z`, the arrangement the
12
- * particles' billboard stage has for the same reason. `color` is straight — not premultiplied — as
13
- * the vertices hold it.
14
- *
15
- * Both are interpolated at the **centroid** of the samples the triangle covers. The splat is
16
- * multisampled, and a thin triangle can cover some of a pixel's samples but not its centre; at the
17
- * centre its depth and alpha would be extrapolated off the triangle's edge, which on a ribbon seen
18
- * nearly edge-on lands the extinction slices away from the ribbon. The draw has one sample, where a
19
- * fragment exists only if the centre is covered and the centroid is the centre.
8
+ * depths. It hands the unlit fragment stages their `AVBOITUnlitVaryings`: the clip position, the
9
+ * vertex colour straight as the vertices hold it, and the vertex's own view-space depth.
20
10
  *
21
11
  * The enclosing shader binds the dynamic-mesh groups (`DYNAMIC_MESH_RESOURCES`), `camera` included,
22
12
  * and hands over `instance_index` as the draw's row, as for {@link chunk_dynamic_mesh_vertex}.
@@ -26,16 +16,10 @@ import { chunk_dynamic_mesh_vertex } from "./chunk_dynamic_mesh_vertex.js";
26
16
  export const chunk_dynamic_mesh_avboit_vertex = CodeChunk.from(
27
17
  //language=WGSL
28
18
  `
29
- struct DynamicMeshAVBOITVertexOut {
30
- @builtin(position) clip : vec4<f32>,
31
- @location(0) @interpolate(perspective, centroid) color : vec4<f32>,
32
- @location(1) @interpolate(perspective, centroid) view_depth : f32,
33
- }
34
-
35
- fn dynamic_mesh_avboit_vertex(vertex_index : u32, draw_index : u32) -> DynamicMeshAVBOITVertexOut {
19
+ fn dynamic_mesh_avboit_vertex(vertex_index : u32, draw_index : u32) -> AVBOITUnlitVaryings {
36
20
  let vertex = dynamic_mesh_vertex(vertex_index, draw_index);
37
21
 
38
- var out : DynamicMeshAVBOITVertexOut;
22
+ var out : AVBOITUnlitVaryings;
39
23
 
40
24
  out.clip = camera.view_projection_matrix * vertex.world;
41
25
  out.color = vertex.color;
@@ -45,6 +29,7 @@ fn dynamic_mesh_avboit_vertex(vertex_index : u32, draw_index : u32) -> DynamicMe
45
29
  return out;
46
30
  }
47
31
  `, [
32
+ chunk_avboit_unlit_varyings,
48
33
  chunk_dynamic_mesh_vertex,
49
34
  ]
50
35
  );
@@ -1,3 +1,16 @@
1
+ /**
2
+ * The dynamic meshes' three contributions to the AVBOIT transparency pipeline — the
3
+ * `AVBOITSideChannel` contract, recorded into the frame graph the way the AVBOIT orchestrator records
4
+ * its own passes. `DynamicMeshAVBOITChannel` calls these with what it decided for the frame — the
5
+ * occupancy with the meshes it found live, the splat and the draw with the list the occupancy writes
6
+ * their draws into — and the handles the orchestrator hands it.
7
+ *
8
+ * One draw per mesh in the splat and in the draw, as in the pass over the scene, out of one
9
+ * {@link GPUDynamicMeshDrawList} per frame: the occupancy writes it, the splat and the draw both draw
10
+ * it, so the meshes' constants go up once a frame and the two passes read the same ones. Order does
11
+ * not matter to any of them — the volume and the accumulators are sums — which is why nothing here
12
+ * sorts.
13
+ */
1
14
  /**
2
15
  * Upload the live meshes and write their draws, then mark the depth slices their world boxes span
3
16
  * (`shader_dynamic_mesh_avboit_occupancy`).
@@ -29,11 +42,8 @@ export function graph_dynamic_mesh_avboit_occupancy({ graph, camera, cluster_par
29
42
  draws: GPUDynamicMeshDrawList;
30
43
  }): number;
31
44
  /**
32
- * Splat the live meshes' extinction into the voxel volume (`shader_dynamic_mesh_avboit_splat`).
33
- *
34
- * The raster is multisampled ({@link DYNAMIC_MESH_AVBOIT_SPLAT_SAMPLES}), so it cannot use the
35
- * volume's single-sampled splat target: the pass makes its own at the volume's resolution, and hands
36
- * the volume's back untouched.
45
+ * Splat the live meshes' extinction into the voxel volume: the unlit splat
46
+ * (`graph_avboit_unlit_splat`) with the dynamic-mesh pipeline, one draw per mesh out of the frame's list.
37
47
  *
38
48
  * @param {object} params
39
49
  * @param {import("../../../engine/graphics/render/frame_graph/FrameGraph.js").FrameGraph} params.graph
@@ -61,7 +71,8 @@ export function graph_dynamic_mesh_avboit_splat({ graph, camera, warp, voxel_res
61
71
  dummy: number;
62
72
  };
63
73
  /**
64
- * Draw the live meshes into the four accumulators (`shader_dynamic_mesh_avboit_draw`).
74
+ * Draw the live meshes into the four accumulators: the unlit draw (`graph_avboit_unlit_draw`) with the
75
+ * dynamic-mesh pipeline, one draw per mesh out of the frame's list.
65
76
  *
66
77
  * @param {object} params
67
78
  * @param {import("../../../engine/graphics/render/frame_graph/FrameGraph.js").FrameGraph} params.graph
@@ -1 +1 @@
1
- {"version":3,"file":"graph_dynamic_mesh_avboit.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/dynamic/graph_dynamic_mesh_avboit.js"],"names":[],"mappings":"AA4CA;;;;;;;;;;;;;;;;;;;GAmBG;AACH;IAXkG,KAAK,EAA5F,OAAO,2DAA2D,EAAE,UAAU;IAC/D,MAAM,EAArB,MAAM;IACoB,kBAAkB,EAA5C,UAAU,MAAM,CAAC;IACF,SAAS,EAAxB,MAAM;IAC+B,SAAS;IACxB,MAAM,EAA5B,aAAa;IACQ,KAAK,EAA1B,YAAY;IACmB,KAAK;IAElC,MAAM,CAwDlB;AAED;;;;;;;;;;;;;;;GAeG;AACH;IARkG,KAAK,EAA5F,OAAO,2DAA2D,EAAE,UAAU;IAC/D,MAAM,EAArB,MAAM;IACS,IAAI,EAAnB,MAAM;IACW,gBAAgB,EAAjC,MAAM,EAAE;IACsD,MAAM,EAApE;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC;IACtB,KAAK;IAClC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAC,CAuFjE;AAED;;;;;;;;;;;;;;;GAeG;AACH;IAZkG,KAAK,EAA5F,OAAO,2DAA2D,EAAE,UAAU;IACnB,QAAQ,EAAnE,OAAO,2BAA2B,EAAE,cAAc;IACnC,MAAM,EAArB,MAAM;IACS,aAAa,EAA5B,MAAM;IACS,IAAI,EAAnB,MAAM;IACS,QAAQ,EAAvB,MAAM;IACS,eAAe,EAA9B,MAAM;IACS,oBAAoB,EAAnC,MAAM;IACsE,YAAY,EAAxF;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAC;IACpC,KAAK;IAClC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAC,CA4F/E"}
1
+ {"version":3,"file":"graph_dynamic_mesh_avboit.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/dynamic/graph_dynamic_mesh_avboit.js"],"names":[],"mappings":"AAWA;;;;;;;;;;;;GAYG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH;IAXkG,KAAK,EAA5F,OAAO,2DAA2D,EAAE,UAAU;IAC/D,MAAM,EAArB,MAAM;IACoB,kBAAkB,EAA5C,UAAU,MAAM,CAAC;IACF,SAAS,EAAxB,MAAM;IAC+B,SAAS;IACxB,MAAM,EAA5B,aAAa;IACQ,KAAK,EAA1B,YAAY;IACmB,KAAK;IAElC,MAAM,CAwDlB;AAED;;;;;;;;;;;;GAYG;AACH;IARkG,KAAK,EAA5F,OAAO,2DAA2D,EAAE,UAAU;IAC/D,MAAM,EAArB,MAAM;IACS,IAAI,EAAnB,MAAM;IACW,gBAAgB,EAAjC,MAAM,EAAE;IACsD,MAAM,EAApE;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC;IACtB,KAAK;IAClC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAC,CA0BjE;AAED;;;;;;;;;;;;;;;;GAgBG;AACH;IAZkG,KAAK,EAA5F,OAAO,2DAA2D,EAAE,UAAU;IACnB,QAAQ,EAAnE,OAAO,2BAA2B,EAAE,cAAc;IACnC,MAAM,EAArB,MAAM;IACS,aAAa,EAA5B,MAAM;IACS,IAAI,EAAnB,MAAM;IACS,QAAQ,EAAvB,MAAM;IACS,eAAe,EAA9B,MAAM;IACS,oBAAoB,EAAnC,MAAM;IACsE,YAAY,EAAxF;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAC;IACpC,KAAK;IAClC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAC,CAkC/E"}
@@ -1,29 +1,13 @@
1
1
  import { assert } from "../../../core/assert.js";
2
- import { GPUTextureUsage } from "../../descriptor/GPUTextureUsage.js";
3
- import { TextureViewDescriptor } from "../../descriptor/texture/TextureViewDescriptor.js";
4
- import { TextureResourceDescriptor } from "../../device/graph/TextureResourceDescriptor.js";
5
- import { DEFAULT_DEPTH_TEXTURE_VIEW } from "../depth/DEFAULT_DEPTH_TEXTURE_VIEW.js";
6
- import { AVBOIT_SPLAT_DUMMY_FORMAT } from "../rasterize/native/avboit/shader_avboit_splat.js";
7
- import { STATIC_GRAPHICS_ENGINE_ASSETS } from "../STATIC_GRAPHICS_ENGINE_ASSETS.js";
8
- import { SAMPLER_LINEAR_UPSCALE } from "../texture/SAMPLER_LINEAR_UPSCALE.js";
9
- import {
10
- DYNAMIC_MESH_AVBOIT_DRAW_BIND_GROUP_PASS,
11
- DYNAMIC_MESH_AVBOIT_DRAW_PIPELINE,
12
- DYNAMIC_MESH_AVBOIT_DRAW_RESOURCES,
13
- } from "./shader_dynamic_mesh_avboit_draw.js";
2
+ import { graph_avboit_unlit_draw, graph_avboit_unlit_splat } from "../rasterize/native/avboit/graph_avboit_unlit.js";
3
+ import { DYNAMIC_MESH_AVBOIT_DRAW_PIPELINE, DYNAMIC_MESH_AVBOIT_DRAW_RESOURCES } from "./shader_dynamic_mesh_avboit_draw.js";
14
4
  import {
15
5
  DYNAMIC_MESH_AVBOIT_BOX_FLOATS,
16
6
  DYNAMIC_MESH_AVBOIT_OCCUPANCY_GROUP_SIZE,
17
7
  DYNAMIC_MESH_AVBOIT_OCCUPANCY_SETTINGS_STRUCT,
18
8
  shader_dynamic_mesh_avboit_occupancy,
19
9
  } from "./shader_dynamic_mesh_avboit_occupancy.js";
20
- import {
21
- DYNAMIC_MESH_AVBOIT_SPLAT_BIND_GROUP_PASS,
22
- DYNAMIC_MESH_AVBOIT_SPLAT_BIND_GROUP_VOLUME,
23
- DYNAMIC_MESH_AVBOIT_SPLAT_PIPELINE,
24
- DYNAMIC_MESH_AVBOIT_SPLAT_RESOURCES,
25
- DYNAMIC_MESH_AVBOIT_SPLAT_SAMPLES,
26
- } from "./shader_dynamic_mesh_avboit_splat.js";
10
+ import { DYNAMIC_MESH_AVBOIT_SPLAT_PIPELINE, DYNAMIC_MESH_AVBOIT_SPLAT_RESOURCES } from "./shader_dynamic_mesh_avboit_splat.js";
27
11
 
28
12
  /**
29
13
  * The dynamic meshes' three contributions to the AVBOIT transparency pipeline — the
@@ -39,9 +23,6 @@ import {
39
23
  * sorts.
40
24
  */
41
25
 
42
- /** The accumulators' and the splat target's view: one mip, the one the frame draws into. */
43
- const COLOR_VIEW = TextureViewDescriptor.from({ mipLevelCount: 1, baseMipLevel: 0 });
44
-
45
26
  /**
46
27
  * Upload the live meshes and write their draws, then mark the depth slices their world boxes span
47
28
  * (`shader_dynamic_mesh_avboit_occupancy`).
@@ -119,11 +100,8 @@ export function graph_dynamic_mesh_avboit_occupancy({
119
100
  }
120
101
 
121
102
  /**
122
- * Splat the live meshes' extinction into the voxel volume (`shader_dynamic_mesh_avboit_splat`).
123
- *
124
- * The raster is multisampled ({@link DYNAMIC_MESH_AVBOIT_SPLAT_SAMPLES}), so it cannot use the
125
- * volume's single-sampled splat target: the pass makes its own at the volume's resolution, and hands
126
- * the volume's back untouched.
103
+ * Splat the live meshes' extinction into the voxel volume: the unlit splat
104
+ * (`graph_avboit_unlit_splat`) with the dynamic-mesh pipeline, one draw per mesh out of the frame's list.
127
105
  *
128
106
  * @param {object} params
129
107
  * @param {import("../../../engine/graphics/render/frame_graph/FrameGraph.js").FrameGraph} params.graph
@@ -143,86 +121,26 @@ export function graph_dynamic_mesh_avboit_splat({
143
121
  draws,
144
122
  }) {
145
123
  assert.isNonNegativeInteger(camera, "camera");
146
- assert.isNonNegativeInteger(warp, "warp");
147
- assert.isArrayLike(voxel_resolution, "voxel_resolution");
148
- assert.defined(volume, "volume");
149
-
150
- function execute(data, resources, context) {
151
- const encoder = context.encoder;
152
- const graphics = context.graphics;
153
-
154
- if (draws.count === 0) {
155
- return;
156
- }
157
-
158
- const pipeline = DYNAMIC_MESH_AVBOIT_SPLAT_PIPELINE;
159
-
160
- // By name, never by position (ledger entry 21): the order a shader declares its bindings in
161
- // is the shader's business.
162
- const groups = DYNAMIC_MESH_AVBOIT_SPLAT_RESOURCES.groups;
163
-
164
- const pass_group = groups[DYNAMIC_MESH_AVBOIT_SPLAT_BIND_GROUP_PASS].generateBindings({
165
- warp: resources.get(data.warp),
166
- }, encoder);
167
-
168
- const volume_group = groups[DYNAMIC_MESH_AVBOIT_SPLAT_BIND_GROUP_VOLUME].generateBindings({
169
- extinction_volume: resources.get(data.extinction),
170
- overflow_slice: resources.get(data.overflow),
171
- }, encoder);
172
124
 
173
- // the target is never written; it only sizes the raster and gives it its samples
174
- const pass_encoder = encoder.constructRenderPass({
175
- label: "Dynamic Mesh AVBOIT Splat",
176
- pipeline,
177
- // the pass's groups are set once, just below; the draws set their own
178
- bindings: [],
179
- colorAttachments: [{
180
- view: resources.get(data.target).obtainView(COLOR_VIEW),
181
- loadOp: "clear",
182
- storeOp: "discard",
183
- }],
184
- });
185
-
186
- graphics.setPipelineBindGroup(pass_encoder, pipeline, DYNAMIC_MESH_AVBOIT_SPLAT_BIND_GROUP_PASS, pass_group);
187
- graphics.setPipelineBindGroup(pass_encoder, pipeline, DYNAMIC_MESH_AVBOIT_SPLAT_BIND_GROUP_VOLUME, volume_group);
188
-
189
- draws.draw(pass_encoder, graphics, pipeline, resources.get(data.camera));
190
-
191
- pass_encoder.end();
192
- }
193
-
194
- const pass_data = {};
195
- const pass = graph.add("Dynamic Mesh AVBOIT Splat", pass_data, execute);
196
-
197
- pass_data.camera = pass.read(camera);
198
- pass_data.warp = pass.read(warp);
199
-
200
- pass.read(volume.extinction);
201
- pass_data.extinction = pass.write(volume.extinction);
202
- pass.read(volume.overflow);
203
- pass_data.overflow = pass.write(volume.overflow);
204
-
205
- const target = TextureResourceDescriptor.from({
206
- resolution: voxel_resolution,
207
- format: AVBOIT_SPLAT_DUMMY_FORMAT,
208
- usage: GPUTextureUsage.RENDER_ATTACHMENT,
125
+ const pipeline = DYNAMIC_MESH_AVBOIT_SPLAT_PIPELINE;
126
+
127
+ return graph_avboit_unlit_splat({
128
+ graph,
129
+ label: "Dynamic Mesh AVBOIT Splat",
130
+ pipeline,
131
+ resources: DYNAMIC_MESH_AVBOIT_SPLAT_RESOURCES,
132
+ inputs: { camera },
133
+ warp,
134
+ voxel_resolution,
135
+ volume,
136
+ is_empty: () => draws.count === 0,
137
+ record: (pass_encoder, graphics, inputs) => draws.draw(pass_encoder, graphics, pipeline, inputs.camera),
209
138
  });
210
-
211
- // `from` takes no sample count
212
- target.sampleCount = DYNAMIC_MESH_AVBOIT_SPLAT_SAMPLES;
213
-
214
- pass_data.target = pass.create("Dynamic Mesh AVBOIT splat target", target);
215
-
216
- return {
217
- extinction: pass_data.extinction,
218
- overflow: pass_data.overflow,
219
- // not this pass's to touch
220
- dummy: volume.dummy,
221
- };
222
139
  }
223
140
 
224
141
  /**
225
- * Draw the live meshes into the four accumulators (`shader_dynamic_mesh_avboit_draw`).
142
+ * Draw the live meshes into the four accumulators: the unlit draw (`graph_avboit_unlit_draw`) with the
143
+ * dynamic-mesh pipeline, one draw per mesh out of the frame's list.
226
144
  *
227
145
  * @param {object} params
228
146
  * @param {import("../../../engine/graphics/render/frame_graph/FrameGraph.js").FrameGraph} params.graph
@@ -250,81 +168,23 @@ export function graph_dynamic_mesh_avboit_draw({
250
168
  draws,
251
169
  }) {
252
170
  assert.isNonNegativeInteger(camera, "camera");
253
- assert.isNonNegativeInteger(depth_texture, "depth_texture");
254
- assert.isNonNegativeInteger(warp, "warp");
255
- assert.isNonNegativeInteger(integral, "integral");
256
- assert.defined(accumulators, "accumulators");
257
-
258
- function execute(data, resources, context) {
259
- const encoder = context.encoder;
260
- const graphics = context.graphics;
261
-
262
- if (draws.count === 0) {
263
- return;
264
- }
265
-
266
- const pipeline = DYNAMIC_MESH_AVBOIT_DRAW_PIPELINE;
267
-
268
- // by name rather than by position, for the reason the splat gives
269
- const pass_group = DYNAMIC_MESH_AVBOIT_DRAW_RESOURCES.groups[DYNAMIC_MESH_AVBOIT_DRAW_BIND_GROUP_PASS].generateBindings({
270
- view: view_ctx.uniform_buffer.buffer,
271
- warp: resources.get(data.warp),
272
- tIntegral: resources.get(data.integral).obtainView(),
273
- sLinear: graphics.samplers.obtain(SAMPLER_LINEAR_UPSCALE),
274
- volumetrics_metadata: resources.get(data.volumetrics_metadata),
275
- tVolumetrics: resources.get(data.volumetrics_lut).obtainView(),
276
- tSTBN_vec3: graphics.textures.obtain(STATIC_GRAPHICS_ENGINE_ASSETS.stbn_vec3).obtainView(),
277
- }, encoder);
278
-
279
- const attachment = (handle) => ({
280
- view: resources.get(handle).obtainView(COLOR_VIEW),
281
- loadOp: "load",
282
- storeOp: "store",
283
- });
284
-
285
- const pass_encoder = encoder.constructRenderPass({
286
- label: "Dynamic Mesh AVBOIT Draw",
287
- pipeline,
288
- // the pass's group is set once, just below; the draws set their own
289
- bindings: [],
290
- colorAttachments: [
291
- attachment(data.color),
292
- attachment(data.norm),
293
- attachment(data.extinction),
294
- attachment(data.emission),
295
- ],
296
- depthStencilAttachment: {
297
- view: resources.get(data.depth).obtainView(DEFAULT_DEPTH_TEXTURE_VIEW),
298
- depthReadOnly: true,
299
- },
300
- });
301
-
302
- graphics.setPipelineBindGroup(pass_encoder, pipeline, DYNAMIC_MESH_AVBOIT_DRAW_BIND_GROUP_PASS, pass_group);
303
-
304
- draws.draw(pass_encoder, graphics, pipeline, resources.get(data.camera));
305
-
306
- pass_encoder.end();
307
- }
308
-
309
- const pass_data = {};
310
- const pass = graph.add("Dynamic Mesh AVBOIT Draw", pass_data, execute);
311
-
312
- pass_data.camera = pass.read(camera);
313
- pass_data.depth = pass.read(depth_texture);
314
- pass_data.warp = pass.read(warp);
315
- pass_data.integral = pass.read(integral);
316
- pass_data.volumetrics_lut = pass.read(volumetrics_lut);
317
- pass_data.volumetrics_metadata = pass.read(volumetrics_metadata);
318
171
 
319
- for (const name of ["color", "norm", "extinction", "emission"]) {
320
- pass.read(accumulators[name]);
321
- pass_data[name] = pass.write(accumulators[name]);
322
- }
323
-
324
- return {
325
- color: pass_data.color,
326
- norm: pass_data.norm,
327
- extinction: pass_data.extinction,
328
- emission: pass_data.emission,
329
- };
172
+ const pipeline = DYNAMIC_MESH_AVBOIT_DRAW_PIPELINE;
173
+
174
+ return graph_avboit_unlit_draw({
175
+ graph,
176
+ label: "Dynamic Mesh AVBOIT Draw",
177
+ pipeline,
178
+ resources: DYNAMIC_MESH_AVBOIT_DRAW_RESOURCES,
179
+ inputs: { camera },
180
+ view_ctx,
181
+ depth_texture,
182
+ warp,
183
+ integral,
184
+ volumetrics_lut,
185
+ volumetrics_metadata,
186
+ accumulators,
187
+ is_empty: () => draws.count === 0,
188
+ record: (pass_encoder, graphics, inputs) => draws.draw(pass_encoder, graphics, pipeline, inputs.camera),
189
+ });
330
190
  }
@@ -1,21 +1,19 @@
1
1
  /**
2
- * Bind group of everything the draw reads once per pass — the view, the warp, the integral and the
3
- * fog. Groups 0 and 1 are the dynamic-mesh groups: the draw constants per chunk, the geometry per
4
- * mesh.
2
+ * Bind group of everything the draw reads once per pass (`AVBOIT_UNLIT_DRAW_PASS_GROUP`) — the view,
3
+ * the warp, the integral and the fog. Groups 0 and 1 are the dynamic-mesh groups: the draw constants
4
+ * per chunk, the geometry per mesh.
5
5
  * @type {number}
6
6
  */
7
7
  export const DYNAMIC_MESH_AVBOIT_DRAW_BIND_GROUP_PASS: number;
8
8
  /**
9
- * The draw pipeline: additive into the accumulators with the emission target masked off, the scene
10
- * depth tested and never written, both faces.
11
- * @type {RenderPipelineDescriptor}
9
+ * The draw pipeline, as every unlit draw is built (`avboit_unlit_draw_pipeline`).
10
+ * @type {import("../../descriptor/pipeline/render/RenderPipelineDescriptor.js").RenderPipelineDescriptor}
12
11
  */
13
- export const DYNAMIC_MESH_AVBOIT_DRAW_PIPELINE: RenderPipelineDescriptor;
14
- /** The draw shader's resource set, for building its pass-level bind group. */
12
+ export const DYNAMIC_MESH_AVBOIT_DRAW_PIPELINE: import("../../descriptor/pipeline/render/RenderPipelineDescriptor.js").RenderPipelineDescriptor;
13
+ /** The draw shader's resource set. */
15
14
  export const DYNAMIC_MESH_AVBOIT_DRAW_RESOURCES: ShaderResourceSetDescriptor;
16
15
  /** The assembled shader, for the validity tier. */
17
16
  export const shader_dynamic_mesh_avboit_draw: ShaderDescriptor;
18
- import { RenderPipelineDescriptor } from "../../descriptor/pipeline/render/RenderPipelineDescriptor.js";
19
17
  import { ShaderResourceSetDescriptor } from "../shader/resource/ShaderResourceSetDescriptor.js";
20
18
  import { ShaderDescriptor } from "../shader/ShaderDescriptor.js";
21
19
  //# sourceMappingURL=shader_dynamic_mesh_avboit_draw.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shader_dynamic_mesh_avboit_draw.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_draw.js"],"names":[],"mappings":"AAyBA;;;;;GAKG;AACH,uDAFU,MAAM,CAE0C;AA+F1D;;;;GAIG;AACH,gDAFU,wBAAwB,CAc/B;AAEH,8EAA8E;AAC9E,6EAA4D;AAE5D,mDAAmD;AACnD,+DAA0D;yCApJjB,8DAA8D;4CAY3D,mDAAmD;iCAC9D,+BAA+B"}
1
+ {"version":3,"file":"shader_dynamic_mesh_avboit_draw.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_draw.js"],"names":[],"mappings":"AAWA;;;;;GAKG;AACH,uDAFU,MAAM,CAE0C;AA6B1D;;;GAGG;AACH,gDAFU,OAAO,8DAA8D,EAAE,wBAAwB,CAMtG;AAEH,sCAAsC;AACtC,6EAA4D;AAE5D,mDAAmD;AACnD,+DAA0D;4CA1Dd,mDAAmD;iCAC9D,+BAA+B"}