@vgpu/render 0.0.1

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 (426) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +55 -0
  3. package/dist/domain/camera.d.ts +10 -0
  4. package/dist/domain/camera.d.ts.map +1 -0
  5. package/dist/domain/camera.js +2 -0
  6. package/dist/domain/camera.js.map +1 -0
  7. package/dist/domain/capsule-data.d.ts +10 -0
  8. package/dist/domain/capsule-data.d.ts.map +1 -0
  9. package/dist/domain/capsule-data.js +61 -0
  10. package/dist/domain/capsule-data.js.map +1 -0
  11. package/dist/domain/cone-data.d.ts +13 -0
  12. package/dist/domain/cone-data.d.ts.map +1 -0
  13. package/dist/domain/cone-data.js +52 -0
  14. package/dist/domain/cone-data.js.map +1 -0
  15. package/dist/domain/cylinder-data.d.ts +14 -0
  16. package/dist/domain/cylinder-data.d.ts.map +1 -0
  17. package/dist/domain/cylinder-data.js +58 -0
  18. package/dist/domain/cylinder-data.js.map +1 -0
  19. package/dist/domain/deg-to-rad.d.ts +2 -0
  20. package/dist/domain/deg-to-rad.d.ts.map +1 -0
  21. package/dist/domain/deg-to-rad.js +4 -0
  22. package/dist/domain/deg-to-rad.js.map +1 -0
  23. package/dist/domain/disk-data.d.ts +12 -0
  24. package/dist/domain/disk-data.d.ts.map +1 -0
  25. package/dist/domain/disk-data.js +21 -0
  26. package/dist/domain/disk-data.js.map +1 -0
  27. package/dist/domain/icosphere-data.d.ts +8 -0
  28. package/dist/domain/icosphere-data.d.ts.map +1 -0
  29. package/dist/domain/icosphere-data.js +58 -0
  30. package/dist/domain/icosphere-data.js.map +1 -0
  31. package/dist/domain/index.d.ts +40 -0
  32. package/dist/domain/index.d.ts.map +1 -0
  33. package/dist/domain/index.js +23 -0
  34. package/dist/domain/index.js.map +1 -0
  35. package/dist/domain/material-factory.d.ts +34 -0
  36. package/dist/domain/material-factory.d.ts.map +1 -0
  37. package/dist/domain/material-factory.js +106 -0
  38. package/dist/domain/material-factory.js.map +1 -0
  39. package/dist/domain/material-sampler.d.ts +7 -0
  40. package/dist/domain/material-sampler.d.ts.map +1 -0
  41. package/dist/domain/material-sampler.js +11 -0
  42. package/dist/domain/material-sampler.js.map +1 -0
  43. package/dist/domain/material-textures-schema.d.ts +29 -0
  44. package/dist/domain/material-textures-schema.d.ts.map +1 -0
  45. package/dist/domain/material-textures-schema.js +57 -0
  46. package/dist/domain/material-textures-schema.js.map +1 -0
  47. package/dist/domain/material-textures.d.ts +13 -0
  48. package/dist/domain/material-textures.d.ts.map +1 -0
  49. package/dist/domain/material-textures.js +91 -0
  50. package/dist/domain/material-textures.js.map +1 -0
  51. package/dist/domain/material.d.ts +27 -0
  52. package/dist/domain/material.d.ts.map +1 -0
  53. package/dist/domain/material.js +2 -0
  54. package/dist/domain/material.js.map +1 -0
  55. package/dist/domain/mesh-box.d.ts +8 -0
  56. package/dist/domain/mesh-box.d.ts.map +1 -0
  57. package/dist/domain/mesh-box.js +57 -0
  58. package/dist/domain/mesh-box.js.map +1 -0
  59. package/dist/domain/mesh-cache.d.ts +4 -0
  60. package/dist/domain/mesh-cache.d.ts.map +1 -0
  61. package/dist/domain/mesh-cache.js +14 -0
  62. package/dist/domain/mesh-cache.js.map +1 -0
  63. package/dist/domain/mesh-capsule.d.ts +14 -0
  64. package/dist/domain/mesh-capsule.d.ts.map +1 -0
  65. package/dist/domain/mesh-capsule.js +52 -0
  66. package/dist/domain/mesh-capsule.js.map +1 -0
  67. package/dist/domain/mesh-cone.d.ts +16 -0
  68. package/dist/domain/mesh-cone.d.ts.map +1 -0
  69. package/dist/domain/mesh-cone.js +54 -0
  70. package/dist/domain/mesh-cone.js.map +1 -0
  71. package/dist/domain/mesh-cylinder.d.ts +18 -0
  72. package/dist/domain/mesh-cylinder.d.ts.map +1 -0
  73. package/dist/domain/mesh-cylinder.js +67 -0
  74. package/dist/domain/mesh-cylinder.js.map +1 -0
  75. package/dist/domain/mesh-disk.d.ts +11 -0
  76. package/dist/domain/mesh-disk.d.ts.map +1 -0
  77. package/dist/domain/mesh-disk.js +45 -0
  78. package/dist/domain/mesh-disk.js.map +1 -0
  79. package/dist/domain/mesh-dodecahedron.d.ts +4 -0
  80. package/dist/domain/mesh-dodecahedron.d.ts.map +1 -0
  81. package/dist/domain/mesh-dodecahedron.js +10 -0
  82. package/dist/domain/mesh-dodecahedron.js.map +1 -0
  83. package/dist/domain/mesh-fullscreen-quad.d.ts +7 -0
  84. package/dist/domain/mesh-fullscreen-quad.d.ts.map +1 -0
  85. package/dist/domain/mesh-fullscreen-quad.js +39 -0
  86. package/dist/domain/mesh-fullscreen-quad.js.map +1 -0
  87. package/dist/domain/mesh-icosahedron.d.ts +4 -0
  88. package/dist/domain/mesh-icosahedron.d.ts.map +1 -0
  89. package/dist/domain/mesh-icosahedron.js +10 -0
  90. package/dist/domain/mesh-icosahedron.js.map +1 -0
  91. package/dist/domain/mesh-icosphere.d.ts +11 -0
  92. package/dist/domain/mesh-icosphere.d.ts.map +1 -0
  93. package/dist/domain/mesh-icosphere.js +47 -0
  94. package/dist/domain/mesh-icosphere.js.map +1 -0
  95. package/dist/domain/mesh-octahedron.d.ts +4 -0
  96. package/dist/domain/mesh-octahedron.d.ts.map +1 -0
  97. package/dist/domain/mesh-octahedron.js +10 -0
  98. package/dist/domain/mesh-octahedron.js.map +1 -0
  99. package/dist/domain/mesh-plane.d.ts +13 -0
  100. package/dist/domain/mesh-plane.d.ts.map +1 -0
  101. package/dist/domain/mesh-plane.js +51 -0
  102. package/dist/domain/mesh-plane.js.map +1 -0
  103. package/dist/domain/mesh-ring.d.ts +12 -0
  104. package/dist/domain/mesh-ring.d.ts.map +1 -0
  105. package/dist/domain/mesh-ring.js +47 -0
  106. package/dist/domain/mesh-ring.js.map +1 -0
  107. package/dist/domain/mesh-sphere.d.ts +10 -0
  108. package/dist/domain/mesh-sphere.d.ts.map +1 -0
  109. package/dist/domain/mesh-sphere.js +51 -0
  110. package/dist/domain/mesh-sphere.js.map +1 -0
  111. package/dist/domain/mesh-tetrahedron.d.ts +5 -0
  112. package/dist/domain/mesh-tetrahedron.d.ts.map +1 -0
  113. package/dist/domain/mesh-tetrahedron.js +10 -0
  114. package/dist/domain/mesh-tetrahedron.js.map +1 -0
  115. package/dist/domain/mesh-torus.d.ts +17 -0
  116. package/dist/domain/mesh-torus.d.ts.map +1 -0
  117. package/dist/domain/mesh-torus.js +56 -0
  118. package/dist/domain/mesh-torus.js.map +1 -0
  119. package/dist/domain/mesh-types.d.ts +38 -0
  120. package/dist/domain/mesh-types.d.ts.map +1 -0
  121. package/dist/domain/mesh-types.js +2 -0
  122. package/dist/domain/mesh-types.js.map +1 -0
  123. package/dist/domain/mesh.d.ts +61 -0
  124. package/dist/domain/mesh.d.ts.map +1 -0
  125. package/dist/domain/mesh.js +49 -0
  126. package/dist/domain/mesh.js.map +1 -0
  127. package/dist/domain/orthographic-camera.d.ts +14 -0
  128. package/dist/domain/orthographic-camera.d.ts.map +1 -0
  129. package/dist/domain/orthographic-camera.js +10 -0
  130. package/dist/domain/orthographic-camera.js.map +1 -0
  131. package/dist/domain/perspective-camera.d.ts +12 -0
  132. package/dist/domain/perspective-camera.d.ts.map +1 -0
  133. package/dist/domain/perspective-camera.js +10 -0
  134. package/dist/domain/perspective-camera.js.map +1 -0
  135. package/dist/domain/plane-data.d.ts +12 -0
  136. package/dist/domain/plane-data.d.ts.map +1 -0
  137. package/dist/domain/plane-data.js +25 -0
  138. package/dist/domain/plane-data.js.map +1 -0
  139. package/dist/domain/polyhedron-data.d.ts +7 -0
  140. package/dist/domain/polyhedron-data.d.ts.map +1 -0
  141. package/dist/domain/polyhedron-data.js +42 -0
  142. package/dist/domain/polyhedron-data.js.map +1 -0
  143. package/dist/domain/polyhedron-mesh.d.ts +10 -0
  144. package/dist/domain/polyhedron-mesh.d.ts.map +1 -0
  145. package/dist/domain/polyhedron-mesh.js +37 -0
  146. package/dist/domain/polyhedron-mesh.js.map +1 -0
  147. package/dist/domain/polyhedron-seeds.d.ts +6 -0
  148. package/dist/domain/polyhedron-seeds.d.ts.map +1 -0
  149. package/dist/domain/polyhedron-seeds.js +51 -0
  150. package/dist/domain/polyhedron-seeds.js.map +1 -0
  151. package/dist/domain/primitive-data-utils.d.ts +9 -0
  152. package/dist/domain/primitive-data-utils.d.ts.map +1 -0
  153. package/dist/domain/primitive-data-utils.js +36 -0
  154. package/dist/domain/primitive-data-utils.js.map +1 -0
  155. package/dist/domain/ring-data.d.ts +13 -0
  156. package/dist/domain/ring-data.d.ts.map +1 -0
  157. package/dist/domain/ring-data.js +24 -0
  158. package/dist/domain/ring-data.js.map +1 -0
  159. package/dist/domain/sphere-data.d.ts +11 -0
  160. package/dist/domain/sphere-data.d.ts.map +1 -0
  161. package/dist/domain/sphere-data.js +31 -0
  162. package/dist/domain/sphere-data.js.map +1 -0
  163. package/dist/domain/srgb.d.ts +5 -0
  164. package/dist/domain/srgb.d.ts.map +1 -0
  165. package/dist/domain/srgb.js +11 -0
  166. package/dist/domain/srgb.js.map +1 -0
  167. package/dist/domain/torus-data.d.ts +11 -0
  168. package/dist/domain/torus-data.d.ts.map +1 -0
  169. package/dist/domain/torus-data.js +38 -0
  170. package/dist/domain/torus-data.js.map +1 -0
  171. package/dist/domain/vertex-layout.d.ts +3 -0
  172. package/dist/domain/vertex-layout.d.ts.map +1 -0
  173. package/dist/domain/vertex-layout.js +14 -0
  174. package/dist/domain/vertex-layout.js.map +1 -0
  175. package/dist/domain/wgsl-alignment.d.ts +17 -0
  176. package/dist/domain/wgsl-alignment.d.ts.map +1 -0
  177. package/dist/domain/wgsl-alignment.js +39 -0
  178. package/dist/domain/wgsl-alignment.js.map +1 -0
  179. package/dist/edit/edit-source.d.ts +10 -0
  180. package/dist/edit/edit-source.d.ts.map +1 -0
  181. package/dist/edit/edit-source.js +9 -0
  182. package/dist/edit/edit-source.js.map +1 -0
  183. package/dist/edit/editable-mesh.d.ts +11 -0
  184. package/dist/edit/editable-mesh.d.ts.map +1 -0
  185. package/dist/edit/editable-mesh.js +30 -0
  186. package/dist/edit/editable-mesh.js.map +1 -0
  187. package/dist/edit/element-set.d.ts +4 -0
  188. package/dist/edit/element-set.d.ts.map +1 -0
  189. package/dist/edit/element-set.js +78 -0
  190. package/dist/edit/element-set.js.map +1 -0
  191. package/dist/edit/errors.d.ts +11 -0
  192. package/dist/edit/errors.d.ts.map +1 -0
  193. package/dist/edit/errors.js +11 -0
  194. package/dist/edit/errors.js.map +1 -0
  195. package/dist/edit/half-edge-bake.d.ts +5 -0
  196. package/dist/edit/half-edge-bake.d.ts.map +1 -0
  197. package/dist/edit/half-edge-bake.js +30 -0
  198. package/dist/edit/half-edge-bake.js.map +1 -0
  199. package/dist/edit/half-edge-build.d.ts +4 -0
  200. package/dist/edit/half-edge-build.d.ts.map +1 -0
  201. package/dist/edit/half-edge-build.js +61 -0
  202. package/dist/edit/half-edge-build.js.map +1 -0
  203. package/dist/edit/half-edge-kernel.d.ts +21 -0
  204. package/dist/edit/half-edge-kernel.d.ts.map +1 -0
  205. package/dist/edit/half-edge-kernel.js +14 -0
  206. package/dist/edit/half-edge-kernel.js.map +1 -0
  207. package/dist/edit/half-edge-views.d.ts +8 -0
  208. package/dist/edit/half-edge-views.d.ts.map +1 -0
  209. package/dist/edit/half-edge-views.js +40 -0
  210. package/dist/edit/half-edge-views.js.map +1 -0
  211. package/dist/edit/index.d.ts +38 -0
  212. package/dist/edit/index.d.ts.map +1 -0
  213. package/dist/edit/index.js +20 -0
  214. package/dist/edit/index.js.map +1 -0
  215. package/dist/edit/kernel-handle.d.ts +5 -0
  216. package/dist/edit/kernel-handle.d.ts.map +1 -0
  217. package/dist/edit/kernel-handle.js +7 -0
  218. package/dist/edit/kernel-handle.js.map +1 -0
  219. package/dist/edit/operator-utils.d.ts +33 -0
  220. package/dist/edit/operator-utils.d.ts.map +1 -0
  221. package/dist/edit/operator-utils.js +101 -0
  222. package/dist/edit/operator-utils.js.map +1 -0
  223. package/dist/edit/operators/bevel.d.ts +18 -0
  224. package/dist/edit/operators/bevel.d.ts.map +1 -0
  225. package/dist/edit/operators/bevel.js +65 -0
  226. package/dist/edit/operators/bevel.js.map +1 -0
  227. package/dist/edit/operators/bridge.d.ts +14 -0
  228. package/dist/edit/operators/bridge.d.ts.map +1 -0
  229. package/dist/edit/operators/bridge.js +55 -0
  230. package/dist/edit/operators/bridge.js.map +1 -0
  231. package/dist/edit/operators/dissolve-edges.d.ts +12 -0
  232. package/dist/edit/operators/dissolve-edges.d.ts.map +1 -0
  233. package/dist/edit/operators/dissolve-edges.js +55 -0
  234. package/dist/edit/operators/dissolve-edges.js.map +1 -0
  235. package/dist/edit/operators/dissolve-faces.d.ts +9 -0
  236. package/dist/edit/operators/dissolve-faces.d.ts.map +1 -0
  237. package/dist/edit/operators/dissolve-faces.js +98 -0
  238. package/dist/edit/operators/dissolve-faces.js.map +1 -0
  239. package/dist/edit/operators/dissolve-vertices.d.ts +13 -0
  240. package/dist/edit/operators/dissolve-vertices.d.ts.map +1 -0
  241. package/dist/edit/operators/dissolve-vertices.js +36 -0
  242. package/dist/edit/operators/dissolve-vertices.js.map +1 -0
  243. package/dist/edit/operators/extrude.d.ts +18 -0
  244. package/dist/edit/operators/extrude.d.ts.map +1 -0
  245. package/dist/edit/operators/extrude.js +33 -0
  246. package/dist/edit/operators/extrude.js.map +1 -0
  247. package/dist/edit/operators/fill-hole.d.ts +12 -0
  248. package/dist/edit/operators/fill-hole.d.ts.map +1 -0
  249. package/dist/edit/operators/fill-hole.js +29 -0
  250. package/dist/edit/operators/fill-hole.js.map +1 -0
  251. package/dist/edit/operators/grid-fill.d.ts +12 -0
  252. package/dist/edit/operators/grid-fill.d.ts.map +1 -0
  253. package/dist/edit/operators/grid-fill.js +20 -0
  254. package/dist/edit/operators/grid-fill.js.map +1 -0
  255. package/dist/edit/operators/heal-manifold.d.ts +15 -0
  256. package/dist/edit/operators/heal-manifold.d.ts.map +1 -0
  257. package/dist/edit/operators/heal-manifold.js +62 -0
  258. package/dist/edit/operators/heal-manifold.js.map +1 -0
  259. package/dist/edit/operators/inset.d.ts +16 -0
  260. package/dist/edit/operators/inset.d.ts.map +1 -0
  261. package/dist/edit/operators/inset.js +40 -0
  262. package/dist/edit/operators/inset.js.map +1 -0
  263. package/dist/edit/operators/loop-cut.d.ts +14 -0
  264. package/dist/edit/operators/loop-cut.d.ts.map +1 -0
  265. package/dist/edit/operators/loop-cut.js +120 -0
  266. package/dist/edit/operators/loop-cut.js.map +1 -0
  267. package/dist/edit/operators/merge-by-distance.d.ts +15 -0
  268. package/dist/edit/operators/merge-by-distance.d.ts.map +1 -0
  269. package/dist/edit/operators/merge-by-distance.js +78 -0
  270. package/dist/edit/operators/merge-by-distance.js.map +1 -0
  271. package/dist/edit/operators/recompute-normals.d.ts +7 -0
  272. package/dist/edit/operators/recompute-normals.d.ts.map +1 -0
  273. package/dist/edit/operators/recompute-normals.js +67 -0
  274. package/dist/edit/operators/recompute-normals.js.map +1 -0
  275. package/dist/edit/operators/subdivide-edges.d.ts +11 -0
  276. package/dist/edit/operators/subdivide-edges.d.ts.map +1 -0
  277. package/dist/edit/operators/subdivide-edges.js +106 -0
  278. package/dist/edit/operators/subdivide-edges.js.map +1 -0
  279. package/dist/edit/operators/subdivide-faces.d.ts +11 -0
  280. package/dist/edit/operators/subdivide-faces.d.ts.map +1 -0
  281. package/dist/edit/operators/subdivide-faces.js +45 -0
  282. package/dist/edit/operators/subdivide-faces.js.map +1 -0
  283. package/dist/edit/selection.d.ts +19 -0
  284. package/dist/edit/selection.d.ts.map +1 -0
  285. package/dist/edit/selection.js +21 -0
  286. package/dist/edit/selection.js.map +1 -0
  287. package/dist/edit/to-editable.d.ts +9 -0
  288. package/dist/edit/to-editable.d.ts.map +1 -0
  289. package/dist/edit/to-editable.js +19 -0
  290. package/dist/edit/to-editable.js.map +1 -0
  291. package/dist/edit/types.d.ts +111 -0
  292. package/dist/edit/types.d.ts.map +1 -0
  293. package/dist/edit/types.js +2 -0
  294. package/dist/edit/types.js.map +1 -0
  295. package/dist/edit/warnings.d.ts +14 -0
  296. package/dist/edit/warnings.d.ts.map +1 -0
  297. package/dist/edit/warnings.js +11 -0
  298. package/dist/edit/warnings.js.map +1 -0
  299. package/dist/index.d.ts +11 -0
  300. package/dist/index.d.ts.map +1 -0
  301. package/dist/index.js +6 -0
  302. package/dist/index.js.map +1 -0
  303. package/dist/inspect/index.d.ts +9 -0
  304. package/dist/inspect/index.d.ts.map +1 -0
  305. package/dist/inspect/index.js +5 -0
  306. package/dist/inspect/index.js.map +1 -0
  307. package/dist/inspect/inspect-material.d.ts +12 -0
  308. package/dist/inspect/inspect-material.d.ts.map +1 -0
  309. package/dist/inspect/inspect-material.js +2 -0
  310. package/dist/inspect/inspect-material.js.map +1 -0
  311. package/dist/inspect/mesh-to-readable.d.ts +4 -0
  312. package/dist/inspect/mesh-to-readable.d.ts.map +1 -0
  313. package/dist/inspect/mesh-to-readable.js +47 -0
  314. package/dist/inspect/mesh-to-readable.js.map +1 -0
  315. package/dist/inspect/mesh-to-wireframe.d.ts +5 -0
  316. package/dist/inspect/mesh-to-wireframe.d.ts.map +1 -0
  317. package/dist/inspect/mesh-to-wireframe.js +101 -0
  318. package/dist/inspect/mesh-to-wireframe.js.map +1 -0
  319. package/dist/inspect/normal-debug-material.d.ts +8 -0
  320. package/dist/inspect/normal-debug-material.d.ts.map +1 -0
  321. package/dist/inspect/normal-debug-material.js +42 -0
  322. package/dist/inspect/normal-debug-material.js.map +1 -0
  323. package/dist/inspect/normal-debug-shader.d.ts +2 -0
  324. package/dist/inspect/normal-debug-shader.d.ts.map +1 -0
  325. package/dist/inspect/normal-debug-shader.js +32 -0
  326. package/dist/inspect/normal-debug-shader.js.map +1 -0
  327. package/dist/inspect/wireframe-material.d.ts +9 -0
  328. package/dist/inspect/wireframe-material.d.ts.map +1 -0
  329. package/dist/inspect/wireframe-material.js +45 -0
  330. package/dist/inspect/wireframe-material.js.map +1 -0
  331. package/dist/inspect/wireframe-mesh.d.ts +9 -0
  332. package/dist/inspect/wireframe-mesh.d.ts.map +1 -0
  333. package/dist/inspect/wireframe-mesh.js +2 -0
  334. package/dist/inspect/wireframe-mesh.js.map +1 -0
  335. package/dist/inspect/wireframe-shader.d.ts +2 -0
  336. package/dist/inspect/wireframe-shader.d.ts.map +1 -0
  337. package/dist/inspect/wireframe-shader.js +24 -0
  338. package/dist/inspect/wireframe-shader.js.map +1 -0
  339. package/dist/passes/index.d.ts +6 -0
  340. package/dist/passes/index.d.ts.map +1 -0
  341. package/dist/passes/index.js +5 -0
  342. package/dist/passes/index.js.map +1 -0
  343. package/dist/passes/pass-sequence.d.ts +9 -0
  344. package/dist/passes/pass-sequence.d.ts.map +1 -0
  345. package/dist/passes/pass-sequence.js +21 -0
  346. package/dist/passes/pass-sequence.js.map +1 -0
  347. package/dist/passes/pass.d.ts +4 -0
  348. package/dist/passes/pass.d.ts.map +1 -0
  349. package/dist/passes/pass.js +99 -0
  350. package/dist/passes/pass.js.map +1 -0
  351. package/dist/pipeline.d.ts +16 -0
  352. package/dist/pipeline.d.ts.map +1 -0
  353. package/dist/pipeline.js +10 -0
  354. package/dist/pipeline.js.map +1 -0
  355. package/dist/rapid-renderer.d.ts +18 -0
  356. package/dist/rapid-renderer.d.ts.map +1 -0
  357. package/dist/rapid-renderer.js +58 -0
  358. package/dist/rapid-renderer.js.map +1 -0
  359. package/dist/render-pass.d.ts +33 -0
  360. package/dist/render-pass.d.ts.map +1 -0
  361. package/dist/render-pass.js +67 -0
  362. package/dist/render-pass.js.map +1 -0
  363. package/dist/render-target/render-target-canvas.d.ts +15 -0
  364. package/dist/render-target/render-target-canvas.d.ts.map +1 -0
  365. package/dist/render-target/render-target-canvas.js +59 -0
  366. package/dist/render-target/render-target-canvas.js.map +1 -0
  367. package/dist/render-target/render-target-multi.d.ts +4 -0
  368. package/dist/render-target/render-target-multi.d.ts.map +1 -0
  369. package/dist/render-target/render-target-multi.js +90 -0
  370. package/dist/render-target/render-target-multi.js.map +1 -0
  371. package/dist/render-target/render-target.d.ts +10 -0
  372. package/dist/render-target/render-target.d.ts.map +1 -0
  373. package/dist/render-target/render-target.js +98 -0
  374. package/dist/render-target/render-target.js.map +1 -0
  375. package/dist/render-target/types.d.ts +59 -0
  376. package/dist/render-target/types.d.ts.map +1 -0
  377. package/dist/render-target/types.js +2 -0
  378. package/dist/render-target/types.js.map +1 -0
  379. package/dist/uniform-pool-internals.d.ts +12 -0
  380. package/dist/uniform-pool-internals.d.ts.map +1 -0
  381. package/dist/uniform-pool-internals.js +24 -0
  382. package/dist/uniform-pool-internals.js.map +1 -0
  383. package/dist/uniform-pool-types.d.ts +22 -0
  384. package/dist/uniform-pool-types.d.ts.map +1 -0
  385. package/dist/uniform-pool-types.js +2 -0
  386. package/dist/uniform-pool-types.js.map +1 -0
  387. package/dist/uniform-pool.d.ts +30 -0
  388. package/dist/uniform-pool.d.ts.map +1 -0
  389. package/dist/uniform-pool.js +127 -0
  390. package/dist/uniform-pool.js.map +1 -0
  391. package/dist/utils/canvas-mouse-tracker.d.ts +11 -0
  392. package/dist/utils/canvas-mouse-tracker.d.ts.map +1 -0
  393. package/dist/utils/canvas-mouse-tracker.js +19 -0
  394. package/dist/utils/canvas-mouse-tracker.js.map +1 -0
  395. package/dist/utils/canvas-resolution.d.ts +9 -0
  396. package/dist/utils/canvas-resolution.d.ts.map +1 -0
  397. package/dist/utils/canvas-resolution.js +16 -0
  398. package/dist/utils/canvas-resolution.js.map +1 -0
  399. package/dist/utils/frame-clock.d.ts +10 -0
  400. package/dist/utils/frame-clock.d.ts.map +1 -0
  401. package/dist/utils/frame-clock.js +47 -0
  402. package/dist/utils/frame-clock.js.map +1 -0
  403. package/dist/utils/index.d.ts +7 -0
  404. package/dist/utils/index.d.ts.map +1 -0
  405. package/dist/utils/index.js +4 -0
  406. package/dist/utils/index.js.map +1 -0
  407. package/package.json +76 -0
  408. package/src/RenderPass.docs.md +41 -0
  409. package/src/createRenderPipeline.docs.md +34 -0
  410. package/src/domain/camera.docs.md +21 -0
  411. package/src/domain/deg-to-rad.docs.md +9 -0
  412. package/src/domain/material-factory.docs.md +59 -0
  413. package/src/domain/material.docs.md +12 -0
  414. package/src/domain/mesh.docs.md +28 -0
  415. package/src/domain/orthographic-camera.docs.md +22 -0
  416. package/src/domain/perspective-camera.docs.md +20 -0
  417. package/src/domain/srgb.docs.md +11 -0
  418. package/src/inspect/inspect-material.docs.md +23 -0
  419. package/src/inspect/mesh-to-wireframe.docs.md +29 -0
  420. package/src/inspect/normal-debug-material.docs.md +26 -0
  421. package/src/inspect/wireframe-material.docs.md +22 -0
  422. package/src/rapid-renderer.docs.md +18 -0
  423. package/src/uniform-pool.docs.md +60 -0
  424. package/src/utils/canvas-mouse-tracker.docs.md +13 -0
  425. package/src/utils/canvas-resolution.docs.md +13 -0
  426. package/src/utils/frame-clock.docs.md +14 -0
@@ -0,0 +1,28 @@
1
+ # Mesh
2
+
3
+ `Mesh` is a pure geometry value for draw code. It owns a vertex buffer, a vertex count, a vertex
4
+ attribute description, and a bounding box. It does not store transforms or scene hierarchy data.
5
+
6
+ ## `Mesh.box({ device, size })`
7
+
8
+ `Mesh.box({ device })` returns a unit cube with face normals suitable for flat-shaded lighting. The
9
+ default size is `1`, so the bounding box spans `[-0.5, -0.5, -0.5]` to `[0.5, 0.5, 0.5]`.
10
+
11
+ Pass `size` to build a cube with a different edge length:
12
+
13
+ ```ts
14
+ const unit = Mesh.box({ device });
15
+ const large = Mesh.box({ device, size: 2 });
16
+ ```
17
+
18
+ The vertex layout is interleaved as `[position, normal]` with two `vec3<f32>` attributes:
19
+
20
+ - stride: 24 bytes
21
+ - position: offset 0, format `float32x3`
22
+ - normal: offset 12, format `float32x3`
23
+
24
+ The cube uses 36 vertices: six faces, two triangles per face, and three vertices per triangle. Faces
25
+ do not share vertices, so each face has one constant normal.
26
+
27
+ Meshes are cached per device and per size. Repeating `Mesh.box({ device, size: 1 })` returns the same
28
+ mesh instance and reuses one GPU vertex buffer for that device.
@@ -0,0 +1,22 @@
1
+ # orthographicCamera
2
+
3
+ Creates a pure camera value for orthographic projection.
4
+
5
+ Pass the left, right, bottom, top, near, and far planes, plus a world-space `position` and `target`. The optional `up` vector defaults to `[0, 1, 0]`.
6
+
7
+ ```ts
8
+ import { orthographicCamera } from "@vgpu/render";
9
+
10
+ const camera = orthographicCamera({
11
+ left: -1,
12
+ right: 1,
13
+ bottom: -1,
14
+ top: 1,
15
+ near: 0.1,
16
+ far: 100,
17
+ position: new Float32Array([0, 0, 5]),
18
+ target: new Float32Array([0, 0, 0]),
19
+ });
20
+ ```
21
+
22
+ The matrix is computed once as projection times view and stored on `camera.viewProjectionMatrix`.
@@ -0,0 +1,20 @@
1
+ # perspectiveCamera
2
+
3
+ Creates a pure camera value for perspective projection.
4
+
5
+ Pass a vertical field of view in radians, aspect ratio, near and far planes, and a world-space `position` and `target`. The optional `up` vector defaults to `[0, 1, 0]`.
6
+
7
+ ```ts
8
+ import { degToRad, perspectiveCamera } from "@vgpu/render";
9
+
10
+ const camera = perspectiveCamera({
11
+ fovYRadians: degToRad(45),
12
+ aspect: canvas.width / canvas.height,
13
+ near: 0.1,
14
+ far: 100,
15
+ position: new Float32Array([0, 0, 5]),
16
+ target: new Float32Array([0, 0, 0]),
17
+ });
18
+ ```
19
+
20
+ The matrix is computed once as projection times view and stored on `camera.viewProjectionMatrix`.
@@ -0,0 +1,11 @@
1
+ # srgb
2
+
3
+ Converts colors from sRGB into linear RGB.
4
+
5
+ The input is sRGB: the way humans, design tools, and hex color pickers usually describe colors. The output is linear RGB in the `0..1` range, which is the color space shaders need for lighting math.
6
+
7
+ ```ts
8
+ const baseColor = srgb(0xcc8844);
9
+ ```
10
+
11
+ You can pass a packed hex value such as `0xff6600`, or a three-component sRGB tuple such as `[0.5, 0.5, 0.5]`.
@@ -0,0 +1,23 @@
1
+ # InspectMaterial
2
+
3
+ `InspectMaterial` is the low-level material shape used by the inspect sub-export.
4
+ It contains a pipeline, a group-0 bind group layout, and a typed uniform writer.
5
+
6
+ ```ts
7
+ const uniforms = device.createBuffer({
8
+ size: material.uniformByteSize,
9
+ usage: ["uniform", "copy_dst"],
10
+ });
11
+
12
+ material.writeUniforms(uniforms.gpu, 0, {
13
+ viewProjectionMatrix: camera.viewProjectionMatrix,
14
+ modelMatrix,
15
+ });
16
+ ```
17
+
18
+ `writeUniforms` writes the shared inspect matrices into the buffer. This keeps
19
+ inspect materials independent from application materials used by `RapidRenderer`.
20
+
21
+ `InspectMaterialUniformParams` includes `viewProjectionMatrix` and `modelMatrix`.
22
+ Future inspect materials should extend this interface explicitly if they need
23
+ additional uniform inputs.
@@ -0,0 +1,29 @@
1
+ # meshToWireframe
2
+
3
+ `meshToWireframe(mesh, device)` converts a readable triangle-list `Mesh` into a
4
+ line-list index buffer with duplicate edges removed by endpoint position.
5
+
6
+ ```ts
7
+ import { meshToWireframe } from "@vgpu/render/inspect";
8
+
9
+ const wireframe = await meshToWireframe(readableMesh, device);
10
+
11
+ // wireframe.vertexBuffer is readableMesh.vertexBuffer
12
+ // wireframe.indexBuffer contains two indices per line segment
13
+ ```
14
+
15
+ The source mesh's vertex buffer must be created with `GPUBufferUsage.COPY_SRC`
16
+ so `meshToWireframe` can read back vertex positions. If the buffer is not
17
+ readable, the function throws `VGPU-CORE-INVALID-USAGE`; `Mesh.box` currently
18
+ does not satisfy this contract.
19
+
20
+ Endpoints are quantized to a `1e-6` grid before comparison. Meshes with distinct
21
+ features below that scale may have edges incorrectly merged, so author debug
22
+ geometry at a larger scale or use a precomputed wireframe for tiny details.
23
+
24
+ Coplanar triangle diagonals are omitted by comparing triangle face normals, so a
25
+ readable unit-box triangle list produces 12 line segments and 24 indices.
26
+
27
+ The returned `indexBuffer` is a raw `GPUBuffer`. Callers own its lifetime and
28
+ should call `indexBuffer.destroy()` when done, or rely on `device.destroy()` to
29
+ clean up at teardown.
@@ -0,0 +1,26 @@
1
+ # normalDebugMaterial
2
+
3
+ Renders each fragment colored by its surface normal, which is useful for
4
+ verifying mesh normals visually during development.
5
+
6
+ ```ts
7
+ import { Mesh } from "@vgpu/render";
8
+ import { normalDebugMaterial } from "@vgpu/render/inspect";
9
+
10
+ const mesh = Mesh.box({ device });
11
+ const material = normalDebugMaterial({ device });
12
+ ```
13
+
14
+ Each fragment outputs `(normal + 1) / 2` as RGB, mapping the unit-cube normal
15
+ range `[-1, +1]³` to `[0, 1]³`. A face whose normal points along +X reads pure
16
+ red; +Y reads pure green; +Z reads pure blue. Reverse directions read cyan,
17
+ magenta, and yellow.
18
+
19
+ The pipeline uses `triangle-list` topology with depth testing and back-face
20
+ culling. Default `targetFormat` is `'bgra8unorm-srgb'`; use
21
+ `'rgba8unorm-srgb'` on platforms that require it.
22
+
23
+ Normals are passed through in object space. Applying a rotation in `modelMatrix`
24
+ rotates the visualized colors with the geometry, which is the intended behavior
25
+ for this inspector. A normal matrix is not applied; this is a development
26
+ visualization, not a lighting pass.
@@ -0,0 +1,22 @@
1
+ # wireframeMaterial
2
+
3
+ `wireframeMaterial` renders a mesh as line segments, which is useful for
4
+ visualizing geometry edges during development.
5
+
6
+ ```ts
7
+ import { meshToWireframe, wireframeMaterial } from "@vgpu/render/inspect";
8
+
9
+ const wireframe = await meshToWireframe(readableMesh, device);
10
+ const material = wireframeMaterial({ device, color: [1, 1, 1] });
11
+ ```
12
+
13
+ The pipeline uses `line-list` topology with depth testing on and no back-face
14
+ culling. It expects the same interleaved position and normal vertex layout as the
15
+ source mesh passed to `meshToWireframe`.
16
+
17
+ `color` defaults to `[1, 1, 1]` in linear RGB. `targetFormat` defaults to
18
+ `'bgra8unorm-srgb'`; use `'rgba8unorm-srgb'` on platforms that require it.
19
+
20
+ The returned `InspectMaterial` is for low-level draws. Pair it with
21
+ `meshToWireframe`, bind a uniform buffer at group 0, then issue an indexed
22
+ line-list draw.
@@ -0,0 +1,18 @@
1
+ # RapidRenderer
2
+
3
+ `RapidRenderer` submits one draw to a target view. The renderer binds a material,
4
+ optionally binds a mesh, then draws either `vertexCount` or `mesh.vertexCount`.
5
+
6
+ ```ts
7
+ material.writeUniforms({ viewProjection, model, cameraPosition, light });
8
+ await renderer.draw({ material, mesh, target, depthTarget });
9
+ await renderer.draw({ material, pipeline, target, vertexCount: 3 });
10
+ ```
11
+
12
+ `material` is required. `pipeline` is an optional override; otherwise the renderer
13
+ uses `material.pipeline`. Call `material.writeUniforms()` before `draw()` when the
14
+ material has uniforms. The renderer does not write camera, transform, light, or
15
+ material parameters.
16
+
17
+ `clearValue` defaults to opaque black. `depthTarget` is optional. `renderer.gpu`
18
+ returns the raw `GPUDevice`. `draw()` resolves after command submission.
@@ -0,0 +1,60 @@
1
+ # UniformPool
2
+
3
+ `UniformPool` stages per-draw uniform bytes in CPU memory and uploads them to a
4
+ WebGPU uniform buffer at the frame boundary. Each `push()` returns the dynamic
5
+ offset, in bytes, to pass when binding the slot for a draw.
6
+
7
+ ## Slots
8
+
9
+ `pool.alloc(layout)` returns a `UniformSlot<T>` with:
10
+
11
+ - `slot.gpu`: the underlying `GPUBuffer` used by the pool.
12
+ - `slot.bindGroup`: a real `GPUBindGroup` with a dynamic uniform-buffer binding.
13
+ - `slot.bindGroupLayout`: a real `GPUBindGroupLayout` whose binding uses
14
+ `hasDynamicOffset: true`.
15
+ - `slot.stride`: `layout.size` padded up to the device's uniform-buffer offset
16
+ alignment.
17
+
18
+ All slots allocated by one pool share the same backing `GPUBuffer`. Each slot
19
+ has its own bind group so callers can bind the slot once and vary only the
20
+ dynamic offset returned by `push()` or `pushBytes()`.
21
+
22
+ ## Pipeline layout sharing
23
+
24
+ A layout may provide a pre-built bind group layout:
25
+
26
+ ```ts
27
+ const slot = pool.alloc({
28
+ size,
29
+ bindGroupLayout: material.bindGroupLayout,
30
+ encode(value, dst, byteOffset) {
31
+ // write uniform bytes
32
+ },
33
+ });
34
+ ```
35
+
36
+ When `bindGroupLayout` is provided, the slot reuses it instead of creating a new
37
+ layout. Use this when a pipeline already owns the bind group layout that will
38
+ consume the slot's bind group.
39
+
40
+ ## Frame uploads
41
+
42
+ `push(value)` and `pushBytes(bytes)` write into the pool's CPU mirror only. They
43
+ do not call WebGPU immediately. `endFrame()` uploads pending bytes with
44
+ `device.gpu.queue.writeBuffer(pool.gpu, 0, pool.cpuMirror, 0, pool.usedBytes)`.
45
+
46
+ Calling `endFrame()` on a clean pool is a no-op. If more values are pushed after
47
+ `endFrame()`, a later `endFrame()` uploads the updated CPU mirror again.
48
+
49
+ ## Submit readiness
50
+
51
+ Call `endFrame()` before submitting command buffers that read data from the
52
+ pool. `assertReadyForSubmit(opName)` checks this invariant. If there are pending
53
+ pushes that have not been uploaded, it throws `VGPU-CORE-INVALID-USAGE` with:
54
+
55
+ ```txt
56
+ UniformPool has unflushed pushes; call endFrame() before submitting.
57
+ ```
58
+
59
+ Renderers should call `assertReadyForSubmit()` immediately before
60
+ `queue.submit()`.
@@ -0,0 +1,13 @@
1
+ # canvasMouseTracker
2
+
3
+ Tracks the latest pointer position over a canvas. Use it when a render loop needs the mouse position without storing event handlers in your app code.
4
+
5
+ ```ts
6
+ const mouse = canvasMouseTracker({ canvas, normalize: true });
7
+ function draw() {
8
+ const [x, y] = mouse.position;
9
+ material.writeUniforms({ mouse: [x, y] });
10
+ }
11
+ ```
12
+
13
+ Call `dispose()` when the canvas is removed.
@@ -0,0 +1,13 @@
1
+ # canvasResolution
2
+
3
+ Reads the drawing size of a canvas. Use it when shaders or render targets need the current canvas width and height.
4
+
5
+ ```ts
6
+ const size = canvasResolution(canvas, { observe: true });
7
+ function draw() {
8
+ material.writeUniforms({ resolution: [size.width, size.height] });
9
+ renderer.draw({ target, material, mesh });
10
+ }
11
+ ```
12
+
13
+ Call `dispose()` to stop observing size changes.
@@ -0,0 +1,14 @@
1
+ # frameClock
2
+
3
+ Measures elapsed time and frame delta in seconds. Use it in animation loops that need stable time values and pause support.
4
+
5
+ ```ts
6
+ const clock = frameClock();
7
+ function frame() {
8
+ const time = clock.now();
9
+ const dt = clock.delta();
10
+ update(time, dt);
11
+ }
12
+ ```
13
+
14
+ Use `pause()`, `resume()`, and `reset()` to control the clock.