@woosh/meep-engine 3.14.6 → 3.15.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 (154) hide show
  1. package/package.json +1 -1
  2. package/src/engine/network/orchestrator/ServerAuthoritativeClient.d.ts +48 -0
  3. package/src/engine/network/orchestrator/ServerAuthoritativeClient.d.ts.map +1 -1
  4. package/src/engine/network/orchestrator/ServerAuthoritativeClient.js +246 -3
  5. package/src/shade/RENDERER_CONTRACT.md +584 -580
  6. package/src/shade/playground/avboit/README.md +117 -0
  7. package/src/shade/playground/avboit/index.html +215 -0
  8. package/src/shade/playground/avboit/main.d.ts +2 -0
  9. package/src/shade/playground/avboit/main.d.ts.map +1 -0
  10. package/src/shade/playground/avboit/main.js +875 -0
  11. package/src/shade/renderer/Renderer.d.ts +16 -0
  12. package/src/shade/renderer/Renderer.d.ts.map +1 -1
  13. package/src/shade/renderer/Renderer.js +29 -28
  14. package/src/shade/renderer/ShadeTransparencyMode.d.ts +13 -0
  15. package/src/shade/renderer/ShadeTransparencyMode.d.ts.map +1 -0
  16. package/src/shade/renderer/ShadeTransparencyMode.js +30 -0
  17. package/src/shade/renderer/path_tracer/accumulating/AccumulatingPathTracer.d.ts +9 -0
  18. package/src/shade/renderer/path_tracer/accumulating/AccumulatingPathTracer.d.ts.map +1 -1
  19. package/src/shade/renderer/path_tracer/accumulating/AccumulatingPathTracer.js +26 -0
  20. package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.d.ts +7 -2
  21. package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.d.ts.map +1 -1
  22. package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.js +12 -1
  23. package/src/shade/renderer/rasterize/expand/shader_filter_triangle_by_material_side.js +1 -1
  24. package/src/shade/renderer/rasterize/forward/FORWARD_VERTEX_SHADER_STRUCT.d.ts +3 -0
  25. package/src/shade/renderer/rasterize/forward/FORWARD_VERTEX_SHADER_STRUCT.d.ts.map +1 -0
  26. package/src/shade/renderer/rasterize/{native/oit → forward}/FORWARD_VERTEX_SHADER_STRUCT.js +4 -4
  27. package/src/shade/renderer/rasterize/forward/SHADING_SCENE_RESOURCE_GROUP.d.ts +3 -0
  28. package/src/shade/renderer/rasterize/forward/SHADING_SCENE_RESOURCE_GROUP.d.ts.map +1 -0
  29. package/src/shade/renderer/rasterize/forward/SHADING_SCENE_RESOURCE_GROUP.js +17 -0
  30. package/src/shade/renderer/rasterize/{native/oit → forward}/chunk_forward_shade_standard_fragment_brick4.d.ts +1 -1
  31. package/src/shade/renderer/rasterize/forward/chunk_forward_shade_standard_fragment_brick4.d.ts.map +1 -0
  32. package/src/shade/renderer/rasterize/{native/oit → forward}/chunk_forward_shade_standard_fragment_brick4.js +16 -16
  33. package/src/shade/renderer/rasterize/{native/oit → forward}/chunk_forward_shade_standard_fragment_ibl.d.ts +1 -1
  34. package/src/shade/renderer/rasterize/forward/chunk_forward_shade_standard_fragment_ibl.d.ts.map +1 -0
  35. package/src/shade/renderer/rasterize/{native/oit → forward}/chunk_forward_shade_standard_fragment_ibl.js +17 -17
  36. package/src/shade/renderer/rasterize/{native/oit → forward}/chunk_material_side_should_draw.d.ts +1 -1
  37. package/src/shade/renderer/rasterize/forward/chunk_material_side_should_draw.d.ts.map +1 -0
  38. package/src/shade/renderer/rasterize/{native/oit → forward}/chunk_material_side_should_draw.js +2 -2
  39. package/src/shade/renderer/rasterize/forward/vertex_shader_chunk.d.ts +3 -0
  40. package/src/shade/renderer/rasterize/forward/vertex_shader_chunk.d.ts.map +1 -0
  41. package/src/shade/renderer/rasterize/{native/oit → forward}/vertex_shader_chunk.js +4 -4
  42. package/src/shade/renderer/rasterize/native/avboit/AVBOITSettings.d.ts +27 -0
  43. package/src/shade/renderer/rasterize/native/avboit/AVBOITSettings.d.ts.map +1 -0
  44. package/src/shade/renderer/rasterize/native/avboit/AVBOITSettings.js +27 -0
  45. package/src/shade/renderer/rasterize/native/avboit/AVBOIT_CONSTANTS.d.ts +107 -0
  46. package/src/shade/renderer/rasterize/native/avboit/AVBOIT_CONSTANTS.d.ts.map +1 -0
  47. package/src/shade/renderer/rasterize/native/avboit/AVBOIT_CONSTANTS.js +120 -0
  48. package/src/shade/renderer/rasterize/native/avboit/AVBOIT_LEDGER.md +463 -0
  49. package/src/shade/renderer/rasterize/native/avboit/AVBOIT_PLAN_2026_09_03.md +509 -0
  50. package/src/shade/renderer/rasterize/native/avboit/AVBOIT_WARP_STRUCT.d.ts +15 -0
  51. package/src/shade/renderer/rasterize/native/avboit/AVBOIT_WARP_STRUCT.d.ts.map +1 -0
  52. package/src/shade/renderer/rasterize/native/avboit/AVBOIT_WARP_STRUCT.js +33 -0
  53. package/src/shade/renderer/rasterize/native/avboit/avboit_build_depth_curve.d.ts +20 -0
  54. package/src/shade/renderer/rasterize/native/avboit/avboit_build_depth_curve.d.ts.map +1 -0
  55. package/src/shade/renderer/rasterize/native/avboit/avboit_build_depth_curve.js +38 -0
  56. package/src/shade/renderer/rasterize/native/avboit/avboit_draw_fragment_body.d.ts +38 -0
  57. package/src/shade/renderer/rasterize/native/avboit/avboit_draw_fragment_body.d.ts.map +1 -0
  58. package/src/shade/renderer/rasterize/native/avboit/avboit_draw_fragment_body.js +130 -0
  59. package/src/shade/renderer/rasterize/native/avboit/avboit_spec_support.d.ts +37 -0
  60. package/src/shade/renderer/rasterize/native/avboit/avboit_spec_support.d.ts.map +1 -0
  61. package/src/shade/renderer/rasterize/native/avboit/avboit_spec_support.js +73 -0
  62. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_counts_to_extinction.d.ts +9 -0
  63. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_counts_to_extinction.d.ts.map +1 -0
  64. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_counts_to_extinction.js +17 -0
  65. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_dilate_word.d.ts +11 -0
  66. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_dilate_word.d.ts.map +1 -0
  67. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_dilate_word.js +18 -0
  68. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_extinction_to_counts.d.ts +9 -0
  69. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_extinction_to_counts.d.ts.map +1 -0
  70. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_extinction_to_counts.js +17 -0
  71. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_extinction_to_transmittance.d.ts +9 -0
  72. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_extinction_to_transmittance.d.ts.map +1 -0
  73. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_extinction_to_transmittance.js +17 -0
  74. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_fold_pairs.d.ts +15 -0
  75. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_fold_pairs.d.ts.map +1 -0
  76. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_fold_pairs.js +25 -0
  77. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_integral_depth_coordinate.d.ts +17 -0
  78. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_integral_depth_coordinate.d.ts.map +1 -0
  79. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_integral_depth_coordinate.js +35 -0
  80. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_occupancy_range.d.ts +11 -0
  81. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_occupancy_range.d.ts.map +1 -0
  82. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_occupancy_range.js +21 -0
  83. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_occupancy_word_mask.d.ts +9 -0
  84. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_occupancy_word_mask.d.ts.map +1 -0
  85. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_occupancy_word_mask.js +26 -0
  86. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_overflows.d.ts +11 -0
  87. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_overflows.d.ts.map +1 -0
  88. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_overflows.js +22 -0
  89. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_pack_counts.d.ts +10 -0
  90. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_pack_counts.d.ts.map +1 -0
  91. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_pack_counts.js +21 -0
  92. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_sample_transmittance.d.ts +10 -0
  93. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_sample_transmittance.d.ts.map +1 -0
  94. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_sample_transmittance.js +32 -0
  95. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_transmission_tint.d.ts +20 -0
  96. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_transmission_tint.d.ts.map +1 -0
  97. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_transmission_tint.js +27 -0
  98. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_transmittance_to_extinction.d.ts +10 -0
  99. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_transmittance_to_extinction.d.ts.map +1 -0
  100. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_transmittance_to_extinction.js +18 -0
  101. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_unpack_counts.d.ts +9 -0
  102. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_unpack_counts.d.ts.map +1 -0
  103. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_unpack_counts.js +21 -0
  104. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_view_depth_to_physical.d.ts +9 -0
  105. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_view_depth_to_physical.d.ts.map +1 -0
  106. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_view_depth_to_physical.js +23 -0
  107. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_view_depth_to_virtual.d.ts +13 -0
  108. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_view_depth_to_virtual.d.ts.map +1 -0
  109. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_view_depth_to_virtual.js +27 -0
  110. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_warp.d.ts +22 -0
  111. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_warp.d.ts.map +1 -0
  112. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_warp.js +38 -0
  113. package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.d.ts +117 -0
  114. package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.d.ts.map +1 -0
  115. package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.js +935 -0
  116. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_build_warp.d.ts +8 -0
  117. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_build_warp.d.ts.map +1 -0
  118. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_build_warp.js +135 -0
  119. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_draw_brick4.d.ts +3 -0
  120. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_draw_brick4.d.ts.map +1 -0
  121. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_draw_brick4.js +101 -0
  122. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_draw_ibl.d.ts +3 -0
  123. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_draw_ibl.d.ts.map +1 -0
  124. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_draw_ibl.js +96 -0
  125. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_integrate.d.ts +3 -0
  126. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_integrate.d.ts.map +1 -0
  127. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_integrate.js +83 -0
  128. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_occupancy.d.ts +9 -0
  129. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_occupancy.d.ts.map +1 -0
  130. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_occupancy.js +119 -0
  131. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_resolve.d.ts +3 -0
  132. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_resolve.d.ts.map +1 -0
  133. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_resolve.js +81 -0
  134. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_splat.d.ts +15 -0
  135. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_splat.d.ts.map +1 -0
  136. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_splat.js +237 -0
  137. package/src/shade/renderer/rasterize/native/material_draw_indirect.d.ts +22 -0
  138. package/src/shade/renderer/rasterize/native/material_draw_indirect.d.ts.map +1 -0
  139. package/src/shade/renderer/rasterize/native/material_draw_indirect.js +69 -0
  140. package/src/shade/renderer/rasterize/native/oit/graph_rasterize_meshes_transparent_oit.d.ts.map +1 -1
  141. package/src/shade/renderer/rasterize/native/oit/graph_rasterize_meshes_transparent_oit.js +665 -722
  142. package/src/shade/renderer/rasterize/native/oit/shader_oit_generate_moments.js +3 -3
  143. package/src/shade/renderer/rasterize/native/oit/shader_oit_resolve_moments.js +4 -4
  144. package/src/shade/renderer/rasterize/native/oit/shader_oit_resolve_moments_ibl.js +4 -4
  145. package/src/shade/renderer/rasterize/native/oit/FORWARD_VERTEX_SHADER_STRUCT.d.ts +0 -3
  146. package/src/shade/renderer/rasterize/native/oit/FORWARD_VERTEX_SHADER_STRUCT.d.ts.map +0 -1
  147. package/src/shade/renderer/rasterize/native/oit/SHADING_SCENE_RESOURCE_GROUP.d.ts +0 -3
  148. package/src/shade/renderer/rasterize/native/oit/SHADING_SCENE_RESOURCE_GROUP.d.ts.map +0 -1
  149. package/src/shade/renderer/rasterize/native/oit/SHADING_SCENE_RESOURCE_GROUP.js +0 -17
  150. package/src/shade/renderer/rasterize/native/oit/chunk_forward_shade_standard_fragment_brick4.d.ts.map +0 -1
  151. package/src/shade/renderer/rasterize/native/oit/chunk_forward_shade_standard_fragment_ibl.d.ts.map +0 -1
  152. package/src/shade/renderer/rasterize/native/oit/chunk_material_side_should_draw.d.ts.map +0 -1
  153. package/src/shade/renderer/rasterize/native/oit/vertex_shader_chunk.d.ts +0 -3
  154. package/src/shade/renderer/rasterize/native/oit/vertex_shader_chunk.d.ts.map +0 -1
@@ -0,0 +1,22 @@
1
+ import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
2
+ import { AVBOIT_EXTINCTION_SCALE } from "./AVBOIT_CONSTANTS.js";
3
+ import { chunk_avboit_unpack_counts } from "./chunk_avboit_unpack_counts.js";
4
+
5
+ /**
6
+ * Which channels an atomic add of `counts` pushed past 255, given the word's value before the add.
7
+ * The splat records the slice for each such channel; the integration pins the channel at full
8
+ * extinction from there on, since a ray that has overflowed a field is extinct anyway and the field
9
+ * may carry into its neighbour past that point.
10
+ *
11
+ * @type {CodeChunk}
12
+ */
13
+ export const chunk_avboit_overflows = CodeChunk.from(
14
+ //language=WGSL
15
+ `
16
+ fn avboit_overflows(previous: u32, counts: vec3<u32>) -> vec3<bool> {
17
+ return (avboit_unpack_counts(previous) + counts) > vec3<u32>(${AVBOIT_EXTINCTION_SCALE}u);
18
+ }
19
+ `, [
20
+ chunk_avboit_unpack_counts,
21
+ ]
22
+ );
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Three channel counts into one `u32`, 10 bits each, R lowest. The fields hold 8-bit values with two
3
+ * guard bits each (deck slide 60), so four saturating events can pile up in one slice before a carry
4
+ * reaches the next channel; `avboit_overflows` is what catches the first one past 255.
5
+ *
6
+ * @type {CodeChunk}
7
+ */
8
+ export const chunk_avboit_pack_counts: CodeChunk;
9
+ import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
10
+ //# sourceMappingURL=chunk_avboit_pack_counts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk_avboit_pack_counts.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/rasterize/native/avboit/chunk_avboit_pack_counts.js"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,uCAFU,SAAS,CAYjB;0BApBwB,uCAAuC"}
@@ -0,0 +1,21 @@
1
+ import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
2
+ import { AVBOIT_FIELD_BITS } from "./AVBOIT_CONSTANTS.js";
3
+
4
+ /**
5
+ * Three channel counts into one `u32`, 10 bits each, R lowest. The fields hold 8-bit values with two
6
+ * guard bits each (deck slide 60), so four saturating events can pile up in one slice before a carry
7
+ * reaches the next channel; `avboit_overflows` is what catches the first one past 255.
8
+ *
9
+ * @type {CodeChunk}
10
+ */
11
+ export const chunk_avboit_pack_counts = CodeChunk.from(
12
+ //language=WGSL
13
+ `
14
+ fn avboit_pack_counts(counts: vec3<u32>) -> u32 {
15
+ var packed = insertBits(0u, counts.x, 0u, ${AVBOIT_FIELD_BITS}u);
16
+ packed = insertBits(packed, counts.y, ${AVBOIT_FIELD_BITS}u, ${AVBOIT_FIELD_BITS}u);
17
+ packed = insertBits(packed, counts.z, ${AVBOIT_FIELD_BITS * 2}u, ${AVBOIT_FIELD_BITS}u);
18
+ return packed;
19
+ }
20
+ `
21
+ );
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The RGB transmittance of everything in front of a fragment: a trilinear sample of the integral
3
+ * texture at the biased, warped depth, turned back into transmittance. The draw weights a fragment's
4
+ * whole contribution by it.
5
+ *
6
+ * @type {CodeChunk}
7
+ */
8
+ export const chunk_avboit_sample_transmittance: CodeChunk;
9
+ import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
10
+ //# sourceMappingURL=chunk_avboit_sample_transmittance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk_avboit_sample_transmittance.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/rasterize/native/avboit/chunk_avboit_sample_transmittance.js"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,gDAFU,SAAS,CAqBjB;0BA/BwB,uCAAuC"}
@@ -0,0 +1,32 @@
1
+ import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
2
+ import { AVBOIT_WARP_STRUCT } from "./AVBOIT_WARP_STRUCT.js";
3
+ import { chunk_avboit_extinction_to_transmittance } from "./chunk_avboit_extinction_to_transmittance.js";
4
+ import { chunk_avboit_integral_depth_coordinate } from "./chunk_avboit_integral_depth_coordinate.js";
5
+
6
+ /**
7
+ * The RGB transmittance of everything in front of a fragment: a trilinear sample of the integral
8
+ * texture at the biased, warped depth, turned back into transmittance. The draw weights a fragment's
9
+ * whole contribution by it.
10
+ *
11
+ * @type {CodeChunk}
12
+ */
13
+ export const chunk_avboit_sample_transmittance = CodeChunk.from(
14
+ //language=WGSL
15
+ `
16
+ fn avboit_sample_transmittance(
17
+ warp: ptr<storage, ${AVBOIT_WARP_STRUCT.wgsl_ref}, read>,
18
+ integral: texture_3d<f32>,
19
+ integral_sampler: sampler,
20
+ screen_uv: vec2<f32>,
21
+ z_view: f32,
22
+ ) -> vec3<f32> {
23
+ let w = avboit_integral_depth_coordinate(warp, z_view);
24
+ let extinction = textureSampleLevel(integral, integral_sampler, vec3<f32>(screen_uv, w), 0.0).rgb;
25
+ return avboit_extinction_to_transmittance(extinction);
26
+ }
27
+ `, [
28
+ AVBOIT_WARP_STRUCT.declaration_chunk,
29
+ chunk_avboit_integral_depth_coordinate,
30
+ chunk_avboit_extinction_to_transmittance,
31
+ ]
32
+ );
@@ -0,0 +1,20 @@
1
+ /**
2
+ * The per-channel transmission tint of a surface — what colours the light it lets through.
3
+ *
4
+ * `mix(1, base colour, weight)`, clamped away from zero so its logarithm stays finite. With a weight
5
+ * of zero a surface tints nothing and lands exactly where MBOIT's scalar coverage puts it; with the
6
+ * material's `transmission_factor` as the weight, glass filters the background by its base colour.
7
+ * Used by both the splat (what the volume records) and the draw (what the accumulators record),
8
+ * which is the one place the two must agree; both take the weight as
9
+ * `transmission_factor × warp.tint_from_base_color`, so the renderer's `AVBOITSettings` decides.
10
+ *
11
+ * Base colour as the transmission colour is glTF's `KHR_materials_transmission` reading, not
12
+ * OpenPBR's (whose transmission colour defaults to white). The engine's material has no transmission
13
+ * colour of its own today, and its forward shader and path tracer transmit untinted — which is why
14
+ * the weight is off unless asked for.
15
+ *
16
+ * @type {CodeChunk}
17
+ */
18
+ export const chunk_avboit_transmission_tint: CodeChunk;
19
+ import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
20
+ //# sourceMappingURL=chunk_avboit_transmission_tint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk_avboit_transmission_tint.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/rasterize/native/avboit/chunk_avboit_transmission_tint.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AACH,6CAFU,SAAS,CASjB;0BA1BwB,uCAAuC"}
@@ -0,0 +1,27 @@
1
+ import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
2
+
3
+ /**
4
+ * The per-channel transmission tint of a surface — what colours the light it lets through.
5
+ *
6
+ * `mix(1, base colour, weight)`, clamped away from zero so its logarithm stays finite. With a weight
7
+ * of zero a surface tints nothing and lands exactly where MBOIT's scalar coverage puts it; with the
8
+ * material's `transmission_factor` as the weight, glass filters the background by its base colour.
9
+ * Used by both the splat (what the volume records) and the draw (what the accumulators record),
10
+ * which is the one place the two must agree; both take the weight as
11
+ * `transmission_factor × warp.tint_from_base_color`, so the renderer's `AVBOITSettings` decides.
12
+ *
13
+ * Base colour as the transmission colour is glTF's `KHR_materials_transmission` reading, not
14
+ * OpenPBR's (whose transmission colour defaults to white). The engine's material has no transmission
15
+ * colour of its own today, and its forward shader and path tracer transmit untinted — which is why
16
+ * the weight is off unless asked for.
17
+ *
18
+ * @type {CodeChunk}
19
+ */
20
+ export const chunk_avboit_transmission_tint = CodeChunk.from(
21
+ //language=WGSL
22
+ `
23
+ fn avboit_transmission_tint(base_color: vec3<f32>, weight: f32) -> vec3<f32> {
24
+ return clamp(mix(vec3<f32>(1.0), base_color, weight), vec3<f32>(1e-3), vec3<f32>(1.0));
25
+ }
26
+ `
27
+ );
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Per-channel transmittance to the volume's normalized extinction: `saturate(-ln T / ln 256)`, so
3
+ * `1.0` is a transmittance of `1/256`, which the integration treats as zero. Floored at `1e-6`
4
+ * before the logarithm so a fully opaque channel saturates instead of producing infinity.
5
+ *
6
+ * @type {CodeChunk}
7
+ */
8
+ export const chunk_avboit_transmittance_to_extinction: CodeChunk;
9
+ import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
10
+ //# sourceMappingURL=chunk_avboit_transmittance_to_extinction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk_avboit_transmittance_to_extinction.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/rasterize/native/avboit/chunk_avboit_transmittance_to_extinction.js"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,uDAFU,SAAS,CASjB;0BAjBwB,uCAAuC"}
@@ -0,0 +1,18 @@
1
+ import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
2
+ import { AVBOIT_EXTINCTION_MAX } from "./AVBOIT_CONSTANTS.js";
3
+
4
+ /**
5
+ * Per-channel transmittance to the volume's normalized extinction: `saturate(-ln T / ln 256)`, so
6
+ * `1.0` is a transmittance of `1/256`, which the integration treats as zero. Floored at `1e-6`
7
+ * before the logarithm so a fully opaque channel saturates instead of producing infinity.
8
+ *
9
+ * @type {CodeChunk}
10
+ */
11
+ export const chunk_avboit_transmittance_to_extinction = CodeChunk.from(
12
+ //language=WGSL
13
+ `
14
+ fn avboit_transmittance_to_extinction(transmittance: vec3<f32>) -> vec3<f32> {
15
+ return saturate(-log(max(transmittance, vec3<f32>(1e-6))) / ${AVBOIT_EXTINCTION_MAX});
16
+ }
17
+ `
18
+ );
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The three 10-bit channel fields of a packed extinction word, see `avboit_pack_counts`. A field
3
+ * that has summed past 255 reads as it is — the integration saturates, this does not.
4
+ *
5
+ * @type {CodeChunk}
6
+ */
7
+ export const chunk_avboit_unpack_counts: CodeChunk;
8
+ import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
9
+ //# sourceMappingURL=chunk_avboit_unpack_counts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk_avboit_unpack_counts.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/rasterize/native/avboit/chunk_avboit_unpack_counts.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,yCAFU,SAAS,CAajB;0BApBwB,uCAAuC"}
@@ -0,0 +1,21 @@
1
+ import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
2
+ import { AVBOIT_FIELD_BITS } from "./AVBOIT_CONSTANTS.js";
3
+
4
+ /**
5
+ * The three 10-bit channel fields of a packed extinction word, see `avboit_pack_counts`. A field
6
+ * that has summed past 255 reads as it is — the integration saturates, this does not.
7
+ *
8
+ * @type {CodeChunk}
9
+ */
10
+ export const chunk_avboit_unpack_counts = CodeChunk.from(
11
+ //language=WGSL
12
+ `
13
+ fn avboit_unpack_counts(packed: u32) -> vec3<u32> {
14
+ return vec3<u32>(
15
+ extractBits(packed, 0u, ${AVBOIT_FIELD_BITS}u),
16
+ extractBits(packed, ${AVBOIT_FIELD_BITS}u, ${AVBOIT_FIELD_BITS}u),
17
+ extractBits(packed, ${AVBOIT_FIELD_BITS * 2}u, ${AVBOIT_FIELD_BITS}u),
18
+ );
19
+ }
20
+ `
21
+ );
@@ -0,0 +1,9 @@
1
+ /**
2
+ * View-space depth straight to the continuous physical slice coordinate in `[0, P]` — the curve,
3
+ * then the warp. What the splat positions a fragment by.
4
+ *
5
+ * @type {CodeChunk}
6
+ */
7
+ export const chunk_avboit_view_depth_to_physical: CodeChunk;
8
+ import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
9
+ //# sourceMappingURL=chunk_avboit_view_depth_to_physical.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk_avboit_view_depth_to_physical.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/rasterize/native/avboit/chunk_avboit_view_depth_to_physical.js"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,kDAFU,SAAS,CAajB;0BAtBwB,uCAAuC"}
@@ -0,0 +1,23 @@
1
+ import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
2
+ import { AVBOIT_WARP_STRUCT } from "./AVBOIT_WARP_STRUCT.js";
3
+ import { chunk_avboit_view_depth_to_virtual } from "./chunk_avboit_view_depth_to_virtual.js";
4
+ import { chunk_avboit_warp } from "./chunk_avboit_warp.js";
5
+
6
+ /**
7
+ * View-space depth straight to the continuous physical slice coordinate in `[0, P]` — the curve,
8
+ * then the warp. What the splat positions a fragment by.
9
+ *
10
+ * @type {CodeChunk}
11
+ */
12
+ export const chunk_avboit_view_depth_to_physical = CodeChunk.from(
13
+ //language=WGSL
14
+ `
15
+ fn avboit_view_depth_to_physical(warp: ptr<storage, ${AVBOIT_WARP_STRUCT.wgsl_ref}, read>, z_view: f32) -> f32 {
16
+ return avboit_warp(warp, avboit_view_depth_to_virtual(warp, z_view));
17
+ }
18
+ `, [
19
+ AVBOIT_WARP_STRUCT.declaration_chunk,
20
+ chunk_avboit_view_depth_to_virtual,
21
+ chunk_avboit_warp,
22
+ ]
23
+ );
@@ -0,0 +1,13 @@
1
+ /**
2
+ * View-space depth (world units) to the continuous virtual slice coordinate in `[0, V]`.
3
+ *
4
+ * The curve is the engine's log depth slicing (`cluster_depth_to_z_slice`, the light clusters' and
5
+ * the froxels'), with parameters built for the finest resolution by `avboit_build_depth_curve` and
6
+ * carried in the warp header. The active resolution `V` is that or a power-of-two fraction of it
7
+ * (plan §3.2), so the finest-level coordinate scales down by `V / V_max`.
8
+ *
9
+ * @type {CodeChunk}
10
+ */
11
+ export const chunk_avboit_view_depth_to_virtual: CodeChunk;
12
+ import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
13
+ //# sourceMappingURL=chunk_avboit_view_depth_to_virtual.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk_avboit_view_depth_to_virtual.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/rasterize/native/avboit/chunk_avboit_view_depth_to_virtual.js"],"names":[],"mappings":"AAKA;;;;;;;;;GASG;AACH,iDAFU,SAAS,CAajB;0BAzBwB,uCAAuC"}
@@ -0,0 +1,27 @@
1
+ import { chunk_cluster_depth_to_z_slice } from "../../../light/cluster/chunk_cluster_depth_to_z_slice.js";
2
+ import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
3
+ import { AVBOIT_VIRTUAL_SLICES_MAX } from "./AVBOIT_CONSTANTS.js";
4
+ import { AVBOIT_WARP_STRUCT } from "./AVBOIT_WARP_STRUCT.js";
5
+
6
+ /**
7
+ * View-space depth (world units) to the continuous virtual slice coordinate in `[0, V]`.
8
+ *
9
+ * The curve is the engine's log depth slicing (`cluster_depth_to_z_slice`, the light clusters' and
10
+ * the froxels'), with parameters built for the finest resolution by `avboit_build_depth_curve` and
11
+ * carried in the warp header. The active resolution `V` is that or a power-of-two fraction of it
12
+ * (plan §3.2), so the finest-level coordinate scales down by `V / V_max`.
13
+ *
14
+ * @type {CodeChunk}
15
+ */
16
+ export const chunk_avboit_view_depth_to_virtual = CodeChunk.from(
17
+ //language=WGSL
18
+ `
19
+ fn avboit_view_depth_to_virtual(warp: ptr<storage, ${AVBOIT_WARP_STRUCT.wgsl_ref}, read>, z_view: f32) -> f32 {
20
+ let finest = cluster_depth_to_z_slice(z_view, (*warp).cluster_parameters, ${AVBOIT_VIRTUAL_SLICES_MAX}.0);
21
+ return finest * f32((*warp).virtual_count) / ${AVBOIT_VIRTUAL_SLICES_MAX}.0;
22
+ }
23
+ `, [
24
+ AVBOIT_WARP_STRUCT.declaration_chunk,
25
+ chunk_cluster_depth_to_z_slice,
26
+ ]
27
+ );
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The depth warp: virtual slice coordinate to physical slice coordinate, continuous and monotone.
3
+ *
4
+ * ```
5
+ * φ(v_f) = prefix(v) + occupied(v) · frac(v_f), v = min(floor(v_f), V - 1)
6
+ * ```
7
+ *
8
+ * Slope 1 across an occupied virtual slice, flat across an empty one. Flat is what makes empty space
9
+ * disappear correctly: a coordinate that falls in a gap lands exactly on the physical boundary between
10
+ * the run before the gap and the run after it, and with the integral stored at slice boundaries
11
+ * (`shader_avboit_integrate`) that reads the previous run's whole total and none of the next run's.
12
+ * The deck's "filterable" begin/end flags exist to get the same effect out of a discrete LUT.
13
+ *
14
+ * Takes the whole warp binding by pointer: passing a pointer to a binding variable is core WGSL,
15
+ * where a pointer to one of its members is not, and the emulator models pointers as plain values so
16
+ * the same code runs in tests.
17
+ *
18
+ * @type {CodeChunk}
19
+ */
20
+ export const chunk_avboit_warp: CodeChunk;
21
+ import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
22
+ //# sourceMappingURL=chunk_avboit_warp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk_avboit_warp.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/rasterize/native/avboit/chunk_avboit_warp.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;GAkBG;AACH,gCAFU,SAAS,CAiBjB;0BArCwB,uCAAuC"}
@@ -0,0 +1,38 @@
1
+ import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
2
+ import { AVBOIT_WARP_STRUCT } from "./AVBOIT_WARP_STRUCT.js";
3
+
4
+ /**
5
+ * The depth warp: virtual slice coordinate to physical slice coordinate, continuous and monotone.
6
+ *
7
+ * ```
8
+ * φ(v_f) = prefix(v) + occupied(v) · frac(v_f), v = min(floor(v_f), V - 1)
9
+ * ```
10
+ *
11
+ * Slope 1 across an occupied virtual slice, flat across an empty one. Flat is what makes empty space
12
+ * disappear correctly: a coordinate that falls in a gap lands exactly on the physical boundary between
13
+ * the run before the gap and the run after it, and with the integral stored at slice boundaries
14
+ * (`shader_avboit_integrate`) that reads the previous run's whole total and none of the next run's.
15
+ * The deck's "filterable" begin/end flags exist to get the same effect out of a discrete LUT.
16
+ *
17
+ * Takes the whole warp binding by pointer: passing a pointer to a binding variable is core WGSL,
18
+ * where a pointer to one of its members is not, and the emulator models pointers as plain values so
19
+ * the same code runs in tests.
20
+ *
21
+ * @type {CodeChunk}
22
+ */
23
+ export const chunk_avboit_warp = CodeChunk.from(
24
+ //language=WGSL
25
+ `
26
+ fn avboit_warp(warp: ptr<storage, ${AVBOIT_WARP_STRUCT.wgsl_ref}, read>, v_f: f32) -> f32 {
27
+ let count = max((*warp).virtual_count, 1u);
28
+ let v_clamped = clamp(v_f, 0.0, f32(count));
29
+ let v = min(u32(floor(v_clamped)), count - 1u);
30
+ let entry = (*warp).lut[v];
31
+ let prefix = f32(entry >> 1u);
32
+ let occupied = f32(entry & 1u);
33
+ return prefix + occupied * (v_clamped - f32(v));
34
+ }
35
+ `, [
36
+ AVBOIT_WARP_STRUCT.declaration_chunk,
37
+ ]
38
+ );
@@ -0,0 +1,117 @@
1
+ /**
2
+ * Extinction volume XY resolution for an internal resolution.
3
+ *
4
+ * @param {ArrayLike<number>} resolution
5
+ * @returns {number[]}
6
+ */
7
+ export function avboit_voxel_resolution(resolution: ArrayLike<number>): number[];
8
+ /**
9
+ * Occupancy prepass over one bucket's HZB-filtered meshlets (plan §3.3).
10
+ *
11
+ * @param {FrameGraph} graph
12
+ * @param {GPUSceneContext} scene
13
+ * @param {number} camera resource ID
14
+ * @param {ArrayLike<number>} cluster_parameters the depth curve, see avboit_build_depth_curve
15
+ * @param {number} meshlet_collection resource ID, `MESHLET_COLLECTION_STRUCT` with its count header
16
+ * @param {number} meshlet_iterator_command resource ID, indirect dispatch over the collection
17
+ * @param {number} [occupancy] resource ID of an existing occupancy buffer to add to; created when -1
18
+ * @returns {number} resource ID of the occupancy bits
19
+ */
20
+ export function graph_avboit_occupancy({ graph, scene, camera, cluster_parameters, meshlet_collection, meshlet_iterator_command, occupancy, }: FrameGraph): number;
21
+ /**
22
+ * The depth-warp LUT from the occupancy bits (plan §3.4).
23
+ *
24
+ * @param {FrameGraph} graph
25
+ * @param {number} occupancy resource ID
26
+ * @param {number[]} voxel_resolution
27
+ * @param {ArrayLike<number>} cluster_parameters the depth curve, see avboit_build_depth_curve
28
+ * @param {AVBOITSettings} [avboit] the renderer's switches, carried into the header
29
+ * @returns {number} resource ID of the `AVBOIT_WARP_STRUCT` buffer
30
+ */
31
+ export function graph_avboit_build_warp({ graph, occupancy, voxel_resolution, cluster_parameters, avboit, }: FrameGraph): number;
32
+ /**
33
+ * Splat one bucket's transparent draws into the extinction volume (plan §3.5).
34
+ *
35
+ * @param {FrameGraph} graph
36
+ * @param {GPUViewContext} view_ctx
37
+ * @param {number} material_count
38
+ * @param {ShadeMaterial[]} materials
39
+ * @param {number} draw_commands resource ID
40
+ * @param {number} meshlets resource ID
41
+ * @param {number} camera resource ID
42
+ * @param {number} warp resource ID
43
+ * @param {number[]} voxel_resolution
44
+ * @param {PrimitiveState} primitive
45
+ * @param {{extinction: number, overflow: number, dummy: number}} [volume] existing resources to add to
46
+ * @returns {{extinction: number, overflow: number, dummy: number}}
47
+ */
48
+ export function graph_avboit_splat({ graph, view_ctx, material_count, materials, draw_commands, meshlets, camera, warp, voxel_resolution, primitive, volume, }: FrameGraph): {
49
+ extinction: number;
50
+ overflow: number;
51
+ dummy: number;
52
+ };
53
+ /**
54
+ * Integrate the extinction volume into the 3D transmittance-integral texture (plan §3.6).
55
+ *
56
+ * @param {FrameGraph} graph
57
+ * @param {number} warp resource ID
58
+ * @param {number} extinction resource ID
59
+ * @param {number} overflow resource ID
60
+ * @param {number[]} voxel_resolution
61
+ * @returns {number} resource ID of the integral texture, `P + 1` slices deep
62
+ */
63
+ export function graph_avboit_integrate({ graph, warp, extinction, overflow, voxel_resolution, }: FrameGraph): number;
64
+ /**
65
+ * Draw one bucket's transparent materials with full shading into the three accumulators (plan §3.8).
66
+ *
67
+ * @param {FrameGraph} graph
68
+ * @param {GPUViewContext} view_ctx
69
+ * @param {number} material_count
70
+ * @param {ShadeMaterial[]} materials
71
+ * @param {number} draw_commands resource ID
72
+ * @param {number} meshlets resource ID
73
+ * @param {number} depth_texture resource ID
74
+ * @param {number} warp resource ID
75
+ * @param {number} integral resource ID
76
+ * @param {PrimitiveState} primitive
77
+ * @param {number} light_cluster_parameters
78
+ * @param {number} light_cluster_lookup
79
+ * @param {number} light_cluster_data
80
+ * @param {number} shadowmap_atlas
81
+ * @param {number} volumetrics_lut
82
+ * @param {number} volumetrics_metadata
83
+ * @param {{color: number, norm: number, extinction: number}} [accumulators] existing targets to add to
84
+ * @param {ShadeIndirectLightingMode} indirect_lighting_mode
85
+ * @returns {{color: number, norm: number, extinction: number}}
86
+ */
87
+ export function graph_avboit_draw({ graph, view_ctx, material_count, materials, draw_commands, meshlets, depth_texture, warp, integral, primitive, light_cluster_parameters, light_cluster_lookup, light_cluster_data, shadowmap_atlas, volumetrics_lut, volumetrics_metadata, accumulators, indirect_lighting_mode, }: FrameGraph): {
88
+ color: number;
89
+ norm: number;
90
+ extinction: number;
91
+ };
92
+ /**
93
+ * Adaptive voxel-based order-independent transparency (Drobot, SIGGRAPH 2025). Does not write depth.
94
+ *
95
+ * Same argument object and same return as `graph_rasterize_meshes_transparent_oit`, so `Renderer`
96
+ * selects between the two with `transparency_mode` alone. The passes it records are listed in
97
+ * `AVBOIT_PLAN_2026_09_03.md` §3.1.
98
+ *
99
+ * @param {FrameGraph} graph
100
+ * @param {number} buckets
101
+ * @param {GPUViewContext} view_ctx
102
+ * @param {number[]} viewport
103
+ * @param {number} color_texture resource ID
104
+ * @param {number} depth_texture resource ID
105
+ * @param {GPUCollectionLimits} limits
106
+ * @param {number} light_cluster_parameters
107
+ * @param {number} light_cluster_lookup
108
+ * @param {number} light_cluster_data
109
+ * @param {number} shadowmap_atlas
110
+ * @param {number} volumetrics_lut
111
+ * @param {number} volumetrics_metadata
112
+ * @param {ShadeIndirectLightingMode} indirect_lighting_mode
113
+ * @param {AVBOITSettings} [avboit] `Renderer.avboit`; the MBOIT orchestrator ignores it
114
+ * @returns {number} resource ID of the composited color texture
115
+ */
116
+ export function graph_rasterize_meshes_transparent_avboit({ graph, buckets, view_ctx, viewport, depth_texture, color_texture, limits, light_cluster_parameters, light_cluster_lookup, light_cluster_data, shadowmap_atlas, volumetrics_lut, volumetrics_metadata, indirect_lighting_mode, avboit, }: FrameGraph): number;
117
+ //# sourceMappingURL=graph_rasterize_meshes_transparent_avboit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph_rasterize_meshes_transparent_avboit.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.js"],"names":[],"mappings":"AAgEA;;;;;GAKG;AACH,oDAHW,UAAU,MAAM,CAAC,GACf,MAAM,EAAE,CAOpB;AAED;;;;;;;;;;;GAWG;AACH,4JAFa,MAAM,CA4DlB;AAED;;;;;;;;;GASG;AACH,0HAFa,MAAM,CAsDlB;AAED;;;;;;;;;;;;;;;GAeG;AACH,6KAFa;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAC,CAkJjE;AAED;;;;;;;;;GASG;AACH,8GAFa,MAAM,CAoClB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qUAFa;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAC,CAwN7D;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,kTAFa,MAAM,CA4PlB"}