@null3d/engine 0.0.0-stage → 0.1.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 (1357) hide show
  1. package/LICENSE-APACHE +176 -0
  2. package/LICENSE-MIT +21 -0
  3. package/README.md +108 -2
  4. package/THIRD-PARTY-NOTICES.txt +637 -0
  5. package/dist/wasm/single/null3d.js +3972 -0
  6. package/dist/wasm/single/null3d_bg.wasm +0 -0
  7. package/dist/wasm/threaded/null3d.js +3988 -0
  8. package/dist/wasm/threaded/null3d_bg.wasm +0 -0
  9. package/docs/api/animation.md +492 -0
  10. package/docs/api/assets.md +400 -0
  11. package/docs/api/cameras.md +161 -0
  12. package/docs/api/controls.md +319 -0
  13. package/docs/api/debug.md +450 -0
  14. package/docs/api/engine.md +254 -0
  15. package/docs/api/feature-draws.md +172 -0
  16. package/docs/api/feature-effects.md +137 -0
  17. package/docs/api/feature-instances.md +154 -0
  18. package/docs/api/features.md +323 -0
  19. package/docs/api/geometry.md +307 -0
  20. package/docs/api/grass.md +114 -0
  21. package/docs/api/impostors.md +274 -0
  22. package/docs/api/input.md +238 -0
  23. package/docs/api/lights.md +266 -0
  24. package/docs/api/lines.md +163 -0
  25. package/docs/api/materials.md +875 -0
  26. package/docs/api/math.md +129 -0
  27. package/docs/api/objects.md +155 -0
  28. package/docs/api/page.md +97 -0
  29. package/docs/api/particles.md +205 -0
  30. package/docs/api/points.md +130 -0
  31. package/docs/api/post.md +494 -0
  32. package/docs/api/quality.md +200 -0
  33. package/docs/api/raycast.md +269 -0
  34. package/docs/api/reference/animation.md +158 -0
  35. package/docs/api/reference/assets.md +335 -0
  36. package/docs/api/reference/cameras.md +138 -0
  37. package/docs/api/reference/controls.md +463 -0
  38. package/docs/api/reference/debug.md +586 -0
  39. package/docs/api/reference/engine.md +647 -0
  40. package/docs/api/reference/feature-draws.md +94 -0
  41. package/docs/api/reference/feature-effects.md +32 -0
  42. package/docs/api/reference/feature-instances.md +63 -0
  43. package/docs/api/reference/features.md +361 -0
  44. package/docs/api/reference/geometry.md +856 -0
  45. package/docs/api/reference/grass.md +131 -0
  46. package/docs/api/reference/impostors.md +368 -0
  47. package/docs/api/reference/input.md +121 -0
  48. package/docs/api/reference/lights.md +257 -0
  49. package/docs/api/reference/lines.md +84 -0
  50. package/docs/api/reference/materials.md +375 -0
  51. package/docs/api/reference/math.md +229 -0
  52. package/docs/api/reference/objects.md +103 -0
  53. package/docs/api/reference/particles.md +336 -0
  54. package/docs/api/reference/points.md +57 -0
  55. package/docs/api/reference/post.md +244 -0
  56. package/docs/api/reference/quality.md +213 -0
  57. package/docs/api/reference/raycast.md +94 -0
  58. package/docs/api/reference/render.md +238 -0
  59. package/docs/api/reference/scene.md +543 -0
  60. package/docs/api/reference/sketch.md +125 -0
  61. package/docs/api/reference/sound.md +203 -0
  62. package/docs/api/reference/splats.md +214 -0
  63. package/docs/api/reference/sprites.md +71 -0
  64. package/docs/api/reference/tasks.md +92 -0
  65. package/docs/api/reference/terrain.md +161 -0
  66. package/docs/api/reference/textures.md +153 -0
  67. package/docs/api/reference/three-compat.md +60 -0
  68. package/docs/api/reference/time.md +25 -0
  69. package/docs/api/reference/ui.md +52 -0
  70. package/docs/api/reference/vertex-draws.md +55 -0
  71. package/docs/api/reference/water.md +430 -0
  72. package/docs/api/reference/wind.md +106 -0
  73. package/docs/api/render.md +499 -0
  74. package/docs/api/scene.md +606 -0
  75. package/docs/api/sketch.md +231 -0
  76. package/docs/api/sound.md +169 -0
  77. package/docs/api/splats.md +264 -0
  78. package/docs/api/sprites.md +169 -0
  79. package/docs/api/tasks.md +106 -0
  80. package/docs/api/terrain.md +118 -0
  81. package/docs/api/textures.md +272 -0
  82. package/docs/api/three-compat.md +102 -0
  83. package/docs/api/time.md +134 -0
  84. package/docs/api/ui.md +134 -0
  85. package/docs/api/vertex-draws.md +171 -0
  86. package/docs/api/water.md +486 -0
  87. package/docs/api/wind.md +375 -0
  88. package/docs/cli/null3d.md +603 -0
  89. package/docs/concepts/architecture.md +174 -0
  90. package/docs/concepts/assets.md +128 -0
  91. package/docs/concepts/backends.md +197 -0
  92. package/docs/concepts/color-management.md +134 -0
  93. package/docs/concepts/culling.md +227 -0
  94. package/docs/concepts/handles.md +93 -0
  95. package/docs/concepts/instances.md +285 -0
  96. package/docs/concepts/large-worlds.md +126 -0
  97. package/docs/concepts/lighting.md +587 -0
  98. package/docs/concepts/lod.md +241 -0
  99. package/docs/concepts/materials.md +128 -0
  100. package/docs/concepts/particle-buffer.md +201 -0
  101. package/docs/concepts/post-processing.md +420 -0
  102. package/docs/concepts/quality-preset-tables.md +94 -0
  103. package/docs/concepts/quality-presets.md +341 -0
  104. package/docs/concepts/render-graph.md +222 -0
  105. package/docs/concepts/render-layers.md +111 -0
  106. package/docs/concepts/shadows.md +448 -0
  107. package/docs/concepts/static-dynamic.md +113 -0
  108. package/docs/cookbook/index.md +664 -0
  109. package/docs/data/threejs-mapping.json +2152 -0
  110. package/docs/errors/E1101.md +23 -0
  111. package/docs/errors/E1102.md +23 -0
  112. package/docs/errors/E1103.md +23 -0
  113. package/docs/errors/E1104.md +23 -0
  114. package/docs/errors/E1105.md +23 -0
  115. package/docs/errors/E1106.md +23 -0
  116. package/docs/errors/E1107.md +23 -0
  117. package/docs/errors/E1108.md +23 -0
  118. package/docs/errors/E1109.md +23 -0
  119. package/docs/errors/E1110.md +23 -0
  120. package/docs/errors/E1111.md +23 -0
  121. package/docs/errors/E1112.md +23 -0
  122. package/docs/errors/E1203.md +23 -0
  123. package/docs/errors/E1204.md +23 -0
  124. package/docs/errors/E1205.md +23 -0
  125. package/docs/errors/E1206.md +23 -0
  126. package/docs/errors/E1207.md +23 -0
  127. package/docs/errors/E1208.md +23 -0
  128. package/docs/errors/E1209.md +23 -0
  129. package/docs/errors/E1213.md +23 -0
  130. package/docs/errors/E1214.md +23 -0
  131. package/docs/errors/E1215.md +23 -0
  132. package/docs/errors/E1216.md +23 -0
  133. package/docs/errors/E1217.md +23 -0
  134. package/docs/errors/E1218.md +23 -0
  135. package/docs/errors/E1219.md +23 -0
  136. package/docs/errors/E1220.md +23 -0
  137. package/docs/errors/E1221.md +23 -0
  138. package/docs/errors/E1222.md +23 -0
  139. package/docs/errors/E1223.md +23 -0
  140. package/docs/errors/E1224.md +23 -0
  141. package/docs/errors/E1225.md +23 -0
  142. package/docs/errors/E1301.md +23 -0
  143. package/docs/errors/E1302.md +23 -0
  144. package/docs/errors/E1303.md +23 -0
  145. package/docs/errors/E1304.md +23 -0
  146. package/docs/errors/E1305.md +23 -0
  147. package/docs/errors/E1306.md +23 -0
  148. package/docs/errors/E1307.md +23 -0
  149. package/docs/errors/E1401.md +23 -0
  150. package/docs/errors/E1402.md +23 -0
  151. package/docs/errors/E1403.md +23 -0
  152. package/docs/errors/E1404.md +23 -0
  153. package/docs/errors/E1405.md +23 -0
  154. package/docs/errors/E1406.md +23 -0
  155. package/docs/errors/E1407.md +23 -0
  156. package/docs/errors/E1408.md +23 -0
  157. package/docs/errors/E1409.md +23 -0
  158. package/docs/errors/E1410.md +23 -0
  159. package/docs/errors/E1411.md +23 -0
  160. package/docs/errors/E1412.md +23 -0
  161. package/docs/errors/E1413.md +23 -0
  162. package/docs/errors/E1414.md +23 -0
  163. package/docs/errors/E1415.md +23 -0
  164. package/docs/errors/E1416.md +23 -0
  165. package/docs/errors/E1417.md +23 -0
  166. package/docs/errors/E1418.md +23 -0
  167. package/docs/errors/E1419.md +23 -0
  168. package/docs/errors/E1420.md +23 -0
  169. package/docs/errors/E1421.md +23 -0
  170. package/docs/errors/E1422.md +23 -0
  171. package/docs/errors/E1423.md +23 -0
  172. package/docs/errors/E1424.md +23 -0
  173. package/docs/errors/E1425.md +23 -0
  174. package/docs/errors/E1426.md +23 -0
  175. package/docs/errors/E1430.md +23 -0
  176. package/docs/errors/E1431.md +23 -0
  177. package/docs/errors/E1432.md +23 -0
  178. package/docs/errors/E1433.md +23 -0
  179. package/docs/errors/E1434.md +23 -0
  180. package/docs/errors/E1435.md +23 -0
  181. package/docs/errors/E1436.md +23 -0
  182. package/docs/errors/E1437.md +23 -0
  183. package/docs/errors/E1501.md +23 -0
  184. package/docs/errors/E1502.md +23 -0
  185. package/docs/errors/E1503.md +23 -0
  186. package/docs/errors/E1504.md +23 -0
  187. package/docs/errors/E1505.md +23 -0
  188. package/docs/errors/E1506.md +23 -0
  189. package/docs/errors/index.md +93 -0
  190. package/docs/getting-started/cdn.md +235 -0
  191. package/docs/getting-started/first-scene.md +129 -0
  192. package/docs/getting-started/hosting.md +400 -0
  193. package/docs/getting-started/install.md +112 -0
  194. package/docs/getting-started/network-use.md +96 -0
  195. package/docs/getting-started/project-structure.md +78 -0
  196. package/docs/getting-started/third-party-notices.md +94 -0
  197. package/docs/guides/accessibility.md +96 -0
  198. package/docs/guides/add-ons.md +160 -0
  199. package/docs/guides/agents.md +77 -0
  200. package/docs/guides/assets-pipeline.md +505 -0
  201. package/docs/guides/audio.md +148 -0
  202. package/docs/guides/baked-light-data.md +176 -0
  203. package/docs/guides/car-paint.md +121 -0
  204. package/docs/guides/content-pages.md +238 -0
  205. package/docs/guides/custom-passes.md +586 -0
  206. package/docs/guides/custom-shaders.md +293 -0
  207. package/docs/guides/debugging.md +236 -0
  208. package/docs/guides/deploying.md +115 -0
  209. package/docs/guides/deterministic-simulation.md +226 -0
  210. package/docs/guides/first-use-shaders.md +57 -0
  211. package/docs/guides/lens-kit.md +134 -0
  212. package/docs/guides/loading-screens.md +263 -0
  213. package/docs/guides/multiple-views.md +122 -0
  214. package/docs/guides/performance.md +405 -0
  215. package/docs/guides/phones.md +138 -0
  216. package/docs/guides/physics.md +202 -0
  217. package/docs/guides/screens.md +125 -0
  218. package/docs/guides/start-time.md +328 -0
  219. package/docs/guides/testing.md +245 -0
  220. package/docs/guides/ui-overlays.md +182 -0
  221. package/docs/guides/video-textures.md +110 -0
  222. package/docs/index.md +49 -0
  223. package/docs/pages.md +242 -0
  224. package/docs/porting/react-three-fiber.md +238 -0
  225. package/docs/porting/threejs-loop-and-threads.md +229 -0
  226. package/docs/porting/threejs-mapping.md +297 -0
  227. package/docs/porting/threejs-materials.md +222 -0
  228. package/docs/porting/threejs-overview.md +228 -0
  229. package/docs/porting/threejs-postprocessing.md +256 -0
  230. package/docs/porting/threejs-shaders.md +308 -0
  231. package/docs/porting/threejs-unsupported.md +91 -0
  232. package/docs/porting/verification.md +191 -0
  233. package/docs/shaders/builtins.md +129 -0
  234. package/docs/shaders/library.md +1374 -0
  235. package/docs/shaders/surface-functions.md +626 -0
  236. package/docs/shaders/wgsl-rules.md +126 -0
  237. package/levels/pieces.d.ts +178 -0
  238. package/levels/pieces.js +759 -0
  239. package/levels/planner.d.ts +126 -0
  240. package/levels/planner.js +682 -0
  241. package/lib/debug/channel.d.ts +103 -0
  242. package/lib/debug/channel.js +269 -0
  243. package/lib/debug/debug.d.ts +180 -0
  244. package/lib/debug/debug.js +4 -0
  245. package/lib/debug/draw.d.ts +146 -0
  246. package/lib/debug/draw.js +719 -0
  247. package/lib/debug/frame-target.d.ts +11 -0
  248. package/lib/debug/frame-target.js +31 -0
  249. package/lib/debug/inspector.d.ts +60 -0
  250. package/lib/debug/inspector.js +475 -0
  251. package/lib/debug/overlay-look.d.ts +162 -0
  252. package/lib/debug/overlay-look.js +1365 -0
  253. package/lib/debug/overlay.d.ts +68 -0
  254. package/lib/debug/overlay.js +195 -0
  255. package/lib/debug/page-meters.d.ts +139 -0
  256. package/lib/debug/page-meters.js +267 -0
  257. package/lib/debug/sketch-debug.d.ts +41 -0
  258. package/lib/debug/sketch-debug.js +86 -0
  259. package/lib/debug/stats-options.d.ts +15 -0
  260. package/lib/debug/stats-options.js +3 -0
  261. package/lib/debug/stats-panel.d.ts +94 -0
  262. package/lib/debug/stats-panel.js +123 -0
  263. package/lib/debug/stats-text.d.ts +169 -0
  264. package/lib/debug/stats-text.js +126 -0
  265. package/lib/debug/stats.d.ts +195 -0
  266. package/lib/debug/stats.js +252 -0
  267. package/lib/debug/view-names.d.ts +15 -0
  268. package/lib/debug/view-names.js +22 -0
  269. package/lib/errors/checks.d.ts +24 -0
  270. package/lib/errors/checks.js +38 -0
  271. package/lib/errors/codes.d.ts +15 -0
  272. package/lib/errors/codes.js +489 -0
  273. package/lib/errors/core-failure.d.ts +19 -0
  274. package/lib/errors/core-failure.js +127 -0
  275. package/lib/errors/engine-error-core.d.ts +21 -0
  276. package/lib/errors/engine-error-core.js +39 -0
  277. package/lib/errors/engine-error.d.ts +38 -0
  278. package/lib/errors/engine-error.js +132 -0
  279. package/lib/errors/fixes.d.ts +89 -0
  280. package/lib/errors/fixes.js +86 -0
  281. package/lib/errors/message.d.ts +4 -0
  282. package/lib/errors/message.js +10 -0
  283. package/lib/generated/core.d.ts +657 -0
  284. package/lib/generated/core.js +659 -0
  285. package/lib/generated/gpu.d.ts +412 -0
  286. package/lib/generated/gpu.js +414 -0
  287. package/lib/generated/shader-features.d.ts +8 -0
  288. package/lib/generated/shader-permutations.d.ts +6 -0
  289. package/lib/generated/shader-permutations.js +9 -0
  290. package/lib/generated/shaders-environment-glsl.d.ts +11 -0
  291. package/lib/generated/shaders-environment-wgsl.d.ts +11 -0
  292. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-coverage-half.d.ts +3 -0
  293. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-coverage.d.ts +3 -0
  294. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-displacement-half.d.ts +3 -0
  295. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-displacement.d.ts +3 -0
  296. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-hash-half.d.ts +3 -0
  297. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-hash.d.ts +3 -0
  298. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-lod-fade-half.d.ts +3 -0
  299. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-lod-fade.d.ts +3 -0
  300. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-morph-half.d.ts +3 -0
  301. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-morph.d.ts +3 -0
  302. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-row-values-half.d.ts +3 -0
  303. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-row-values.d.ts +3 -0
  304. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-skinning-half.d.ts +3 -0
  305. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-skinning.d.ts +3 -0
  306. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-transmission-half.d.ts +3 -0
  307. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-transmission.d.ts +3 -0
  308. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-weighted-half.d.ts +3 -0
  309. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-weighted.d.ts +3 -0
  310. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-half.d.ts +3 -0
  311. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen.d.ts +3 -0
  312. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-displacement-half.d.ts +3 -0
  313. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-displacement.d.ts +3 -0
  314. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-lod-fade-half.d.ts +3 -0
  315. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-lod-fade.d.ts +3 -0
  316. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-morph-half.d.ts +3 -0
  317. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-morph.d.ts +3 -0
  318. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-row-values-half.d.ts +3 -0
  319. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-row-values.d.ts +3 -0
  320. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-skinning-half.d.ts +3 -0
  321. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-skinning.d.ts +3 -0
  322. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-translucency-half.d.ts +3 -0
  323. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-translucency.d.ts +3 -0
  324. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-transmission-half.d.ts +3 -0
  325. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-transmission.d.ts +3 -0
  326. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-half.d.ts +3 -0
  327. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage.d.ts +3 -0
  328. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-hash-half.d.ts +3 -0
  329. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-hash.d.ts +3 -0
  330. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-morph-half.d.ts +3 -0
  331. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-morph.d.ts +3 -0
  332. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-row-values-half.d.ts +3 -0
  333. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-row-values.d.ts +3 -0
  334. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-skinning-half.d.ts +3 -0
  335. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-skinning.d.ts +3 -0
  336. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-translucency-half.d.ts +3 -0
  337. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-translucency.d.ts +3 -0
  338. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-transmission-half.d.ts +3 -0
  339. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-transmission.d.ts +3 -0
  340. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-weighted-half.d.ts +3 -0
  341. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-weighted.d.ts +3 -0
  342. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-half.d.ts +3 -0
  343. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement.d.ts +3 -0
  344. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-hash-and-morph-half.d.ts +3 -0
  345. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-hash-and-morph.d.ts +3 -0
  346. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-hash-and-row-values-half.d.ts +3 -0
  347. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-hash-and-row-values.d.ts +3 -0
  348. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-hash-and-skinning-half.d.ts +3 -0
  349. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-hash-and-skinning.d.ts +3 -0
  350. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-hash-and-translucency-half.d.ts +3 -0
  351. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-hash-and-translucency.d.ts +3 -0
  352. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-hash-half.d.ts +3 -0
  353. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-hash.d.ts +3 -0
  354. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-lod-fade-and-row-values-half.d.ts +3 -0
  355. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-lod-fade-and-row-values.d.ts +3 -0
  356. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-lod-fade-and-translucency-half.d.ts +3 -0
  357. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-lod-fade-and-translucency.d.ts +3 -0
  358. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-lod-fade-half.d.ts +3 -0
  359. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-lod-fade.d.ts +3 -0
  360. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-morph-and-skinning-half.d.ts +3 -0
  361. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-morph-and-skinning.d.ts +3 -0
  362. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-morph-and-translucency-half.d.ts +3 -0
  363. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-morph-and-translucency.d.ts +3 -0
  364. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-morph-and-transmission-half.d.ts +3 -0
  365. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-morph-and-transmission.d.ts +3 -0
  366. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-morph-and-weighted-half.d.ts +3 -0
  367. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-morph-and-weighted.d.ts +3 -0
  368. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-morph-half.d.ts +3 -0
  369. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-morph.d.ts +3 -0
  370. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-row-values-and-translucency-half.d.ts +3 -0
  371. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-row-values-and-translucency.d.ts +3 -0
  372. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-row-values-and-weighted-half.d.ts +3 -0
  373. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-row-values-and-weighted.d.ts +3 -0
  374. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-row-values-half.d.ts +3 -0
  375. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-row-values.d.ts +3 -0
  376. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-skinning-and-translucency-half.d.ts +3 -0
  377. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-skinning-and-translucency.d.ts +3 -0
  378. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-skinning-and-transmission-half.d.ts +3 -0
  379. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-skinning-and-transmission.d.ts +3 -0
  380. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-skinning-and-weighted-half.d.ts +3 -0
  381. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-skinning-and-weighted.d.ts +3 -0
  382. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-skinning-half.d.ts +3 -0
  383. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-skinning.d.ts +3 -0
  384. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-translucency-half.d.ts +3 -0
  385. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-translucency.d.ts +3 -0
  386. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-transmission-half.d.ts +3 -0
  387. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-transmission.d.ts +3 -0
  388. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-weighted-half.d.ts +3 -0
  389. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-weighted.d.ts +3 -0
  390. package/lib/generated/shaders-glsl-combos-area-lights-and-bump-half.d.ts +3 -0
  391. package/lib/generated/shaders-glsl-combos-area-lights-and-bump.d.ts +3 -0
  392. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-and-displacement-half.d.ts +3 -0
  393. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-and-displacement.d.ts +3 -0
  394. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-and-lod-fade-half.d.ts +3 -0
  395. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-and-lod-fade.d.ts +3 -0
  396. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-and-morph-half.d.ts +3 -0
  397. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-and-morph.d.ts +3 -0
  398. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-and-row-values-half.d.ts +3 -0
  399. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-and-row-values.d.ts +3 -0
  400. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-and-skinning-half.d.ts +3 -0
  401. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-and-skinning.d.ts +3 -0
  402. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-and-transmission-half.d.ts +3 -0
  403. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-and-transmission.d.ts +3 -0
  404. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-half.d.ts +3 -0
  405. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage.d.ts +3 -0
  406. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-and-hash-half.d.ts +3 -0
  407. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-and-hash.d.ts +3 -0
  408. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-and-morph-half.d.ts +3 -0
  409. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-and-morph.d.ts +3 -0
  410. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-and-row-values-half.d.ts +3 -0
  411. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-and-row-values.d.ts +3 -0
  412. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-and-skinning-half.d.ts +3 -0
  413. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-and-skinning.d.ts +3 -0
  414. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-and-transmission-half.d.ts +3 -0
  415. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-and-transmission.d.ts +3 -0
  416. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-and-weighted-half.d.ts +3 -0
  417. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-and-weighted.d.ts +3 -0
  418. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-half.d.ts +3 -0
  419. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement.d.ts +3 -0
  420. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-hash-and-morph-half.d.ts +3 -0
  421. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-hash-and-morph.d.ts +3 -0
  422. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-hash-and-row-values-half.d.ts +3 -0
  423. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-hash-and-row-values.d.ts +3 -0
  424. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-hash-and-skinning-half.d.ts +3 -0
  425. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-hash-and-skinning.d.ts +3 -0
  426. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-hash-half.d.ts +3 -0
  427. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-hash.d.ts +3 -0
  428. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-lod-fade-and-row-values-half.d.ts +3 -0
  429. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-lod-fade-and-row-values.d.ts +3 -0
  430. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-lod-fade-half.d.ts +3 -0
  431. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-lod-fade.d.ts +3 -0
  432. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-morph-and-skinning-half.d.ts +3 -0
  433. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-morph-and-skinning.d.ts +3 -0
  434. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-morph-and-transmission-half.d.ts +3 -0
  435. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-morph-and-transmission.d.ts +3 -0
  436. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-morph-and-weighted-half.d.ts +3 -0
  437. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-morph-and-weighted.d.ts +3 -0
  438. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-morph-half.d.ts +3 -0
  439. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-morph.d.ts +3 -0
  440. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-row-values-and-weighted-half.d.ts +3 -0
  441. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-row-values-and-weighted.d.ts +3 -0
  442. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-row-values-half.d.ts +3 -0
  443. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-row-values.d.ts +3 -0
  444. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-skinning-and-transmission-half.d.ts +3 -0
  445. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-skinning-and-transmission.d.ts +3 -0
  446. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-skinning-and-weighted-half.d.ts +3 -0
  447. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-skinning-and-weighted.d.ts +3 -0
  448. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-skinning-half.d.ts +3 -0
  449. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-skinning.d.ts +3 -0
  450. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-transmission-half.d.ts +3 -0
  451. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-transmission.d.ts +3 -0
  452. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-weighted-half.d.ts +3 -0
  453. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-weighted.d.ts +3 -0
  454. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-half.d.ts +3 -0
  455. package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen.d.ts +3 -0
  456. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-displacement-and-morph-half.d.ts +3 -0
  457. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-displacement-and-morph.d.ts +3 -0
  458. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-displacement-and-row-values-half.d.ts +3 -0
  459. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-displacement-and-row-values.d.ts +3 -0
  460. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-displacement-and-skinning-half.d.ts +3 -0
  461. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-displacement-and-skinning.d.ts +3 -0
  462. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-displacement-and-translucency-half.d.ts +3 -0
  463. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-displacement-and-translucency.d.ts +3 -0
  464. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-displacement-and-transmission-half.d.ts +3 -0
  465. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-displacement-and-transmission.d.ts +3 -0
  466. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-displacement-half.d.ts +3 -0
  467. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-displacement.d.ts +3 -0
  468. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-lod-fade-and-row-values-half.d.ts +3 -0
  469. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-lod-fade-and-row-values.d.ts +3 -0
  470. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-lod-fade-and-translucency-half.d.ts +3 -0
  471. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-lod-fade-and-translucency.d.ts +3 -0
  472. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-lod-fade-half.d.ts +3 -0
  473. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-lod-fade.d.ts +3 -0
  474. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-morph-and-skinning-half.d.ts +3 -0
  475. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-morph-and-skinning.d.ts +3 -0
  476. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-morph-and-translucency-half.d.ts +3 -0
  477. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-morph-and-translucency.d.ts +3 -0
  478. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-morph-and-transmission-half.d.ts +3 -0
  479. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-morph-and-transmission.d.ts +3 -0
  480. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-morph-half.d.ts +3 -0
  481. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-morph.d.ts +3 -0
  482. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-row-values-and-translucency-half.d.ts +3 -0
  483. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-row-values-and-translucency.d.ts +3 -0
  484. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-row-values-half.d.ts +3 -0
  485. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-row-values.d.ts +3 -0
  486. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-skinning-and-translucency-half.d.ts +3 -0
  487. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-skinning-and-translucency.d.ts +3 -0
  488. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-skinning-and-transmission-half.d.ts +3 -0
  489. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-skinning-and-transmission.d.ts +3 -0
  490. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-skinning-half.d.ts +3 -0
  491. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-skinning.d.ts +3 -0
  492. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-translucency-half.d.ts +3 -0
  493. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-translucency.d.ts +3 -0
  494. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-transmission-half.d.ts +3 -0
  495. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-transmission.d.ts +3 -0
  496. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-half.d.ts +3 -0
  497. package/lib/generated/shaders-glsl-combos-area-lights-and-coverage.d.ts +3 -0
  498. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-hash-and-morph-half.d.ts +3 -0
  499. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-hash-and-morph.d.ts +3 -0
  500. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-hash-and-row-values-half.d.ts +3 -0
  501. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-hash-and-row-values.d.ts +3 -0
  502. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-hash-and-skinning-half.d.ts +3 -0
  503. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-hash-and-skinning.d.ts +3 -0
  504. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-hash-and-translucency-half.d.ts +3 -0
  505. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-hash-and-translucency.d.ts +3 -0
  506. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-hash-half.d.ts +3 -0
  507. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-hash.d.ts +3 -0
  508. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-moment-and-morph-half.d.ts +3 -0
  509. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-moment-and-morph.d.ts +3 -0
  510. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-moment-and-row-values-half.d.ts +3 -0
  511. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-moment-and-row-values.d.ts +3 -0
  512. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-moment-and-skinning-half.d.ts +3 -0
  513. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-moment-and-skinning.d.ts +3 -0
  514. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-moment-and-translucency-half.d.ts +3 -0
  515. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-moment-and-translucency.d.ts +3 -0
  516. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-moment-half.d.ts +3 -0
  517. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-moment.d.ts +3 -0
  518. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-morph-and-skinning-half.d.ts +3 -0
  519. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-morph-and-skinning.d.ts +3 -0
  520. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-morph-and-translucency-half.d.ts +3 -0
  521. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-morph-and-translucency.d.ts +3 -0
  522. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-morph-and-transmission-half.d.ts +3 -0
  523. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-morph-and-transmission.d.ts +3 -0
  524. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-morph-and-weighted-half.d.ts +3 -0
  525. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-morph-and-weighted.d.ts +3 -0
  526. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-morph-half.d.ts +3 -0
  527. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-morph.d.ts +3 -0
  528. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-row-values-and-translucency-half.d.ts +3 -0
  529. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-row-values-and-translucency.d.ts +3 -0
  530. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-row-values-and-weighted-half.d.ts +3 -0
  531. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-row-values-and-weighted.d.ts +3 -0
  532. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-row-values-half.d.ts +3 -0
  533. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-row-values.d.ts +3 -0
  534. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-skinning-and-translucency-half.d.ts +3 -0
  535. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-skinning-and-translucency.d.ts +3 -0
  536. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-skinning-and-transmission-half.d.ts +3 -0
  537. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-skinning-and-transmission.d.ts +3 -0
  538. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-skinning-and-weighted-half.d.ts +3 -0
  539. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-skinning-and-weighted.d.ts +3 -0
  540. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-skinning-half.d.ts +3 -0
  541. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-skinning.d.ts +3 -0
  542. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-translucency-half.d.ts +3 -0
  543. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-translucency.d.ts +3 -0
  544. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-transmission-half.d.ts +3 -0
  545. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-transmission.d.ts +3 -0
  546. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-weighted-half.d.ts +3 -0
  547. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-weighted.d.ts +3 -0
  548. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-half.d.ts +3 -0
  549. package/lib/generated/shaders-glsl-combos-area-lights-and-displacement.d.ts +3 -0
  550. package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-morph-and-skinning-half.d.ts +3 -0
  551. package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-morph-and-skinning.d.ts +3 -0
  552. package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-morph-and-translucency-half.d.ts +3 -0
  553. package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-morph-and-translucency.d.ts +3 -0
  554. package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-morph-half.d.ts +3 -0
  555. package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-morph.d.ts +3 -0
  556. package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-row-values-and-translucency-half.d.ts +3 -0
  557. package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-row-values-and-translucency.d.ts +3 -0
  558. package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-row-values-half.d.ts +3 -0
  559. package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-row-values.d.ts +3 -0
  560. package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-skinning-and-translucency-half.d.ts +3 -0
  561. package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-skinning-and-translucency.d.ts +3 -0
  562. package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-skinning-half.d.ts +3 -0
  563. package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-skinning.d.ts +3 -0
  564. package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-translucency-half.d.ts +3 -0
  565. package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-translucency.d.ts +3 -0
  566. package/lib/generated/shaders-glsl-combos-area-lights-and-hash-half.d.ts +3 -0
  567. package/lib/generated/shaders-glsl-combos-area-lights-and-hash.d.ts +3 -0
  568. package/lib/generated/shaders-glsl-combos-area-lights-and-lines.d.ts +3 -0
  569. package/lib/generated/shaders-glsl-combos-area-lights-and-lod-fade-and-row-values-and-translucency-half.d.ts +3 -0
  570. package/lib/generated/shaders-glsl-combos-area-lights-and-lod-fade-and-row-values-and-translucency.d.ts +3 -0
  571. package/lib/generated/shaders-glsl-combos-area-lights-and-lod-fade-and-row-values-half.d.ts +3 -0
  572. package/lib/generated/shaders-glsl-combos-area-lights-and-lod-fade-and-row-values.d.ts +3 -0
  573. package/lib/generated/shaders-glsl-combos-area-lights-and-lod-fade-and-translucency-half.d.ts +3 -0
  574. package/lib/generated/shaders-glsl-combos-area-lights-and-lod-fade-and-translucency.d.ts +3 -0
  575. package/lib/generated/shaders-glsl-combos-area-lights-and-lod-fade-half.d.ts +3 -0
  576. package/lib/generated/shaders-glsl-combos-area-lights-and-lod-fade.d.ts +3 -0
  577. package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-morph-and-skinning-half.d.ts +3 -0
  578. package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-morph-and-skinning.d.ts +3 -0
  579. package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-morph-and-translucency-half.d.ts +3 -0
  580. package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-morph-and-translucency.d.ts +3 -0
  581. package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-morph-half.d.ts +3 -0
  582. package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-morph.d.ts +3 -0
  583. package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-row-values-and-translucency-half.d.ts +3 -0
  584. package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-row-values-and-translucency.d.ts +3 -0
  585. package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-row-values-half.d.ts +3 -0
  586. package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-row-values.d.ts +3 -0
  587. package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-skinning-and-translucency-half.d.ts +3 -0
  588. package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-skinning-and-translucency.d.ts +3 -0
  589. package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-skinning-half.d.ts +3 -0
  590. package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-skinning.d.ts +3 -0
  591. package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-translucency-half.d.ts +3 -0
  592. package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-translucency.d.ts +3 -0
  593. package/lib/generated/shaders-glsl-combos-area-lights-and-moment-half.d.ts +3 -0
  594. package/lib/generated/shaders-glsl-combos-area-lights-and-moment.d.ts +3 -0
  595. package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-skinning-and-translucency-half.d.ts +3 -0
  596. package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-skinning-and-translucency.d.ts +3 -0
  597. package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-skinning-and-transmission-half.d.ts +3 -0
  598. package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-skinning-and-transmission.d.ts +3 -0
  599. package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-skinning-and-weighted-half.d.ts +3 -0
  600. package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-skinning-and-weighted.d.ts +3 -0
  601. package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-skinning-half.d.ts +3 -0
  602. package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-skinning.d.ts +3 -0
  603. package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-translucency-half.d.ts +3 -0
  604. package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-translucency.d.ts +3 -0
  605. package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-transmission-half.d.ts +3 -0
  606. package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-transmission.d.ts +3 -0
  607. package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-weighted-half.d.ts +3 -0
  608. package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-weighted.d.ts +3 -0
  609. package/lib/generated/shaders-glsl-combos-area-lights-and-morph-half.d.ts +3 -0
  610. package/lib/generated/shaders-glsl-combos-area-lights-and-morph.d.ts +3 -0
  611. package/lib/generated/shaders-glsl-combos-area-lights-and-row-values-and-translucency-half.d.ts +3 -0
  612. package/lib/generated/shaders-glsl-combos-area-lights-and-row-values-and-translucency.d.ts +3 -0
  613. package/lib/generated/shaders-glsl-combos-area-lights-and-row-values-and-weighted-half.d.ts +3 -0
  614. package/lib/generated/shaders-glsl-combos-area-lights-and-row-values-and-weighted.d.ts +3 -0
  615. package/lib/generated/shaders-glsl-combos-area-lights-and-row-values-half.d.ts +3 -0
  616. package/lib/generated/shaders-glsl-combos-area-lights-and-row-values.d.ts +3 -0
  617. package/lib/generated/shaders-glsl-combos-area-lights-and-skinning-and-translucency-half.d.ts +3 -0
  618. package/lib/generated/shaders-glsl-combos-area-lights-and-skinning-and-translucency.d.ts +3 -0
  619. package/lib/generated/shaders-glsl-combos-area-lights-and-skinning-and-transmission-half.d.ts +3 -0
  620. package/lib/generated/shaders-glsl-combos-area-lights-and-skinning-and-transmission.d.ts +3 -0
  621. package/lib/generated/shaders-glsl-combos-area-lights-and-skinning-and-weighted-half.d.ts +3 -0
  622. package/lib/generated/shaders-glsl-combos-area-lights-and-skinning-and-weighted.d.ts +3 -0
  623. package/lib/generated/shaders-glsl-combos-area-lights-and-skinning-half.d.ts +3 -0
  624. package/lib/generated/shaders-glsl-combos-area-lights-and-skinning.d.ts +3 -0
  625. package/lib/generated/shaders-glsl-combos-area-lights-and-translucency-half.d.ts +3 -0
  626. package/lib/generated/shaders-glsl-combos-area-lights-and-translucency.d.ts +3 -0
  627. package/lib/generated/shaders-glsl-combos-area-lights-and-transmission-half.d.ts +3 -0
  628. package/lib/generated/shaders-glsl-combos-area-lights-and-transmission.d.ts +3 -0
  629. package/lib/generated/shaders-glsl-combos-area-lights-and-weighted-half.d.ts +3 -0
  630. package/lib/generated/shaders-glsl-combos-area-lights-and-weighted.d.ts +3 -0
  631. package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-coverage-half.d.ts +3 -0
  632. package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-coverage.d.ts +3 -0
  633. package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-displacement-half.d.ts +3 -0
  634. package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-displacement.d.ts +3 -0
  635. package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-hash-half.d.ts +3 -0
  636. package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-hash.d.ts +3 -0
  637. package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-lod-fade-half.d.ts +3 -0
  638. package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-lod-fade.d.ts +3 -0
  639. package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-morph-half.d.ts +3 -0
  640. package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-morph.d.ts +3 -0
  641. package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-row-values-half.d.ts +3 -0
  642. package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-row-values.d.ts +3 -0
  643. package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-skinning-half.d.ts +3 -0
  644. package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-skinning.d.ts +3 -0
  645. package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-transmission-half.d.ts +3 -0
  646. package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-transmission.d.ts +3 -0
  647. package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-weighted-half.d.ts +3 -0
  648. package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-weighted.d.ts +3 -0
  649. package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-half.d.ts +3 -0
  650. package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen.d.ts +3 -0
  651. package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-displacement-half.d.ts +3 -0
  652. package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-displacement.d.ts +3 -0
  653. package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-lod-fade-half.d.ts +3 -0
  654. package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-lod-fade.d.ts +3 -0
  655. package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-morph-half.d.ts +3 -0
  656. package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-morph.d.ts +3 -0
  657. package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-row-values-half.d.ts +3 -0
  658. package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-row-values.d.ts +3 -0
  659. package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-skinning-half.d.ts +3 -0
  660. package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-skinning.d.ts +3 -0
  661. package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-translucency-half.d.ts +3 -0
  662. package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-translucency.d.ts +3 -0
  663. package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-transmission-half.d.ts +3 -0
  664. package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-transmission.d.ts +3 -0
  665. package/lib/generated/shaders-glsl-combos-bump-and-coverage-half.d.ts +3 -0
  666. package/lib/generated/shaders-glsl-combos-bump-and-coverage.d.ts +3 -0
  667. package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-hash-half.d.ts +3 -0
  668. package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-hash.d.ts +3 -0
  669. package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-morph-half.d.ts +3 -0
  670. package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-morph.d.ts +3 -0
  671. package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-row-values-half.d.ts +3 -0
  672. package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-row-values.d.ts +3 -0
  673. package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-skinning-half.d.ts +3 -0
  674. package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-skinning.d.ts +3 -0
  675. package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-translucency-half.d.ts +3 -0
  676. package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-translucency.d.ts +3 -0
  677. package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-transmission-half.d.ts +3 -0
  678. package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-transmission.d.ts +3 -0
  679. package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-weighted-half.d.ts +3 -0
  680. package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-weighted.d.ts +3 -0
  681. package/lib/generated/shaders-glsl-combos-bump-and-displacement-half.d.ts +3 -0
  682. package/lib/generated/shaders-glsl-combos-bump-and-displacement.d.ts +3 -0
  683. package/lib/generated/shaders-glsl-combos-bump-and-hash-and-morph-half.d.ts +3 -0
  684. package/lib/generated/shaders-glsl-combos-bump-and-hash-and-morph.d.ts +3 -0
  685. package/lib/generated/shaders-glsl-combos-bump-and-hash-and-row-values-half.d.ts +3 -0
  686. package/lib/generated/shaders-glsl-combos-bump-and-hash-and-row-values.d.ts +3 -0
  687. package/lib/generated/shaders-glsl-combos-bump-and-hash-and-skinning-half.d.ts +3 -0
  688. package/lib/generated/shaders-glsl-combos-bump-and-hash-and-skinning.d.ts +3 -0
  689. package/lib/generated/shaders-glsl-combos-bump-and-hash-and-translucency-half.d.ts +3 -0
  690. package/lib/generated/shaders-glsl-combos-bump-and-hash-and-translucency.d.ts +3 -0
  691. package/lib/generated/shaders-glsl-combos-bump-and-hash-half.d.ts +3 -0
  692. package/lib/generated/shaders-glsl-combos-bump-and-hash.d.ts +3 -0
  693. package/lib/generated/shaders-glsl-combos-bump-and-lod-fade-and-row-values-half.d.ts +3 -0
  694. package/lib/generated/shaders-glsl-combos-bump-and-lod-fade-and-row-values.d.ts +3 -0
  695. package/lib/generated/shaders-glsl-combos-bump-and-lod-fade-and-translucency-half.d.ts +3 -0
  696. package/lib/generated/shaders-glsl-combos-bump-and-lod-fade-and-translucency.d.ts +3 -0
  697. package/lib/generated/shaders-glsl-combos-bump-and-lod-fade-half.d.ts +3 -0
  698. package/lib/generated/shaders-glsl-combos-bump-and-lod-fade.d.ts +3 -0
  699. package/lib/generated/shaders-glsl-combos-bump-and-morph-and-skinning-half.d.ts +3 -0
  700. package/lib/generated/shaders-glsl-combos-bump-and-morph-and-skinning.d.ts +3 -0
  701. package/lib/generated/shaders-glsl-combos-bump-and-morph-and-translucency-half.d.ts +3 -0
  702. package/lib/generated/shaders-glsl-combos-bump-and-morph-and-translucency.d.ts +3 -0
  703. package/lib/generated/shaders-glsl-combos-bump-and-morph-and-transmission-half.d.ts +3 -0
  704. package/lib/generated/shaders-glsl-combos-bump-and-morph-and-transmission.d.ts +3 -0
  705. package/lib/generated/shaders-glsl-combos-bump-and-morph-and-weighted-half.d.ts +3 -0
  706. package/lib/generated/shaders-glsl-combos-bump-and-morph-and-weighted.d.ts +3 -0
  707. package/lib/generated/shaders-glsl-combos-bump-and-morph-half.d.ts +3 -0
  708. package/lib/generated/shaders-glsl-combos-bump-and-morph.d.ts +3 -0
  709. package/lib/generated/shaders-glsl-combos-bump-and-row-values-and-translucency-half.d.ts +3 -0
  710. package/lib/generated/shaders-glsl-combos-bump-and-row-values-and-translucency.d.ts +3 -0
  711. package/lib/generated/shaders-glsl-combos-bump-and-row-values-and-weighted-half.d.ts +3 -0
  712. package/lib/generated/shaders-glsl-combos-bump-and-row-values-and-weighted.d.ts +3 -0
  713. package/lib/generated/shaders-glsl-combos-bump-and-row-values-half.d.ts +3 -0
  714. package/lib/generated/shaders-glsl-combos-bump-and-row-values.d.ts +3 -0
  715. package/lib/generated/shaders-glsl-combos-bump-and-skinning-and-translucency-half.d.ts +3 -0
  716. package/lib/generated/shaders-glsl-combos-bump-and-skinning-and-translucency.d.ts +3 -0
  717. package/lib/generated/shaders-glsl-combos-bump-and-skinning-and-transmission-half.d.ts +3 -0
  718. package/lib/generated/shaders-glsl-combos-bump-and-skinning-and-transmission.d.ts +3 -0
  719. package/lib/generated/shaders-glsl-combos-bump-and-skinning-and-weighted-half.d.ts +3 -0
  720. package/lib/generated/shaders-glsl-combos-bump-and-skinning-and-weighted.d.ts +3 -0
  721. package/lib/generated/shaders-glsl-combos-bump-and-skinning-half.d.ts +3 -0
  722. package/lib/generated/shaders-glsl-combos-bump-and-skinning.d.ts +3 -0
  723. package/lib/generated/shaders-glsl-combos-bump-and-translucency-half.d.ts +3 -0
  724. package/lib/generated/shaders-glsl-combos-bump-and-translucency.d.ts +3 -0
  725. package/lib/generated/shaders-glsl-combos-bump-and-transmission-half.d.ts +3 -0
  726. package/lib/generated/shaders-glsl-combos-bump-and-transmission.d.ts +3 -0
  727. package/lib/generated/shaders-glsl-combos-bump-and-weighted-half.d.ts +3 -0
  728. package/lib/generated/shaders-glsl-combos-bump-and-weighted.d.ts +3 -0
  729. package/lib/generated/shaders-glsl-combos-coat-sheen-and-coverage-half.d.ts +3 -0
  730. package/lib/generated/shaders-glsl-combos-coat-sheen-and-coverage.d.ts +3 -0
  731. package/lib/generated/shaders-glsl-combos-coat-sheen-and-displacement-half.d.ts +3 -0
  732. package/lib/generated/shaders-glsl-combos-coat-sheen-and-displacement.d.ts +3 -0
  733. package/lib/generated/shaders-glsl-combos-coat-sheen-and-hash-half.d.ts +3 -0
  734. package/lib/generated/shaders-glsl-combos-coat-sheen-and-hash.d.ts +3 -0
  735. package/lib/generated/shaders-glsl-combos-coat-sheen-and-lod-fade-half.d.ts +3 -0
  736. package/lib/generated/shaders-glsl-combos-coat-sheen-and-lod-fade.d.ts +3 -0
  737. package/lib/generated/shaders-glsl-combos-coat-sheen-and-morph-half.d.ts +3 -0
  738. package/lib/generated/shaders-glsl-combos-coat-sheen-and-morph.d.ts +3 -0
  739. package/lib/generated/shaders-glsl-combos-coat-sheen-and-row-values-half.d.ts +3 -0
  740. package/lib/generated/shaders-glsl-combos-coat-sheen-and-row-values.d.ts +3 -0
  741. package/lib/generated/shaders-glsl-combos-coat-sheen-and-skinning-half.d.ts +3 -0
  742. package/lib/generated/shaders-glsl-combos-coat-sheen-and-skinning.d.ts +3 -0
  743. package/lib/generated/shaders-glsl-combos-coat-sheen-and-transmission-half.d.ts +3 -0
  744. package/lib/generated/shaders-glsl-combos-coat-sheen-and-transmission.d.ts +3 -0
  745. package/lib/generated/shaders-glsl-combos-coat-sheen-and-weighted-half.d.ts +3 -0
  746. package/lib/generated/shaders-glsl-combos-coat-sheen-and-weighted.d.ts +3 -0
  747. package/lib/generated/shaders-glsl-combos-coverage-half.d.ts +3 -0
  748. package/lib/generated/shaders-glsl-combos-coverage.d.ts +3 -0
  749. package/lib/generated/shaders-glsl-combos-cutout.d.ts +3 -0
  750. package/lib/generated/shaders-glsl-combos-decals-half.d.ts +3 -0
  751. package/lib/generated/shaders-glsl-combos-decals.d.ts +3 -0
  752. package/lib/generated/shaders-glsl-combos-displacement-half.d.ts +3 -0
  753. package/lib/generated/shaders-glsl-combos-displacement.d.ts +3 -0
  754. package/lib/generated/shaders-glsl-combos-hash-half.d.ts +3 -0
  755. package/lib/generated/shaders-glsl-combos-hash.d.ts +3 -0
  756. package/lib/generated/shaders-glsl-combos-lod-fade-half.d.ts +3 -0
  757. package/lib/generated/shaders-glsl-combos-lod-fade.d.ts +3 -0
  758. package/lib/generated/shaders-glsl-combos-moment-half.d.ts +3 -0
  759. package/lib/generated/shaders-glsl-combos-moment.d.ts +3 -0
  760. package/lib/generated/shaders-glsl-combos-morph-half.d.ts +3 -0
  761. package/lib/generated/shaders-glsl-combos-morph.d.ts +3 -0
  762. package/lib/generated/shaders-glsl-combos-motion.d.ts +3 -0
  763. package/lib/generated/shaders-glsl-combos-picking.d.ts +3 -0
  764. package/lib/generated/shaders-glsl-combos-probe-grid-half.d.ts +3 -0
  765. package/lib/generated/shaders-glsl-combos-probe-grid.d.ts +3 -0
  766. package/lib/generated/shaders-glsl-combos-row-values-half.d.ts +3 -0
  767. package/lib/generated/shaders-glsl-combos-row-values.d.ts +3 -0
  768. package/lib/generated/shaders-glsl-combos-skinning-half.d.ts +3 -0
  769. package/lib/generated/shaders-glsl-combos-skinning.d.ts +3 -0
  770. package/lib/generated/shaders-glsl-combos-sprites.d.ts +3 -0
  771. package/lib/generated/shaders-glsl-combos-subsurface-half.d.ts +3 -0
  772. package/lib/generated/shaders-glsl-combos-subsurface.d.ts +3 -0
  773. package/lib/generated/shaders-probe-glsl.d.ts +11 -0
  774. package/lib/generated/shaders-probe-wgsl.d.ts +11 -0
  775. package/lib/generated/shaders-sky-volume-env-glsl.d.ts +11 -0
  776. package/lib/generated/shaders-sky-volume-env-wgsl.d.ts +11 -0
  777. package/lib/generated/shaders-sky-volume-panorama-glsl.d.ts +11 -0
  778. package/lib/generated/shaders-sky-volume-panorama-wgsl.d.ts +11 -0
  779. package/lib/generated/shaders-wgsl-combos-area-lights-and-bump-half.d.ts +3 -0
  780. package/lib/generated/shaders-wgsl-combos-area-lights-and-bump.d.ts +3 -0
  781. package/lib/generated/shaders-wgsl-combos-area-lights-and-coat-sheen-half.d.ts +3 -0
  782. package/lib/generated/shaders-wgsl-combos-area-lights-and-coat-sheen.d.ts +3 -0
  783. package/lib/generated/shaders-wgsl-combos-area-lights-and-coverage-half.d.ts +3 -0
  784. package/lib/generated/shaders-wgsl-combos-area-lights-and-coverage.d.ts +3 -0
  785. package/lib/generated/shaders-wgsl-combos-area-lights-and-displacement-half.d.ts +3 -0
  786. package/lib/generated/shaders-wgsl-combos-area-lights-and-displacement.d.ts +3 -0
  787. package/lib/generated/shaders-wgsl-combos-area-lights-and-hash-half.d.ts +3 -0
  788. package/lib/generated/shaders-wgsl-combos-area-lights-and-hash.d.ts +3 -0
  789. package/lib/generated/shaders-wgsl-combos-area-lights-and-instance-index-half.d.ts +3 -0
  790. package/lib/generated/shaders-wgsl-combos-area-lights-and-instance-index.d.ts +3 -0
  791. package/lib/generated/shaders-wgsl-combos-area-lights-and-lines.d.ts +3 -0
  792. package/lib/generated/shaders-wgsl-combos-area-lights-and-lod-fade-half.d.ts +3 -0
  793. package/lib/generated/shaders-wgsl-combos-area-lights-and-lod-fade.d.ts +3 -0
  794. package/lib/generated/shaders-wgsl-combos-area-lights-and-moment-half.d.ts +3 -0
  795. package/lib/generated/shaders-wgsl-combos-area-lights-and-moment.d.ts +3 -0
  796. package/lib/generated/shaders-wgsl-combos-area-lights-and-row-values-half.d.ts +3 -0
  797. package/lib/generated/shaders-wgsl-combos-area-lights-and-row-values.d.ts +3 -0
  798. package/lib/generated/shaders-wgsl-combos-area-lights-and-skinning-half.d.ts +3 -0
  799. package/lib/generated/shaders-wgsl-combos-area-lights-and-skinning.d.ts +3 -0
  800. package/lib/generated/shaders-wgsl-combos-area-lights-and-translucency-half.d.ts +3 -0
  801. package/lib/generated/shaders-wgsl-combos-area-lights-and-translucency.d.ts +3 -0
  802. package/lib/generated/shaders-wgsl-combos-area-lights-and-transmission-half.d.ts +3 -0
  803. package/lib/generated/shaders-wgsl-combos-area-lights-and-transmission.d.ts +3 -0
  804. package/lib/generated/shaders-wgsl-combos-area-lights-and-weighted-half.d.ts +3 -0
  805. package/lib/generated/shaders-wgsl-combos-area-lights-and-weighted.d.ts +3 -0
  806. package/lib/generated/shaders-wgsl-combos-bump-half.d.ts +3 -0
  807. package/lib/generated/shaders-wgsl-combos-bump.d.ts +3 -0
  808. package/lib/generated/shaders-wgsl-combos-coat-sheen-half.d.ts +3 -0
  809. package/lib/generated/shaders-wgsl-combos-coat-sheen.d.ts +3 -0
  810. package/lib/generated/shaders-wgsl-combos-coverage-half.d.ts +3 -0
  811. package/lib/generated/shaders-wgsl-combos-coverage.d.ts +3 -0
  812. package/lib/generated/shaders-wgsl-combos-cutout.d.ts +3 -0
  813. package/lib/generated/shaders-wgsl-combos-decals-half.d.ts +3 -0
  814. package/lib/generated/shaders-wgsl-combos-decals.d.ts +3 -0
  815. package/lib/generated/shaders-wgsl-combos-displacement-half.d.ts +3 -0
  816. package/lib/generated/shaders-wgsl-combos-displacement.d.ts +3 -0
  817. package/lib/generated/shaders-wgsl-combos-hash-half.d.ts +3 -0
  818. package/lib/generated/shaders-wgsl-combos-hash.d.ts +3 -0
  819. package/lib/generated/shaders-wgsl-combos-instance-index-half.d.ts +3 -0
  820. package/lib/generated/shaders-wgsl-combos-instance-index.d.ts +3 -0
  821. package/lib/generated/shaders-wgsl-combos-lod-fade-half.d.ts +3 -0
  822. package/lib/generated/shaders-wgsl-combos-lod-fade.d.ts +3 -0
  823. package/lib/generated/shaders-wgsl-combos-moment-half.d.ts +3 -0
  824. package/lib/generated/shaders-wgsl-combos-moment.d.ts +3 -0
  825. package/lib/generated/shaders-wgsl-combos-motion.d.ts +3 -0
  826. package/lib/generated/shaders-wgsl-combos-picking.d.ts +3 -0
  827. package/lib/generated/shaders-wgsl-combos-probe-grid-half.d.ts +3 -0
  828. package/lib/generated/shaders-wgsl-combos-probe-grid.d.ts +3 -0
  829. package/lib/generated/shaders-wgsl-combos-row-values-half.d.ts +3 -0
  830. package/lib/generated/shaders-wgsl-combos-row-values.d.ts +3 -0
  831. package/lib/generated/shaders-wgsl-combos-skinning-half.d.ts +3 -0
  832. package/lib/generated/shaders-wgsl-combos-skinning.d.ts +3 -0
  833. package/lib/generated/shaders-wgsl-combos-sprites.d.ts +3 -0
  834. package/lib/generated/shaders-wgsl-combos-subsurface-half.d.ts +3 -0
  835. package/lib/generated/shaders-wgsl-combos-subsurface.d.ts +3 -0
  836. package/lib/generated/shaders.d.ts +1146 -0
  837. package/lib/gpu/canvas-release.d.ts +20 -0
  838. package/lib/gpu/canvas-release.js +67 -0
  839. package/lib/gpu/completion.d.ts +35 -0
  840. package/lib/gpu/completion.js +256 -0
  841. package/lib/gpu/device-shaders.d.ts +69 -0
  842. package/lib/gpu/device-shaders.js +177 -0
  843. package/lib/gpu/early-builds.d.ts +68 -0
  844. package/lib/gpu/early-builds.js +158 -0
  845. package/lib/gpu/effect-join.d.ts +83 -0
  846. package/lib/gpu/effect-join.js +134 -0
  847. package/lib/gpu/effect-joiner.d.ts +14 -0
  848. package/lib/gpu/effect-joiner.js +165 -0
  849. package/lib/gpu/environment-steps.d.ts +135 -0
  850. package/lib/gpu/environment-steps.js +210 -0
  851. package/lib/gpu/environment-words.d.ts +14 -0
  852. package/lib/gpu/environment-words.js +19 -0
  853. package/lib/gpu/environment.d.ts +4 -0
  854. package/lib/gpu/environment.js +8 -0
  855. package/lib/gpu/float-bits.d.ts +2 -0
  856. package/lib/gpu/float-bits.js +9 -0
  857. package/lib/gpu/line-vertices.d.ts +1 -0
  858. package/lib/gpu/line-vertices.js +14 -0
  859. package/lib/gpu/memory.d.ts +19 -0
  860. package/lib/gpu/memory.js +50 -0
  861. package/lib/gpu/particle-records.d.ts +1 -0
  862. package/lib/gpu/particle-records.js +15 -0
  863. package/lib/gpu/pipeline-name.d.ts +6 -0
  864. package/lib/gpu/pipeline-name.js +23 -0
  865. package/lib/gpu/probe-steps.d.ts +22 -0
  866. package/lib/gpu/probe-steps.js +43 -0
  867. package/lib/gpu/readback.d.ts +32 -0
  868. package/lib/gpu/readback.js +163 -0
  869. package/lib/gpu/variants.d.ts +16 -0
  870. package/lib/gpu/variants.js +67 -0
  871. package/lib/gpu/vertex-format.d.ts +46 -0
  872. package/lib/gpu/vertex-format.js +111 -0
  873. package/lib/gpu/webgl2/backend.d.ts +714 -0
  874. package/lib/gpu/webgl2/backend.js +2964 -0
  875. package/lib/gpu/webgl2/call-timing.d.ts +34 -0
  876. package/lib/gpu/webgl2/call-timing.js +143 -0
  877. package/lib/gpu/webgl2/context.d.ts +31 -0
  878. package/lib/gpu/webgl2/context.js +111 -0
  879. package/lib/gpu/webgl2/depth.d.ts +25 -0
  880. package/lib/gpu/webgl2/depth.js +30 -0
  881. package/lib/gpu/webgl2/environment.d.ts +65 -0
  882. package/lib/gpu/webgl2/environment.js +572 -0
  883. package/lib/gpu/webgl2/gpu-timer.d.ts +25 -0
  884. package/lib/gpu/webgl2/gpu-timer.js +93 -0
  885. package/lib/gpu/webgl2/probes.d.ts +38 -0
  886. package/lib/gpu/webgl2/probes.js +117 -0
  887. package/lib/gpu/webgl2/programs.d.ts +238 -0
  888. package/lib/gpu/webgl2/programs.js +487 -0
  889. package/lib/gpu/webgpu/backend.d.ts +460 -0
  890. package/lib/gpu/webgpu/backend.js +1812 -0
  891. package/lib/gpu/webgpu/buffer-reads.d.ts +42 -0
  892. package/lib/gpu/webgpu/buffer-reads.js +95 -0
  893. package/lib/gpu/webgpu/culled-counts.d.ts +79 -0
  894. package/lib/gpu/webgpu/culled-counts.js +259 -0
  895. package/lib/gpu/webgpu/draw-path-probe.d.ts +37 -0
  896. package/lib/gpu/webgpu/draw-path-probe.js +187 -0
  897. package/lib/gpu/webgpu/environment.d.ts +36 -0
  898. package/lib/gpu/webgpu/environment.js +735 -0
  899. package/lib/gpu/webgpu/first-pass.d.ts +13 -0
  900. package/lib/gpu/webgpu/first-pass.js +61 -0
  901. package/lib/gpu/webgpu/gpu-timer.d.ts +67 -0
  902. package/lib/gpu/webgpu/gpu-timer.js +328 -0
  903. package/lib/gpu/webgpu/indirect-arguments.d.ts +42 -0
  904. package/lib/gpu/webgpu/indirect-arguments.js +156 -0
  905. package/lib/gpu/webgpu/pipelines.d.ts +264 -0
  906. package/lib/gpu/webgpu/pipelines.js +2013 -0
  907. package/lib/gpu/webgpu/probes.d.ts +27 -0
  908. package/lib/gpu/webgpu/probes.js +190 -0
  909. package/lib/gpu/webgpu/reusable.d.ts +74 -0
  910. package/lib/gpu/webgpu/reusable.js +212 -0
  911. package/lib/gpu/webgpu/staging.d.ts +79 -0
  912. package/lib/gpu/webgpu/staging.js +238 -0
  913. package/lib/gpu/webgpu/upload-routes.d.ts +55 -0
  914. package/lib/gpu/webgpu/upload-routes.js +128 -0
  915. package/lib/index.d.ts +121 -0
  916. package/lib/index.js +54 -0
  917. package/lib/math/color.d.ts +18 -0
  918. package/lib/math/color.js +71 -0
  919. package/lib/math/create-math.d.ts +101 -0
  920. package/lib/math/create-math.js +207 -0
  921. package/lib/math/hex.d.ts +8 -0
  922. package/lib/math/hex.js +38 -0
  923. package/lib/math/index.d.ts +2 -0
  924. package/lib/math/index.js +11 -0
  925. package/lib/math/mat4.d.ts +22 -0
  926. package/lib/math/mat4.js +206 -0
  927. package/lib/math/math.d.ts +16 -0
  928. package/lib/math/math.js +42 -0
  929. package/lib/math/namespaces/math.d.ts +7 -0
  930. package/lib/math/namespaces/math.js +14 -0
  931. package/lib/math/namespaces/quat.d.ts +20 -0
  932. package/lib/math/namespaces/quat.js +30 -0
  933. package/lib/math/namespaces/vec3.d.ts +4 -0
  934. package/lib/math/namespaces/vec3.js +8 -0
  935. package/lib/math/quat.d.ts +36 -0
  936. package/lib/math/quat.js +224 -0
  937. package/lib/math/random.d.ts +16 -0
  938. package/lib/math/random.js +57 -0
  939. package/lib/math/types.d.ts +43 -0
  940. package/lib/math/types.js +4 -0
  941. package/lib/math/vec3.d.ts +43 -0
  942. package/lib/math/vec3.js +187 -0
  943. package/lib/page/abortable.d.ts +2 -0
  944. package/lib/page/abortable.js +19 -0
  945. package/lib/page/browser-check.d.ts +8 -0
  946. package/lib/page/browser-check.js +23 -0
  947. package/lib/page/canvas-watch.d.ts +34 -0
  948. package/lib/page/canvas-watch.js +141 -0
  949. package/lib/page/capabilities.d.ts +201 -0
  950. package/lib/page/capabilities.js +409 -0
  951. package/lib/page/check-store.d.ts +54 -0
  952. package/lib/page/check-store.js +169 -0
  953. package/lib/page/display.d.ts +2 -0
  954. package/lib/page/display.js +25 -0
  955. package/lib/page/early-core.d.ts +1 -0
  956. package/lib/page/early-core.js +23 -0
  957. package/lib/page/engine.d.ts +942 -0
  958. package/lib/page/engine.js +2459 -0
  959. package/lib/page/first-frame.d.ts +16 -0
  960. package/lib/page/first-frame.js +35 -0
  961. package/lib/page/frame-stats.d.ts +402 -0
  962. package/lib/page/frame-stats.js +389 -0
  963. package/lib/page/gamepads.d.ts +37 -0
  964. package/lib/page/gamepads.js +123 -0
  965. package/lib/page/held-input.d.ts +19 -0
  966. package/lib/page/held-input.js +54 -0
  967. package/lib/page/hold.d.ts +186 -0
  968. package/lib/page/hold.js +49 -0
  969. package/lib/page/input-ring.d.ts +13 -0
  970. package/lib/page/input-ring.js +25 -0
  971. package/lib/page/input.d.ts +6 -0
  972. package/lib/page/input.js +159 -0
  973. package/lib/page/isolation-check.d.ts +14 -0
  974. package/lib/page/isolation-check.js +21 -0
  975. package/lib/page/label-loop.d.ts +80 -0
  976. package/lib/page/label-loop.js +417 -0
  977. package/lib/page/labels.d.ts +56 -0
  978. package/lib/page/labels.js +102 -0
  979. package/lib/page/limits.d.ts +321 -0
  980. package/lib/page/limits.js +323 -0
  981. package/lib/page/loader.d.ts +78 -0
  982. package/lib/page/loader.js +149 -0
  983. package/lib/page/main-thread.d.ts +10 -0
  984. package/lib/page/main-thread.js +41 -0
  985. package/lib/page/memory-pool.d.ts +26 -0
  986. package/lib/page/memory-pool.js +69 -0
  987. package/lib/page/ownership.d.ts +65 -0
  988. package/lib/page/ownership.js +166 -0
  989. package/lib/page/permutation-recording.d.ts +26 -0
  990. package/lib/page/permutation-recording.js +32 -0
  991. package/lib/page/pipeline-store.d.ts +25 -0
  992. package/lib/page/pipeline-store.js +84 -0
  993. package/lib/page/pointer-lock.d.ts +14 -0
  994. package/lib/page/pointer-lock.js +60 -0
  995. package/lib/page/preferences.d.ts +2 -0
  996. package/lib/page/preferences.js +11 -0
  997. package/lib/page/record-button.d.ts +5 -0
  998. package/lib/page/record-button.js +60 -0
  999. package/lib/page/start-marker.d.ts +47 -0
  1000. package/lib/page/start-marker.js +119 -0
  1001. package/lib/page/stats-switch.d.ts +16 -0
  1002. package/lib/page/stats-switch.js +38 -0
  1003. package/lib/page/stop-jobs.d.ts +37 -0
  1004. package/lib/page/stop-jobs.js +87 -0
  1005. package/lib/page/switches.d.ts +347 -0
  1006. package/lib/page/switches.js +150 -0
  1007. package/lib/page/videos.d.ts +70 -0
  1008. package/lib/page/videos.js +244 -0
  1009. package/lib/quality/budget.d.ts +14 -0
  1010. package/lib/quality/budget.js +25 -0
  1011. package/lib/quality/check.d.ts +119 -0
  1012. package/lib/quality/check.js +84 -0
  1013. package/lib/quality/chooser.d.ts +98 -0
  1014. package/lib/quality/chooser.js +108 -0
  1015. package/lib/quality/device-hints.d.ts +8 -0
  1016. package/lib/quality/device-hints.js +18 -0
  1017. package/lib/quality/governor.d.ts +571 -0
  1018. package/lib/quality/governor.js +1293 -0
  1019. package/lib/quality/preset-docs.d.ts +402 -0
  1020. package/lib/quality/preset-docs.js +179 -0
  1021. package/lib/quality/presets.d.ts +821 -0
  1022. package/lib/quality/presets.js +678 -0
  1023. package/lib/render/direct-loop.d.ts +4 -0
  1024. package/lib/render/direct-loop.js +52 -0
  1025. package/lib/render/draw.d.ts +66 -0
  1026. package/lib/render/draw.js +111 -0
  1027. package/lib/render/load-draw.d.ts +12 -0
  1028. package/lib/render/load-draw.js +18 -0
  1029. package/lib/render/loop.d.ts +241 -0
  1030. package/lib/render/loop.js +566 -0
  1031. package/lib/render/loss.d.ts +53 -0
  1032. package/lib/render/loss.js +127 -0
  1033. package/lib/render/pacer.d.ts +24 -0
  1034. package/lib/render/pacer.js +51 -0
  1035. package/lib/render/recovery.d.ts +82 -0
  1036. package/lib/render/recovery.js +160 -0
  1037. package/lib/render/refresh.d.ts +38 -0
  1038. package/lib/render/refresh.js +111 -0
  1039. package/lib/render/renderer.d.ts +192 -0
  1040. package/lib/render/renderer.js +295 -0
  1041. package/lib/render/scene-renderer.d.ts +135 -0
  1042. package/lib/render/scene-renderer.js +216 -0
  1043. package/lib/render/shader-salt.d.ts +5 -0
  1044. package/lib/render/shader-salt.js +31 -0
  1045. package/lib/render/webgl2-renderers.d.ts +11 -0
  1046. package/lib/render/webgl2-renderers.js +227 -0
  1047. package/lib/render/webgpu-renderers.d.ts +10 -0
  1048. package/lib/render/webgpu-renderers.js +254 -0
  1049. package/lib/scene/addon-debug-views.d.ts +30 -0
  1050. package/lib/scene/addon-debug-views.js +63 -0
  1051. package/lib/scene/animation.d.ts +547 -0
  1052. package/lib/scene/animation.js +1425 -0
  1053. package/lib/scene/area-light-tables.d.ts +32 -0
  1054. package/lib/scene/area-light-tables.js +89 -0
  1055. package/lib/scene/assets.d.ts +375 -0
  1056. package/lib/scene/assets.js +736 -0
  1057. package/lib/scene/background.d.ts +238 -0
  1058. package/lib/scene/background.js +470 -0
  1059. package/lib/scene/baked-light.d.ts +60 -0
  1060. package/lib/scene/baked-light.js +300 -0
  1061. package/lib/scene/builtin-environments.d.ts +36 -0
  1062. package/lib/scene/builtin-environments.js +43 -0
  1063. package/lib/scene/chunk-rows.d.ts +81 -0
  1064. package/lib/scene/chunk-rows.js +146 -0
  1065. package/lib/scene/color.d.ts +22 -0
  1066. package/lib/scene/color.js +45 -0
  1067. package/lib/scene/derived-cache.d.ts +139 -0
  1068. package/lib/scene/derived-cache.js +547 -0
  1069. package/lib/scene/downloads.d.ts +2 -0
  1070. package/lib/scene/downloads.js +371 -0
  1071. package/lib/scene/effects.d.ts +193 -0
  1072. package/lib/scene/effects.js +476 -0
  1073. package/lib/scene/environment-file.d.ts +22 -0
  1074. package/lib/scene/environment-file.js +81 -0
  1075. package/lib/scene/environment.d.ts +57 -0
  1076. package/lib/scene/environment.js +131 -0
  1077. package/lib/scene/fake-call-values.d.ts +8 -0
  1078. package/lib/scene/fake-call-values.js +51 -0
  1079. package/lib/scene/feature-draws.d.ts +169 -0
  1080. package/lib/scene/feature-draws.js +269 -0
  1081. package/lib/scene/feature-effects.d.ts +42 -0
  1082. package/lib/scene/feature-effects.js +155 -0
  1083. package/lib/scene/feature-host.d.ts +129 -0
  1084. package/lib/scene/feature-host.js +299 -0
  1085. package/lib/scene/feature-instances.d.ts +130 -0
  1086. package/lib/scene/feature-instances.js +326 -0
  1087. package/lib/scene/features.d.ts +412 -0
  1088. package/lib/scene/features.js +550 -0
  1089. package/lib/scene/file-limits.d.ts +70 -0
  1090. package/lib/scene/file-limits.js +224 -0
  1091. package/lib/scene/fog.d.ts +101 -0
  1092. package/lib/scene/fog.js +148 -0
  1093. package/lib/scene/frame-cameras.d.ts +175 -0
  1094. package/lib/scene/frame-cameras.js +492 -0
  1095. package/lib/scene/gltf-animation.d.ts +129 -0
  1096. package/lib/scene/gltf-animation.js +887 -0
  1097. package/lib/scene/gltf-draco.d.ts +9 -0
  1098. package/lib/scene/gltf-draco.js +224 -0
  1099. package/lib/scene/gltf-extensions.d.ts +31 -0
  1100. package/lib/scene/gltf-extensions.js +92 -0
  1101. package/lib/scene/gltf-json.d.ts +49 -0
  1102. package/lib/scene/gltf-json.js +94 -0
  1103. package/lib/scene/gltf-math.d.ts +16 -0
  1104. package/lib/scene/gltf-math.js +129 -0
  1105. package/lib/scene/gltf-meshopt.d.ts +3 -0
  1106. package/lib/scene/gltf-meshopt.js +48 -0
  1107. package/lib/scene/gltf-parse.d.ts +600 -0
  1108. package/lib/scene/gltf-parse.js +1854 -0
  1109. package/lib/scene/gltf.d.ts +189 -0
  1110. package/lib/scene/gltf.js +1589 -0
  1111. package/lib/scene/grade-table.d.ts +9 -0
  1112. package/lib/scene/grade-table.js +23 -0
  1113. package/lib/scene/grade-task.d.ts +12 -0
  1114. package/lib/scene/grade-task.js +11 -0
  1115. package/lib/scene/grading.d.ts +110 -0
  1116. package/lib/scene/grading.js +142 -0
  1117. package/lib/scene/half-float.d.ts +4 -0
  1118. package/lib/scene/half-float.js +42 -0
  1119. package/lib/scene/ktx2-cache.d.ts +32 -0
  1120. package/lib/scene/ktx2-cache.js +62 -0
  1121. package/lib/scene/ktx2-file.d.ts +57 -0
  1122. package/lib/scene/ktx2-file.js +207 -0
  1123. package/lib/scene/ktx2-transcode.d.ts +15 -0
  1124. package/lib/scene/ktx2-transcode.js +94 -0
  1125. package/lib/scene/ktx2.d.ts +42 -0
  1126. package/lib/scene/ktx2.js +179 -0
  1127. package/lib/scene/lens.d.ts +61 -0
  1128. package/lib/scene/lens.js +101 -0
  1129. package/lib/scene/level-meshopt.d.ts +20 -0
  1130. package/lib/scene/level-meshopt.js +122 -0
  1131. package/lib/scene/level-pieces.d.ts +24 -0
  1132. package/lib/scene/level-pieces.js +138 -0
  1133. package/lib/scene/level-rule.d.ts +120 -0
  1134. package/lib/scene/level-rule.js +130 -0
  1135. package/lib/scene/level-words.d.ts +19 -0
  1136. package/lib/scene/level-words.js +34 -0
  1137. package/lib/scene/levels-task.d.ts +51 -0
  1138. package/lib/scene/levels-task.js +132 -0
  1139. package/lib/scene/light-images.d.ts +36 -0
  1140. package/lib/scene/light-images.js +88 -0
  1141. package/lib/scene/light-probes.d.ts +240 -0
  1142. package/lib/scene/light-probes.js +644 -0
  1143. package/lib/scene/lines.d.ts +188 -0
  1144. package/lib/scene/lines.js +257 -0
  1145. package/lib/scene/lut-files.d.ts +41 -0
  1146. package/lib/scene/lut-files.js +399 -0
  1147. package/lib/scene/lut.d.ts +55 -0
  1148. package/lib/scene/lut.js +47 -0
  1149. package/lib/scene/memory.d.ts +72 -0
  1150. package/lib/scene/memory.js +159 -0
  1151. package/lib/scene/mesh-arrays.d.ts +110 -0
  1152. package/lib/scene/mesh-arrays.js +701 -0
  1153. package/lib/scene/mesh-levels.d.ts +10 -0
  1154. package/lib/scene/mesh-levels.js +52 -0
  1155. package/lib/scene/namespaces.d.ts +125 -0
  1156. package/lib/scene/namespaces.js +313 -0
  1157. package/lib/scene/panorama-files.d.ts +71 -0
  1158. package/lib/scene/panorama-files.js +1103 -0
  1159. package/lib/scene/panorama.d.ts +23 -0
  1160. package/lib/scene/panorama.js +108 -0
  1161. package/lib/scene/particles.d.ts +452 -0
  1162. package/lib/scene/particles.js +814 -0
  1163. package/lib/scene/pass-reads.d.ts +70 -0
  1164. package/lib/scene/pass-reads.js +220 -0
  1165. package/lib/scene/picks.d.ts +69 -0
  1166. package/lib/scene/picks.js +208 -0
  1167. package/lib/scene/pointer-events.d.ts +202 -0
  1168. package/lib/scene/pointer-events.js +500 -0
  1169. package/lib/scene/post.d.ts +567 -0
  1170. package/lib/scene/post.js +928 -0
  1171. package/lib/scene/prefab.d.ts +109 -0
  1172. package/lib/scene/prefab.js +166 -0
  1173. package/lib/scene/probes.d.ts +71 -0
  1174. package/lib/scene/probes.js +169 -0
  1175. package/lib/scene/property-animation.d.ts +160 -0
  1176. package/lib/scene/property-animation.js +276 -0
  1177. package/lib/scene/queries.d.ts +176 -0
  1178. package/lib/scene/queries.js +393 -0
  1179. package/lib/scene/render.d.ts +487 -0
  1180. package/lib/scene/render.js +829 -0
  1181. package/lib/scene/resources.d.ts +1598 -0
  1182. package/lib/scene/resources.js +2843 -0
  1183. package/lib/scene/rotation.d.ts +6 -0
  1184. package/lib/scene/rotation.js +12 -0
  1185. package/lib/scene/scene.d.ts +1858 -0
  1186. package/lib/scene/scene.js +4680 -0
  1187. package/lib/scene/serial-loads.d.ts +29 -0
  1188. package/lib/scene/serial-loads.js +68 -0
  1189. package/lib/scene/shader-preloads.d.ts +74 -0
  1190. package/lib/scene/shader-preloads.js +116 -0
  1191. package/lib/scene/shader-templates.d.ts +60 -0
  1192. package/lib/scene/shader-templates.js +156 -0
  1193. package/lib/scene/sprites.d.ts +262 -0
  1194. package/lib/scene/sprites.js +292 -0
  1195. package/lib/scene/stale-calls-scenario.d.ts +20 -0
  1196. package/lib/scene/stale-calls-scenario.js +175 -0
  1197. package/lib/scene/textures.d.ts +323 -0
  1198. package/lib/scene/textures.js +953 -0
  1199. package/lib/scene/time-of-day.d.ts +145 -0
  1200. package/lib/scene/time-of-day.js +644 -0
  1201. package/lib/scene/unmarked-writes.d.ts +118 -0
  1202. package/lib/scene/unmarked-writes.js +283 -0
  1203. package/lib/scene/unread-extensions-scenario.d.ts +6 -0
  1204. package/lib/scene/unread-extensions-scenario.js +26 -0
  1205. package/lib/scene/vertex-draws.d.ts +82 -0
  1206. package/lib/scene/vertex-draws.js +85 -0
  1207. package/lib/scene/wgsl-uniforms.d.ts +167 -0
  1208. package/lib/scene/wgsl-uniforms.js +12 -0
  1209. package/lib/shader-artifact.json +1 -0
  1210. package/lib/shared/await-later.d.ts +5 -0
  1211. package/lib/shared/await-later.js +10 -0
  1212. package/lib/shared/control.d.ts +94 -0
  1213. package/lib/shared/control.js +150 -0
  1214. package/lib/shared/core-sources.d.ts +2 -0
  1215. package/lib/shared/core-sources.js +7 -0
  1216. package/lib/shared/core.d.ts +1254 -0
  1217. package/lib/shared/core.js +381 -0
  1218. package/lib/shared/counter.d.ts +52 -0
  1219. package/lib/shared/counter.js +55 -0
  1220. package/lib/shared/dev.d.ts +8 -0
  1221. package/lib/shared/dev.js +13 -0
  1222. package/lib/shared/feature-stats.d.ts +16 -0
  1223. package/lib/shared/feature-stats.js +27 -0
  1224. package/lib/shared/frame-image.d.ts +13 -0
  1225. package/lib/shared/frame-image.js +32 -0
  1226. package/lib/shared/gpu-clock.d.ts +14 -0
  1227. package/lib/shared/gpu-clock.js +38 -0
  1228. package/lib/shared/gpu-counter.d.ts +12 -0
  1229. package/lib/shared/gpu-counter.js +15 -0
  1230. package/lib/shared/gpu-scope.d.ts +14 -0
  1231. package/lib/shared/gpu-scope.js +104 -0
  1232. package/lib/shared/helper-workers.d.ts +4 -0
  1233. package/lib/shared/helper-workers.js +23 -0
  1234. package/lib/shared/images.d.ts +255 -0
  1235. package/lib/shared/images.js +450 -0
  1236. package/lib/shared/import-once.d.ts +6 -0
  1237. package/lib/shared/import-once.js +19 -0
  1238. package/lib/shared/key-codes.d.ts +2 -0
  1239. package/lib/shared/key-codes.js +69 -0
  1240. package/lib/shared/labels.d.ts +94 -0
  1241. package/lib/shared/labels.js +172 -0
  1242. package/lib/shared/memory-area.d.ts +6 -0
  1243. package/lib/shared/memory-area.js +21 -0
  1244. package/lib/shared/memory-figure.d.ts +14 -0
  1245. package/lib/shared/memory-figure.js +18 -0
  1246. package/lib/shared/memory-views.d.ts +48 -0
  1247. package/lib/shared/memory-views.js +90 -0
  1248. package/lib/shared/metrics.d.ts +353 -0
  1249. package/lib/shared/metrics.js +799 -0
  1250. package/lib/shared/page-measurement.d.ts +9 -0
  1251. package/lib/shared/page-measurement.js +37 -0
  1252. package/lib/shared/phase.d.ts +17 -0
  1253. package/lib/shared/phase.js +20 -0
  1254. package/lib/shared/policy.d.ts +20 -0
  1255. package/lib/shared/policy.js +46 -0
  1256. package/lib/shared/recording.d.ts +100 -0
  1257. package/lib/shared/recording.js +378 -0
  1258. package/lib/shared/role.d.ts +10 -0
  1259. package/lib/shared/role.js +13 -0
  1260. package/lib/shared/run-task.d.ts +39 -0
  1261. package/lib/shared/run-task.js +69 -0
  1262. package/lib/shared/slot.d.ts +218 -0
  1263. package/lib/shared/slot.js +221 -0
  1264. package/lib/shared/software.d.ts +24 -0
  1265. package/lib/shared/software.js +22 -0
  1266. package/lib/shared/stats.d.ts +62 -0
  1267. package/lib/shared/stats.js +86 -0
  1268. package/lib/shared/task-failure.d.ts +24 -0
  1269. package/lib/shared/task-failure.js +36 -0
  1270. package/lib/shared/task-host.d.ts +42 -0
  1271. package/lib/shared/task-host.js +60 -0
  1272. package/lib/shared/task-load-error.d.ts +10 -0
  1273. package/lib/shared/task-load-error.js +13 -0
  1274. package/lib/shared/task-modules.d.ts +2 -0
  1275. package/lib/shared/task-modules.js +8 -0
  1276. package/lib/shared/task-pending.d.ts +24 -0
  1277. package/lib/shared/task-pending.js +101 -0
  1278. package/lib/shared/tasks.d.ts +54 -0
  1279. package/lib/shared/tasks.js +426 -0
  1280. package/lib/shared/tier.d.ts +7 -0
  1281. package/lib/shared/tier.js +3 -0
  1282. package/lib/shared/version.d.ts +72 -0
  1283. package/lib/shared/version.js +103 -0
  1284. package/lib/shared/videos.d.ts +15 -0
  1285. package/lib/shared/videos.js +11 -0
  1286. package/lib/shared/wake.d.ts +38 -0
  1287. package/lib/shared/wake.js +76 -0
  1288. package/lib/shared/wasm-limits.d.ts +13 -0
  1289. package/lib/shared/wasm-limits.js +75 -0
  1290. package/lib/shared/wasm.d.ts +34 -0
  1291. package/lib/shared/wasm.js +151 -0
  1292. package/lib/shared/webkit.d.ts +33 -0
  1293. package/lib/shared/webkit.js +59 -0
  1294. package/lib/shared/wgsl-updates.d.ts +9 -0
  1295. package/lib/shared/wgsl-updates.js +8 -0
  1296. package/lib/shared/worker-start.d.ts +56 -0
  1297. package/lib/shared/worker-start.js +186 -0
  1298. package/lib/sketch/clock.d.ts +61 -0
  1299. package/lib/sketch/clock.js +98 -0
  1300. package/lib/sketch/define-sketch.d.ts +269 -0
  1301. package/lib/sketch/define-sketch.js +103 -0
  1302. package/lib/sketch/input-off-scenario.d.ts +7 -0
  1303. package/lib/sketch/input-off-scenario.js +24 -0
  1304. package/lib/sketch/input-off.d.ts +16 -0
  1305. package/lib/sketch/input-off.js +38 -0
  1306. package/lib/sketch/input.d.ts +243 -0
  1307. package/lib/sketch/input.js +554 -0
  1308. package/lib/sketch/preset-check.d.ts +42 -0
  1309. package/lib/sketch/preset-check.js +120 -0
  1310. package/lib/sketch/quality.d.ts +392 -0
  1311. package/lib/sketch/quality.js +355 -0
  1312. package/lib/sketch/random.d.ts +13 -0
  1313. package/lib/sketch/random.js +25 -0
  1314. package/lib/sketch/runner.d.ts +574 -0
  1315. package/lib/sketch/runner.js +2159 -0
  1316. package/lib/sketch/ui.d.ts +94 -0
  1317. package/lib/sketch/ui.js +391 -0
  1318. package/lib/stats.d.ts +4 -0
  1319. package/lib/stats.js +8 -0
  1320. package/lib/workers/drawing-host.d.ts +24 -0
  1321. package/lib/workers/drawing-host.js +48 -0
  1322. package/lib/workers/gltf-worker.d.ts +35 -0
  1323. package/lib/workers/gltf-worker.js +210 -0
  1324. package/lib/workers/job-worker.d.ts +1 -0
  1325. package/lib/workers/job-worker.js +102 -0
  1326. package/lib/workers/panorama-worker.d.ts +15 -0
  1327. package/lib/workers/panorama-worker.js +21 -0
  1328. package/lib/workers/probe-worker.d.ts +34 -0
  1329. package/lib/workers/probe-worker.js +58 -0
  1330. package/lib/workers/protocol.d.ts +377 -0
  1331. package/lib/workers/protocol.js +57 -0
  1332. package/lib/workers/render-worker.d.ts +1 -0
  1333. package/lib/workers/render-worker.js +103 -0
  1334. package/lib/workers/sketch-worker.d.ts +1 -0
  1335. package/lib/workers/sketch-worker.js +295 -0
  1336. package/lib/workers/task-worker.d.ts +1 -0
  1337. package/lib/workers/task-worker.js +5 -0
  1338. package/lib/workers/tasks.d.ts +65 -0
  1339. package/lib/workers/tasks.js +85 -0
  1340. package/package.json +106 -5
  1341. package/vendor/basis/LICENSE +201 -0
  1342. package/vendor/basis/LICENSE-zstd +30 -0
  1343. package/vendor/basis/NOTICE +15 -0
  1344. package/vendor/basis/basis_transcoder.d.mts +36 -0
  1345. package/vendor/basis/basis_transcoder.mjs +2 -0
  1346. package/vendor/basis/basis_transcoder.wasm +0 -0
  1347. package/vendor/draco/LICENSE +252 -0
  1348. package/vendor/draco/draco_decoder_gltf.wasm +0 -0
  1349. package/vendor/draco/draco_wasm_wrapper_gltf.d.ts +71 -0
  1350. package/vendor/draco/draco_wasm_wrapper_gltf.js +116 -0
  1351. package/vendor/ltc/LICENSE +31 -0
  1352. package/vendor/ltc/area-light-tables.bin +0 -0
  1353. package/vendor/meshopt/LICENSE.md +21 -0
  1354. package/vendor/meshopt/meshopt_clusterizer.wasm +0 -0
  1355. package/vendor/meshopt/meshopt_decoder.wasm +0 -0
  1356. package/vendor/meshopt/meshopt_encoder.wasm +0 -0
  1357. package/vendor/meshopt/meshopt_simplifier.wasm +0 -0
@@ -0,0 +1,2013 @@
1
+ // Standard bind group layouts and the render pipeline templates. Every render pipeline shares the
2
+ // layouts of its template's groups, so switching pipelines never forces a rebind of the per-frame
3
+ // group. The engine defines its own layouts and templates, from the shaders that the device loaded,
4
+ // and a page can add more, as the texture test page does. Only development builds define the
5
+ // templates of the debug lines and the debug views, so release builds hold none of their code.
6
+ import { FORMAT_R32_FLOAT, FORMAT_RGBA8_UNORM, LAYOUT_ACCUMULATE, LAYOUT_AO, LAYOUT_AO_DEPTH, LAYOUT_AO_DEPTH_MS, LAYOUT_ATMOSPHERE, LAYOUT_BACKGROUND, LAYOUT_BACKGROUND_LAYER, LAYOUT_BLOOM, LAYOUT_BOUNCE, LAYOUT_CLOUDS, LAYOUT_CLOUDS_ATMOSPHERE, LAYOUT_CLUSTER_CULL, LAYOUT_COMPUTE_HISTORY_R32_FLOAT, LAYOUT_COMPUTE_HISTORY_RGBA8_UNORM, LAYOUT_COMPUTE_HISTORY_RGBA16_FLOAT, LAYOUT_COMPUTE_INSTANCE_BUFFERS, LAYOUT_COMPUTE_R32_FLOAT, LAYOUT_COMPUTE_RGBA8_UNORM, LAYOUT_COMPUTE_RGBA16_FLOAT, LAYOUT_CULL, LAYOUT_DECAL_DEPTH, LAYOUT_DECAL_DEPTH_MS, LAYOUT_DECAL_FRAME, LAYOUT_DEPTH, LAYOUT_DEPTH_PYRAMID, LAYOUT_DOF_COMPOSITE, LAYOUT_DOF_COMPOSITE_MS, LAYOUT_EFFECT, LAYOUT_EFFECT_BLOOM, LAYOUT_EFFECT_BLOOM_DEPTH_MS, LAYOUT_EFFECT_DEPTH_MS, LAYOUT_EXPOSURE, LAYOUT_FEATURE_ROWS, LAYOUT_FINAL, LAYOUT_FINAL_BLOOM, LAYOUT_FINAL_EFFECTS, LAYOUT_FINAL_EFFECTS_DEPTH_MS, LAYOUT_FRAME, LAYOUT_FRAME_PARALLAX, LAYOUT_INSTANCE_INDEX, LAYOUT_JOINTS, LAYOUT_LIGHT_CLUSTERS, LAYOUT_LIGHT_DEPTH, LAYOUT_LIGHT_DEPTH_MS, LAYOUT_MATERIAL_MAPS, LAYOUT_MATERIAL_MAPS_PARALLAX, LAYOUT_MATERIAL_MAPS_SCENE, LAYOUT_MATERIAL_SCENE, LAYOUT_MOMENT_COMPOSITE, LAYOUT_MOMENT_DEPTH_MS, LAYOUT_MOMENT_FRAME, LAYOUT_MOMENT_SMAA_BLEND, LAYOUT_MOMENT_SMAA_EDGES, LAYOUT_MOMENT_SMAA_RESOLVE, LAYOUT_MOTION_FRAME, LAYOUT_PARTICLE, LAYOUT_PARTICLE_DEPTH_MS, LAYOUT_PARTICLE_SCENE_DEPTH, LAYOUT_SKIN, LAYOUT_SSR_REDUCE, LAYOUT_SSR_TRACE, LAYOUT_SUBSURFACE_BLUR, LAYOUT_SUBSURFACE_COMPOSITE, LAYOUT_SUBSURFACE_COMPOSITE_MS, LAYOUT_TAA, LAYOUT_TAA_MS, LAYOUT_TEXTURES, LAYOUT_TRANSMISSION_COPY_MS, LAYOUT_VIEW_COPY, LAYOUT_WEIGHTED_COMPOSITE, LAYOUT_WEIGHTED_DEPTH_MS, PERMUTATION_ALPHA_MASK, PERMUTATION_CASTER, PERMUTATION_DEPTH_MULTISAMPLED, PERMUTATION_DISPLACEMENT, PERMUTATION_INSTANCE_INDEX, PERMUTATION_MOTION, PERMUTATION_PARALLAX, PERMUTATION_PICK, PERMUTATION_PREPASS, PERMUTATION_SKIN, PERMUTATION_VERTEX_COLOR, PERMUTATION_VERTEX_TANGENT, PERMUTATION_WEIGHTED, SIZE_INDEX_STRIDE, SIZE_INSTANCE_STRIDE, SIZE_MAP_SLOTS, SIZE_MOTION_INSTANCE_STRIDE, STATE_ALPHA_TO_COVERAGE, STATE_BLEND, STATE_BLEND_ADDITIVE, STATE_BLEND_MULTIPLY, STATE_BLEND_NORMAL, STATE_CULL_FRONT, STATE_CULL_NONE, STATE_DEPTH_EQUAL, STATE_DEPTH_OR_EQUAL, STATE_LINE_LIST, STATE_NO_COLOR_WRITE, STATE_NO_DEPTH_TEST, STATE_NO_DEPTH_WRITE, TEMPLATE_ACCUMULATE, TEMPLATE_AO, TEMPLATE_AO_DENOISE, TEMPLATE_AO_DEPTH, TEMPLATE_AO_DEPTH_MS, TEMPLATE_BACKGROUND, TEMPLATE_BACKGROUND_ATMOSPHERE, TEMPLATE_BACKGROUND_CLOUDS, TEMPLATE_BACKGROUND_CLOUDS_ATMOSPHERE, TEMPLATE_BACKGROUND_CUBE, TEMPLATE_BACKGROUND_SKY, TEMPLATE_BLOOM, TEMPLATE_BOUNCE_DENOISE, TEMPLATE_BOUNCE_TRACE, TEMPLATE_CLUSTER, TEMPLATE_CULL, TEMPLATE_DEBUG_LINES, TEMPLATE_DEBUG_VIEW, TEMPLATE_DECAL, TEMPLATE_DECAL_MAPS, TEMPLATE_DEPTH_PYRAMID, TEMPLATE_DOF_BLUR, TEMPLATE_DOF_COMPOSITE, TEMPLATE_DOF_COMPOSITE_MS, TEMPLATE_DOF_FILTER, TEMPLATE_DOF_SETUP, TEMPLATE_DOF_SETUP_MS, TEMPLATE_EXPOSURE_ADAPT, TEMPLATE_EXPOSURE_ADAPT_HISTOGRAM, TEMPLATE_EXPOSURE_HISTOGRAM, TEMPLATE_EXPOSURE_LUMINANCE, TEMPLATE_FEATURE_ROWS, TEMPLATE_FINAL, TEMPLATE_FINAL_BLOOM, TEMPLATE_FOG_APPLY, TEMPLATE_FOG_APPLY_MS, TEMPLATE_FOG_BLOCK, TEMPLATE_FOG_LIGHT, TEMPLATE_FOG_SUM, TEMPLATE_INSTANCED_LIT, TEMPLATE_INSTANCED_STANDARD_MAPS, TEMPLATE_INSTANCED_TEXCOORDS, TEMPLATE_INSTANCED_UNLIT, TEMPLATE_INSTANCED_UNLIT_MAP, TEMPLATE_LIGHT_COUNT, TEMPLATE_LIGHT_DEPTH, TEMPLATE_LIGHT_DEPTH_CLEAR, TEMPLATE_LIGHT_DEPTH_CLEAR_MS, TEMPLATE_LIGHT_DEPTH_MS, TEMPLATE_LIGHT_FIT, TEMPLATE_LIGHT_PLACE, TEMPLATE_LIGHT_WRITE, TEMPLATE_LINE, TEMPLATE_LINE_LIT, TEMPLATE_MOMENT_COMPOSITE, TEMPLATE_MOMENT_DEPTH, TEMPLATE_MOMENT_LIT, TEMPLATE_MOMENT_SMAA_BLEND, TEMPLATE_MOMENT_SMAA_EDGES, TEMPLATE_MOMENT_SMAA_RESOLVE, TEMPLATE_MOMENT_SPRITE, TEMPLATE_MOMENT_SPRITE_MAP, TEMPLATE_MOMENT_STANDARD_MAPS, TEMPLATE_MOMENT_UNLIT, TEMPLATE_MOMENT_UNLIT_MAP, TEMPLATE_MOTION, TEMPLATE_MOTION_VIEW, TEMPLATE_OCCLUSION_EARLY, TEMPLATE_OCCLUSION_LATE, TEMPLATE_OUTLINE_MASK, TEMPLATE_PARTICLE, TEMPLATE_PARTICLE_DEPTH, TEMPLATE_PARTICLE_DEPTH_MS, TEMPLATE_PARTICLE_MAP, TEMPLATE_PICK, TEMPLATE_PICK_MAPS, TEMPLATE_PICK_RESOLVE, TEMPLATE_PICK_TEXTURE_MAPS, TEMPLATE_PROBE_GRID, TEMPLATE_PROBE_GRID_MAPS, TEMPLATE_SHADOW_CUTOUT, TEMPLATE_SHADOW_CUTOUT_MAP, TEMPLATE_SHADOW_DEPTH, TEMPLATE_SINGLE_COMPOSITE, TEMPLATE_SINGLE_DEPTH, TEMPLATE_SKIN, TEMPLATE_SKY_TABLE, TEMPLATE_SPRITE, TEMPLATE_SPRITE_MAP, TEMPLATE_SSR_REDUCE, TEMPLATE_SSR_TRACE, TEMPLATE_SUBSURFACE, TEMPLATE_SUBSURFACE_BLUR, TEMPLATE_SUBSURFACE_COMPOSITE, TEMPLATE_SUBSURFACE_COMPOSITE_MS, TEMPLATE_SUBSURFACE_MAPS, TEMPLATE_TAA_COPY, TEMPLATE_TAA_RESOLVE, TEMPLATE_TAA_RESOLVE_MS, TEMPLATE_TONE_MASK, TEMPLATE_TRANSMISSION_COPY, TEMPLATE_VIEW_COPY, TEMPLATE_WEIGHTED_COMPOSITE, TEMPLATE_WEIGHTED_DEPTH, VERTEX_INSTANCE_LOCATION, VERTEX_TYPE_F32, VERTEX_TYPE_SINT8, VERTEX_TYPE_SINT16, VERTEX_TYPE_SNORM8, VERTEX_TYPE_SNORM16, VERTEX_TYPE_UINT8, VERTEX_TYPE_UINT16, VERTEX_TYPE_UNORM8, VERTEX_TYPE_UNORM16, } from '../../generated/gpu.js';
7
+ import { DEBUG_LINES_SHADER, DEBUG_VIEW_SHADER, MOTION_VIEW_SHADER, } from '../../generated/shaders.js';
8
+ import { LINE_VERTICES } from '../line-vertices.js';
9
+ import { PARTICLE_RECORDS } from '../particle-records.js';
10
+ import { pipelineName } from '../pipeline-name.js';
11
+ import { missingVariant, variantFor } from '../variants.js';
12
+ import { plainScale, variantLocations, vertexAttribute, vertexStride, } from '../vertex-format.js';
13
+ /**
14
+ * True in development builds, which add the debug views' templates. This file reads the constant
15
+ * itself, as the files that load on first use do. It loads with its GPU path's renderers, apart from
16
+ * the start's files, so a check through the shared constant would keep the debug views' shaders in
17
+ * the start's files of a production build. A check that folds within this file drops them.
18
+ */
19
+ const DEV = typeof __NULL3D_DEV__ === 'undefined' ? true : __NULL3D_DEV__;
20
+ /** The WebGPU build of a shader variant. */
21
+ export function wgslOf(variant) {
22
+ if (!variant.wgsl)
23
+ throw new Error('a shader variant has no WebGPU build');
24
+ return variant.wgsl;
25
+ }
26
+ /**
27
+ * The bit of a compute pass's format code that says the pass samples textures at group 1. The core
28
+ * sets it when the pass has textures, and clears it otherwise, since a pipeline layout with a
29
+ * group that nothing binds fails its dispatch.
30
+ */
31
+ export const COMPUTE_MAPS_BIT = 1 << 8;
32
+ /**
33
+ * The bit of a compute pass's format code that says the pass keeps two states: each run writes one
34
+ * state as its storage texture and reads the other, so its group 0 also binds the other state as a
35
+ * sampled texture.
36
+ */
37
+ export const COMPUTE_HISTORY_BIT = 1 << 9;
38
+ /**
39
+ * The bind group layout of an add-on compute pass's group 0 for the target's format code: its
40
+ * block of uniforms, then the storage texture that it fills. A format code of 0 names a pass that
41
+ * fills an instance draw's two buffers instead, with no texture. The maps bit says the pass also
42
+ * samples textures at group 1. The history bit names the layout that also binds the previous
43
+ * state.
44
+ */
45
+ export function layoutOfComputeFormat(code) {
46
+ const format = code & ~(COMPUTE_MAPS_BIT | COMPUTE_HISTORY_BIT);
47
+ const history = (code & COMPUTE_HISTORY_BIT) !== 0;
48
+ if (format === 0)
49
+ return LAYOUT_COMPUTE_INSTANCE_BUFFERS;
50
+ if (history) {
51
+ if (format === FORMAT_R32_FLOAT)
52
+ return LAYOUT_COMPUTE_HISTORY_R32_FLOAT;
53
+ if (format === FORMAT_RGBA8_UNORM)
54
+ return LAYOUT_COMPUTE_HISTORY_RGBA8_UNORM;
55
+ return LAYOUT_COMPUTE_HISTORY_RGBA16_FLOAT;
56
+ }
57
+ if (format === FORMAT_R32_FLOAT)
58
+ return LAYOUT_COMPUTE_R32_FLOAT;
59
+ if (format === FORMAT_RGBA8_UNORM)
60
+ return LAYOUT_COMPUTE_RGBA8_UNORM;
61
+ return LAYOUT_COMPUTE_RGBA16_FLOAT;
62
+ }
63
+ /**
64
+ * The name of the `@compute` entry point of a whole WGSL module: the function that the attribute
65
+ * precedes, or `main` for a module without one.
66
+ */
67
+ export function computeEntryPoint(source) {
68
+ const at = source.search(/@\s*compute\b/u);
69
+ if (at < 0)
70
+ return 'main';
71
+ const name = /fn\s+([A-Za-z_][A-Za-z0-9_]*)/u.exec(source.slice(at))?.[1];
72
+ return name ?? 'main';
73
+ }
74
+ /**
75
+ * The binding of the row values texture of instance batches in the frame group and in the depth
76
+ * template's group, as the frame builder binds it and the mesh shaders declare it.
77
+ */
78
+ const ROW_VALUES_BINDING = 16;
79
+ /**
80
+ * The binding of the table of object ranges in the frame group and in the depth template's group,
81
+ * which the vertex shaders of custom materials that read an instance's index or an object's id
82
+ * search.
83
+ */
84
+ const OBJECT_RANGES_BINDING = 17;
85
+ /**
86
+ * The binding of the view's list of reflection probes in the frame group, which the lit shading
87
+ * reads beside the probes' texture array at binding 3 (decision record D-149).
88
+ */
89
+ const PROBE_LIST_BINDING = 18;
90
+ /** The fragment shader of a prepass that draws with a template's own vertex shader. */
91
+ const EMPTY_FRAGMENT = '@fragment\nfn fs() -> @location(0) vec4f {\n return vec4f(0.0);\n}\n';
92
+ /** The map slots of a standard material, one texture array and sampler each. */
93
+ const MAP_SLOTS = Array.from({ length: SIZE_MAP_SLOTS }, (_, slot) => slot);
94
+ /**
95
+ * The binding of the displacement map's texture array in the maps group, after every slot's array
96
+ * and sampler, as the frame builder binds it. Its sampler takes the next binding.
97
+ */
98
+ const HEIGHT_BINDING = 2 * SIZE_MAP_SLOTS;
99
+ /** The culling shader's compute entry point. */
100
+ const CULL_ENTRY_POINT = 'main';
101
+ /** The entry points of occlusion culling's two phases, in the culling shader's occlusion build. */
102
+ const OCCLUSION_ENTRY_POINTS = {
103
+ [TEMPLATE_OCCLUSION_EARLY]: 'early',
104
+ [TEMPLATE_OCCLUSION_LATE]: 'late',
105
+ };
106
+ /**
107
+ * The skinning pass's builds, by their permutation bits: with the vertex tangent's code for formats
108
+ * that have a tangent, and with the vertex color's for formats whose color the pass morphs.
109
+ */
110
+ export const SKIN_BUILDS = [
111
+ 0,
112
+ PERMUTATION_VERTEX_TANGENT,
113
+ PERMUTATION_VERTEX_COLOR,
114
+ PERMUTATION_VERTEX_TANGENT | PERMUTATION_VERTEX_COLOR,
115
+ ];
116
+ /** The compute templates of light clustering: each one's entry point in the light clustering shader. */
117
+ const LIGHT_ENTRY_POINTS = {
118
+ [TEMPLATE_LIGHT_FIT]: 'fit_lights',
119
+ [TEMPLATE_LIGHT_COUNT]: 'count_lights',
120
+ [TEMPLATE_LIGHT_PLACE]: 'place_lights',
121
+ [TEMPLATE_LIGHT_WRITE]: 'write_lights',
122
+ };
123
+ /** The automatic exposure's compute templates: each one's entry point in the histogram shader. */
124
+ const EXPOSURE_ENTRY_POINTS = {
125
+ [TEMPLATE_EXPOSURE_HISTOGRAM]: 'histogram_main',
126
+ [TEMPLATE_EXPOSURE_ADAPT_HISTOGRAM]: 'adapt_main',
127
+ };
128
+ /** The compacted instance that a mesh draw's instances read: its matrix rows, then its ids. */
129
+ const INSTANCE_BUFFERS = [
130
+ {
131
+ arrayStride: SIZE_INSTANCE_STRIDE,
132
+ stepMode: 'instance',
133
+ attributes: [
134
+ { shaderLocation: VERTEX_INSTANCE_LOCATION, offset: 0, format: 'float32x4' },
135
+ { shaderLocation: VERTEX_INSTANCE_LOCATION + 1, offset: 16, format: 'float32x4' },
136
+ { shaderLocation: VERTEX_INSTANCE_LOCATION + 2, offset: 32, format: 'float32x4' },
137
+ { shaderLocation: VERTEX_INSTANCE_LOCATION + 3, offset: 48, format: 'uint32x4' },
138
+ ],
139
+ },
140
+ ];
141
+ /**
142
+ * The motion view's compacted instance: the matrix rows and the ids, then the rows of the last
143
+ * frame's matrix at locations 13 to 15.
144
+ */
145
+ const MOTION_INSTANCE_BUFFERS = [
146
+ {
147
+ arrayStride: SIZE_MOTION_INSTANCE_STRIDE,
148
+ stepMode: 'instance',
149
+ attributes: [
150
+ ...INSTANCE_BUFFERS[0].attributes,
151
+ { shaderLocation: VERTEX_INSTANCE_LOCATION + 4, offset: 64, format: 'float32x4' },
152
+ { shaderLocation: VERTEX_INSTANCE_LOCATION + 5, offset: 80, format: 'float32x4' },
153
+ { shaderLocation: VERTEX_INSTANCE_LOCATION + 6, offset: 96, format: 'float32x4' },
154
+ ],
155
+ },
156
+ ];
157
+ /** The location of the last frame's place of each vertex in the motion template. */
158
+ const LAST_POSITION_LOCATION = 4;
159
+ /**
160
+ * The compacted index that a mesh draw's instances read in the builds that read their instances by
161
+ * index: the source's index, from which the vertex shader reads the rest.
162
+ */
163
+ const INDEX_BUFFERS = [
164
+ {
165
+ arrayStride: SIZE_INDEX_STRIDE,
166
+ stepMode: 'instance',
167
+ attributes: [{ shaderLocation: VERTEX_INSTANCE_LOCATION, offset: 0, format: 'uint32' }],
168
+ },
169
+ ];
170
+ /**
171
+ * The blend state of each blend mode, whose fragments write color premultiplied by alpha, as
172
+ * three.js blends with `premultipliedAlpha`: normal blending covers the target, additive blending
173
+ * adds light to it, and multiply blending tints it and keeps its alpha.
174
+ */
175
+ const BLENDS = {
176
+ [STATE_BLEND_NORMAL]: {
177
+ color: { srcFactor: 'one', dstFactor: 'one-minus-src-alpha' },
178
+ alpha: { srcFactor: 'one', dstFactor: 'one-minus-src-alpha' },
179
+ },
180
+ [STATE_BLEND_ADDITIVE]: {
181
+ color: { srcFactor: 'one', dstFactor: 'one' },
182
+ alpha: { srcFactor: 'one', dstFactor: 'one' },
183
+ },
184
+ [STATE_BLEND_MULTIPLY]: {
185
+ color: { srcFactor: 'dst', dstFactor: 'one-minus-src-alpha' },
186
+ alpha: { srcFactor: 'zero', dstFactor: 'one' },
187
+ },
188
+ };
189
+ /** The formats whose mip levels the GPU makes: 8-bit color, as the draw list allows. */
190
+ const MIP_FORMATS = ['rgba8unorm', 'rgba8unorm-srgb'];
191
+ /** The write mask of every color channel, as `GPUColorWrite.ALL` holds it. */
192
+ const ALL_CHANNELS = 0xf;
193
+ /**
194
+ * The color targets of a pipeline of `template` that draws into `colorFormat`. The weighted
195
+ * layer's pipelines draw into a second target too, its coverage sum in one 16-bit float: the
196
+ * builds of the weighted bit, and the depth copy that draws first in the layer's pass, which
197
+ * writes no color. Both targets blend the same way, as compatibility mode requires.
198
+ */
199
+ function colorTargets(colorFormat, template, permutation, stateFlags) {
200
+ const blend = BLENDS[stateFlags & STATE_BLEND];
201
+ const writeMask = stateFlags & STATE_NO_COLOR_WRITE ? 0 : ALL_CHANNELS;
202
+ const first = { format: colorFormat, blend, writeMask };
203
+ const two = (permutation & PERMUTATION_WEIGHTED) !== 0 || template === TEMPLATE_WEIGHTED_DEPTH;
204
+ return two ? [first, { format: 'r16float', blend, writeMask }] : [first];
205
+ }
206
+ /**
207
+ * The depth test of a pipeline's state flags, in reversed depth: nearer surfaces pass, every one
208
+ * passes without the test, only the surface at the target's depth passes after the depth prepass,
209
+ * and a background at the far plane passes where no object wrote depth.
210
+ */
211
+ function depthCompare(stateFlags) {
212
+ if (stateFlags & STATE_NO_DEPTH_TEST)
213
+ return 'always';
214
+ if (stateFlags & STATE_DEPTH_OR_EQUAL)
215
+ return 'greater-equal';
216
+ return stateFlags & STATE_DEPTH_EQUAL ? 'equal' : 'greater';
217
+ }
218
+ /**
219
+ * WebGPU's vertex format of each vertex attribute type, by code, for attributes that shaders read
220
+ * as floats. WebGPU has no format that reads plain integers as whole floats, so it reads them as
221
+ * their normalized twins, and the shader multiplies them back (`plainScale`).
222
+ */
223
+ const FLOAT_READS = {
224
+ [VERTEX_TYPE_F32]: 'float32',
225
+ [VERTEX_TYPE_UNORM8]: 'unorm8',
226
+ [VERTEX_TYPE_SNORM8]: 'snorm8',
227
+ [VERTEX_TYPE_UNORM16]: 'unorm16',
228
+ [VERTEX_TYPE_SNORM16]: 'snorm16',
229
+ [VERTEX_TYPE_UINT8]: 'unorm8',
230
+ [VERTEX_TYPE_SINT8]: 'snorm8',
231
+ [VERTEX_TYPE_UINT16]: 'unorm16',
232
+ [VERTEX_TYPE_SINT16]: 'snorm16',
233
+ };
234
+ /** WebGPU's vertex format of each plain integer type, by code, for attributes read as integers. */
235
+ const WHOLE_READS = {
236
+ [VERTEX_TYPE_UINT8]: 'uint8',
237
+ [VERTEX_TYPE_SINT8]: 'sint8',
238
+ [VERTEX_TYPE_UINT16]: 'uint16',
239
+ [VERTEX_TYPE_SINT16]: 'sint16',
240
+ };
241
+ /** The WebGPU vertex format that reads an attribute. */
242
+ export function gpuVertexFormat(attribute) {
243
+ const base = attribute.integer ? WHOLE_READS[attribute.type] : FLOAT_READS[attribute.type];
244
+ if (!base)
245
+ throw new Error(`no WebGPU vertex format reads vertex type ${attribute.type}`);
246
+ return (attribute.size === 1 ? base : `${base}x${attribute.size}`);
247
+ }
248
+ /** The id of the pipeline constant that scales the attribute at a location: 1000 plus it. */
249
+ const SCALE_ID = 1000;
250
+ /** The id of the skinning pass's pipeline constant that writes normals and tangents in 8 bits. */
251
+ const NARROW_DIRECTIONS_ID = 1100;
252
+ /** The mesh locations that a template's variant reads, or undefined for a template without meshes. */
253
+ function meshLocations(t, permutation) {
254
+ if (!t.meshLocations)
255
+ return undefined;
256
+ const masked = t.maskLocations && permutation & PERMUTATION_ALPHA_MASK ? t.maskLocations : [];
257
+ return variantLocations([...t.meshLocations, ...masked], permutation);
258
+ }
259
+ /**
260
+ * The vertex buffers of a template's pipeline: a mesh's vertices first, for a template that draws
261
+ * meshes, with each location it reads where the vertex format places it. The variants with vertex
262
+ * colors read the mesh's colors too. The builds that read their instances by index take an index
263
+ * per instance in place of the template's compacted instance.
264
+ */
265
+ function vertexBuffers(t, vertexFormat, permutation) {
266
+ const locations = meshLocations(t, permutation);
267
+ if (!locations)
268
+ return t.vertexBuffers;
269
+ const instances = permutation & PERMUTATION_INSTANCE_INDEX
270
+ ? INDEX_BUFFERS
271
+ : permutation & PERMUTATION_MOTION
272
+ ? MOTION_INSTANCE_BUFFERS
273
+ : t.vertexBuffers;
274
+ const attributes = locations.map((shaderLocation) => {
275
+ const attribute = vertexAttribute(vertexFormat, shaderLocation);
276
+ if (!attribute)
277
+ throw new Error(`vertex format ${vertexFormat} has no attribute at ${shaderLocation}`);
278
+ return { shaderLocation, offset: attribute.offset, format: gpuVertexFormat(attribute) };
279
+ });
280
+ const mesh = {
281
+ arrayStride: vertexStride(vertexFormat),
282
+ stepMode: 'vertex',
283
+ attributes,
284
+ };
285
+ if (!t.lastVertices)
286
+ return [mesh, ...instances];
287
+ const position = attributes.find((attribute) => attribute.shaderLocation === 0);
288
+ if (!position)
289
+ throw new Error(`vertex format ${vertexFormat} has no position`);
290
+ const last = {
291
+ arrayStride: mesh.arrayStride,
292
+ stepMode: 'vertex',
293
+ attributes: [{ ...position, shaderLocation: LAST_POSITION_LOCATION }],
294
+ };
295
+ return [mesh, ...instances, last];
296
+ }
297
+ /**
298
+ * The pipeline constants that scale a mesh's plain integer attributes back to whole values, for
299
+ * each location the variant reads whose constant its WGSL declares. Shaders that declare none
300
+ * read such attributes as fractions.
301
+ */
302
+ function scaleConstants(t, shader, vertexFormat, permutation) {
303
+ let constants;
304
+ for (const location of meshLocations(t, permutation) ?? []) {
305
+ const attribute = vertexAttribute(vertexFormat, location);
306
+ const scale = attribute ? plainScale(attribute) : 1;
307
+ const id = SCALE_ID + location;
308
+ if (scale === 1 || !shader.source.includes(`@id(${id})`))
309
+ continue;
310
+ constants ??= {};
311
+ constants[id] = scale;
312
+ }
313
+ return constants;
314
+ }
315
+ export class Pipelines {
316
+ device;
317
+ /**
318
+ * True when the skinning pass writes normals and tangents as 32-bit floats, in place of 8-bit
319
+ * integers, as the core's skinned vertex format then has them. Only the switch that measures
320
+ * the two asks for it.
321
+ */
322
+ floatSkinnedDirections = false;
323
+ layouts = [];
324
+ /** The layouts that only some devices bind, which the first pipeline or bind group to use them makes. */
325
+ laterLayouts = [];
326
+ templates = [];
327
+ /** The add-on compute passes' shaders, by their compute pipeline template. */
328
+ computeTemplates = new Map();
329
+ /** Each compute pass's pipeline layout, by the layout of its group 0. */
330
+ computeLayouts = new Map();
331
+ /**
332
+ * Each template's pipeline layouts, made for their first pipelines, by the groups after the
333
+ * template's own: the joint texture's for the builds that skin in the vertex shader, then the
334
+ * view's index group for the builds that read their instances by index.
335
+ */
336
+ pipelineLayouts = new Map();
337
+ cullLayout;
338
+ cull;
339
+ /**
340
+ * The builds of occlusion culling's two phases and of its depth pyramid, which arrive with the
341
+ * occlusion feature's shader file.
342
+ */
343
+ occlusion;
344
+ /** The motion view's culling build, which arrives with the motion feature's shader file. */
345
+ cullMotion;
346
+ pyramid;
347
+ pyramidLayout;
348
+ /**
349
+ * The conversion of a feature-instance draw's world rows to camera-relative rows, which the
350
+ * engine dispatches once for each draw in a frame that holds one (D-229).
351
+ */
352
+ featureRows;
353
+ /** The conversion's pipeline layout, made at its first pipeline. */
354
+ featureRowsLayout;
355
+ /**
356
+ * The cluster pass's builds, which arrive with the cluster levels feature's shader file. It is
357
+ * read by name so that a build whose generated modules are older than the manifest still type
358
+ * checks, and the pipeline reports the shader as missing instead.
359
+ */
360
+ cluster;
361
+ clusterLayout;
362
+ lightLayout;
363
+ lightClusters;
364
+ lightDepth;
365
+ lightDepthMs;
366
+ lightDepthLayout;
367
+ lightDepthMsLayout;
368
+ skinLayout;
369
+ /** The skinning pass's builds, which arrive with the skinning feature's shader file. */
370
+ skin;
371
+ /** The automatic exposure's histogram steps, which arrive with the exposure feature's file. */
372
+ exposureHistogram;
373
+ /** The histogram steps' pipeline layout, made at their first pipeline. */
374
+ exposureLayout;
375
+ mipmap;
376
+ modules = new Map();
377
+ /** The module of the fragment shader that writes nothing, made at its first use. */
378
+ emptyFragment;
379
+ /** The pipelines that make mip levels, by the format they draw. */
380
+ mipPipelines = new Map();
381
+ scalePipelines = new Map();
382
+ /** `shaders` are the WGSL builds that the device loaded, with the bits that it fixes. */
383
+ constructor(device, shaders) {
384
+ this.device = device;
385
+ const fragment = GPUShaderStage.FRAGMENT;
386
+ // The frame's constants and the material table, which depth-only pipelines read too, then
387
+ // the materials' custom values, the row values of instance batches and the table of object
388
+ // ranges, which the vertex shaders of custom materials' shadow casters read too.
389
+ const frameEntries = [
390
+ {
391
+ binding: 0,
392
+ visibility: GPUShaderStage.VERTEX | fragment,
393
+ buffer: { type: 'uniform' },
394
+ },
395
+ { binding: 1, visibility: fragment, buffer: { type: 'read-only-storage' } },
396
+ ];
397
+ const rowValues = {
398
+ binding: ROW_VALUES_BINDING,
399
+ visibility: GPUShaderStage.VERTEX,
400
+ texture: { sampleType: 'unfilterable-float' },
401
+ };
402
+ const objectRanges = {
403
+ binding: OBJECT_RANGES_BINDING,
404
+ visibility: GPUShaderStage.VERTEX,
405
+ buffer: { type: 'uniform' },
406
+ };
407
+ this.defineLayout(LAYOUT_DEPTH, 'depth', [
408
+ ...frameEntries,
409
+ {
410
+ // A custom material's caster reads its row of values in the vertex stage, and its
411
+ // fragment stage, where it declares a coverage function, reads that row too.
412
+ binding: 2,
413
+ visibility: GPUShaderStage.VERTEX | fragment,
414
+ texture: { sampleType: 'unfilterable-float' },
415
+ },
416
+ rowValues,
417
+ objectRanges,
418
+ ]);
419
+ // The materials' custom values, with the table of specular terms in the columns after the
420
+ // first rows, the light tables and the reflection probes' maps in the layers of one array,
421
+ // then the shadow map, whose depths the receivers read as floats, the sampler that compares
422
+ // depths in the shadow atlas, the cascades, the camera's light grid and light list, the
423
+ // shadow atlas of point and spot lights with its tiles, the light probe grids' 3D texture,
424
+ // ambient occlusion's texture, which the lit shading reads with textureLoad, the
425
+ // environment's cube map with its filtering sampler, the sampler that reads four texels of
426
+ // the shadow map at once, the copy of the opaque color that surfaces which let light through
427
+ // sample with the environment's sampler, the row values of instance batches and the table
428
+ // of object ranges, which only vertex shaders read, and the view's list of reflection
429
+ // probes.
430
+ const probeGrid = {
431
+ binding: 10,
432
+ visibility: fragment,
433
+ texture: { viewDimension: '3d' },
434
+ };
435
+ const transmission = {
436
+ binding: 15,
437
+ visibility: fragment,
438
+ texture: { viewDimension: '2d-array' },
439
+ };
440
+ const frame = [
441
+ ...frameEntries,
442
+ {
443
+ binding: 2,
444
+ visibility: GPUShaderStage.VERTEX | fragment,
445
+ texture: { sampleType: 'unfilterable-float' },
446
+ },
447
+ { binding: 3, visibility: fragment, texture: { viewDimension: '2d-array' } },
448
+ {
449
+ binding: 4,
450
+ visibility: fragment,
451
+ texture: { sampleType: 'unfilterable-float', viewDimension: '2d-array' },
452
+ },
453
+ { binding: 5, visibility: fragment, sampler: { type: 'comparison' } },
454
+ { binding: 6, visibility: fragment, buffer: { type: 'uniform' } },
455
+ // The light grid and the light list of the camera's point and spot lights.
456
+ { binding: 7, visibility: fragment, buffer: { type: 'read-only-storage' } },
457
+ { binding: 8, visibility: fragment, buffer: { type: 'read-only-storage' } },
458
+ {
459
+ binding: 9,
460
+ visibility: fragment,
461
+ texture: { sampleType: 'depth', viewDimension: '2d-array' },
462
+ },
463
+ probeGrid,
464
+ {
465
+ binding: 11,
466
+ visibility: fragment,
467
+ texture: { sampleType: 'unfilterable-float', viewDimension: '2d-array' },
468
+ },
469
+ { binding: 12, visibility: fragment, texture: { viewDimension: 'cube' } },
470
+ { binding: 13, visibility: fragment, sampler: {} },
471
+ { binding: 14, visibility: fragment, sampler: { type: 'non-filtering' } },
472
+ transmission,
473
+ rowValues,
474
+ objectRanges,
475
+ { binding: PROBE_LIST_BINDING, visibility: fragment, buffer: { type: 'uniform' } },
476
+ ];
477
+ this.defineLayout(LAYOUT_FRAME, 'frame', frame);
478
+ // The frame group of the builds of parallax occlusion mapping leaves out the copy of the
479
+ // opaque color, which no such build reads: the draw list never pairs parallax with
480
+ // transmission. Their maps' group holds one sampled texture more than any other material's,
481
+ // so this keeps their fragment stage within the default count.
482
+ this.defineLayout(LAYOUT_FRAME_PARALLAX, 'frame with parallax', frame.filter((entry) => entry !== transmission), true);
483
+ // The decals' frame group leaves out the probe grid, which no decal build reads, so that a
484
+ // decal with maps stays within the default count of sampled textures in the fragment stage.
485
+ // It carries the copy of the opaque color, which the reflections' lit code reads in every
486
+ // lit build, decals included. It is made at the first decal.
487
+ this.defineLayout(LAYOUT_DECAL_FRAME, 'decal frame', frame.filter((entry) => entry !== probeGrid), true);
488
+ // The motion pass's frame group: the depth group's entries, then the motion block and the last
489
+ // frame's joints, which vertex shaders read, and the table of object ranges for custom
490
+ // materials that read object ids. A custom material's fragment stage reads its row of custom
491
+ // values, where it tests its own coverage, so that texture reaches both stages as it does in
492
+ // the depth group.
493
+ this.defineLayout(LAYOUT_MOTION_FRAME, 'motion frame', [
494
+ ...frameEntries,
495
+ {
496
+ binding: 2,
497
+ visibility: GPUShaderStage.VERTEX | fragment,
498
+ texture: { sampleType: 'unfilterable-float' },
499
+ },
500
+ { binding: 4, visibility: GPUShaderStage.VERTEX, buffer: { type: 'uniform' } },
501
+ {
502
+ binding: 5,
503
+ visibility: GPUShaderStage.VERTEX,
504
+ texture: { sampleType: 'unfilterable-float' },
505
+ },
506
+ rowValues,
507
+ objectRanges,
508
+ ]);
509
+ this.defineLayout(LAYOUT_TEXTURES, 'textures', [
510
+ { binding: 0, visibility: fragment, texture: { viewDimension: '2d-array' } },
511
+ { binding: 1, visibility: fragment, sampler: {} },
512
+ ]);
513
+ // A texture array for each map slot, then each slot's sampler, then the displacement map's
514
+ // array and sampler. Custom materials' vertex stages sample their textures too, and an
515
+ // add-on's compute pass samples them in its own stage. The displacement map is the vertex
516
+ // stage's alone, so the fragment stage keeps a sampled texture free, apart from the layout
517
+ // of parallax, whose fragment stage reads it too.
518
+ const maps = GPUShaderStage.VERTEX | fragment | GPUShaderStage.COMPUTE;
519
+ const mapEntries = (height) => [
520
+ ...MAP_SLOTS.map((binding) => ({
521
+ binding,
522
+ visibility: maps,
523
+ texture: { viewDimension: '2d-array' },
524
+ })),
525
+ ...MAP_SLOTS.map((slot) => ({
526
+ binding: MAP_SLOTS.length + slot,
527
+ visibility: maps,
528
+ sampler: {},
529
+ })),
530
+ { binding: HEIGHT_BINDING, visibility: height, texture: { viewDimension: '2d-array' } },
531
+ { binding: HEIGHT_BINDING + 1, visibility: height, sampler: {} },
532
+ ];
533
+ this.defineLayout(LAYOUT_MATERIAL_MAPS, 'material maps', mapEntries(GPUShaderStage.VERTEX));
534
+ this.defineLayout(LAYOUT_MATERIAL_MAPS_PARALLAX, 'material maps with parallax', mapEntries(maps));
535
+ // A custom material that reads the copy of the scene's depth takes the maps' group with the
536
+ // last slot and the displacement map left out, which no custom material reads. Its fragment
537
+ // stage then holds the frame group's eight sampled textures, this group's seven and the
538
+ // copy, within the sixteen that every device allows.
539
+ const sceneMaps = MAP_SLOTS.slice(0, MAP_SLOTS.length - 1);
540
+ this.defineLayout(LAYOUT_MATERIAL_MAPS_SCENE, 'material maps with scene depth', [
541
+ ...sceneMaps.map((binding) => ({
542
+ binding,
543
+ visibility: maps,
544
+ texture: { viewDimension: '2d-array' },
545
+ })),
546
+ ...sceneMaps.map((slot) => ({
547
+ binding: MAP_SLOTS.length + slot,
548
+ visibility: maps,
549
+ sampler: {},
550
+ })),
551
+ ]);
552
+ const compute = GPUShaderStage.COMPUTE;
553
+ // The culling pipelines' parameters, the scene's tables, the compacted instances and indirect
554
+ // draws, then the depth pyramid of occlusion culling, whose first word counts the frame's
555
+ // occluders, the cell offsets, the first joint of each skinned source, and the distances
556
+ // between which each source draws. Their history shares the buffer of the indirect draws, as
557
+ // eight storage buffers is all that every device allows a shader stage.
558
+ this.defineLayout(LAYOUT_CULL, 'cull', [
559
+ { binding: 0, visibility: compute, buffer: { type: 'uniform' } },
560
+ { binding: 1, visibility: compute, buffer: { type: 'read-only-storage' } },
561
+ { binding: 2, visibility: compute, buffer: { type: 'read-only-storage' } },
562
+ { binding: 3, visibility: compute, buffer: { type: 'read-only-storage' } },
563
+ { binding: 4, visibility: compute, buffer: { type: 'storage' } },
564
+ { binding: 5, visibility: compute, buffer: { type: 'storage' } },
565
+ { binding: 6, visibility: compute, buffer: { type: 'read-only-storage' } },
566
+ { binding: 7, visibility: compute, buffer: { type: 'read-only-storage' } },
567
+ { binding: 8, visibility: compute, buffer: { type: 'storage' } },
568
+ { binding: 9, visibility: compute, texture: { sampleType: 'unfilterable-float' } },
569
+ { binding: 10, visibility: compute, texture: { sampleType: 'uint' } },
570
+ { binding: 11, visibility: compute, texture: { sampleType: 'unfilterable-float' } },
571
+ ]);
572
+ // The cluster levels' pass: one dispatch's parameters at a dynamic offset, the scene's
573
+ // patches and indices, the view's compacted instances and indirect draws, then the view's
574
+ // runs, offsets, index list and draws.
575
+ this.defineLayout(LAYOUT_CLUSTER_CULL, 'cluster cull', [
576
+ { binding: 0, visibility: compute, buffer: { type: 'uniform', hasDynamicOffset: true } },
577
+ { binding: 1, visibility: compute, buffer: { type: 'read-only-storage' } },
578
+ { binding: 2, visibility: compute, buffer: { type: 'read-only-storage' } },
579
+ { binding: 3, visibility: compute, buffer: { type: 'read-only-storage' } },
580
+ { binding: 4, visibility: compute, buffer: { type: 'read-only-storage' } },
581
+ { binding: 5, visibility: compute, buffer: { type: 'storage' } },
582
+ { binding: 6, visibility: compute, buffer: { type: 'storage' } },
583
+ { binding: 7, visibility: compute, buffer: { type: 'storage' } },
584
+ { binding: 8, visibility: compute, buffer: { type: 'storage' } },
585
+ ]);
586
+ // A batch's parameters at a dynamic offset, the pyramid, and the occluders' depth, read with
587
+ // textureLoad as a float texture: compatibility mode forbids depth textures in textureLoad.
588
+ this.defineLayout(LAYOUT_DEPTH_PYRAMID, 'depth pyramid', [
589
+ { binding: 0, visibility: compute, buffer: { type: 'uniform', hasDynamicOffset: true } },
590
+ { binding: 1, visibility: compute, buffer: { type: 'storage' } },
591
+ { binding: 2, visibility: compute, texture: { sampleType: 'unfilterable-float' } },
592
+ ]);
593
+ // The view's culling parameters, for its row of the cell offsets texture, the world matrices,
594
+ // the bucket table, the bucket records and the cell offsets texture, which the vertex shaders
595
+ // of the builds that read their instances by index read. Compatibility mode may have no storage buffers
596
+ // in vertex shaders, and refuses the layout itself, so only core WebGPU makes and binds it.
597
+ const vertex = GPUShaderStage.VERTEX;
598
+ this.defineLayout(LAYOUT_INSTANCE_INDEX, 'instance index', [
599
+ { binding: 0, visibility: vertex, buffer: { type: 'uniform' } },
600
+ { binding: 1, visibility: vertex, buffer: { type: 'read-only-storage' } },
601
+ { binding: 2, visibility: vertex, buffer: { type: 'read-only-storage' } },
602
+ { binding: 3, visibility: vertex, buffer: { type: 'read-only-storage' } },
603
+ { binding: 4, visibility: vertex, texture: { sampleType: 'unfilterable-float' } },
604
+ ], true);
605
+ // Light clustering's parameters, the light list, the light grid that it fills, and the
606
+ // depth reduction that its fit reads.
607
+ this.defineLayout(LAYOUT_LIGHT_CLUSTERS, 'light clusters', [
608
+ { binding: 0, visibility: GPUShaderStage.COMPUTE, buffer: { type: 'uniform' } },
609
+ { binding: 1, visibility: GPUShaderStage.COMPUTE, buffer: { type: 'read-only-storage' } },
610
+ { binding: 2, visibility: GPUShaderStage.COMPUTE, buffer: { type: 'storage' } },
611
+ { binding: 3, visibility: GPUShaderStage.COMPUTE, buffer: { type: 'read-only-storage' } },
612
+ ]);
613
+ // The light clusters' depth reduction: its blocks, the light grid whose header it writes,
614
+ // and the view's depth as a float texture. The multisampled layout reads sample 0.
615
+ this.defineLayout(LAYOUT_LIGHT_DEPTH, 'light depth', [
616
+ { binding: 0, visibility: GPUShaderStage.COMPUTE, buffer: { type: 'uniform' } },
617
+ { binding: 1, visibility: GPUShaderStage.COMPUTE, buffer: { type: 'storage' } },
618
+ {
619
+ binding: 2,
620
+ visibility: GPUShaderStage.COMPUTE,
621
+ texture: { sampleType: 'unfilterable-float' },
622
+ },
623
+ ]);
624
+ this.defineLayout(LAYOUT_LIGHT_DEPTH_MS, 'light depth ms', [
625
+ { binding: 0, visibility: GPUShaderStage.COMPUTE, buffer: { type: 'uniform' } },
626
+ { binding: 1, visibility: GPUShaderStage.COMPUTE, buffer: { type: 'storage' } },
627
+ {
628
+ binding: 2,
629
+ visibility: GPUShaderStage.COMPUTE,
630
+ texture: { sampleType: 'unfilterable-float', multisampled: true },
631
+ },
632
+ ]);
633
+ // The joint texture, which the builds that skin in the vertex shader read.
634
+ this.defineLayout(LAYOUT_JOINTS, 'joints', [
635
+ {
636
+ binding: 0,
637
+ visibility: GPUShaderStage.VERTEX,
638
+ texture: { sampleType: 'unfilterable-float' },
639
+ },
640
+ ]);
641
+ // The skinning pass's table of formats and parts, a mesh page's vertices, the skinned
642
+ // vertices that it writes, the joint matrices, and the morph textures of deltas and of
643
+ // weights, which it reads with textureLoad.
644
+ const computeData = { sampleType: 'unfilterable-float' };
645
+ this.defineLayout(LAYOUT_SKIN, 'skin', [
646
+ { binding: 0, visibility: GPUShaderStage.COMPUTE, buffer: { type: 'read-only-storage' } },
647
+ { binding: 1, visibility: GPUShaderStage.COMPUTE, buffer: { type: 'read-only-storage' } },
648
+ { binding: 2, visibility: GPUShaderStage.COMPUTE, buffer: { type: 'storage' } },
649
+ { binding: 3, visibility: GPUShaderStage.COMPUTE, texture: computeData },
650
+ { binding: 4, visibility: GPUShaderStage.COMPUTE, texture: computeData },
651
+ { binding: 5, visibility: GPUShaderStage.COMPUTE, texture: computeData },
652
+ ]);
653
+ // Group 0 of an add-on's compute pass: its block of uniforms, then the storage texture that
654
+ // it fills. The storage texture's format is part of the layout, so a pass of another
655
+ // format takes the layout of that format. Shaders read the target as an array of one
656
+ // layer, as they sample every pass's target.
657
+ const computeEntries = (format) => [
658
+ { binding: 0, visibility: compute, buffer: { type: 'uniform' } },
659
+ {
660
+ binding: 1,
661
+ visibility: compute,
662
+ storageTexture: { access: 'write-only', format, viewDimension: '2d-array' },
663
+ },
664
+ ];
665
+ this.defineLayout(LAYOUT_COMPUTE_RGBA16_FLOAT, 'compute rgba16float', computeEntries('rgba16float'), true);
666
+ this.defineLayout(LAYOUT_COMPUTE_R32_FLOAT, 'compute r32float', computeEntries('r32float'), true);
667
+ this.defineLayout(LAYOUT_COMPUTE_RGBA8_UNORM, 'compute rgba8unorm', computeEntries('rgba8unorm'), true);
668
+ // Group 0 of a compute pass that keeps two states: its block of uniforms, the state that
669
+ // this run writes as a storage texture, and the state of the run before, which the shader
670
+ // reads. Each run binds a view of one state's layers, so no subresource is both written
671
+ // and read in one dispatch.
672
+ const historyEntries = (format, sampleType) => [
673
+ ...computeEntries(format),
674
+ { binding: 2, visibility: compute, texture: { sampleType, viewDimension: '2d-array' } },
675
+ ];
676
+ this.defineLayout(LAYOUT_COMPUTE_HISTORY_RGBA16_FLOAT, 'compute history rgba16float', historyEntries('rgba16float', 'float'), true);
677
+ this.defineLayout(LAYOUT_COMPUTE_HISTORY_R32_FLOAT, 'compute history r32float', historyEntries('r32float', 'unfilterable-float'), true);
678
+ this.defineLayout(LAYOUT_COMPUTE_HISTORY_RGBA8_UNORM, 'compute history rgba8unorm', historyEntries('rgba8unorm', 'float'), true);
679
+ // Group 0 of an add-on's compute pass that fills an instance draw: its block of uniforms,
680
+ // the draw's count word and its per-instance rows, both read and written as storage.
681
+ this.defineLayout(LAYOUT_COMPUTE_INSTANCE_BUFFERS, 'compute instance buffers', [
682
+ { binding: 0, visibility: compute, buffer: { type: 'uniform' } },
683
+ { binding: 1, visibility: compute, buffer: { type: 'storage' } },
684
+ { binding: 2, visibility: compute, buffer: { type: 'storage' } },
685
+ ], true);
686
+ // Group 0 of the conversion of a feature-instance draw's world rows: its block of
687
+ // uniforms, which holds the camera's world position, the draw's count word and world rows,
688
+ // which it reads, and the camera-relative rows that it writes.
689
+ this.defineLayout(LAYOUT_FEATURE_ROWS, 'feature rows', [
690
+ { binding: 0, visibility: compute, buffer: { type: 'uniform' } },
691
+ { binding: 1, visibility: compute, buffer: { type: 'read-only-storage' } },
692
+ { binding: 2, visibility: compute, buffer: { type: 'read-only-storage' } },
693
+ { binding: 3, visibility: compute, buffer: { type: 'storage' } },
694
+ ], true);
695
+ // The final pass reads the scene color with textureLoad, which takes any float format, and
696
+ // its color grading table, a 3D texture, with a linear filter, which reads the outline mask
697
+ // too.
698
+ const finalEntries = [
699
+ { binding: 0, visibility: fragment, buffer: { type: 'uniform' } },
700
+ {
701
+ binding: 1,
702
+ visibility: fragment,
703
+ texture: { sampleType: 'unfilterable-float', viewDimension: '2d' },
704
+ },
705
+ { binding: 9, visibility: fragment, texture: { viewDimension: '3d' } },
706
+ { binding: 10, visibility: fragment, sampler: {} },
707
+ { binding: 11, visibility: fragment, texture: {} },
708
+ // The automatic exposure's texel, in 32-bit floats, which no device need filter.
709
+ { binding: 12, visibility: fragment, texture: { sampleType: 'unfilterable-float' } },
710
+ // The built-in grading table, a 3D texture that a job worker baked.
711
+ { binding: 13, visibility: fragment, texture: { viewDimension: '3d' } },
712
+ ];
713
+ this.defineLayout(LAYOUT_FINAL, 'final', finalEntries);
714
+ // The base level of bloom's chain, which the final pass's bloom build reads with a linear
715
+ // filter, after its settings.
716
+ this.defineLayout(LAYOUT_FINAL_BLOOM, 'final bloom', [
717
+ ...finalEntries,
718
+ { binding: 2, visibility: fragment, buffer: { type: 'uniform' } },
719
+ { binding: 3, visibility: fragment, texture: {} },
720
+ { binding: 8, visibility: fragment, sampler: {} },
721
+ ]);
722
+ // A step of bloom: its settings, the texture it reads, and the linear sampler.
723
+ this.defineLayout(LAYOUT_BLOOM, 'bloom', [
724
+ { binding: 0, visibility: fragment, buffer: { type: 'uniform' } },
725
+ { binding: 1, visibility: fragment, texture: {} },
726
+ { binding: 2, visibility: fragment, sampler: {} },
727
+ ]);
728
+ // Ambient occlusion's steps read every texture with textureLoad. The depth step reads the
729
+ // depth target as plain floats: compatibility mode reads no depth texture type with
730
+ // textureLoad, and it does read a depth format bound as unfilterable floats.
731
+ const aoSettings = {
732
+ binding: 0,
733
+ visibility: fragment,
734
+ buffer: { type: 'uniform' },
735
+ };
736
+ const unfiltered = (binding, multisampled = false) => ({
737
+ binding,
738
+ visibility: fragment,
739
+ texture: { sampleType: 'unfilterable-float', multisampled },
740
+ });
741
+ // The moment layer's colour builds keep the frame's copy of the opaque color at binding 15,
742
+ // which every lit build declares through the reflection code, and add the moment store at
743
+ // the light probe grid's binding, 10. They declare no light probe grid, so that entry
744
+ // leaves the layout: their maps' group already takes the fragment stage to the count of 16
745
+ // without it.
746
+ this.defineLayout(LAYOUT_MOMENT_FRAME, 'moment frame', [
747
+ ...frame.filter((entry) => entry !== probeGrid),
748
+ {
749
+ binding: 10,
750
+ visibility: fragment,
751
+ texture: { sampleType: 'unfilterable-float' },
752
+ },
753
+ ]);
754
+ // The moment layer's steps read their images with textureLoad, and the anti-aliasing reads
755
+ // its lookup tables and its images with a linear sampler.
756
+ this.defineLayout(LAYOUT_MOMENT_COMPOSITE, 'moment composite', [unfiltered(0), unfiltered(1)]);
757
+ this.defineLayout(LAYOUT_MOMENT_DEPTH_MS, 'moment depth ms', [unfiltered(0, true)]);
758
+ this.defineLayout(LAYOUT_MOMENT_SMAA_EDGES, 'moment smaa edges', [
759
+ unfiltered(0),
760
+ unfiltered(1),
761
+ ]);
762
+ this.defineLayout(LAYOUT_MOMENT_SMAA_BLEND, 'moment smaa blend', [
763
+ { binding: 0, visibility: fragment, texture: {} },
764
+ { binding: 1, visibility: fragment, texture: {} },
765
+ { binding: 2, visibility: fragment, texture: {} },
766
+ { binding: 3, visibility: fragment, sampler: { type: 'filtering' } },
767
+ ]);
768
+ this.defineLayout(LAYOUT_MOMENT_SMAA_RESOLVE, 'moment smaa resolve', [
769
+ { binding: 0, visibility: fragment, texture: {} },
770
+ { binding: 1, visibility: fragment, texture: {} },
771
+ { binding: 2, visibility: fragment, sampler: { type: 'filtering' } },
772
+ ]);
773
+ this.defineLayout(LAYOUT_AO_DEPTH, 'ao depth', [aoSettings, unfiltered(1)]);
774
+ this.defineLayout(LAYOUT_AO_DEPTH_MS, 'ao depth ms', [aoSettings, unfiltered(1, true)]);
775
+ this.defineLayout(LAYOUT_AO, 'ao', [
776
+ aoSettings,
777
+ unfiltered(1),
778
+ unfiltered(2),
779
+ // Screen-space reflections' trace, or a blank array while they draw none: an array of
780
+ // layers either way, so the screen texture reads the same on both paths.
781
+ {
782
+ binding: 3,
783
+ visibility: fragment,
784
+ texture: { sampleType: 'unfilterable-float', viewDimension: '2d-array' },
785
+ },
786
+ ]);
787
+ // Screen-space reflections' steps read every texture with textureLoad too: a level of the
788
+ // depth pyramid reads the level below it, and the trace ambient occlusion's depth copy and
789
+ // the pyramid's six levels above it.
790
+ this.defineLayout(LAYOUT_SSR_REDUCE, 'ssr reduce', [aoSettings, unfiltered(1)]);
791
+ this.defineLayout(LAYOUT_SSR_TRACE, 'ssr trace', [
792
+ aoSettings,
793
+ ...[1, 2, 3, 4, 5, 6, 7].map((binding) => unfiltered(binding)),
794
+ ]);
795
+ // Screen-space bounce light's steps read ambient occlusion's depth copy and horizon step's
796
+ // target with textureLoad, and the color copy or the traced light as an array of layers:
797
+ // the copy has one layer per surface that lets light through, and both steps take the
798
+ // same layout.
799
+ this.defineLayout(LAYOUT_BOUNCE, 'bounce', [
800
+ aoSettings,
801
+ unfiltered(1),
802
+ unfiltered(2),
803
+ {
804
+ binding: 3,
805
+ visibility: fragment,
806
+ texture: { sampleType: 'unfilterable-float', viewDimension: '2d-array' },
807
+ },
808
+ ]);
809
+ // The background's values, which the sky's vertex stage reads too, a cube map and its
810
+ // filtering sampler.
811
+ this.defineLayout(LAYOUT_BACKGROUND, 'background', [
812
+ { binding: 0, visibility: GPUShaderStage.VERTEX | fragment, buffer: { type: 'uniform' } },
813
+ { binding: 1, visibility: fragment, texture: { viewDimension: 'cube' } },
814
+ { binding: 2, visibility: fragment, sampler: {} },
815
+ ]);
816
+ // A sky layer's values: its uniform block alone, which its template's fragment stage
817
+ // reads.
818
+ this.defineLayout(LAYOUT_BACKGROUND_LAYER, 'background layer', [
819
+ { binding: 0, visibility: fragment, buffer: { type: 'uniform' } },
820
+ ]);
821
+ // The volumetric cloud tier's group: the sky's own block or the physical sky's values and
822
+ // tables, then the noise field and its sampler at the bindings that the shared cloud module
823
+ // names.
824
+ const cloudValues = {
825
+ binding: 0,
826
+ visibility: GPUShaderStage.VERTEX | fragment,
827
+ buffer: { type: 'uniform' },
828
+ };
829
+ this.defineLayout(LAYOUT_CLOUDS, 'clouds', [
830
+ cloudValues,
831
+ { binding: 6, visibility: fragment, texture: { viewDimension: '3d' } },
832
+ { binding: 7, visibility: fragment, sampler: {} },
833
+ ]);
834
+ this.defineLayout(LAYOUT_CLOUDS_ATMOSPHERE, 'clouds atmosphere', [
835
+ cloudValues,
836
+ { binding: 1, visibility: fragment, texture: {} },
837
+ { binding: 2, visibility: fragment, texture: {} },
838
+ { binding: 3, visibility: fragment, texture: {} },
839
+ { binding: 4, visibility: fragment, sampler: {} },
840
+ { binding: 5, visibility: fragment, sampler: {} },
841
+ { binding: 6, visibility: fragment, texture: { viewDimension: '3d' } },
842
+ { binding: 7, visibility: fragment, sampler: {} },
843
+ ]);
844
+ // The physical sky's group: its values, its three tables, which it reads with a linear
845
+ // filter, a sampler that clamps and one that repeats across the width.
846
+ this.defineLayout(LAYOUT_ATMOSPHERE, 'atmosphere', [
847
+ { binding: 0, visibility: fragment, buffer: { type: 'uniform' } },
848
+ { binding: 1, visibility: fragment, texture: {} },
849
+ { binding: 2, visibility: fragment, texture: {} },
850
+ { binding: 3, visibility: fragment, texture: {} },
851
+ { binding: 4, visibility: fragment, sampler: {} },
852
+ { binding: 5, visibility: fragment, sampler: {} },
853
+ ]);
854
+ // The copy of a view's image into its target reads the image with textureLoad.
855
+ this.defineLayout(LAYOUT_VIEW_COPY, 'view copy', [unfiltered(0)]);
856
+ // The still-camera accumulation's blend: its values, and the color it reads with textureLoad.
857
+ this.defineLayout(LAYOUT_ACCUMULATE, 'accumulate', [
858
+ { binding: 0, visibility: fragment, buffer: { type: 'uniform' } },
859
+ unfiltered(1),
860
+ ]);
861
+ // The weighted layer's composite reads its two sums, and its depth copy a multisampled scene
862
+ // depth, with textureLoad. The copy of the opaque color for transmission reads the scene
863
+ // color and depth as the composite reads its sums, or with a multisampled depth.
864
+ this.defineLayout(LAYOUT_WEIGHTED_COMPOSITE, 'weighted composite', [
865
+ unfiltered(0),
866
+ unfiltered(1),
867
+ ]);
868
+ this.defineLayout(LAYOUT_WEIGHTED_DEPTH_MS, 'weighted depth ms', [unfiltered(0, true)]);
869
+ this.defineLayout(LAYOUT_TRANSMISSION_COPY_MS, 'transmission copy ms', [
870
+ unfiltered(0),
871
+ unfiltered(1, true),
872
+ ]);
873
+ // A custom effect: its block, the color it reads with a linear filter and the sampler, then
874
+ // the scene's depth as plain floats, or a blank texture where the effect reads no depth.
875
+ const effectEntries = [
876
+ aoSettings,
877
+ { binding: 1, visibility: fragment, texture: {} },
878
+ { binding: 2, visibility: fragment, sampler: {} },
879
+ ];
880
+ this.defineLayout(LAYOUT_EFFECT, 'effect', [...effectEntries, unfiltered(3)]);
881
+ this.defineLayout(LAYOUT_EFFECT_DEPTH_MS, 'effect depth ms', [
882
+ ...effectEntries,
883
+ unfiltered(3, true),
884
+ ]);
885
+ // An effect that reads a level of bloom's chain binds the level after its depth, which it
886
+ // samples with its linear sampler.
887
+ const bloomLevel = {
888
+ binding: 4,
889
+ visibility: fragment,
890
+ texture: {},
891
+ };
892
+ this.defineLayout(LAYOUT_EFFECT_BLOOM, 'effect bloom', [
893
+ ...effectEntries,
894
+ unfiltered(3),
895
+ bloomLevel,
896
+ ]);
897
+ this.defineLayout(LAYOUT_EFFECT_BLOOM_DEPTH_MS, 'effect bloom depth ms', [
898
+ ...effectEntries,
899
+ unfiltered(3, true),
900
+ bloomLevel,
901
+ ]);
902
+ // Depth of field's composite: an effect's entries with the scene's depth, then the blurred
903
+ // image, which it reads with the linear sampler.
904
+ const blurred = { binding: 4, visibility: fragment, texture: {} };
905
+ this.defineLayout(LAYOUT_DOF_COMPOSITE, 'dof', [...effectEntries, unfiltered(3), blurred]);
906
+ this.defineLayout(LAYOUT_DOF_COMPOSITE_MS, 'dof ms', [
907
+ ...effectEntries,
908
+ unfiltered(3, true),
909
+ blurred,
910
+ ]);
911
+ // Temporal anti-aliasing's resolve: its block, the scene's color, depth and motion, each
912
+ // read with textureLoad, the two histories, which it samples with the linear sampler, and
913
+ // the sampler at binding 6. The multisampled build reads the scene depth's samples.
914
+ const taa = (depthMultisampled) => [
915
+ aoSettings,
916
+ unfiltered(1),
917
+ unfiltered(2, depthMultisampled),
918
+ unfiltered(3),
919
+ { binding: 4, visibility: fragment, texture: {} },
920
+ { binding: 5, visibility: fragment, texture: {} },
921
+ { binding: 6, visibility: fragment, sampler: {} },
922
+ { binding: 7, visibility: fragment, texture: {} },
923
+ ];
924
+ this.defineLayout(LAYOUT_TAA, 'taa', taa(false));
925
+ this.defineLayout(LAYOUT_TAA_MS, 'taa ms', taa(true));
926
+ // The subsurface blur's steps read every texture with textureLoad: the across step the skin
927
+ // pass's light, and the down step that, the across step's light, the scene color and the
928
+ // scene's depth as plain floats.
929
+ this.defineLayout(LAYOUT_SUBSURFACE_BLUR, 'subsurface blur', [aoSettings, unfiltered(1)]);
930
+ const composite = [aoSettings, unfiltered(1), unfiltered(2), unfiltered(3)];
931
+ this.defineLayout(LAYOUT_SUBSURFACE_COMPOSITE, 'subsurface composite', [
932
+ ...composite,
933
+ unfiltered(4),
934
+ ]);
935
+ this.defineLayout(LAYOUT_SUBSURFACE_COMPOSITE_MS, 'subsurface composite ms', [
936
+ ...composite,
937
+ unfiltered(4, true),
938
+ ]);
939
+ // The final pass with custom effects folded into it: the pass's own entries, then every
940
+ // effect's block and the scene's depth, which the effects read as a group does. The effects
941
+ // sample the scene color with a linear filter, so it binds as a filterable float texture:
942
+ // effects run on the HDR path, whose color formats filter.
943
+ const foldEntries = [
944
+ ...finalEntries.map((entry) => entry.binding === 1 ? { binding: 1, visibility: fragment, texture: {} } : entry),
945
+ { binding: 4, visibility: fragment, buffer: { type: 'uniform' } },
946
+ ];
947
+ this.defineLayout(LAYOUT_FINAL_EFFECTS, 'final effects', [...foldEntries, unfiltered(5)]);
948
+ this.defineLayout(LAYOUT_FINAL_EFFECTS_DEPTH_MS, 'final effects depth ms', [
949
+ ...foldEntries,
950
+ unfiltered(5, true),
951
+ ]);
952
+ // A particle system's values, then the block of the view that draws, at a dynamic offset,
953
+ // then the wind field that its vertex shader samples; then the view's copy of its opaque
954
+ // depth, which soft particles read with textureLoad.
955
+ const vertexAndFragment = GPUShaderStage.VERTEX | fragment;
956
+ this.defineLayout(LAYOUT_PARTICLE, 'particle', [
957
+ { binding: 0, visibility: vertexAndFragment, buffer: { type: 'uniform' } },
958
+ {
959
+ binding: 1,
960
+ visibility: vertexAndFragment,
961
+ buffer: { type: 'uniform', hasDynamicOffset: true },
962
+ },
963
+ {
964
+ binding: 2,
965
+ visibility: GPUShaderStage.VERTEX,
966
+ texture: { sampleType: 'float', viewDimension: '2d-array' },
967
+ },
968
+ { binding: 3, visibility: GPUShaderStage.VERTEX, sampler: { type: 'filtering' } },
969
+ ]);
970
+ this.defineLayout(LAYOUT_PARTICLE_SCENE_DEPTH, 'particle scene depth', [unfiltered(0)]);
971
+ // The copy of the opaque depth for soft particles reads a multisampled depth's first sample;
972
+ // the one-sample copy binds as a view's copy does.
973
+ this.defineLayout(LAYOUT_PARTICLE_DEPTH_MS, 'particle depth ms', [unfiltered(0, true)]);
974
+ for (const [id, label, shader, layout] of [
975
+ [TEMPLATE_PARTICLE_DEPTH, 'particle depth', shaders.particle_depth, LAYOUT_VIEW_COPY],
976
+ [
977
+ TEMPLATE_PARTICLE_DEPTH_MS,
978
+ 'particle depth ms',
979
+ shaders.particle_depth_ms,
980
+ LAYOUT_PARTICLE_DEPTH_MS,
981
+ ],
982
+ ])
983
+ this.defineTemplate(id, {
984
+ label,
985
+ shader,
986
+ pipeline: 'main',
987
+ layouts: [layout],
988
+ vertexBuffers: [],
989
+ });
990
+ for (const [id, label, shader, map] of [
991
+ [TEMPLATE_PARTICLE, 'particles', shaders.particle, false],
992
+ [TEMPLATE_PARTICLE_MAP, 'particles map', shaders.particle_map, true],
993
+ ]) {
994
+ const layouts = [LAYOUT_FRAME, LAYOUT_PARTICLE, LAYOUT_PARTICLE_SCENE_DEPTH];
995
+ this.defineTemplate(id, {
996
+ label,
997
+ shader,
998
+ pipeline: 'main',
999
+ layouts: map ? [...layouts, LAYOUT_TEXTURES] : layouts,
1000
+ vertexBuffers: [PARTICLE_RECORDS],
1001
+ });
1002
+ }
1003
+ for (const [id, label, shader, meshLocations, layouts] of [
1004
+ [TEMPLATE_INSTANCED_LIT, 'lit', shaders.lit, [0, 1], [LAYOUT_FRAME]],
1005
+ [TEMPLATE_PROBE_GRID, 'probe grid', shaders.probe_grid, [0, 1], [LAYOUT_FRAME]],
1006
+ [
1007
+ TEMPLATE_PROBE_GRID_MAPS,
1008
+ 'probe grid maps',
1009
+ shaders.probe_grid_maps,
1010
+ [0, 1, 2, 3],
1011
+ [LAYOUT_FRAME, LAYOUT_MATERIAL_MAPS],
1012
+ ],
1013
+ [TEMPLATE_INSTANCED_UNLIT, 'unlit', shaders.unlit, [0], [LAYOUT_FRAME]],
1014
+ [TEMPLATE_INSTANCED_TEXCOORDS, 'texcoords', shaders.texcoords, [0, 2], [LAYOUT_FRAME]],
1015
+ [
1016
+ TEMPLATE_INSTANCED_UNLIT_MAP,
1017
+ 'unlit map',
1018
+ shaders.unlit_map,
1019
+ [0, 2, 3],
1020
+ [LAYOUT_FRAME, LAYOUT_TEXTURES],
1021
+ ],
1022
+ [
1023
+ TEMPLATE_INSTANCED_STANDARD_MAPS,
1024
+ 'standard maps',
1025
+ shaders.standard_maps,
1026
+ [0, 1, 2, 3],
1027
+ [LAYOUT_FRAME, LAYOUT_MATERIAL_MAPS],
1028
+ ],
1029
+ [TEMPLATE_SHADOW_DEPTH, 'shadow depth', shaders.shadow_depth, [0, 1], [LAYOUT_DEPTH]],
1030
+ [TEMPLATE_SHADOW_CUTOUT, 'shadow cutout', shaders.shadow_cutout, [0, 1], [LAYOUT_DEPTH]],
1031
+ [
1032
+ TEMPLATE_SHADOW_CUTOUT_MAP,
1033
+ 'shadow cutout map',
1034
+ shaders.shadow_cutout_map,
1035
+ [0, 1, 2, 3],
1036
+ [LAYOUT_DEPTH, LAYOUT_TEXTURES],
1037
+ ],
1038
+ [TEMPLATE_OUTLINE_MASK, 'outline mask', shaders.outline_mask, [0, 1], [LAYOUT_DEPTH]],
1039
+ [TEMPLATE_TONE_MASK, 'tone mask', shaders.tone_mask, [0, 1], [LAYOUT_DEPTH]],
1040
+ [TEMPLATE_SUBSURFACE, 'subsurface', shaders.subsurface, [0, 1], [LAYOUT_FRAME]],
1041
+ [
1042
+ TEMPLATE_SUBSURFACE_MAPS,
1043
+ 'subsurface maps',
1044
+ shaders.subsurface_maps,
1045
+ [0, 1, 2, 3],
1046
+ [LAYOUT_FRAME, LAYOUT_MATERIAL_MAPS],
1047
+ ],
1048
+ [TEMPLATE_PICK, 'pick', shaders.pick, [0], [LAYOUT_FRAME]],
1049
+ [
1050
+ TEMPLATE_PICK_MAPS,
1051
+ 'pick maps',
1052
+ shaders.pick_maps,
1053
+ [0, 2, 3],
1054
+ [LAYOUT_FRAME, LAYOUT_MATERIAL_MAPS],
1055
+ ],
1056
+ [
1057
+ TEMPLATE_PICK_TEXTURE_MAPS,
1058
+ 'pick texture maps',
1059
+ shaders.pick_texture_maps,
1060
+ [0, 2, 3],
1061
+ [LAYOUT_FRAME, LAYOUT_TEXTURES],
1062
+ ],
1063
+ [TEMPLATE_SPRITE, 'sprite', shaders.sprite, [0, 2], [LAYOUT_FRAME]],
1064
+ [TEMPLATE_MOMENT_LIT, 'moment lit', shaders.moment_lit, [0, 1], [LAYOUT_MOMENT_FRAME]],
1065
+ [
1066
+ TEMPLATE_MOMENT_STANDARD_MAPS,
1067
+ 'moment standard maps',
1068
+ shaders.moment_standard_maps,
1069
+ [0, 1, 2, 3],
1070
+ [LAYOUT_MOMENT_FRAME, LAYOUT_MATERIAL_MAPS],
1071
+ ],
1072
+ [TEMPLATE_MOMENT_UNLIT, 'moment unlit', shaders.moment_unlit, [0], [LAYOUT_MOMENT_FRAME]],
1073
+ [
1074
+ TEMPLATE_MOMENT_UNLIT_MAP,
1075
+ 'moment unlit map',
1076
+ shaders.moment_unlit_map,
1077
+ [0, 2, 3],
1078
+ [LAYOUT_MOMENT_FRAME, LAYOUT_TEXTURES],
1079
+ ],
1080
+ [
1081
+ TEMPLATE_MOMENT_SPRITE,
1082
+ 'moment sprite',
1083
+ shaders.moment_sprite,
1084
+ [0, 2],
1085
+ [LAYOUT_MOMENT_FRAME],
1086
+ ],
1087
+ [
1088
+ TEMPLATE_MOMENT_SPRITE_MAP,
1089
+ 'moment sprite map',
1090
+ shaders.moment_sprite_map,
1091
+ [0, 2],
1092
+ [LAYOUT_MOMENT_FRAME, LAYOUT_TEXTURES],
1093
+ ],
1094
+ [TEMPLATE_LINE, 'line', shaders.line, [0], [LAYOUT_FRAME]],
1095
+ [TEMPLATE_LINE_LIT, 'lit line', shaders.line_lit, [0], [LAYOUT_FRAME]],
1096
+ [
1097
+ TEMPLATE_SPRITE_MAP,
1098
+ 'sprite map',
1099
+ shaders.sprite_map,
1100
+ [0, 2],
1101
+ [LAYOUT_FRAME, LAYOUT_TEXTURES],
1102
+ ],
1103
+ ]) {
1104
+ this.defineTemplate(id, {
1105
+ label: `mesh ${label}`,
1106
+ shader,
1107
+ pipeline: 'main',
1108
+ layouts,
1109
+ meshLocations,
1110
+ vertexBuffers: INSTANCE_BUFFERS,
1111
+ ownPrepass: id === TEMPLATE_SPRITE || id === TEMPLATE_SPRITE_MAP,
1112
+ depthFragment: id === TEMPLATE_SHADOW_CUTOUT || id === TEMPLATE_SHADOW_CUTOUT_MAP,
1113
+ });
1114
+ }
1115
+ // Decals: their frame group, the maps' where the build samples them, then the scene's depth,
1116
+ // which the builds that read a multisampled depth bind through a layout of their own. They
1117
+ // read the position of the box's corners alone.
1118
+ this.defineLayout(LAYOUT_DECAL_DEPTH, 'decal depth', [unfiltered(0)]);
1119
+ this.defineLayout(LAYOUT_DECAL_DEPTH_MS, 'decal depth ms', [unfiltered(0, true)]);
1120
+ // A custom material that reads the scene's depth binds the copy of the camera's opaque
1121
+ // depth after the maps' group, or after the frame's when it has no textures. The copy is
1122
+ // one sample whatever the scene's antialiasing, so it needs no multisampled layout.
1123
+ this.defineLayout(LAYOUT_MATERIAL_SCENE, 'material scene depth', [unfiltered(0)]);
1124
+ for (const [id, label, shader, maps] of [
1125
+ [TEMPLATE_DECAL, 'decal', shaders.decal, []],
1126
+ [TEMPLATE_DECAL_MAPS, 'decal maps', shaders.decal_maps, [LAYOUT_MATERIAL_MAPS]],
1127
+ ]) {
1128
+ this.defineTemplate(id, {
1129
+ label: `mesh ${label}`,
1130
+ shader,
1131
+ pipeline: 'main',
1132
+ layouts: [LAYOUT_DECAL_FRAME, ...maps, LAYOUT_DECAL_DEPTH],
1133
+ multisampledLayouts: [LAYOUT_DECAL_FRAME, ...maps, LAYOUT_DECAL_DEPTH_MS],
1134
+ meshLocations: [0],
1135
+ vertexBuffers: INSTANCE_BUFFERS,
1136
+ });
1137
+ }
1138
+ // GPU picking's resolve: one triangle over the render size that copies the id target that
1139
+ // the device resolved, at group 0 of a view copy's layout.
1140
+ this.defineTemplate(TEMPLATE_PICK_RESOLVE, {
1141
+ label: 'pick resolve',
1142
+ shader: shaders.pick_resolve,
1143
+ pipeline: 'main',
1144
+ layouts: [LAYOUT_VIEW_COPY],
1145
+ vertexBuffers: [],
1146
+ });
1147
+ this.defineTemplate(TEMPLATE_FINAL, {
1148
+ label: 'final',
1149
+ shader: shaders.final,
1150
+ pipeline: 'main',
1151
+ layouts: [LAYOUT_FINAL],
1152
+ vertexBuffers: [],
1153
+ });
1154
+ this.defineTemplate(TEMPLATE_FINAL_BLOOM, {
1155
+ label: 'final bloom',
1156
+ shader: shaders.final,
1157
+ pipeline: 'main',
1158
+ layouts: [LAYOUT_FINAL_BLOOM],
1159
+ vertexBuffers: [],
1160
+ });
1161
+ this.defineTemplate(TEMPLATE_BLOOM, {
1162
+ label: 'bloom',
1163
+ shader: shaders.bloom,
1164
+ pipeline: 'main',
1165
+ layouts: [LAYOUT_BLOOM],
1166
+ vertexBuffers: [],
1167
+ });
1168
+ for (const [id, label, shader, pipeline, layout] of [
1169
+ [TEMPLATE_AO_DEPTH, 'ao depth', shaders.ao, 'depth', LAYOUT_AO_DEPTH],
1170
+ [TEMPLATE_AO_DEPTH_MS, 'ao depth ms', shaders.ao_ms, 'depth', LAYOUT_AO_DEPTH_MS],
1171
+ [TEMPLATE_AO, 'ao horizon', shaders.ao, 'horizon', LAYOUT_AO],
1172
+ [TEMPLATE_AO_DENOISE, 'ao denoise', shaders.ao, 'denoise', LAYOUT_AO],
1173
+ [TEMPLATE_SSR_REDUCE, 'ssr reduce', shaders.ssr_reduce, 'reduce', LAYOUT_SSR_REDUCE],
1174
+ [TEMPLATE_SSR_TRACE, 'ssr trace', shaders.ssr, 'trace', LAYOUT_SSR_TRACE],
1175
+ [TEMPLATE_BOUNCE_TRACE, 'bounce trace', shaders.bounce, 'trace', LAYOUT_BOUNCE],
1176
+ [TEMPLATE_BOUNCE_DENOISE, 'bounce denoise', shaders.bounce, 'denoise', LAYOUT_BOUNCE],
1177
+ [
1178
+ TEMPLATE_EXPOSURE_LUMINANCE,
1179
+ 'exposure cells',
1180
+ shaders.exposure,
1181
+ 'downsample',
1182
+ LAYOUT_EFFECT,
1183
+ ],
1184
+ [TEMPLATE_EXPOSURE_ADAPT, 'exposure adapt', shaders.exposure, 'adapt', LAYOUT_EFFECT],
1185
+ [TEMPLATE_DOF_SETUP, 'dof setup', shaders.dof, 'setup', LAYOUT_EFFECT],
1186
+ [TEMPLATE_DOF_SETUP_MS, 'dof setup ms', shaders.dof_ms, 'setup', LAYOUT_EFFECT_DEPTH_MS],
1187
+ [TEMPLATE_DOF_BLUR, 'dof gather', shaders.dof, 'gather', LAYOUT_BLOOM],
1188
+ [TEMPLATE_DOF_FILTER, 'dof tent', shaders.dof, 'tent', LAYOUT_BLOOM],
1189
+ [TEMPLATE_DOF_COMPOSITE, 'dof composite', shaders.dof, 'composite', LAYOUT_DOF_COMPOSITE],
1190
+ [
1191
+ TEMPLATE_DOF_COMPOSITE_MS,
1192
+ 'dof composite ms',
1193
+ shaders.dof_ms,
1194
+ 'composite',
1195
+ LAYOUT_DOF_COMPOSITE_MS,
1196
+ ],
1197
+ [
1198
+ TEMPLATE_SUBSURFACE_BLUR,
1199
+ 'subsurface across',
1200
+ shaders.subsurface_blur,
1201
+ 'across',
1202
+ LAYOUT_SUBSURFACE_BLUR,
1203
+ ],
1204
+ [
1205
+ TEMPLATE_SUBSURFACE_COMPOSITE,
1206
+ 'subsurface down',
1207
+ shaders.subsurface_blur,
1208
+ 'down',
1209
+ LAYOUT_SUBSURFACE_COMPOSITE,
1210
+ ],
1211
+ [
1212
+ TEMPLATE_SUBSURFACE_COMPOSITE_MS,
1213
+ 'subsurface down ms',
1214
+ shaders.subsurface_blur_ms,
1215
+ 'down',
1216
+ LAYOUT_SUBSURFACE_COMPOSITE_MS,
1217
+ ],
1218
+ // The volumetric fog's block step and sum bind as steps of bloom, and its apply step as
1219
+ // depth of field's composite, with the summed grid in place of the blurred image.
1220
+ [TEMPLATE_FOG_BLOCK, 'fog block', shaders.fog_volume, 'block', LAYOUT_BLOOM],
1221
+ [TEMPLATE_FOG_SUM, 'fog sum', shaders.fog_volume, 'sum', LAYOUT_BLOOM],
1222
+ [TEMPLATE_FOG_APPLY, 'fog apply', shaders.fog_volume, 'apply', LAYOUT_DOF_COMPOSITE],
1223
+ [
1224
+ TEMPLATE_FOG_APPLY_MS,
1225
+ 'fog apply ms',
1226
+ shaders.fog_volume_ms,
1227
+ 'apply',
1228
+ LAYOUT_DOF_COMPOSITE_MS,
1229
+ ],
1230
+ ]) {
1231
+ this.defineTemplate(id, { label, shader, pipeline, layouts: [layout], vertexBuffers: [] });
1232
+ }
1233
+ // The volumetric fog's light step reads the camera's frame group, as the background does,
1234
+ // then its own settings, the last frame's grid and a sampler, as a step of bloom does.
1235
+ this.defineTemplate(TEMPLATE_FOG_LIGHT, {
1236
+ label: 'fog light',
1237
+ shader: shaders.fog_light,
1238
+ pipeline: 'light',
1239
+ layouts: [LAYOUT_FRAME, LAYOUT_BLOOM],
1240
+ vertexBuffers: [],
1241
+ });
1242
+ this.defineTemplate(TEMPLATE_VIEW_COPY, {
1243
+ label: 'view copy',
1244
+ shader: shaders.view_copy,
1245
+ pipeline: 'main',
1246
+ layouts: [LAYOUT_VIEW_COPY],
1247
+ vertexBuffers: [],
1248
+ });
1249
+ // Temporal anti-aliasing's resolve binds the scene's color, depth and motion and both
1250
+ // histories; its copy binds as the copy of a view's image does.
1251
+ this.defineTemplate(TEMPLATE_TAA_RESOLVE, {
1252
+ label: 'taa resolve',
1253
+ shader: shaders.taa,
1254
+ pipeline: 'resolve',
1255
+ layouts: [LAYOUT_TAA],
1256
+ vertexBuffers: [],
1257
+ });
1258
+ this.defineTemplate(TEMPLATE_TAA_RESOLVE_MS, {
1259
+ label: 'taa resolve ms',
1260
+ shader: shaders.taa_ms,
1261
+ pipeline: 'resolve',
1262
+ layouts: [LAYOUT_TAA_MS],
1263
+ vertexBuffers: [],
1264
+ });
1265
+ this.defineTemplate(TEMPLATE_TAA_COPY, {
1266
+ label: 'taa copy',
1267
+ shader: shaders.taa_copy,
1268
+ pipeline: 'main',
1269
+ layouts: [LAYOUT_VIEW_COPY],
1270
+ vertexBuffers: [],
1271
+ });
1272
+ this.defineTemplate(TEMPLATE_ACCUMULATE, {
1273
+ label: 'accumulate',
1274
+ shader: shaders.accumulate,
1275
+ pipeline: 'main',
1276
+ layouts: [LAYOUT_ACCUMULATE],
1277
+ vertexBuffers: [],
1278
+ });
1279
+ this.defineTemplate(TEMPLATE_TRANSMISSION_COPY, {
1280
+ label: 'transmission copy',
1281
+ shader: shaders.transmission_copy,
1282
+ pipeline: 'main',
1283
+ layouts: [LAYOUT_WEIGHTED_COMPOSITE],
1284
+ multisampledLayouts: [LAYOUT_TRANSMISSION_COPY_MS],
1285
+ vertexBuffers: [],
1286
+ });
1287
+ this.defineTemplate(TEMPLATE_WEIGHTED_COMPOSITE, {
1288
+ label: 'weighted composite',
1289
+ shader: shaders.weighted_composite,
1290
+ pipeline: 'main',
1291
+ layouts: [LAYOUT_WEIGHTED_COMPOSITE],
1292
+ vertexBuffers: [],
1293
+ });
1294
+ this.defineTemplate(TEMPLATE_MOMENT_COMPOSITE, {
1295
+ label: 'moment composite',
1296
+ shader: shaders.moment_composite,
1297
+ pipeline: 'main',
1298
+ layouts: [LAYOUT_MOMENT_COMPOSITE],
1299
+ vertexBuffers: [],
1300
+ });
1301
+ this.defineTemplate(TEMPLATE_MOMENT_DEPTH, {
1302
+ label: 'moment depth',
1303
+ shader: shaders.moment_depth,
1304
+ pipeline: 'main',
1305
+ layouts: [LAYOUT_MOMENT_DEPTH_MS],
1306
+ vertexBuffers: [],
1307
+ depthFragment: true,
1308
+ });
1309
+ this.defineTemplate(TEMPLATE_MOMENT_SMAA_EDGES, {
1310
+ label: 'moment smaa edges',
1311
+ shader: shaders.moment_smaa_edges,
1312
+ pipeline: 'main',
1313
+ layouts: [LAYOUT_MOMENT_SMAA_EDGES],
1314
+ vertexBuffers: [],
1315
+ });
1316
+ this.defineTemplate(TEMPLATE_MOMENT_SMAA_BLEND, {
1317
+ label: 'moment smaa blend',
1318
+ shader: shaders.moment_smaa_blend,
1319
+ pipeline: 'main',
1320
+ layouts: [LAYOUT_MOMENT_SMAA_BLEND],
1321
+ vertexBuffers: [],
1322
+ });
1323
+ this.defineTemplate(TEMPLATE_MOMENT_SMAA_RESOLVE, {
1324
+ label: 'moment smaa resolve',
1325
+ shader: shaders.moment_smaa_resolve,
1326
+ pipeline: 'main',
1327
+ layouts: [LAYOUT_MOMENT_SMAA_RESOLVE],
1328
+ vertexBuffers: [],
1329
+ });
1330
+ this.defineTemplate(TEMPLATE_WEIGHTED_DEPTH, {
1331
+ label: 'weighted depth',
1332
+ shader: shaders.weighted_depth,
1333
+ pipeline: 'main',
1334
+ layouts: [LAYOUT_WEIGHTED_DEPTH_MS],
1335
+ vertexBuffers: [],
1336
+ depthFragment: true,
1337
+ });
1338
+ // The one-sample layer's composite reads the layer one texel per pixel, as a view's copy
1339
+ // reads its image, and its depth copy reads a multisampled scene depth, as the weighted
1340
+ // layer's does.
1341
+ this.defineTemplate(TEMPLATE_SINGLE_COMPOSITE, {
1342
+ label: 'one-sample composite',
1343
+ shader: shaders.single_composite,
1344
+ pipeline: 'main',
1345
+ layouts: [LAYOUT_VIEW_COPY],
1346
+ vertexBuffers: [],
1347
+ });
1348
+ this.defineTemplate(TEMPLATE_SINGLE_DEPTH, {
1349
+ label: 'one-sample depth',
1350
+ shader: shaders.single_depth,
1351
+ pipeline: 'main',
1352
+ layouts: [LAYOUT_WEIGHTED_DEPTH_MS],
1353
+ vertexBuffers: [],
1354
+ depthFragment: true,
1355
+ });
1356
+ this.defineTemplate(TEMPLATE_BACKGROUND, {
1357
+ label: 'background',
1358
+ shader: shaders.background,
1359
+ pipeline: 'main',
1360
+ layouts: [LAYOUT_FRAME, LAYOUT_BACKGROUND, LAYOUT_TEXTURES],
1361
+ vertexBuffers: [],
1362
+ });
1363
+ for (const [id, label, shader] of [
1364
+ [TEMPLATE_BACKGROUND_CUBE, 'background cube', shaders.background_cube],
1365
+ [TEMPLATE_BACKGROUND_SKY, 'background sky', shaders.sky],
1366
+ ]) {
1367
+ this.defineTemplate(id, {
1368
+ label,
1369
+ shader,
1370
+ pipeline: 'main',
1371
+ layouts: [LAYOUT_FRAME, LAYOUT_BACKGROUND],
1372
+ vertexBuffers: [],
1373
+ });
1374
+ }
1375
+ // The motion of moving objects: the last frame's matrices after each instance's copy, and the
1376
+ // last frame's place of each vertex in slot 2. Masked builds read the texture coordinates and
1377
+ // the base color map, whose group, or a blank one's, every build binds.
1378
+ this.defineTemplate(TEMPLATE_MOTION, {
1379
+ label: 'mesh motion',
1380
+ shader: shaders.motion,
1381
+ pipeline: 'main',
1382
+ layouts: [LAYOUT_MOTION_FRAME, LAYOUT_TEXTURES],
1383
+ meshLocations: [0],
1384
+ maskLocations: [2, 3],
1385
+ vertexBuffers: MOTION_INSTANCE_BUFFERS,
1386
+ lastVertices: true,
1387
+ });
1388
+ this.defineTemplate(TEMPLATE_SKY_TABLE, {
1389
+ label: 'sky tables',
1390
+ shader: shaders.sky_tables,
1391
+ pipeline: 'main',
1392
+ layouts: [LAYOUT_ATMOSPHERE],
1393
+ vertexBuffers: [],
1394
+ });
1395
+ this.defineTemplate(TEMPLATE_BACKGROUND_ATMOSPHERE, {
1396
+ label: 'background atmosphere',
1397
+ shader: shaders.sky_physical,
1398
+ pipeline: 'main',
1399
+ layouts: [LAYOUT_FRAME, LAYOUT_ATMOSPHERE],
1400
+ vertexBuffers: [],
1401
+ });
1402
+ // The volumetric cloud tier: the same box, blended over the sky, whose own group adds the
1403
+ // noise field that the renderer makes at the tier's first use.
1404
+ this.defineTemplate(TEMPLATE_BACKGROUND_CLOUDS, {
1405
+ label: 'background clouds',
1406
+ shader: shaders.sky_volume,
1407
+ pipeline: 'main',
1408
+ layouts: [LAYOUT_FRAME, LAYOUT_CLOUDS],
1409
+ vertexBuffers: [],
1410
+ });
1411
+ this.defineTemplate(TEMPLATE_BACKGROUND_CLOUDS_ATMOSPHERE, {
1412
+ label: 'background clouds atmosphere',
1413
+ shader: shaders.sky_volume_physical,
1414
+ pipeline: 'main',
1415
+ layouts: [LAYOUT_FRAME, LAYOUT_CLOUDS_ATMOSPHERE],
1416
+ vertexBuffers: [],
1417
+ });
1418
+ if (DEV) {
1419
+ this.defineTemplate(TEMPLATE_MOTION_VIEW, {
1420
+ label: 'motion view',
1421
+ shader: MOTION_VIEW_SHADER,
1422
+ pipeline: 'main',
1423
+ layouts: [LAYOUT_EFFECT],
1424
+ multisampledLayouts: [LAYOUT_EFFECT_DEPTH_MS],
1425
+ vertexBuffers: [],
1426
+ });
1427
+ this.defineTemplate(TEMPLATE_DEBUG_LINES, {
1428
+ label: 'debug lines',
1429
+ shader: DEBUG_LINES_SHADER,
1430
+ pipeline: 'main',
1431
+ layouts: [LAYOUT_FRAME],
1432
+ vertexBuffers: [LINE_VERTICES],
1433
+ });
1434
+ this.defineTemplate(TEMPLATE_DEBUG_VIEW, {
1435
+ label: 'mesh debug view',
1436
+ shader: DEBUG_VIEW_SHADER,
1437
+ pipeline: 'main',
1438
+ layouts: [LAYOUT_FRAME],
1439
+ meshLocations: [0, 1],
1440
+ vertexBuffers: INSTANCE_BUFFERS,
1441
+ });
1442
+ }
1443
+ this.cullLayout = device.createPipelineLayout({ bindGroupLayouts: [this.layout(LAYOUT_CULL)] });
1444
+ this.cull = variantFor(shaders.cull, 0, 'wgsl')?.wgsl ?? undefined;
1445
+ this.occlusion = shaders.cull_occlusion;
1446
+ this.cullMotion = shaders.cull_motion;
1447
+ this.pyramid = shaders.pyramid;
1448
+ this.pyramidLayout = device.createPipelineLayout({
1449
+ bindGroupLayouts: [this.layout(LAYOUT_DEPTH_PYRAMID)],
1450
+ });
1451
+ this.featureRows = shaders.feature_rows;
1452
+ this.cluster = shaders.cluster_cull;
1453
+ this.clusterLayout = device.createPipelineLayout({
1454
+ bindGroupLayouts: [this.layout(LAYOUT_CLUSTER_CULL)],
1455
+ });
1456
+ this.lightLayout = device.createPipelineLayout({
1457
+ bindGroupLayouts: [this.layout(LAYOUT_LIGHT_CLUSTERS)],
1458
+ });
1459
+ this.lightClusters = variantFor(shaders.light_clusters, 0, 'wgsl')?.wgsl ?? undefined;
1460
+ this.lightDepth = variantFor(shaders.light_depth, 0, 'wgsl')?.wgsl ?? undefined;
1461
+ this.lightDepthMs = variantFor(shaders.light_depth_ms, 0, 'wgsl')?.wgsl ?? undefined;
1462
+ this.lightDepthLayout = device.createPipelineLayout({
1463
+ bindGroupLayouts: [this.layout(LAYOUT_LIGHT_DEPTH)],
1464
+ });
1465
+ this.lightDepthMsLayout = device.createPipelineLayout({
1466
+ bindGroupLayouts: [this.layout(LAYOUT_LIGHT_DEPTH_MS)],
1467
+ });
1468
+ this.skinLayout = device.createPipelineLayout({ bindGroupLayouts: [this.layout(LAYOUT_SKIN)] });
1469
+ this.skin = shaders.skin;
1470
+ this.exposureHistogram = shaders.exposure_histogram;
1471
+ // The histogram steps' group: their settings, the color they meter with a linear filter,
1472
+ // the histogram and the stored exposure, and the exposure's texel that they write. It is
1473
+ // made at its first use.
1474
+ this.defineLayout(LAYOUT_EXPOSURE, 'exposure', [
1475
+ { binding: 0, visibility: compute, buffer: { type: 'uniform' } },
1476
+ { binding: 1, visibility: compute, texture: {} },
1477
+ { binding: 2, visibility: compute, sampler: {} },
1478
+ { binding: 3, visibility: compute, buffer: { type: 'storage' } },
1479
+ { binding: 4, visibility: compute, buffer: { type: 'storage' } },
1480
+ {
1481
+ binding: 5,
1482
+ visibility: compute,
1483
+ storageTexture: { access: 'write-only', format: 'rgba32float' },
1484
+ },
1485
+ ], true);
1486
+ this.mipmap = variantFor(shaders.mipmap, 0, 'wgsl')?.wgsl ?? undefined;
1487
+ }
1488
+ /**
1489
+ * Adds a bind group layout under an id that no other layout has. With `onFirstUse`, the layout
1490
+ * is made only when a pipeline or a bind group first needs it, for a layout that some devices
1491
+ * cannot make.
1492
+ */
1493
+ defineLayout(id, label, entries, onFirstUse = false) {
1494
+ if (this.layouts[id] || this.laterLayouts[id])
1495
+ throw new Error(`bind group layout ${id} already exists`);
1496
+ if (onFirstUse)
1497
+ this.laterLayouts[id] = { label, entries };
1498
+ else
1499
+ this.layouts[id] = this.device.createBindGroupLayout({ label, entries });
1500
+ }
1501
+ /**
1502
+ * Adds a template of the sketch's compiled WGSL. A custom material's is the standard material's
1503
+ * template with the material's WGSL, in the shader variants that the plugin built, which also
1504
+ * read the first texture coordinates. A material with textures binds them in the slots of the
1505
+ * maps' layout. A custom effect's draws one triangle with the effect's layout, and its own
1506
+ * textures in a second group of the maps' layout, and a group of joined effects draws as an
1507
+ * effect without textures does. A custom tone curve's binds as the final pass or its bloom build does,
1508
+ * and the final pass with effects folded into it binds their buffer and the depth too.
1509
+ */
1510
+ defineCustom(id, shader) {
1511
+ const { kind } = shader;
1512
+ if (kind === 'compute') {
1513
+ this.computeTemplates.set(id, { shader: shader.variants });
1514
+ return;
1515
+ }
1516
+ // A sky layer's build of the sky map's shader draws no pipeline of the scene: the map's
1517
+ // generator builds its pipelines, so the template needs nothing here.
1518
+ if (kind === 'skyLayerMap')
1519
+ return;
1520
+ // A sky layer draws the template's box around the camera, with the frame's group and its
1521
+ // own values in the background layer's group.
1522
+ if (kind === 'skyLayer') {
1523
+ this.defineTemplate(id, {
1524
+ label: `sky layer ${id}`,
1525
+ shader: shader.variants,
1526
+ pipeline: 'main',
1527
+ layouts: [LAYOUT_FRAME, LAYOUT_BACKGROUND_LAYER],
1528
+ vertexBuffers: [],
1529
+ });
1530
+ return;
1531
+ }
1532
+ if (kind !== undefined) {
1533
+ const effect = kind === 'effect' || kind === 'effectGroup';
1534
+ const [layout, multisampled, label] = effect
1535
+ ? shader.bloom
1536
+ ? [LAYOUT_EFFECT_BLOOM, LAYOUT_EFFECT_BLOOM_DEPTH_MS, `custom effect ${id}`]
1537
+ : [LAYOUT_EFFECT, LAYOUT_EFFECT_DEPTH_MS, `custom effect ${id}`]
1538
+ : kind === 'effectFold'
1539
+ ? [LAYOUT_FINAL_EFFECTS, LAYOUT_FINAL_EFFECTS_DEPTH_MS, `folded effects ${id}`]
1540
+ : [
1541
+ kind === 'final' ? LAYOUT_FINAL : LAYOUT_FINAL_BLOOM,
1542
+ undefined,
1543
+ `custom tone curve ${id}`,
1544
+ ];
1545
+ // An effect's own textures bind in a second group of the maps' layout.
1546
+ const maps = shader.textures > 0 ? [LAYOUT_MATERIAL_MAPS] : [];
1547
+ this.defineTemplate(id, {
1548
+ label,
1549
+ shader: shader.variants,
1550
+ pipeline: 'main',
1551
+ layouts: [layout, ...maps],
1552
+ multisampledLayouts: multisampled === undefined ? undefined : [multisampled, ...maps],
1553
+ vertexBuffers: [],
1554
+ });
1555
+ return;
1556
+ }
1557
+ // A material that reads the scene's depth binds the copy after its maps, or after the
1558
+ // frame's group when it has none. Its maps' group leaves a slot free for the copy.
1559
+ const scene = shader.sceneDepth === true ? [LAYOUT_MATERIAL_SCENE] : [];
1560
+ const maps = shader.sceneDepth === true ? LAYOUT_MATERIAL_MAPS_SCENE : LAYOUT_MATERIAL_MAPS;
1561
+ // A draw shader makes every vertex itself, so its pipelines read no vertex buffer and have
1562
+ // no prepass: its object has no mesh and no depth to write before the shading.
1563
+ this.defineTemplate(id, {
1564
+ label: `custom material ${id}`,
1565
+ shader: shader.variants,
1566
+ pipeline: 'main',
1567
+ layouts: [...(shader.textures > 0 ? [LAYOUT_FRAME, maps] : [LAYOUT_FRAME]), ...scene],
1568
+ // A material that declares its shadow caster's coverage, or whose WGSL sets the
1569
+ // surface's alpha, draws its casters' depth with a fragment stage, which drops the
1570
+ // pixels that its cutoff leaves out.
1571
+ depthFragment: shader.coverage === true || shader.alpha === true,
1572
+ // A material that names its mask draws the camera's depth prepass with a build of its
1573
+ // shader that returns that alpha, so the prepass keeps the same fragments.
1574
+ prepassCutout: shader.coverage === true || shader.alpha === true,
1575
+ ...(shader.meshless === true
1576
+ ? { vertexBuffers: [], meshless: true }
1577
+ : {
1578
+ meshLocations: shader.locations,
1579
+ vertexBuffers: INSTANCE_BUFFERS,
1580
+ ownPrepass: true,
1581
+ }),
1582
+ });
1583
+ }
1584
+ /**
1585
+ * Gives a custom material's template the shader of a hot update, and forgets the shader modules
1586
+ * of its old shader. The pipelines that `render` describes from then on use the new shader.
1587
+ */
1588
+ replaceCustom(id, shader) {
1589
+ if (shader.kind === 'compute') {
1590
+ this.computeTemplates.set(id, { shader: shader.variants });
1591
+ return;
1592
+ }
1593
+ const old = this.templates[id];
1594
+ for (const variant of Object.values(old?.shader ?? {}))
1595
+ if (variant.wgsl)
1596
+ this.modules.delete(variant.wgsl);
1597
+ this.templates[id] = undefined;
1598
+ this.defineCustom(id, shader);
1599
+ }
1600
+ /** True when a template has this id. */
1601
+ has(id) {
1602
+ return this.templates[id] !== undefined || this.computeTemplates.has(id);
1603
+ }
1604
+ /**
1605
+ * True when the pipelines of a template draw objects of the scene: meshes, or a custom material's
1606
+ * draw shader. A frame can go without such a pipeline's draws, while a pass of the frame's own
1607
+ * cannot.
1608
+ */
1609
+ drawsObjects(id) {
1610
+ const template = this.templates[id];
1611
+ return template?.meshLocations !== undefined || template?.meshless === true;
1612
+ }
1613
+ /** The name of a render pipeline of a template, for a message (`pipelineName`). */
1614
+ describe(id, permutation) {
1615
+ return pipelineName(id, permutation, this.templates[id]?.label);
1616
+ }
1617
+ /** The shader variants of a template that exists. */
1618
+ variants(id) {
1619
+ const template = this.templates[id];
1620
+ if (!template)
1621
+ throw new Error(`unknown render template ${id}`);
1622
+ return template.shader;
1623
+ }
1624
+ /**
1625
+ * Adds a render pipeline template under an id that no other template has. The shader of a
1626
+ * feature that loads on first use has no variants until its module arrives.
1627
+ */
1628
+ defineTemplate(id, template) {
1629
+ if (this.templates[id])
1630
+ throw new Error(`render pipeline template ${id} already exists`);
1631
+ const variants = Object.values(template.shader);
1632
+ if (variants.length > 0 &&
1633
+ !variants.some((variant) => variant.wgsl?.pipelines[template.pipeline]))
1634
+ throw new Error(`the shader of template ${id} has no pipeline ${template.pipeline}`);
1635
+ this.templates[id] = template;
1636
+ }
1637
+ layout(id) {
1638
+ const layout = this.layouts[id];
1639
+ if (layout)
1640
+ return layout;
1641
+ const later = this.laterLayouts[id];
1642
+ if (!later)
1643
+ throw new Error(`unknown bind group layout ${id}`);
1644
+ const made = this.device.createBindGroupLayout(later);
1645
+ this.layouts[id] = made;
1646
+ return made;
1647
+ }
1648
+ /**
1649
+ * The pipeline layout of an add-on compute pass whose code names its target's format: group 0
1650
+ * binds the pass's block and its storage texture, and when the pass samples textures, group 1
1651
+ * binds them as an effect's own textures bind.
1652
+ */
1653
+ computePipelineLayout(code) {
1654
+ const layout = layoutOfComputeFormat(code);
1655
+ let made = this.computeLayouts.get(code);
1656
+ if (!made) {
1657
+ const groups = [this.layout(layout)];
1658
+ if ((code & COMPUTE_MAPS_BIT) !== 0)
1659
+ groups.push(this.layout(LAYOUT_MATERIAL_MAPS));
1660
+ made = this.device.createPipelineLayout({ bindGroupLayouts: groups });
1661
+ this.computeLayouts.set(code, made);
1662
+ }
1663
+ return made;
1664
+ }
1665
+ /** Creates the shader module of `shader` ahead of the pipelines that will share it. */
1666
+ prepareModule(label, shader) {
1667
+ this.module(label, shader);
1668
+ }
1669
+ module(label, shader) {
1670
+ let module = this.modules.get(shader);
1671
+ if (!module) {
1672
+ module = this.device.createShaderModule({ label, code: shader.source });
1673
+ this.modules.set(shader, module);
1674
+ }
1675
+ return module;
1676
+ }
1677
+ /**
1678
+ * How to build a render pipeline of a template, in the shader variant that its permutation bits
1679
+ * pick, for meshes of a vertex format where the template draws meshes. Without a color format it
1680
+ * draws depth only, and with the state that writes no color it keeps the color target untouched.
1681
+ * The depth bias is in reversed depth, as the draw list holds it.
1682
+ */
1683
+ render(template, permutation, colorFormat, depthFormat, sampleCount, stateFlags, vertexFormat, depthBias, depthBiasSlopeScale) {
1684
+ const t = this.templates[template];
1685
+ if (!t)
1686
+ throw new Error(`unknown render template ${template}`);
1687
+ // A displaced material's prepass moves its vertices as its shading does.
1688
+ const places = t.ownPrepass === true || (permutation & PERMUTATION_DISPLACEMENT) !== 0;
1689
+ const ownPrepass = places && (permutation & PERMUTATION_PREPASS) !== 0;
1690
+ // A masked pair of a material that names its mask draws the prepass with the shader's own
1691
+ // build, which returns the surface's alpha; every other pair draws the empty fragment.
1692
+ const cutoutPrepass = ownPrepass && t.prepassCutout === true && (permutation & PERMUTATION_ALPHA_MASK) !== 0;
1693
+ const build = ownPrepass && !cutoutPrepass ? (permutation & ~PERMUTATION_PREPASS) >>> 0 : permutation;
1694
+ const shader = variantFor(t.shader, build, 'wgsl')?.wgsl;
1695
+ if (!shader)
1696
+ throw new Error(`render template ${template}: ${missingVariant(permutation)}`);
1697
+ const module = this.module(t.label, shader);
1698
+ const entryPoints = shader.pipelines[t.pipeline];
1699
+ const skins = (permutation & PERMUTATION_SKIN) !== 0;
1700
+ const byIndex = (permutation & PERMUTATION_INSTANCE_INDEX) !== 0;
1701
+ const multisampled = t.multisampledLayouts !== undefined && (permutation & PERMUTATION_DEPTH_MULTISAMPLED) !== 0;
1702
+ // A custom material's shadow caster draws in the shadow passes, whose views bind the depth
1703
+ // template's group in place of the frame group, and its motion build in the motion pass,
1704
+ // whose view binds the motion frame group there.
1705
+ const caster = (permutation & PERMUTATION_CASTER) !== 0;
1706
+ const motion = template !== TEMPLATE_MOTION && (permutation & PERMUTATION_MOTION) !== 0;
1707
+ // Parallax reads the displacement map in the fragment stage too, through a layout of its own.
1708
+ const parallax = (permutation & PERMUTATION_PARALLAX) !== 0;
1709
+ // Six flags fill the low bits: five of them need 32 values, and parallax, the sixth, needs
1710
+ // the next 32, so a template starts every 64 keys and never shares one with its neighbour.
1711
+ const key = template * 64 +
1712
+ (skins ? 1 : 0) +
1713
+ (byIndex ? 2 : 0) +
1714
+ (multisampled ? 4 : 0) +
1715
+ (caster ? 8 : 0) +
1716
+ (motion ? 16 : 0) +
1717
+ (parallax ? 32 : 0);
1718
+ let layout = this.pipelineLayouts.get(key);
1719
+ if (!layout) {
1720
+ const listed = multisampled ? t.multisampledLayouts : t.layouts;
1721
+ const own = parallax
1722
+ ? listed.map((id) => id === LAYOUT_MATERIAL_MAPS
1723
+ ? LAYOUT_MATERIAL_MAPS_PARALLAX
1724
+ : id === LAYOUT_FRAME
1725
+ ? LAYOUT_FRAME_PARALLAX
1726
+ : id)
1727
+ : listed;
1728
+ const first = caster ? LAYOUT_DEPTH : motion ? LAYOUT_MOTION_FRAME : undefined;
1729
+ // A caster, motion or pick build shades no surface, so its shader binds no scene
1730
+ // depth. Its layout leaves that group out, and its draws bind no group there.
1731
+ const pick = (permutation & PERMUTATION_PICK) !== 0;
1732
+ const shaded = caster || motion || pick ? own.filter((id) => id !== LAYOUT_MATERIAL_SCENE) : own;
1733
+ const groups = [
1734
+ ...(first === undefined ? shaded : [first, ...shaded.slice(1)]),
1735
+ ...(skins ? [LAYOUT_JOINTS] : []),
1736
+ ...(byIndex ? [LAYOUT_INSTANCE_INDEX] : []),
1737
+ ];
1738
+ layout = this.device.createPipelineLayout({
1739
+ label: t.label,
1740
+ bindGroupLayouts: groups.map((id) => this.layout(id)),
1741
+ });
1742
+ this.pipelineLayouts.set(key, layout);
1743
+ }
1744
+ return {
1745
+ label: t.label,
1746
+ layout,
1747
+ vertex: {
1748
+ module,
1749
+ entryPoint: entryPoints?.vertex,
1750
+ buffers: vertexBuffers(t, vertexFormat, permutation),
1751
+ constants: scaleConstants(t, shader, vertexFormat, permutation),
1752
+ },
1753
+ fragment: colorFormat
1754
+ ? {
1755
+ module: ownPrepass && !cutoutPrepass ? this.emptyFragmentModule() : module,
1756
+ entryPoint: ownPrepass && !cutoutPrepass ? 'fs' : entryPoints?.fragment,
1757
+ targets: colorTargets(colorFormat, template, permutation, stateFlags),
1758
+ }
1759
+ : t.depthFragment && !ownPrepass
1760
+ ? { module, entryPoint: entryPoints?.fragment, targets: [] }
1761
+ : undefined,
1762
+ primitive: {
1763
+ topology: stateFlags & STATE_LINE_LIST ? 'line-list' : 'triangle-list',
1764
+ cullMode: stateFlags & STATE_CULL_NONE ? 'none' : stateFlags & STATE_CULL_FRONT ? 'front' : 'back',
1765
+ frontFace: 'ccw',
1766
+ },
1767
+ // Reversed depth: 1 at the near plane, 0 at the far plane. Without the depth test a surface
1768
+ // writes no depth either, as in three.js's WebGL renderer. After the depth prepass, the
1769
+ // opaque pass draws only at the depth that the prepass found. Compatibility mode needs a
1770
+ // bias clamp of 0.
1771
+ depthStencil: depthFormat
1772
+ ? {
1773
+ format: depthFormat,
1774
+ depthWriteEnabled: (stateFlags & (STATE_NO_DEPTH_WRITE | STATE_NO_DEPTH_TEST)) === 0,
1775
+ depthCompare: depthCompare(stateFlags),
1776
+ depthBias,
1777
+ depthBiasSlopeScale,
1778
+ depthBiasClamp: 0,
1779
+ }
1780
+ : undefined,
1781
+ multisample: {
1782
+ count: sampleCount,
1783
+ alphaToCoverageEnabled: (stateFlags & STATE_ALPHA_TO_COVERAGE) !== 0,
1784
+ },
1785
+ };
1786
+ }
1787
+ /** The module of the fragment shader that writes nothing, which a template's own prepass draws with. */
1788
+ emptyFragmentModule() {
1789
+ this.emptyFragment ??= this.device.createShaderModule({
1790
+ label: 'empty fragment',
1791
+ code: EMPTY_FRAGMENT,
1792
+ });
1793
+ return this.emptyFragment;
1794
+ }
1795
+ /**
1796
+ * Starts to build the pipelines that make mip levels, in the background, for each format whose
1797
+ * levels the GPU makes. The first texture of each format then makes its levels without a
1798
+ * compile inside the frame. A build that fails is made again at first use, which reports it.
1799
+ */
1800
+ prebuildMipmaps() {
1801
+ if (!this.mipmap)
1802
+ return;
1803
+ for (const format of MIP_FORMATS) {
1804
+ this.device.createRenderPipelineAsync(this.mipDescriptor(format, 'main')).then((pipeline) => {
1805
+ if (!this.mipPipelines.has(format))
1806
+ this.mipPipelines.set(format, pipeline);
1807
+ }, () => { });
1808
+ this.device.createRenderPipelineAsync(this.mipDescriptor(format, 'scale')).then((pipeline) => {
1809
+ if (!this.scalePipelines.has(format))
1810
+ this.scalePipelines.set(format, pipeline);
1811
+ }, () => { });
1812
+ }
1813
+ }
1814
+ /**
1815
+ * The pipeline that makes mip levels of textures of `format`: the one built in the background
1816
+ * when it is done, else one made at once.
1817
+ */
1818
+ mipmaps(format) {
1819
+ return this.cachedPipeline(this.mipPipelines, format, 'main');
1820
+ }
1821
+ /**
1822
+ * The pipeline that draws a texture into the corner of a texture of `format`, at a size of its
1823
+ * own: the one built in the background when it is done, else one made at once.
1824
+ */
1825
+ mipScale(format) {
1826
+ return this.cachedPipeline(this.scalePipelines, format, 'scale');
1827
+ }
1828
+ cachedPipeline(pipelines, format, entry) {
1829
+ let pipeline = pipelines.get(format);
1830
+ if (!pipeline) {
1831
+ pipeline = this.device.createRenderPipeline(this.mipDescriptor(format, entry));
1832
+ pipelines.set(format, pipeline);
1833
+ }
1834
+ return pipeline;
1835
+ }
1836
+ /** How to build the pipeline of `entry` for textures of `format`. */
1837
+ mipDescriptor(format, entry) {
1838
+ const shader = this.mipmap;
1839
+ if (!shader)
1840
+ throw new Error("the device's shader module has no mip level shader");
1841
+ const module = this.module('mipmaps', shader);
1842
+ const entryPoints = shader.pipelines[entry];
1843
+ return {
1844
+ label: entry === 'main' ? 'mipmaps' : 'mip scale',
1845
+ layout: 'auto',
1846
+ vertex: { module, entryPoint: entryPoints?.vertex },
1847
+ fragment: { module, entryPoint: entryPoints?.fragment, targets: [{ format }] },
1848
+ };
1849
+ }
1850
+ /**
1851
+ * The shader variants of a compute template whose shader loads on first use, the skinning pass's
1852
+ * or one of occlusion culling's, or undefined for a template whose shader the device's module of
1853
+ * the start holds.
1854
+ */
1855
+ computeVariants(template, permutation = 0) {
1856
+ const custom = this.computeTemplates.get(template);
1857
+ if (custom)
1858
+ return custom.shader;
1859
+ if (template === TEMPLATE_SKIN)
1860
+ return this.skin;
1861
+ if (template === TEMPLATE_DEPTH_PYRAMID)
1862
+ return this.pyramid;
1863
+ if (template === TEMPLATE_FEATURE_ROWS)
1864
+ return this.featureRows;
1865
+ if (template === TEMPLATE_CLUSTER)
1866
+ return this.cluster;
1867
+ if (template === TEMPLATE_CULL && permutation & PERMUTATION_MOTION)
1868
+ return this.cullMotion;
1869
+ if (EXPOSURE_ENTRY_POINTS[template] !== undefined)
1870
+ return this.exposureHistogram;
1871
+ return OCCLUSION_ENTRY_POINTS[template] !== undefined ? this.occlusion : undefined;
1872
+ }
1873
+ /**
1874
+ * How to build a compute pipeline of a template: culling or a phase of occlusion culling, the
1875
+ * depth pyramid, skinning, or a step of light clustering. The skinning pass takes the build of
1876
+ * its permutation bits (see `SKIN_BUILDS`).
1877
+ */
1878
+ compute(template, permutation) {
1879
+ const custom = this.computeTemplates.get(template);
1880
+ if (custom) {
1881
+ const shader = variantFor(custom.shader, 0, 'wgsl')?.wgsl;
1882
+ if (!shader)
1883
+ throw new Error(`the compute pass's shader has not arrived`);
1884
+ return {
1885
+ label: `compute pass ${template}`,
1886
+ layout: this.computePipelineLayout(permutation),
1887
+ compute: {
1888
+ module: this.module('compute pass', shader),
1889
+ entryPoint: computeEntryPoint(shader.source),
1890
+ },
1891
+ };
1892
+ }
1893
+ if (template === TEMPLATE_SKIN) {
1894
+ const tangent = (permutation & PERMUTATION_VERTEX_TANGENT) !== 0 ? ' tangent' : '';
1895
+ const color = (permutation & PERMUTATION_VERTEX_COLOR) !== 0 ? ' color' : '';
1896
+ const shader = variantFor(this.skin, permutation, 'wgsl')?.wgsl;
1897
+ if (!shader)
1898
+ throw new Error("the device's shader modules have no skinning shader");
1899
+ const constants = this.floatSkinnedDirections ? { [NARROW_DIRECTIONS_ID]: 0 } : undefined;
1900
+ return {
1901
+ label: `skin${tangent}${color}`,
1902
+ layout: this.skinLayout,
1903
+ compute: { module: this.module('skin', shader), entryPoint: 'main', constants },
1904
+ };
1905
+ }
1906
+ if (template === TEMPLATE_CULL && permutation & PERMUTATION_MOTION) {
1907
+ const shader = variantFor(this.cullMotion, permutation, 'wgsl')?.wgsl;
1908
+ if (!shader)
1909
+ throw new Error("the device's shader modules have no motion culling shader");
1910
+ return {
1911
+ label: 'cull motion',
1912
+ layout: this.cullLayout,
1913
+ compute: { module: this.module('cull motion', shader), entryPoint: CULL_ENTRY_POINT },
1914
+ };
1915
+ }
1916
+ if (template === TEMPLATE_CULL) {
1917
+ if (!this.cull)
1918
+ throw new Error("the device's shader module has no culling shader");
1919
+ return {
1920
+ label: 'cull',
1921
+ layout: this.cullLayout,
1922
+ compute: { module: this.module('cull', this.cull), entryPoint: CULL_ENTRY_POINT },
1923
+ };
1924
+ }
1925
+ const phase = OCCLUSION_ENTRY_POINTS[template];
1926
+ if (phase) {
1927
+ const shader = variantFor(this.occlusion, 0, 'wgsl')?.wgsl;
1928
+ if (!shader)
1929
+ throw new Error("the device's shader modules have no occlusion culling shader");
1930
+ return {
1931
+ label: `occlusion ${phase}`,
1932
+ layout: this.cullLayout,
1933
+ compute: { module: this.module('occlusion', shader), entryPoint: phase },
1934
+ };
1935
+ }
1936
+ if (template === TEMPLATE_CLUSTER) {
1937
+ const shader = this.cluster ? variantFor(this.cluster, 0, 'wgsl')?.wgsl : undefined;
1938
+ if (!shader)
1939
+ throw new Error("the device's shader modules have no cluster shader");
1940
+ return {
1941
+ label: 'cluster cull',
1942
+ layout: this.clusterLayout,
1943
+ compute: { module: this.module('cluster cull', shader), entryPoint: 'main' },
1944
+ };
1945
+ }
1946
+ if (template === TEMPLATE_DEPTH_PYRAMID) {
1947
+ const shader = variantFor(this.pyramid, 0, 'wgsl')?.wgsl;
1948
+ if (!shader)
1949
+ throw new Error("the device's shader modules have no depth pyramid shader");
1950
+ return {
1951
+ label: 'depth pyramid',
1952
+ layout: this.pyramidLayout,
1953
+ compute: { module: this.module('depth pyramid', shader), entryPoint: 'main' },
1954
+ };
1955
+ }
1956
+ if (template === TEMPLATE_FEATURE_ROWS) {
1957
+ const shader = variantFor(this.featureRows, 0, 'wgsl')?.wgsl;
1958
+ if (!shader)
1959
+ throw new Error("the device's shader modules have no feature rows shader");
1960
+ this.featureRowsLayout ??= this.device.createPipelineLayout({
1961
+ bindGroupLayouts: [this.layout(LAYOUT_FEATURE_ROWS)],
1962
+ });
1963
+ return {
1964
+ label: 'feature rows',
1965
+ layout: this.featureRowsLayout,
1966
+ compute: { module: this.module('feature rows', shader), entryPoint: 'main' },
1967
+ };
1968
+ }
1969
+ const exposureEntry = EXPOSURE_ENTRY_POINTS[template];
1970
+ if (exposureEntry) {
1971
+ const shader = variantFor(this.exposureHistogram, 0, 'wgsl')?.wgsl;
1972
+ if (!shader)
1973
+ throw new Error("the device's shader modules have no exposure histogram shader");
1974
+ this.exposureLayout ??= this.device.createPipelineLayout({
1975
+ bindGroupLayouts: [this.layout(LAYOUT_EXPOSURE)],
1976
+ });
1977
+ return {
1978
+ label: `exposure ${exposureEntry}`,
1979
+ layout: this.exposureLayout,
1980
+ compute: { module: this.module('exposure histogram', shader), entryPoint: exposureEntry },
1981
+ };
1982
+ }
1983
+ if (template === TEMPLATE_LIGHT_DEPTH ||
1984
+ template === TEMPLATE_LIGHT_DEPTH_MS ||
1985
+ template === TEMPLATE_LIGHT_DEPTH_CLEAR ||
1986
+ template === TEMPLATE_LIGHT_DEPTH_CLEAR_MS) {
1987
+ const multisampled = template === TEMPLATE_LIGHT_DEPTH_MS || template === TEMPLATE_LIGHT_DEPTH_CLEAR_MS;
1988
+ const clear = template === TEMPLATE_LIGHT_DEPTH_CLEAR || template === TEMPLATE_LIGHT_DEPTH_CLEAR_MS;
1989
+ const shader = multisampled ? this.lightDepthMs : this.lightDepth;
1990
+ if (!shader)
1991
+ throw new Error("the device's shader modules have no light depth shader");
1992
+ return {
1993
+ label: clear ? 'light depth clear' : 'light depth',
1994
+ layout: multisampled ? this.lightDepthMsLayout : this.lightDepthLayout,
1995
+ compute: {
1996
+ module: this.module('light depth', shader),
1997
+ entryPoint: clear ? 'clear_reduction' : 'reduce_depth',
1998
+ },
1999
+ };
2000
+ }
2001
+ const entryPoint = LIGHT_ENTRY_POINTS[template];
2002
+ if (!entryPoint)
2003
+ throw new Error(`unknown compute template ${template}`);
2004
+ const shader = this.lightClusters;
2005
+ if (!shader)
2006
+ throw new Error("the device's shader module has no light clustering shader");
2007
+ return {
2008
+ label: entryPoint,
2009
+ layout: this.lightLayout,
2010
+ compute: { module: this.module('light clusters', shader), entryPoint },
2011
+ };
2012
+ }
2013
+ }