@woosh/meep-engine 3.30.0 → 3.31.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 (1579) hide show
  1. package/build/bundle-worker-image-decoder.js +1 -1
  2. package/build/bundle-worker-terrain.js +1 -1
  3. package/package.json +3 -1
  4. package/src/core/binary/BinaryBuffer.d.ts.map +1 -1
  5. package/src/core/binary/BinaryBuffer.js +42 -14
  6. package/src/core/binary/BitImage2.d.ts.map +1 -1
  7. package/src/core/binary/BitImage2.js +2 -6
  8. package/src/core/binary/BitSet.js +5 -5
  9. package/src/core/binary/compression/chunks_to_stream.d.ts +24 -0
  10. package/src/core/binary/compression/chunks_to_stream.d.ts.map +1 -0
  11. package/src/core/binary/compression/chunks_to_stream.js +35 -0
  12. package/src/core/binary/compression/compress_bytes.d.ts +3 -4
  13. package/src/core/binary/compression/compress_bytes.d.ts.map +1 -1
  14. package/src/core/binary/compression/compress_bytes.js +6 -17
  15. package/src/core/binary/compression/decompress_bytes.d.ts +1 -2
  16. package/src/core/binary/compression/decompress_bytes.d.ts.map +1 -1
  17. package/src/core/binary/compression/decompress_bytes.js +4 -15
  18. package/src/core/binary/compression/decompress_bytes_into.d.ts.map +1 -1
  19. package/src/core/binary/compression/decompress_bytes_into.js +2 -13
  20. package/src/core/binary/ctz32.d.ts +12 -4
  21. package/src/core/binary/ctz32.d.ts.map +1 -1
  22. package/src/core/binary/ctz32.js +23 -41
  23. package/src/core/binary/lsb_32.d.ts +10 -2
  24. package/src/core/binary/lsb_32.d.ts.map +1 -1
  25. package/src/core/binary/lsb_32.js +17 -12
  26. package/src/core/binary/lz4/lz4_compress_block_hc.js +2 -2
  27. package/src/core/binary/type/DataTypeIndices.d.ts +39 -0
  28. package/src/core/binary/type/DataTypeIndices.d.ts.map +1 -1
  29. package/src/core/binary/type/DataTypeIndices.js +38 -1
  30. package/src/core/binary/type/Type.d.ts.map +1 -1
  31. package/src/core/binary/type/Type.js +6 -1
  32. package/src/core/bvh2/bvh3/ebvh_optimize_treelet.js +3 -3
  33. package/src/core/bvh8/bvh8_geometry_validate.d.ts.map +1 -1
  34. package/src/core/bvh8/bvh8_geometry_validate.js +2 -88
  35. package/src/core/bvh8/bvh8_geometry_validate_bounds.d.ts +25 -0
  36. package/src/core/bvh8/bvh8_geometry_validate_bounds.d.ts.map +1 -0
  37. package/src/core/bvh8/bvh8_geometry_validate_bounds.js +105 -0
  38. package/src/core/bvh8/bvh8_geometry_validate_indirect.d.ts.map +1 -1
  39. package/src/core/bvh8/bvh8_geometry_validate_indirect.js +2 -91
  40. package/src/core/clipboard/obtainClipBoard.d.ts +4 -0
  41. package/src/core/clipboard/obtainClipBoard.d.ts.map +1 -1
  42. package/src/core/clipboard/obtainClipBoard.js +29 -8
  43. package/src/core/clipboard/safeClipboardReadText.d.ts.map +1 -1
  44. package/src/core/clipboard/safeClipboardReadText.js +73 -38
  45. package/src/core/clipboard/safeClipboardWriteText.d.ts.map +1 -1
  46. package/src/core/clipboard/safeClipboardWriteText.js +11 -9
  47. package/src/core/collection/array/iterator/ArrayIteratorRandom.d.ts.map +1 -1
  48. package/src/core/collection/array/iterator/ArrayIteratorRandom.js +6 -0
  49. package/src/core/collection/heap/IndexedFloatMinHeap.d.ts +6 -0
  50. package/src/core/collection/heap/IndexedFloatMinHeap.d.ts.map +1 -1
  51. package/src/core/collection/heap/IndexedFloatMinHeap.js +14 -0
  52. package/src/core/collection/list/FilteredListProjection.d.ts.map +1 -1
  53. package/src/core/collection/list/FilteredListProjection.js +7 -54
  54. package/src/core/collection/list/List.d.ts +4 -0
  55. package/src/core/collection/list/List.d.ts.map +1 -1
  56. package/src/core/collection/list/List.js +10 -52
  57. package/src/core/collection/list/SortedListProjection.d.ts +7 -0
  58. package/src/core/collection/list/SortedListProjection.d.ts.map +1 -1
  59. package/src/core/collection/list/SortedListProjection.js +12 -0
  60. package/src/core/collection/list/list_apply_ordered_diff.d.ts +37 -0
  61. package/src/core/collection/list/list_apply_ordered_diff.d.ts.map +1 -0
  62. package/src/core/collection/list/list_apply_ordered_diff.js +87 -0
  63. package/src/core/collection/map/BiMap.d.ts.map +1 -1
  64. package/src/core/collection/map/BiMap.js +19 -6
  65. package/src/core/collection/map/HashMap.d.ts.map +1 -1
  66. package/src/core/collection/map/HashMap.js +38 -11
  67. package/src/core/collection/queue/Deque.d.ts +2 -2
  68. package/src/core/collection/queue/Deque.d.ts.map +1 -1
  69. package/src/core/collection/queue/Deque.js +12 -1
  70. package/src/core/collection/table/RowFirstTable.d.ts.map +1 -1
  71. package/src/core/collection/table/RowFirstTable.js +15 -2
  72. package/src/core/collection/table/serializeRowFirstTable.d.ts.map +1 -1
  73. package/src/core/collection/table/serializeRowFirstTable.js +2 -3
  74. package/src/core/color/operations/color_lerp.d.ts.map +1 -1
  75. package/src/core/color/operations/color_lerp.js +77 -55
  76. package/src/core/color/sRGB/linear_to_sRGB.d.ts.map +1 -1
  77. package/src/core/color/sRGB/linear_to_sRGB.js +3 -1
  78. package/src/core/debug/matchers/AllOf.d.ts +2 -1
  79. package/src/core/debug/matchers/AllOf.d.ts.map +1 -1
  80. package/src/core/debug/matchers/AllOf.js +1 -1
  81. package/src/core/debug/matchers/AnyOf.d.ts +2 -1
  82. package/src/core/debug/matchers/AnyOf.d.ts.map +1 -1
  83. package/src/core/debug/matchers/AnyOf.js +1 -1
  84. package/src/core/debug/matchers/CombinableMatcher.d.ts +2 -1
  85. package/src/core/debug/matchers/CombinableMatcher.d.ts.map +1 -1
  86. package/src/core/debug/matchers/CombinableMatcher.js +1 -1
  87. package/src/core/debug/matchers/DescribeAs.d.ts +2 -1
  88. package/src/core/debug/matchers/DescribeAs.d.ts.map +1 -1
  89. package/src/core/debug/matchers/DescribeAs.js +2 -1
  90. package/src/core/debug/matchers/IsAnything.d.ts +2 -1
  91. package/src/core/debug/matchers/IsAnything.d.ts.map +1 -1
  92. package/src/core/debug/matchers/IsAnything.js +2 -1
  93. package/src/core/debug/matchers/IsEqual.d.ts +2 -1
  94. package/src/core/debug/matchers/IsEqual.d.ts.map +1 -1
  95. package/src/core/debug/matchers/IsEqual.js +2 -1
  96. package/src/core/debug/matchers/IsFinite.d.ts +2 -1
  97. package/src/core/debug/matchers/IsFinite.d.ts.map +1 -1
  98. package/src/core/debug/matchers/IsFinite.js +2 -1
  99. package/src/core/debug/matchers/IsIn.d.ts +2 -1
  100. package/src/core/debug/matchers/IsIn.d.ts.map +1 -1
  101. package/src/core/debug/matchers/IsIn.js +2 -1
  102. package/src/core/debug/matchers/IsInteger.d.ts +2 -1
  103. package/src/core/debug/matchers/IsInteger.d.ts.map +1 -1
  104. package/src/core/debug/matchers/IsInteger.js +2 -1
  105. package/src/core/debug/matchers/IsIterableContaining.d.ts +2 -1
  106. package/src/core/debug/matchers/IsIterableContaining.d.ts.map +1 -1
  107. package/src/core/debug/matchers/IsIterableContaining.js +1 -1
  108. package/src/core/debug/matchers/IsNot.d.ts +2 -1
  109. package/src/core/debug/matchers/IsNot.d.ts.map +1 -1
  110. package/src/core/debug/matchers/IsNot.js +2 -1
  111. package/src/core/debug/matchers/IsNull.d.ts +2 -1
  112. package/src/core/debug/matchers/IsNull.d.ts.map +1 -1
  113. package/src/core/debug/matchers/IsNull.js +2 -1
  114. package/src/core/debug/matchers/IsUndefined.d.ts +2 -1
  115. package/src/core/debug/matchers/IsUndefined.d.ts.map +1 -1
  116. package/src/core/debug/matchers/IsUndefined.js +2 -1
  117. package/src/core/events/signal/Signal.d.ts +15 -0
  118. package/src/core/events/signal/Signal.d.ts.map +1 -1
  119. package/src/core/events/signal/Signal.js +857 -820
  120. package/src/core/fsm/simple/SimpleStateMachineDescription.d.ts.map +1 -1
  121. package/src/core/fsm/simple/SimpleStateMachineDescription.js +4 -3
  122. package/src/core/geom/2d/convex-hull/convex_hull_fixed_count_2d_bruteforce.d.ts.map +1 -1
  123. package/src/core/geom/2d/convex-hull/convex_hull_fixed_count_2d_bruteforce.js +6 -1
  124. package/src/core/geom/2d/convex-hull/convex_hull_fixed_count_2d_relaxation.d.ts +1 -1
  125. package/src/core/geom/2d/convex-hull/convex_hull_fixed_count_2d_relaxation.d.ts.map +1 -1
  126. package/src/core/geom/2d/convex-hull/convex_hull_fixed_count_2d_relaxation.js +6 -7
  127. package/src/core/geom/2d/hash-grid/SpatialHashGrid.d.ts.map +1 -1
  128. package/src/core/geom/2d/hash-grid/SpatialHashGrid.js +23 -6
  129. package/src/core/geom/2d/line/ray2_ray2_compute_intersection_array_2d.d.ts.map +1 -1
  130. package/src/core/geom/2d/line/ray2_ray2_compute_intersection_array_2d.js +13 -1
  131. package/src/core/geom/3d/aabb/aabb3_raycast_hit_point.d.ts.map +1 -1
  132. package/src/core/geom/3d/aabb/aabb3_raycast_hit_point.js +53 -32
  133. package/src/core/geom/3d/atlas/segment/atlas_chart_growth_cost.d.ts +40 -0
  134. package/src/core/geom/3d/atlas/segment/atlas_chart_growth_cost.d.ts.map +1 -0
  135. package/src/core/geom/3d/atlas/segment/atlas_chart_growth_cost.js +54 -0
  136. package/src/core/geom/3d/atlas/segment/atlas_segment_charts.d.ts +21 -3
  137. package/src/core/geom/3d/atlas/segment/atlas_segment_charts.d.ts.map +1 -1
  138. package/src/core/geom/3d/atlas/segment/atlas_segment_charts.js +24 -15
  139. package/src/core/geom/3d/atlas/segment/atlas_segment_charts_atomic.d.ts +6 -3
  140. package/src/core/geom/3d/atlas/segment/atlas_segment_charts_atomic.d.ts.map +1 -1
  141. package/src/core/geom/3d/atlas/segment/atlas_segment_charts_atomic.js +9 -15
  142. package/src/core/geom/3d/cone/cone_compute_plane_side.d.ts.map +1 -1
  143. package/src/core/geom/3d/cone/cone_compute_plane_side.js +31 -19
  144. package/src/core/geom/3d/equirectangular/equirectangular_direction_to_uv.d.ts +11 -1
  145. package/src/core/geom/3d/equirectangular/equirectangular_direction_to_uv.d.ts.map +1 -1
  146. package/src/core/geom/3d/equirectangular/equirectangular_direction_to_uv.js +11 -1
  147. package/src/core/geom/3d/equirectangular/equirectangular_uv_to_direction.d.ts +11 -1
  148. package/src/core/geom/3d/equirectangular/equirectangular_uv_to_direction.d.ts.map +1 -1
  149. package/src/core/geom/3d/equirectangular/equirectangular_uv_to_direction.js +11 -1
  150. package/src/core/geom/3d/frustum/frustum3_compute_closest_point.d.ts.map +1 -1
  151. package/src/core/geom/3d/frustum/frustum3_compute_closest_point.js +55 -0
  152. package/src/core/geom/3d/frustum/frustum_from_projection_matrix_array.d.ts +14 -0
  153. package/src/core/geom/3d/frustum/frustum_from_projection_matrix_array.d.ts.map +1 -1
  154. package/src/core/geom/3d/frustum/frustum_from_projection_matrix_array.js +17 -1
  155. package/src/core/geom/3d/gjk/gjk.d.ts +15 -0
  156. package/src/core/geom/3d/gjk/gjk.d.ts.map +1 -1
  157. package/src/core/geom/3d/gjk/gjk.js +15 -0
  158. package/src/core/geom/3d/gjk/gjk_epa_penetration.d.ts.map +1 -1
  159. package/src/core/geom/3d/gjk/gjk_epa_penetration.js +18 -0
  160. package/src/core/geom/3d/hash-grid/PointHashGrid3.d.ts +32 -3
  161. package/src/core/geom/3d/hash-grid/PointHashGrid3.d.ts.map +1 -1
  162. package/src/core/geom/3d/hash-grid/PointHashGrid3.js +36 -3
  163. package/src/core/geom/3d/morton/v3_morton_encode_lut.d.ts.map +1 -1
  164. package/src/core/geom/3d/morton/v3_morton_encode_lut.js +11 -4
  165. package/src/core/geom/3d/morton/v3_morton_encode_normalized.d.ts +16 -4
  166. package/src/core/geom/3d/morton/v3_morton_encode_normalized.d.ts.map +1 -1
  167. package/src/core/geom/3d/morton/v3_morton_encode_normalized.js +21 -8
  168. package/src/core/geom/3d/normal/spherical/encode_unit_to_spheremap.d.ts.map +1 -1
  169. package/src/core/geom/3d/normal/spherical/encode_unit_to_spheremap.js +17 -3
  170. package/src/core/geom/3d/octahedra/octahedral_direction_to_uv.d.ts +10 -0
  171. package/src/core/geom/3d/octahedra/octahedral_direction_to_uv.d.ts.map +1 -1
  172. package/src/core/geom/3d/octahedra/octahedral_direction_to_uv.js +46 -49
  173. package/src/core/geom/3d/octahedra/octahedral_uv_to_direction.d.ts +13 -1
  174. package/src/core/geom/3d/octahedra/octahedral_uv_to_direction.d.ts.map +1 -1
  175. package/src/core/geom/3d/octahedra/octahedral_uv_to_direction.js +36 -39
  176. package/src/core/geom/3d/quadric/quadric3_to_tensor_m3_inverse.d.ts +4 -1
  177. package/src/core/geom/3d/quadric/quadric3_to_tensor_m3_inverse.d.ts.map +1 -1
  178. package/src/core/geom/3d/quadric/quadric3_to_tensor_m3_inverse.js +22 -4
  179. package/src/core/geom/3d/quaternion/quat3_canonicalize_sign_run.d.ts +38 -0
  180. package/src/core/geom/3d/quaternion/quat3_canonicalize_sign_run.d.ts.map +1 -0
  181. package/src/core/geom/3d/quaternion/quat3_canonicalize_sign_run.js +76 -0
  182. package/src/core/geom/3d/quaternion/quat3_encode_to_uint32.d.ts +11 -0
  183. package/src/core/geom/3d/quaternion/quat3_encode_to_uint32.d.ts.map +1 -1
  184. package/src/core/geom/3d/quaternion/quat3_encode_to_uint32.js +14 -34
  185. package/src/core/geom/3d/shape/PosedShape3D.d.ts +9 -0
  186. package/src/core/geom/3d/shape/PosedShape3D.d.ts.map +1 -1
  187. package/src/core/geom/3d/shape/PosedShape3D.js +43 -0
  188. package/src/core/geom/3d/shape/UnionShape3D.d.ts.map +1 -1
  189. package/src/core/geom/3d/shape/UnionShape3D.js +20 -3
  190. package/src/core/geom/3d/shape/json/type_adapters.d.ts +11 -2
  191. package/src/core/geom/3d/shape/json/type_adapters.d.ts.map +1 -1
  192. package/src/core/geom/3d/shape/json/type_adapters.js +36 -12
  193. package/src/core/geom/3d/sphere/harmonics/sh3_sample_irradiance_by_direction.d.ts +13 -0
  194. package/src/core/geom/3d/sphere/harmonics/sh3_sample_irradiance_by_direction.d.ts.map +1 -1
  195. package/src/core/geom/3d/sphere/harmonics/sh3_sample_irradiance_by_direction.js +17 -4
  196. package/src/core/geom/3d/tetrahedra/tetrahedral_flip_layouts.d.ts +88 -0
  197. package/src/core/geom/3d/tetrahedra/tetrahedral_flip_layouts.d.ts.map +1 -0
  198. package/src/core/geom/3d/tetrahedra/tetrahedral_flip_layouts.js +108 -0
  199. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_23.d.ts.map +1 -1
  200. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_23.js +13 -31
  201. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_32.d.ts.map +1 -1
  202. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_32.js +14 -22
  203. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_improve_quality.d.ts.map +1 -1
  204. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_improve_quality.js +96 -26
  205. package/src/core/geom/3d/tetrahedra/tetrahedron_contains_point.d.ts.map +1 -1
  206. package/src/core/geom/3d/tetrahedra/tetrahedron_contains_point.js +17 -6
  207. package/src/core/geom/3d/topology/struct/binary/io/bt_boundary_loop.d.ts +27 -0
  208. package/src/core/geom/3d/topology/struct/binary/io/bt_boundary_loop.d.ts.map +1 -1
  209. package/src/core/geom/3d/topology/struct/binary/io/bt_boundary_loop.js +101 -0
  210. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_close_boundary_holes.d.ts +3 -0
  211. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_close_boundary_holes.d.ts.map +1 -1
  212. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_close_boundary_holes.js +5 -57
  213. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_compute_vertex_quadrics.d.ts.map +1 -1
  214. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_compute_vertex_quadrics.js +2 -34
  215. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_fill_small_holes.d.ts.map +1 -1
  216. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_fill_small_holes.js +2 -43
  217. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_simplify.d.ts +54 -33
  218. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_simplify.d.ts.map +1 -1
  219. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_simplify.js +229 -68
  220. package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_kill_parallels.d.ts.map +1 -1
  221. package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_kill_parallels.js +4 -15
  222. package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_mesh_split_pinched_vertices.d.ts.map +1 -1
  223. package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_mesh_split_pinched_vertices.js +13 -1
  224. package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_vertex_fuse_duplicate_edges.d.ts.map +1 -1
  225. package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_vertex_fuse_duplicate_edges.js +3 -1
  226. package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_vertex_replace.d.ts.map +1 -1
  227. package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_vertex_replace.js +22 -3
  228. package/src/core/geom/3d/topology/struct/binary/query/bt_edge_count_faces.d.ts +17 -2
  229. package/src/core/geom/3d/topology/struct/binary/query/bt_edge_count_faces.d.ts.map +1 -1
  230. package/src/core/geom/3d/topology/struct/binary/query/bt_edge_count_faces.js +28 -4
  231. package/src/core/geom/3d/topology/struct/binary/query/bt_edge_get.d.ts.map +1 -1
  232. package/src/core/geom/3d/topology/struct/binary/query/bt_edge_get.js +8 -1
  233. package/src/core/geom/3d/topology/struct/binary/query/bt_face_get_edge_adjacent_faces_weighted.d.ts.map +1 -1
  234. package/src/core/geom/3d/topology/struct/binary/query/bt_face_get_edge_adjacent_faces_weighted.js +10 -2
  235. package/src/core/geom/3d/topology/struct/binary/query/bt_face_island_flood_fill.d.ts.map +1 -1
  236. package/src/core/geom/3d/topology/struct/binary/query/bt_face_island_flood_fill.js +2 -0
  237. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_build_boundary_distance_field.d.ts.map +1 -1
  238. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_build_boundary_distance_field.js +25 -5
  239. package/src/core/geom/3d/triangle/tri3_compute_normal.d.ts +5 -1
  240. package/src/core/geom/3d/triangle/tri3_compute_normal.d.ts.map +1 -1
  241. package/src/core/geom/3d/triangle/tri3_compute_normal.js +8 -1
  242. package/src/core/geom/3d/triangle/tri3_ray_intersection.d.ts.map +1 -1
  243. package/src/core/geom/3d/triangle/tri3_ray_intersection.js +15 -3
  244. package/src/core/geom/3d/triangle/tri3_ray_intersection_barycentric.d.ts +2 -1
  245. package/src/core/geom/3d/triangle/tri3_ray_intersection_barycentric.d.ts.map +1 -1
  246. package/src/core/geom/3d/triangle/tri3_ray_intersection_barycentric.js +2 -1
  247. package/src/core/geom/3d/triangle/tri3_ray_intersection_barycentric_edge.d.ts +1 -1
  248. package/src/core/geom/3d/triangle/tri3_ray_intersection_barycentric_edge.d.ts.map +1 -1
  249. package/src/core/geom/3d/triangle/tri3_ray_intersection_barycentric_edge.js +8 -1
  250. package/src/core/geom/vec/vector_normalize.d.ts.map +1 -1
  251. package/src/core/geom/vec/vector_normalize.js +5 -1
  252. package/src/core/geom/vec3/v3_slerp.d.ts.map +1 -1
  253. package/src/core/geom/vec3/v3_slerp.js +69 -4
  254. package/src/core/geom/vec4/v4_max_axis.d.ts +28 -0
  255. package/src/core/geom/vec4/v4_max_axis.d.ts.map +1 -0
  256. package/src/core/geom/vec4/v4_max_axis.js +41 -0
  257. package/src/core/graph/coloring/colorizeGraph.js +10 -7
  258. package/src/core/graph/layout/graph_peel_topological_layer.d.ts.map +1 -1
  259. package/src/core/graph/layout/graph_peel_topological_layer.js +16 -2
  260. package/src/core/json/JsonUtils.d.ts.map +1 -1
  261. package/src/core/json/JsonUtils.js +6 -2
  262. package/src/core/json/abstractJSONSerializer.d.ts.map +1 -1
  263. package/src/core/json/abstractJSONSerializer.js +5 -1
  264. package/src/core/lang/reactive/ReactiveOperatorType.d.ts +20 -0
  265. package/src/core/lang/reactive/ReactiveOperatorType.d.ts.map +1 -1
  266. package/src/core/lang/reactive/ReactiveOperatorType.js +34 -12
  267. package/src/core/localization/LanguageMetadata.d.ts +2 -1
  268. package/src/core/localization/LanguageMetadata.d.ts.map +1 -1
  269. package/src/core/localization/LanguageMetadata.js +6 -0
  270. package/src/core/localization/Localization.d.ts.map +1 -1
  271. package/src/core/localization/Localization.js +23 -10
  272. package/src/core/localization/LocalizationEngine.d.ts.map +1 -1
  273. package/src/core/localization/LocalizationEngine.js +4 -0
  274. package/src/core/math/fract.d.ts.map +1 -1
  275. package/src/core/math/fract.js +4 -3
  276. package/src/core/math/hash/squirrel3.d.ts +10 -2
  277. package/src/core/math/hash/squirrel3.d.ts.map +1 -1
  278. package/src/core/math/hash/squirrel3.js +16 -8
  279. package/src/core/math/linalg/m2/m2_polar_decomp_noS.d.ts +7 -0
  280. package/src/core/math/linalg/m2/m2_polar_decomp_noS.d.ts.map +1 -1
  281. package/src/core/math/linalg/m2/m2_polar_decomp_noS.js +20 -1
  282. package/src/core/math/physics/pdf/pdf_normal.d.ts +11 -3
  283. package/src/core/math/physics/pdf/pdf_normal.d.ts.map +1 -1
  284. package/src/core/math/physics/pdf/pdf_normal.js +25 -11
  285. package/src/core/math/solveQuadratic.d.ts.map +1 -1
  286. package/src/core/math/solveQuadratic.js +22 -3
  287. package/src/core/math/statistics/computeStatisticalPartialMedian.d.ts +9 -2
  288. package/src/core/math/statistics/computeStatisticalPartialMedian.d.ts.map +1 -1
  289. package/src/core/math/statistics/computeStatisticalPartialMedian.js +12 -6
  290. package/src/core/math/statistics/computeStatisticalPercentile.d.ts.map +1 -1
  291. package/src/core/math/statistics/computeStatisticalPercentile.js +9 -2
  292. package/src/core/math/statistics/gaussian_amplitude.d.ts +10 -1
  293. package/src/core/math/statistics/gaussian_amplitude.d.ts.map +1 -1
  294. package/src/core/math/statistics/gaussian_amplitude.js +20 -15
  295. package/src/core/model/BooleanVector3.d.ts.map +1 -1
  296. package/src/core/model/BooleanVector3.js +18 -2
  297. package/src/core/model/BoundedValue.d.ts +9 -0
  298. package/src/core/model/BoundedValue.d.ts.map +1 -1
  299. package/src/core/model/BoundedValue.js +30 -3
  300. package/src/core/model/ObservedBoolean.d.ts.map +1 -1
  301. package/src/core/model/ObservedBoolean.js +22 -2
  302. package/src/core/model/ObservedEnum.d.ts.map +1 -1
  303. package/src/core/model/ObservedEnum.js +6 -2
  304. package/src/core/model/node-graph/NodeGraph.d.ts +6 -1
  305. package/src/core/model/node-graph/NodeGraph.d.ts.map +1 -1
  306. package/src/core/model/node-graph/NodeGraph.js +22 -4
  307. package/src/core/model/node-graph/json/deserializeNodeGraphFromJSON.d.ts.map +1 -1
  308. package/src/core/model/node-graph/json/deserializeNodeGraphFromJSON.js +3 -1
  309. package/src/core/model/node-graph/json/serializeNodeGraphToJSON.d.ts.map +1 -1
  310. package/src/core/model/node-graph/json/serializeNodeGraphToJSON.js +5 -0
  311. package/src/core/model/node-graph/type/DataType.d.ts.map +1 -1
  312. package/src/core/model/node-graph/type/DataType.js +8 -0
  313. package/src/core/model/node-graph/type/ParametricDataType.d.ts.map +1 -1
  314. package/src/core/model/node-graph/type/ParametricDataType.js +19 -0
  315. package/src/core/model/node-graph/visual/NodeGraphVisualData.d.ts.map +1 -1
  316. package/src/core/model/node-graph/visual/NodeGraphVisualData.js +5 -0
  317. package/src/core/model/reactive/js/compileReactiveToJS.d.ts +22 -0
  318. package/src/core/model/reactive/js/compileReactiveToJS.d.ts.map +1 -1
  319. package/src/core/model/reactive/js/compileReactiveToJS.js +113 -219
  320. package/src/core/model/reactive/model/ReactiveBinaryExpression.d.ts.map +1 -1
  321. package/src/core/model/reactive/model/ReactiveBinaryExpression.js +8 -2
  322. package/src/core/model/reactive/model/comparative/ReactiveEquals.d.ts.map +1 -1
  323. package/src/core/model/reactive/model/comparative/ReactiveEquals.js +3 -1
  324. package/src/core/model/reactive/model/comparative/ReactiveNotEquals.d.ts.map +1 -1
  325. package/src/core/model/reactive/model/comparative/ReactiveNotEquals.js +2 -1
  326. package/src/core/model/reactive/model/terminal/ReactiveLiteralString.d.ts.map +1 -1
  327. package/src/core/model/reactive/model/terminal/ReactiveLiteralString.js +4 -2
  328. package/src/core/model/stat/Stat.d.ts.map +1 -1
  329. package/src/core/model/stat/Stat.js +4 -0
  330. package/src/core/parser/seedVariablesIntoTemplateString.d.ts.map +1 -1
  331. package/src/core/parser/seedVariablesIntoTemplateString.js +5 -0
  332. package/src/core/parser/simple/readArrayLiteral.d.ts.map +1 -1
  333. package/src/core/parser/simple/readArrayLiteral.js +7 -0
  334. package/src/core/parser/simple/readHexToken.d.ts +3 -0
  335. package/src/core/parser/simple/readHexToken.d.ts.map +1 -1
  336. package/src/core/parser/simple/readHexToken.js +39 -106
  337. package/src/core/parser/simple/readNumberToken.d.ts.map +1 -1
  338. package/src/core/parser/simple/readNumberToken.js +13 -4
  339. package/src/core/parser/simple/readUnsignedIntegerToken.d.ts +2 -0
  340. package/src/core/parser/simple/readUnsignedIntegerToken.d.ts.map +1 -1
  341. package/src/core/parser/simple/readUnsignedIntegerToken.js +31 -71
  342. package/src/core/parser/simple/read_digits.d.ts +31 -0
  343. package/src/core/parser/simple/read_digits.d.ts.map +1 -0
  344. package/src/core/parser/simple/read_digits.js +74 -0
  345. package/src/core/primitives/numbers/number_format_by_thousands.d.ts.map +1 -1
  346. package/src/core/primitives/numbers/number_format_by_thousands.js +16 -1
  347. package/src/core/primitives/numbers/number_pretty_print.d.ts.map +1 -1
  348. package/src/core/primitives/numbers/number_pretty_print.js +6 -1
  349. package/src/core/process/executor/ConcurrentExecutor.d.ts.map +1 -1
  350. package/src/core/process/executor/ConcurrentExecutor.js +36 -0
  351. package/src/core/process/task/Task.d.ts +8 -0
  352. package/src/core/process/task/Task.d.ts.map +1 -1
  353. package/src/core/process/task/Task.js +12 -1
  354. package/src/core/process/task/TaskGroup.d.ts +6 -0
  355. package/src/core/process/task/TaskGroup.d.ts.map +1 -1
  356. package/src/core/process/task/TaskGroup.js +7 -1
  357. package/src/core/process/undo/ActionProcessor.d.ts +12 -0
  358. package/src/core/process/undo/ActionProcessor.d.ts.map +1 -1
  359. package/src/core/process/undo/ActionProcessor.js +41 -15
  360. package/src/core/process/worker/OnDemandWorkerManager.d.ts.map +1 -1
  361. package/src/core/process/worker/OnDemandWorkerManager.js +6 -1
  362. package/src/core/process/worker/WorkerBuilder.d.ts.map +1 -1
  363. package/src/core/process/worker/WorkerBuilder.js +27 -5
  364. package/src/engine/Clock.d.ts.map +1 -1
  365. package/src/engine/Clock.js +11 -0
  366. package/src/engine/Engine.d.ts.map +1 -1
  367. package/src/engine/Engine.js +107 -6
  368. package/src/engine/achievements/AchievementManager.d.ts.map +1 -1
  369. package/src/engine/achievements/AchievementManager.js +16 -1
  370. package/src/engine/animation/clip/ecd_bind_animation_curve.d.ts.map +1 -1
  371. package/src/engine/animation/clip/ecd_bind_animation_curve.js +17 -6
  372. package/src/engine/animation/clip/hemisphere_align_quaternion_values.d.ts +19 -10
  373. package/src/engine/animation/clip/hemisphere_align_quaternion_values.d.ts.map +1 -1
  374. package/src/engine/animation/clip/hemisphere_align_quaternion_values.js +19 -23
  375. package/src/engine/animation/keyed2/AnimationTrackPlayback.d.ts +1 -1
  376. package/src/engine/animation/keyed2/AnimationTrackPlayback.d.ts.map +1 -1
  377. package/src/engine/animation/keyed2/AnimationTrackPlayback.js +21 -4
  378. package/src/engine/asset/AssetManager.d.ts.map +1 -1
  379. package/src/engine/asset/AssetManager.js +11 -3
  380. package/src/engine/control/first-person/FirstPersonPlayerController.d.ts +1 -0
  381. package/src/engine/control/first-person/FirstPersonPlayerController.d.ts.map +1 -1
  382. package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts +28 -0
  383. package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts.map +1 -1
  384. package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.js +14 -0
  385. package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts +23 -2
  386. package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts.map +1 -1
  387. package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.js +2122 -2078
  388. package/src/engine/ecs/Entity.d.ts.map +1 -1
  389. package/src/engine/ecs/Entity.js +43 -7
  390. package/src/engine/ecs/EntityBlueprint.d.ts.map +1 -1
  391. package/src/engine/ecs/EntityBlueprint.js +13 -4
  392. package/src/engine/ecs/EntityComponentDataset.d.ts.map +1 -1
  393. package/src/engine/ecs/EntityComponentDataset.js +95 -9
  394. package/src/engine/ecs/EntityManager.d.ts +16 -0
  395. package/src/engine/ecs/EntityManager.d.ts.map +1 -1
  396. package/src/engine/ecs/EntityManager.js +112 -37
  397. package/src/engine/ecs/EntityObserver.d.ts +7 -0
  398. package/src/engine/ecs/EntityObserver.d.ts.map +1 -1
  399. package/src/engine/ecs/EntityObserver.js +8 -1
  400. package/src/engine/ecs/System.d.ts +23 -0
  401. package/src/engine/ecs/System.d.ts.map +1 -1
  402. package/src/engine/ecs/System.js +25 -0
  403. package/src/engine/ecs/components/Tag.d.ts.map +1 -1
  404. package/src/engine/ecs/components/Tag.js +4 -1
  405. package/src/engine/ecs/computeComponentClassName.d.ts +13 -1
  406. package/src/engine/ecs/computeComponentClassName.d.ts.map +1 -1
  407. package/src/engine/ecs/computeComponentClassName.js +11 -1
  408. package/src/engine/ecs/dynamic_actions/DynamicActorSystem.d.ts.map +1 -1
  409. package/src/engine/ecs/dynamic_actions/DynamicActorSystem.js +11 -0
  410. package/src/engine/ecs/fow/FogOfWar.d.ts.map +1 -1
  411. package/src/engine/ecs/fow/FogOfWar.js +37 -11
  412. package/src/engine/ecs/parent/EntityNode.d.ts.map +1 -1
  413. package/src/engine/ecs/parent/EntityNode.js +8 -0
  414. package/src/engine/ecs/speaker/VoiceSystem.d.ts.map +1 -1
  415. package/src/engine/ecs/speaker/VoiceSystem.js +9 -0
  416. package/src/engine/ecs/storage/binary/BinaryClassSerializationAdapter.d.ts +15 -0
  417. package/src/engine/ecs/storage/binary/BinaryClassSerializationAdapter.d.ts.map +1 -1
  418. package/src/engine/ecs/storage/binary/BinaryClassSerializationAdapter.js +18 -0
  419. package/src/engine/ecs/system/AbstractContextSystem.d.ts.map +1 -1
  420. package/src/engine/ecs/system/AbstractContextSystem.js +14 -4
  421. package/src/engine/ecs/system/SystemEntityContext.d.ts +12 -0
  422. package/src/engine/ecs/system/SystemEntityContext.d.ts.map +1 -1
  423. package/src/engine/ecs/system/SystemEntityContext.js +23 -0
  424. package/src/engine/ecs/system_validate_class.d.ts.map +1 -1
  425. package/src/engine/ecs/system_validate_class.js +6 -2
  426. package/src/engine/ecs/terrain/ecs/cling/ClingToTerrainSystem.js +37 -8
  427. package/src/engine/ecs/terrain/tiles/TerrainTile.d.ts.map +1 -1
  428. package/src/engine/ecs/terrain/tiles/TerrainTile.js +45 -3
  429. package/src/engine/ecs/terrain/tiles/TerrainTileManager.d.ts.map +1 -1
  430. package/src/engine/ecs/terrain/tiles/TerrainTileManager.js +5 -8
  431. package/src/engine/graphics/ecs/camera/pp/PerfectPanner.d.ts.map +1 -1
  432. package/src/engine/graphics/ecs/camera/pp/PerfectPanner.js +62 -7
  433. package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMesh.d.ts +9 -0
  434. package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMesh.d.ts.map +1 -1
  435. package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMesh.js +13 -0
  436. package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshAnimationControllerSystem.d.ts +11 -0
  437. package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshAnimationControllerSystem.d.ts.map +1 -1
  438. package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshAnimationControllerSystem.js +78 -13
  439. package/src/engine/graphics/ecs/path/tube/build/make_ring_vertices.d.ts.map +1 -1
  440. package/src/engine/graphics/ecs/path/tube/build/make_ring_vertices.js +22 -8
  441. package/src/engine/graphics/geometry/buffered/geometry_compute_vertex_normals_indexed.d.ts.map +1 -1
  442. package/src/engine/graphics/geometry/buffered/geometry_compute_vertex_normals_indexed.js +18 -2
  443. package/src/engine/graphics/geometry/geometry_construct_triangle_normal.d.ts +3 -1
  444. package/src/engine/graphics/geometry/geometry_construct_triangle_normal.d.ts.map +1 -1
  445. package/src/engine/graphics/geometry/geometry_construct_triangle_normal.js +3 -1
  446. package/src/engine/graphics/geometry/geometry_construct_triangle_normal_area_weighted.d.ts +32 -0
  447. package/src/engine/graphics/geometry/geometry_construct_triangle_normal_area_weighted.d.ts.map +1 -0
  448. package/src/engine/graphics/geometry/geometry_construct_triangle_normal_area_weighted.js +53 -0
  449. package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.d.ts +22 -2
  450. package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.d.ts.map +1 -1
  451. package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.js +1201 -1160
  452. package/src/engine/graphics/particles/particular/engine/simulator/SimulationStepCurlNoiseVelocity.d.ts +0 -1
  453. package/src/engine/graphics/particles/particular/engine/simulator/SimulationStepCurlNoiseVelocity.d.ts.map +1 -1
  454. package/src/engine/graphics/particles/particular/engine/simulator/SimulationStepCurlNoiseVelocity.js +10 -5
  455. package/src/engine/graphics/particles/particular/engine/simulator/update_parameters.d.ts.map +1 -1
  456. package/src/engine/graphics/particles/particular/engine/simulator/update_parameters.js +23 -0
  457. package/src/engine/graphics/particles/particular/group/itemSizeFromAttributeType.d.ts +1 -1
  458. package/src/engine/graphics/sh3/path_tracer/texture/apply_texture_clamping_to_coordinate.d.ts.map +1 -1
  459. package/src/engine/graphics/sh3/path_tracer/texture/apply_texture_clamping_to_coordinate.js +6 -1
  460. package/src/engine/graphics/texture/atlas/ManagedTextureAtlas.d.ts.map +1 -1
  461. package/src/engine/graphics/texture/atlas/ManagedTextureAtlas.js +20 -0
  462. package/src/engine/graphics/texture/atlas/TextureAtlas.d.ts +1 -0
  463. package/src/engine/graphics/texture/atlas/TextureAtlas.d.ts.map +1 -1
  464. package/src/engine/graphics/texture/atlas/TextureAtlas.js +24 -5
  465. package/src/engine/graphics/texture/sampler/Sampler2D.d.ts.map +1 -1
  466. package/src/engine/graphics/texture/sampler/Sampler2D.js +14 -1
  467. package/src/engine/graphics/texture/sampler/sampler2d_sub_copy_same_item_size.d.ts.map +1 -1
  468. package/src/engine/graphics/texture/sampler/sampler2d_sub_copy_same_item_size.js +16 -5
  469. package/src/engine/graphics/texture/sampler/sampler2d_to_uint8_RGBA.d.ts.map +1 -1
  470. package/src/engine/graphics/texture/sampler/sampler2d_to_uint8_RGBA.js +29 -8
  471. package/src/engine/graphics/texture/sampler/serialization/TextureBinaryBufferSerializer.d.ts.map +1 -1
  472. package/src/engine/graphics/texture/sampler/serialization/TextureBinaryBufferSerializer.js +8 -3
  473. package/src/engine/graphics3/DecalSystem.d.ts +5 -4
  474. package/src/engine/graphics3/DecalSystem.d.ts.map +1 -1
  475. package/src/engine/graphics3/DecalSystem.js +5 -4
  476. package/src/engine/graphics3/GraphicsEngine.d.ts +40 -7
  477. package/src/engine/graphics3/GraphicsEngine.d.ts.map +1 -1
  478. package/src/engine/graphics3/GraphicsEngine.js +92 -7
  479. package/src/engine/graphics3/MeshSystem.d.ts +7 -0
  480. package/src/engine/graphics3/MeshSystem.d.ts.map +1 -1
  481. package/src/engine/graphics3/MeshSystem.js +681 -661
  482. package/src/engine/graphics3/ParticleEmitterSystem.d.ts +1 -0
  483. package/src/engine/graphics3/ParticleEmitterSystem.d.ts.map +1 -1
  484. package/src/engine/graphics3/ParticleEmitterSystem.js +1 -0
  485. package/src/engine/graphics3/TerrainSystem.d.ts +10 -40
  486. package/src/engine/graphics3/TerrainSystem.d.ts.map +1 -1
  487. package/src/engine/graphics3/TerrainSystem.js +186 -185
  488. package/src/engine/graphics3/Trail3DSystem.d.ts +28 -19
  489. package/src/engine/graphics3/Trail3DSystem.d.ts.map +1 -1
  490. package/src/engine/graphics3/Trail3DSystem.js +57 -64
  491. package/src/engine/graphics3/debug/gizmo_write_geometry.d.ts.map +1 -1
  492. package/src/engine/graphics3/debug/gizmo_write_geometry.js +7 -59
  493. package/src/engine/graphics3/decal/GPUDecalRenderer.d.ts.map +1 -1
  494. package/src/engine/graphics3/decal/GPUDecalRenderer.js +23 -7
  495. package/src/engine/graphics3/decal/shader_cluster_assign_decals.d.ts.map +1 -1
  496. package/src/engine/graphics3/decal/shader_cluster_assign_decals.js +29 -6
  497. package/src/engine/graphics3/path/tube_stream_write_geometry.d.ts.map +1 -1
  498. package/src/engine/graphics3/path/tube_stream_write_geometry.js +7 -56
  499. package/src/engine/graphics3/register_instance_animation.d.ts +3 -3
  500. package/src/engine/graphics3/register_instance_animation.js +3 -3
  501. package/src/engine/graphics3/terrain/GPUTerrainSplatRenderer.d.ts.map +1 -1
  502. package/src/engine/graphics3/terrain/TERRAIN_MATERIAL_TEMPLATE.d.ts +77 -0
  503. package/src/engine/graphics3/terrain/TERRAIN_MATERIAL_TEMPLATE.d.ts.map +1 -0
  504. package/src/engine/graphics3/terrain/TERRAIN_MATERIAL_TEMPLATE.js +485 -0
  505. package/src/engine/graphics3/terrain/TerrainShadeMaterial.d.ts +103 -0
  506. package/src/engine/graphics3/terrain/TerrainShadeMaterial.d.ts.map +1 -0
  507. package/src/engine/graphics3/terrain/TerrainShadeMaterial.js +130 -0
  508. package/src/engine/graphics3/terrain/chunk_terrain_material_surface.d.ts +23 -0
  509. package/src/engine/graphics3/terrain/chunk_terrain_material_surface.d.ts.map +1 -0
  510. package/src/engine/graphics3/terrain/chunk_terrain_material_surface.js +68 -0
  511. package/src/engine/graphics3/trail/trail_tube_write_geometry.d.ts.map +1 -1
  512. package/src/engine/graphics3/trail/trail_tube_write_geometry.js +8 -59
  513. package/src/engine/grid/transform2grid/Transform2GridPositionSystem.d.ts.map +1 -1
  514. package/src/engine/grid/transform2grid/Transform2GridPositionSystem.js +10 -0
  515. package/src/engine/input/devices/PointerDevice.d.ts.map +1 -1
  516. package/src/engine/input/devices/PointerDevice.js +58 -5
  517. package/src/engine/input/ecs/ism/InputMapProgram.d.ts.map +1 -1
  518. package/src/engine/input/ecs/ism/InputMapProgram.js +13 -0
  519. package/src/engine/input/ecs/systems/InputControllerSystem.d.ts +1 -0
  520. package/src/engine/input/ecs/systems/InputControllerSystem.d.ts.map +1 -1
  521. package/src/engine/input/ecs/systems/InputControllerSystem.js +52 -2
  522. package/src/engine/intelligence/behavior/composite/ParallelBehavior.d.ts.map +1 -1
  523. package/src/engine/intelligence/behavior/composite/ParallelBehavior.js +8 -0
  524. package/src/engine/intelligence/behavior/decorator/RepeatBehavior.d.ts.map +1 -1
  525. package/src/engine/intelligence/behavior/decorator/RepeatBehavior.js +7 -0
  526. package/src/engine/intelligence/behavior/decorator/RepeatUntilSuccessBehavior.d.ts.map +1 -1
  527. package/src/engine/intelligence/behavior/decorator/RepeatUntilSuccessBehavior.js +14 -0
  528. package/src/engine/intelligence/behavior/ecs/BehaviorSystem.d.ts.map +1 -1
  529. package/src/engine/intelligence/behavior/ecs/BehaviorSystem.js +13 -0
  530. package/src/engine/interpolation/InterpolationLog.d.ts +51 -4
  531. package/src/engine/interpolation/InterpolationLog.d.ts.map +1 -1
  532. package/src/engine/interpolation/InterpolationLog.js +132 -2
  533. package/src/engine/interpolation/InterpolationSystem.d.ts +113 -35
  534. package/src/engine/interpolation/InterpolationSystem.d.ts.map +1 -1
  535. package/src/engine/interpolation/InterpolationSystem.js +674 -50
  536. package/src/engine/network/NetworkSession.d.ts +176 -47
  537. package/src/engine/network/NetworkSession.d.ts.map +1 -1
  538. package/src/engine/network/NetworkSession.js +1462 -272
  539. package/src/engine/network/README.md +106 -3
  540. package/src/engine/network/SMOOTHNESS_DESIGN.md +392 -0
  541. package/src/engine/network/adapters/PoseCorrection.d.ts +50 -0
  542. package/src/engine/network/adapters/PoseCorrection.d.ts.map +1 -0
  543. package/src/engine/network/adapters/PoseCorrection.js +211 -0
  544. package/src/engine/network/adapters/TransformReplicationAdapter.d.ts +1 -0
  545. package/src/engine/network/adapters/TransformReplicationAdapter.d.ts.map +1 -1
  546. package/src/engine/network/adapters/TransformReplicationAdapter.js +17 -0
  547. package/src/engine/network/adapters/VelocityCorrection.d.ts +31 -0
  548. package/src/engine/network/adapters/VelocityCorrection.d.ts.map +1 -0
  549. package/src/engine/network/adapters/VelocityCorrection.js +71 -0
  550. package/src/engine/network/adapters/replicate_transform64.d.ts +13 -0
  551. package/src/engine/network/adapters/replicate_transform64.d.ts.map +1 -0
  552. package/src/engine/network/adapters/replicate_transform64.js +18 -0
  553. package/src/engine/network/adapters/rigid_body_of.d.ts +22 -0
  554. package/src/engine/network/adapters/rigid_body_of.d.ts.map +1 -0
  555. package/src/engine/network/adapters/rigid_body_of.js +33 -0
  556. package/src/engine/network/correction/Correction.d.ts +120 -0
  557. package/src/engine/network/correction/Correction.d.ts.map +1 -0
  558. package/src/engine/network/correction/Correction.js +143 -0
  559. package/src/engine/network/ecs/NetworkSystem.d.ts +36 -7
  560. package/src/engine/network/ecs/NetworkSystem.d.ts.map +1 -1
  561. package/src/engine/network/ecs/NetworkSystem.js +49 -7
  562. package/src/engine/network/orchestrator/NetworkPeer.d.ts +50 -1
  563. package/src/engine/network/orchestrator/NetworkPeer.d.ts.map +1 -1
  564. package/src/engine/network/orchestrator/NetworkPeer.js +143 -10
  565. package/src/engine/network/orchestrator/ServerAuthoritativeClient.d.ts +38 -2
  566. package/src/engine/network/orchestrator/ServerAuthoritativeClient.d.ts.map +1 -1
  567. package/src/engine/network/orchestrator/ServerAuthoritativeClient.js +58 -10
  568. package/src/engine/network/orchestrator/ServerAuthoritativeServer.d.ts +68 -2
  569. package/src/engine/network/orchestrator/ServerAuthoritativeServer.d.ts.map +1 -1
  570. package/src/engine/network/orchestrator/ServerAuthoritativeServer.js +299 -18
  571. package/src/engine/network/replication/Replicator.d.ts +8 -1
  572. package/src/engine/network/replication/Replicator.d.ts.map +1 -1
  573. package/src/engine/network/replication/Replicator.js +50 -6
  574. package/src/engine/network/sim/ActionLog.d.ts +5 -2
  575. package/src/engine/network/sim/ActionLog.d.ts.map +1 -1
  576. package/src/engine/network/sim/ActionLog.js +5 -2
  577. package/src/engine/network/sim/RewindEngine.d.ts.map +1 -1
  578. package/src/engine/network/sim/RewindEngine.js +6 -0
  579. package/src/engine/network/sim/SimActionExecutor.d.ts +48 -3
  580. package/src/engine/network/sim/SimActionExecutor.d.ts.map +1 -1
  581. package/src/engine/network/sim/SimActionExecutor.js +152 -6
  582. package/src/engine/network/sim/SmoothingState.d.ts +54 -2
  583. package/src/engine/network/sim/SmoothingState.d.ts.map +1 -1
  584. package/src/engine/network/sim/SmoothingState.js +107 -3
  585. package/src/engine/network/state/MutationLedger.d.ts.map +1 -1
  586. package/src/engine/network/state/MutationLedger.js +18 -2
  587. package/src/engine/network/state/PredictionHistory.d.ts +67 -0
  588. package/src/engine/network/state/PredictionHistory.d.ts.map +1 -0
  589. package/src/engine/network/state/PredictionHistory.js +145 -0
  590. package/src/engine/network/time/RenderPlayout.d.ts +2 -1
  591. package/src/engine/network/time/RenderPlayout.d.ts.map +1 -1
  592. package/src/engine/network/time/RenderPlayout.js +174 -163
  593. package/src/engine/network/transport/DeferredTransport.d.ts +57 -0
  594. package/src/engine/network/transport/DeferredTransport.d.ts.map +1 -0
  595. package/src/engine/network/transport/DeferredTransport.js +143 -0
  596. package/src/engine/network/transport/LoopbackTransport.d.ts +8 -0
  597. package/src/engine/network/transport/LoopbackTransport.d.ts.map +1 -1
  598. package/src/engine/network/transport/LoopbackTransport.js +12 -1
  599. package/src/engine/network/transport/ReliableCommandPipeline.d.ts.map +1 -1
  600. package/src/engine/network/transport/ReliableCommandPipeline.js +20 -0
  601. package/src/engine/network/transport/adapters/NodeUDPTransport.d.ts.map +1 -1
  602. package/src/engine/network/transport/adapters/NodeUDPTransport.js +11 -2
  603. package/src/engine/network/transport/adapters/WebTransportTransport.d.ts.map +1 -1
  604. package/src/engine/network/transport/adapters/WebTransportTransport.js +8 -1
  605. package/src/engine/network/transport/fragments/FragmentAssembler.d.ts +2 -1
  606. package/src/engine/network/transport/fragments/FragmentAssembler.d.ts.map +1 -1
  607. package/src/engine/network/transport/fragments/FragmentAssembler.js +67 -3
  608. package/src/engine/network/transport/fragments/fragment_send.d.ts +8 -0
  609. package/src/engine/network/transport/fragments/fragment_send.d.ts.map +1 -1
  610. package/src/engine/network/transport/fragments/fragment_send.js +17 -7
  611. package/src/engine/network/transport/fragments/packet_size.d.ts +6 -0
  612. package/src/engine/network/transport/fragments/packet_size.d.ts.map +1 -1
  613. package/src/engine/network/transport/fragments/packet_size.js +6 -0
  614. package/src/engine/physics/ccd/linear_sweep.d.ts.map +1 -1
  615. package/src/engine/physics/ccd/linear_sweep.js +19 -1
  616. package/src/engine/physics/cloth/ecs/ClothWorld.d.ts +7 -3
  617. package/src/engine/physics/cloth/ecs/ClothWorld.d.ts.map +1 -1
  618. package/src/engine/physics/cloth/ecs/ClothWorld.js +34 -4
  619. package/src/engine/physics/cloth/solver/cloth_self_find.js +17 -0
  620. package/src/engine/physics/contact/ManifoldStore.d.ts +20 -1
  621. package/src/engine/physics/contact/ManifoldStore.d.ts.map +1 -1
  622. package/src/engine/physics/contact/ManifoldStore.js +24 -2
  623. package/src/engine/physics/ecs/PhysicsSystem.d.ts +51 -88
  624. package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -1
  625. package/src/engine/physics/ecs/PhysicsSystem.js +82 -217
  626. package/src/engine/physics/ecs/is_sensor.d.ts +24 -0
  627. package/src/engine/physics/ecs/is_sensor.d.ts.map +1 -1
  628. package/src/engine/physics/ecs/is_sensor.js +39 -0
  629. package/src/engine/physics/fluid/ecs/FluidComponent.d.ts +18 -4
  630. package/src/engine/physics/fluid/ecs/FluidComponent.d.ts.map +1 -1
  631. package/src/engine/physics/fluid/ecs/FluidComponent.js +29 -8
  632. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  633. package/src/engine/physics/fluid/effector/AbstractFluidEffector.d.ts +8 -0
  634. package/src/engine/physics/fluid/effector/AbstractFluidEffector.d.ts.map +1 -1
  635. package/src/engine/physics/fluid/effector/AbstractFluidEffector.js +8 -0
  636. package/src/engine/physics/fluid/solver/NOTES.md +46 -0
  637. package/src/engine/physics/fluid/solver/v3_grid_advect_maccormack_scalar.js +1 -1
  638. package/src/engine/physics/fluid/solver/v3_grid_advect_maccormack_velocity.js +1 -1
  639. package/src/engine/physics/fluid/solver/v3_grid_advect_sl_velocity.js +1 -1
  640. package/src/engine/physics/fluid/solver/v3_grid_apply_advection_forward.js +1 -1
  641. package/src/engine/physics/fluid/solver/v3_grid_apply_scalar_advection.js +1 -1
  642. package/src/engine/physics/fluid/solver/v3_grid_apply_vorticity_confinement.d.ts.map +1 -1
  643. package/src/engine/physics/fluid/solver/v3_grid_apply_vorticity_confinement.js +8 -0
  644. package/src/engine/physics/fluid/solver/v3_grid_compute_divergence.d.ts.map +1 -1
  645. package/src/engine/physics/fluid/solver/v3_grid_compute_divergence.js +8 -0
  646. package/src/engine/physics/fluid/solver/v3_grid_subtract_pressure_gradient.d.ts.map +1 -1
  647. package/src/engine/physics/fluid/solver/v3_grid_subtract_pressure_gradient.js +8 -0
  648. package/src/engine/physics/fluid/solver/v3_mac_advect_scalar.d.ts +5 -0
  649. package/src/engine/physics/fluid/solver/v3_mac_advect_scalar.d.ts.map +1 -1
  650. package/src/engine/physics/fluid/solver/v3_mac_advect_scalar.js +5 -0
  651. package/src/engine/physics/integration/integrate_velocity.d.ts +15 -0
  652. package/src/engine/physics/integration/integrate_velocity.d.ts.map +1 -1
  653. package/src/engine/physics/integration/integrate_velocity.js +15 -0
  654. package/src/engine/physics/island/IslandBuilder.d.ts.map +1 -1
  655. package/src/engine/physics/island/IslandBuilder.js +6 -7
  656. package/src/engine/physics/mls-mpm/MLS_MPM.d.ts.map +1 -1
  657. package/src/engine/physics/mls-mpm/MLS_MPM.js +29 -13
  658. package/src/engine/physics/mls-mpm/mls_mpm_demo_scene.d.ts +29 -0
  659. package/src/engine/physics/mls-mpm/mls_mpm_demo_scene.d.ts.map +1 -0
  660. package/src/engine/physics/mls-mpm/mls_mpm_demo_scene.js +44 -0
  661. package/src/engine/physics/mls-mpm/testMLS_MPM.js +3 -3
  662. package/src/engine/physics/narrowphase/narrowphase_step.d.ts.map +1 -1
  663. package/src/engine/physics/narrowphase/narrowphase_step.js +74 -11
  664. package/src/engine/physics/queries/overlap_shape.d.ts.map +1 -1
  665. package/src/engine/physics/queries/overlap_shape.js +92 -45
  666. package/src/engine/physics/queries/raycast.d.ts.map +1 -1
  667. package/src/engine/physics/queries/raycast.js +55 -43
  668. package/src/engine/physics/queries/shape_cast.d.ts.map +1 -1
  669. package/src/engine/physics/queries/shape_cast.js +185 -174
  670. package/src/engine/physics/solver/solve_contacts.d.ts.map +1 -1
  671. package/src/engine/physics/solver/solve_contacts.js +42 -19
  672. package/src/engine/plugin/EnginePluginManager.d.ts +10 -0
  673. package/src/engine/plugin/EnginePluginManager.d.ts.map +1 -1
  674. package/src/engine/plugin/EnginePluginManager.js +54 -1
  675. package/src/engine/plugin/PluginReferenceContext.d.ts.map +1 -1
  676. package/src/engine/plugin/PluginReferenceContext.js +7 -3
  677. package/src/engine/reference/v2/Reference.d.ts +9 -0
  678. package/src/engine/reference/v2/Reference.d.ts.map +1 -1
  679. package/src/engine/reference/v2/Reference.js +39 -2
  680. package/src/engine/simulation/Ticker.d.ts.map +1 -1
  681. package/src/engine/simulation/Ticker.js +20 -1
  682. package/src/engine/sound/ecs/SoundListenerSystem.d.ts +27 -0
  683. package/src/engine/sound/ecs/SoundListenerSystem.d.ts.map +1 -1
  684. package/src/engine/sound/ecs/SoundListenerSystem.js +82 -21
  685. package/src/engine/sound/ecs/audio/LiveEmitterSet.d.ts.map +1 -1
  686. package/src/engine/sound/ecs/audio/LiveEmitterSet.js +394 -356
  687. package/src/engine/sound/material/concrete/SoundMaterialComposition.d.ts.map +1 -1
  688. package/src/engine/sound/material/concrete/SoundMaterialComposition.js +54 -17
  689. package/src/engine/sound/material/detector/terrain/TerrainSoundMaterialSurfaceDetector.d.ts.map +1 -1
  690. package/src/engine/sound/material/detector/terrain/TerrainSoundMaterialSurfaceDetector.js +34 -3
  691. package/src/engine/sound/simulation/core/AcousticSolution.d.ts +5 -0
  692. package/src/engine/sound/simulation/core/AcousticSolution.d.ts.map +1 -1
  693. package/src/engine/sound/simulation/core/AcousticSolution.js +5 -0
  694. package/src/engine/sound/simulation/definition/AcousticMaterial.d.ts +8 -0
  695. package/src/engine/sound/simulation/definition/AcousticMaterial.d.ts.map +1 -1
  696. package/src/engine/sound/simulation/definition/AcousticMaterial.js +8 -0
  697. package/src/engine/sound/simulation/probe/probe_visibility_augment.d.ts +6 -4
  698. package/src/engine/sound/simulation/probe/probe_visibility_augment.d.ts.map +1 -1
  699. package/src/engine/sound/simulation/probe/probe_visibility_augment.js +19 -7
  700. package/src/engine/sound/simulation/render/FoaProbeReverbRenderer.d.ts +39 -0
  701. package/src/engine/sound/simulation/render/FoaProbeReverbRenderer.d.ts.map +1 -1
  702. package/src/engine/sound/simulation/render/FoaProbeReverbRenderer.js +130 -1
  703. package/src/engine/sound/simulation/render/ProbeReverbRenderer.d.ts +3 -2
  704. package/src/engine/sound/simulation/render/ProbeReverbRenderer.d.ts.map +1 -1
  705. package/src/engine/sound/simulation/render/ProbeReverbRenderer.js +15 -1
  706. package/src/engine/sound/sopra/SopraEngine.d.ts +10 -0
  707. package/src/engine/sound/sopra/SopraEngine.d.ts.map +1 -1
  708. package/src/engine/sound/sopra/SopraEngine.js +486 -440
  709. package/src/engine/sound/sopra/runtime/BusGraph.d.ts +29 -0
  710. package/src/engine/sound/sopra/runtime/BusGraph.d.ts.map +1 -1
  711. package/src/engine/sound/sopra/runtime/BusGraph.js +69 -2
  712. package/src/engine/sound/sopra/runtime/EventInstance.d.ts.map +1 -1
  713. package/src/engine/sound/sopra/runtime/EventInstance.js +130 -9
  714. package/src/engine/ui/GUIEngine.d.ts +14 -0
  715. package/src/engine/ui/GUIEngine.d.ts.map +1 -1
  716. package/src/engine/ui/GUIEngine.js +52 -4
  717. package/src/format/image/avif/api/apply_transformations.d.ts +2 -1
  718. package/src/format/image/avif/api/apply_transformations.d.ts.map +1 -1
  719. package/src/format/image/avif/api/apply_transformations.js +129 -120
  720. package/src/format/image/avif/api/convert_to_rgba.d.ts.map +1 -1
  721. package/src/format/image/avif/api/convert_to_rgba.js +35 -2
  722. package/src/format/image/avif/api/decode_image_item.d.ts +2 -1
  723. package/src/format/image/avif/api/decode_image_item.d.ts.map +1 -1
  724. package/src/format/image/avif/api/decode_image_item.js +322 -234
  725. package/src/format/image/avif/av1/decode/decode_av1_still.js +329 -309
  726. package/src/format/image/avif/av1/encode/encode_tile.js +2349 -2331
  727. package/src/format/image/avif/av1/entropy/symbol_cost.d.ts.map +1 -1
  728. package/src/format/image/avif/av1/entropy/symbol_cost.js +86 -76
  729. package/src/format/image/avif/heif/AvifFile.d.ts +11 -0
  730. package/src/format/image/avif/heif/AvifFile.d.ts.map +1 -1
  731. package/src/format/image/avif/heif/AvifFile.js +154 -142
  732. package/src/format/image/avif/heif/find_item_properties.d.ts +23 -0
  733. package/src/format/image/avif/heif/find_item_properties.d.ts.map +1 -0
  734. package/src/format/image/avif/heif/find_item_properties.js +36 -0
  735. package/src/format/image/avif/heif/parse_avif_file.js +6 -3
  736. package/src/format/image/avif/heif/read_item_data.d.ts.map +1 -1
  737. package/src/format/image/avif/heif/read_item_data.js +131 -97
  738. package/src/format/image/jpeg/decodeScan.d.ts.map +1 -1
  739. package/src/format/image/jpeg/decodeScan.js +17 -0
  740. package/src/format/scene/gltf/gltf_parse_container.d.ts.map +1 -1
  741. package/src/format/scene/gltf/gltf_parse_container.js +61 -41
  742. package/src/format/scene/gltf/gltf_read_accessor.d.ts +21 -0
  743. package/src/format/scene/gltf/gltf_read_accessor.d.ts.map +1 -1
  744. package/src/format/scene/gltf/gltf_read_accessor.js +37 -0
  745. package/src/format/scene/usd/usd_compose_transform.d.ts.map +1 -1
  746. package/src/format/scene/usd/usd_compose_transform.js +56 -6
  747. package/src/format/texture/basis/transcode/fit_endpoints.d.ts +6 -0
  748. package/src/format/texture/basis/transcode/fit_endpoints.d.ts.map +1 -1
  749. package/src/format/texture/basis/transcode/fit_endpoints.js +33 -39
  750. package/src/generation/filtering/numeric/CellFilterCache.d.ts +17 -0
  751. package/src/generation/filtering/numeric/CellFilterCache.d.ts.map +1 -1
  752. package/src/generation/filtering/numeric/CellFilterCache.js +36 -3
  753. package/src/generation/grid/actions/ContinuousGridCellActionSetTerrainObstacle.d.ts +9 -0
  754. package/src/generation/grid/actions/ContinuousGridCellActionSetTerrainObstacle.d.ts.map +1 -1
  755. package/src/generation/grid/actions/ContinuousGridCellActionSetTerrainObstacle.js +37 -6
  756. package/src/generation/grid/actions/ContinuousGridCellActionWriteObstacle.d.ts.map +1 -1
  757. package/src/generation/grid/actions/ContinuousGridCellActionWriteObstacle.js +8 -21
  758. package/src/generation/grid/actions/grid_obstacle_write_grid_point.d.ts +28 -0
  759. package/src/generation/grid/actions/grid_obstacle_write_grid_point.d.ts.map +1 -0
  760. package/src/generation/grid/actions/grid_obstacle_write_grid_point.js +41 -0
  761. package/src/generation/grid/generation/GridTaskDensityMarkerDistribution.d.ts +15 -1
  762. package/src/generation/grid/generation/GridTaskDensityMarkerDistribution.d.ts.map +1 -1
  763. package/src/generation/grid/generation/GridTaskDensityMarkerDistribution.js +17 -3
  764. package/src/generation/markers/actions/MarkerNodeProcessingRuleSet.d.ts.map +1 -1
  765. package/src/generation/markers/actions/MarkerNodeProcessingRuleSet.js +16 -1
  766. package/src/generation/placement/action/GridCellActionWriteFilterToLayer.d.ts.map +1 -1
  767. package/src/generation/placement/action/GridCellActionWriteFilterToLayer.js +8 -1
  768. package/src/generation/theme/TerrainTheme.d.ts.map +1 -1
  769. package/src/generation/theme/TerrainTheme.js +20 -1
  770. package/src/shade/RENDERER_CONTRACT.md +48 -6
  771. package/src/shade/descriptor/texture/format/gpu_texture_formats_copy_compatible.d.ts +23 -0
  772. package/src/shade/descriptor/texture/format/gpu_texture_formats_copy_compatible.d.ts.map +1 -0
  773. package/src/shade/descriptor/texture/format/gpu_texture_formats_copy_compatible.js +28 -0
  774. package/src/shade/descriptor/texture/format/gpu_texture_formats_view_compatible.d.ts +25 -0
  775. package/src/shade/descriptor/texture/format/gpu_texture_formats_view_compatible.d.ts.map +1 -0
  776. package/src/shade/descriptor/texture/format/gpu_texture_formats_view_compatible.js +42 -0
  777. package/src/shade/device/ShadeGPUCommandContext.d.ts.map +1 -1
  778. package/src/shade/device/ShadeGPUCommandContext.js +874 -857
  779. package/src/shade/device/mock/SoftwareGPUBindGroup.d.ts +38 -1
  780. package/src/shade/device/mock/SoftwareGPUBindGroup.d.ts.map +1 -1
  781. package/src/shade/device/mock/SoftwareGPUBindGroup.js +73 -1
  782. package/src/shade/device/mock/SoftwareGPUBuffer.d.ts.map +1 -1
  783. package/src/shade/device/mock/SoftwareGPUBuffer.js +5 -0
  784. package/src/shade/device/mock/SoftwareGPUCommandBuffer.d.ts +34 -0
  785. package/src/shade/device/mock/SoftwareGPUCommandBuffer.d.ts.map +1 -1
  786. package/src/shade/device/mock/SoftwareGPUCommandBuffer.js +71 -1
  787. package/src/shade/device/mock/SoftwareGPUCommandEncoder.d.ts +15 -0
  788. package/src/shade/device/mock/SoftwareGPUCommandEncoder.d.ts.map +1 -1
  789. package/src/shade/device/mock/SoftwareGPUCommandEncoder.js +109 -1
  790. package/src/shade/device/mock/SoftwareGPUComputePassEncoder.d.ts.map +1 -1
  791. package/src/shade/device/mock/SoftwareGPUComputePassEncoder.js +51 -0
  792. package/src/shade/device/mock/SoftwareGPUDevice.d.ts +5 -1
  793. package/src/shade/device/mock/SoftwareGPUDevice.d.ts.map +1 -1
  794. package/src/shade/device/mock/SoftwareGPUDevice.js +58 -1
  795. package/src/shade/device/mock/SoftwareGPUPipeline.d.ts +1 -0
  796. package/src/shade/device/mock/SoftwareGPUPipeline.d.ts.map +1 -1
  797. package/src/shade/device/mock/SoftwareGPUPipeline.js +17 -11
  798. package/src/shade/device/mock/SoftwareGPUQueue.d.ts.map +1 -1
  799. package/src/shade/device/mock/SoftwareGPUQueue.js +41 -0
  800. package/src/shade/device/mock/SoftwareGPURenderPassEncoder.d.ts.map +1 -1
  801. package/src/shade/device/mock/SoftwareGPURenderPassEncoder.js +24 -0
  802. package/src/shade/device/mock/SoftwareGPUTexture.d.ts +11 -1
  803. package/src/shade/device/mock/SoftwareGPUTexture.d.ts.map +1 -1
  804. package/src/shade/device/mock/SoftwareGPUTexture.js +45 -8
  805. package/src/shade/device/mock/SoftwareGPUTextureView.d.ts +20 -1
  806. package/src/shade/device/mock/SoftwareGPUTextureView.d.ts.map +1 -1
  807. package/src/shade/device/mock/SoftwareGPUTextureView.js +28 -1
  808. package/src/shade/device/mock/recorded_binding_kind_mismatches.d.ts +20 -0
  809. package/src/shade/device/mock/recorded_binding_kind_mismatches.d.ts.map +1 -0
  810. package/src/shade/device/mock/recorded_binding_kind_mismatches.js +84 -0
  811. package/src/shade/device/mock/texture_copy.d.ts.map +1 -1
  812. package/src/shade/device/mock/texture_copy.js +41 -3
  813. package/src/shade/device/mock/texture_view_resource.d.ts +26 -0
  814. package/src/shade/device/mock/texture_view_resource.d.ts.map +1 -0
  815. package/src/shade/device/mock/texture_view_resource.js +47 -0
  816. package/src/shade/device/timing/GPUTimer.d.ts.map +1 -1
  817. package/src/shade/device/timing/GPUTimer.js +35 -21
  818. package/src/shade/playground/caldera/caldera_format.d.ts +28 -1
  819. package/src/shade/playground/caldera/caldera_format.d.ts.map +1 -1
  820. package/src/shade/playground/caldera/caldera_format.js +37 -0
  821. package/src/shade/playground/caldera/main.js +12 -2
  822. package/src/shade/playground/frame_rate_meter.d.ts +92 -0
  823. package/src/shade/playground/frame_rate_meter.d.ts.map +1 -0
  824. package/src/shade/playground/frame_rate_meter.js +147 -0
  825. package/src/shade/playground/particle_ecs/main.js +53 -7
  826. package/src/shade/playground/particle_ecs/moonlit_environment.js +2 -2
  827. package/src/shade/playground/particle_stats_readback.d.ts +58 -0
  828. package/src/shade/playground/particle_stats_readback.d.ts.map +1 -0
  829. package/src/shade/playground/particle_stats_readback.js +83 -0
  830. package/src/shade/playground/particle_system/main.js +378 -325
  831. package/src/shade/playground/skinned_blas_refit/main.d.ts.map +1 -1
  832. package/src/shade/playground/skinned_blas_refit/main.js +7 -2
  833. package/src/shade/playground/sponza_path_trace/main.d.ts.map +1 -1
  834. package/src/shade/playground/sponza_path_trace/main.js +398 -393
  835. package/src/shade/playground/volumetrics_froxel/main.d.ts.map +1 -1
  836. package/src/shade/playground/volumetrics_froxel/main.js +941 -936
  837. package/src/shade/renderer/GraphicsContext.d.ts.map +1 -1
  838. package/src/shade/renderer/GraphicsContext.js +7 -2
  839. package/src/shade/renderer/Renderer.d.ts +47 -1
  840. package/src/shade/renderer/Renderer.d.ts.map +1 -1
  841. package/src/shade/renderer/Renderer.js +224 -27
  842. package/src/shade/renderer/animation/ANIMATION_CLIP_STATE_STRUCT.d.ts +4 -7
  843. package/src/shade/renderer/animation/ANIMATION_CLIP_STATE_STRUCT.d.ts.map +1 -1
  844. package/src/shade/renderer/animation/ANIMATION_CLIP_STATE_STRUCT.js +19 -16
  845. package/src/shade/renderer/animation/ANIMATION_CURVE_HEADER_STRUCT.js +11 -11
  846. package/src/shade/renderer/animation/ANIMATION_DATABASE_SPEC.d.ts +14 -18
  847. package/src/shade/renderer/animation/ANIMATION_DATABASE_SPEC.d.ts.map +1 -1
  848. package/src/shade/renderer/animation/ANIMATION_DATABASE_SPEC.js +95 -24
  849. package/src/shade/renderer/animation/ANIMATION_SKIN_JOINT_STRUCT.d.ts +5 -4
  850. package/src/shade/renderer/animation/ANIMATION_SKIN_JOINT_STRUCT.d.ts.map +1 -1
  851. package/src/shade/renderer/animation/ANIMATION_SKIN_JOINT_STRUCT.js +7 -4
  852. package/src/shade/renderer/animation/ANIMATION_SKIN_STRUCT.d.ts +6 -12
  853. package/src/shade/renderer/animation/ANIMATION_SKIN_STRUCT.d.ts.map +1 -1
  854. package/src/shade/renderer/animation/ANIMATION_SKIN_STRUCT.js +9 -16
  855. package/src/shade/renderer/animation/ANIMATION_TRACK_BINDING_STRUCT.d.ts +6 -5
  856. package/src/shade/renderer/animation/ANIMATION_TRACK_BINDING_STRUCT.d.ts.map +1 -1
  857. package/src/shade/renderer/animation/ANIMATION_TRACK_BINDING_STRUCT.js +12 -5
  858. package/src/shade/renderer/animation/GPUAnimationManager.d.ts +80 -95
  859. package/src/shade/renderer/animation/GPUAnimationManager.d.ts.map +1 -1
  860. package/src/shade/renderer/animation/GPUAnimationManager.js +371 -606
  861. package/src/shade/renderer/animation/chunk_animation_curve_evaluate.d.ts +10 -14
  862. package/src/shade/renderer/animation/chunk_animation_curve_evaluate.d.ts.map +1 -1
  863. package/src/shade/renderer/animation/chunk_animation_curve_evaluate.js +40 -67
  864. package/src/shade/renderer/animation/chunk_pose_accumulator.d.ts.map +1 -1
  865. package/src/shade/renderer/animation/chunk_pose_accumulator.js +13 -4
  866. package/src/shade/renderer/animation/shader_animation_apply.d.ts +14 -8
  867. package/src/shade/renderer/animation/shader_animation_apply.d.ts.map +1 -1
  868. package/src/shade/renderer/animation/shader_animation_apply.js +129 -128
  869. package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.js +2 -2
  870. package/src/shade/renderer/animation/skinning/SKINNING_BINDING_STRUCT.d.ts +3 -2
  871. package/src/shade/renderer/animation/skinning/SKINNING_BINDING_STRUCT.d.ts.map +1 -1
  872. package/src/shade/renderer/animation/skinning/SKINNING_BINDING_STRUCT.js +3 -2
  873. package/src/shade/renderer/animation/skinning/shader_skin_matrix_prep.d.ts +12 -7
  874. package/src/shade/renderer/animation/skinning/shader_skin_matrix_prep.d.ts.map +1 -1
  875. package/src/shade/renderer/animation/skinning/shader_skin_matrix_prep.js +107 -104
  876. package/src/shade/renderer/binding/BindingResource.d.ts +36 -1
  877. package/src/shade/renderer/binding/BindingResource.d.ts.map +1 -1
  878. package/src/shade/renderer/binding/BindingResource.js +36 -3
  879. package/src/shade/renderer/binding/BufferBinding.d.ts +8 -0
  880. package/src/shade/renderer/binding/BufferBinding.d.ts.map +1 -1
  881. package/src/shade/renderer/binding/BufferBinding.js +21 -0
  882. package/src/shade/renderer/buffer/table/GPUDatabase.d.ts +19 -0
  883. package/src/shade/renderer/buffer/table/GPUDatabase.d.ts.map +1 -1
  884. package/src/shade/renderer/buffer/table/GPUDatabase.js +114 -1
  885. package/src/shade/renderer/buffer/table/GPUDatabaseDefinition.d.ts +132 -1
  886. package/src/shade/renderer/buffer/table/GPUDatabaseDefinition.d.ts.map +1 -1
  887. package/src/shade/renderer/buffer/table/GPUDatabaseDefinition.js +384 -1
  888. package/src/shade/renderer/buffer/table/GPUDatabaseReadback.d.ts.map +1 -1
  889. package/src/shade/renderer/buffer/table/GPUDatabaseReadback.js +1332 -1323
  890. package/src/shade/renderer/buffer/table/GPUTableLink.d.ts +67 -0
  891. package/src/shade/renderer/buffer/table/GPUTableLink.d.ts.map +1 -0
  892. package/src/shade/renderer/buffer/table/GPUTableLink.js +76 -0
  893. package/src/shade/renderer/buffer/table/GPUTableRange.d.ts +72 -0
  894. package/src/shade/renderer/buffer/table/GPUTableRange.d.ts.map +1 -0
  895. package/src/shade/renderer/buffer/table/GPUTableRange.js +82 -0
  896. package/src/shade/renderer/buffer/table/GPUTypedTable.d.ts +106 -5
  897. package/src/shade/renderer/buffer/table/GPUTypedTable.d.ts.map +1 -1
  898. package/src/shade/renderer/buffer/table/GPUTypedTable.js +444 -28
  899. package/src/shade/renderer/buffer/table/GPUTypedTableDescriptor.d.ts.map +1 -1
  900. package/src/shade/renderer/buffer/table/GPUTypedTableDescriptor.js +28 -5
  901. package/src/shade/renderer/buffer/table/GPU_DATABASE_NULL.d.ts +14 -0
  902. package/src/shade/renderer/buffer/table/GPU_DATABASE_NULL.d.ts.map +1 -0
  903. package/src/shade/renderer/buffer/table/GPU_DATABASE_NULL.js +13 -0
  904. package/src/shade/renderer/buffer/table/gpu_database_check_links.d.ts +80 -0
  905. package/src/shade/renderer/buffer/table/gpu_database_check_links.d.ts.map +1 -0
  906. package/src/shade/renderer/buffer/table/gpu_database_check_links.js +456 -0
  907. package/src/shade/renderer/buffer/table/gpu_table_field_word.d.ts +17 -0
  908. package/src/shade/renderer/buffer/table/gpu_table_field_word.d.ts.map +1 -0
  909. package/src/shade/renderer/buffer/table/gpu_table_field_word.js +111 -0
  910. package/src/shade/renderer/buffer/table/gpu_table_range_well_formed.d.ts +20 -0
  911. package/src/shade/renderer/buffer/table/gpu_table_range_well_formed.d.ts.map +1 -0
  912. package/src/shade/renderer/buffer/table/gpu_table_range_well_formed.js +27 -0
  913. package/src/shade/renderer/camera/CameraManager.d.ts +11 -0
  914. package/src/shade/renderer/camera/CameraManager.d.ts.map +1 -1
  915. package/src/shade/renderer/camera/CameraManager.js +18 -0
  916. package/src/shade/renderer/create_frame_loop.d.ts +16 -0
  917. package/src/shade/renderer/create_frame_loop.d.ts.map +1 -1
  918. package/src/shade/renderer/create_frame_loop.js +16 -0
  919. package/src/shade/renderer/deferred/chunk_shade_standard_material_direct.d.ts +23 -0
  920. package/src/shade/renderer/deferred/chunk_shade_standard_material_direct.d.ts.map +1 -1
  921. package/src/shade/renderer/deferred/chunk_shade_standard_material_direct.js +27 -32
  922. package/src/shade/renderer/deferred/chunk_shade_standard_material_direct_heavy.d.ts +9 -7
  923. package/src/shade/renderer/deferred/chunk_shade_standard_material_direct_heavy.d.ts.map +1 -1
  924. package/src/shade/renderer/deferred/chunk_shade_standard_material_direct_heavy.js +16 -108
  925. package/src/shade/renderer/dynamic/DynamicMeshAVBOITChannel.d.ts +135 -0
  926. package/src/shade/renderer/dynamic/DynamicMeshAVBOITChannel.d.ts.map +1 -0
  927. package/src/shade/renderer/dynamic/DynamicMeshAVBOITChannel.js +296 -0
  928. package/src/shade/renderer/dynamic/GPUDynamicMeshRenderer.d.ts +2 -2
  929. package/src/shade/renderer/dynamic/GPUDynamicMeshRenderer.d.ts.map +1 -1
  930. package/src/shade/renderer/dynamic/GPUDynamicMeshRenderer.js +10 -131
  931. package/src/shade/renderer/dynamic/GPUDynamicMeshResidency.d.ts.map +1 -1
  932. package/src/shade/renderer/dynamic/GPUDynamicMeshResidency.js +185 -167
  933. package/src/shade/renderer/dynamic/GPUDynamicMeshResidencyTable.d.ts +49 -0
  934. package/src/shade/renderer/dynamic/GPUDynamicMeshResidencyTable.d.ts.map +1 -0
  935. package/src/shade/renderer/dynamic/GPUDynamicMeshResidencyTable.js +185 -0
  936. package/src/shade/renderer/dynamic/chunk_dynamic_mesh_avboit_vertex.d.ts +24 -0
  937. package/src/shade/renderer/dynamic/chunk_dynamic_mesh_avboit_vertex.d.ts.map +1 -0
  938. package/src/shade/renderer/dynamic/chunk_dynamic_mesh_avboit_vertex.js +49 -0
  939. package/src/shade/renderer/dynamic/chunk_dynamic_mesh_vertex.d.ts +18 -0
  940. package/src/shade/renderer/dynamic/chunk_dynamic_mesh_vertex.d.ts.map +1 -0
  941. package/src/shade/renderer/dynamic/chunk_dynamic_mesh_vertex.js +54 -0
  942. package/src/shade/renderer/dynamic/dynamic_mesh_live_bounds.d.ts +26 -0
  943. package/src/shade/renderer/dynamic/dynamic_mesh_live_bounds.d.ts.map +1 -0
  944. package/src/shade/renderer/dynamic/dynamic_mesh_live_bounds.js +96 -0
  945. package/src/shade/renderer/dynamic/graph_dynamic_mesh_avboit.d.ts +102 -0
  946. package/src/shade/renderer/dynamic/graph_dynamic_mesh_avboit.d.ts.map +1 -0
  947. package/src/shade/renderer/dynamic/graph_dynamic_mesh_avboit.js +364 -0
  948. package/src/shade/renderer/dynamic/shader_dynamic_mesh.d.ts.map +1 -1
  949. package/src/shade/renderer/dynamic/shader_dynamic_mesh.js +153 -177
  950. package/src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_draw.d.ts +20 -0
  951. package/src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_draw.d.ts.map +1 -0
  952. package/src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_draw.js +136 -0
  953. package/src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_occupancy.d.ts +20 -0
  954. package/src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_occupancy.d.ts.map +1 -0
  955. package/src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_occupancy.js +106 -0
  956. package/src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_splat.d.ts +32 -0
  957. package/src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_splat.d.ts.map +1 -0
  958. package/src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_splat.js +163 -0
  959. package/src/shade/renderer/extension/RENDER_EXTENSION_DESIGN.md +13 -2
  960. package/src/shade/renderer/fow/GPUFogOfWarRenderer.d.ts.map +1 -1
  961. package/src/shade/renderer/fow/GPUFogOfWarRenderer.js +5 -14
  962. package/src/shade/renderer/fow/fow_obtain_mask.d.ts +17 -0
  963. package/src/shade/renderer/fow/fow_obtain_mask.d.ts.map +1 -0
  964. package/src/shade/renderer/fow/fow_obtain_mask.js +41 -0
  965. package/src/shade/renderer/frame_jitter_applies.d.ts +21 -0
  966. package/src/shade/renderer/frame_jitter_applies.d.ts.map +1 -0
  967. package/src/shade/renderer/frame_jitter_applies.js +23 -0
  968. package/src/shade/renderer/geometry/bvh/GPUGeometryBVHManager.d.ts.map +1 -1
  969. package/src/shade/renderer/geometry/bvh/GPUGeometryBVHManager.js +128 -3
  970. package/src/shade/renderer/geometry/geometry_obtain_attribute.d.ts +42 -0
  971. package/src/shade/renderer/geometry/geometry_obtain_attribute.d.ts.map +1 -0
  972. package/src/shade/renderer/geometry/geometry_obtain_attribute.js +83 -0
  973. package/src/shade/renderer/geometry/meshlet/GPUMeshletManager.d.ts +12 -0
  974. package/src/shade/renderer/geometry/meshlet/GPUMeshletManager.d.ts.map +1 -1
  975. package/src/shade/renderer/geometry/meshlet/GPUMeshletManager.js +65 -0
  976. package/src/shade/renderer/geometry/meshlet/build/geometry_to_meshlets_greedy.d.ts.map +1 -1
  977. package/src/shade/renderer/geometry/meshlet/build/geometry_to_meshlets_greedy.js +4 -1
  978. package/src/shade/renderer/geometry/meshlet/build/meshoptimizer/geometry_to_meshlets_meshoptimizer.d.ts.map +1 -1
  979. package/src/shade/renderer/geometry/meshlet/build/meshoptimizer/geometry_to_meshlets_meshoptimizer.js +4 -1
  980. package/src/shade/renderer/geometry/normals/encode_normals_to_octahedral_u32.d.ts.map +1 -1
  981. package/src/shade/renderer/geometry/normals/encode_normals_to_octahedral_u32.js +4 -1
  982. package/src/shade/renderer/geometry/normals/geometry_build_tangents.d.ts.map +1 -1
  983. package/src/shade/renderer/geometry/normals/geometry_build_tangents.js +39 -1
  984. package/src/shade/renderer/geometry/util/geometry_merge.d.ts.map +1 -1
  985. package/src/shade/renderer/geometry/util/geometry_merge.js +18 -2
  986. package/src/shade/renderer/geometry/virtual/VIRTUAL_GEOMETRY_DESIGN.md +77 -39
  987. package/src/shade/renderer/geometry/virtual/build/gltf/gltf_collect_geometries.d.ts.map +1 -1
  988. package/src/shade/renderer/geometry/virtual/build/gltf/gltf_collect_geometries.js +31 -2
  989. package/src/shade/renderer/geometry/virtual/build/level/VGeoFrontier.d.ts +18 -0
  990. package/src/shade/renderer/geometry/virtual/build/level/VGeoFrontier.d.ts.map +1 -1
  991. package/src/shade/renderer/geometry/virtual/build/level/VGeoFrontier.js +19 -0
  992. package/src/shade/renderer/geometry/virtual/build/level/VGeoGroupStep.d.ts +8 -0
  993. package/src/shade/renderer/geometry/virtual/build/level/VGeoGroupStep.d.ts.map +1 -1
  994. package/src/shade/renderer/geometry/virtual/build/level/VGeoGroupStep.js +9 -0
  995. package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_group_step.d.ts.map +1 -1
  996. package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_group_step.js +10 -1
  997. package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_leaf_frontier.d.ts.map +1 -1
  998. package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_leaf_frontier.js +4 -0
  999. package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_levels.d.ts.map +1 -1
  1000. package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_levels.js +12 -0
  1001. package/src/shade/renderer/geometry/virtual/format/read/VGeoContainerReader.d.ts.map +1 -1
  1002. package/src/shade/renderer/geometry/virtual/format/read/VGeoContainerReader.js +10 -1
  1003. package/src/shade/renderer/geometry/virtual/format/read/vgeo_read_page.js +21 -0
  1004. package/src/shade/renderer/geometry/virtual/format/vgeo_write_container.d.ts.map +1 -1
  1005. package/src/shade/renderer/geometry/virtual/format/vgeo_write_container.js +33 -1
  1006. package/src/shade/renderer/geometry/virtual/runtime/VGeoPageFetcher.d.ts.map +1 -1
  1007. package/src/shade/renderer/geometry/virtual/runtime/VGeoPageFetcher.js +63 -2
  1008. package/src/shade/renderer/geometry/virtual/runtime/VGeoViewCut.d.ts +17 -0
  1009. package/src/shade/renderer/geometry/virtual/runtime/VGeoViewCut.d.ts.map +1 -1
  1010. package/src/shade/renderer/geometry/virtual/runtime/VGeoViewCut.js +39 -0
  1011. package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_instances_to_meshlets.d.ts.map +1 -1
  1012. package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_instances_to_meshlets.js +7 -0
  1013. package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v1/chunk_brick4_sh3_color_decode.d.ts.map +1 -1
  1014. package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v1/chunk_brick4_sh3_color_decode.js +23 -2
  1015. package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v1/chunk_brick4_sh3_color_decode_from_storage.d.ts.map +1 -1
  1016. package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v1/chunk_brick4_sh3_color_decode_from_storage.js +22 -1
  1017. package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v1/chunk_brick4_sh3_color_encode.d.ts.map +1 -1
  1018. package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v1/chunk_brick4_sh3_color_encode.js +23 -2
  1019. package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v1/chunk_brick4_sh3_color_encode_to_storage.d.ts.map +1 -1
  1020. package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v1/chunk_brick4_sh3_color_encode_to_storage.js +22 -1
  1021. package/src/shade/renderer/global_illumination/lpv/lpv_visualise_probes.d.ts +2 -1
  1022. package/src/shade/renderer/global_illumination/lpv/lpv_visualise_probes.d.ts.map +1 -1
  1023. package/src/shade/renderer/global_illumination/lpv/lpv_visualise_probes.js +12 -53
  1024. package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_lvp_atlas_to_sh.d.ts.map +1 -1
  1025. package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_lvp_atlas_to_sh.js +2 -1
  1026. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_patch_texel_coord.d.ts +17 -0
  1027. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_patch_texel_coord.d.ts.map +1 -0
  1028. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_patch_texel_coord.js +38 -0
  1029. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_read_patch_texel.d.ts.map +1 -1
  1030. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_read_patch_texel.js +16 -10
  1031. package/src/shade/renderer/gpu_primitive/indirect/IndirectComputeCommandBuildPass.d.ts +1 -1
  1032. package/src/shade/renderer/gpu_primitive/indirect/IndirectComputeCommandBuildPass.d.ts.map +1 -1
  1033. package/src/shade/renderer/gpu_primitive/indirect/IndirectComputeCommandBuildPass.js +25 -14
  1034. package/src/shade/renderer/gpu_primitive/indirect/NOTES.md +94 -0
  1035. package/src/shade/renderer/gpu_primitive/indirect/WEBGPU_GUARANTEED_MAX_COMPUTE_WORKGROUPS_PER_DIMENSION.d.ts +10 -7
  1036. package/src/shade/renderer/gpu_primitive/indirect/WEBGPU_GUARANTEED_MAX_COMPUTE_WORKGROUPS_PER_DIMENSION.d.ts.map +1 -1
  1037. package/src/shade/renderer/gpu_primitive/indirect/WEBGPU_GUARANTEED_MAX_COMPUTE_WORKGROUPS_PER_DIMENSION.js +10 -7
  1038. package/src/shade/renderer/light/GPULightCollection.d.ts.map +1 -1
  1039. package/src/shade/renderer/light/GPULightCollection.js +22 -1
  1040. package/src/shade/renderer/light/LIGHT_DATABASE_SPEC.d.ts.map +1 -1
  1041. package/src/shade/renderer/light/LIGHT_DATABASE_SPEC.js +26 -0
  1042. package/src/shade/renderer/light/cluster/chunk_cluster_keep_smallest.d.ts +21 -0
  1043. package/src/shade/renderer/light/cluster/chunk_cluster_keep_smallest.d.ts.map +1 -0
  1044. package/src/shade/renderer/light/cluster/chunk_cluster_keep_smallest.js +47 -0
  1045. package/src/shade/renderer/light/cluster/shader_cluster_assign_lights.d.ts.map +1 -1
  1046. package/src/shade/renderer/light/cluster/shader_cluster_assign_lights.js +12 -8
  1047. package/src/shade/renderer/light/environment/equirectangular_zenith_first_direction_to_uv.d.ts +36 -0
  1048. package/src/shade/renderer/light/environment/equirectangular_zenith_first_direction_to_uv.d.ts.map +1 -0
  1049. package/src/shade/renderer/light/environment/equirectangular_zenith_first_direction_to_uv.js +41 -0
  1050. package/src/shade/renderer/light/environment/execute_filter_environment_map.d.ts.map +1 -1
  1051. package/src/shade/renderer/light/environment/execute_filter_environment_map.js +17 -1
  1052. package/src/shade/renderer/light/environment/octahedral_uv_to_direction.d.ts +5 -13
  1053. package/src/shade/renderer/light/environment/octahedral_uv_to_direction.d.ts.map +1 -1
  1054. package/src/shade/renderer/light/environment/octahedral_uv_to_direction.js +10 -30
  1055. package/src/shade/renderer/light/environment/octahedral_z_pole_uv_to_direction.d.ts +31 -0
  1056. package/src/shade/renderer/light/environment/octahedral_z_pole_uv_to_direction.d.ts.map +1 -0
  1057. package/src/shade/renderer/light/environment/octahedral_z_pole_uv_to_direction.js +45 -0
  1058. package/src/shade/renderer/light/environment/resample_cube_to_octahedral.js +2 -2
  1059. package/src/shade/renderer/light/environment/resample_equirectangular_to_octahedral.d.ts.map +1 -1
  1060. package/src/shade/renderer/light/environment/resample_equirectangular_to_octahedral.js +11 -8
  1061. package/src/shade/renderer/light/model/SpotLight.d.ts +10 -1
  1062. package/src/shade/renderer/light/model/SpotLight.d.ts.map +1 -1
  1063. package/src/shade/renderer/light/model/SpotLight.js +11 -3
  1064. package/src/shade/renderer/light/model/io/light_record_directional.d.ts.map +1 -1
  1065. package/src/shade/renderer/light/model/io/light_record_directional.js +3 -1
  1066. package/src/shade/renderer/light/model/io/light_record_point.d.ts.map +1 -1
  1067. package/src/shade/renderer/light/model/io/light_record_point.js +3 -1
  1068. package/src/shade/renderer/light/model/io/light_record_spot.d.ts.map +1 -1
  1069. package/src/shade/renderer/light/model/io/light_record_spot.js +3 -1
  1070. package/src/shade/renderer/loader/gltf/gltf_base_url.d.ts +20 -0
  1071. package/src/shade/renderer/loader/gltf/gltf_base_url.d.ts.map +1 -0
  1072. package/src/shade/renderer/loader/gltf/gltf_base_url.js +27 -0
  1073. package/src/shade/renderer/loader/gltf/gltf_create_material.d.ts.map +1 -1
  1074. package/src/shade/renderer/loader/gltf/gltf_create_material.js +50 -10
  1075. package/src/shade/renderer/loader/gltf/load_gltf.d.ts +4 -0
  1076. package/src/shade/renderer/loader/gltf/load_gltf.d.ts.map +1 -1
  1077. package/src/shade/renderer/loader/gltf/load_gltf.js +28 -56
  1078. package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
  1079. package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts.map +1 -1
  1080. package/src/shade/renderer/loader/gltf/tiny-gltf.js +843 -843
  1081. package/src/shade/renderer/material/GPUMaterialContext.d.ts +63 -26
  1082. package/src/shade/renderer/material/GPUMaterialContext.d.ts.map +1 -1
  1083. package/src/shade/renderer/material/GPUMaterialContext.js +255 -390
  1084. package/src/shade/renderer/material/GPUMaterialManager.d.ts +51 -1
  1085. package/src/shade/renderer/material/GPUMaterialManager.d.ts.map +1 -1
  1086. package/src/shade/renderer/material/GPUMaterialManager.js +345 -91
  1087. package/src/shade/renderer/material/ShadeMaterial.d.ts +21 -0
  1088. package/src/shade/renderer/material/ShadeMaterial.d.ts.map +1 -1
  1089. package/src/shade/renderer/material/ShadeMaterial.js +31 -0
  1090. package/src/shade/renderer/material/resident/GPUResidentMaterialContext.d.ts.map +1 -1
  1091. package/src/shade/renderer/material/resident/GPUResidentMaterialContext.js +25 -6
  1092. package/src/shade/renderer/material/standard/SHADING_MATERIAL_RESOURCE_GROUP.d.ts +10 -0
  1093. package/src/shade/renderer/material/standard/SHADING_MATERIAL_RESOURCE_GROUP.d.ts.map +1 -1
  1094. package/src/shade/renderer/material/standard/SHADING_MATERIAL_RESOURCE_GROUP.js +14 -2
  1095. package/src/shade/renderer/material/standard/STANDARD_MATERIAL_TEMPLATE.d.ts +12 -0
  1096. package/src/shade/renderer/material/standard/STANDARD_MATERIAL_TEMPLATE.d.ts.map +1 -0
  1097. package/src/shade/renderer/material/standard/STANDARD_MATERIAL_TEMPLATE.js +166 -0
  1098. package/src/shade/renderer/material/standard/VT_MATERIAL_TEMPLATE.d.ts +10 -0
  1099. package/src/shade/renderer/material/standard/VT_MATERIAL_TEMPLATE.d.ts.map +1 -0
  1100. package/src/shade/renderer/material/standard/VT_MATERIAL_TEMPLATE.js +141 -0
  1101. package/src/shade/renderer/material/standard/chunk_standard_material_surface.d.ts +29 -0
  1102. package/src/shade/renderer/material/standard/chunk_standard_material_surface.d.ts.map +1 -0
  1103. package/src/shade/renderer/material/standard/chunk_standard_material_surface.js +92 -0
  1104. package/src/shade/renderer/material/standard/fragment_gbuffer.d.ts +74 -28
  1105. package/src/shade/renderer/material/standard/fragment_gbuffer.d.ts.map +1 -1
  1106. package/src/shade/renderer/material/standard/fragment_gbuffer.js +165 -67
  1107. package/src/shade/renderer/material/standard/fragment_gbuffer_vt.d.ts +27 -18
  1108. package/src/shade/renderer/material/standard/fragment_gbuffer_vt.d.ts.map +1 -1
  1109. package/src/shade/renderer/material/standard/fragment_gbuffer_vt.js +70 -91
  1110. package/src/shade/renderer/material/standard/material_gbuffer_vertex.d.ts +9 -6
  1111. package/src/shade/renderer/material/standard/material_gbuffer_vertex.d.ts.map +1 -1
  1112. package/src/shade/renderer/material/standard/material_gbuffer_vertex.js +13 -14
  1113. package/src/shade/renderer/material/template/GPUMaterialServices.d.ts +73 -0
  1114. package/src/shade/renderer/material/template/GPUMaterialServices.d.ts.map +1 -0
  1115. package/src/shade/renderer/material/template/GPUMaterialServices.js +79 -0
  1116. package/src/shade/renderer/material/template/ShadeMaterialTemplate.d.ts +170 -0
  1117. package/src/shade/renderer/material/template/ShadeMaterialTemplate.d.ts.map +1 -0
  1118. package/src/shade/renderer/material/template/ShadeMaterialTemplate.js +234 -0
  1119. package/src/shade/renderer/material/template/chunk_material_surface.d.ts +47 -0
  1120. package/src/shade/renderer/material/template/chunk_material_surface.d.ts.map +1 -0
  1121. package/src/shade/renderer/material/template/chunk_material_surface.js +116 -0
  1122. package/src/shade/renderer/material/template/flat_material_template_spec_support.d.ts +22 -0
  1123. package/src/shade/renderer/material/template/flat_material_template_spec_support.d.ts.map +1 -0
  1124. package/src/shade/renderer/material/template/flat_material_template_spec_support.js +78 -0
  1125. package/src/shade/renderer/material/template/material_metadata_neutral.d.ts +15 -0
  1126. package/src/shade/renderer/material/template/material_metadata_neutral.d.ts.map +1 -0
  1127. package/src/shade/renderer/material/template/material_metadata_neutral.js +46 -0
  1128. package/src/shade/renderer/material/template/material_template_of.d.ts +10 -0
  1129. package/src/shade/renderer/material/template/material_template_of.d.ts.map +1 -0
  1130. package/src/shade/renderer/material/template/material_template_of.js +20 -0
  1131. package/src/shade/renderer/object_property/chunk_write_object_property.d.ts +5 -0
  1132. package/src/shade/renderer/object_property/chunk_write_object_property.d.ts.map +1 -1
  1133. package/src/shade/renderer/object_property/chunk_write_object_property.js +7 -1
  1134. package/src/shade/renderer/object_property/chunk_write_object_property_node3d.d.ts +7 -1
  1135. package/src/shade/renderer/object_property/chunk_write_object_property_node3d.d.ts.map +1 -1
  1136. package/src/shade/renderer/object_property/chunk_write_object_property_node3d.js +9 -2
  1137. package/src/shade/renderer/particles/DESIGN.md +7 -0
  1138. package/src/shade/renderer/particles/data/PARTICLE_DATABASE_SPEC.d.ts.map +1 -1
  1139. package/src/shade/renderer/particles/data/PARTICLE_DATABASE_SPEC.js +81 -68
  1140. package/src/shade/renderer/particles/isa/ParticleVMISA.d.ts +22 -3
  1141. package/src/shade/renderer/particles/isa/ParticleVMISA.d.ts.map +1 -1
  1142. package/src/shade/renderer/particles/isa/ParticleVMISA.js +30 -3
  1143. package/src/shade/renderer/particles/isa/particle_assembly.js +41 -1
  1144. package/src/shade/renderer/particles/optimizer/particle_program_analysis.d.ts +7 -1
  1145. package/src/shade/renderer/particles/optimizer/particle_program_analysis.d.ts.map +1 -1
  1146. package/src/shade/renderer/particles/optimizer/particle_program_analysis.js +23 -17
  1147. package/src/shade/renderer/particles/optimizer/pass_allocate_registers.js +1 -1
  1148. package/src/shade/renderer/particles/optimizer/pass_fold_constants.js +10 -9
  1149. package/src/shade/renderer/particles/optimizer/pass_inline_constants.d.ts.map +1 -1
  1150. package/src/shade/renderer/particles/optimizer/pass_inline_constants.js +4 -3
  1151. package/src/shade/renderer/particles/optimizer/pass_narrow_widths.d.ts.map +1 -1
  1152. package/src/shade/renderer/particles/optimizer/pass_narrow_widths.js +1 -1
  1153. package/src/shade/renderer/particles/optimizer/pass_pack_registers.d.ts.map +1 -1
  1154. package/src/shade/renderer/particles/optimizer/pass_pack_registers.js +12 -4
  1155. package/src/shade/renderer/particles/optimizer/pass_peephole.d.ts.map +1 -1
  1156. package/src/shade/renderer/particles/optimizer/pass_peephole.js +11 -10
  1157. package/src/shade/renderer/particles/optimizer/pass_propagate_copies.d.ts.map +1 -1
  1158. package/src/shade/renderer/particles/optimizer/pass_propagate_copies.js +12 -10
  1159. package/src/shade/renderer/particles/optimizer/pass_share_subexpressions.d.ts.map +1 -1
  1160. package/src/shade/renderer/particles/optimizer/pass_share_subexpressions.js +12 -4
  1161. package/src/shade/renderer/particles/runtime/ParticleEmitter.d.ts.map +1 -1
  1162. package/src/shade/renderer/particles/runtime/ParticleEmitter.js +7 -0
  1163. package/src/shade/renderer/particles/shaders/chunk_particle_avboit_contribution.d.ts +4 -0
  1164. package/src/shade/renderer/particles/shaders/chunk_particle_avboit_contribution.d.ts.map +1 -1
  1165. package/src/shade/renderer/particles/shaders/chunk_particle_avboit_contribution.js +47 -88
  1166. package/src/shade/renderer/particles/shaders/shader_particle_avboit_occupancy.d.ts.map +1 -1
  1167. package/src/shade/renderer/particles/shaders/shader_particle_avboit_occupancy.js +22 -68
  1168. package/src/shade/renderer/particles/shaders/shader_particle_avboit_splat.d.ts.map +1 -1
  1169. package/src/shade/renderer/particles/shaders/shader_particle_avboit_splat.js +5 -3
  1170. package/src/shade/renderer/particles/vm/ParticleVMReference.d.ts.map +1 -1
  1171. package/src/shade/renderer/particles/vm/ParticleVMReference.js +17 -1
  1172. package/src/shade/renderer/path_tracer/shader/chunk_sample_material_data.d.ts.map +1 -1
  1173. package/src/shade/renderer/path_tracer/shader/chunk_sample_material_data.js +12 -2
  1174. package/src/shade/renderer/postprocess/TemporalJitterSequence.d.ts +44 -0
  1175. package/src/shade/renderer/postprocess/TemporalJitterSequence.d.ts.map +1 -0
  1176. package/src/shade/renderer/postprocess/TemporalJitterSequence.js +104 -0
  1177. package/src/shade/renderer/postprocess/chunk_find_nearest_depth.d.ts +25 -0
  1178. package/src/shade/renderer/postprocess/chunk_find_nearest_depth.d.ts.map +1 -0
  1179. package/src/shade/renderer/postprocess/chunk_find_nearest_depth.js +74 -0
  1180. package/src/shade/renderer/postprocess/denoise/shader_temporal_reprojection_luma.d.ts.map +1 -1
  1181. package/src/shade/renderer/postprocess/denoise/shader_temporal_reprojection_luma.js +19 -4
  1182. package/src/shade/renderer/postprocess/dof/gather/shader_dof2_recombine.d.ts.map +1 -1
  1183. package/src/shade/renderer/postprocess/dof/gather/shader_dof2_recombine.js +12 -1
  1184. package/src/shade/renderer/postprocess/eye/GPUCameraExposureManager.d.ts.map +1 -1
  1185. package/src/shade/renderer/postprocess/eye/GPUCameraExposureManager.js +8 -0
  1186. package/src/shade/renderer/postprocess/eye/shader_autoexposure_adapt.d.ts.map +1 -1
  1187. package/src/shade/renderer/postprocess/eye/shader_autoexposure_adapt.js +18 -3
  1188. package/src/shade/renderer/postprocess/eye/shader_autoexposure_read_histogram.d.ts.map +1 -1
  1189. package/src/shade/renderer/postprocess/eye/shader_autoexposure_read_histogram.js +17 -4
  1190. package/src/shade/renderer/postprocess/gtao/GTAO_CONSTANTS.d.ts +29 -0
  1191. package/src/shade/renderer/postprocess/gtao/GTAO_CONSTANTS.d.ts.map +1 -0
  1192. package/src/shade/renderer/postprocess/gtao/GTAO_CONSTANTS.js +69 -0
  1193. package/src/shade/renderer/postprocess/gtao/fragment_shader_gtao.d.ts +4 -16
  1194. package/src/shade/renderer/postprocess/gtao/fragment_shader_gtao.d.ts.map +1 -1
  1195. package/src/shade/renderer/postprocess/gtao/fragment_shader_gtao.js +10 -52
  1196. package/src/shade/renderer/postprocess/gtao/fragment_shader_gtao_with_irradiance.d.ts +0 -16
  1197. package/src/shade/renderer/postprocess/gtao/fragment_shader_gtao_with_irradiance.d.ts.map +1 -1
  1198. package/src/shade/renderer/postprocess/gtao/fragment_shader_gtao_with_irradiance.js +23 -55
  1199. package/src/shade/renderer/postprocess/motion_blur/MotionBlur.d.ts +4 -1
  1200. package/src/shade/renderer/postprocess/motion_blur/MotionBlur.d.ts.map +1 -1
  1201. package/src/shade/renderer/postprocess/motion_blur/MotionBlur.js +4 -1
  1202. package/src/shade/renderer/postprocess/motion_blur/chunk_motion_blur_resolution.d.ts +18 -0
  1203. package/src/shade/renderer/postprocess/motion_blur/chunk_motion_blur_resolution.d.ts.map +1 -0
  1204. package/src/shade/renderer/postprocess/motion_blur/chunk_motion_blur_resolution.js +43 -0
  1205. package/src/shade/renderer/postprocess/motion_blur/graph_postprocess_motion_blur.d.ts +5 -1
  1206. package/src/shade/renderer/postprocess/motion_blur/graph_postprocess_motion_blur.d.ts.map +1 -1
  1207. package/src/shade/renderer/postprocess/motion_blur/graph_postprocess_motion_blur.js +12 -2
  1208. package/src/shade/renderer/postprocess/motion_blur/shader_motion_blur_reconstruct.d.ts.map +1 -1
  1209. package/src/shade/renderer/postprocess/motion_blur/shader_motion_blur_reconstruct.js +33 -6
  1210. package/src/shade/renderer/postprocess/nss/NSS.d.ts +16 -8
  1211. package/src/shade/renderer/postprocess/nss/NSS.d.ts.map +1 -1
  1212. package/src/shade/renderer/postprocess/nss/NSS.js +37 -35
  1213. package/src/shade/renderer/postprocess/nss/chunk_nss_find_nearest_depth.d.ts +2 -2
  1214. package/src/shade/renderer/postprocess/nss/chunk_nss_find_nearest_depth.d.ts.map +1 -1
  1215. package/src/shade/renderer/postprocess/nss/chunk_nss_find_nearest_depth.js +28 -61
  1216. package/src/shade/renderer/postprocess/nss/shader_nss_postprocess.d.ts.map +1 -1
  1217. package/src/shade/renderer/postprocess/nss/shader_nss_postprocess.js +296 -291
  1218. package/src/shade/renderer/postprocess/nss/shader_nss_preprocess.d.ts.map +1 -1
  1219. package/src/shade/renderer/postprocess/nss/shader_nss_preprocess.js +13 -0
  1220. package/src/shade/renderer/postprocess/ssr/SSR.d.ts.map +1 -1
  1221. package/src/shade/renderer/postprocess/ssr/SSR.js +9 -7
  1222. package/src/shade/renderer/postprocess/ssr/depth_max_shader.d.ts +14 -0
  1223. package/src/shade/renderer/postprocess/ssr/depth_max_shader.d.ts.map +1 -1
  1224. package/src/shade/renderer/postprocess/ssr/depth_max_shader.js +53 -25
  1225. package/src/shade/renderer/postprocess/ssr/graph_build_depth_max_pyramid.d.ts +11 -1
  1226. package/src/shade/renderer/postprocess/ssr/graph_build_depth_max_pyramid.d.ts.map +1 -1
  1227. package/src/shade/renderer/postprocess/ssr/graph_build_depth_max_pyramid.js +11 -1
  1228. package/src/shade/renderer/postprocess/ssr/prefilter/NOTES.md +46 -0
  1229. package/src/shade/renderer/postprocess/ssr/prefilter/shader_ssr_prefilter.d.ts.map +1 -1
  1230. package/src/shade/renderer/postprocess/ssr/prefilter/shader_ssr_prefilter.js +7 -0
  1231. package/src/shade/renderer/postprocess/ssr/shader/chunk_ssr_depth_thickness.d.ts +32 -0
  1232. package/src/shade/renderer/postprocess/ssr/shader/chunk_ssr_depth_thickness.d.ts.map +1 -0
  1233. package/src/shade/renderer/postprocess/ssr/shader/chunk_ssr_depth_thickness.js +41 -0
  1234. package/src/shade/renderer/postprocess/ssr/ssr_trace_shader.d.ts.map +1 -1
  1235. package/src/shade/renderer/postprocess/ssr/ssr_trace_shader.js +11 -6
  1236. package/src/shade/renderer/postprocess/taa/TAA.d.ts +13 -4
  1237. package/src/shade/renderer/postprocess/taa/TAA.d.ts.map +1 -1
  1238. package/src/shade/renderer/postprocess/taa/TAA.js +29 -48
  1239. package/src/shade/renderer/postprocess/taa/chunk_taa_tonemap.d.ts +11 -0
  1240. package/src/shade/renderer/postprocess/taa/chunk_taa_tonemap.d.ts.map +1 -1
  1241. package/src/shade/renderer/postprocess/taa/chunk_taa_tonemap.js +25 -4
  1242. package/src/shade/renderer/postprocess/taa/shader_depth_occlusion_clip.d.ts +8 -0
  1243. package/src/shade/renderer/postprocess/taa/shader_depth_occlusion_clip.d.ts.map +1 -1
  1244. package/src/shade/renderer/postprocess/taa/shader_depth_occlusion_clip.js +14 -42
  1245. package/src/shade/renderer/rasterize/RasterizationJob.d.ts +4 -2
  1246. package/src/shade/renderer/rasterize/RasterizationJob.d.ts.map +1 -1
  1247. package/src/shade/renderer/rasterize/RasterizationJob.js +3 -1
  1248. package/src/shade/renderer/rasterize/TemplatePassDescriptor.d.ts +57 -0
  1249. package/src/shade/renderer/rasterize/TemplatePassDescriptor.d.ts.map +1 -0
  1250. package/src/shade/renderer/rasterize/TemplatePassDescriptor.js +133 -0
  1251. package/src/shade/renderer/rasterize/bucket/construct_primitive_state.d.ts.map +1 -1
  1252. package/src/shade/renderer/rasterize/bucket/construct_primitive_state.js +17 -0
  1253. package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.d.ts.map +1 -1
  1254. package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.js +30 -4
  1255. package/src/shade/renderer/rasterize/bucket/shader_count_meshlets_by_material.d.ts.map +1 -1
  1256. package/src/shade/renderer/rasterize/bucket/shader_count_meshlets_by_material.js +74 -68
  1257. package/src/shade/renderer/rasterize/bucket/shader_read_out_bucket.d.ts.map +1 -1
  1258. package/src/shade/renderer/rasterize/bucket/shader_read_out_bucket.js +11 -1
  1259. package/src/shade/renderer/rasterize/bucket/shader_sort_meshlets_by_material.d.ts.map +1 -1
  1260. package/src/shade/renderer/rasterize/bucket/shader_sort_meshlets_by_material.js +70 -64
  1261. package/src/shade/renderer/rasterize/cull/hzb/shader_hzb_meshlet_filter_1way.d.ts.map +1 -1
  1262. package/src/shade/renderer/rasterize/cull/hzb/shader_hzb_meshlet_filter_1way.js +3 -4
  1263. package/src/shade/renderer/rasterize/cull/hzb/shader_hzb_meshlet_filter_1way_full.d.ts.map +1 -1
  1264. package/src/shade/renderer/rasterize/cull/hzb/shader_hzb_meshlet_filter_1way_full.js +8 -2
  1265. package/src/shade/renderer/rasterize/expand/bucket/meshlet/shader_meshlets_count_by_rasterization_bucket.d.ts.map +1 -1
  1266. package/src/shade/renderer/rasterize/expand/bucket/meshlet/shader_meshlets_count_by_rasterization_bucket.js +3 -4
  1267. package/src/shade/renderer/rasterize/expand/bucket/meshlet/shader_meshlets_extract_bucket.d.ts.map +1 -1
  1268. package/src/shade/renderer/rasterize/expand/bucket/meshlet/shader_meshlets_extract_bucket.js +7 -5
  1269. package/src/shade/renderer/rasterize/expand/bucket/meshlet/shader_meshlets_rasterization_bucket_sort.d.ts.map +1 -1
  1270. package/src/shade/renderer/rasterize/expand/bucket/meshlet/shader_meshlets_rasterization_bucket_sort.js +3 -4
  1271. package/src/shade/renderer/rasterize/expand/mesh/shader_mesh_expand_to_meshlets_prefix.d.ts.map +1 -1
  1272. package/src/shade/renderer/rasterize/expand/mesh/shader_mesh_expand_to_meshlets_prefix.js +3 -4
  1273. package/src/shade/renderer/rasterize/expand/mesh/shader_prefix_sum_to_command.d.ts.map +1 -1
  1274. package/src/shade/renderer/rasterize/expand/mesh/shader_prefix_sum_to_command.js +5 -2
  1275. package/src/shade/renderer/rasterize/expand/pass1/filter_meshlets.2-way.compute.d.ts.map +1 -1
  1276. package/src/shade/renderer/rasterize/expand/pass1/filter_meshlets.2-way.compute.js +3 -4
  1277. package/src/shade/renderer/rasterize/forward/SHADING_SCENE_RESOURCE_GROUP.d.ts +20 -0
  1278. package/src/shade/renderer/rasterize/forward/SHADING_SCENE_RESOURCE_GROUP.d.ts.map +1 -1
  1279. package/src/shade/renderer/rasterize/forward/SHADING_SCENE_RESOURCE_GROUP.js +25 -0
  1280. package/src/shade/renderer/rasterize/forward/chunk_forward_shade_standard_fragment_brick4.d.ts.map +1 -1
  1281. package/src/shade/renderer/rasterize/forward/chunk_forward_shade_standard_fragment_brick4.js +2 -1
  1282. package/src/shade/renderer/rasterize/forward/chunk_forward_shade_standard_fragment_ibl.d.ts.map +1 -1
  1283. package/src/shade/renderer/rasterize/forward/chunk_forward_shade_standard_fragment_ibl.js +2 -1
  1284. package/src/shade/renderer/rasterize/forward/forward_template_pipeline.d.ts +40 -0
  1285. package/src/shade/renderer/rasterize/forward/forward_template_pipeline.d.ts.map +1 -0
  1286. package/src/shade/renderer/rasterize/forward/forward_template_pipeline.js +86 -0
  1287. package/src/shade/renderer/rasterize/forward/vertex_shader_chunk.d.ts +11 -0
  1288. package/src/shade/renderer/rasterize/forward/vertex_shader_chunk.d.ts.map +1 -1
  1289. package/src/shade/renderer/rasterize/forward/vertex_shader_chunk.js +13 -2
  1290. package/src/shade/renderer/rasterize/native/alpha_tested_pass_resources.d.ts +59 -1
  1291. package/src/shade/renderer/rasterize/native/alpha_tested_pass_resources.d.ts.map +1 -1
  1292. package/src/shade/renderer/rasterize/native/alpha_tested_pass_resources.js +109 -7
  1293. package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.d.ts +16 -1
  1294. package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.d.ts.map +1 -1
  1295. package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.js +13 -1
  1296. package/src/shade/renderer/rasterize/native/avboit/AVBOIT_LEDGER.md +247 -0
  1297. package/src/shade/renderer/rasterize/native/avboit/AVBOIT_PLAN_2026_09_03.md +20 -2
  1298. package/src/shade/renderer/rasterize/native/avboit/avboit_draw_fragment_body.js +1 -1
  1299. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_coverage.d.ts +17 -0
  1300. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_coverage.d.ts.map +1 -0
  1301. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_coverage.js +25 -0
  1302. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_fold_pairs.d.ts +4 -5
  1303. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_fold_pairs.d.ts.map +1 -1
  1304. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_fold_pairs.js +7 -6
  1305. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_occupancy_mark.d.ts +17 -0
  1306. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_occupancy_mark.d.ts.map +1 -0
  1307. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_occupancy_mark.js +51 -0
  1308. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_premultiplied_contribution.d.ts +23 -0
  1309. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_premultiplied_contribution.d.ts.map +1 -0
  1310. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_premultiplied_contribution.js +77 -0
  1311. package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.d.ts.map +1 -1
  1312. package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.js +16 -20
  1313. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_draw_brick4.d.ts +8 -2
  1314. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_draw_brick4.d.ts.map +1 -1
  1315. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_draw_brick4.js +57 -43
  1316. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_draw_ibl.d.ts +8 -2
  1317. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_draw_ibl.d.ts.map +1 -1
  1318. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_draw_ibl.js +57 -43
  1319. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_occupancy.d.ts.map +1 -1
  1320. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_occupancy.js +8 -2
  1321. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_splat.d.ts +7 -2
  1322. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_splat.d.ts.map +1 -1
  1323. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_splat.js +67 -58
  1324. package/src/shade/renderer/rasterize/native/depth/shadow_rasterization_alpha_tested_pass_descriptor.d.ts +8 -2
  1325. package/src/shade/renderer/rasterize/native/depth/shadow_rasterization_alpha_tested_pass_descriptor.d.ts.map +1 -1
  1326. package/src/shade/renderer/rasterize/native/depth/shadow_rasterization_alpha_tested_pass_descriptor.js +186 -156
  1327. package/src/shade/renderer/rasterize/native/graph_rasterize_meshes_alpha_tested.d.ts +2 -2
  1328. package/src/shade/renderer/rasterize/native/graph_rasterize_meshes_alpha_tested.d.ts.map +1 -1
  1329. package/src/shade/renderer/rasterize/native/graph_rasterize_meshes_alpha_tested.js +36 -28
  1330. package/src/shade/renderer/rasterize/native/material_draw_indirect.d.ts +14 -12
  1331. package/src/shade/renderer/rasterize/native/material_draw_indirect.d.ts.map +1 -1
  1332. package/src/shade/renderer/rasterize/native/material_draw_indirect.js +29 -23
  1333. package/src/shade/renderer/rasterize/native/oit/graph_rasterize_meshes_transparent_oit.d.ts.map +1 -1
  1334. package/src/shade/renderer/rasterize/native/oit/graph_rasterize_meshes_transparent_oit.js +16 -22
  1335. package/src/shade/renderer/rasterize/native/oit/oit_resolve_fragment_body.d.ts +33 -0
  1336. package/src/shade/renderer/rasterize/native/oit/oit_resolve_fragment_body.d.ts.map +1 -0
  1337. package/src/shade/renderer/rasterize/native/oit/oit_resolve_fragment_body.js +123 -0
  1338. package/src/shade/renderer/rasterize/native/oit/shader_oit_generate_moments.d.ts +7 -2
  1339. package/src/shade/renderer/rasterize/native/oit/shader_oit_generate_moments.d.ts.map +1 -1
  1340. package/src/shade/renderer/rasterize/native/oit/shader_oit_generate_moments.js +227 -218
  1341. package/src/shade/renderer/rasterize/native/oit/shader_oit_resolve_moments.d.ts +8 -2
  1342. package/src/shade/renderer/rasterize/native/oit/shader_oit_resolve_moments.d.ts.map +1 -1
  1343. package/src/shade/renderer/rasterize/native/oit/shader_oit_resolve_moments.js +112 -180
  1344. package/src/shade/renderer/rasterize/native/oit/shader_oit_resolve_moments_ibl.d.ts +8 -2
  1345. package/src/shade/renderer/rasterize/native/oit/shader_oit_resolve_moments_ibl.d.ts.map +1 -1
  1346. package/src/shade/renderer/rasterize/native/oit/shader_oit_resolve_moments_ibl.js +110 -178
  1347. package/src/shade/renderer/rasterize/native/viz/viz_rasterization_alpha_tested_pass_descriptor.d.ts +7 -2
  1348. package/src/shade/renderer/rasterize/native/viz/viz_rasterization_alpha_tested_pass_descriptor.d.ts.map +1 -1
  1349. package/src/shade/renderer/rasterize/native/viz/viz_rasterization_alpha_tested_pass_descriptor.js +242 -204
  1350. package/src/shade/renderer/restir/reservoir/shader.d.ts.map +1 -1
  1351. package/src/shade/renderer/restir/reservoir/shader.js +27 -1
  1352. package/src/shade/renderer/scene/GPUSceneContext.d.ts +2 -1
  1353. package/src/shade/renderer/scene/GPUSceneContext.d.ts.map +1 -1
  1354. package/src/shade/renderer/scene/GPUSceneContext.js +11 -9
  1355. package/src/shade/renderer/scene/SCENE_DATABASE_SPEC.js +22 -0
  1356. package/src/shade/renderer/scene/SceneManager.d.ts +10 -0
  1357. package/src/shade/renderer/scene/SceneManager.d.ts.map +1 -1
  1358. package/src/shade/renderer/scene/SceneManager.js +17 -0
  1359. package/src/shade/renderer/scene/rows/GPUEntityBoundsReadback.d.ts.map +1 -1
  1360. package/src/shade/renderer/scene/rows/GPUEntityBoundsReadback.js +164 -144
  1361. package/src/shade/renderer/scene/rows/GPUSceneRows.d.ts +10 -0
  1362. package/src/shade/renderer/scene/rows/GPUSceneRows.d.ts.map +1 -1
  1363. package/src/shade/renderer/scene/rows/GPUSceneRows.js +14 -0
  1364. package/src/shade/renderer/scene/serialization/serialize_scene.d.ts.map +1 -1
  1365. package/src/shade/renderer/scene/serialization/serialize_scene.js +2 -6
  1366. package/src/shade/renderer/shader/ComputeShader.d.ts +5 -0
  1367. package/src/shade/renderer/shader/ComputeShader.d.ts.map +1 -1
  1368. package/src/shade/renderer/shader/ComputeShader.js +358 -353
  1369. package/src/shade/renderer/shader/chunk/atmosphere/chunk_integrate_scattering.d.ts.map +1 -1
  1370. package/src/shade/renderer/shader/chunk/atmosphere/chunk_integrate_scattering.js +15 -1
  1371. package/src/shade/renderer/shader/chunk/binary/chunk_encode_f16.d.ts +11 -2
  1372. package/src/shade/renderer/shader/chunk/binary/chunk_encode_f16.d.ts.map +1 -1
  1373. package/src/shade/renderer/shader/chunk/binary/chunk_encode_f16.js +33 -13
  1374. package/src/shade/renderer/shader/chunk/brdf/chunk_D_GGX.d.ts.map +1 -1
  1375. package/src/shade/renderer/shader/chunk/brdf/chunk_D_GGX.js +31 -3
  1376. package/src/shade/renderer/shader/chunk/bvh/morton/chunk_decode32_morton2.d.ts +10 -1
  1377. package/src/shade/renderer/shader/chunk/bvh/morton/chunk_decode32_morton2.d.ts.map +1 -1
  1378. package/src/shade/renderer/shader/chunk/bvh/morton/chunk_decode32_morton2.js +23 -8
  1379. package/src/shade/renderer/shader/chunk/camera/chunk_pixel_radius_to_world.d.ts +8 -1
  1380. package/src/shade/renderer/shader/chunk/camera/chunk_pixel_radius_to_world.d.ts.map +1 -1
  1381. package/src/shade/renderer/shader/chunk/camera/chunk_pixel_radius_to_world.js +12 -5
  1382. package/src/shade/renderer/shader/chunk/geometry/aabb3/chunk_aabb3_distance_to_ray.d.ts +15 -1
  1383. package/src/shade/renderer/shader/chunk/geometry/aabb3/chunk_aabb3_distance_to_ray.d.ts.map +1 -1
  1384. package/src/shade/renderer/shader/chunk/geometry/aabb3/chunk_aabb3_distance_to_ray.js +24 -28
  1385. package/src/shade/renderer/shader/chunk/geometry/aabb3/chunk_aabb3_distance_to_ray_v2.d.ts +5 -0
  1386. package/src/shade/renderer/shader/chunk/geometry/aabb3/chunk_aabb3_distance_to_ray_v2.d.ts.map +1 -1
  1387. package/src/shade/renderer/shader/chunk/geometry/aabb3/chunk_aabb3_distance_to_ray_v2.js +18 -13
  1388. package/src/shade/renderer/shader/chunk/geometry/aabb3/chunk_aabb3_intersects_ray.d.ts.map +1 -1
  1389. package/src/shade/renderer/shader/chunk/geometry/aabb3/chunk_aabb3_intersects_ray.js +1 -47
  1390. package/src/shade/renderer/shader/chunk/geometry/aabb3/chunk_aabb3_raycast.d.ts +10 -0
  1391. package/src/shade/renderer/shader/chunk/geometry/aabb3/chunk_aabb3_raycast.d.ts.map +1 -1
  1392. package/src/shade/renderer/shader/chunk/geometry/aabb3/chunk_aabb3_raycast.js +23 -8
  1393. package/src/shade/renderer/shader/chunk/geometry/aabb3/chunk_aabb3_raycast_positive.d.ts +7 -0
  1394. package/src/shade/renderer/shader/chunk/geometry/aabb3/chunk_aabb3_raycast_positive.d.ts.map +1 -1
  1395. package/src/shade/renderer/shader/chunk/geometry/aabb3/chunk_aabb3_raycast_positive.js +12 -25
  1396. package/src/shade/renderer/shader/chunk/geometry/aabb3/chunk_aabb3_slab_span.d.ts +32 -0
  1397. package/src/shade/renderer/shader/chunk/geometry/aabb3/chunk_aabb3_slab_span.d.ts.map +1 -0
  1398. package/src/shade/renderer/shader/chunk/geometry/aabb3/chunk_aabb3_slab_span.js +52 -0
  1399. package/src/shade/renderer/shader/chunk/geometry/aabb3/chunk_aabb3_view_depth_range.d.ts +20 -0
  1400. package/src/shade/renderer/shader/chunk/geometry/aabb3/chunk_aabb3_view_depth_range.d.ts.map +1 -0
  1401. package/src/shade/renderer/shader/chunk/geometry/aabb3/chunk_aabb3_view_depth_range.js +42 -0
  1402. package/src/shade/renderer/shader/chunk/geometry/octahedron/chunk_octahedral_uv_wrap.d.ts +10 -1
  1403. package/src/shade/renderer/shader/chunk/geometry/octahedron/chunk_octahedral_uv_wrap.d.ts.map +1 -1
  1404. package/src/shade/renderer/shader/chunk/geometry/octahedron/chunk_octahedral_uv_wrap.js +18 -3
  1405. package/src/shade/renderer/shader/chunk/geometry/quaternion/chunk_quat_encode_u32.d.ts.map +1 -1
  1406. package/src/shade/renderer/shader/chunk/geometry/quaternion/chunk_quat_encode_u32.js +8 -4
  1407. package/src/shade/renderer/shader/chunk/grid/chunk_folded_workgroup_index.d.ts +24 -0
  1408. package/src/shade/renderer/shader/chunk/grid/chunk_folded_workgroup_index.d.ts.map +1 -0
  1409. package/src/shade/renderer/shader/chunk/grid/chunk_folded_workgroup_index.js +36 -0
  1410. package/src/shade/renderer/shader/chunk/grid/chunk_grid3d_to_index.d.ts +6 -0
  1411. package/src/shade/renderer/shader/chunk/grid/chunk_grid3d_to_index.d.ts.map +1 -1
  1412. package/src/shade/renderer/shader/chunk/grid/chunk_grid3d_to_index.js +6 -0
  1413. package/src/shade/renderer/shader/chunk/light/INCIDENT_LIGHT_STRUCT.d.ts.map +1 -1
  1414. package/src/shade/renderer/shader/chunk/light/INCIDENT_LIGHT_STRUCT.js +6 -1
  1415. package/src/shade/renderer/shader/chunk/light/io/chunk_get_spot_light_info.d.ts.map +1 -1
  1416. package/src/shade/renderer/shader/chunk/light/io/chunk_get_spot_light_info.js +6 -1
  1417. package/src/shade/renderer/shader/chunk/material/chunk_albedo_unpremultiply.d.ts +24 -0
  1418. package/src/shade/renderer/shader/chunk/material/chunk_albedo_unpremultiply.d.ts.map +1 -0
  1419. package/src/shade/renderer/shader/chunk/material/chunk_albedo_unpremultiply.js +31 -0
  1420. package/src/shade/renderer/shader/chunk/random/pcg/chunk_pcg2d.js +2 -2
  1421. package/src/shade/renderer/shader/chunk/random/pcg/chunk_pcg3d16.js +1 -1
  1422. package/src/shade/renderer/shader/chunk/random/pcg/chunk_pcg4d.js +1 -1
  1423. package/src/shade/renderer/shader/chunk/screen_space/chunk_ffx_sssr_validate_hit.d.ts.map +1 -1
  1424. package/src/shade/renderer/shader/chunk/screen_space/chunk_ffx_sssr_validate_hit.js +8 -4
  1425. package/src/shade/renderer/shader/chunk/sdf/chunk_mesh_sdf_soft_shadow.d.ts.map +1 -1
  1426. package/src/shade/renderer/shader/chunk/sdf/chunk_mesh_sdf_soft_shadow.js +17 -3
  1427. package/src/shade/renderer/shader/graph/compute/graph_compute_indirect_pass.d.ts +4 -0
  1428. package/src/shade/renderer/shader/graph/compute/graph_compute_indirect_pass.d.ts.map +1 -1
  1429. package/src/shade/renderer/shader/graph/compute/graph_compute_indirect_pass.js +4 -0
  1430. package/src/shade/renderer/shader/pass/RenderPassDescriptor.d.ts +8 -0
  1431. package/src/shade/renderer/shader/pass/RenderPassDescriptor.d.ts.map +1 -1
  1432. package/src/shade/renderer/shader/pass/RenderPassDescriptor.js +203 -192
  1433. package/src/shade/renderer/shader/resource/ShaderResourceGroupDescriptor.d.ts.map +1 -1
  1434. package/src/shade/renderer/shader/resource/ShaderResourceGroupDescriptor.js +12 -0
  1435. package/src/shade/renderer/shader/type/WebGPUArray.d.ts.map +1 -1
  1436. package/src/shade/renderer/shader/type/WebGPUArray.js +25 -1
  1437. package/src/shade/renderer/shader/type/queue_typed_buffer_update.d.ts.map +1 -1
  1438. package/src/shade/renderer/shader/type/queue_typed_buffer_update.js +15 -0
  1439. package/src/shade/renderer/shadow/map/GPUSceneShadowmapContext.d.ts.map +1 -1
  1440. package/src/shade/renderer/shadow/map/GPUSceneShadowmapContext.js +10 -9
  1441. package/src/shade/renderer/shadow/map/ShadowmapDrawSelector.d.ts +12 -2
  1442. package/src/shade/renderer/shadow/map/ShadowmapDrawSelector.d.ts.map +1 -1
  1443. package/src/shade/renderer/shadow/map/ShadowmapDrawSelector.js +210 -196
  1444. package/src/shade/renderer/shadow/map/csm/shader/shader_csm_caster_range.d.ts +10 -3
  1445. package/src/shade/renderer/shadow/map/csm/shader/shader_csm_caster_range.d.ts.map +1 -1
  1446. package/src/shade/renderer/shadow/map/csm/shader/shader_csm_caster_range.js +219 -194
  1447. package/src/shade/renderer/shadow/map/shadowmap_budget_carry_over.d.ts +32 -0
  1448. package/src/shade/renderer/shadow/map/shadowmap_budget_carry_over.d.ts.map +1 -0
  1449. package/src/shade/renderer/shadow/map/shadowmap_budget_carry_over.js +47 -0
  1450. package/src/shade/renderer/shadow/vsm/VirtualShadowMap.d.ts.map +1 -1
  1451. package/src/shade/renderer/shadow/vsm/VirtualShadowMap.js +11 -1
  1452. package/src/shade/renderer/texture/ShadeTexture.d.ts +16 -0
  1453. package/src/shade/renderer/texture/ShadeTexture.d.ts.map +1 -1
  1454. package/src/shade/renderer/texture/ShadeTexture.js +17 -0
  1455. package/src/shade/renderer/texture/TextureManager.d.ts +22 -5
  1456. package/src/shade/renderer/texture/TextureManager.d.ts.map +1 -1
  1457. package/src/shade/renderer/texture/TextureManager.js +109 -6
  1458. package/src/shade/renderer/texture/bindless/GPUBindlessTextureManager.d.ts.map +1 -1
  1459. package/src/shade/renderer/texture/bindless/GPUBindlessTextureManager.js +8 -2
  1460. package/src/shade/renderer/texture/download_texture_data.d.ts.map +1 -1
  1461. package/src/shade/renderer/texture/download_texture_data.js +12 -4
  1462. package/src/shade/renderer/texture/encode/shader_texture_encode_astc_4x4.d.ts.map +1 -1
  1463. package/src/shade/renderer/texture/encode/shader_texture_encode_astc_4x4.js +66 -63
  1464. package/src/shade/renderer/texture/encode/shader_texture_encode_bc1.d.ts.map +1 -1
  1465. package/src/shade/renderer/texture/encode/shader_texture_encode_bc1.js +63 -60
  1466. package/src/shade/renderer/texture/encode/shader_texture_encode_bc4.d.ts.map +1 -1
  1467. package/src/shade/renderer/texture/encode/shader_texture_encode_bc4.js +79 -76
  1468. package/src/shade/renderer/texture/encode/shader_texture_encode_bc4_snorm.d.ts.map +1 -1
  1469. package/src/shade/renderer/texture/encode/shader_texture_encode_bc4_snorm.js +67 -64
  1470. package/src/shade/renderer/texture/encode/shader_texture_encode_bc5.d.ts.map +1 -1
  1471. package/src/shade/renderer/texture/encode/shader_texture_encode_bc5.js +70 -67
  1472. package/src/shade/renderer/texture/encode/shader_texture_encode_bc5_snorm.d.ts.map +1 -1
  1473. package/src/shade/renderer/texture/encode/shader_texture_encode_bc5_snorm.js +66 -63
  1474. package/src/shade/renderer/texture/encode/shader_texture_encode_bc6h.d.ts.map +1 -1
  1475. package/src/shade/renderer/texture/encode/shader_texture_encode_bc6h.js +65 -62
  1476. package/src/shade/renderer/texture/encode/shader_texture_encode_bc7.d.ts.map +1 -1
  1477. package/src/shade/renderer/texture/encode/shader_texture_encode_bc7.js +61 -58
  1478. package/src/shade/renderer/texture/format/texture_format_from_shade_image.d.ts +7 -1
  1479. package/src/shade/renderer/texture/format/texture_format_from_shade_image.d.ts.map +1 -1
  1480. package/src/shade/renderer/texture/format/texture_format_from_shade_image.js +100 -95
  1481. package/src/shade/renderer/texture/mipmaps/WebGPUMipmapGenerator.d.ts.map +1 -1
  1482. package/src/shade/renderer/texture/mipmaps/WebGPUMipmapGenerator.js +59 -68
  1483. package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_wronski2021.d.ts +30 -1
  1484. package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_wronski2021.d.ts.map +1 -1
  1485. package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_wronski2021.js +37 -20
  1486. package/src/shade/renderer/texture/texture_descriptor_from_texture_shade.js +73 -73
  1487. package/src/shade/renderer/view/ViewManager.d.ts +8 -0
  1488. package/src/shade/renderer/view/ViewManager.d.ts.map +1 -1
  1489. package/src/shade/renderer/view/ViewManager.js +15 -0
  1490. package/src/shade/renderer/volumetrics/GPUViewVolumetrics.d.ts.map +1 -1
  1491. package/src/shade/renderer/volumetrics/GPUViewVolumetrics.js +516 -507
  1492. package/src/shade/renderer/volumetrics/shader_volumetrics_build_scattering_lut.d.ts.map +1 -1
  1493. package/src/shade/renderer/volumetrics/shader_volumetrics_build_scattering_lut.js +272 -260
  1494. package/src/shade/renderer/volumetrics/taa/shader_volumetrics_taa.d.ts.map +1 -1
  1495. package/src/shade/renderer/volumetrics/taa/shader_volumetrics_taa.js +160 -134
  1496. package/src/shade/wgsl/emulator/WGSLJavaScriptCompiler.d.ts +3 -0
  1497. package/src/shade/wgsl/emulator/WGSLJavaScriptCompiler.d.ts.map +1 -1
  1498. package/src/shade/wgsl/emulator/WGSLJavaScriptCompiler.js +243 -62
  1499. package/src/shade/wgsl/emulator/WGSLLanguageCore.d.ts.map +1 -1
  1500. package/src/shade/wgsl/emulator/WGSLLanguageCore.js +110 -7
  1501. package/src/shade/wgsl/validate_wgsl_source.d.ts.map +1 -1
  1502. package/src/shade/wgsl/validate_wgsl_source.js +57 -0
  1503. package/src/view/asset/AssetLoaderStatusView.d.ts.map +1 -1
  1504. package/src/view/asset/AssetLoaderStatusView.js +8 -0
  1505. package/src/view/common/LabelView.d.ts.map +1 -1
  1506. package/src/view/common/LabelView.js +4 -0
  1507. package/src/view/common/ListView.d.ts +6 -2
  1508. package/src/view/common/ListView.d.ts.map +1 -1
  1509. package/src/view/common/ListView.js +27 -7
  1510. package/src/view/common/TabbedView.d.ts.map +1 -1
  1511. package/src/view/common/TabbedView.js +8 -0
  1512. package/src/view/common/VirtualListView.d.ts.map +1 -1
  1513. package/src/view/common/VirtualListView.js +17 -1
  1514. package/src/view/common/dnd/DropTarget.d.ts.map +1 -1
  1515. package/src/view/common/dnd/DropTarget.js +18 -0
  1516. package/src/view/elements/DropDownSelectionView.d.ts.map +1 -1
  1517. package/src/view/elements/DropDownSelectionView.js +8 -0
  1518. package/src/view/elements/image/SvgImageView.d.ts.map +1 -1
  1519. package/src/view/elements/image/SvgImageView.js +8 -0
  1520. package/src/view/elements/navigation/ViewStack.d.ts.map +1 -1
  1521. package/src/view/elements/navigation/ViewStack.js +4 -0
  1522. package/src/view/elements/notify/NotificationView.d.ts.map +1 -1
  1523. package/src/view/elements/notify/NotificationView.js +4 -0
  1524. package/src/view/elements/progress/segmented/SegmentedResourceBarView.d.ts.map +1 -1
  1525. package/src/view/elements/progress/segmented/SegmentedResourceBarView.js +8 -0
  1526. package/src/view/elements/radial/RadialMenu.d.ts.map +1 -1
  1527. package/src/view/elements/radial/RadialMenu.js +4 -0
  1528. package/src/view/minimap/Minimap.d.ts.map +1 -1
  1529. package/src/view/minimap/Minimap.js +8 -0
  1530. package/src/view/minimap/MinimapCanvasView.d.ts.map +1 -1
  1531. package/src/view/minimap/MinimapCanvasView.js +21 -1
  1532. package/src/view/minimap/dom/MinimapCameraView.d.ts.map +1 -1
  1533. package/src/view/minimap/dom/MinimapCameraView.js +232 -220
  1534. package/src/view/minimap/dom/MinimapMarkerView.d.ts.map +1 -1
  1535. package/src/view/minimap/dom/MinimapMarkerView.js +8 -0
  1536. package/src/view/minimap/minimap_focus_area.d.ts +5 -0
  1537. package/src/view/minimap/minimap_focus_area.d.ts.map +1 -1
  1538. package/src/view/minimap/minimap_focus_area.js +22 -0
  1539. package/src/view/tooltip/TooltipManager.d.ts.map +1 -1
  1540. package/src/view/tooltip/TooltipManager.js +16 -4
  1541. package/src/core/geom/3d/atlas/atlas_bench_lib.js +0 -315
  1542. package/src/engine/graphics/ecs/mesh/MeshEvents.d.ts +0 -6
  1543. package/src/engine/graphics/ecs/mesh/MeshEvents.d.ts.map +0 -1
  1544. package/src/engine/graphics/ecs/mesh/MeshEvents.js +0 -16
  1545. package/src/engine/graphics/ecs/mesh/commonObject3DFastMatrixUpdate.d.ts +0 -2
  1546. package/src/engine/graphics/ecs/mesh/commonObject3DFastMatrixUpdate.d.ts.map +0 -1
  1547. package/src/engine/graphics/ecs/mesh/commonObject3DFastMatrixUpdate.js +0 -37
  1548. package/src/engine/graphics/ecs/mesh/copyToVector3.d.ts +0 -8
  1549. package/src/engine/graphics/ecs/mesh/copyToVector3.d.ts.map +0 -1
  1550. package/src/engine/graphics/ecs/mesh/copyToVector3.js +0 -18
  1551. package/src/engine/graphics/ecs/mesh/object3DFastMatrixUpdate.d.ts +0 -6
  1552. package/src/engine/graphics/ecs/mesh/object3DFastMatrixUpdate.d.ts.map +0 -1
  1553. package/src/engine/graphics/ecs/mesh/object3DFastMatrixUpdate.js +0 -18
  1554. package/src/engine/graphics/ecs/mesh/rootObject3DFastMatrixUpdate.d.ts +0 -6
  1555. package/src/engine/graphics/ecs/mesh/rootObject3DFastMatrixUpdate.d.ts.map +0 -1
  1556. package/src/engine/graphics/ecs/mesh/rootObject3DFastMatrixUpdate.js +0 -14
  1557. package/src/engine/graphics/ecs/mesh/setMesh.d.ts +0 -16
  1558. package/src/engine/graphics/ecs/mesh/setMesh.d.ts.map +0 -1
  1559. package/src/engine/graphics/ecs/mesh/setMesh.js +0 -55
  1560. package/src/engine/graphics/ecs/mesh/skeleton/BoneMapping.d.ts +0 -13
  1561. package/src/engine/graphics/ecs/mesh/skeleton/BoneMapping.d.ts.map +0 -1
  1562. package/src/engine/graphics/ecs/mesh/skeleton/BoneMapping.js +0 -99
  1563. package/src/engine/graphics/ecs/mesh/skeleton/HumanoidBoneType.d.ts +0 -25
  1564. package/src/engine/graphics/ecs/mesh/skeleton/HumanoidBoneType.d.ts.map +0 -1
  1565. package/src/engine/graphics/ecs/mesh/skeleton/HumanoidBoneType.js +0 -29
  1566. package/src/engine/graphics/ecs/mesh/updateMeshTransform.d.ts +0 -6
  1567. package/src/engine/graphics/ecs/mesh/updateMeshTransform.d.ts.map +0 -1
  1568. package/src/engine/graphics/ecs/mesh/updateMeshTransform.js +0 -15
  1569. package/src/engine/graphics/ecs/mesh/updateNodeByTransformAndBBB.d.ts +0 -8
  1570. package/src/engine/graphics/ecs/mesh/updateNodeByTransformAndBBB.d.ts.map +0 -1
  1571. package/src/engine/graphics/ecs/mesh/updateNodeByTransformAndBBB.js +0 -14
  1572. package/src/engine/graphics3/terrain/GPUTerrainSplatRenderer.js +0 -481
  1573. package/src/engine/graphics3/terrain/pack_terrain_row_table.js +0 -48
  1574. package/src/engine/graphics3/terrain/shader_terrain_splat.js +0 -215
  1575. package/src/shade/renderer/animation/ANIMATION_BOUND_TRACK_GROUP_STRUCT.js +0 -57
  1576. package/src/shade/renderer/animation/ANIMATION_KEYFRAME_BLOCK_STRUCT.js +0 -50
  1577. package/src/shade/renderer/animation/ANIMATION_SKIN_JOINT_BLOCK_STRUCT.js +0 -62
  1578. package/src/shade/renderer/geometry/virtual/build/mesh/VGEO_CREASE_ANGLE.d.ts +0 -46
  1579. package/src/shade/renderer/geometry/virtual/build/mesh/VGEO_CREASE_ANGLE.d.ts.map +0 -1
@@ -1,21 +1,19 @@
1
1
  import { assert } from "../../../core/assert.js";
2
2
  import { FrameGraph } from "../../../engine/graphics/render/frame_graph/FrameGraph.js";
3
3
  import { GPUDatabase } from "../buffer/table/GPUDatabase.js";
4
+ import { GPU_DATABASE_NULL } from "../buffer/table/GPU_DATABASE_NULL.js";
5
+ import { generate_record_writer } from "../buffer/table/serde/generate_record_writer.js";
4
6
  import {
5
7
  graph_scene_update_transform_hierarchy
6
8
  } from "../scene/hierarchy/graph_scene_update_transform_hierarchy.js";
7
9
  import { graph_import_buffer } from "../shader/graph/graph_import_buffer.js";
8
- import {
9
- ANIMATION_BOUND_TRACK_GROUP_NULL,
10
- TRACKS_PER_GROUP_NODE,
11
- } from "./ANIMATION_BOUND_TRACK_GROUP_STRUCT.js";
10
+ import { ANIMATION_CLIP_STATE_STRUCT } from "./ANIMATION_CLIP_STATE_STRUCT.js";
11
+ import { ANIMATION_CURVE_KEYFRAME_STRUCT } from "./ANIMATION_CURVE_KEYFRAME_STRUCT.js";
12
12
  import { ANIMATION_DATABASE_SPEC } from "./ANIMATION_DATABASE_SPEC.js";
13
+ import { ANIMATION_SKIN_JOINT_STRUCT } from "./ANIMATION_SKIN_JOINT_STRUCT.js";
14
+ import { ANIMATION_SKIN_STRUCT } from "./ANIMATION_SKIN_STRUCT.js";
15
+ import { ANIMATION_TRACK_BINDING_STRUCT } from "./ANIMATION_TRACK_BINDING_STRUCT.js";
13
16
  import { AnimationClipFlags } from "./AnimationClipFlags.js";
14
- import { KEYFRAMES_PER_BLOCK } from "./ANIMATION_KEYFRAME_BLOCK_STRUCT.js";
15
- import {
16
- ANIMATION_SKIN_JOINT_BLOCK_NULL,
17
- JOINTS_PER_SKIN_BLOCK,
18
- } from "./ANIMATION_SKIN_JOINT_BLOCK_STRUCT.js";
19
17
  import { POSE_ACCUMULATOR_SLOT_BYTES } from "./POSE_ACCUMULATOR_LAYOUT.js";
20
18
  import { GPUStateAuthorityFlags } from "../../../engine/ecs/gpu/GPUStateAuthorityFlags.js";
21
19
  import { gpu_authority_grant } from "../../../engine/ecs/gpu/gpu_authority_grant.js";
@@ -45,23 +43,13 @@ import {
45
43
 
46
44
  /**
47
45
  * @typedef {import("../../../engine/animation/curve/AnimationCurve.js").AnimationCurve} AnimationCurve
46
+ * @typedef {import("../buffer/table/serde/generate_record_writer.js").GPURecordWriter} GPURecordWriter
48
47
  * @typedef {import("../../device/ShadeGPUCommandContext.js").ShadeGPUCommandContext} ShadeGPUCommandContext
49
48
  * @typedef {import("../scene/GPUSceneContext.js").GPUSceneContext} GPUSceneContext
50
49
  * @typedef {import("./ShadeAnimationClip.js").ShadeAnimationClip} ShadeAnimationClip
51
50
  * @typedef {import("./Skin.js").Skin} Skin
52
51
  */
53
52
 
54
- /**
55
- * Tail-slot placeholders for the fixed-size inline arrays in chain
56
- * nodes. The shader's `count` guard means these bytes are never read,
57
- * but the upload buffer doesn't zero unwritten ranges and
58
- * `write_struct_value` skips undefined fields — so explicit zeros are
59
- * the only way to keep tail bytes deterministic. Frozen so a stray
60
- * mutation can't bleed into multiple slots that share the reference.
61
- */
62
- const ZERO_KEYFRAME = Object.freeze({ time: 0, value: 0, inTangent: 0, outTangent: 0 });
63
- const ZERO_BINDING = Object.freeze({ track: 0, instance: 0, property: 0 });
64
-
65
53
  /**
66
54
  * Scratch for seeding a released joint's offset — see {@link GPUAnimationManager#release_targets}.
67
55
  *
@@ -78,17 +66,50 @@ const SEED = new Transform64();
78
66
  const SEED_PLAYBACK = { clip: null, time: 0, weight: 1 };
79
67
 
80
68
  const SEED_PLAYBACKS = [SEED_PLAYBACK];
81
- // Object.freeze on a typed array with elements throws under V8
82
- // ("Cannot freeze array buffer views with elements"), so we leave the
83
- // Float32Array unfrozen — the surrounding placeholder object is still
84
- // frozen to keep accidental field-level mutation out of bounds.
85
- const ZERO_INVERSE_BIND = new Float32Array(16);
86
- const ZERO_SKIN_JOINT = Object.freeze({ node: 0, inverse_bind: ZERO_INVERSE_BIND });
69
+
70
+ /*
71
+ Generated writers for the rows a registration adds as a run. Through `add_run` every row is a
72
+ reflective walk of its type, and a run is one row per keyframe, binding or joint where a chain
73
+ block used to hold eight: a 60-joint skin measured 1.7x the cost of the chain it replaced until
74
+ its joints went through a writer.
75
+ */
76
+
77
+ const KEYFRAME_WRITER = generate_record_writer(ANIMATION_CURVE_KEYFRAME_STRUCT);
78
+ const BINDING_WRITER = generate_record_writer(ANIMATION_TRACK_BINDING_STRUCT);
79
+ const SKIN_JOINT_WRITER = generate_record_writer(ANIMATION_SKIN_JOINT_STRUCT);
80
+
81
+ /*
82
+ Writers for the fields of a clip that change after registration, each owning only its own words.
83
+ A playing clip's time is the GPU's — the tick advances it in the database buffer, and the CPU's
84
+ copy of the record never hears of it — so a mutator uploads the words it changes and nothing
85
+ else: a whole record would put the CPU's stale time back over the GPU's.
86
+ */
87
+
88
+ const CLIP_TIME_WRITER = generate_record_writer(ANIMATION_CLIP_STATE_STRUCT, ['time']);
89
+ const CLIP_PLAYBACK_RATE_WRITER = generate_record_writer(ANIMATION_CLIP_STATE_STRUCT, ['playback_rate']);
90
+ const CLIP_PLAYBACK_WEIGHT_WRITER = generate_record_writer(ANIMATION_CLIP_STATE_STRUCT, ['playback_weight']);
91
+ const CLIP_FLAGS_WRITER = generate_record_writer(ANIMATION_CLIP_STATE_STRUCT, ['flags']);
92
+ const CLIP_BINDINGS_WRITER = generate_record_writer(ANIMATION_CLIP_STATE_STRUCT, ['bindings_first', 'bindings_count']);
93
+
94
+ /**
95
+ * Word of a clip record holding its flags — read back to set or clear a bit of them.
96
+ */
97
+ const CLIP_FLAGS_WORD = ANIMATION_CLIP_STATE_STRUCT.get('flags').offset / 4;
98
+
99
+ /**
100
+ * Word of a skin record holding its first joint row — where its matrices start.
101
+ */
102
+ const SKIN_JOINTS_FIRST_WORD = ANIMATION_SKIN_STRUCT.get('joints_first').offset / 4;
103
+
104
+ /**
105
+ * A joint's `node` alone — what naming a pending skin's nodes writes, and all it uploads.
106
+ */
107
+ const SKIN_JOINT_NODE_WRITER = generate_record_writer(ANIMATION_SKIN_JOINT_STRUCT, ['node']);
87
108
 
88
109
  /**
89
110
  * One skinning matrix is a `mat4x4f` — 16 f32s, 64 bytes. The
90
- * `skin_matrices` scratch buffer holds one entry per (skin, joint) pair
91
- * across every registered skin.
111
+ * `skin_matrices` scratch buffer holds one entry per row of
112
+ * `animation_skin_joints`, at the joint's row.
92
113
  */
93
114
  const SKIN_MATRIX_BYTES = 64;
94
115
 
@@ -120,57 +141,21 @@ const POSE_ACCUMULATOR_INITIAL_CAPACITY = 256;
120
141
  */
121
142
  const MAX_DT_SECONDS = 1 / 15;
122
143
 
123
- /**
124
- * Allocate a singly-linked chain of fixed-capacity nodes into `table`,
125
- * one node per `items_per_chunk`-sized window of `items`. Builds
126
- * tail-first so each node's successor id is known at `add()` time —
127
- * the alternative (forward + back-patch) would mean a second `set()`
128
- * per node.
129
- *
130
- * `build_node(start, count, next_id)` constructs the record to add: it
131
- * populates the inline array from `items[start..start+count]`, pads
132
- * tail slots, and assembles any extra payload the table expects
133
- * (including embedding `next_id` as the node's `next` field).
134
- *
135
- * Returns the head id (the last `add()`'s slot id), or `0xFFFFFFFF` if
136
- * `items` is empty.
137
- *
138
- * @template T
139
- * @template R
140
- * @param {{ add: (record: R) => number }} table
141
- * @param {T[]} items
142
- * @param {number} items_per_chunk
143
- * @param {(start: number, count: number, next_id: number) => R} build_node
144
- * @returns {number}
145
- */
146
- function add_linked_chain(table, items, items_per_chunk, build_node) {
147
- const node_count = Math.ceil(items.length / items_per_chunk);
148
- let next_id = 0xFFFFFFFF;
149
-
150
- for (let n = node_count - 1; n >= 0; n--) {
151
- const start = n * items_per_chunk;
152
- const this_count = Math.min(items_per_chunk, items.length - start);
153
- next_id = table.add(build_node(start, this_count, next_id));
154
- }
155
-
156
- return next_id;
157
- }
158
-
159
144
  /**
160
145
  * Top-level coordinator for GPU-resident animation.
161
146
  *
162
147
  * Owns a single {@link GPUDatabase} keyed by {@link ANIMATION_DATABASE_SPEC}
163
- * with five tables: `animation_curves`, `animation_keyframe_blocks`,
164
- * `animation_tracks`, `animation_clips`, `animation_bound_track_groups`.
165
- * Every record — including individual keyframes (inlined inside block
166
- * nodes) and individual bindings (inlined inside group nodes) — lives in
148
+ * with its tables: `animation_curves`, `animation_keyframes`,
149
+ * `animation_tracks`, `animation_clips`, `animation_bindings`,
150
+ * `animation_skins` and `animation_skin_joints`.
151
+ * Every record — including individual keyframes (a run of rows per
152
+ * curve) and individual bindings (a run of rows per clip) — lives in
167
153
  * the database, so the dispatch shader needs only one storage binding.
168
154
  *
169
155
  * Animation *data* (curves, keyframes, tracks) is independent from
170
- * *bound clips* (each carrying a `time` and a head pointer to its
171
- * bound-track group chain). Bindings are no longer their own table:
172
- * each chain node inlines up to {@link TRACKS_PER_GROUP_NODE} bindings
173
- * and back-references its owning clip.
156
+ * *bound clips* (each carrying a `time` and the run of its bindings).
157
+ * Each binding row names its clip, so the apply pass, one thread per
158
+ * binding, finds the clip's time from the binding alone.
174
159
  *
175
160
  * Usage:
176
161
  * 1. (Once at setup) Either low-level (`add_curve`, `add_track`,
@@ -234,8 +219,9 @@ export class GPUAnimationManager {
234
219
  /**
235
220
  * When true, the next prep dispatch will copy the freshly-written
236
221
  * "current" buffer into the "previous" buffer at the end of the
237
- * pass — used on first allocation and after every grow so the
238
- * very first velocity computation has matching prev/current
222
+ * pass — set when a run of joints is handed out, when a pending
223
+ * skin's joints are named, and when the buffers grow, so the first
224
+ * velocity computation over those rows has matching prev/current
239
225
  * matrices (zero velocity).
240
226
  * @type {boolean}
241
227
  */
@@ -249,56 +235,13 @@ export class GPUAnimationManager {
249
235
  #skin_matrices_capacity = 0;
250
236
 
251
237
  /**
252
- * High-water mark of the matrix range: the first index no skin has ever been given.
253
- * A skin that cannot be served from {@link #free_skin_matrix_ranges} takes
254
- * `joint_count` consecutive entries starting here, and this advances past them.
255
- *
256
- * Monotonic, but no longer the whole allocator — a range given back is reused before
257
- * this advances again, so it tracks peak concurrent joints rather than total
258
- * registrations.
238
+ * One past the highest joint row any skin has been given — how many matrices the buffers have
239
+ * to address, since a joint's matrix sits at its row. Only grows: first fit hands the rows a
240
+ * skin gave back to any skin they fit before it reaches past the end.
259
241
  *
260
242
  * @type {number}
261
243
  */
262
- #next_skin_matrix_offset = 0;
263
-
264
- /**
265
- * CPU-side `skin_id → skin_matrix_offset` map. Each registered
266
- * skin's base address in the shared `skin_matrices` scratch
267
- * buffer; the per-block absolute offset (the prep shader's hot
268
- * path) is derived as `base + chain_position *
269
- * JOINTS_PER_SKIN_BLOCK` at registration. Storing the base on
270
- * GPU would duplicate it — the block records already carry the
271
- * per-block absolute address, and only the CPU (the skinning-
272
- * binding upload path) needs the skin's base value.
273
- *
274
- * @type {Map<number, number>}
275
- */
276
- #skin_matrix_offsets = new Map();
277
-
278
- /**
279
- * Matrix ranges handed back by {@link unregister_skin}, bucketed by their length in
280
- * matrices. Each bucket is a stack of base indices free to give out again.
281
- *
282
- * A range's base is baked into its skin's joint-block rows on the GPU, so a range can
283
- * never be *moved* once handed out — which is what made compaction hard enough to skip,
284
- * and left the offset a bump pointer with no way back. Reuse needs no movement: the hole
285
- * a despawned character leaves is exactly the size of the next character wearing that
286
- * rig, so matching a request to a hole of the same length hands the range straight back
287
- * with nothing relocated and nothing to patch.
288
- *
289
- * Bucketed by length because the match has to be **exact**. The prep pass writes
290
- * `base + joint` for `joint` in `[0, joint_count)`, so a skin placed in a shorter hole
291
- * would write over whatever lives after it. Splitting a longer hole would fit, but every
292
- * split leaves a fragment only an exactly-as-small skin can ever use; a game's rigs come
293
- * in a handful of joint counts, so exact buckets stay few and nearly always hit.
294
- *
295
- * What this does not reclaim is bounded by the number of distinct joint counts ever
296
- * registered rather than by the number of registrations: a rig retired for good leaves
297
- * its ranges behind, a rig still in use passes the same ranges around forever.
298
- *
299
- * @type {Map<number, number[]>}
300
- */
301
- #free_skin_matrix_ranges = new Map();
244
+ #skin_matrix_count = 0;
302
245
 
303
246
  /**
304
247
  * How many bound clips drive each entity, by entity. An entity's local TRS is the GPU's for
@@ -371,9 +314,9 @@ export class GPUAnimationManager {
371
314
  * {@link register_clip}. Lets multiple clips whose channels share
372
315
  * the same curve instance (e.g. one base clip retargeted across
373
316
  * many character instances) reuse the same GPU rows for the
374
- * curve header + keyframe blocks rather than uploading
317
+ * curve header + keyframes rather than uploading
375
318
  * duplicates. At grid-of-dancers scale duplication would balloon
376
- * the keyframe-blocks table past its page-table limits.
319
+ * the keyframes table past its page-table limits.
377
320
  *
378
321
  * Low-level `add_curve` deliberately stays uncached — every call
379
322
  * uploads — so existing callers that pre-build curves with
@@ -390,7 +333,7 @@ export class GPUAnimationManager {
390
333
  *
391
334
  * An instance cache alone shares nothing between two parses of one file, and a character
392
335
  * instanced a few hundred times is a few hundred parses — each with its own instances of the
393
- * same keys, filling the keyframe-block table with copies of one dance until its page limit
336
+ * same keys, filling the keyframes table with copies of one dance until its page limit
394
337
  * refuses the next dancer. Curves are read-only once uploaded and nothing here releases them,
395
338
  * so equal content can safely mean one upload.
396
339
  *
@@ -418,35 +361,32 @@ export class GPUAnimationManager {
418
361
  #track_id_cache = new Map();
419
362
 
420
363
  /**
421
- * Skins registered via {@link register_skin} whose joint-block
422
- * chain hasn't been built yet because one or more joint entities
423
- * has not taken its row yet. The skin's GPU table row exists
424
- * (placeholder `joint_block_head = NULL`, no joints driving the
425
- * prep pass yet), and state mutators / unregister already work
426
- * — but the deformation only kicks in once {@link update}
427
- * successfully drains the entry.
428
- *
429
- * Each entry: `skin_id`, the CPU {@link Skin} (whose `joints`
430
- * array drives the chain build), the `skin_matrix_offset`
431
- * reserved at register time, and the `inverse_bind_matrices`
432
- * typed array.
364
+ * Skins registered via {@link register_skin} whose joints name no node yet, because at least
365
+ * one joint entity has not taken its row. The skin's record and its run of joints exist — each
366
+ * joint with its inverse bind and a NULL node, which the prep pass skips — so the id, the
367
+ * matrix offset and {@link unregister_skin} work from the start. The skin's meshes are bound
368
+ * to it only when {@link update} names the nodes: until then its matrices are not written,
369
+ * and a mesh deformed by them would read zeros or another skin's last pose.
370
+ *
371
+ * Each entry: `skin_id`; the CPU {@link Skin}, whose `joints` are the entities whose rows
372
+ * become the nodes and whose `meshes` are bound then; `joints_first`, the first row of the
373
+ * skin's joints; and `joint_count`, how many rows the run has.
433
374
  *
434
375
  * @type {Array<{
435
376
  * skin_id: number,
436
377
  * skin: Skin,
437
- * skin_matrix_offset: number,
438
- * inverse_bind_matrices: Float32Array,
378
+ * joints_first: number,
379
+ * joint_count: number,
439
380
  * }>}
440
381
  */
441
382
  #pending_skins = [];
442
383
 
443
384
  /**
444
385
  * Clips registered via {@link register_clip} whose bindings
445
- * chain hasn't been built yet because one or more channel
386
+ * haven't been added yet because one or more channel
446
387
  * targets has not taken its row yet. The clip's GPU table row
447
- * exists (placeholder `bound_track_group_head = NULL`, no
448
- * tracks driving the apply pass yet); time/state mutators and
449
- * unregister already work.
388
+ * exists (an empty range, no bindings driving the apply pass
389
+ * yet); time/state mutators and unregister already work.
450
390
  *
451
391
  * Each entry: `clip_id` plus the per-channel `(track_id,
452
392
  * target, property)` triples — the curves and tracks were
@@ -491,8 +431,8 @@ export class GPUAnimationManager {
491
431
  * Per-frame skinning-matrix scratch buffer for the *current*
492
432
  * frame. `null` until the first skin is registered. The
493
433
  * skin-matrix-prep pass writes to it; the skinning compute pass
494
- * reads from it to deform current-frame positions. Address `j`
495
- * of skin `s` is at matrix index `s.skin_matrix_offset + j`.
434
+ * reads from it to deform current-frame positions. Joint `j` of
435
+ * skin `s` is at matrix index `s.joints_first + j` — the joint's row.
496
436
  *
497
437
  * The buffer reference is invalidated on grow AND flips role
498
438
  * every frame as part of the ping-pong with
@@ -520,17 +460,16 @@ export class GPUAnimationManager {
520
460
  }
521
461
 
522
462
  /**
523
- * Matrices the buffer has to address: the high-water mark, which covers every registered
524
- * skin plus any range sitting on the free list between the ones still in use. Independent
525
- * of buffer capacity, which is at least this big.
463
+ * Matrices the buffer has to address: one past the highest joint row any skin has been
464
+ * given. Independent of buffer capacity, which is at least this big.
526
465
  *
527
- * Not a count of live joints — a skin that unregisters leaves its range addressable for
528
- * the next skin of its size, so this falls only when nothing has been registered yet.
466
+ * Not a count of live joints — rows a skin gives back stay addressable for the next skin
467
+ * that fits in them, so this never falls.
529
468
  *
530
469
  * @returns {number}
531
470
  */
532
471
  get skin_matrix_count() {
533
- return this.#next_skin_matrix_offset;
472
+ return this.#skin_matrix_count;
534
473
  }
535
474
 
536
475
  /**
@@ -594,7 +533,7 @@ export class GPUAnimationManager {
594
533
  * Read back a skin's record from the database's CPU shadow.
595
534
  *
596
535
  * @param {number} skin_id
597
- * @returns {{joint_block_head: number, joint_count: number}}
536
+ * @returns {{joints_first: number, joint_count: number}}
598
537
  */
599
538
  get_skin(skin_id) {
600
539
  assert.isNonNegativeInteger(skin_id, 'skin_id');
@@ -602,30 +541,32 @@ export class GPUAnimationManager {
602
541
  }
603
542
 
604
543
  /**
605
- * Base address of the skin's matrix range in the shared
544
+ * Base address of the skin's matrices in the shared
606
545
  * `skin_matrices` scratch buffer — matrix `j` of the skin lives
607
- * at `skin_matrices[get_skin_matrix_offset(skin_id) + j]`.
546
+ * at `skin_matrices[get_skin_matrix_offset(skin_id) + j]`. A joint's
547
+ * matrix sits at the joint's row, so this is the skin's first joint
548
+ * row, read from its record — one word of it, not the record.
608
549
  *
609
- * Tracked CPU-side rather than on the skin record because the
610
- * value is only ever consumed by the skinning-binding upload
611
- * path; the prep shader uses the per-block absolute offset
612
- * (cheaper than a per-thread skin lookup for that hot path).
550
+ * A run never moves once handed out, so the offset holds for as long
551
+ * as the skin is registered; the skinning context reads it only when
552
+ * its bindings change.
613
553
  *
614
554
  * @param {number} skin_id
615
555
  * @returns {number}
616
556
  */
617
557
  get_skin_matrix_offset(skin_id) {
618
558
  assert.isNonNegativeInteger(skin_id, 'skin_id');
619
- const offset = this.#skin_matrix_offsets.get(skin_id);
620
- assert.defined(offset, `unknown skin_id ${skin_id}`);
621
- return offset;
559
+
560
+ const joints_first = this.#database.get('animation_skins').get_word(skin_id, SKIN_JOINTS_FIRST_WORD);
561
+
562
+ assert.defined(joints_first, `unknown skin_id ${skin_id}`);
563
+
564
+ return joints_first;
622
565
  }
623
566
 
624
567
  /**
625
- * Add an animation curve. Keyframes are split into linked-list blocks
626
- * of up to {@link KEYFRAMES_PER_BLOCK} entries each; the curve header
627
- * points at the head block, and each block's `next` field chains
628
- * forward.
568
+ * Add an animation curve. Its keyframes go into `animation_keyframes` as one run of rows, in
569
+ * order, and the curve's header names the run.
629
570
  *
630
571
  * The curve is a cubic Hermite spline — step, linear, and arbitrary
631
572
  * cubic shapes are all expressible by choosing tangents on each keyframe.
@@ -639,25 +580,13 @@ export class GPUAnimationManager {
639
580
  assert.greaterThanOrEqual(curve.length, 1, 'curve must have at least one keyframe');
640
581
 
641
582
  const keys = curve.keys;
642
- const blocks_table = this.#database.get('animation_keyframe_blocks');
643
-
644
- const head_block_id = add_linked_chain(
645
- blocks_table,
646
- keys,
647
- KEYFRAMES_PER_BLOCK,
648
- (start, count, next) => {
649
- const keyframes = new Array(KEYFRAMES_PER_BLOCK);
650
- for (let j = 0; j < KEYFRAMES_PER_BLOCK; j++) {
651
- keyframes[j] = j < count ? keys[start + j] : ZERO_KEYFRAME;
652
- }
653
- return { keyframes, count, next };
654
- }
655
- );
583
+
584
+ const keyframes_first = this.#database.get('animation_keyframes').add_run_records(keys, KEYFRAME_WRITER);
656
585
 
657
586
  const curves_table = this.#database.get('animation_curves');
658
587
  return curves_table.add({
659
588
  kind: 0,
660
- keyframe_block_head: head_block_id,
589
+ keyframes_first,
661
590
  keyframe_count: keys.length,
662
591
  time_min: curve.start_time,
663
592
  time_max: curve.end_time,
@@ -695,11 +624,12 @@ export class GPUAnimationManager {
695
624
 
696
625
  assert.notEqual(mask, 0, 'track must have at least one channel');
697
626
 
627
+ // a lane with its mask bit clear names no curve
698
628
  const curves = [
699
- cx ?? 0,
700
- cy ?? 0,
701
- cz ?? 0,
702
- cw ?? 0,
629
+ cx ?? GPU_DATABASE_NULL,
630
+ cy ?? GPU_DATABASE_NULL,
631
+ cz ?? GPU_DATABASE_NULL,
632
+ cw ?? GPU_DATABASE_NULL,
703
633
  ];
704
634
 
705
635
  const table = this.#database.get('animation_tracks');
@@ -708,11 +638,9 @@ export class GPUAnimationManager {
708
638
 
709
639
  /**
710
640
  * Create a bound clip — a group of bound tracks that share a single
711
- * `time`. Bindings are split into linked-list group nodes of up to
712
- * {@link TRACKS_PER_GROUP_NODE} each; the clip points at the head
713
- * node and each node back-references the clip so the apply shader
714
- * (one thread per group node) can fetch the clip without walking the
715
- * chain from the clip end.
641
+ * `time`. The bindings go into `animation_bindings` as one run of
642
+ * rows, each naming the clip, so the apply shader (one thread per
643
+ * binding) fetches the clip's time from the binding alone.
716
644
  *
717
645
  * Tracks may be authored on a clock that doesn't align with
718
646
  * `[time_start, time_end]` — their curves are clamped to their own
@@ -741,90 +669,62 @@ export class GPUAnimationManager {
741
669
  const time_end = clip.time_end ?? 0;
742
670
  const bindings = clip.bindings;
743
671
 
744
- const clips_table = this.#database.get('animation_clips');
745
- const groups_table = this.#database.get('animation_bound_track_groups');
746
-
747
- // Reserve the clip slot up front so group nodes can back-reference
748
- // it via `clip`. The head pointer is patched in once the chain is
749
- // built (we don't know its first id until we've allocated every
750
- // group node).
751
- const clip_id = clips_table.add({
672
+ // Reserve the clip row first, so every binding can name it. The range is filled in once
673
+ // the run exists.
674
+ const clip_id = this.#database.get('animation_clips').add({
752
675
  time,
753
676
  time_start,
754
677
  time_end,
755
- bound_track_group_head: ANIMATION_BOUND_TRACK_GROUP_NULL,
678
+ bindings_first: GPU_DATABASE_NULL,
679
+ bindings_count: 0,
756
680
  playback_rate: 1,
757
681
  flags: 0,
758
682
  playback_weight: 1,
759
683
  });
760
684
 
761
- const head_group_id = add_linked_chain(
762
- groups_table,
763
- bindings,
764
- TRACKS_PER_GROUP_NODE,
765
- (start, count, next) => {
766
- const inline_bindings = new Array(TRACKS_PER_GROUP_NODE);
767
- for (let j = 0; j < TRACKS_PER_GROUP_NODE; j++) {
768
- if (j < count) {
769
- const b = bindings[start + j];
770
-
771
- assert.isNonNegativeInteger(b.track, `clip.bindings[${start + j}].track`);
772
- assert.isNonNegativeInteger(b.instance, `clip.bindings[${start + j}].instance`);
773
- assert.isNonNegativeInteger(b.property, `clip.bindings[${start + j}].property`);
774
-
775
- inline_bindings[j] = b;
776
- } else {
777
- inline_bindings[j] = ZERO_BINDING;
778
- }
779
- }
780
- return { bindings: inline_bindings, count, next, clip: clip_id };
781
- }
782
- );
685
+ const rows = new Array(bindings.length);
783
686
 
784
- // Patch the head pointer now that the chain exists. Re-`set` the
785
- // whole record because the table API doesn't expose per-field
786
- // updates.
787
- clips_table.set(clip_id, {
788
- time,
789
- time_start,
790
- time_end,
791
- bound_track_group_head: head_group_id,
792
- playback_rate: 1,
793
- flags: 0,
794
- playback_weight: 1,
795
- });
687
+ for (let i = 0; i < bindings.length; i++) {
688
+ const b = bindings[i];
689
+
690
+ assert.isNonNegativeInteger(b.track, `clip.bindings[${i}].track`);
691
+ assert.isNonNegativeInteger(b.instance, `clip.bindings[${i}].instance`);
692
+ assert.isNonNegativeInteger(b.property, `clip.bindings[${i}].property`);
693
+
694
+ rows[i] = { track: b.track, instance: b.instance, property: b.property, clip: clip_id };
695
+ }
696
+
697
+ const bindings_first = this.#database.get('animation_bindings').add_run_records(rows, BINDING_WRITER);
698
+
699
+ this.#write_clip(clip_id, { bindings_first, bindings_count: rows.length }, CLIP_BINDINGS_WRITER);
796
700
 
797
701
  return clip_id;
798
702
  }
799
703
 
800
704
  /**
801
- * Overwrite a single field of a clip's record by reading the current
802
- * record back from the CPU shadow and re-`set`ting with one field
803
- * changed. The table API doesn't expose per-field updates, so we
804
- * round-trip through a full record; the upload-buffer dedupe
805
- * collapses the resulting per-frame write into a single GPU touch
806
- * when nothing else changed.
705
+ * Write the fields of a clip's record that `writer` owns, on the CPU shadow and on the GPU, and
706
+ * nothing else: the rest of the record — a playing clip's `time` above all, which the GPU tick
707
+ * advances where the shadow never sees it — stays as the GPU has it.
807
708
  *
808
709
  * @param {number} clip_id
809
- * @param {string} field
810
- * @param {number} value
710
+ * @param {Object<string, number>} value the fields the writer owns
711
+ * @param {GPURecordWriter} writer one of the clip field writers above
811
712
  */
812
- #patch_clip_field(clip_id, field, value) {
713
+ #write_clip(clip_id, value, writer) {
813
714
  assert.isNonNegativeInteger(clip_id, 'clip_id');
814
715
 
815
- const clips_table = this.#database.get('animation_clips');
816
- const current = clips_table.get(clip_id);
817
-
818
- clips_table.set(clip_id, {
819
- time: current.time,
820
- time_start: current.time_start,
821
- time_end: current.time_end,
822
- bound_track_group_head: current.bound_track_group_head,
823
- playback_rate: current.playback_rate,
824
- flags: current.flags,
825
- playback_weight: current.playback_weight,
826
- [field]: value,
827
- });
716
+ this.#database.get('animation_clips').set_fields(clip_id, value, writer);
717
+ }
718
+
719
+ /**
720
+ * A clip's flags as the CPU last wrote them. Only the host changes them, so the shadow's are the
721
+ * GPU's.
722
+ *
723
+ * @param {number} clip_id
724
+ * @returns {number}
725
+ */
726
+ #clip_flags(clip_id) {
727
+ return this.#database.get('animation_clips').get_word(clip_id, CLIP_FLAGS_WORD);
828
728
  }
829
729
 
830
730
  /**
@@ -847,7 +747,7 @@ export class GPUAnimationManager {
847
747
  */
848
748
  set_time(clip_id, time) {
849
749
  assert.isNumber(time, 'time');
850
- this.#patch_clip_field(clip_id, 'time', time);
750
+ this.#write_clip(clip_id, { time }, CLIP_TIME_WRITER);
851
751
 
852
752
  const shadow = this.#playback_by_clip.get(clip_id);
853
753
 
@@ -867,7 +767,7 @@ export class GPUAnimationManager {
867
767
  */
868
768
  set_playback_rate(clip_id, rate) {
869
769
  assert.isNumber(rate, 'rate');
870
- this.#patch_clip_field(clip_id, 'playback_rate', rate);
770
+ this.#write_clip(clip_id, { playback_rate: rate }, CLIP_PLAYBACK_RATE_WRITER);
871
771
  }
872
772
 
873
773
  /**
@@ -887,7 +787,7 @@ export class GPUAnimationManager {
887
787
  */
888
788
  set_playback_weight(clip_id, weight) {
889
789
  assert.isNumber(weight, 'weight');
890
- this.#patch_clip_field(clip_id, 'playback_weight', weight);
790
+ this.#write_clip(clip_id, { playback_weight: weight }, CLIP_PLAYBACK_WEIGHT_WRITER);
891
791
 
892
792
  const shadow = this.#playback_by_clip.get(clip_id);
893
793
 
@@ -916,10 +816,7 @@ export class GPUAnimationManager {
916
816
  set_flags(clip_id, flags) {
917
817
  assert.isNonNegativeInteger(flags, 'flags');
918
818
 
919
- const clips_table = this.#database.get('animation_clips');
920
- const current = clips_table.get(clip_id);
921
-
922
- this.#patch_clip_field(clip_id, 'flags', current.flags | flags);
819
+ this.#write_clip(clip_id, { flags: this.#clip_flags(clip_id) | flags }, CLIP_FLAGS_WRITER);
923
820
  }
924
821
 
925
822
  /**
@@ -933,10 +830,7 @@ export class GPUAnimationManager {
933
830
  clear_flags(clip_id, flags) {
934
831
  assert.isNonNegativeInteger(flags, 'flags');
935
832
 
936
- const clips_table = this.#database.get('animation_clips');
937
- const current = clips_table.get(clip_id);
938
-
939
- this.#patch_clip_field(clip_id, 'flags', current.flags & ~flags);
833
+ this.#write_clip(clip_id, { flags: this.#clip_flags(clip_id) & ~flags }, CLIP_FLAGS_WRITER);
940
834
  }
941
835
 
942
836
  /**
@@ -954,10 +848,7 @@ export class GPUAnimationManager {
954
848
  start(clip_id) {
955
849
  assert.isNonNegativeInteger(clip_id, 'clip_id');
956
850
 
957
- const clips_table = this.#database.get('animation_clips');
958
- const current = clips_table.get(clip_id);
959
-
960
- this.#patch_clip_field(clip_id, 'flags', current.flags | AnimationClipFlags.Playing);
851
+ this.#write_clip(clip_id, { flags: this.#clip_flags(clip_id) | AnimationClipFlags.Playing }, CLIP_FLAGS_WRITER);
961
852
  }
962
853
 
963
854
  /**
@@ -973,20 +864,18 @@ export class GPUAnimationManager {
973
864
  stop(clip_id) {
974
865
  assert.isNonNegativeInteger(clip_id, 'clip_id');
975
866
 
976
- const clips_table = this.#database.get('animation_clips');
977
- const current = clips_table.get(clip_id);
978
-
979
- this.#patch_clip_field(clip_id, 'flags', current.flags & ~AnimationClipFlags.Playing);
867
+ this.#write_clip(clip_id, { flags: this.#clip_flags(clip_id) & ~AnimationClipFlags.Playing }, CLIP_FLAGS_WRITER);
980
868
  }
981
869
 
982
870
  /**
983
871
  * Register a skin: an ordered list of joints, each pinning a
984
872
  * Node3D row that drives the joint plus the inverse-bind matrix
985
873
  * that takes vertex positions from mesh space into the joint's
986
- * bind-pose local space. The skin reserves a contiguous range of
987
- * `joints.length` matrices in the {@link #skin_matrices_buffer}
988
- * scratch buffer; the prep pass populates that range each frame
989
- * with `node.global × inverse_bind` for every joint.
874
+ * bind-pose local space. The joints go into `animation_skin_joints`
875
+ * as one run of rows, and a joint's matrix in the
876
+ * {@link #skin_matrices_buffer} scratch buffer sits at its row — so the
877
+ * skin's matrices are the same run of the buffer, which the prep pass
878
+ * fills each frame with `node.global × inverse_bind` for every joint.
990
879
  *
991
880
  * The skin record carries no mesh-world factor. The rasterizer
992
881
  * applies `mesh.transform_global` to the skinned clone vertex
@@ -996,13 +885,6 @@ export class GPUAnimationManager {
996
885
  * double-cancel against that re-application and shrink the rig
997
886
  * back to mesh-local coordinates rendered as world.
998
887
  *
999
- * Joints are split into linked-list blocks of up to
1000
- * {@link JOINTS_PER_SKIN_BLOCK} each — same chain pattern used for
1001
- * bound-track groups and keyframe blocks. Each block records the
1002
- * absolute write offset for its slots, so the prep shader's
1003
- * per-thread work is one block load + a bounded inner loop with no
1004
- * indirection back through the skin record.
1005
- *
1006
888
  * @param {{
1007
889
  * joints: Array<{ node: number, inverse_bind: Float32Array | number[] }>,
1008
890
  * }} skin
@@ -1014,64 +896,21 @@ export class GPUAnimationManager {
1014
896
  assert.greaterThanOrEqual(skin.joints.length, 1, 'skin must have at least one joint');
1015
897
 
1016
898
  const joints = skin.joints;
1017
- const joint_count = joints.length;
1018
899
 
1019
- // Reserve the matrix range. Each block bakes in its absolute
1020
- // slot offset (skin_base + chain_position * JOINTS_PER_SKIN_BLOCK)
1021
- // so the prep shader writes directly without dereferencing
1022
- // the skin row for the offset; the base is also stashed on
1023
- // the CPU map so the skinning-binding upload can look it up
1024
- // without reading the GPU back.
1025
- const skin_matrix_offset = this.#allocate_skin_matrix_range(joint_count);
900
+ for (let i = 0; i < joints.length; i++) {
901
+ // named now: a joint whose node comes later is register_skin's, which binds no mesh
902
+ // until it has come
903
+ assert.isNonNegativeInteger(joints[i].node, `skin.joints[${i}].node`);
904
+ assert.notEqual(joints[i].node, GPU_DATABASE_NULL, `skin.joints[${i}].node`);
905
+ assert.defined(joints[i].inverse_bind, `skin.joints[${i}].inverse_bind`);
906
+ }
1026
907
 
1027
- const skins_table = this.#database.get('animation_skins');
1028
- const blocks_table = this.#database.get('animation_skin_joint_blocks');
1029
-
1030
- // Reserve the skin row up front. The head pointer is patched
1031
- // in once the chain exists. NULL placeholder — 0 is a valid
1032
- // block row id (the first allocation in an empty table).
1033
- const skin_id = skins_table.add({
1034
- joint_block_head: ANIMATION_SKIN_JOINT_BLOCK_NULL,
1035
- joint_count,
1036
- });
1037
- this.#skin_matrix_offsets.set(skin_id, skin_matrix_offset);
1038
-
1039
- const head_block_id = add_linked_chain(
1040
- blocks_table,
1041
- joints,
1042
- JOINTS_PER_SKIN_BLOCK,
1043
- (start, count, next) => {
1044
- const inline_joints = new Array(JOINTS_PER_SKIN_BLOCK);
1045
- for (let j = 0; j < JOINTS_PER_SKIN_BLOCK; j++) {
1046
- if (j < count) {
1047
- const joint = joints[start + j];
1048
-
1049
- assert.isNonNegativeInteger(joint.node, `skin.joints[${start + j}].node`);
1050
- assert.defined(joint.inverse_bind, `skin.joints[${start + j}].inverse_bind`);
1051
-
1052
- inline_joints[j] = joint;
1053
- } else {
1054
- inline_joints[j] = ZERO_SKIN_JOINT;
1055
- }
1056
- }
1057
- return {
1058
- joints: inline_joints,
1059
- count,
1060
- next,
1061
- skin_matrix_offset: skin_matrix_offset + start,
1062
- };
1063
- }
1064
- );
908
+ const joints_first = this.#add_joints(joints);
1065
909
 
1066
- // Patch the head pointer now that the chain exists. Re-`set`
1067
- // the whole record because the table API doesn't expose
1068
- // per-field updates.
1069
- skins_table.set(skin_id, {
1070
- joint_block_head: head_block_id,
1071
- joint_count,
910
+ return this.#database.get('animation_skins').add({
911
+ joints_first,
912
+ joint_count: joints.length,
1072
913
  });
1073
-
1074
- return skin_id;
1075
914
  }
1076
915
 
1077
916
  /**
@@ -1079,12 +918,12 @@ export class GPUAnimationManager {
1079
918
  * **entities**, allocates a GPU skin record, and binds every mesh entity through the
1080
919
  * skinning context.
1081
920
  *
1082
- * **Eventual consistency.** The `skin_id` is allocated and returned synchronously — callers
1083
- * can immediately pass it to state mutators or {@link unregister_skin}. If any joint has not
1084
- * taken its row yet (see `GPUSceneRows.acquire`), the joint-block chain that drives the
1085
- * deformation is queued and built on the next {@link update} that sees every joint there.
1086
- * The skin's table row uses a placeholder `joint_block_head` until then — observationally
1087
- * indistinguishable from "skin with no joints driving it" (no deformation runs).
921
+ * **Eventual consistency.** The `skin_id` is allocated and returned synchronously, and the
922
+ * skin's joints take their rows at once, so {@link get_skin_matrix_offset} and
923
+ * {@link unregister_skin} work from here on. If any joint's entity has not taken its
924
+ * transforms row yet (see `GPUSceneRows.acquire`), the joints name no node, and the meshes
925
+ * are not bound, until the next {@link update} that sees every joint there. Until then the
926
+ * skin's matrices are not written, and its meshes draw undeformed, as they were modelled.
1088
927
  *
1089
928
  * The frame a skin's meshes are deformed in is the prefab's business, fixed once at compile
1090
929
  * (`prefab_normalize_skin_frames`); nothing about it is decided here.
@@ -1095,128 +934,129 @@ export class GPUAnimationManager {
1095
934
  register_skin(skin) {
1096
935
  assert.defined(skin, 'skin');
1097
936
  assert.equal(skin.isSkin, true, 'skin.isSkin !== true');
937
+ assert.greaterThanOrEqual(skin.joints.length, 1, 'skin must have at least one joint');
1098
938
  assert.greaterThanOrEqual(skin.meshes.length, 1, 'skin.meshes must contain at least one mesh');
1099
939
 
940
+ for (let i = 0; i < skin.meshes.length; i++) {
941
+ assert.isNonNegativeInteger(skin.meshes[i], `skin.meshes[${i}]`);
942
+ }
943
+
944
+ const complete = this.#joint_rows_ready(skin);
945
+
946
+ // The joints take their rows now, named nodes and all if every joint is there already.
947
+ const joints_first = this.#add_joints(this.#skin_joints(skin, complete));
1100
948
  const joint_count = skin.joints.length;
1101
- const inverse_bind_matrices = skin.inverse_bind_matrices;
1102
949
 
1103
- // Reserve the matrix range up front — block records carry
1104
- // their absolute slot offset, so the prep shader writes
1105
- // directly. The base also lands on #skin_matrix_offsets so
1106
- // skinning-binding upload can look it up.
1107
- const skin_matrix_offset = this.#allocate_skin_matrix_range(joint_count);
1108
-
1109
- // Reserve the skin row immediately with a placeholder head
1110
- // pointer. State mutators and the public id are usable from
1111
- // this point on; the joint chain gets patched in once
1112
- // every joint has its row (possibly synchronously below,
1113
- // possibly deferred via the pending queue).
1114
- const skins_table = this.#database.get('animation_skins');
1115
- const skin_id = skins_table.add({
1116
- // NULL placeholder — 0 is a valid block row id
1117
- joint_block_head: ANIMATION_SKIN_JOINT_BLOCK_NULL,
1118
- joint_count,
1119
- });
1120
- this.#skin_matrix_offsets.set(skin_id, skin_matrix_offset);
950
+ const skin_id = this.#database.get('animation_skins').add({ joints_first, joint_count });
951
+
952
+ if (complete) {
953
+ this.#bind_meshes(skin, skin_id);
954
+ } else {
955
+ // the next update() that sees every joint's row names the nodes and binds the meshes
956
+ this.#pending_skins.push({ skin_id, skin, joints_first, joint_count });
957
+ }
958
+
959
+ return skin_id;
960
+ }
1121
961
 
1122
- // Bind every mesh entity into the skinning context. The clone a binding deforms is made
1123
- // when the entity's mesh row is written — before or after this — and the binding follows.
962
+ /**
963
+ * Bind every mesh entity of `skin` into the skinning context. The clone a binding deforms is
964
+ * made when the entity's mesh row is written — before or after this — and the binding
965
+ * follows.
966
+ *
967
+ * @param {Skin} skin
968
+ * @param {number} skin_id
969
+ */
970
+ #bind_meshes(skin, skin_id) {
1124
971
  const skinning = this.#scene_context.skinning;
1125
972
  const meshes = skin.meshes;
1126
- for (let i = 0; i < meshes.length; i++) {
1127
- assert.isNonNegativeInteger(meshes[i], `skin.meshes[${i}]`);
1128
973
 
974
+ for (let i = 0; i < meshes.length; i++) {
1129
975
  skinning.bind(meshes[i], skin_id);
1130
976
  }
1131
-
1132
- // Try to complete now. If every joint has its row, the chain gets built and patched in.
1133
- // Otherwise the skin lands on #pending_skins and the next update() drain retries.
1134
- const pending = {
1135
- skin_id,
1136
- skin,
1137
- skin_matrix_offset,
1138
- inverse_bind_matrices,
1139
- };
1140
- if (!this.#try_complete_skin(pending)) {
1141
- this.#pending_skins.push(pending);
1142
- }
1143
-
1144
- return skin_id;
1145
977
  }
1146
978
 
1147
979
  /**
1148
- * Attempt to build the joint-block chain for a pending skin and
1149
- * patch its head pointer onto the skin row. Returns `true` when
1150
- * every joint entity holds its transforms row (and the chain was
1151
- * built); `false` when at least one joint has not taken it yet.
980
+ * Whether every joint entity of `skin` holds its transforms row. All or nothing: a skin
981
+ * whose joints were only partly named would deform with some of its matrices missing.
1152
982
  *
1153
- * @param {{
1154
- * skin_id: number,
1155
- * skin: Skin,
1156
- * skin_matrix_offset: number,
1157
- * inverse_bind_matrices: Float32Array,
1158
- * }} pending
983
+ * @param {Skin} skin
1159
984
  * @returns {boolean}
1160
985
  */
1161
- #try_complete_skin(pending) {
986
+ #joint_rows_ready(skin) {
1162
987
  const rows = this.#scene_context.rows;
1163
- const joint_nodes = pending.skin.joints;
1164
- const joint_count = joint_nodes.length;
1165
- const inverse_bind_matrices = pending.inverse_bind_matrices;
1166
- const skin_matrix_offset = pending.skin_matrix_offset;
1167
- const skin_id = pending.skin_id;
988
+ const joints = skin.joints;
1168
989
 
1169
- // All-or-nothing: a single missing row leaves the chain
1170
- // unbuilt — partial chains aren't valid (the prep shader
1171
- // walks every block).
1172
- const joints = new Array(joint_count);
1173
- for (let i = 0; i < joint_count; i++) {
1174
- const joint = joint_nodes[i];
990
+ for (let i = 0; i < joints.length; i++) {
991
+ assert.isNonNegativeInteger(joints[i], `skin.joints[${i}]`);
1175
992
 
1176
- assert.isNonNegativeInteger(joint, `skin.joints[${i}]`);
993
+ if (!rows.has(joints[i])) {
994
+ return false;
995
+ }
996
+ }
1177
997
 
1178
- if (!rows.has(joint)) return false;
998
+ return true;
999
+ }
1000
+
1001
+ /**
1002
+ * The joint records of `skin`: each joint's inverse bind, and its node — the joint entity's
1003
+ * transforms row when `with_nodes`, {@link GPU_DATABASE_NULL} otherwise.
1004
+ *
1005
+ * @param {Skin} skin
1006
+ * @param {boolean} with_nodes
1007
+ * @returns {Array<{node: number, inverse_bind: Float32Array}>}
1008
+ */
1009
+ #skin_joints(skin, with_nodes) {
1010
+ const entities = skin.joints;
1011
+ const inverse_bind_matrices = skin.inverse_bind_matrices;
1012
+ const joints = new Array(entities.length);
1179
1013
 
1014
+ for (let i = 0; i < entities.length; i++) {
1180
1015
  joints[i] = {
1181
- node: row_of_entity(joint),
1182
- // Per-joint slice of the flat matrix array. The
1183
- // marshaller copies these bytes into the skin-joint
1184
- // block record; sub-array views are fine — they
1185
- // share the underlying buffer but write_struct_value
1186
- // reads by length, not by offset.
1016
+ node: with_nodes ? row_of_entity(entities[i]) : GPU_DATABASE_NULL,
1017
+ // Per-joint slice of the flat matrix array. Sub-array views are fine — they share
1018
+ // the underlying buffer, but the marshaller reads by length, not by offset.
1187
1019
  inverse_bind: inverse_bind_matrices.subarray(i * 16, (i + 1) * 16),
1188
1020
  };
1189
1021
  }
1190
1022
 
1191
- const blocks_table = this.#database.get('animation_skin_joint_blocks');
1192
- const head_block_id = add_linked_chain(
1193
- blocks_table,
1194
- joints,
1195
- JOINTS_PER_SKIN_BLOCK,
1196
- (start, count, next) => {
1197
- const inline_joints = new Array(JOINTS_PER_SKIN_BLOCK);
1198
- for (let j = 0; j < JOINTS_PER_SKIN_BLOCK; j++) {
1199
- inline_joints[j] = j < count ? joints[start + j] : ZERO_SKIN_JOINT;
1200
- }
1201
- return {
1202
- joints: inline_joints,
1203
- count,
1204
- next,
1205
- skin_matrix_offset: skin_matrix_offset + start,
1206
- };
1207
- }
1208
- );
1023
+ return joints;
1024
+ }
1209
1025
 
1210
- // Patch the head pointer onto the already-allocated skin
1211
- // row. Read-modify-write so any other fields the user might
1212
- // have changed via mutators (none today, but future-proof)
1213
- // are preserved.
1214
- const skins_table = this.#database.get('animation_skins');
1215
- const current = skins_table.get(skin_id);
1216
- skins_table.set(skin_id, {
1217
- joint_block_head: head_block_id,
1218
- joint_count: current.joint_count,
1219
- });
1026
+ /**
1027
+ * Name the nodes of a pending skin's joints, once every joint entity holds its transforms row,
1028
+ * and bind its meshes. Returns `true` when it did; `false` when at least one joint has not
1029
+ * taken its row yet.
1030
+ *
1031
+ * Only each joint's `node` is written, and only that word is uploaded: the inverse bind went
1032
+ * in at registration.
1033
+ *
1034
+ * @param {{skin_id: number, skin: Skin, joints_first: number, joint_count: number}} pending
1035
+ * @returns {boolean}
1036
+ */
1037
+ #try_complete_skin(pending) {
1038
+ const skin = pending.skin;
1039
+
1040
+ if (!this.#joint_rows_ready(skin)) {
1041
+ return false;
1042
+ }
1043
+
1044
+ const joints_table = this.#database.get('animation_skin_joints');
1045
+ const entities = skin.joints;
1046
+
1047
+ // the run was cut to the skin as it registered; a joint added since has no row in it
1048
+ assert.equal(entities.length, pending.joint_count, 'skin.joints changed after register_skin');
1049
+
1050
+ for (let i = 0; i < entities.length; i++) {
1051
+ joints_table.set_fields(pending.joints_first + i, { node: row_of_entity(entities[i]) }, SKIN_JOINT_NODE_WRITER);
1052
+ }
1053
+
1054
+ this.#bind_meshes(skin, pending.skin_id);
1055
+
1056
+ // The joints' matrices are written from the next prep on, and "previous" over their rows
1057
+ // holds whatever was there before — zeros, or the last pose of a skin that had them — so
1058
+ // it is seeded, as it is for a run just handed out.
1059
+ this.#first_frame_skin_matrices = true;
1220
1060
 
1221
1061
  return true;
1222
1062
  }
@@ -1228,14 +1068,14 @@ export class GPUAnimationManager {
1228
1068
  * **Eventual consistency.** The `clip_id` is allocated and returned synchronously — callers
1229
1069
  * can immediately call {@link start} / {@link stop} / {@link set_time} / {@link set_playback_rate}
1230
1070
  * / {@link set_flags} / {@link clear_flags} / {@link set_playback_weight} /
1231
- * {@link unregister_clip}. If any target has not taken its row yet, the bindings chain that
1232
- * drives the apply pass is queued and built on the next {@link update} that sees every target
1233
- * there. The clip's table row uses a placeholder `bound_track_group_head` until then — apply
1234
- * produces no contributions, so the clip is observationally inert (still subject to time
1235
- * advancement via the tick shader if `Playing` is set).
1236
- *
1237
- * **Binding is what hands a target to the GPU.** When the chain is built, every entity it
1238
- * drives has its `GPUStateAuthority` TransformAttachment bit granted, so the CPU stops
1071
+ * {@link unregister_clip}. If any target has not taken its row yet, the bindings that drive
1072
+ * the apply pass are queued and added on the next {@link update} that sees every target there.
1073
+ * The clip's table row holds an empty range until then — apply produces no contributions, so
1074
+ * the clip is observationally inert (still subject to time advancement via the tick shader if
1075
+ * `Playing` is set).
1076
+ *
1077
+ * **Binding is what hands a target to the GPU.** When the bindings are added, every entity
1078
+ * they drive has its `GPUStateAuthority` TransformAttachment bit granted, so the CPU stops
1239
1079
  * writing its local TRS; the last clip to leave revokes it. The entity has to have declared
1240
1080
  * the component — a prefab does, on every node a clip reaches — because a grant that could
1241
1081
  * silently do nothing would be a claim nobody could see.
@@ -1277,18 +1117,18 @@ export class GPUAnimationManager {
1277
1117
  };
1278
1118
  }
1279
1119
 
1280
- // Reserve the clip row immediately with a placeholder head
1281
- // pointer. State mutators and the public id are usable from
1282
- // this point on; the bindings chain gets patched in once
1283
- // every target has its row. `time` defaults to 0 (the
1284
- // playback offset relative to `time_start`; the apply
1285
- // shader does `effective_time = clip.time + clip.time_start`).
1120
+ // Reserve the clip row immediately with an empty range. State
1121
+ // mutators and the public id are usable from this point on; the
1122
+ // bindings get added once every target has its row. `time`
1123
+ // defaults to 0 (the playback offset relative to `time_start`;
1124
+ // the apply shader does `effective_time = clip.time + clip.time_start`).
1286
1125
  const clips_table = this.#database.get('animation_clips');
1287
1126
  const clip_id = clips_table.add({
1288
1127
  time: 0,
1289
1128
  time_start: clip.start_time,
1290
1129
  time_end: clip.end_time,
1291
- bound_track_group_head: ANIMATION_BOUND_TRACK_GROUP_NULL,
1130
+ bindings_first: GPU_DATABASE_NULL,
1131
+ bindings_count: 0,
1292
1132
  playback_rate: 1,
1293
1133
  flags: 0,
1294
1134
  playback_weight: 1,
@@ -1305,10 +1145,10 @@ export class GPUAnimationManager {
1305
1145
  }
1306
1146
 
1307
1147
  /**
1308
- * Attempt to build the bindings chain for a pending clip and
1309
- * patch its head pointer onto the clip row. Returns `true` when
1310
- * every channel target holds its transforms row (and the chain
1311
- * was built); `false` when at least one has not taken it yet.
1148
+ * Attempt to add the bindings of a pending clip and name them in
1149
+ * the clip's range. Returns `true` when every channel target holds
1150
+ * its transforms row (and the bindings were added); `false` when at
1151
+ * least one has not taken it yet.
1312
1152
  *
1313
1153
  * Completing is also when the targets are handed to the GPU — see {@link register_clip}.
1314
1154
  *
@@ -1336,28 +1176,15 @@ export class GPUAnimationManager {
1336
1176
  track: ch.track,
1337
1177
  instance: row_of_entity(target),
1338
1178
  property: ch.property,
1179
+ clip: clip_id,
1339
1180
  };
1340
1181
  }
1341
1182
 
1342
- const groups_table = this.#database.get('animation_bound_track_groups');
1343
- const head_group_id = add_linked_chain(
1344
- groups_table,
1345
- bindings,
1346
- TRACKS_PER_GROUP_NODE,
1347
- (start, count, next) => {
1348
- const inline_bindings = new Array(TRACKS_PER_GROUP_NODE);
1349
- for (let j = 0; j < TRACKS_PER_GROUP_NODE; j++) {
1350
- inline_bindings[j] = j < count ? bindings[start + j] : ZERO_BINDING;
1351
- }
1352
- return { bindings: inline_bindings, count, next, clip: clip_id };
1353
- }
1354
- );
1183
+ const bindings_first = this.#database.get('animation_bindings').add_run_records(bindings, BINDING_WRITER);
1355
1184
 
1356
- // Patch the head pointer onto the already-allocated clip
1357
- // row. Read-modify-write preserves any user-driven state
1358
- // changes (set_time, set_flags, etc.) made between
1359
- // register_clip and the drain.
1360
- this.#patch_clip_field(clip_id, 'bound_track_group_head', head_group_id);
1185
+ // Name the run in the already-allocated clip row — the range's words alone, so neither
1186
+ // the host's changes since register_clip nor the time the GPU has advanced are touched.
1187
+ this.#write_clip(clip_id, { bindings_first, bindings_count: bindings.length }, CLIP_BINDINGS_WRITER);
1361
1188
 
1362
1189
  this.#take_targets(clip_id, channels);
1363
1190
 
@@ -1528,10 +1355,9 @@ export class GPUAnimationManager {
1528
1355
  }
1529
1356
 
1530
1357
  /**
1531
- * Drop a clip from the manager. Walks the bindings chain and
1532
- * removes every group-node + the clip row. Tolerates the clip
1533
- * still being pending (drains it from the queue without GPU
1534
- * touches besides the original row removal).
1358
+ * Drop a clip from the manager: its row, and with it the run of its bindings — the clip's range
1359
+ * owns the run, so the table removes it. Tolerates the clip still being pending (drains it from
1360
+ * the queue without GPU touches besides the original row removal).
1535
1361
  *
1536
1362
  * Curves and tracks the clip referenced stay alive — they're
1537
1363
  * shared via {@link #intern_curve} / {@link #intern_track} and
@@ -1539,7 +1365,7 @@ export class GPUAnimationManager {
1539
1365
  * reference-counting the manager doesn't carry.
1540
1366
  *
1541
1367
  * Safe to call repeatedly on the same id: the second call finds the row unoccupied and
1542
- * returns without walking anything.
1368
+ * returns without touching anything.
1543
1369
  *
1544
1370
  * @param {number} clip_id
1545
1371
  */
@@ -1557,27 +1383,13 @@ export class GPUAnimationManager {
1557
1383
  }
1558
1384
 
1559
1385
  const clips_table = this.#database.get('animation_clips');
1560
- const groups_table = this.#database.get('animation_bound_track_groups');
1561
1386
 
1562
- // Occupancy rather than `get` — see {@link unregister_skin}. A removed row reads back as
1563
- // zeros, and a zeroed `bound_track_group_head` is group 0, which the walk below would
1564
- // chase into itself forever.
1387
+ // Occupancy is what says the row is still this clip's; a second call finds it free and has
1388
+ // nothing to hand back twice.
1565
1389
  if (!clips_table.occupancy.get(clip_id)) return;
1566
1390
 
1567
- const clip_record = clips_table.get(clip_id);
1568
-
1569
- // Walk the bindings chain and remove every node. The chain
1570
- // may be empty (placeholder head NULL) if the clip is still
1571
- // pending or has been registered then drained but never
1572
- // completed; both cases skip the loop.
1573
- let block_id = clip_record.bound_track_group_head;
1574
- while (block_id !== ANIMATION_BOUND_TRACK_GROUP_NULL) {
1575
- const block = groups_table.get(block_id);
1576
- const next_id = block !== undefined ? block.next : ANIMATION_BOUND_TRACK_GROUP_NULL;
1577
- groups_table.remove(block_id);
1578
- block_id = next_id;
1579
- }
1580
-
1391
+ // The bindings go with the clip. A clip still pending holds an empty range and takes
1392
+ // nothing.
1581
1393
  clips_table.remove(clip_id);
1582
1394
 
1583
1395
  this.#release_targets(clip_id);
@@ -1586,18 +1398,18 @@ export class GPUAnimationManager {
1586
1398
  }
1587
1399
 
1588
1400
  /**
1589
- * Drop a skin from the manager. Walks the joint-block chain and
1590
- * removes every block + the skin row, and tears down every
1591
- * skinning binding pointing at this skin (so the skinning
1592
- * context doesn't try to read the now-freed skin's matrix
1593
- * offset on its next upload).
1401
+ * Drop a skin from the manager: its row, and with it the run of its joints — the skin's range
1402
+ * owns the run, so the table removes it — and every skinning binding pointing at this skin (so
1403
+ * the skinning context doesn't try to read the now-freed skin's matrix offset on its next
1404
+ * upload).
1594
1405
  *
1595
- * The skin's matrix range goes back on the free list, for the next skin with the same
1596
- * joint count to take as-is. A spawn/despawn loop over a fixed cast therefore costs
1597
- * what the cast costs, not what the loop has run.
1406
+ * The joints' rows, and the matrices at them, are free for the next skin that fits. A
1407
+ * respawn of the same rig fits the rows it left, and first fit takes them unless an earlier
1408
+ * hole fits too — so a spawn/despawn loop over a fixed cast costs what the cast costs, not
1409
+ * what the loop has run.
1598
1410
  *
1599
1411
  * Tolerates the skin still being pending. Safe to call repeatedly on the same id: the
1600
- * second call finds the row unoccupied and gives no range back twice.
1412
+ * second call finds the row unoccupied and removes nothing.
1601
1413
  *
1602
1414
  * @param {number} skin_id
1603
1415
  */
@@ -1617,47 +1429,15 @@ export class GPUAnimationManager {
1617
1429
  this.#scene_context.skinning.unbind_all_by_skin(skin_id);
1618
1430
 
1619
1431
  const skins_table = this.#database.get('animation_skins');
1620
- const blocks_table = this.#database.get('animation_skin_joint_blocks');
1621
1432
 
1622
- // Occupancy, not `get`, is what says the row is still this skin's. `remove` zero-fills a
1623
- // slot rather than dropping it and `get` reads those bytes back, so a second call would
1624
- // find a record whose `joint_block_head` is 0 — a valid block id, not the NULL sentinel —
1625
- // and the walk below would follow block 0 to block 0 for as long as the process lives.
1433
+ // Occupancy is what says the row is still this skin's; a second call finds it free and
1434
+ // removes nothing.
1626
1435
  if (!skins_table.occupancy.get(skin_id)) {
1627
- this.#skin_matrix_offsets.delete(skin_id);
1628
1436
  return;
1629
1437
  }
1630
1438
 
1631
- const skin_record = skins_table.get(skin_id);
1632
-
1633
- // Walk the joint-block chain, terminating on the NULL
1634
- // sentinel (also the placeholder for a not-yet-patched head).
1635
- // Note: 0 is a VALID block row id — the first single-block
1636
- // skin registered into an empty table gets head 0, and
1637
- // treating it as a placeholder would leak its block, leaving
1638
- // the prep shader processing it against a recycled
1639
- // transforms-table row every frame.
1640
- let block_id = skin_record.joint_block_head;
1641
- while (block_id !== ANIMATION_SKIN_JOINT_BLOCK_NULL) {
1642
- const block = blocks_table.get(block_id);
1643
- const next_id = block !== undefined ? block.next : ANIMATION_SKIN_JOINT_BLOCK_NULL;
1644
- blocks_table.remove(block_id);
1645
- block_id = next_id;
1646
- }
1647
-
1439
+ // The joints go with the skin — a pending skin's too, nodes or not.
1648
1440
  skins_table.remove(skin_id);
1649
-
1650
- // Give the matrix range back while the record that says how long it is still exists.
1651
- // Reaching here means the row was occupied, and a row is occupied only between the
1652
- // registration that set this offset and the delete below — the occupancy check at the
1653
- // top is what keeps a second call from handing the same base out twice.
1654
- const skin_matrix_offset = this.#skin_matrix_offsets.get(skin_id);
1655
-
1656
- assert.defined(skin_matrix_offset, `skin ${skin_id} holds a live row but no matrix offset`);
1657
-
1658
- this.#free_skin_matrix_range(skin_matrix_offset, skin_record.joint_count);
1659
-
1660
- this.#skin_matrix_offsets.delete(skin_id);
1661
1441
  }
1662
1442
 
1663
1443
  /**
@@ -1736,52 +1516,42 @@ export class GPUAnimationManager {
1736
1516
  }
1737
1517
 
1738
1518
  /**
1739
- * Reserve `joint_count` consecutive matrices and answer with the base index.
1519
+ * Put a skin's joints into `animation_skin_joints` as one run, and make sure the matrix
1520
+ * buffers reach its end — a joint's matrix sits at the joint's row.
1740
1521
  *
1741
- * A range of exactly that length that some skin has given back is preferred over fresh
1742
- * space, which is what keeps a spawn/despawn loop from growing the buffer — see
1743
- * {@link #free_skin_matrix_ranges} for why the match is exact and never split.
1744
- *
1745
- * @param {number} joint_count length of the range, in matrices
1746
- * @returns {number} base matrix index of the reserved range
1522
+ * @param {Array<{node: number, inverse_bind: Float32Array | number[]}>} joints
1523
+ * @returns {number} the run's first row
1747
1524
  */
1748
- #allocate_skin_matrix_range(joint_count) {
1749
- const reusable = this.#free_skin_matrix_ranges.get(joint_count);
1525
+ #add_joints(joints) {
1526
+ const joints_first = this.#database.get('animation_skin_joints').add_run_records(joints, SKIN_JOINT_WRITER);
1750
1527
 
1751
- if (reusable !== undefined && reusable.length > 0) {
1752
- // Already inside the buffer — it was sized for this range when it was first
1753
- // handed out, and the buffer only ever grows.
1754
- return reusable.pop();
1528
+ if (joints_first === GPU_DATABASE_NULL) {
1529
+ // no joints: the empty range, and no rows for the buffers to reach
1530
+ return joints_first;
1755
1531
  }
1756
1532
 
1757
- const skin_matrix_offset = this.#next_skin_matrix_offset;
1758
-
1759
- this.#next_skin_matrix_offset += joint_count;
1760
- this.#ensure_skin_matrices_capacity(this.#next_skin_matrix_offset);
1533
+ const end = joints_first + joints.length;
1761
1534
 
1762
- return skin_matrix_offset;
1763
- }
1764
-
1765
- /**
1766
- * Put a matrix range back on the free list.
1767
- *
1768
- * The bytes are left as they are: the prep pass rewrites every matrix of a live skin each
1769
- * frame, so what a dead skin left behind is only ever read by a pass that no longer has a
1770
- * block pointing at it.
1771
- *
1772
- * @param {number} skin_matrix_offset base matrix index of the range
1773
- * @param {number} joint_count length of the range, in matrices
1774
- */
1775
- #free_skin_matrix_range(skin_matrix_offset, joint_count) {
1776
- let bucket = this.#free_skin_matrix_ranges.get(joint_count);
1777
-
1778
- if (bucket === undefined) {
1779
- bucket = [];
1780
-
1781
- this.#free_skin_matrix_ranges.set(joint_count, bucket);
1535
+ if (end > this.#skin_matrix_count) {
1536
+ this.#skin_matrix_count = end;
1537
+ this.#ensure_skin_matrices_capacity(end);
1782
1538
  }
1783
1539
 
1784
- bucket.push(skin_matrix_offset);
1540
+ // A run that is being handed out has no meaningful history in the matrix buffers, whether
1541
+ // its rows are fresh or some despawned skin's, so the next prep dispatch has to seed
1542
+ // "previous" from "current" for it.
1543
+ //
1544
+ // This flag used to be set only inside #ensure_skin_matrices_capacity, i.e. only when the
1545
+ // buffer actually grew. Rows given back by another skin never grow the buffer, and fresh
1546
+ // rows below the current capacity hit that helper's early-out - so in both cases the
1547
+ // `previous` buffer over the run still held either all-zero matrices or the last pose of
1548
+ // the skin that had those rows before. The skinning pass reads
1549
+ // `prev_skin_matrices[skin_base + j]` unconditionally, so the new character's first frame
1550
+ // produced motion vectors from someone else's pose - a screen-crossing smear through TAA
1551
+ // and motion blur - on exactly the spawn/despawn loop that reuses rows.
1552
+ this.#first_frame_skin_matrices = true;
1553
+
1554
+ return joints_first;
1785
1555
  }
1786
1556
 
1787
1557
  /**
@@ -1825,18 +1595,16 @@ export class GPUAnimationManager {
1825
1595
  }
1826
1596
 
1827
1597
  /**
1828
- * Flush all pending uploads (curves, keyframe blocks, tracks, clips,
1829
- * bound-track groups, skins, skin joint blocks) into the GPU
1598
+ * Flush all pending uploads (curves, keyframes, tracks, clips,
1599
+ * bindings, skins, skin joints) into the GPU
1830
1600
  * database. Call once per frame, before any shader that reads from
1831
1601
  * `database.buffer`.
1832
1602
  *
1833
- * Also drains the pending-registration queues: skins and clips
1834
- * whose dependencies (joint rows, channel-target rows)
1835
- * weren't ready at register time get one shot per `update` to
1836
- * complete. Once every entity has taken its row, the
1837
- * deferred chain build runs and the registration becomes
1838
- * observationally complete — the next-frame `database.update`
1839
- * picks up the patched head pointer.
1603
+ * Drains the pending-registration queues first: skins and clips
1604
+ * whose dependencies (joint rows, channel-target rows) weren't
1605
+ * ready at register time get one shot per `update` to complete.
1606
+ * Once every entity has taken its row, the deferred build runs,
1607
+ * and this same call's `database.update` uploads what it wrote.
1840
1608
  *
1841
1609
  * Does not touch the skin-matrices ping-pong buffers — those
1842
1610
  * are scratch populated each frame by
@@ -1875,29 +1643,26 @@ export class GPUAnimationManager {
1875
1643
  * correct ping-pong behaviour across frames without leaking the
1876
1644
  * buffer-role bookkeeping into every caller.
1877
1645
  *
1878
- * No-op when no skins are registered (`group_count_x === 0`).
1646
+ * No-op when the joints table has no rows to walk
1647
+ * (`group_count_x === 0`).
1879
1648
  *
1880
1649
  * Per-frame ordering:
1881
- * 1. Flip {@link #skin_matrices_current_index} — the buffer that
1882
- * was last frame's "current" is about to be overwritten with
1883
- * this frame's matrices; the other buffer (last frame's prev)
1884
- * becomes this frame's "previous" implicit data source for
1885
- * {@link prev_skin_matrices_buffer}.
1886
- * 2. Wait — clarify: we want last frame's "current" to BECOME
1887
- * this frame's "previous". So flipping current_index moves
1888
- * the role tag the correct way: what was current[i] becomes
1889
- * previous (= buffers[1 - i]), and current[1 - i] is the
1890
- * write target.
1891
- * 3. Dispatch the prep shader into the new current.
1892
- * 4. On the very first frame (or after a grow), copy current →
1893
- * previous so the first velocity reads see matching matrices
1894
- * and produce zero velocity.
1650
+ * 1. Flip {@link #skin_matrices_current_index}: last frame's
1651
+ * "current" becomes this frame's "previous"
1652
+ * ({@link prev_skin_matrices_buffer}), and the buffer that
1653
+ * held the frame before it becomes the write target.
1654
+ * 2. Dispatch the prep shader into the new "current".
1655
+ * 3. If {@link #first_frame_skin_matrices} is set — a run handed
1656
+ * out, a pending skin's joints named, or the buffers grown
1657
+ * since the last dispatch — copy all of "current" over
1658
+ * "previous", so the first velocity read over those rows sees
1659
+ * matching matrices and produces zero velocity.
1895
1660
  *
1896
1661
  * @param {ShadeGPUCommandContext} cmd_ctx
1897
1662
  */
1898
1663
  dispatch_skin_matrix_prep(cmd_ctx) {
1899
1664
  const groups = this.#database
1900
- .get('animation_skin_joint_blocks')
1665
+ .get('animation_skin_joints')
1901
1666
  .dispatch_group_count(SKIN_MATRIX_PREP_WORKGROUP_SIZE);
1902
1667
  if (groups === 0) {
1903
1668
  return;
@@ -1982,7 +1747,7 @@ export class GPUAnimationManager {
1982
1747
 
1983
1748
  // Only clip evaluation is conditional. Every scene needs current globals.
1984
1749
  const apply_groups = this.#database
1985
- .get('animation_bound_track_groups')
1750
+ .get('animation_bindings')
1986
1751
  .dispatch_group_count(ANIMATION_APPLY_WORKGROUP_SIZE);
1987
1752
 
1988
1753
  if (apply_groups > 0) {