@babylonjs/lite 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (417) hide show
  1. package/_math-factory-C-QqW-Wi.js +55 -0
  2. package/_math-factory-C-QqW-Wi.js.map +1 -0
  3. package/add-block-CikX5gWy.js +6 -0
  4. package/add-block-CikX5gWy.js.map +1 -0
  5. package/alpha-test-fragment-CUiHCw7W.js +22 -0
  6. package/alpha-test-fragment-CUiHCw7W.js.map +1 -0
  7. package/ambient-occlusion-block-DForhWL3.js +77 -0
  8. package/ambient-occlusion-block-DForhWL3.js.map +1 -0
  9. package/anisotropy-block-D5fXH_OY.js +12 -0
  10. package/anisotropy-block-D5fXH_OY.js.map +1 -0
  11. package/anisotropy-fragment-HgasXS7l.js +89 -0
  12. package/anisotropy-fragment-HgasXS7l.js.map +1 -0
  13. package/arc-tan2-block-d8sWt_x0.js +12 -0
  14. package/arc-tan2-block-d8sWt_x0.js.map +1 -0
  15. package/assets/splat-sort-worker-Crg3CaCc.js.map +1 -0
  16. package/background-dds-skybox-yHTqabU3.js +221 -0
  17. package/background-dds-skybox-yHTqabU3.js.map +1 -0
  18. package/background-ground-DIw6D3qf.js +235 -0
  19. package/background-ground-DIw6D3qf.js.map +1 -0
  20. package/background-hdr-skybox-c4uuTmkP.js +179 -0
  21. package/background-hdr-skybox-c4uuTmkP.js.map +1 -0
  22. package/background-solid-skybox-DPGBpPbm.js +235 -0
  23. package/background-solid-skybox-DPGBpPbm.js.map +1 -0
  24. package/bake-local-matrix-Dfpd3b06.js +28 -0
  25. package/bake-local-matrix-Dfpd3b06.js.map +1 -0
  26. package/billboard-renderable-D8mlVGCd.js +242 -0
  27. package/billboard-renderable-D8mlVGCd.js.map +1 -0
  28. package/biplanar-block-DZnKuV81.js +115 -0
  29. package/biplanar-block-DZnKuV81.js.map +1 -0
  30. package/bones-block-D6IhqUVV.js +31 -0
  31. package/bones-block-D6IhqUVV.js.map +1 -0
  32. package/clamp-block-BdII67hT.js +21 -0
  33. package/clamp-block-BdII67hT.js.map +1 -0
  34. package/clearcoat-block-BGML4npi.js +12 -0
  35. package/clearcoat-block-BGML4npi.js.map +1 -0
  36. package/clearcoat-fragment-LCiG98Rf.js +256 -0
  37. package/clearcoat-fragment-LCiG98Rf.js.map +1 -0
  38. package/clip-planes-block-BPfFJrbf.js +26 -0
  39. package/clip-planes-block-BPfFJrbf.js.map +1 -0
  40. package/cloud-block-BeVrangc.js +90 -0
  41. package/cloud-block-BeVrangc.js.map +1 -0
  42. package/color-converter-block-CvwKiW4k.js +123 -0
  43. package/color-converter-block-CvwKiW4k.js.map +1 -0
  44. package/color-merger-CCu21ZII.js +57 -0
  45. package/color-merger-CCu21ZII.js.map +1 -0
  46. package/color-splitter-CGn1G4ow.js +33 -0
  47. package/color-splitter-CGn1G4ow.js.map +1 -0
  48. package/conditional-block-Cd2pbejI.js +51 -0
  49. package/conditional-block-Cd2pbejI.js.map +1 -0
  50. package/create-skeleton-C9JdIJnb.js +44 -0
  51. package/create-skeleton-C9JdIJnb.js.map +1 -0
  52. package/cross-block-DCrLwCpt.js +12 -0
  53. package/cross-block-DCrLwCpt.js.map +1 -0
  54. package/cubemap-skybox-material-DvXMVc4k.js +79 -0
  55. package/cubemap-skybox-material-DvXMVc4k.js.map +1 -0
  56. package/curve-block-BlJpXVYv.js +89 -0
  57. package/curve-block-BlJpXVYv.js.map +1 -0
  58. package/debug-block-D2pg4Yf6.js +14 -0
  59. package/debug-block-D2pg4Yf6.js.map +1 -0
  60. package/derivative-block-B8KjtaWs.js +20 -0
  61. package/derivative-block-B8KjtaWs.js.map +1 -0
  62. package/desaturate-block-C1RghNSB.js +15 -0
  63. package/desaturate-block-C1RghNSB.js.map +1 -0
  64. package/discard-block-B2jKjaEL.js +21 -0
  65. package/discard-block-B2jKjaEL.js.map +1 -0
  66. package/distance-block-3NkgFZ3f.js +16 -0
  67. package/distance-block-3NkgFZ3f.js.map +1 -0
  68. package/divide-block-ZyepIg_-.js +6 -0
  69. package/divide-block-ZyepIg_-.js.map +1 -0
  70. package/dot-block-VlfAC6cD.js +16 -0
  71. package/dot-block-VlfAC6cD.js.map +1 -0
  72. package/elbow-block-NEOiIxzO.js +10 -0
  73. package/elbow-block-NEOiIxzO.js.map +1 -0
  74. package/emissive-fragment-BnNvbBCw.js +39 -0
  75. package/emissive-fragment-BnNvbBCw.js.map +1 -0
  76. package/esm-shadow-view-DGKdF1NI.js +18 -0
  77. package/esm-shadow-view-DGKdF1NI.js.map +1 -0
  78. package/esm-shadow-view-DN9HIaM4.js +15 -0
  79. package/esm-shadow-view-DN9HIaM4.js.map +1 -0
  80. package/esm-shadow-view-Dk9NFtLq.js +15 -0
  81. package/esm-shadow-view-Dk9NFtLq.js.map +1 -0
  82. package/fog-block-DJ9hEolm.js +41 -0
  83. package/fog-block-DJ9hEolm.js.map +1 -0
  84. package/frag-coord-block-DzXfFgfV.js +25 -0
  85. package/frag-coord-block-DzXfFgfV.js.map +1 -0
  86. package/frag-depth-block-UQbeKP2D.js +34 -0
  87. package/frag-depth-block-UQbeKP2D.js.map +1 -0
  88. package/fragment-output-BOphkIeh.js +26 -0
  89. package/fragment-output-BOphkIeh.js.map +1 -0
  90. package/fresnel-block-DefHWeO-.js +20 -0
  91. package/fresnel-block-DefHWeO-.js.map +1 -0
  92. package/front-facing-0d6aiyrv.js +11 -0
  93. package/front-facing-0d6aiyrv.js.map +1 -0
  94. package/gaussian-splatting-pipeline-sh-DgJl7l56.js +500 -0
  95. package/gaussian-splatting-pipeline-sh-DgJl7l56.js.map +1 -0
  96. package/gltf-animation-D7uyTyO3.js +245 -0
  97. package/gltf-animation-D7uyTyO3.js.map +1 -0
  98. package/gltf-ext-anisotropy-CknJiJK8.js +22 -0
  99. package/gltf-ext-anisotropy-CknJiJK8.js.map +1 -0
  100. package/gltf-ext-basisu-CPg5kPrx.js +452 -0
  101. package/gltf-ext-basisu-CPg5kPrx.js.map +1 -0
  102. package/gltf-ext-clearcoat-CLH2SVph.js +31 -0
  103. package/gltf-ext-clearcoat-CLH2SVph.js.map +1 -0
  104. package/gltf-ext-dielectric-qHzlnvdl.js +105 -0
  105. package/gltf-ext-dielectric-qHzlnvdl.js.map +1 -0
  106. package/gltf-ext-emissive-strength-nzGZXZVK.js +19 -0
  107. package/gltf-ext-emissive-strength-nzGZXZVK.js.map +1 -0
  108. package/gltf-ext-iridescence-C6bq7jiM.js +26 -0
  109. package/gltf-ext-iridescence-C6bq7jiM.js.map +1 -0
  110. package/gltf-ext-node-visibility-MafA9ot2.js +25 -0
  111. package/gltf-ext-node-visibility-MafA9ot2.js.map +1 -0
  112. package/gltf-ext-orm-CT18G_vQ.js +33 -0
  113. package/gltf-ext-orm-CT18G_vQ.js.map +1 -0
  114. package/gltf-ext-quantization-CpZyLDIz.js +94 -0
  115. package/gltf-ext-quantization-CpZyLDIz.js.map +1 -0
  116. package/gltf-ext-sheen-BgIxUzyZ.js +25 -0
  117. package/gltf-ext-sheen-BgIxUzyZ.js.map +1 -0
  118. package/gltf-ext-spec-gloss-D0LJLBUM.js +24 -0
  119. package/gltf-ext-spec-gloss-D0LJLBUM.js.map +1 -0
  120. package/gltf-ext-unlit-D2ANui0V.js +16 -0
  121. package/gltf-ext-unlit-D2ANui0V.js.map +1 -0
  122. package/gltf-ext-uv-transform-CE_-T1Tr.js +38 -0
  123. package/gltf-ext-uv-transform-CE_-T1Tr.js.map +1 -0
  124. package/gltf-feature-animation-pointer-BjpwOOqo.js +88 -0
  125. package/gltf-feature-animation-pointer-BjpwOOqo.js.map +1 -0
  126. package/gltf-feature-animations-CCizegp8.js +15 -0
  127. package/gltf-feature-animations-CCizegp8.js.map +1 -0
  128. package/gltf-feature-draco-yGSMGTE3.js +124 -0
  129. package/gltf-feature-draco-yGSMGTE3.js.map +1 -0
  130. package/gltf-feature-gpu-instancing-2e_CFQnl.js +151 -0
  131. package/gltf-feature-gpu-instancing-2e_CFQnl.js.map +1 -0
  132. package/gltf-feature-lights-punctual-DDDg4j0U.js +71 -0
  133. package/gltf-feature-lights-punctual-DDDg4j0U.js.map +1 -0
  134. package/gltf-feature-meshopt-Des96YFI.js +84 -0
  135. package/gltf-feature-meshopt-Des96YFI.js.map +1 -0
  136. package/gltf-feature-morph-CKCw6tkX.js +29 -0
  137. package/gltf-feature-morph-CKCw6tkX.js.map +1 -0
  138. package/gltf-feature-skeleton-D8hWLqi2.js +36 -0
  139. package/gltf-feature-skeleton-D8hWLqi2.js.map +1 -0
  140. package/gltf-feature-variants-Ds6v9byg.js +17 -0
  141. package/gltf-feature-variants-Ds6v9byg.js.map +1 -0
  142. package/gltf-feature-xmp-BUfq_IVG.js +15 -0
  143. package/gltf-feature-xmp-BUfq_IVG.js.map +1 -0
  144. package/gltf-glb-parser-D6UZWFuC.js +27 -0
  145. package/gltf-glb-parser-D6UZWFuC.js.map +1 -0
  146. package/gltf-interleave-DGnUlz28.js +241 -0
  147. package/gltf-interleave-DGnUlz28.js.map +1 -0
  148. package/gltf-pbr-builder-ext-BFOxOCnQ.js +85 -0
  149. package/gltf-pbr-builder-ext-BFOxOCnQ.js.map +1 -0
  150. package/gltf-variants-DFbr8EES.js +88 -0
  151. package/gltf-variants-DFbr8EES.js.map +1 -0
  152. package/gradient-block-DL_60sDc.js +50 -0
  153. package/gradient-block-DL_60sDc.js.map +1 -0
  154. package/gs-picking-pipeline-DzfMASL9.js +280 -0
  155. package/gs-picking-pipeline-DzfMASL9.js.map +1 -0
  156. package/height-to-normal-block-DhPHkDFg.js +65 -0
  157. package/height-to-normal-block-DhPHkDFg.js.map +1 -0
  158. package/ibl-fragment-DqQVi8k0.js +91 -0
  159. package/ibl-fragment-DqQVi8k0.js.map +1 -0
  160. package/ibl-skybox-wgsl-DCah0kWV.js +13 -0
  161. package/ibl-skybox-wgsl-DCah0kWV.js.map +1 -0
  162. package/image-processing-block-DwrhhmuF.js +40 -0
  163. package/image-processing-block-DwrhhmuF.js.map +1 -0
  164. package/image-source-BuMJgd9-.js +17 -0
  165. package/image-source-BuMJgd9-.js.map +1 -0
  166. package/index-C8HOR2sB.js +19222 -0
  167. package/index-C8HOR2sB.js.map +1 -0
  168. package/index.d.ts +4611 -0
  169. package/index.js +309 -0
  170. package/index.js.map +1 -0
  171. package/input-block-DgAJBzN_.js +109 -0
  172. package/input-block-DgAJBzN_.js.map +1 -0
  173. package/instances-block-BaSSiz8m.js +12 -0
  174. package/instances-block-BaSSiz8m.js.map +1 -0
  175. package/iridescence-block-B0pRFoOU.js +67 -0
  176. package/iridescence-block-B0pRFoOU.js.map +1 -0
  177. package/iridescence-fragment-Gymp7or5.js +243 -0
  178. package/iridescence-fragment-Gymp7or5.js.map +1 -0
  179. package/length-block-ChOkeiHR.js +11 -0
  180. package/length-block-ChOkeiHR.js.map +1 -0
  181. package/lerp-block-DjI2SfmI.js +18 -0
  182. package/lerp-block-DjI2SfmI.js.map +1 -0
  183. package/light-block-B11ew7FA.js +123 -0
  184. package/light-block-B11ew7FA.js.map +1 -0
  185. package/light-information-VJbW0jbs.js +19 -0
  186. package/light-information-VJbW0jbs.js.map +1 -0
  187. package/loop-block-Bb23EOMb.js +71 -0
  188. package/loop-block-Bb23EOMb.js.map +1 -0
  189. package/manifold-AS8POaOr.js +3022 -0
  190. package/manifold-AS8POaOr.js.map +1 -0
  191. package/manifold-RCa7RkKz.js +5 -0
  192. package/manifold-RCa7RkKz.js.map +1 -0
  193. package/matrix-blocks-acWn_V6g.js +51 -0
  194. package/matrix-blocks-acWn_V6g.js.map +1 -0
  195. package/max-block-CjFgljZ7.js +6 -0
  196. package/max-block-CjFgljZ7.js.map +1 -0
  197. package/mesh-attribute-exists-block-BfK8UiSL.js +44 -0
  198. package/mesh-attribute-exists-block-BfK8UiSL.js.map +1 -0
  199. package/mesh-features-BLENkYVt.js +341 -0
  200. package/mesh-features-BLENkYVt.js.map +1 -0
  201. package/min-block-CHtBngNl.js +6 -0
  202. package/min-block-CHtBngNl.js.map +1 -0
  203. package/mod-block-Ceizv8Y7.js +6 -0
  204. package/mod-block-Ceizv8Y7.js.map +1 -0
  205. package/morph-fragment-DOVo70gP.js +59 -0
  206. package/morph-fragment-DOVo70gP.js.map +1 -0
  207. package/morph-targets-55z342ZB.js +35 -0
  208. package/morph-targets-55z342ZB.js.map +1 -0
  209. package/multilight-wgsl-BGyiIOp3.js +112 -0
  210. package/multilight-wgsl-BGyiIOp3.js.map +1 -0
  211. package/multiply-block-DaXLJ7Ud.js +6 -0
  212. package/multiply-block-DaXLJ7Ud.js.map +1 -0
  213. package/negate-block-9CSLc5pM.js +6 -0
  214. package/negate-block-9CSLc5pM.js.map +1 -0
  215. package/nlerp-block-BNK1adIb.js +21 -0
  216. package/nlerp-block-BNK1adIb.js.map +1 -0
  217. package/node-env-BPZXZzBf.js +39 -0
  218. package/node-env-BPZXZzBf.js.map +1 -0
  219. package/node-registry-DwgC4yth.js +190 -0
  220. package/node-registry-DwgC4yth.js.map +1 -0
  221. package/node-registry-extra-advanced-2DJVt67-.js +45 -0
  222. package/node-registry-extra-advanced-2DJVt67-.js.map +1 -0
  223. package/node-registry-extra-compat-Dhrw8fDQ.js +41 -0
  224. package/node-registry-extra-compat-Dhrw8fDQ.js.map +1 -0
  225. package/node-registry-extra-math-CsAHvIZo.js +49 -0
  226. package/node-registry-extra-math-CsAHvIZo.js.map +1 -0
  227. package/node-registry-extra-procedural-5pLQ3Bhz.js +45 -0
  228. package/node-registry-extra-procedural-5pLQ3Bhz.js.map +1 -0
  229. package/node-renderable-DlLIdBmd.js +269 -0
  230. package/node-renderable-DlLIdBmd.js.map +1 -0
  231. package/node-shadow-DKrcqmNg.js +122 -0
  232. package/node-shadow-DKrcqmNg.js.map +1 -0
  233. package/node-snippet-DUMm9qEO.js +22 -0
  234. package/node-snippet-DUMm9qEO.js.map +1 -0
  235. package/normal-blend-block-BfH_nBoj.js +29 -0
  236. package/normal-blend-block-BfH_nBoj.js.map +1 -0
  237. package/normal-map-fragment-DpsIXrJf.js +38 -0
  238. package/normal-map-fragment-DpsIXrJf.js.map +1 -0
  239. package/normalize-block-F2bLNj9K.js +6 -0
  240. package/normalize-block-F2bLNj9K.js.map +1 -0
  241. package/oneminus-block-BP9x4Dc3.js +6 -0
  242. package/oneminus-block-BP9x4Dc3.js.map +1 -0
  243. package/opposite-block-Cnqmm-lH.js +6 -0
  244. package/opposite-block-Cnqmm-lH.js.map +1 -0
  245. package/package.json +26 -0
  246. package/panner-block-BwMQq-6Y.js +13 -0
  247. package/panner-block-BwMQq-6Y.js.map +1 -0
  248. package/parse-camera-DM3oJJeT.js +23 -0
  249. package/parse-camera-DM3oJJeT.js.map +1 -0
  250. package/pbr-aces-wgsl-HpiQHGN_.js +13 -0
  251. package/pbr-aces-wgsl-HpiQHGN_.js.map +1 -0
  252. package/pbr-metallic-roughness-block-full-6vMm1Jk6.js +763 -0
  253. package/pbr-metallic-roughness-block-full-6vMm1Jk6.js.map +1 -0
  254. package/pbr-metallic-roughness-block-h_KAOZrW.js +104 -0
  255. package/pbr-metallic-roughness-block-h_KAOZrW.js.map +1 -0
  256. package/pbr-mr-helper-core-CIwm-T1G.js +237 -0
  257. package/pbr-mr-helper-core-CIwm-T1G.js.map +1 -0
  258. package/pbr-refraction-DGmMSa2v.js +17 -0
  259. package/pbr-refraction-DGmMSa2v.js.map +1 -0
  260. package/pbr-renderable-BJxUtPBb.js +961 -0
  261. package/pbr-renderable-BJxUtPBb.js.map +1 -0
  262. package/pbr-shadow-fragment-LO9SlbJj.js +14 -0
  263. package/pbr-shadow-fragment-LO9SlbJj.js.map +1 -0
  264. package/pbr-template-ext-8q7BcTDf.js +88 -0
  265. package/pbr-template-ext-8q7BcTDf.js.map +1 -0
  266. package/pbr-tracking-B3alzn91.js +31 -0
  267. package/pbr-tracking-B3alzn91.js.map +1 -0
  268. package/pbr-transmission-ext-BxW4CEGu.js +581 -0
  269. package/pbr-transmission-ext-BxW4CEGu.js.map +1 -0
  270. package/perturb-normal-0Q8EM9ig.js +39 -0
  271. package/perturb-normal-0Q8EM9ig.js.map +1 -0
  272. package/posterize-block-DfdKsbEf.js +28 -0
  273. package/posterize-block-DfdKsbEf.js.map +1 -0
  274. package/pow-block-DI5ICzhc.js +13 -0
  275. package/pow-block-DI5ICzhc.js.map +1 -0
  276. package/random-number-block-2OyRYljF.js +15 -0
  277. package/random-number-block-2OyRYljF.js.map +1 -0
  278. package/reciprocal-block-Ck3CW-j-.js +14 -0
  279. package/reciprocal-block-Ck3CW-j-.js.map +1 -0
  280. package/reflect-block-CizpzrX4.js +12 -0
  281. package/reflect-block-CizpzrX4.js.map +1 -0
  282. package/reflectance-fragment-BCrgPmrt.js +143 -0
  283. package/reflectance-fragment-BCrgPmrt.js.map +1 -0
  284. package/reflection-block-DqcwyYqr.js +12 -0
  285. package/reflection-block-DqcwyYqr.js.map +1 -0
  286. package/reflection-texture-base-block-1xmJ0HDj.js +10 -0
  287. package/reflection-texture-base-block-1xmJ0HDj.js.map +1 -0
  288. package/reflection-texture-block-C3QtzoV8.js +60 -0
  289. package/reflection-texture-block-C3QtzoV8.js.map +1 -0
  290. package/refract-block-HHiAk-7U.js +13 -0
  291. package/refract-block-HHiAk-7U.js.map +1 -0
  292. package/refraction-block-U8y6XiXs.js +11 -0
  293. package/refraction-block-U8y6XiXs.js.map +1 -0
  294. package/refraction-dispersion-wgsl-DdQCyyO1.js +16 -0
  295. package/refraction-dispersion-wgsl-DdQCyyO1.js.map +1 -0
  296. package/remap-block-DxK1W1vp.js +27 -0
  297. package/remap-block-DxK1W1vp.js.map +1 -0
  298. package/replace-color-block-1m--hiru.js +17 -0
  299. package/replace-color-block-1m--hiru.js.map +1 -0
  300. package/rgbd-decode-DCvzUYeI.js +110 -0
  301. package/rgbd-decode-DCvzUYeI.js.map +1 -0
  302. package/rotate2d-block-nEe1N2MJ.js +15 -0
  303. package/rotate2d-block-nEe1N2MJ.js.map +1 -0
  304. package/scale-block-C5Z8159G.js +13 -0
  305. package/scale-block-C5Z8159G.js.map +1 -0
  306. package/scene-material-swap-C2ykv55W.js +34 -0
  307. package/scene-material-swap-C2ykv55W.js.map +1 -0
  308. package/screen-size-block-BVNnOvE8.js +21 -0
  309. package/screen-size-block-BVNnOvE8.js.map +1 -0
  310. package/screen-space-block-CwaxdfSe.js +28 -0
  311. package/screen-space-block-CwaxdfSe.js.map +1 -0
  312. package/shader-renderable-D-6796KR.js +531 -0
  313. package/shader-renderable-D-6796KR.js.map +1 -0
  314. package/shadow-fragment-core-DHN2G6FI.js +110 -0
  315. package/shadow-fragment-core-DHN2G6FI.js.map +1 -0
  316. package/shadow-map-CQNQC-Fw.js +13 -0
  317. package/shadow-map-CQNQC-Fw.js.map +1 -0
  318. package/sheen-block-BugfJqK3.js +12 -0
  319. package/sheen-block-BugfJqK3.js.map +1 -0
  320. package/sheen-fragment-Dze2f7XJ.js +215 -0
  321. package/sheen-fragment-Dze2f7XJ.js.map +1 -0
  322. package/simplex-perlin-3d-block-CcMtofzV.js +58 -0
  323. package/simplex-perlin-3d-block-CcMtofzV.js.map +1 -0
  324. package/singlelight-directional-wgsl-CmUDZxwz.js +39 -0
  325. package/singlelight-directional-wgsl-CmUDZxwz.js.map +1 -0
  326. package/singlelight-hemispheric-wgsl-t-83IP_s.js +40 -0
  327. package/singlelight-hemispheric-wgsl-t-83IP_s.js.map +1 -0
  328. package/singlelight-point-wgsl-CLzULIYV.js +45 -0
  329. package/singlelight-point-wgsl-CLzULIYV.js.map +1 -0
  330. package/singlelight-spot-wgsl-DEEUrfVM.js +47 -0
  331. package/singlelight-spot-wgsl-DEEUrfVM.js.map +1 -0
  332. package/skeleton-fragment-B_XlFbtx.js +71 -0
  333. package/skeleton-fragment-B_XlFbtx.js.map +1 -0
  334. package/skybox-renderable-DDwzu-PT.js +92 -0
  335. package/skybox-renderable-DDwzu-PT.js.map +1 -0
  336. package/skybox.vertex-DJgi072W.js +5 -0
  337. package/skybox.vertex-DJgi072W.js.map +1 -0
  338. package/smoothstep-block-Di4t37x-.js +15 -0
  339. package/smoothstep-block-Di4t37x-.js.map +1 -0
  340. package/splat-ply-compressed-BahdBG1r.js +394 -0
  341. package/splat-ply-compressed-BahdBG1r.js.map +1 -0
  342. package/standard-renderable-GjxL9xSf.js +636 -0
  343. package/standard-renderable-GjxL9xSf.js.map +1 -0
  344. package/std-ambient-fragment-BoUsD06w.js +37 -0
  345. package/std-ambient-fragment-BoUsD06w.js.map +1 -0
  346. package/std-cube-reflection-fragment-ulqc3bsP.js +31 -0
  347. package/std-cube-reflection-fragment-ulqc3bsP.js.map +1 -0
  348. package/std-emissive-fragment-DNGj1HdQ.js +40 -0
  349. package/std-emissive-fragment-DNGj1HdQ.js.map +1 -0
  350. package/std-lightmap-fragment-Bqj89aIe.js +37 -0
  351. package/std-lightmap-fragment-Bqj89aIe.js.map +1 -0
  352. package/std-opacity-fragment-KuPh5N2Z.js +37 -0
  353. package/std-opacity-fragment-KuPh5N2Z.js.map +1 -0
  354. package/std-reflection-fragment-BA5Ghn_M.js +57 -0
  355. package/std-reflection-fragment-BA5Ghn_M.js.map +1 -0
  356. package/std-shadow-fragment-FNQfrJuC.js +8 -0
  357. package/std-shadow-fragment-FNQfrJuC.js.map +1 -0
  358. package/std-specular-fragment-CE-6scqd.js +37 -0
  359. package/std-specular-fragment-CE-6scqd.js.map +1 -0
  360. package/std-tracking-CNKZ-hJN.js +15 -0
  361. package/std-tracking-CNKZ-hJN.js.map +1 -0
  362. package/step-block-BkywzTYm.js +13 -0
  363. package/step-block-BkywzTYm.js.map +1 -0
  364. package/storage-read-block-BdzhJfln.js +25 -0
  365. package/storage-read-block-BdzhJfln.js.map +1 -0
  366. package/storage-write-block-DjLKZ0Ro.js +11 -0
  367. package/storage-write-block-DjLKZ0Ro.js.map +1 -0
  368. package/subsurface-block-CBhxT9ui.js +12 -0
  369. package/subsurface-block-CBhxT9ui.js.map +1 -0
  370. package/subsurface-fragment-liM3y2-P.js +158 -0
  371. package/subsurface-fragment-liM3y2-P.js.map +1 -0
  372. package/subtract-block-NPfKvzQP.js +6 -0
  373. package/subtract-block-NPfKvzQP.js.map +1 -0
  374. package/swapchain-overlay-DcCSFDp7.js +35 -0
  375. package/swapchain-overlay-DcCSFDp7.js.map +1 -0
  376. package/tbn-block-ByOI6Y43.js +43 -0
  377. package/tbn-block-ByOI6Y43.js.map +1 -0
  378. package/teleport-in-block-BMa17cqq.js +10 -0
  379. package/teleport-in-block-BMa17cqq.js.map +1 -0
  380. package/teleport-out-block-5AkB25H6.js +19 -0
  381. package/teleport-out-block-5AkB25H6.js.map +1 -0
  382. package/texture-block-rr21KIL_.js +70 -0
  383. package/texture-block-rr21KIL_.js.map +1 -0
  384. package/thin-instance-fragment-hsv-RyDs.js +69 -0
  385. package/thin-instance-fragment-hsv-RyDs.js.map +1 -0
  386. package/thin-instance-gpu-C9Gv_Z1w.js +62 -0
  387. package/thin-instance-gpu-C9Gv_Z1w.js.map +1 -0
  388. package/tracking-primitives-wgdBY85t.js +82 -0
  389. package/tracking-primitives-wgdBY85t.js.map +1 -0
  390. package/transform-block-DbRph9JI.js +32 -0
  391. package/transform-block-DbRph9JI.js.map +1 -0
  392. package/trigonometry-block-BYQcTHiD.js +36 -0
  393. package/trigonometry-block-BYQcTHiD.js.map +1 -0
  394. package/triplanar-block-BZHkD9hX.js +148 -0
  395. package/triplanar-block-BZHkD9hX.js.map +1 -0
  396. package/twirl-block-78WtdiBd.js +39 -0
  397. package/twirl-block-78WtdiBd.js.map +1 -0
  398. package/unlit-fragment-BIlhJpz6.js +43 -0
  399. package/unlit-fragment-BIlhJpz6.js.map +1 -0
  400. package/uv-transform-fragment-hYujGpZg.js +47 -0
  401. package/uv-transform-fragment-hYujGpZg.js.map +1 -0
  402. package/vector-merger-CrW-ONB0.js +43 -0
  403. package/vector-merger-CrW-ONB0.js.map +1 -0
  404. package/vector-splitter-BoJuHrAU.js +34 -0
  405. package/vector-splitter-BoJuHrAU.js.map +1 -0
  406. package/vertex-output-Cvft64y0.js +14 -0
  407. package/vertex-output-Cvft64y0.js.map +1 -0
  408. package/view-direction-CWVucfnT.js +12 -0
  409. package/view-direction-CWVucfnT.js.map +1 -0
  410. package/voronoi-noise-block-iNQxa_Ls.js +43 -0
  411. package/voronoi-noise-block-iNQxa_Ls.js.map +1 -0
  412. package/wave-block-CY_mk1ec.js +41 -0
  413. package/wave-block-CY_mk1ec.js.map +1 -0
  414. package/wgsl-helpers-DyzNzCeE.js +48 -0
  415. package/wgsl-helpers-DyzNzCeE.js.map +1 -0
  416. package/worley-noise-3d-block-CyR2-k4s.js +58 -0
  417. package/worley-noise-3d-block-CyR2-k4s.js.map +1 -0
package/index.d.ts ADDED
@@ -0,0 +1,4611 @@
1
+ /** Add an agent to the crowd. Returns the agent index. */
2
+ export declare function addAgent(crowd: NavCrowd, position: Vec3, params: AgentParameters): number;
3
+
4
+ /** Attaches `group` to `manager` so it is ticked each update, creating its backing animation task on first use.
5
+ * @param manager - Animation manager that will own and drive the group.
6
+ * @param group - Animation group to attach.
7
+ * @throws If the group is already attached to a different manager. */
8
+ export declare function addAnimationGroup(manager: AnimationManager, group: AnimationGroup): void;
9
+
10
+ /** Attaches each group in `groups` to `manager` via {@link addAnimationGroup}. */
11
+ export declare function addAnimationGroups(manager: AnimationManager, groups: readonly AnimationGroup[]): void;
12
+
13
+ /** Attaches `task` to `manager` and marks it active.
14
+ * @throws If the task is already attached to a different manager. */
15
+ export declare function addAnimationTask(manager: AnimationManager, task: AnimationTask): void;
16
+
17
+ /**
18
+ * Adds an axis-locked billboard sprite system to the scene so it is rendered each frame.
19
+ * @param scene - Scene that will own and draw the system.
20
+ * @param system - Axis-locked billboard system to register.
21
+ */
22
+ export declare function addAxisLockedBillboardSystem(scene: SceneContext, system: AxisLockedBillboardSpriteSystem): void;
23
+
24
+ /**
25
+ * Adds a billboard sprite to the system and returns a stable handle to it.
26
+ * @param system - Billboard system to add the sprite to.
27
+ * @param init - Initial sprite properties.
28
+ * @returns A handle that stays valid as sprites are added and removed.
29
+ */
30
+ export declare function addBillboardSprite(system: BillboardSpriteSystem, init: BillboardSpriteInit): BillboardSpriteHandle;
31
+
32
+ /**
33
+ * Appends a billboard sprite to the system and returns its instance index.
34
+ * @param system - Billboard system to add to.
35
+ * @param props - Sprite properties; `position` and `sizeWorld` are required.
36
+ * @returns The new sprite's instance index.
37
+ * @throws If `position` or `sizeWorld` is missing.
38
+ */
39
+ export declare function addBillboardSpriteIndex(system: BillboardSpriteSystem, props: BillboardSpriteInit): number;
40
+
41
+ /**
42
+ * Add a box obstacle to a tile-cache navmesh. The navmesh must have been
43
+ * built with `maxObstacles > 0`. The tile cache is fully updated before
44
+ * returning (matching BJS Addons default behavior).
45
+ *
46
+ * @param halfExtents - box half-size on each axis
47
+ * @param angle - rotation around the Y axis, in radians
48
+ */
49
+ export declare function addBoxObstacle(plugin: NavigationPlugin, position: Vec3, halfExtents: Vec3, angle: number): ObstacleHandle | null;
50
+
51
+ /**
52
+ * Add a cylinder obstacle to a tile-cache navmesh.
53
+ *
54
+ * @param radius - cylinder radius
55
+ * @param height - cylinder height
56
+ */
57
+ export declare function addCylinderObstacle(plugin: NavigationPlugin, position: Vec3, radius: number, height: number): ObstacleHandle | null;
58
+
59
+ /**
60
+ * Add a depth-hosted Sprite2D layer to a SceneContext via the scene's optional
61
+ * renderable extension hook. Pure HUD layers (`depth: "none"`) are rendered by
62
+ * `createSpriteRenderer + registerSpriteRenderer` instead.
63
+ */
64
+ export declare function addDepthHostedSpriteLayer(scene: SceneContext, layer: Sprite2DLayer): void;
65
+
66
+ /**
67
+ * Adds a camera-facing billboard sprite system to the scene so it is rendered each frame.
68
+ * @param scene - Scene that will own and draw the system.
69
+ * @param system - Facing billboard system to register.
70
+ */
71
+ export declare function addFacingBillboardSystem(scene: SceneContext, system: FacingBillboardSpriteSystem): void;
72
+
73
+ /** Add one or more render-target dependencies to the pass. Idempotent
74
+ * (Set semantics). Mirrors BJS `FrameGraphRenderPass.addDependencies`,
75
+ * promoted onto the base `Pass` because every future pass type
76
+ * (compute / copy / object-list) needs the same surface. */
77
+ export declare function addPassDependencies(pass: Pass, deps: RenderTarget | readonly RenderTarget[]): void;
78
+
79
+ /** Create a `RenderPass`, wire it to the task currently recording, and return
80
+ * it. Must be called from inside `Task.record()` so the FG can associate the
81
+ * new pass with the right task (mirrors BJS `frameGraph.addRenderPass`).
82
+ *
83
+ * Configure the returned pass with `setRenderPassRenderTarget`,
84
+ * `setRenderPassExecuteFunc`, etc. before the FG finishes building. */
85
+ export declare function addRenderPass(target: FrameGraph | SceneContext, name: string): RenderPass;
86
+
87
+ /**
88
+ * Adds a sprite to the layer and returns a stable handle to it.
89
+ * @param layer - Sprite layer to add the sprite to.
90
+ * @param props - Initial sprite properties.
91
+ * @returns A handle that stays valid as sprites are added and removed.
92
+ */
93
+ export declare function addSprite2D(layer: Sprite2DLayer, props: Sprite2DProps): Sprite2DHandle;
94
+
95
+ /** Add one sprite. Returns its index. Grows capacity as needed. */
96
+ export declare function addSprite2DIndex(layer: Sprite2DLayer, props: Sprite2DProps): number;
97
+
98
+ /** Add an animation to a manager, transferring ownership if it already belongs to another manager. */
99
+ export declare function addSpriteAnimation(manager: SpriteAnimationManager, animation: SpriteFrameAnimation): void;
100
+
101
+ /**
102
+ * Attaches a sprite animation manager to a shared animation manager so it ticks with it.
103
+ * @param manager - Animation manager that will drive the sprite manager.
104
+ * @param spriteManager - Sprite animation manager to attach.
105
+ * @throws If the sprite manager is already running or attached elsewhere.
106
+ */
107
+ export declare function addSpriteAnimationManager(manager: AnimationManager, spriteManager: SpriteAnimationManager): void;
108
+
109
+ /** Add a pure-2D layer to the renderer. No-op if the layer is already present. */
110
+ export declare function addSpriteRendererLayer(sr: SpriteRenderer, layer: Sprite2DLayer): void;
111
+
112
+ /** Add a task at the END of execute order. Accepts the scene's frame graph directly,
113
+ * or a SceneContext (the scene's default frame graph is used). */
114
+ export declare function addTask(target: FrameGraph | SceneContext, task: Task): void;
115
+
116
+ /** Insert a task at the START of user execute order. Built-in system tasks that must
117
+ * precede all user work, such as the shadow adapter, keep their leading slot. */
118
+ export declare function addTaskAtStart(target: FrameGraph | SceneContext, task: Task): void;
119
+
120
+ /** Insert a task BEFORE another task in execute order. Accepts a FrameGraph or a SceneContext. */
121
+ export declare function addTaskBefore(target: FrameGraph | SceneContext, task: Task, before: Task): void;
122
+
123
+ /** Add one instance. Returns its index. Grows capacity as needed. */
124
+ export declare function addThinInstance(mesh: Mesh, matrix: Mat4): number;
125
+
126
+ /**
127
+ * Adds an entity to the scene, dispatching on its type. Asset containers are unpacked and
128
+ * each contained entity added recursively; meshes, lights, cameras, transform nodes, and
129
+ * shadow generators are registered in their respective scene collections.
130
+ * @param scene - The owning scene (pillar 4b: entities never reference the scene themselves).
131
+ * @param entity - The entity (or asset container) to add.
132
+ */
133
+ export declare function addToScene(scene: SceneContext, entity: Mesh | LightBase | Camera | ShadowGenerator | TransformNode | AssetContainer): void;
134
+
135
+ /** Request the agent to move toward a world target (constrained by navmesh). */
136
+ export declare function agentGoto(crowd: NavCrowd, index: number, destination: Vec3): void;
137
+
138
+ /** Crowd agent parameters. */
139
+ export declare interface AgentParameters {
140
+ radius: number;
141
+ height: number;
142
+ maxAcceleration: number;
143
+ maxSpeed: number;
144
+ collisionQueryRange: number;
145
+ pathOptimizationRange: number;
146
+ separationWeight: number;
147
+ updateFlags?: number;
148
+ obstacleAvoidanceType?: number;
149
+ queryFilterType?: number;
150
+ reachRadius?: number;
151
+ }
152
+
153
+ /** A post-process task that combines a left-eye and right-eye image into a red/cyan anaglyph 3D image. */
154
+ export declare interface AnaglyphPostProcessTask extends PostProcessTask {
155
+ leftTexture: RenderTarget;
156
+ }
157
+
158
+ /** Configuration for `createAnaglyphPostProcessTask`; `leftTexture` is the left-eye image combined with the source (right eye). */
159
+ export declare interface AnaglyphPostProcessTaskConfig extends Omit<PostProcessTaskConfig, "_shader"> {
160
+ leftTexture: RenderTarget;
161
+ }
162
+
163
+ /** Minimal structural view of a scene node's animatable transform. Lets the
164
+ * animation controller apply plain glTF node-TRS channels (translation/rotation/
165
+ * scale) to scene nodes without importing the scene layer. `SceneNode` is
166
+ * structurally compatible with this interface. */
167
+ declare interface AnimatedNodeTarget {
168
+ readonly position: {
169
+ set(x: number, y: number, z: number): void;
170
+ };
171
+ readonly rotationQuaternion: {
172
+ set(x: number, y: number, z: number, w: number): void;
173
+ };
174
+ readonly scaling: {
175
+ set(x: number, y: number, z: number): void;
176
+ };
177
+ }
178
+
179
+ /** Options for {@link setAnimationAdditive}, selecting the reference pose subtracted from an additive animation. */
180
+ export declare interface AnimationAdditiveOptions {
181
+ readonly referenceFrame?: number;
182
+ readonly referenceTime?: number;
183
+ }
184
+
185
+ /** Single animation channel — targets one node property, or an arbitrary
186
+ * KHR_animation_pointer target resolved at load time to a writer function. */
187
+ declare interface AnimationChannel {
188
+ readonly samplerIdx: number;
189
+ /** For standard channels: glTF node index. For `PATH_POINTER`: unused (-1). */
190
+ readonly nodeIdx: number;
191
+ readonly path: TargetPath;
192
+ /** PATH_POINTER only: invoked per-frame with the interpolated sampler output.
193
+ * The writer is responsible for applying the value to the runtime target
194
+ * (node.visible, material factor, camera fov, light color, ...). */
195
+ readonly pointerWriter?: (output: Float32Array, offset: number) => void;
196
+ /** PATH_POINTER only: number of floats per keyframe (1, 3, 4, ...). */
197
+ readonly pointerArity?: number;
198
+ /** PATH_POINTER only: true when LINEAR interpolation should use quaternion slerp. */
199
+ readonly pointerQuaternion?: boolean;
200
+ }
201
+
202
+ /** One animation clip (may animate many nodes). */
203
+ export declare interface AnimationClip {
204
+ readonly name: string;
205
+ readonly channels: readonly AnimationChannel[];
206
+ readonly samplers: readonly AnimationSampler[];
207
+ /** Total duration in seconds (max of all sampler input times). */
208
+ readonly duration: number;
209
+ /** Frame rate used by AnimationGroup goToFrame(); defaults to 60. */
210
+ readonly frameRate?: number;
211
+ }
212
+
213
+ /** Drives playback of a skeletal/morph animation clip, advancing time and uploading bone matrices each tick. */
214
+ export declare interface AnimationController {
215
+ /** Advance animation by deltaMs and update bone textures. */
216
+ tick(deltaMs: number, engine?: EngineContext): void;
217
+ /** Current playback time in seconds. */
218
+ time: number;
219
+ /** True if playing. */
220
+ playing: boolean;
221
+ /** Playback speed multiplier (default 1). */
222
+ speedRatio: number;
223
+ /** Whether animation loops (default true). */
224
+ loop: boolean;
225
+
226
+ /** User-facing animation group — one per animation clip. Pure state. */
227
+ export declare interface AnimationGroup {
228
+ /** Name of this animation. */
229
+ readonly name: string;
230
+ /** Duration in seconds. */
231
+ readonly duration: number;
232
+ /** Frame rate used by goToFrame(). */
233
+ readonly frameRate?: number;
234
+ /** True if currently playing. */
235
+ isPlaying: boolean;
236
+ /** Current playback time in seconds. */
237
+ currentFrame: number;
238
+ /** Playback speed multiplier (default 1). */
239
+ speedRatio: number;
240
+ /** Whether animation loops (default true). */
241
+ loopAnimation: boolean;
242
+ /** Weighted contribution used by AnimationManager mixing (default 1). */
243
+ weight: number;
244
+
245
+ /** A single keyframe on a property animation track. Supply exactly one of `time` (seconds) or `frame`. */
246
+ export declare interface AnimationKeyframe {
247
+ readonly time?: number;
248
+ readonly frame?: number;
249
+ readonly value: AnimationKeyframeValue;
250
+ }
251
+
252
+ /** A keyframe value: a single scalar or a fixed-length tuple of components (e.g. a vector or quaternion). */
253
+ export declare type AnimationKeyframeValue = number | readonly number[];
254
+
255
+ /** Owns a set of {@link AnimationTask}s and ticks them, either manually or via its own requestAnimationFrame loop. */
256
+ export declare interface AnimationManager {
257
+ animations: AnimationTask[];
258
+ fixedDeltaMs: number;
259
+ running: boolean;
260
+ readonly engine?: EngineContext;
261
+ /** Called after each autonomous tick with the step (in ms) that was applied. */
262
+ readonly onUpdate?: (deltaMs: number) => void;
263
+
264
+ /** Options for {@link createAnimationManager}. */
265
+ export declare interface AnimationManagerOptions {
266
+ readonly engine?: EngineContext;
267
+ readonly fixedDeltaMs?: number;
268
+ /** Called after each autonomous tick with the step (in ms) that was applied. */
269
+ readonly onUpdate?: (deltaMs: number) => void;
270
+ }
271
+
272
+ /** Parsed keyframe sampler — times + values + interpolation. */
273
+ declare interface AnimationSampler {
274
+ /** Keyframe timestamps in seconds (monotonically increasing). */
275
+ readonly input: Float32Array;
276
+ /** Keyframe output values (vec3/quat/scalar packed sequentially).
277
+ * For CUBICSPLINE: [inTangent, value, outTangent] per keyframe. */
278
+ readonly output: Float32Array;
279
+ readonly interpolation: InterpMode;
280
+ }
281
+
282
+ /** A unit of per-frame animation work owned by an {@link AnimationManager}. */
283
+ export declare interface AnimationTask {
284
  active: boolean;
285
+
286
+ /** Handler that drives all tasks of a given category in one pass; returns true if it handled that category this tick. */
287
+ export declare type AnimationTaskCategoryHandler = (manager: AnimationManager, deltaMs: number) => boolean;
288
+
289
+ /** Options for {@link createAnimationTask}. */
290
+ export declare interface AnimationTaskOptions {
291
+ readonly category?: string;
292
+ /** Called when the task is removed from its manager, allowing it to release any owned resources. */
293
+ readonly dispose?: (manager: AnimationManager) => void;
294
+ }
295
+
296
+ /** Callback invoked each tick to advance a single {@link AnimationTask} by `deltaMs` milliseconds. */
297
+ export declare type AnimationTaskUpdate = (manager: AnimationManager, deltaMs: number, task: AnimationTask) => void;
298
+
299
+ /** Anisotropy layer properties. Maps to BJS PBRMaterial.anisotropy sub-object.
300
+ * Stretches specular reflections along the tangent direction. */
301
+ export declare interface AnisotropyProps {
302
+ /** Whether anisotropy is active. Default false. */
303
+ isEnabled: boolean;
304
+ /** Anisotropy strength (0=isotropic, 1=fully anisotropic). Default 1.0. */
305
+ intensity?: number;
306
+ /** Anisotropy direction in tangent space (u, v). Default [1, 0]. */
307
+ direction?: [number, number];
308
+ }
309
+
310
+ declare type AnyMaterial = StandardMaterialProps | PbrMaterialProps;
311
+
312
+ /** ArcRotateCamera — orbits around a target point.
313
+ * Uses Babylon.js convention: left-handed, alpha=rotation around Y, beta=elevation.
314
+ * Plain data + methods. Does NOT know about the scene.
315
+ *
316
+ * Push-based dirty tracking: alpha/beta/radius use Object.defineProperty,
317
+ * target uses ObservableVec3. Changes call wm.markLocalDirty() immediately.
318
+ *
319
+ * Inertia follows the Babylon.js model: input handlers accumulate per-frame
320
+ * offsets (inertialAlphaOffset, etc.) which are applied and exponentially
321
+ * decayed each frame by the controls module. */
322
+ export declare interface ArcRotateCamera extends Camera, IWorldMatrixProvider, IParentable {
323
+ alpha: number;
324
+ beta: number;
325
+ radius: number;
326
+ target: Vec3;
327
+ fov: number;
328
+ nearPlane: number;
329
+ farPlane: number;
330
+ viewport?: NormalizedViewport;
331
+ children: SceneNode[];
332
+ /** Inertia coefficient for rotation and zoom (0 = instant stop, 0.9 = default, 1 = no decay). */
333
+ inertia: number;
334
+ /** Inertia coefficient for panning (0 = instant stop, 0.9 = default). */
335
+ panningInertia: number;
336
+ /** Per-frame inertial offsets — accumulated by input, applied & decayed each frame. */
337
+ inertialAlphaOffset: number;
338
+ inertialBetaOffset: number;
339
+ inertialRadiusOffset: number;
340
+ inertialPanningX: number;
341
+ inertialPanningY: number;
342
+ parent: IWorldMatrixProvider | null;
343
+ readonly worldMatrix: Mat4;
344
+ readonly worldMatrixVersion: number;
345
+ }
346
+
347
+ /**
348
+ * Result returned by loadGltf / loadBabylon.
349
+ * Pass directly to addToScene() — it handles all fields automatically.
350
+ *
351
+ * - glTF: entities = [root TransformNode], animationGroups = loaded clips
352
+ * - .babylon: entities = root SceneNodes (Mesh/TransformNode) + LightBase, clearColor from file
353
+ */
354
+ export declare interface AssetContainer {
355
+ /** Scene entities. glTF: [root TransformNode]. .babylon: root nodes + lights. */
356
+ entities: Array<SceneNode | LightBase>;
357
+ /** Animation groups from the file. addToScene() registers them with the scene-owned AnimationManager by default. */
358
+ animationGroups?: AnimationGroup[];
359
+ /** Scene background color declared in the file. addToScene() applies it to scene.clearColor. */
360
+ clearColor?: GPUColorDict;
361
+ /** Camera parsed from the file. addToScene() sets it as scene.camera when present. */
362
+ camera?: Camera;
363
+ /** KHR_materials_variants data. Use selectVariant() / getVariantNames() to interact. */
364
+ materialVariants?: MaterialVariantData;
365
+ /** KHR_xmp_json_ld metadata. `packets` are the JSON-LD packets declared at the
366
+ * document level; `assetPacket` is the packet referenced by `asset` (if any). */
367
+ xmpMetadata?: {
368
+ packets: unknown[];
369
+ assetPacket?: unknown;
370
+ };
371
+ }
372
+
373
+ /**
374
+ * Attach orbit/zoom/pan controls to an ArcRotateCamera.
375
+ * Matches Babylon.js ArcRotateCameraPointersInput behavior with inertia:
376
+ * - Left-drag: rotate (alpha/beta) with momentum
377
+ * - Right-drag: pan (shift target) with momentum
378
+ * - Wheel: zoom (radius) with momentum
379
+ * - Pinch: zoom (touch, direct — no inertia)
380
+ *
381
+ * Input handlers accumulate into the camera's inertial offset properties.
382
+ * Inertia is applied each frame via scene._beforeRender (single RAF loop).
383
+ *
384
+ * Camera stays plain data — this function reads/writes its properties.
385
+ * Returns a cleanup function to remove all listeners and the beforeRender hook.
386
+ */
387
+ export declare function attachControl(camera: ArcRotateCamera, canvas: HTMLCanvasElement, scene?: SceneContext): () => void;
388
+
389
+ /**
390
+ * Attach keyboard + mouse controls to a FreeCamera.
391
+ * Matches Babylon.js FreeCamera input behavior:
392
+ * - Mouse drag or pointer-lock: look around (yaw/pitch)
393
+ * - Arrow keys / WASD: move forward/back/strafe
394
+ * - PageUp/PageDown or Space/Shift: move up/down
395
+ * - Inertia: movement decays smoothly (camera.inertia, default 0.9)
396
+ * - Frame-rate independent: uses deltaTime from render loop
397
+ *
398
+ * Camera stays plain data — this function reads/writes its properties.
399
+ * Returns a cleanup function to remove all listeners and the beforeRender hook.
400
+ */
401
+ export declare function attachFreeControl(camera: FreeCamera, canvas: HTMLCanvasElement, scene?: SceneContext): () => void;
402
+
403
+ /**
404
+ * Attaches a manager to a sprite renderer's update hooks so its animations advance each frame.
405
+ * @param renderer - Sprite renderer whose update loop drives the manager.
406
+ * @param manager - Sprite animation manager to attach.
407
+ * @returns A binding that detaches the manager when disposed.
408
+ * @throws If the manager is already running or attached elsewhere.
409
+ */
410
+ export declare function attachSpriteAnimationsToRenderer(renderer: SpriteRenderer, manager: SpriteAnimationManager): SpriteAnimationBinding;
411
+
412
+ /**
413
+ * Attaches a manager to a scene's before-render hooks so its animations advance each frame.
414
+ * @param scene - Scene whose render loop drives the manager.
415
+ * @param manager - Sprite animation manager to attach.
416
+ * @returns A binding that detaches the manager when disposed.
417
+ * @throws If the manager is already running or attached elsewhere.
418
+ */
419
+ export declare function attachSpriteAnimationsToScene(scene: SceneContext, manager: SpriteAnimationManager): SpriteAnimationBinding;
420
+
421
+ /** A billboard sprite system that rotates only around a fixed world axis. */
422
+ export declare type AxisLockedBillboardSpriteSystem = BillboardSpriteSystem<"axis-locked">;
423
+
424
+ /**
425
+ * Bakes the mesh's current world matrix into its splat vertices, then resets the mesh's
426
+ * position, rotation, and scaling to identity so the visual result is unchanged.
427
+ * @param mesh - Gaussian Splatting mesh to modify in place.
428
+ */
429
+ export declare function bakeCurrentTransformIntoVertices(mesh: GaussianSplattingMesh): void;
430
+
431
+ /**
432
+ * Bakes a transform matrix directly into a mesh's splat vertices, rewriting each splat's
433
+ * position, scale, and orientation so the mesh renders identically with an identity transform.
434
+ * @param mesh - Gaussian Splatting mesh to modify in place.
435
+ * @param transform - World-space transform to bake into the splat data.
436
+ */
437
+ export declare function bakeTransformIntoVertices(mesh: GaussianSplattingMesh, transform: Mat4): void;
438
+
439
+ /**
440
+ * Additive blending for world-space billboards. The billboard's RGB, scaled by its own alpha, is
441
+ * added to the framebuffer (no depth write, like the other transparent modes), so overlapping
442
+ * billboards stack and brighten — world-space embers, sparks, muzzle flashes, and light shafts.
443
+ */
444
+ export declare const billboardBlendAdditive: BillboardBlendDescriptor;
445
+
446
+ /** Straight-alpha "over" blending (the default) for transparent billboards. */
447
+ export declare const billboardBlendAlpha: BillboardBlendDescriptor;
448
+
449
+ /**
450
+ * Alpha-test cutout: no color blend; fragments below `alphaCutoff` are discarded and surviving
451
+ * fragments write depth, so cutout billboards occlude correctly like opaque geometry.
452
+ */
453
+ export declare const billboardBlendCutout: BillboardBlendDescriptor;
454
+
455
+ /**
456
+ * A billboard-system blend descriptor. Pass one of the exported `billboardBlend*` values to
457
+ * `createFacingBillboardSystem` / `createAxisLockedBillboardSystem` via `{ blendMode }`. The
458
+ * fields are internal plumbing; treat the value as opaque.
459
+ */
460
+ export declare interface BillboardBlendDescriptor {
461
+
462
+ /**
463
+ * Blend mode for a billboard sprite system — a pure-data descriptor value. Import one of
464
+ * `billboardBlendAlpha` (default), `billboardBlendPremultiplied`, or `billboardBlendCutout`
465
+ * and pass it as `BillboardSpriteSystemOptions.blendMode`. (Type alias of
466
+ * {@link BillboardBlendDescriptor}.)
467
+ */
468
+ export declare type BillboardBlendMode = BillboardBlendDescriptor;
469
+
470
+ /** Premultiplied-alpha "over" blending; per-system opacity scales RGB and A together. */
471
+ export declare const billboardBlendPremultiplied: BillboardBlendDescriptor;
472
+
473
+ /** Opaque custom-shader descriptor produced by {@link createBillboardCustomShader}. */
474
+ export declare interface BillboardCustomShader {
475
+
476
+ /** Options for {@link createBillboardCustomShader}. */
477
+ export declare interface BillboardCustomShaderOptions {
478
+ /** WGSL fragment body. See the module docs for the in-scope identifiers. */
479
+ readonly fragment: string;
480
+ /** Extra textures, in binding order. Each contributes a `texture_2d` + `sampler`. */
481
+ readonly extraTextures?: readonly BillboardCustomTexture[];
482
+ }
483
+
484
+ /** One extra texture bound after the atlas (group 1, bindings 3, 5, 7, …). */
485
+ export declare type BillboardCustomTexture = CustomShaderTexture;
486
+
487
+ /** Depth/blend pipeline path used by a billboard system: alpha-blended `transparent` or alpha-tested `cutout`. */
488
+ export declare type BillboardDepthMode = "transparent" | "cutout";
489
+
490
+ /** How a billboard orients itself: `facing` always faces the camera, `axis-locked` rotates only around a fixed axis. */
491
+ export declare type BillboardOrientation = "facing" | "axis-locked";
492
+
493
+ /** Stable identity for a single billboard sprite that survives swap-remove reindexing. */
494
+ export declare interface BillboardSpriteHandle {
1
495
  readonly system: BillboardSpriteSystem;
496
+ readonly id: number;
497
+ }
498
+
499
+ /** Initial properties for a single billboard sprite. */
500
+ export declare interface BillboardSpriteInit {
501
+ position: [number, number, number];
502
+ sizeWorld: [number, number];
503
+ frame?: number;
504
+ rotation?: number;
505
+ pivot?: [number, number];
506
+ color?: [number, number, number, number];
507
+ flipX?: boolean;
508
+ flipY?: boolean;
509
+ visible?: boolean;
510
+ }
511
+
512
+ declare interface BillboardSpriteSystem<TOrientation extends BillboardOrientation = BillboardOrientation> {
2
513
  readonly atlas: SpriteAtlas;
514
+ readonly blendMode: BillboardBlendMode;
515
+ alphaCutoff: number;
516
+ opacity: number;
517
+ visible: boolean;
518
+ readonly order: number;
519
+ readonly count: number;
3
520
  /**
521
+ * Per-system custom-shader params (`fx.params`); set via `setBillboardShaderParams`.
522
+ * **Absent** on plain systems (only allocated for custom-shader systems, or lazily by the setter).
523
+ */
524
+ shaderParams?: [number, number, number, number];
525
+ }
526
+
527
+ /** Optional configuration for a billboard sprite system. */
528
+ export declare interface BillboardSpriteSystemOptions {
529
+ capacity?: number;
530
+ blendMode?: BillboardBlendMode;
531
+ alphaCutoff?: number;
532
+ opacity?: number;
533
+ visible?: boolean;
534
+ order?: number;
535
+ /** Optional opt-in custom fragment shader (from `createBillboardCustomShader`). */
536
+ customShader?: BillboardCustomShader;
537
+ }
538
+
539
+ declare interface BindingDecl {
540
+
541
+ /** A post-process task that desaturates the image toward grayscale by `degree`. */
542
+ export declare interface BlackAndWhitePostProcessTask extends PostProcessTask {
543
+ degree: number;
544
+ }
545
+
546
+ /** Configuration for `createBlackAndWhitePostProcessTask`; `degree` is the desaturation strength (0 = color, 1 = full grayscale). */
547
+ export declare interface BlackAndWhitePostProcessTaskConfig extends Omit<PostProcessTaskConfig, "_shader"> {
548
+ degree?: number;
549
+ }
550
+
551
+ /** A block emitter — pure functions, no per-instance state. */
552
+ declare interface BlockEmitter {
553
+ /** Class name this emitter handles (e.g. "InputBlock"). */
554
+ readonly className: string;
555
+ /** Which shader stage this block produces into. Defaults to "fragment". */
556
+ readonly stage?: Stage;
557
+ /** Terminal "side-effect" block that has no outputs the graph reads (e.g.
558
+ * DiscardBlock). emitGraph force-emits these after the root walk so they
559
+ * participate even without a downstream consumer. */
560
+ readonly sideEffect?: boolean;
561
+ /** Emit the value of `outputName` for `block`, returning a typed WGSL expression. */
562
+ emit(block: NodeBlock, outputName: string, stage: Stage, state: NodeBuildState, ctx: NodeEmitContext): NodeExpr;
563
+ }
564
+
565
+ /** A composite post-process task that extracts highlights, blurs them, and merges the glow back over the source image. */
566
+ export declare interface BloomPostProcessTask extends Task, PostProcessTaskSettings {
567
+ readonly name: string;
568
+ sourceTexture: RenderTarget;
569
+ targetTexture: RenderTarget | null;
570
+ outputTexture: RenderTarget;
571
+ weight: number;
572
+ kernel: number;
573
+ threshold: number;
574
+ exposure: number;
575
+ readonly bloomScale: number;
576
+ /** Recompute and upload the uniforms of all sub-passes (extract, blur X/Y, merge) from current settings. */
577
+ updateUniforms(): void;
578
+ }
579
+
580
+ /** Configuration for `createBloomPostProcessTask`: highlight `threshold`/`exposure`, blur `kernel`, merge `weight`, and `bloomScale`. */
581
+ export declare interface BloomPostProcessTaskConfig extends PostProcessTaskSettings {
582
+ weight?: number;
583
+ kernel?: number;
584
+ threshold?: number;
585
+ exposure?: number;
586
+ bloomScale?: number;
587
+ }
588
+
589
+ /** A separable Gaussian blur post-process pass along a single `direction`. */
590
+ export declare interface BlurPostProcessTask extends PostProcessTask {
591
+ direction: PostProcessVec2;
592
+ kernel: number;
593
+ }
594
+
595
+ /** Configuration for `createBlurPostProcessTask`; `direction` is the blur axis and `kernel` the sample-window size in pixels. */
596
+ export declare interface BlurPostProcessTaskConfig extends Omit<PostProcessTaskConfig, "_shader"> {
597
+ direction?: PostProcessVec2;
598
+ kernel?: number;
599
+ }
600
+
601
+ /** Minimal camera contract — any camera that can provide view/projection matrices.
602
+ * Both ArcRotateCamera and FreeCamera implement this interface.
603
+ * Pure state, no scene knowledge (pillar 4b). */
604
+ export declare interface Camera {
605
+ fov: number;
606
+ nearPlane: number;
607
+ farPlane: number;
608
+ viewport?: NormalizedViewport;
609
+ children: SceneNode[];
610
+ readonly worldMatrix: Mat4;
611
+ readonly worldMatrixVersion: number;
612
+
613
+ /** Cap mode: close both ends of the tube/extrusion. */
614
+ export declare const CAP_ALL = 3;
615
+
616
+ /** Cap mode: close only the end of the tube/extrusion. */
617
+ export declare const CAP_END = 2;
618
+
619
+ /** Cap mode: no caps on either end of the tube/extrusion. */
620
+ export declare const CAP_NONE = 0;
621
+
622
+ /** Cap mode: close only the start of the tube/extrusion. */
623
+ export declare const CAP_START = 1;
624
+
625
+ /** A post-process task that offsets the red/green/blue channels to simulate lens chromatic aberration. */
626
+ export declare interface ChromaticAberrationPostProcessTask extends PostProcessTask {
627
+ aberrationAmount: number;
628
+ direction: PostProcessVec2_2;
629
+ radialIntensity: number;
630
+ centerPosition: PostProcessVec2_2;
631
+ }
632
+
633
+ /** Configuration for `createChromaticAberrationPostProcessTask`: shift `aberrationAmount`, `direction`, `radialIntensity`, and `centerPosition`. */
634
+ export declare interface ChromaticAberrationPostProcessTaskConfig extends Omit<PostProcessTaskConfig, "_shader"> {
635
+ aberrationAmount?: number;
636
+ direction?: PostProcessVec2_2;
637
+ radialIntensity?: number;
638
+ centerPosition?: PostProcessVec2_2;
639
+ }
640
+
641
+ /** Removes and disposes every task attached to `manager`. */
642
+ export declare function clearAnimationManager(manager: AnimationManager): void;
643
+
644
+ /**
645
+ * Removes every sprite from the system, resetting its count to zero.
646
+ * @param system - Billboard system to clear.
647
+ */
648
+ export declare function clearBillboardSprites(system: BillboardSpriteSystem): void;
649
+
650
+ /** Clearcoat layer properties. Maps to BJS PBRMaterial.clearCoat sub-object. */
651
+ export declare interface ClearCoatProps {
652
+ /** Whether clearcoat is active. Default false. */
653
+ isEnabled?: boolean;
654
+ /** Clearcoat layer intensity (0=off, 1=full). Default 1.0. */
655
+ intensity?: number;
656
+ /** Clearcoat layer roughness. Default 0.0 (perfectly smooth). */
657
+ roughness?: number;
658
+ /** Index of refraction of the clearcoat layer. Default 1.5. */
659
+ indexOfRefraction?: number;
660
+ /** Optional clearcoat intensity texture (R channel). Multiplies `intensity`. */
661
+ texture?: Texture2D;
662
+ /** Optional clearcoat roughness texture (G channel). Multiplies `roughness`. */
663
+ roughnessTexture?: Texture2D;
664
+ /** Optional clearcoat normal map (tangent-space). Used to perturb the coat
665
+ * layer normal independently of the base layer. */
666
+ bumpTexture?: Texture2D;
667
+ /** Clearcoat normal texture scale (glTF normalTexture.scale). Default 1.0. */
668
+ bumpTextureScale?: number;
669
+ /** Whether to remap base F0 across the clearcoat interface (CLEARCOAT_REMAP_F0).
670
+ * Matches BJS PBRClearCoatConfiguration.remapF0OnInterfaceChange.
671
+ * Default true. glTF loader sets this to false per KHR_materials_clearcoat. */
672
+ useF0Remap?: boolean;
673
+ }
674
+
675
+ /** Clear all sprites from a layer while preserving allocated capacity. */
676
+ export declare function clearSprite2DLayer(layer: Sprite2DLayer): void;
677
+
678
+ /**
679
+ * Removes every animation owned by the manager, leaving it empty.
680
+ * @param manager - Manager to clear.
681
+ */
682
+ export declare function clearSpriteAnimations(manager: SpriteAnimationManager): void;
683
+
684
+ /** A clipping plane expressed as the coefficients `[a, b, c, d]` of `a·x + b·y + c·z + d`. */
685
+ export declare type ClipPlane = readonly [number, number, number, number];
686
+
687
+ /** Deep-clone a SceneNode tree. Meshes are shallow-cloned (shared GPU buffers).
688
+ * Lights, cameras, and other non-mesh/non-TN children are shallow-cloned. */
689
+ export declare function cloneTransformNode(src: SceneNode): SceneNode;
690
+
691
+ export declare interface ClusteredLightContainer {
692
+ readonly kind: "clusteredLightContainer";
693
+ pointLights: ClusteredPointLight[];
694
+ horizontalTiles: number;
695
+ verticalTiles: number;
696
+ zSlices: number;
697
+
698
+ export declare interface ClusteredLightContainerOptions {
699
+ horizontalTiles?: number;
700
+ verticalTiles?: number;
701
+ zSlices?: number;
702
+ }
703
+
704
+ export declare interface ClusteredPointLight {
705
+ position: [number, number, number];
706
+ diffuse: [number, number, number];
707
+ range: number;
708
+ intensity: number;
709
+ }
710
+
711
+ export declare interface ClusteredPointLightOptions {
712
+ position: [number, number, number];
713
+ diffuse: [number, number, number];
714
+ range?: number;
715
+ intensity?: number;
716
+ }
717
+
718
+ /** Compute a path between two world positions, snapped to the navmesh. */
719
+ export declare function computePath(plugin: NavigationPlugin, start: Vec3, end: Vec3): Vec3[];
720
+
721
+ /**
722
+ * Create a post-process task that merges a left-eye texture with the source (right eye) into a red/cyan anaglyph.
723
+ * @param config - Source/target settings and the left-eye `leftTexture`.
724
+ * @param engine - The owning engine.
725
+ * @param scene - Optional owning scene. Omit for scene-less standalone frame graphs.
726
+ * @returns The anaglyph post-process task.
727
+ */
728
+ export declare function createAnaglyphPostProcessTask(config: AnaglyphPostProcessTaskConfig, engine: EngineContext, scene?: SceneContext): AnaglyphPostProcessTask;
729
+
730
+ /**
731
+ * Create a skeleton animation controller from parsed glTF animation data.
732
+ * Returns a tick function that advances the animation and uploads bone matrices.
733
+ */
734
+ export declare function createAnimationController(clip: AnimationClip, nodes: readonly NodeRest[], skeletons: readonly SkeletonBinding[], morphBindings: readonly MorphBinding[], nodeTargets?: readonly (AnimatedNodeTarget | undefined)[], excludedNodeIndices?: ReadonlySet<number>): AnimationController;
735
+
736
+ /** Create AnimationGroup(s) from parsed glTF animation data.
737
+ * Returns one group per animation clip. */
738
+ export declare function createAnimationGroups(animData: GltfAnimationData): AnimationGroup[];
739
+
740
+ /** Creates an animation manager with no tasks attached.
741
+ * @param options - Optional engine, fixed timestep, and update callback.
742
+ * @returns The new manager. */
743
+ export declare function createAnimationManager(options?: AnimationManagerOptions): AnimationManager;
744
+
745
+ /** Creates an animation task that invokes `update` each tick.
746
+ * @param update - Callback that advances the task by the frame delta.
747
+ * @param options - Optional category and dispose hook.
748
+ * @returns The new, active animation task. */
749
+ export declare function createAnimationTask(update: AnimationTaskUpdate, options?: AnimationTaskOptions): AnimationTask;
750
+
751
+ /** Create a bare ArcRotateCamera with given params. Pure data, no scene knowledge. */
752
+ export declare function createArcRotateCamera(alpha: number, beta: number, radius: number, target: Vec3): ArcRotateCamera;
753
+
754
+ /**
755
+ * Creates a billboard sprite system whose quads rotate only around a fixed world axis.
756
+ * @param atlas - Sprite atlas supplying frames.
757
+ * @param axis - Lock axis; normalized internally and must be non-zero and finite.
758
+ * @param opts - Optional capacity, blend, and appearance settings.
759
+ * @returns The new axis-locked billboard system.
760
+ * @throws If `axis` has non-finite components or is the zero vector.
761
+ */
762
+ export declare function createAxisLockedBillboardSystem(atlas: SpriteAtlas, axis: readonly [number, number, number], opts?: BillboardSpriteSystemOptions): AxisLockedBillboardSpriteSystem;
763
+
764
+ /**
765
+ * Build a custom-shader descriptor to pass as `customShader` when creating a billboard system.
766
+ * The descriptor is opaque; the pipeline consumes it lazily.
767
+ */
768
+ export declare function createBillboardCustomShader(options: BillboardCustomShaderOptions): BillboardCustomShader;
769
+
770
+ /**
771
+ * Create a post-process task that blends the image toward grayscale.
772
+ * @param config - Source/target settings and desaturation `degree`.
773
+ * @param engine - The owning engine.
774
+ * @param scene - Optional owning scene. Omit for scene-less standalone frame graphs.
775
+ * @returns The black-and-white post-process task.
776
+ */
777
+ export declare function createBlackAndWhitePostProcessTask(config: BlackAndWhitePostProcessTaskConfig, engine: EngineContext, scene?: SceneContext): BlackAndWhitePostProcessTask;
778
+
779
+ /**
780
+ * Create a bloom post-process task by chaining highlight extraction, separable blur, and a merge pass.
781
+ * @param config - Bloom parameters and source/target settings.
782
+ * @param engine - The owning engine.
783
+ * @param scene - Optional owning scene. Omit for scene-less standalone frame graphs.
784
+ * @returns The bloom post-process task.
785
+ */
786
+ export declare function createBloomPostProcessTask(config: BloomPostProcessTaskConfig, engine: EngineContext, scene?: SceneContext): BloomPostProcessTask;
787
+
788
+ /**
789
+ * Create a separable Gaussian blur post-process task. Apply twice (horizontal then vertical) for a full 2D blur.
790
+ * @param config - Blur direction, kernel size, and source/target settings.
791
+ * @param engine - The owning engine.
792
+ * @param scene - Optional owning scene. Omit for scene-less standalone frame graphs.
793
+ * @returns The blur post-process task.
794
+ */
795
+ export declare function createBlurPostProcessTask(config: BlurPostProcessTaskConfig, engine: EngineContext, scene?: SceneContext): BlurPostProcessTask;
796
+
797
+ /** Create a box mesh. Caller must assign material. */
798
+ export declare function createBox(engine: EngineContext, size?: number): Mesh;
799
+
800
+ /**
801
+ * Create a post-process task that simulates chromatic aberration by shifting color channels outward from a center point.
802
+ * @param config - Aberration parameters and source/target settings.
803
+ * @param engine - The owning engine.
804
+ * @param scene - Optional owning scene. Omit for scene-less standalone frame graphs.
805
+ * @returns The chromatic-aberration post-process task.
806
+ */
807
+ export declare function createChromaticAberrationPostProcessTask(config: ChromaticAberrationPostProcessTaskConfig, engine: EngineContext, scene?: SceneContext): ChromaticAberrationPostProcessTask;
808
+
809
+ /**
810
+ * Builds a {@link Csg2Solid} from a mesh's CPU geometry, baking its world transform.
811
+ * @param mesh - Source mesh; must retain CPU positions, normals, and indices.
812
+ * @param materialSlot - Material slot index (0 to 65535) tagged onto the solid's triangles.
813
+ * @returns A CSG2 solid; call {@link disposeCsg2} when finished to free WASM memory.
814
+ */
815
+ export declare function createCsg2FromMesh(mesh: Mesh, materialSlot?: number): Csg2Solid;
816
+
817
+ /**
818
+ * Builds a {@link CsgSolid} from a mesh's CPU geometry, baking its world transform.
819
+ * @param mesh - Source mesh; must retain CPU positions, normals, and indices.
820
+ * @param materialSlot - Material slot index tagged onto every generated polygon.
821
+ * @returns A CSG solid usable with {@link csgUnion}, {@link csgSubtract}, and {@link csgIntersect}.
822
+ */
823
+ export declare function createCsgFromMesh(mesh: Mesh, materialSlot?: number): CsgSolid;
824
+
825
+ /** Create a cylinder (or cone / truncated cone / prism) mesh. Caller must assign material. */
826
+ export declare function createCylinder(engine: EngineContext, options?: CylinderOptions): Mesh;
827
+
828
+ /**
829
+ * Extract debug visualization geometry from the generated navmesh.
830
+ * Faces are detached (each triangle gets its own 3 vertices) and per-vertex
831
+ * normals are set to the face normal — yielding flat shading without the need
832
+ * for a separate normal-computation pass in callers.
833
+ * Returns positions, normals, indices, and a hash of the positions for
834
+ * cross-engine parity checks.
835
+ */
836
+ export declare function createDebugNavMeshGeometry(plugin: NavigationPlugin): {
837
+ positions: Float32Array;
838
+ normals: Float32Array;
839
+ indices: Uint32Array;
840
+ positionsHash: number;
841
+ };
842
+
843
+ /** Create an ArcRotateCamera framed to fit all loaded meshes, assign it to scene.
844
+ * Only the scene knows its contents — auto-framing logic lives here.
845
+ * Matches Babylon.js createDefaultCameraOrLight(true, true, true). */
846
+ export declare function createDefaultCamera(scene: SceneContext): ArcRotateCamera;
847
+
848
+ /**
849
+ * Creates a directional light shining along `direction` (a parallel light source, like the sun).
850
+ * @param direction - World-space direction the light travels along.
851
+ * @param intensity - Scalar multiplier applied to the light's diffuse and specular contribution.
852
+ * @returns Plain `DirectionalLight` data to be added to a scene via `addToScene`.
853
+ */
854
+ export declare function createDirectionalLight(direction: [number, number, number], intensity?: number): DirectionalLight;
855
+
856
+ /** Create a disc (or ring / pie slice via `arc`). Caller must assign material. */
857
+ export declare function createDisc(engine: EngineContext, options?: DiscOptions): Mesh;
858
+
859
+ /**
860
+ * Create an `EffectRenderer` that draws `effect` as a fullscreen pass to the
861
+ * swapchain each frame. The renderer owns a swapchain `RenderTarget` and
862
+ * implements `RenderingContext` directly — no `SceneContext` is needed.
863
+ *
864
+ * Call `registerEffectRenderer` to start rendering, `unregisterEffectRenderer`
865
+ * to pause, and `disposeEffectRenderer` to free GPU resources.
866
+ */
867
+ export declare function createEffectRenderer(engine: EngineContext, effect: EffectWrapper, options?: EffectRendererOptions): EffectRenderer;
868
+
869
+ /**
870
+ * Create a frame-graph task that draws an effect as a fullscreen pass into `config.target`.
871
+ * @param config - The effect, target, and clear settings.
872
+ * @param engine - The owning engine.
873
+ * @param scene - Optional owning scene. Omit for scene-less standalone frame graphs.
874
+ * @returns The render task to add to a frame graph.
875
+ */
876
+ export declare function createEffectRenderTask(config: EffectRenderTaskConfig, engine: EngineContext, scene?: SceneContext): EffectRenderTask;
877
+
878
+ /**
879
+ * Create an `EffectWrapper` for the given engine, allocating uniform buffers and
880
+ * texture slots from `options.bindings`.
881
+ * @param engine - The engine that owns the GPU resources.
882
+ * @param options - Shader source and binding layout for the effect.
883
+ * @returns The new effect wrapper.
884
+ */
885
+ export declare function createEffectWrapper(engine: EngineContext, options: EffectWrapperOptions): EffectWrapper;
886
+
887
+ /** Create the Babylon Lite engine. Acquires GPU adapter + device, configures swapchain.
888
+ * Accepts either a DOM canvas (main thread) or an `OffscreenCanvas` (e.g. transferred to
889
+ * a Web Worker) — see {@link RenderCanvas}. */
890
+ export declare function createEngine(canvas: RenderCanvas, options?: EngineOptions): Promise<EngineContext>;
891
+
892
+ /**
893
+ * Creates an exponential shadow map (ESM) shadow generator for a directional light,
894
+ * including the depth, blur, and final ESM textures plus the per-frame render task hooks.
895
+ * @param engine - The engine providing the GPU device.
896
+ * @param _light - The directional light that casts the shadows.
897
+ * @param cfg - Optional shadow-map, blur, and projection configuration.
898
+ * @returns A `ShadowGenerator` wired to the directional ESM render path.
899
+ */
900
+ export declare function createEsmDirectionalShadowGenerator(engine: EngineContext, _light: DirectionalLight, cfg?: EsmDirectionalShadowGeneratorConfig): ShadowGenerator;
901
+
902
+ /**
903
+ * Create a post-process task that isolates bright highlights above a luminance threshold (used as the first stage of bloom).
904
+ * @param config - Threshold/exposure parameters and source/target settings.
905
+ * @param engine - The owning engine.
906
+ * @param scene - Optional owning scene. Omit for scene-less standalone frame graphs.
907
+ * @returns The extract-highlights post-process task.
908
+ */
909
+ export declare function createExtractHighlightsPostProcessTask(config: ExtractHighlightsPostProcessTaskConfig, engine: EngineContext, scene?: SceneContext): ExtractHighlightsPostProcessTask;
910
+
911
+ /** Create an extruded shape (2D shape swept along a path). Caller must assign material. */
912
+ export declare function createExtrudeShape(engine: EngineContext, options: ExtrudeShapeOptions): Mesh;
913
+
914
+ /**
915
+ * Creates a camera-facing billboard sprite system backed by the given atlas.
916
+ * @param atlas - Sprite atlas supplying frames.
917
+ * @param opts - Optional capacity, blend, and appearance settings.
918
+ * @returns The new facing billboard system.
919
+ */
920
+ export declare function createFacingBillboardSystem(atlas: SpriteAtlas, opts?: BillboardSpriteSystemOptions): FacingBillboardSpriteSystem;
921
+
922
+ /** Create a scene-less frame-graph context for fullscreen effects and post-process chains. */
923
+ export declare function createFrameGraphContext(engine: EngineContext, options?: FrameGraphContextOptions): FrameGraphContext;
924
+
925
+ /** Create a FreeCamera at the given position looking at target. Pure data, no scene knowledge. */
926
+ export declare function createFreeCamera(position: Vec3, target: Vec3): FreeCamera;
927
+
928
+ /** Create a GPU picker bound to the given scene. */
929
+ export declare function createGpuPicker(scene: SceneContext): GpuPicker;
930
+
931
+ /**
932
+ * Create a Babylon.js-equivalent `GridMaterial`: an unlit, procedural object-space
933
+ * grid built on top of {@link createShaderMaterial}. The grid math runs entirely in
934
+ * object space — the vertex stage forwards object-space position and normal, and the
935
+ * fragment stage derives per-axis line contributions weighted by the normal.
936
+ *
937
+ * @param options - Grid appearance and blend options.
938
+ * @returns A configured {@link ShaderMaterial}.
939
+ */
940
+ export declare function createGridMaterial(options?: GridMaterialOptions): ShaderMaterial;
941
+
942
+ /**
943
+ * Build a `SpriteAtlas` from a uniform grid over an existing texture. All
944
+ * cells share the supplied pivot. Frames are emitted row-major (top-left
945
+ * first). No name lookup map is populated because grid cells have no names.
946
+ */
947
+ export declare function createGridSpriteAtlas(texture: Texture2D, options: GridAtlasOptions): SpriteAtlas;
948
+
949
+ /** Create a flat ground mesh. Caller must assign material. */
950
+ export declare function createGround(engine: EngineContext, options?: GroundOptions): Mesh;
951
+
952
+ /** Create a ground mesh from a heightmap URL. Caller must assign material. */
953
+ export declare function createGroundFromHeightMap(engine: EngineContext, url: string, options: GroundOptions): Promise<Mesh>;
954
+
955
+ /**
956
+ * Create a Havok physics world and register per-frame stepping on the scene.
957
+ *
958
+ * The caller is responsible for loading the WASM binary externally:
959
+ * ```ts
960
+ * import HavokPhysics from "@babylonjs/havok";
961
+ * const hknp = await HavokPhysics({ locateFile: () => "/HavokPhysics.wasm" });
962
+ * const world = createHavokWorld(scene, hknp);
963
+ * ```
964
+ */
965
+ export declare function createHavokWorld(scene: SceneContext, hknp: any, gravity?: Vec3): PhysicsWorld;
966
+
967
+ /** Create a hemispheric light. Returns plain data — caller adds to scene.
968
+ * Matches Babylon.js HemisphericLight behavior. */
969
+ export declare function createHemisphericLight(direction?: [number, number, number], intensity?: number): HemisphericLight;
970
+
971
+ /**
972
+ * Create a frame-graph task that applies the scene's image-processing settings
973
+ * (exposure, contrast, tone mapping) to a color source and draws it to the swapchain.
974
+ * @param config - The color source to process.
975
+ * @param engine - The owning engine.
976
+ * @param scene - The scene whose `imageProcessing` settings drive the effect.
977
+ * @returns The task to add to the frame graph.
978
+ */
979
+ export declare function createImageProcessingTask(config: ImageProcessingTaskConfig, engine: EngineContext, scene: SceneContext): Task;
980
+
981
+ /** Create a linear-depth ShaderMaterial that writes `(d, d, d, 1)` per fragment.
982
+ * The depth is computed from the view-space z, normalized by the supplied
983
+ * near/far range (or 0.03/15 by default). Override per material via the
984
+ * `nearFar` custom uniform. */
985
+ export declare function createLinearDepthMaterial(options?: LinearDepthMaterialOptions): ShaderMaterial;
986
+
987
+ /** Create a material view that references source state and overrides render features exactly. */
988
+ export declare function createMaterialView(source: Material, renderFeatures: MaterialRenderFeatures): MaterialView;
989
+
990
+ /**
991
+ * Triangulates a {@link Csg2Solid} into one mesh per material slot.
992
+ * @param materials - Materials indexed by the material slots assigned during construction.
993
+ * @param name - Base name; each sub-mesh is suffixed with its slot index.
994
+ * @returns One mesh per distinct material slot, each assigned its corresponding material.
995
+ */
996
+ export declare function createMeshesFromCsg2(engine: EngineContext, solid: Csg2Solid, materials: readonly Material[], name?: string): Mesh[];
997
+
998
+ /**
999
+ * Triangulates a {@link CsgSolid} into a single renderable mesh.
1000
+ * @param name - Name for the created mesh.
1001
+ */
1002
+ export declare function createMeshFromCsg(engine: EngineContext, solid: CsgSolid, name?: string): Mesh;
1003
+
1004
+ /**
1005
+ * Triangulates a {@link Csg2Solid} into a single renderable mesh.
1006
+ * @param name - Name for the created mesh.
1007
+ */
1008
+ export declare function createMeshFromCsg2(engine: EngineContext, solid: Csg2Solid, name?: string): Mesh;
1009
+
1010
+ /** Create a Mesh from raw geometry data + GPU device.
1011
+ * No material is assigned — the caller must set mesh.material before adding to scene. */
1012
+ export declare function createMeshFromData(engine: EngineContext, name: string, positions: Float32Array, normals: Float32Array, indices: Uint32Array, uvs?: Float32Array, uvs2?: Float32Array, tangents?: Float32Array, colors?: Float32Array): Mesh;
1013
+
1014
+ /** Create morph target GPU data from parsed glTF targets.
1015
+ * @param engine - Engine context (provides GPU device)
1016
+ * @param targets - Array of `{positions, normals}` deltas per target
1017
+ * @param vertexCount - Number of vertices in the base mesh
1018
+ * @param morphWeights - Initial morph weights (one per target, may be null)
1019
+ */
1020
+ export declare function createMorphTargets(engine: EngineContext, targets: {
1021
+ positions: Float32Array;
1022
+ normals: Float32Array | null;
1023
+ }[], vertexCount: number, morphWeights: number[] | null): MorphTargetData;
1024
+
1025
+ /**
1026
+ * Create a crowd attached to the navmesh. The crowd is NOT auto-updated;
1027
+ * call `updateNavCrowd(crowd, dt)` each frame for full determinism.
1028
+ */
1029
+ export declare function createNavCrowd(plugin: NavigationPlugin, maxAgents: number, maxAgentRadius: number): NavCrowd;
1030
+
1031
+ /**
1032
+ * Create a navigation plugin. Loads the Recast wasm internally on first call;
1033
+ * subsequent calls reuse the loaded module.
1034
+ *
1035
+ * Pass `locateFile` to serve the wasm from a public path instead of bundling
1036
+ * it inline — same pattern as `HavokPhysics({ locateFile: () => "/HavokPhysics.wasm" })`.
1037
+ *
1038
+ * @example
1039
+ * ```ts
1040
+ * const nav = await createNavigationPluginAsync({ locateFile: () => "/recast-navigation.wasm" });
1041
+ * ```
1042
+ */
1043
+ export declare function createNavigationPluginAsync(options?: {
1044
+ locateFile?: (url: string) => string;
1045
+ }): Promise<NavigationPlugin>;
1046
+
1047
+ /**
1048
+ * Build a navmesh from one or more meshes. Each mesh's CPU positions are
1049
+ * transformed by its worldMatrix (matching BJS GetPositionsAndIndices), merged
1050
+ * into a single stream, and index winding is reversed (left-handed convention)
1051
+ * unless `doNotReverseIndices` is set.
1052
+ *
1053
+ * - Solo navmesh by default.
1054
+ * - If `maxObstacles > 0`, builds a tile-cache navmesh so obstacles can be
1055
+ * added/removed dynamically.
1056
+ * - Off-mesh connections can be supplied for either solo or tile-cache.
1057
+ */
1058
+ export declare function createNavMesh(plugin: NavigationPlugin, meshes: Mesh[], params: NavMeshParameters): void;
1059
+
1060
+ /** Create a no-color view over a NodeMaterial source. */
1061
+ export declare function createNodeNoColorMaterialView(source: NodeMaterial): MaterialView;
1062
+
1063
+ /** Create a PbrMaterialProps with optional overrides. */
1064
+ export declare function createPbrMaterial(props?: Partial<PbrMaterialProps>): PbrMaterialProps;
1065
+
1066
+ /** Create a no-color view over a PBR source material.
1067
+ * The view references the source; material state is never copied. */
1068
+ export declare function createPbrNoColorMaterialView(source: PbrMaterialProps): MaterialView;
1069
+
1070
+ /**
1071
+ * Creates a PCF (percentage-closer filtering) shadow generator for a directional light,
1072
+ * using an orthographic projection auto-fit to the caster meshes' world AABBs.
1073
+ * @param engine - The engine providing the GPU device.
1074
+ * @param _light - The directional light that casts the shadows.
1075
+ * @param cfg - Optional shadow-map and projection configuration.
1076
+ * @returns A `ShadowGenerator` wired to the directional PCF render path.
1077
+ */
1078
+ export declare function createPcfDirectionalShadowGenerator(engine: EngineContext, _light: DirectionalLight, cfg?: PcfDirectionalShadowGeneratorConfig): ShadowGenerator;
1079
+
1080
+ /**
1081
+ * Creates a PCF (percentage-closer filtering) shadow generator for a spot light, using a
1082
+ * perspective projection derived from the light's cone angle.
1083
+ * @param engine - The engine providing the GPU device.
1084
+ * @param _light - The spot light that casts the shadows.
1085
+ * @param cfg - Optional shadow-map and projection configuration.
1086
+ * @returns A `ShadowGenerator` wired to the spot-light PCF render path.
1087
+ */
1088
+ export declare function createPcfSpotlightShadowGenerator(engine: EngineContext, _light: SpotLight, cfg?: PcfSpotlightShadowGeneratorConfig): ShadowGenerator;
1089
+
1090
+ /**
1091
+ * Create a physics aggregate: body + shape + material wired together.
1092
+ * `mass === 0` → STATIC, `mass > 0` → DYNAMIC.
1093
+ * Shape geometry is auto-sized from the mesh bounding box when not specified.
1094
+ */
1095
+ export declare function createPhysicsAggregate(world: PhysicsWorld, node: Mesh, type: PhysicsShapeType, options: PhysicsAggregateOptions): PhysicsAggregate;
1096
+
1097
+ /**
1098
+ * Creates a rigid body bound to a scene node, adds it to the world, and seeds it with the node's transform.
1099
+ * @param world - The physics world.
1100
+ * @param node - The scene node the body follows / drives.
1101
+ * @param motionType - Whether the body is static, animated (kinematic), or dynamic.
1102
+ * @param startsAsleep - When true, the body is added in a sleeping state.
1103
+ * @returns The created physics body handle.
1104
+ */
1105
+ export declare function createPhysicsBody(world: PhysicsWorld, node: SceneNode, motionType: PhysicsMotionType, startsAsleep?: boolean): PhysicsBody;
1106
+
1107
+ /**
1108
+ * Creates a collision shape (sphere, box, capsule, or cylinder) from the given options.
1109
+ * @param world - The physics world.
1110
+ * @param options - The shape type and its geometry parameters.
1111
+ * @returns The created shape handle.
1112
+ */
1113
+ export declare function createPhysicsShape(world: PhysicsWorld, options: PhysicsShapeOptions): PhysicsShape;
1114
+
1115
+ /** Create a plane (unit quad facing -Z). Caller must assign material. */
1116
+ export declare function createPlane(engine: EngineContext, options?: PlaneOptions): Mesh;
1117
+
1118
+ /**
1119
+ * Creates a point light that emits in all directions from `position` with distance falloff.
1120
+ * @param position - World-space position of the light.
1121
+ * @param intensity - Scalar multiplier applied to the light's diffuse and specular contribution.
1122
+ * @returns Plain `PointLight` data to be added to a scene via `addToScene`.
1123
+ */
1124
+ export declare function createPointLight(position: [number, number, number], intensity?: number): PointLight;
1125
+
1126
+ /** Create a polyhedron (15 presets). Caller must assign material. */
1127
+ export declare function createPolyhedron(engine: EngineContext, options?: PolyhedronOptions): Mesh;
1128
+
1129
+ /**
1130
+ * Creates a Gaussian Splatting mesh with `splatCount` placeholder splats and attaches
1131
+ * it to the scene's render pipeline. Useful for procedurally filling splat data later.
1132
+ * @param scene - Scene that owns and renders the mesh.
1133
+ * @param name - Mesh name.
1134
+ * @param splatCount - Number of splats to allocate.
1135
+ * @param fragments - Optional custom shader fragments for the splat material.
1136
+ * @returns The created, scene-attached Gaussian Splatting mesh.
1137
+ */
1138
+ export declare function createProceduralGaussianSplattingMesh(scene: SceneContext, name: string, splatCount: number, fragments?: readonly GsShaderFragment[]): GaussianSplattingMesh;
1139
+
1140
+ /** Compiles a set of track definitions into a reusable {@link PropertyAnimationClip}.
1141
+ * @param name - Clip name.
1142
+ * @param tracks - One or more track definitions; their keyframes are sorted and baked into samplers.
1143
+ * @param options - Optional default frame rate.
1144
+ * @returns The compiled clip, with its duration set to the longest track.
1145
+ * @throws If no tracks are provided. */
1146
+ export declare function createPropertyAnimationClip(name: string, tracks: readonly PropertyAnimationTrackOptions[], options?: PropertyAnimationClipOptions): PropertyAnimationClip;
1147
+
1148
+ /** Binds `clip` to `target`'s properties, creates a playing animation group, and attaches it to `manager`.
1149
+ * @param manager - Animation manager that drives the resulting group.
1150
+ * @param target - Object whose properties (resolved by each track's dotted path) are animated.
1151
+ * @param clip - Compiled clip to play.
1152
+ * @param options - Optional looping, speed, and play-range overrides.
1153
+ * @returns The started animation group.
1154
+ * @throws If the resolved play range does not have `toTime` greater than `fromTime`. */
1155
+ export declare function createPropertyAnimationGroup(manager: AnimationManager, target: object, clip: PropertyAnimationClip, options?: CreatePropertyAnimationGroupOptions): AnimationGroup;
1156
+
1157
+ /** Options for {@link createPropertyAnimationGroup}, controlling looping, speed, and play range. */
1158
+ export declare interface CreatePropertyAnimationGroupOptions {
1159
+ readonly loop?: boolean;
1160
+ readonly speedRatio?: number;
1161
+ readonly fromFrame?: number;
1162
+ readonly toFrame?: number;
1163
+ readonly fromTime?: number;
1164
+ readonly toTime?: number;
1165
+ }
1166
+
1167
+ /** Create a render target descriptor (GPU textures allocated by `buildRenderTarget`). */
1168
+ export declare function createRenderTarget(descriptor: RenderTargetDescriptor): RenderTarget;
1169
+
1170
+ /** Eagerly allocate a render target's GPU textures and return a sampled-texture
1171
+ * view of the color attachment, or the depth attachment for depth-only targets.
1172
+ * Marks the RT so `buildRenderTarget` won't realloc.
1173
+ *
1174
+ * The descriptor's size MUST be fixed (not `"canvas"`) because the canvas size
1175
+ * may change before the frame graph builds, which would invalidate the eagerly-
1176
+ * created texture handle that downstream bind groups have already captured. */
1177
+ export declare function createRenderTargetTexture(engine: EngineContext, descriptor: RenderTargetDescriptor): {
1178
+ rt: RenderTarget;
1179
+ texture: Texture2D;
1180
+ };
1181
+
1182
+ /** Create a render pass task. GPU resources (target textures + descriptor)
1183
+ * are not allocated until `record()` runs (via `frameGraph.build()`).
1184
+ *
1185
+ * Swapchain-targeted tasks acquire the swap view per-frame at execute time. */
1186
+ export declare function createRenderTask(config: RenderTaskConfig, engine: EngineContext, scene: SceneContext): RenderTask;
1187
+
1188
+ /** Create a ribbon from an array of parallel Vec3 paths. Caller must assign material. */
1189
+ export declare function createRibbon(engine: EngineContext, options: RibbonOptions): Mesh;
1190
+
1191
+ /** Create an empty scene context bound to the given engine. */
1192
+ export declare function createSceneContext(engine: EngineContext, options?: SceneContextOptions): SceneContext;
1193
+
1194
+ /** Create a ShaderMaterial from WGSL sources and declarations, validating
1195
+ * attributes, uniforms, samplers, and defines.
1196
+ * @param options - Sources, attributes, uniforms, samplers, defines, and render state.
1197
+ * @returns The constructed `ShaderMaterial`. */
1198
+ export declare function createShaderMaterial(options: ShaderMaterialOptions): ShaderMaterial;
1199
+
1200
+ /** Create a 1×1 solid-color `Texture2D` from straight RGBA components in [0, 1].
1201
+ * @param engine - Engine context.
1202
+ * @param r - Red channel (0–1).
1203
+ * @param g - Green channel (0–1).
1204
+ * @param b - Blue channel (0–1).
1205
+ * @param a - Alpha channel (0–1). Default 1.0.
1206
+ * @returns A bilinear-sampled `Texture2D` backed by a tiny GPU texture. */
1207
+ export declare function createSolidTexture2D(engine: EngineContext, r: number, g: number, b: number, a?: number): Texture2D;
1208
+
1209
+ /** Create a sphere mesh. Caller must assign material. */
1210
+ export declare function createSphere(engine: EngineContext, options?: SphereOptions): Mesh;
1211
+
1212
+ /** Generate UV sphere geometry matching Babylon's CreateSphere exactly.
1213
+ * Babylon uses: totalZ = 2 + segments rows, totalY = 2 * totalZ columns.
1214
+ * Default: 32 segments → 35×69 = 2415 vertices. */
1215
+ export declare function createSphereData(options?: SphereOptions): SphereMeshData;
1216
+
1217
+ /**
1218
+ * Creates a spot light: a cone of light from `position` aimed along `direction`.
1219
+ * @param position - World-space position of the light.
1220
+ * @param direction - World-space direction the cone points along.
1221
+ * @param angle - Full cone angle in radians.
1222
+ * @param exponent - Falloff exponent; higher values produce a sharper edge.
1223
+ * @param intensity - Scalar multiplier applied to the light's diffuse and specular contribution.
1224
+ * @returns Plain `SpotLight` data to be added to a scene via `addToScene`.
1225
+ */
1226
+ export declare function createSpotLight(position: [number, number, number], direction: [number, number, number], angle: number, exponent: number, intensity?: number): SpotLight;
1227
+
1228
+ /**
1229
+ * Create a custom fragment shader for a sprite layer. Pass the result as the `customShader`
1230
+ * option of `createSprite2DLayer`. See the module-level docs for the WGSL contract.
1231
+ */
1232
+ export declare function createSprite2DCustomShader(options: Sprite2DCustomShaderOptions): Sprite2DCustomShader;
1233
+
1234
+ /** Create a new (empty) `Sprite2DLayer` backed by `atlas`. */
1235
+ export declare function createSprite2DLayer(atlas: SpriteAtlas, opts?: Sprite2DLayerOptions): Sprite2DLayer;
1236
+
1237
+ /**
1238
+ * Creates an empty sprite animation manager.
1239
+ * @param options - Optional fixed time step and per-tick update callback.
1240
+ * @returns The new manager.
1241
+ */
1242
+ export declare function createSpriteAnimationManager(options?: SpriteAnimationManagerOptions): SpriteAnimationManager;
1243
+
1244
+ /**
1245
+ * Pack `sources` into a single `SpriteAtlas`. Shelf-packs in input order: each
1246
+ * frame is placed left-to-right on the current shelf, wrapping to a new shelf
1247
+ * (row) when it would overflow `maxWidthPx`. The texture is sized exactly to the
1248
+ * packed content.
1249
+ */
1250
+ export declare function createSpriteAtlasFromFrames(engine: EngineContext, sources: readonly SpriteAtlasFrameSource[], options?: SpriteAtlasPackOptions): SpriteAtlas;
1251
+
1252
+ /**
1253
+ * Creates a sprite frame animation and immediately shows its first frame.
1254
+ * @param target - Sprite the animation drives.
1255
+ * @param from - First frame index of the range.
1256
+ * @param to - Last frame index of the range; may be less than `from` to play in reverse.
1257
+ * @param loop - When `true`, the animation restarts after reaching `to`.
1258
+ * @param delayMs - Delay in milliseconds between frame steps.
1259
+ * @param options - Optional end callback and removal behaviour.
1260
+ * @returns The new animation, not yet attached to any manager.
1261
+ * @throws If `from` or `to` is not finite.
1262
+ */
1263
+ export declare function createSpriteFrameAnimation(target: SpriteAnimationTarget, from: number, to: number, loop: boolean, delayMs: number, options?: PlaySpriteAnimationOptions): SpriteFrameAnimation;
1264
+
1265
+ /** Create a `SpriteRenderer` for `engine`, pre-warming pipelines for the layers' blend modes. */
1266
+ export declare function createSpriteRenderer(engine: EngineContext, opts: SpriteRendererOptions): SpriteRenderer;
1267
+
1268
+ /** Create StandardMaterial with Babylon defaults. */
1269
+ export declare function createStandardMaterial(): StandardMaterialProps;
1270
+
1271
+ /** Create a no-color view over a Standard source material.
1272
+ * The view references the source; material state is never copied. */
1273
+ export declare function createStandardNoColorMaterialView(source: StandardMaterialProps): MaterialView;
1274
+
1275
+ /**
1276
+ * Create a `Texture2D` from a tightly-packed RGBA8 byte buffer.
1277
+ *
1278
+ * @param engine - Engine context.
1279
+ * @param data - `width * height * 4` bytes, row-major, top-to-bottom, straight alpha.
1280
+ * @param width - Texture width in pixels (\>= 1).
1281
+ * @param height - Texture height in pixels (\>= 1).
1282
+ * @param options - Sampler / format overrides.
1283
+ */
1284
+ export declare function createTexture2DFromPixels(engine: EngineContext, data: Uint8Array, width: number, height: number, options?: PixelsTexture2DOptions): Texture2D;
1285
+
1286
+ /** Create a torus mesh. Caller must assign material. */
1287
+ export declare function createTorus(engine: EngineContext, options?: TorusOptions): Mesh;
1288
+
1289
+ /** Create a TransformNode (SceneNode) with TRS values and lazy world matrix.
1290
+ * Parameters: name, position (px,py,pz), rotation quaternion (qx,qy,qz,qw), scaling (sx,sy,sz). */
1291
+ export declare function createTransformNode(name: string, px?: number, py?: number, pz?: number, qx?: number, qy?: number, qz?: number, qw?: number, sx?: number, sy?: number, sz?: number): TransformNode;
1292
+
1293
+ /** Create a tube (circular cross-section swept along a path). Caller must assign material. */
1294
+ export declare function createTube(engine: EngineContext, options: TubeOptions): Mesh;
1295
+
1296
+ /**
1297
+ * Create a frame-graph task that draws a uniform-only effect as a fullscreen pass into `config.target`.
1298
+ * @param config - The effect, target, and clear settings.
1299
+ * @param engine - The owning engine.
1300
+ * @param scene - Optional owning scene. Omit for scene-less standalone frame graphs.
1301
+ * @returns The render task to add to a frame graph.
1302
+ */
1303
+ export declare function createUniformEffectRenderTask(config: UniformEffectRenderTaskConfig, engine: EngineContext, scene?: SceneContext): UniformEffectRenderTask;
1304
+
1305
+ /**
1306
+ * Create a lightweight fullscreen effect with exactly one uniform buffer at binding 0.
1307
+ * @param engine - The engine that owns the GPU resources.
1308
+ * @param options - Shader source and uniform-buffer byte length.
1309
+ * @returns The new uniform effect wrapper.
1310
+ */
1311
+ export declare function createUniformEffectWrapper(engine: EngineContext, options: UniformEffectWrapperOptions): UniformEffectWrapper;
1312
+
1313
+ /** Cross-fades from `fromGroup` to `toGroup`, fading the first to weight 0 and the second to `options.toWeight` (default 1). */
1314
+ export declare function crossFadeAnimationGroups(manager: AnimationManager, fromGroup: AnimationGroup, toGroup: AnimationGroup, options: CrossFadeAnimationGroupsOptions): void;
1315
+
1316
+ /** Options for {@link crossFadeAnimationGroups}. */
1317
+ export declare interface CrossFadeAnimationGroupsOptions {
1318
+ readonly durationMs: number;
1319
+ readonly toWeight?: number;
1320
+ }
1321
+
1322
+ /** Returns the boolean union (`a` ∪ `b`) of two solids as a new solid. */
1323
+ export declare function csg2Add(a: Csg2Solid, b: Csg2Solid): Csg2Solid;
1324
+
1325
+ /** Returns the boolean intersection (`a` ∩ `b`) of two solids as a new solid. */
1326
+ export declare function csg2Intersect(a: Csg2Solid, b: Csg2Solid): Csg2Solid;
1327
+
1328
+ /** A manifold-3d backed CSG solid for high-precision boolean mesh operations. */
1329
+ export declare interface Csg2Solid {
1330
+ readonly [csg2SolidBrand]: true;
1331
+
1332
+ declare const csg2SolidBrand: unique symbol;
1333
+
1334
+ /** Returns the boolean difference (`a` − `b`) of two solids as a new solid. */
1335
+ export declare function csg2Subtract(a: Csg2Solid, b: Csg2Solid): Csg2Solid;
1336
+
1337
+ /**
1338
+ * Returns the boolean intersection (`a` ∩ `b`) of two solids.
1339
+ * @returns A new solid; inputs are not modified.
1340
+ */
1341
+ export declare function csgIntersect(a: CsgSolid, b: CsgSolid): CsgSolid;
1342
+
1343
+ /** An immutable BSP-based CSG solid (set of polygons) for boolean mesh operations. */
1344
+ export declare interface CsgSolid {
1345
+ readonly [csgSolidBrand]: true;
1346
+
1347
+ declare const csgSolidBrand: unique symbol;
1348
+
1349
+ /**
1350
+ * Returns the boolean difference (`a` − `b`) of two solids.
1351
+ * @returns A new solid; inputs are not modified.
1352
+ */
1353
+ export declare function csgSubtract(a: CsgSolid, b: CsgSolid): CsgSolid;
1354
+
1355
+ /**
1356
+ * Returns the boolean union (`a` ∪ `b`) of two solids.
1357
+ * @returns A new solid; inputs are not modified.
1358
+ */
1359
+ export declare function csgUnion(a: CsgSolid, b: CsgSolid): CsgSolid;
1360
+
1361
+ /** One extra texture bound after the atlas. In WGSL it becomes `<name>Tex` + `<name>Samp`. */
1362
+ export declare interface CustomShaderTexture {
1363
+ /** Identifier used in WGSL: becomes `<name>Tex` (texture) and `<name>Samp` (sampler). */
1364
+ readonly name: string;
1365
+ readonly texture: Texture2D;
1366
+ }
1367
+
1368
+ /** Options for `createCylinderData`. Subset of Babylon's CreateCylinder. */
1369
+ export declare interface CylinderOptions {
1370
+ height?: number;
1371
+ diameter?: number;
1372
+ diameterTop?: number;
1373
+ diameterBottom?: number;
1374
+ tessellation?: number;
1375
+ subdivisions?: number;
1376
+ }
1377
+
1378
+ export declare interface DirectionalLight extends LightBase {
1379
+ readonly lightType: "directional";
1380
+ direction: ObservableVec3;
1381
+ position: ObservableVec3;
1382
+ diffuse: [number, number, number];
1383
+ specular: [number, number, number];
1384
+ intensity: number;
1385
+ }
1386
+
1387
+ /** Options for `createDiscData`. Subset of Babylon's CreateDisc. */
1388
+ export declare interface DiscOptions {
1389
+ radius?: number;
1390
+ tessellation?: number;
1391
+ /** Fraction of circumference (`0 < arc ≤ 1`). Default 1 (full disc). */
1392
+ arc?: number;
1393
+ }
1394
+
1395
+ /** Frees the WASM memory backing a solid. The solid must not be used afterwards. */
1396
+ export declare function disposeCsg2(solid: Csg2Solid): void;
1397
+
1398
+ /** Unregister and free all GPU resources owned by the renderer. */
1399
+ export declare function disposeEffectRenderer(er: EffectRenderer): void;
1400
+
1401
+ /** Destroy the uniform buffers and clear the cached pipelines, bind groups, and slots owned by the effect wrapper. */
1402
+ export declare function disposeEffectWrapper(wrapper: EffectWrapper): void;
1403
+
1404
+ /** Release all engine-owned GPU resources (device + swapchain). Rendering contexts
1405
+ * own their own GPU resources (frame graphs, render targets) and dispose them
1406
+ * separately. */
1407
+ export declare function disposeEngine(engine: EngineContext): void;
1408
+
1409
+ /** Unregister and dispose all GPU resources owned by the standalone frame graph. */
1410
+ export declare function disposeFrameGraphContext(ctx: FrameGraphContext): void;
1411
+
1412
+ /**
1413
+ * Removes and releases all bodies, then releases the native world. Call once when tearing down physics.
1414
+ * @param world - The physics world to dispose.
1415
+ */
1416
+ export declare function disposePhysics(world: PhysicsWorld): void;
1417
+
1418
+ /** Dispose GPU resources owned by this picker. */
1419
+ export declare function disposePicker(picker: GpuPicker): void;
1420
+
1421
+ /** Release all GPU resources owned by this scene. */
1422
+ export declare function disposeScene(scene: SceneContext): void;
1423
+
1424
+ /**
1425
+ * Detaches a binding created by {@link attachSpriteAnimationsToScene} or
1426
+ * {@link attachSpriteAnimationsToRenderer}. Safe to call more than once.
1427
+ * @param binding - Binding to dispose.
1428
+ */
1429
+ export declare function disposeSpriteAnimationBinding(binding: SpriteAnimationBinding): void;
1430
+
1431
+ /**
1432
+ * Destroy all GPU resources owned by the renderer, unregister it from the engine, and clear `layers`.
1433
+ * Idempotent. To tie disposal to a scene, call
1434
+ * `onSceneDispose(scene, () => disposeSpriteRenderer(sr))` after `registerSpriteRenderer` —
1435
+ * see the `SpriteRenderer` doc-comment.
1436
+ */
1437
+ export declare function disposeSpriteRenderer(sr: SpriteRenderer): void;
1438
+
1439
+ /** Destroy the uniform buffer and clear cached GPU objects owned by the uniform effect wrapper. */
1440
+ export declare function disposeUniformEffectWrapper(wrapper: UniformEffectWrapper): void;
1441
+
1442
+ /**
1443
+ * A per-pass draw binding produced by `Renderable.bind(engine, target)`.
1444
+ *
1445
+ * Target-specific GPU state (resolved pipeline(s), sceneBG, etc.) is captured in the
1446
+ * `draw` closure so the binding itself has no material-specific payload. The same
1447
+ * `Renderable` can be bound multiple times (once per pass it participates in) with
1448
+ * a separate `DrawBinding` each time.
1449
+ */
1450
+ export declare interface DrawBinding {
1451
+ /** Back-reference for sort/eviction (order, mesh identity). */
1452
+ readonly renderable: Renderable;
1453
+ /** Pipeline used by this binding. The render pass task owns setPipeline()
1454
+ * and dedups consecutive bindings with the same pipeline. */
1455
+ readonly pipeline: GPURenderPipeline;
1456
+ /** Issue draw commands for this renderable into `pass`. The render pass task has
1457
+ * already set the scene bind group (group 0) and `pass.setPipeline(pipeline)` if
1458
+ * it changed. The closure handles per-mesh / per-material bind groups,
1459
+ * vertex/index buffers, and drawIndexed. Returns the number of GPU draw calls. */
1460
+ draw(pass: GPURenderPassEncoder | GPURenderBundleEncoder, engine: EngineContext): number;
1461
+ /** Update dirty per-pass state before draw. Called once per frame per binding.
1462
+ * Per-mesh state (e.g. world matrix) shared across bindings should be
1463
+ * version-guarded to avoid redundant writes. Render task transparent sorting
1464
+ * runs after these updates, so renderables may refresh `_worldCenter` here. */
1465
+ update?(context: DrawUpdateContext): void;
1466
+
1467
+ /** Dynamic per-pass data available before a binding draws. */
1468
+ export declare interface DrawUpdateContext {
1469
+ readonly targetWidth: number;
1470
+ readonly targetHeight: number;
1471
+
1472
+ /** Kind of GPU binding an effect exposes: a uniform buffer, a sampled texture, or a sampler. */
1473
+ export declare type EffectBindingKind = "uniform" | "texture" | "sampler";
1474
+
1475
+ /** Describes a single bind-group entry (binding slot, kind, and type details) for an effect wrapper. */
1476
+ export declare interface EffectBindingLayout {
1477
+ name?: string;
1478
+ binding: number;
1479
+ kind: EffectBindingKind;
1480
+ visibility?: GPUShaderStageFlags;
1481
+ uniformByteLength?: number;
1482
+ textureSampleType?: GPUTextureSampleType;
1483
+ samplerType?: GPUSamplerBindingType;
1484
+ textureBinding?: string | number;
1485
+ }
1486
+
1487
+ /**
1488
+ * `EffectRenderer` — a fullscreen-effect `RenderingContext` that draws
1489
+ * directly to the swapchain without a `SceneContext` or frame-graph task.
1490
+ * Use `registerEffectRenderer` / `unregisterEffectRenderer` to attach it to
1491
+ * an engine, then call `startEngine` as usual.
1492
+ *
1493
+ * For offscreen render-to-texture workflows (effect result consumed by a
1494
+ * scene material) continue to use `createEffectRenderTask` inside a scene
1495
+ * frame graph.
1496
+ */
1497
+ export declare interface EffectRenderer extends RenderingContext_2 {
1498
+ readonly name: string;
1499
+ }
1500
+
1501
+ /** Options for `createEffectRenderer`. */
1502
+ export declare interface EffectRendererOptions {
1503
+ /** Label for GPU resources. Defaults to the effect's own name. */
1504
+ name?: string;
1505
+ /** Whether to clear the swapchain before drawing. Defaults to `true`. */
1506
+ clear?: boolean;
1507
+ /** Clear colour. Defaults to opaque black. */
1508
+ clearColor?: GPUColorDict;
1509
+ /**
1510
+ * Per-frame callback invoked just before the effect is drawn, receiving the
1511
+ * frame delta in milliseconds. Use it to update uniforms (e.g. time, animation
1512
+ * state). This is the effect-path equivalent of a scene's `onBeforeRender`.
1513
+ */
1514
+ update?: (deltaMs: number) => void;
1515
+ }
1516
+
1517
+ /** A frame-graph task that renders an `EffectWrapper` as a fullscreen pass into an offscreen `RenderTarget`. */
1518
+ export declare interface EffectRenderTask extends Task {
1519
+ readonly name: string;
1520
+
1521
+ /** Configuration for `createEffectRenderTask`: the effect to draw, its render target, and optional clear state. */
1522
+ export declare interface EffectRenderTaskConfig {
1523
+ name: string;
1524
+ effect: EffectWrapper;
1525
+ target: RenderTarget;
1526
+ clear?: boolean;
1527
+ clearColor?: GPUColorDict;
1528
+ }
1529
+
1530
+ /** A reusable fullscreen effect: owns its shader module, bind-group layout, pipelines, and uniform/texture slots. */
1531
+ export declare interface EffectWrapper {
1532
+ readonly name: string;
1533
+ readonly options: EffectWrapperOptions;
1534
+ }
1535
+
1536
+ /** Configuration for `createEffectWrapper`: the fullscreen fragment shader plus optional vertex shader, bindings, and blend state. */
1537
+ export declare interface EffectWrapperOptions {
1538
+ name?: string;
1539
+ fragmentWGSL: string;
1540
+ vertexWGSL?: string;
1541
+ bindings?: EffectBindingLayout[];
1542
+ blend?: GPUBlendState;
1543
+ }
1544
+
1545
+ /** Enable advanced animation blending for a manager. Kept opt-in so manual-only weights do not pay for skeletal mixing code. */
1546
+ export declare function enableAnimationBlending(manager: AnimationManager): void;
1547
+
1548
+ /**
1549
+ * Enable detailed picking on a GPU picker.
1550
+ * When enabled, pickAsync() will compute faceId, bu, bv
1551
+ * by performing CPU ray-triangle intersection on the identified mesh.
1552
+ * Requires meshes to have _cpuPositions and _cpuIndices set.
1553
+ */
1554
+ export declare function enableDetailedPicking(picker: GpuPicker): void;
1555
+
1556
+ /** Enable automatic dirty tracking on a PBR or Standard material.
1557
+ * After calling this, any UBO-backed property mutation marks the source material UBO dirty. */
1558
+ export declare function enableMaterialTracking(material: Material & {
1559
+ specularPower?: unknown;
1560
+ }): Promise<void>;
1561
+
1562
+ /** Enables weighted property-animation blending on `manager` by registering its category handler. */
1563
+ export declare function enablePropertyAnimationBlending(manager: AnimationManager): void;
1564
+
1565
+ /** Enable or disable GPU frustum culling for an existing thin-instanced mesh.
1566
+ *
1567
+ * Call this after `setThinInstances()`/`addThinInstance()` and before `registerScene()`.
1568
+ * The render system keeps the feature opt-in so non-culled thin-instance scenes do not
1569
+ * fetch the compute-culling module or allocate compacted visible-instance buffers.
1570
+ */
1571
+ export declare function enableThinInstanceGpuCulling(mesh: Mesh, enabled?: boolean): void;
1572
+
1573
+ /** CPU helper matching BJS `GaussianSplattingGpuPickingMaterialPlugin.EncodeIdToColor`. */
1574
+ export declare function encodeIdToColor(id: number): [number, number, number];
1575
+
1576
+ /** Handle to the WebGPU engine — pure state, no attached methods. */
1577
+ export declare interface EngineContext {
1578
+ readonly canvas: RenderCanvas;
1579
+ readonly msaaSamples: number;
1580
+ /** Preferred GPU texture format for the swapchain. Use as the `colorFormat`
1581
+ * for offscreen RTs that are sampled by main-pass materials. */
1582
+ readonly format: GPUTextureFormat;
1583
+ /** Number of GPU draw calls in the last rendered frame. */
1584
+ drawCallCount: number;
1585
+ /** Clamps the effective device pixel ratio used for the swapchain backing store.
1586
+ * The backing store is sized at `min(devicePixelRatio, maxDevicePixelRatio) * cssPixels`.
1587
+ * `maxDevicePixelRatio = 1` renders at native CSS-pixel resolution (no DPR upscaling);
1588
+ * the default `Infinity` is unclamped (full devicePixelRatio). Mutable at runtime — set
1589
+ * before the next `resizeEngine` to take effect (mirrors `setHardwareScalingRatio`). */
1590
+ maxDevicePixelRatio: number;
1591
+
1592
+ /**
1593
+ * Options for `createEngine`.
1594
+ * - `msaaSamples`: number of MSAA samples to use for the main render pass.
1595
+ * WebGPU only permits `1` (no MSAA) or `4` (4x MSAA) per the spec
1596
+ * (2x is not a valid WebGPU sample count). Defaults to `4`.
1597
+ */
1598
+ export declare interface EngineOptions {
1599
+ msaaSamples?: 1 | 4;
1600
+ /**
1601
+ * WebGPU canvas alpha mode. Use "premultiplied" to enable canvas transparency (clear color
1602
+ * with `alpha < 1` will let HTML content underneath show through). Defaults to "opaque".
1603
+ */
1604
+ alphaMode?: GPUCanvasAlphaMode;
1605
+ /**
1606
+ * Clamps the effective device pixel ratio used for the swapchain backing store.
1607
+ * The backing store is sized at `min(devicePixelRatio, maxDevicePixelRatio) * cssPixels`.
1608
+ * `maxDevicePixelRatio: 1` renders at native CSS-pixel resolution (no DPR upscaling) —
1609
+ * useful on high-DPI/iOS devices where `devicePixelRatio` is ~3. Defaults to unclamped
1610
+ * (full devicePixelRatio). Equivalent to Babylon.js `setHardwareScalingRatio`.
1611
+ */
1612
+ maxDevicePixelRatio?: number;
1613
+ }
1614
+
1615
+ /** GPU-resident environment textures. */
1616
+ export declare interface EnvironmentTextures {
1617
+ specularCube: GPUTexture;
1618
+ specularCubeView: GPUTextureView;
1619
+ brdfLut: GPUTexture;
1620
+ brdfLutView: GPUTextureView;
1621
+ cubeSampler: GPUSampler;
1622
+ brdfSampler: GPUSampler;
1623
+ irradianceSH: Float32Array;
1624
+ /** Pre-scaled SH coefficients for shader, 36 floats in stride-4 layout:
1625
+ * [L00.rgb, 0, L1_1.rgb, 0, L10.rgb, 0, L11.rgb, 0, L2_2.rgb, 0,
1626
+ * L2_1.rgb, 0, L20.rgb, 0, L21.rgb, 0, L22.rgb, 0] */
1627
+ sphericalHarmonics: Float32Array;
1628
+ /** LOD generation scale for specular IBL sampling. Default 0.8 (matches BJS BaseTexture). */
1629
+ lodGenerationScale: number;
1630
+ }
1631
+
1632
+ /** Configuration for a directional-light ESM shadow generator: map size, depth scale, blur kernel, darkness, and ortho projection bounds. */
1633
+ export declare interface EsmDirectionalShadowGeneratorConfig {
1634
+ mapSize?: number;
1635
+ depthScale?: number;
1636
+ bias?: number;
1637
+ /** Kernel blur sample region in pixels. Matches Babylon.js ShadowGenerator.blurKernel. Default 1. */
1638
+ blurKernel?: number;
1639
+ blurScale?: number;
1640
+ darkness?: number;
1641
+ frustumEdgeFalloff?: number;
1642
+ /** Ortho projection min Z — typically camera.nearPlane. Default 1. */
1643
+ orthoMinZ?: number;
1644
+ /** Ortho projection max Z — typically camera.farPlane. Default 10000. */
1645
+ orthoMaxZ?: number;
1646
+ /** Force the shadow map to be regenerated every frame. Default false. */
1647
+ forceRefreshEveryFrame?: boolean;
1648
+ }
1649
+
1650
+ /** Bidirectional Euler XYZ view over a quaternion.
1651
+ * Reads decompose the current quaternion on the fly; writes convert Euler→quat atomically. */
1652
+ declare interface EulerProxy {
1653
+ x: number;
1654
+ y: number;
1655
+ z: number;
1656
+ set(x: number, y: number, z: number): void;
1657
+ }
1658
+
1659
+ /** A post-process task that keeps only pixels whose luminance exceeds `threshold` and zeroes the rest. */
1660
+ export declare interface ExtractHighlightsPostProcessTask extends PostProcessTask {
1661
+ threshold: number;
1662
+ exposure: number;
1663
+ }
1664
+
1665
+ /** Configuration for `createExtractHighlightsPostProcessTask`: luminance `threshold` and `exposure` applied before thresholding. */
1666
+ export declare interface ExtractHighlightsPostProcessTaskConfig extends Omit<PostProcessTaskConfig, "_shader"> {
1667
+ threshold?: number;
1668
+ exposure?: number;
1669
+ }
1670
+
1671
+ /** Options for `createExtrudeShapeData`: a 2D `shape` swept along a 3D `path`. */
1672
+ export declare interface ExtrudeShapeOptions {
1673
+ shape: Vec3[];
1674
+ path: Vec3[];
1675
+ scale?: number;
1676
+ rotation?: number;
1677
+ cap?: number;
1678
+ }
1679
+
1680
+ /** A camera-facing billboard sprite system. */
1681
+ export declare type FacingBillboardSpriteSystem = BillboardSpriteSystem<"facing">;
1682
+
1683
+ /** Animates `group`'s blend weight toward `options.to` over `options.durationMs`, enabling blending on `manager`.
1684
+ * @throws If `to`/`from` are outside `[0, 1]` or the duration is not a finite positive number. */
1685
+ export declare function fadeAnimationWeight(manager: AnimationManager, group: AnimationGroup, options: FadeAnimationWeightOptions): void;
1686
+
1687
+ /** Options for {@link fadeAnimationWeight}. */
1688
+ export declare interface FadeAnimationWeightOptions {
1689
+ readonly to: number;
1690
+ readonly durationMs: number;
1691
+ readonly from?: number;
1692
+ }
1693
+
1694
+ /** Return any random point on the navmesh. */
1695
+ export declare function findRandomPoint(plugin: NavigationPlugin): Vec3;
1696
+
1697
+ /**
1698
+ * Return a random point on the navmesh inside a circle of `radius` around `position`.
1699
+ * Determinism: seeded by Recast's internal RNG; call `setNavigationRandomSeed`
1700
+ * to make results reproducible across runs.
1701
+ */
1702
+ export declare function findRandomPointAroundCircle(plugin: NavigationPlugin, position: Vec3, radius: number): Vec3;
1703
+
1704
+ /** Mark thin instance data dirty after direct array manipulation. */
1705
+ export declare function flushThinInstances(mesh: Mesh): void;
1706
+
1707
+ /** Fog configuration — plain data. */
1708
+ export declare interface FogConfig {
1709
+ mode: 0 | 1 | 2 | 3;
1710
+ density: number;
1711
+ start: number;
1712
+ end: number;
1713
+ color: [number, number, number];
1714
+ }
1715
+
1716
+ /** The frame graph — an ordered list of tasks. */
1717
+ export declare interface FrameGraph {
4
1718
  /** Build (or rebuild) every task in execute order. */
1719
+ build(): void;
1720
+ /** Execute every task's recorded passes. Returns total draw calls. */
1721
+ execute(): number;
1722
+ /** Free all GPU resources owned by the frame graph. */
1723
+ dispose(): void;
1724
+ }
1725
+
1726
+ /** A scene-less rendering context driven directly by a FrameGraph. */
1727
+ export declare interface FrameGraphContext extends RenderingContext_2 {
1728
+ readonly name: string;
1729
+ readonly engine: EngineContext;
1730
+ readonly frameGraph: FrameGraph;
1731
+ clearColor: GPUColorDict;
1732
+ }
1733
+
1734
+ /** Options for a standalone frame-graph rendering context. */
1735
+ export declare interface FrameGraphContextOptions {
1736
+ /** Label used for diagnostics and GPU resource naming. */
1737
+ name?: string;
1738
+ /** Context clear color metadata; individual tasks still control their own render-target clears. */
1739
+ clearColor?: GPUColorDict;
1740
+ /** Per-frame callback invoked before the frame graph executes; use it to update uniforms or other task inputs. */
1741
+ update?: (deltaMs: number) => void;
1742
+ }
1743
+
1744
+ /** FreeCamera — positioned in world space, looking at a target point.
1745
+ * Matches Babylon.js FreeCamera: position + target, left-handed.
1746
+ * Plain data + methods. Does NOT know about the scene.
1747
+ *
1748
+ * Push-based dirty tracking: position and target use ObservableVec3,
1749
+ * _yaw/_pitch use Object.defineProperty. */
1750
+ export declare interface FreeCamera extends Camera, IWorldMatrixProvider, IParentable {
1751
+ position: ObservableVec3;
1752
+ target: ObservableVec3;
1753
+ /** Movement speed. Default 2.0 (matches BJS). */
1754
+ speed: number;
1755
+ /** Mouse rotation sensitivity (higher = less sensitive). Default 2000 (matches BJS). */
1756
+ angularSensitivity: number;
1757
+ /** Inertia damping factor (0 = instant stop, 0.9 = smooth). Default 0.9 (matches BJS). */
1758
+ inertia: number;
1759
+ parent: IWorldMatrixProvider | null;
1760
+ readonly worldMatrix: Mat4;
1761
+ readonly worldMatrixVersion: number;
1762
+
1763
+ /** Public Gaussian-splatting mesh handle. `_kind` is a brand so consumers can
1764
+ * narrow on it; the renderable is wired up by `loadSplat()` directly. */
1765
+ export declare interface GaussianSplattingMesh extends SceneNode {
5
1766
  /** Number of splats in the cloud. */
1767
+ readonly vertexCount: number;
1768
+ /** RGBA32F texture dimensions used for centers/covA/covB/colors. */
1769
+ readonly textureWidth: number;
1770
+ readonly textureHeight: number;
1771
+ /** World-space AABB across all splat centres (for camera framing). */
1772
+ boundMin: [number, number, number];
1773
+ boundMax: [number, number, number];
1774
+ /** Spherical-harmonics degree (0 means no view-dependent SH). Set at load
1775
+ * time and immutable afterwards — `updateData` rejects a degree change. */
1776
+ readonly shDegree: number;
6
1777
  /** Resolves on the first sort completion. The lab scene awaits this
1778
+ * before flagging `dataset.ready`. */
1779
+ readonly firstSortReady: Promise<void>;
7
1780
  /** Raw 32-byte/splat row buffer. Mirrors BJS `splatsData` (with
1781
+ * `keepInRam:true`) — exposed for inspection + `updateData` round-trips. */
1782
+ readonly splatsData: ArrayBuffer;
1783
+ /** Replace the splat data in place. Re-uploads centres / covariance /
1784
+ * colour textures, re-posts positions to the sort worker, and updates the
1785
+ * AABB. Vertex count must match the original buffer. Mirrors BJS
1786
+ * `GaussianSplattingMesh.updateData(buffer, _sh, opts)`. */
1787
+ updateData(splatBuffer: ArrayBuffer): void;
1788
+ }
1789
+
1790
+ /** Get the current world position of an agent. */
1791
+ export declare function getAgentPosition(crowd: NavCrowd, index: number): Vec3;
1792
+
1793
+ /** Get the current world-space velocity of an agent. */
1794
+ export declare function getAgentVelocity(crowd: NavCrowd, index: number): Vec3;
1795
+
1796
+ /** Returns the animation groups currently attached to `manager`, or an empty array if none. */
1797
+ export declare function getAnimationGroups(manager: AnimationManager): readonly AnimationGroup[];
1798
+
1799
+ /**
1800
+ * Resolves the current instance index of the sprite referenced by `handle`.
1801
+ * @param handle - Handle of the sprite to resolve.
1802
+ * @returns The current instance index in the system's buffers.
1803
+ * @throws If the handle has already been removed.
1804
+ */
1805
+ export declare function getBillboardSpriteHandleIndex(handle: BillboardSpriteHandle): number;
1806
+
1807
+ /** Get the world-space position of a camera. */
1808
+ export declare function getCameraPosition(camera: Camera): Vec3;
1809
+
1810
+ /** Snap a position to the closest point on the navmesh. */
1811
+ export declare function getClosestPoint(plugin: NavigationPlugin, position: Vec3): Vec3;
1812
+
1813
+ /** Returns the render-target aspect ratio adjusted for the camera's normalized viewport, or the raw ratio if none. */
1814
+ export declare function getEffectiveAspectRatio(camera: Camera | null | undefined, targetWidth: number, targetHeight: number): number;
1815
+
1816
+ /** Get the scene's frame graph. Always non-null — created in `createSceneContext`. */
1817
+ export declare function getFrameGraph(scene: SceneContext): FrameGraph;
1818
+
1819
+ /** Get the current seed used by Recast's randomized queries. */
1820
+ export declare function getNavigationRandomSeed(plugin: NavigationPlugin): number;
1821
+
1822
+ /**
1823
+ * Returns the world's current gravity vector.
1824
+ * @param world - The physics world.
1825
+ * @returns Gravity acceleration in m/s².
1826
+ */
1827
+ export declare function getPhysicsGravity(world: PhysicsWorld): Vec3;
1828
+
1829
+ /**
1830
+ * Returns the world's fixed simulation timestep in seconds.
1831
+ * @param world - The physics world.
1832
+ * @returns The timestep in seconds.
1833
+ */
1834
+ export declare function getPhysicsTimestep(world: PhysicsWorld): number;
1835
+
1836
+ /**
1837
+ * Returns the world's current maximum linear and angular speed limits.
1838
+ * @param world - The physics world.
1839
+ * @returns The `maxLinear` and `maxAngular` speed limits.
1840
+ */
1841
+ export declare function getPhysicsVelocityLimits(world: PhysicsWorld): {
1842
+ maxLinear: number;
1843
+ maxAngular: number;
1844
+ };
1845
+
1846
+ /**
1847
+ * Get the interpolated normal at the picked point.
1848
+ * Requires detailed picking (`faceId >= 0`) and mesh._cpuNormals.
1849
+ * @param useWorldCoordinates - if true, transform normal by world matrix (default: false)
1850
+ */
1851
+ export declare function getPickedNormal(info: PickingInfo, useWorldCoordinates?: boolean): [number, number, number] | null;
1852
+
1853
+ /**
1854
+ * Get the interpolated UV coordinates at the picked point.
1855
+ * Requires detailed picking (`faceId >= 0`) and mesh._cpuUvs.
1856
+ */
1857
+ export declare function getPickedUV(info: PickingInfo): [number, number] | null;
1858
+
1859
+ /** Compute the projection matrix for a camera. Cached per worldMatrixVersion + aspect. */
1860
+ export declare function getProjectionMatrix(camera: Camera, aspectRatio: number): Mat4;
1861
+
1862
+ /**
1863
+ * Resolves the current instance index of the sprite referenced by `handle`.
1864
+ * @param handle - Handle of the sprite to resolve.
1865
+ * @returns The current instance index in the layer's buffers.
1866
+ * @throws If the handle has already been removed.
1867
+ */
1868
+ export declare function getSprite2DHandleIndex(handle: Sprite2DHandle): number;
1869
+
1870
+ /**
1871
+ * Get available variant names from a loaded glTF asset.
1872
+ * Returns an empty array if the asset has no material variants.
1873
+ */
1874
+ export declare function getVariantNames(container: AssetContainer): readonly string[];
1875
+
1876
+ /** Compute the view matrix for a camera. Cached per worldMatrixVersion. */
1877
+ export declare function getViewMatrix(camera: Camera): Mat4;
1878
+
1879
+ /** Compute the view-projection matrix for a camera. Cached per worldMatrixVersion + aspect. */
1880
+ export declare function getViewProjectionMatrix(camera: Camera, aspectRatio: number): Mat4;
1881
+
1882
+ /** Everything the animation system needs, parsed from a glTF file. */
1883
+ export declare interface GltfAnimationData {
1884
+ readonly clips: readonly AnimationClip[];
1885
+ readonly nodes: readonly NodeRest[];
1886
+ readonly skeletons: readonly SkeletonBinding[];
1887
+ readonly morphBindings: readonly MorphBinding[];
1888
+ /** Scene-node targets indexed by glTF node index. Used to write plain node-TRS
1889
+ * channels (non-skeletal node animation) back onto the live scene graph so the
1890
+ * affected meshes — and their descendants — actually move. */
1891
+ readonly nodeTargets: readonly (AnimatedNodeTarget | undefined)[];
1892
+ /** Node indices excluded from node-TRS writeback: skin joints (driven by the
1893
+ * skeleton path) plus skinned-mesh nodes and all their ancestors (their bone
1894
+ * matrices bake an `invMeshWorld` captured at load, so moving them at runtime
1895
+ * would double-transform the skinned vertices). */
1896
+ readonly excludedNodeIndices: ReadonlySet<number>;
1897
+ }
1898
+
1899
+ /** Seek to a specific frame, apply the pose, and pause. */
1900
+ export declare function goToFrame(group: AnimationGroup, frame: number, engine?: EngineContext): void;
1901
+
1902
+ /** GPU-based picker — pure state. Use pickAsync() and disposePicker() standalone functions. */
1903
+ export declare interface GpuPicker {
1904
+
1905
+ /** Options for `createGridSpriteAtlas`. */
1906
+ export declare interface GridAtlasOptions {
1907
+ cellWidthPx: number;
1908
+ cellHeightPx: number;
1909
+ /** Defaults to `floor(textureWidth / cellWidthPx)`. */
1910
+ columns?: number;
1911
+ /** Defaults to `floor(textureHeight / cellHeightPx)`. */
1912
+ rows?: number;
1913
+ marginPx?: number;
1914
+ spacingPx?: number;
1915
+ /** Default `[0.5, 0.5]`. */
1916
+ pivot?: readonly [number, number];
1917
+ premultipliedAlpha?: boolean;
1918
+ }
1919
+
1920
+ /**
1921
+ * Options for {@link createGridMaterial}. Mirrors Babylon.js `GridMaterial`:
1922
+ * an unlit, procedural object-space grid. All fields are optional and fall back
1923
+ * to the Babylon defaults.
1924
+ */
1925
+ export declare interface GridMaterialOptions {
1926
+ readonly name?: string;
1927
+ /** Background color between the lines. Default black `[0,0,0]`. */
1928
+ readonly mainColor?: GridVec3;
1929
+ /** Color of the grid lines. Default teal `[0,0.5,0.5]`. */
1930
+ readonly lineColor?: GridVec3;
1931
+ /** Spacing of the grid in object-space units. Default `1`. */
1932
+ readonly gridRatio?: number;
1933
+ /** Object-space offset added before computing the grid. Default `[0,0,0]`. */
1934
+ readonly gridOffset?: GridVec3;
1935
+ /** Every Nth line is a major line. Rounded with `Math.round`. Default `10`. */
1936
+ readonly majorUnitFrequency?: number;
1937
+ /** Visibility of the minor (non-major) lines, `0..1`. Default `0.33`. */
1938
+ readonly minorUnitVisibility?: number;
1939
+ /** Opacity of the grid outside of the lines. `<1` enables the transparent path. Default `1`. */
1940
+ readonly opacity?: number;
1941
+ /** Cosine-based antialiasing of the lines. Default `true`. */
1942
+ readonly antialias?: boolean;
1943
+ /** Premultiply rgb by alpha (transparent path only). Default `false`. */
1944
+ readonly preMultiplyAlpha?: boolean;
1945
+ /** Combine axes with `max` instead of additive sum. Default `false`. */
1946
+ readonly useMaxLine?: boolean;
1947
+ /** Optional opacity texture; its `.a` channel multiplies the final opacity. */
1948
+ readonly opacityTexture?: Texture2D;
1949
+ /** Per-material visibility multiplier applied to the final alpha. Default `1`. */
1950
+ readonly visibility?: number;
1951
+ /** Cull back faces. Default `true`. */
1952
+ readonly backFaceCulling?: boolean;
1953
+ }
1954
+
1955
+ /** A 3-component color/vector expressed as a readonly tuple. */
1956
+ export declare type GridVec3 = readonly [number, number, number];
1957
+
1958
+ /** Options for `createFlatGroundData` and {@link createGroundFromHeightMap}. */
1959
+ export declare interface GroundOptions {
1960
+ width?: number;
1961
+ height?: number;
1962
+ subdivisions?: number;
1963
+ minHeight?: number;
1964
+ maxHeight?: number;
1965
+ /** UV scale factor [uScale, vScale]. Multiplies generated UVs for texture tiling. Default [1, 1]. */
1966
+ uvScale?: [number, number];
1967
+ }
1968
+
1969
+ /** Alpha-blended depth variant (BJS `depthRenderer.alphaBlendedDepth = true`).
1970
+ * Splat fragments emit `(d, d, d, gaussianAlpha)` so the existing GS pipeline's
1971
+ * ALPHA_COMBINE blend accumulates a soft-edged grayscale depth visualisation,
1972
+ * matching BJS `V80DRL#19`. */
1973
+ export declare const gsAlphaBlendedDepthFragment: GsShaderFragment;
1974
+
1975
+ /** Names of the four WGSL slots a `GsShaderFragment` may inject into the
1976
+ * Gaussian-splat fragment shader. Markers in the WGSL source look like
1977
+ * `\/*GS_FRAGMENT_MAIN_END*\/` — valid comments when no plugin is present. */
1978
+ export declare type GsFragmentSlot = "GS_FRAGMENT_DEFINITIONS" | "GS_FRAGMENT_MAIN_BEGIN" | "GS_FRAGMENT_BEFORE_FRAGCOLOR" | "GS_FRAGMENT_MAIN_END";
1979
+
1980
+ /** Lite port of `GaussianSplattingGpuPickingMaterialPlugin`'s non-compound path:
1981
+ * declare a `picking` UBO at `@group(2) @binding(0)` (allocated by the picking
1982
+ * pipeline) and override the fragment colour with the per-mesh pick id. */
1983
+ export declare const gsGpuPickingFragment: GsShaderFragment;
1984
+
1985
+ /** Force-depth-write variant (BJS `forceDepthWriteTransparentMeshes = true`).
1986
+ * Matches BJS's `gaussianSplattingDepth.fragment.fx` default (no `ALPHA_BLENDED_DEPTH`)
1987
+ * branch exactly:
1988
+ *
1989
+ * ```
1990
+ * // base WGSL has `let A = -dot(in.vPos, in.vPos);` and `in.vColor.a = splat.color.a * material.alpha`
1991
+ * if (A < -in.vColor.a) { discard; } // ↔ if dot(vPos,vPos) > vColor.a
1992
+ * finalColor = vec4(linearDepth, linearDepth, linearDepth, 1.0);
1993
+ * ```
1994
+ *
1995
+ * Per-splat α is used as a *squared-radius* threshold in the splat-local 2D
1996
+ * quad coordinate (`vPos ∈ [-1,1]²`), so each splat clips to a disc of
1997
+ * radius √α inside its quad. No gaussian falloff in the depth pass —
1998
+ * surviving fragments all write `opacity = 1.0` (the EWA core is not
1999
+ * used here; that's the `gsAlphaBlendedDepthFragment` regime). */
2000
+ export declare const gsLinearDepthFragment: GsShaderFragment;
2001
+
2002
+ /** Data-only descriptor of a GS shader plugin. Lite equivalent of a BJS
2003
+ * `MaterialPluginBase`: snippets get spliced into the four GS fragment slots. */
2004
+ export declare interface GsShaderFragment {
2005
+ readonly id: string;
2006
+ readonly fragmentSlots?: Partial<Record<GsFragmentSlot, string>>;
2007
+ readonly helperFunctions?: string;
2008
+ }
2009
+
2010
+ declare interface HdrLoadOptions {
2011
+ /** Cubemap face size in pixels. Default 256. */
2012
+ faceSize?: number;
2013
+ /** When true, render the HDR cubemap as the skybox background. */
2014
+ useCubemapSkybox?: boolean;
2015
+ /** When true, skip the ground plane. */
2016
+ skipGround?: boolean;
2017
+ /** Skybox size matching BJS createDefaultEnvironment skyboxSize option. */
2018
+ skyboxSize?: number;
2019
+ }
2020
+
2021
+ export declare interface HemisphericLight extends LightBase {
2022
+ readonly lightType: "hemispheric";
2023
+ direction: ObservableVec3;
2024
+ intensity: number;
2025
+ diffuseColor: [number, number, number];
2026
+ specularColor: [number, number, number];
2027
+ groundColor: [number, number, number];
2028
+ }
2029
+
2030
+ /** Image processing configuration. */
2031
+ export declare interface ImageProcessingConfig {
2032
+ exposure: number;
2033
+ contrast: number;
2034
+ toneMappingEnabled: boolean;
2035
+ /** "standard" (BJS TONEMAPPING_STANDARD, default) or "aces" (BJS TONEMAPPING_ACES). */
2036
+ toneMappingType?: "standard" | "aces";
2037
+ }
2038
+
2039
+ /** Source of the color image to post-process: a texture, a render target, or a getter returning one (resolved each record). */
2040
+ export declare type ImageProcessingSource = Texture2D | RenderTarget | (() => Texture2D | RenderTarget | null | undefined);
2041
+
2042
+ /** Configuration for `createImageProcessingTask`: the color source to apply exposure/contrast/tone-mapping to. */
2043
+ export declare interface ImageProcessingTaskConfig {
2044
+ name?: string;
2045
+ source: ImageProcessingSource;
2046
+ }
2047
+
2048
+ /** Loads the manifold-3d WASM runtime. Must be awaited once before any CSG2 operation. */
2049
+ export declare function initializeCsg2Async(): Promise<void>;
2050
+
2051
+ declare type InterpMode = 0 | 1 | 2;
2052
+
2053
+ /** Any object that can be attached to a parent in the scene hierarchy.
2054
+ * When parent is null, position/rotation/scaling are in world space. */
2055
+ export declare interface IParentable {
2056
+ parent: IWorldMatrixProvider | null;
2057
+ }
2058
+
2059
+ /** Iridescence thin-film properties. Maps to BJS PBRMaterial.iridescence and KHR_materials_iridescence. */
2060
+ declare interface IridescenceProps {
2061
+ /** Whether iridescence is active. Default false. */
2062
+ isEnabled?: boolean;
2063
+ /** Iridescence blend intensity (0=off, 1=full). Default 1.0 for native PBR; glTF default is supplied by the loader. */
2064
+ intensity?: number;
2065
+ /** Thin-film index of refraction. Default 1.3. */
2066
+ indexOfRefraction?: number;
2067
+ /** Minimum film thickness in nanometres. Default 100. */
2068
+ minimumThickness?: number;
2069
+ /** Maximum film thickness in nanometres. Default 400. */
2070
+ maximumThickness?: number;
2071
+ /** Optional intensity texture; R channel multiplies intensity. */
2072
+ texture?: Texture2D;
2073
+ /** Optional thickness texture; G channel lerps minimum→maximum thickness. */
2074
+ thicknessTexture?: Texture2D;
2075
+ }
2076
+
2077
+ /**
2078
+ * Returns `true` if the sprite referenced by `handle` is still present in its system.
2079
+ * @param handle - Handle to test.
2080
+ */
2081
+ export declare function isBillboardSpriteHandleAlive(handle: BillboardSpriteHandle): boolean;
2082
+
2083
+ /** Returns whether the manifold-3d runtime has finished loading and CSG2 is usable. */
2084
+ export declare function isCsg2Ready(): boolean;
2085
+
2086
+ /**
2087
+ * Returns `true` if the sprite referenced by `handle` is still present in its layer.
2088
+ * @param handle - Handle to test.
2089
+ */
2090
+ export declare function isSprite2DHandleAlive(handle: Sprite2DHandle): boolean;
2091
+
2092
+ /** Any object that provides a world-space transformation matrix.
2093
+ * Implementations compute lazily on property access (getter). */
2094
+ export declare interface IWorldMatrixProvider {
2095
+ /** World-space 4×4 column-major matrix. May trigger lazy recomputation. */
2096
+ readonly worldMatrix: Mat4;
2097
+ /** Monotonically increasing counter — bumped each time worldMatrix recomputes.
2098
+ * Children snapshot this value to detect when their parent has changed. */
2099
+ readonly worldMatrixVersion: number;
2100
+ }
2101
+
2102
+ /** Shared base for all light types.
2103
+ * Provides pipeline integration callbacks so render pipelines are light-agnostic. */
2104
+ export declare interface LightBase extends IWorldMatrixProvider, IParentable {
2105
+ readonly lightType: string;
2106
+ children: SceneNode[];
2107
+ /** Mesh IDs excluded from this light. If set, these meshes are NOT lit by this light. */
2108
+ excludedMeshIds?: ReadonlySet<string>;
2109
+ /** If non-empty, ONLY these mesh IDs are lit by this light. Takes priority over excludedMeshIds. */
2110
+ includedOnlyMeshIds?: ReadonlySet<string>;
2111
+ /** Shadow generator attached to this light. Set this to make the light cast shadows. */
2112
+ shadowGenerator?: ShadowGenerator;
2113
+ parent: IWorldMatrixProvider | null;
2114
+ readonly worldMatrix: Mat4;
2115
+ readonly worldMatrixVersion: number;
2116
+
2117
+ /** Options for `createLinearDepthMaterial()`. */
2118
+ export declare interface LinearDepthMaterialOptions {
2119
+ /** Camera near plane (defaults to 0.03 to match the source playground). */
2120
+ near?: number;
2121
+ /** Camera far plane (defaults to 15 to match the source playground). */
2122
+ far?: number;
2123
+ /** Optional material name. */
2124
+ name?: string;
2125
+ }
2126
+
2127
+ /** Options for `loadSpriteAtlas`. PR 1 supports the `gridSize` path only. */
2128
+ export declare interface LoadAtlasOptions {
2129
+ /** Grid cell size `[w, h]` in pixels. Required in PR 1. */
2130
+ gridSize?: readonly [number, number];
2131
+ /** Reserved for future PR — TexturePacker-style JSON. Throws if used in PR 1. */
2132
+ metadataUrl?: string;
2133
+ sampling?: SpriteSampling;
2134
+ /** Marks the atlas as carrying premultiplied RGBA so the renderer picks the
2135
+ * premultiplied blend pipeline (`srcFactor: ONE`). Default `false` — matches
2136
+ * the bits PNG decoding produces. Set together with `premultiplyOnLoad: true`
2137
+ * for mathematically correct soft edges. Setting this `true` without
2138
+ * `premultiplyOnLoad: true` is only correct if the source image is *already*
2139
+ * premultiplied on disk (e.g. produced by a build step). */
2140
+ premultipliedAlpha?: boolean;
2141
+ /** Tell the texture loader to premultiply alpha at decode time
2142
+ * (`createImageBitmap({ premultiplyAlpha: "premultiply" })`). Default `false`.
2143
+ * Pair with `premultipliedAlpha: true` for the premultiplied blend pipeline. */
2144
+ premultiplyOnLoad?: boolean;
2145
+ textureOptions?: Texture2DOptions;
2146
+ }
2147
+
2148
+ /**
2149
+ * Load a .babylon scene file and return a AssetContainer.
2150
+ * Pass the result to addToScene() to populate the scene.
2151
+ *
2152
+ * @param engine - The engine (provides GPU device)
2153
+ * @param url - URL to the .babylon file
2154
+ * @param opts - Optional loader configuration
2155
+ */
2156
+ export declare function loadBabylon(engine: EngineContext, url: string, opts?: LoadBabylonOptions): Promise<AssetContainer>;
2157
+
2158
+ declare interface LoadBabylonOptions {
2159
+ /** Maximum number of meshes to load. Default: all. */
2160
+ maxMeshes?: number;
2161
+ /** Whether to load textures. Default: true. */
2162
+ loadTextures?: boolean;
2163
+ /** Whether to parse the camera from the file. Default: true. */
2164
+ loadCamera?: boolean;
2165
+ }
2166
+
2167
+ /**
2168
+ * Load a Basis Universal (.basis) texture, transcode it to the best GPU-supported
2169
+ * compressed format, and upload to a WebGPU texture.
2170
+ *
2171
+ * @param engine - The engine context.
2172
+ * @param url - URL of the .basis file.
2173
+ * @param opts - Sampler/address/filter options. `mipMaps` is ignored — basis
2174
+ * mips are used as-is. `invertY` is ignored — basis data is
2175
+ * already oriented for sampling.
2176
+ * @returns A Texture2D.
2177
+ */
2178
+ export declare function loadBasisTexture2D(engine: EngineContext, url: string, opts?: Texture2DOptions): Promise<Texture2D>;
2179
+
2180
+ /**
2181
+ * Load a Babylon.js .env environment file and upload cubemap + BRDF LUT to GPU.
2182
+ * BRDF LUT is decoded from a pre-baked RGBD PNG (matching BJS's embedded
2183
+ * environmentBRDFTexture) for pixel-perfect parity.
2184
+ */
2185
+ export declare function loadEnvironment(scene: SceneContext, url: string, options: {
2186
+ groundTextureUrl?: string;
2187
+ skipSkybox?: boolean;
2188
+ skipGround?: boolean;
2189
+ /**
2190
+ * URL for the skybox texture. Extension determines loading strategy:
2191
+ * - `.dds`: loads a DDS cube skybox (e.g. BJS CDN backgroundSkybox.dds). Tree-shaken when unused.
2192
+ * - `.env`: reuses the already-loaded specular cubemap as an HDR skybox (like BJS `createDefaultSkybox`).
2193
+ * Omit for the default flat-color background. Use `skipSkybox` to disable skybox entirely.
2194
+ */
2195
+ skyboxUrl?: string;
2196
+ /** Skybox size matching BJS createDefaultEnvironment skyboxSize option (default 20). */
2197
+ skyboxSize?: number;
2198
+ brdfUrl: string;
2199
+ }): Promise<EnvironmentTextures>;
2200
+
2201
+ /**
2202
+ * Load a .glb or .gltf file, parse it, and upload mesh + material data to GPU.
2203
+ * Supports both binary GLB and separate .gltf + .bin + image files.
2204
+ * Registers a deferred PBR renderable builder.
2205
+ * Automatically parses glTF animations if present.
2206
+ *
2207
+ * Returns a AssetContainer. Pass it to addToScene() which adds the hierarchy,
2208
+ * registers animation ticks, and applies any scene-level settings.
2209
+ */
2210
+ export declare function loadGltf(engine: EngineContext, url: string): Promise<AssetContainer>;
2211
+
2212
+ /**
2213
+ * Loads a Radiance `.hdr` (RGBE) equirectangular panorama and builds GPU-ready IBL textures
2214
+ * (prefiltered specular cubemap, BRDF LUT, and irradiance spherical harmonics), then attaches
2215
+ * them to the scene and queues optional skybox/ground background renderables.
2216
+ * @param scene - The scene to receive the environment textures and background renderables.
2217
+ * @param url - URL of the `.hdr` file to fetch.
2218
+ * @param options - Optional face size, skybox, and ground settings.
2219
+ * @returns The assembled environment textures (also stored on the scene).
2220
+ */
2221
+ export declare function loadHdrEnvironment(scene: SceneContext, url: string, options?: HdrLoadOptions): Promise<EnvironmentTextures>;
2222
+
2223
+ /**
2224
+ * Load a texture with KTX compressed format auto-selection and fallback.
2225
+ *
2226
+ * Tries each suffix in priority order, picks the first whose compressed format
2227
+ * the GPU supports, fetches and parses the KTX1 file, and uploads it as a
2228
+ * compressed GPU texture. Falls back to the base URL (loaded as a regular image)
2229
+ * if no suffix is supported or loading fails.
2230
+ *
2231
+ * @param engine - The engine context (device must have compressed texture features enabled).
2232
+ * @param baseUrl - The fallback image URL (e.g. "textures/grid.png").
2233
+ * @param suffixes - KTX suffixes to try in priority order (e.g. ["-astc.ktx", "-dxt.ktx", "-etc2.ktx"]).
2234
+ * @param opts - Texture options (sampler, address mode, etc.). `mipMaps` is ignored — KTX mips are used as-is.
2235
+ * @returns A Texture2D (same interface whether compressed or fallback).
2236
+ */
2237
+ export declare function loadKtxTexture2D(engine: EngineContext, baseUrl: string, suffixes: string[], opts?: Texture2DOptions): Promise<Texture2D>;
2238
+
2239
+ /** Load a skybox cube texture and register it on the scene.
2240
+ * The auto-builder will create the pipeline and render it.
2241
+ *
2242
+ * @param scene - Scene to register the skybox in
2243
+ * @param baseUrl - Base URL for cube faces (e.g., 'textures/skybox')
2244
+ * @param ext - File extension (e.g., '.jpg', '.png')
2245
+ * @param size - Box size (default 100, matches Babylon)
2246
+ */
2247
+ export declare function loadSkybox(scene: SceneContext, baseUrl: string, ext: string, size?: number): Promise<void>;
2248
+
2249
+ /** Fetch + parse a `.sog` archive and attach the resulting splat cloud to `scene`.
2250
+ *
2251
+ * The returned mesh has `rotation.x = Math.PI` set on the scene node, matching
2252
+ * the BJS reference convention. SOG / PlayCanvas / SuperSplat assets are
2253
+ * authored "Y-down", and BJS compensates with `mesh.rotation.x = Math.PI`
2254
+ * at scene-graph time. */
2255
+ export declare function loadSOG(scene: SceneContext, url: string): Promise<GaussianSplattingMesh>;
2256
+
2257
+ /** Fetch + parse a Gaussian-splat asset and attach it to `scene`. */
2258
+ export declare function loadSplat(scene: SceneContext, url: string, fragments?: readonly GsShaderFragment[]): Promise<GaussianSplattingMesh>;
2259
+
2260
+ /**
2261
+ * Load a sprite atlas from an image URL. PR 1 supports only the
2262
+ * `gridSize` path: the texture is fetched as a non-Y-flipped image
2263
+ * (so atlas UVs map top-down with `(0,0)` at the image top-left) and
2264
+ * partitioned into a grid via `createGridSpriteAtlas`.
2265
+ */
2266
+ export declare function loadSpriteAtlas(engine: EngineContext, textureUrl: string, options?: LoadAtlasOptions): Promise<SpriteAtlas>;
2267
+
2268
+ /** Fetch + parse a `.spz` asset and attach the splat cloud to `scene`.
2269
+ *
2270
+ * The returned mesh has `rotation.x = Math.PI` set on the scene node, matching
2271
+ * the BJS reference convention. SPZ assets are authored "Y-down", and BJS
2272
+ * compensates with `mesh.rotation.x = Math.PI` at scene-graph time. */
2273
+ export declare function loadSPZ(scene: SceneContext, url: string): Promise<GaussianSplattingMesh>;
2274
+
2275
+ /** Load an image from `url` into a GPU `Texture2D`, generating mipmaps by default.
2276
+ * Results are cached per device by URL + options, so repeated calls with the
2277
+ * same arguments share one texture promise.
2278
+ * @param engine - Engine context.
2279
+ * @param url - Image URL to fetch and decode.
2280
+ * @param opts - Sampler, format, and decode overrides.
2281
+ * @returns A promise resolving to the uploaded `Texture2D`. */
2282
+ export declare function loadTexture2D(engine: EngineContext, url: string, opts?: Texture2DOptions): Promise<Texture2D>;
2283
+
2284
+ /** Mark a material source (or one of its views) as needing UBO re-upload.
2285
+ * The source owns a monotonic version so multiple renderables/views can observe
2286
+ * the same mutation independently without racing on a single cleared boolean. */
2287
+ export declare function markMaterialUboDirty(materialOrView: Material): void;
2288
+
2289
+ /** 4x4 column-major matrix stored as a flat Float32Array (16 elements).
2290
+ * Layout matches WebGPU/WGSL mat4x4<f32> memory order. */
2291
+ declare type Mat4 = Float32Array & {
2292
+ readonly __brand: "Mat4";
2293
+ };
2294
+
2295
+ /** Compose TRS (translation * rotation * scale) into a single Mat4. */
2296
+ export declare function mat4Compose(tx: number, ty: number, tz: number, qx: number, qy: number, qz: number, qw: number, sx: number, sy: number, sz: number): Mat4;
2297
+
2298
+ /** Create a new identity Mat4. */
2299
+ export declare function mat4Identity(): Mat4;
2300
+
2301
+ /** Create a scaling matrix. */
2302
+ export declare function mat4Scale(x: number, y: number, z: number): Mat4;
2303
+
2304
+ /** Create a translation matrix. */
2305
+ export declare function mat4Translation(x: number, y: number, z: number): Mat4;
2306
+
2307
+ /** Base material interface — the polymorphic anchor shared by every concrete
2308
+ * material kind (Standard, PBR, Shader, Node). Concrete materials add their own
2309
+ * user-facing properties while the shared `_buildGroup` hook lets the renderer
2310
+ * dispatch every material through a common path. */
2311
+ export declare interface Material {
8
2312
  /** Optional human-readable name. Populated by loaders from the source asset
2313
+ * (e.g. the glTF material name) so callers can look a material up by name. */
2314
+ name?: string;
2315
+
2316
+ /** Exact material render-feature override used by MaterialView.
2317
+ * Feature bits are interpreted by each concrete material family. */
2318
+ export declare interface MaterialRenderFeatures {
2319
+ features: number;
2320
+ features2?: number;
2321
+ }
2322
+
2323
+ /**
2324
+ * Full variant data for a loaded glTF asset.
2325
+ * Populated by loadGltf() when KHR_materials_variants is present.
2326
+ *
2327
+ * Note: variant data holds direct references to Mesh objects from the load.
2328
+ * Cloned hierarchies (via cloneTransformNode) are NOT variant-aware.
2329
+ */
2330
+ export declare interface MaterialVariantData {
2331
+ /** Ordered list of available variant names. */
2332
+ readonly names: readonly string[];
2333
+ /** Per-variant mesh→material mappings. Key = variant name. */
2334
+ readonly variants: Readonly<Record<string, readonly VariantMeshEntry[]>>;
2335
+ /** Original (default) materials for all variant-participating meshes. */
2336
+ readonly originals: readonly VariantMeshEntry[];
2337
+ }
2338
+
2339
+ /** A lightweight render view over an editable source material.
2340
+ * The view is also a Material: it inherits material state from {@link source}
2341
+ * through the prototype chain and owns only render-feature bits. Keeping views
2342
+ * material-compatible lets ordinary render paths read properties normally, so
2343
+ * scenes that never create views do not retain view-specific unwrap branches. */
2344
+ export declare interface MaterialView extends Material {
2345
+ readonly source: Material;
2346
+
2347
+ /** Maximum number of scene lights packed into the shared lights UBO.
2348
+ * Babylon.js defaults to 4 lights per material; Babylon Lite's cap is scene-wide
2349
+ * because all materials index the same group-0 lights buffer. Raise via
2350
+ * `setMaxLights(n)` before creating any scene / loading any asset that needs
2351
+ * more lights (e.g. the glTF loader auto-raises this when an asset declares
2352
+ * more KHR_lights_punctual lights than the current cap). */
2353
+ export declare let MAX_LIGHTS: number;
2354
+
2355
+ /** A renderable mesh — plain data with transform, material, and GPU geometry.
2356
+ * Works with both standard and PBR pipelines; routing is based on material type.
2357
+ * Extends SceneNode for the full TRS + parent + children hierarchy. */
2358
+ export declare interface Mesh extends SceneNode {
2359
+ /** Unique ID from source file (e.g. .babylon). Used for light include/exclude filtering. */
2360
+ id?: string;
2361
+ material: Material;
2362
+ receiveShadows: boolean;
2363
+ /** World-space bounding box (set by loaders for camera framing). */
2364
+ boundMin?: [number, number, number];
2365
+ boundMax?: [number, number, number];
2366
+ /** Skeleton GPU data (skeletal animation). Type-only — no module dependency. */
2367
+ skeleton?: SkeletonData | null;
2368
+ /** Morph target GPU data. Type-only — no module dependency. */
2369
+ morphTargets?: MorphTargetData | null;
2370
+ /** User-controlled render order. Lower = drawn first within phase.
2371
+ * Only affects ordering within the opaque or transparent phase. */
2372
+ renderOrder?: number;
2373
+ /** Thin instance data (CPU-side). GPU buffer managed by render system. */
2374
+ thinInstances?: ThinInstanceData | null;
2375
+
2376
+ /** Opaque GPU geometry handle (user never touches these). */
2377
+ export declare interface MeshGPU {
2378
+ readonly positionBuffer: GPUBuffer;
2379
+ readonly normalBuffer: GPUBuffer;
2380
+ readonly tangentBuffer?: GPUBuffer | null;
2381
+ readonly uvBuffer: GPUBuffer;
2382
+ readonly uv2Buffer?: GPUBuffer | null;
2383
+ readonly colorBuffer?: GPUBuffer | null;
2384
+ readonly hasUv?: boolean;
2385
+ readonly hasUv2?: boolean;
2386
+ readonly hasTangent?: boolean;
2387
+ readonly hasColor?: boolean;
2388
+ readonly indexBuffer: GPUBuffer;
2389
+ readonly indexCount: number;
2390
+ readonly indexFormat: GPUIndexFormat;
2391
+
2392
+ /** Connects a morph-target mesh to its GPU weight buffer for per-frame updates. */
2393
+ declare interface MorphBinding {
2394
+ /** Node index that owns the morph targets. */
2395
+ readonly nodeIdx: number;
2396
+ /** GPU uniform buffer written each frame with current weights. */
2397
+ readonly weightsBuffer: GPUBuffer;
2398
+ /** CPU mirror of the first four current weights, used by deformation-aware picking. */
2399
+ readonly weights: Float32Array;
2400
+ /** Number of morph targets (max 4 supported). */
2401
+ readonly targetCount: number;
2402
+ readonly runtimeMorphTargets?: MorphTargetData;
2403
+ }
2404
+
2405
+ /** Morph target GPU data — delta texture + weights UBO.
2406
+ * Created by createMorphTargets() in morph/create-morph-targets.ts.
2407
+ * Attached to mesh.morphTargets. */
2408
+ export declare interface MorphTargetData {
2409
+ readonly texture: GPUTexture;
2410
+ readonly count: number;
2411
+ readonly weightsBuffer: GPUBuffer;
2412
+ readonly targets: readonly {
2413
+ positions: Float32Array;
2414
+ normals: Float32Array | null;
2415
+ }[];
2416
+ readonly weights: Float32Array<ArrayBuffer>;
2417
+ }
2418
+
2419
+ /** Pure-state handle for a crowd. */
2420
+ export declare interface NavCrowd {
2421
+
2422
+ /** Pure-state handle for the navigation plugin. */
2423
+ export declare interface NavigationPlugin {
2424
+
2425
+ /** NavMesh build parameters (Recast solo / tiled / tile-cache navmesh config). */
2426
+ export declare interface NavMeshParameters {
2427
+ cs?: number;
2428
+ ch?: number;
2429
+ walkableSlopeAngle?: number;
2430
+ walkableHeight?: number;
2431
+ walkableClimb?: number;
2432
+ walkableRadius?: number;
2433
+ maxEdgeLen?: number;
2434
+ maxSimplificationError?: number;
2435
+ minRegionArea?: number;
2436
+ mergeRegionArea?: number;
2437
+ maxVertsPerPoly?: number;
2438
+ detailSampleDist?: number;
2439
+ detailSampleMaxError?: number;
2440
+ /** Skip reversing winding when extracting positions (right-handed input). */
2441
+ doNotReverseIndices?: boolean;
2442
+ /** Tile size for tiled / tile-cache navmesh. Recommended 32-64 for tile cache. */
2443
+ tileSize?: number;
2444
+ /**
2445
+ * Maximum number of obstacles. If `> 0` the navmesh is built with a tile cache
2446
+ * so obstacles can be added/removed dynamically.
2447
+ */
2448
+ maxObstacles?: number;
2449
+ /** Expected layers per tile for tile-cache navmesh. Default 1. */
2450
+ expectedLayersPerTile?: number;
2451
+ /** Off-mesh connection segments (teleports) baked into the navmesh. */
2452
+ offMeshConnections?: OffMeshConnection[];
2453
+ /** Keep intermediates for debug visualization. */
2454
+ keepIntermediates?: boolean;
2455
+ }
2456
+
2457
+ /** Parsed block in the graph. */
2458
+ declare interface NodeBlock {
2459
+ readonly id: number;
2460
+ /** BJS class name (e.g. "InputBlock", "TransformBlock", "FragmentOutputBlock"). */
2461
+ readonly className: string;
2462
+ /** Author-provided block name. */
2463
+ readonly name: string;
2464
+ /** Inputs by name. */
2465
+ readonly inputs: ReadonlyMap<string, NodeConnection>;
2466
+ /** Output names (type is resolved by the emitter). */
2467
+ readonly outputs: ReadonlySet<string>;
2468
+ /** Original serialized JSON for emitters that need extra fields (mode, value, etc.). */
2469
+ readonly serialized: Readonly<Record<string, unknown>>;
2470
+ }
2471
+
2472
+ /** Build state threaded through every emit call. */
2473
+ declare interface NodeBuildState {
2474
+ readonly vertex: StageState;
2475
+ readonly fragment: StageState;
2476
+ readonly vertexAttributes: VertexAttribute[];
2477
+ readonly varyings: Varying[];
2478
+ readonly nodeUboFields: UboField[];
2479
+ readonly bindings: BindingDecl[];
2480
+ readonly textures: NodeTextureBinding[];
2481
+ /** PBRMetallicRoughnessBlock helper bodies are large, so the block records
2482
+ * feature-specific helper requests here and node-material resolves them
2483
+ * through dynamic imports after graph emission. */
2484
+ readonly pbrMrHelperRequests: NodePbrMrHelperRequest[];
2485
+ /** Active LoopBlock storage variables keyed by `${stage}|${blockId}` while
2486
+ * the loop body is being emitted. StorageReadBlock/StorageWriteBlock use
2487
+ * this to route their loopID object connection to the mutable WGSL var. */
2488
+ readonly loopVariables: Map<string, NodeLoopVariable>;
2489
+ /** Monotonic counter for SSA temp names, shared across stages. */
2490
+ nextTemp: number;
2491
+ /** Set by any block that references the scene lights UBO (LightBlock,
2492
+ * LightInformationBlock, …). The pipeline builder allocates a binding +
2493
+ * struct decls + BGL entry when true. */
2494
+ usesLightsUbo: boolean;
2495
+ /** Set by ScreenSizeBlock. The pipeline exposes the current canvas size via
2496
+ * spare base scene-UBO scalars (no extra bindings / no per-graph UBO size change). */
2497
+ usesScreenSize: boolean;
2498
+ /** Set by FragDepthBlock. The pipeline switches the fragment return type
2499
+ * from a bare color to a `color+@builtin(frag_depth)` output struct. */
2500
+ usesFragDepth: boolean;
2501
+ usesClipPlanes: boolean;
2502
+ usesMeshAttributeExists: boolean;
2503
+ /** Set by MorphTargetsBlock. The pipeline allocates two vertex-only
2504
+ * bindings (morph texture + morph UBO), declares the struct, and adds
2505
+ * a `@builtin(vertex_index)` param to vs_main. */
2506
+ usesMorphTargets: boolean;
2507
+ /** Set by parseNodeMaterialFromSnippet when shadowGenerators are supplied.
2508
+ * The pipeline allocates shadow bindings (texture + sampler + UBO) per
2509
+ * shadow-casting light, emits light-space varyings in vs_main, and injects
2510
+ * a `nme_computeShadowFactors` helper that LightBlock calls before the
2511
+ * lighting loop. Zero entries = no bindings, no WGSL — invisible to scenes
2512
+ * without shadows. */
2513
+ shadowLights: {
2514
+ lightIndex: number;
2515
+ shadowType: "esm" | "pcf";
2516
+ }[];
2517
+ /** Set by ReflectionBlock or any block that needs scene env textures
2518
+ * (specular cube + BRDF LUT + SH irradiance). The pipeline allocates
2519
+ * 4 group-1 bindings (env_iblTexture/sampler + env_brdfLUT/sampler) and
2520
+ * reads SH coefficients + envRotationY + lodGenerationScale from the
2521
+ * canonical frame-graph scene UBO. Materials without env
2522
+ * pay zero — empty default. */
2523
+ usesEnv: boolean;
2524
+ /** Set by ClearCoatBlock; tells PBRMetallicRoughnessBlock to walk into
2525
+ * the connected ClearCoatBlock and emit the clear-coat layer code path
2526
+ * (extra GGX layer + Fresnel modulation of the base specular). */
2527
+ usesClearcoat: boolean;
2528
+ /** Set by SheenBlock; tells PBRMetallicRoughnessBlock to add the Charlie
2529
+ * NDF + Ashikhmin visibility sheen layer (cloth/velvet look). */
2530
+ usesSheen: boolean;
2531
+ /** Set by AnisotropyBlock; reserved for future anisotropic GGX path.
2532
+ * Currently used only to validate marker plumbing in scene 70 — at
2533
+ * intensity=0 the BJS anisotropic path reduces to standard GGX. */
2534
+ usesAnisotropy: boolean;
2535
+ /** Set by IridescenceBlock; tells PBRMetallicRoughnessBlock to replace the
2536
+ * base-layer F0 by the thin-film interference Fresnel color before direct
2537
+ * and IBL specular evaluation. */
2538
+ usesIridescence: boolean;
2539
+ /** Set by SubSurfaceBlock; reserved for future SS path. Marker only. */
2540
+ usesSubsurface: boolean;
2541
+ /** When false (default), BonesBlock emits a pass-through of its `world`
2542
+ * input — no skeleton binding is required. Set to true only when every
2543
+ * mesh using this material has a skeleton. */
2544
+ hasSkeleton: boolean;
2545
+ /** When false (default), InstancesBlock passes through the uniform world
2546
+ * matrix. Set to true when thin-instance attributes are bound. */
2547
+ hasInstances: boolean;
2548
+ }
2549
+
2550
+ /** A single connection point on a block — input only.
2551
+ * Output connection types are resolved by the emitter at graph-walk time. */
2552
+ declare interface NodeConnection {
2553
+ /** Connection name on the owning block (e.g. "rgb", "uv", "color"). */
2554
+ readonly name: string;
2555
+ /** For inputs only: the upstream block id + output name. Null if unconnected. */
2556
+ readonly source: NodeConnectionRef | null;
2557
+ }
2558
+
2559
+ declare interface NodeConnectionRef {
2560
+ readonly blockId: number;
2561
+ readonly outputName: string;
2562
+ }
2563
+
2564
+ declare interface NodeEmitContext {
2565
+ /** Resolve an input → WGSL expression (handles memoization + recursive walk). */
2566
+ readonly resolve: (block: NodeBlock, inputName: string, stage: Stage, state: NodeBuildState) => NodeExpr;
2567
+ /** Resolve a specific (producerBlock, outputName) — used when one block reads another directly. */
2568
+ readonly resolveOutput: (producer: NodeBlock, outputName: string, stage: Stage, state: NodeBuildState) => NodeExpr;
2569
+ /** Mint a fresh SSA temp name. */
2570
+ readonly temp: (state: NodeBuildState, prefix?: string) => string;
2571
+ /** Cast a typed expression to a target WGSL type when the shapes differ. */
2572
+ readonly cast: (value: NodeExpr, target: NodeValueType) => NodeExpr;
2573
+ /** Access the surrounding graph (so emitters can find upstream blocks). */
2574
+ readonly graph: NodeGraph;
2575
+
2576
+ /** Typed WGSL expression produced by an emitter. */
2577
+ declare interface NodeExpr {
2578
+ readonly expr: string;
2579
+ readonly type: NodeValueType;
2580
+ }
2581
+
2582
+ /** Parsed graph. Roots are FragmentOutputBlock + VertexOutputBlock (located by className). */
2583
+ declare interface NodeGraph {
2584
+ readonly blocks: ReadonlyMap<number, NodeBlock>;
2585
+ /** Named overridable inputs (uniform InputBlocks) — name → block id. */
2586
+ readonly namedInputs: ReadonlyMap<string, number>;
2587
+ /** BJS alpha mode (0=DISABLE, 2=COMBINE, …). Determines the GPU blend equation. */
2588
+ readonly alphaMode: number;
2589
+ /** Whether the material requires alpha blending at runtime.
2590
+ * Derived from the graph (FragmentOutputBlock.a is connected) plus
2591
+ * JSON-level overrides (`_needAlphaBlending`, `forceAlphaBlending`). */
2592
+ readonly needsAlphaBlending: boolean;
2593
+ /** Babylon.js material back-face culling flag. */
2594
+ readonly backFaceCulling: boolean;
2595
+ }
2596
+
2597
+ /** A live handle to one named Node Material input (uniform or texture). Set
2598
+ * `value` for scalar/vector inputs or `texture` for `texture2d` inputs; writes
2599
+ * flag the material UBO dirty so the change is uploaded next frame. */
2600
+ export declare interface NodeInputHandle {
2601
+ readonly type: "f32" | "vec2f" | "vec3f" | "vec4f" | "texture2d";
2602
+ value?: number | number[];
2603
+ texture?: Texture2D | null;
2604
+ }
2605
+
2606
+ declare interface NodeLoopVariable {
2607
+ readonly valueVar: string;
2608
+ readonly valueType: NodeValueType;
2609
+ readonly indexVar: string;
2610
+ }
2611
+
2612
+ /** A compiled Node Material (Babylon NME graph). Exposes an `inputs` map of
2613
+ * named handles for live uniform/texture updates, and dispatches rendering
2614
+ * through the inherited `_buildGroup` hook. */
2615
+ export declare interface NodeMaterial extends Material {
2616
+ readonly inputs: Record<string, NodeInputHandle>;
2617
+
2618
+ declare interface NodePbrMrHelperRequest {
2619
+ readonly key: string;
2620
+ readonly useEnv: boolean;
2621
+ readonly useClearcoat: boolean;
2622
+ readonly useSheen: boolean;
2623
+ readonly useRefraction: boolean;
2624
+ readonly useSubsurface: boolean;
2625
+ readonly useAnisotropy: boolean;
2626
+ readonly useIridescence: boolean;
2627
+ readonly useShAlbedoScaling: boolean;
2628
+ readonly useCcBump: boolean;
2629
+ readonly useCcTint: boolean;
2630
+ readonly useSpecularAA: boolean;
2631
+ readonly remapClearcoatF0: boolean;
2632
+ }
2633
+
2634
+ /** Per-node rest pose TRS + parent link for hierarchy traversal. */
2635
+ declare interface NodeRest {
2636
+ readonly parentIdx: number;
9
2637
  tx: number;
2638
+ ty: number;
2639
+ tz: number;
2640
+ rx: number;
2641
+ ry: number;
2642
+ rz: number;
2643
+ rw: number;
2644
+ sx: number;
2645
+ sy: number;
2646
+ sz: number;
2647
+ }
2648
+
2649
+ declare interface NodeTextureBinding {
2650
+ readonly name: string;
2651
+ readonly kind: "texture2d" | "textureCube";
2652
+ readonly texture: Texture2D | null;
2653
+ }
2654
+
2655
+ declare type NodeValueType = "f32" | "vec2f" | "vec3f" | "vec4f" | "mat4f" | "texture2d" | "textureCube";
2656
+
2657
+ /** Babylon-compatible normalized camera viewport. x/y/width/height are fractions of the render target. */
2658
+ export declare interface NormalizedViewport {
2659
+ x: number;
2660
+ y: number;
2661
+ width: number;
2662
+ height: number;
2663
+ }
2664
+
2665
+ /**
2666
+ * Normalizes the vector `(x, y, z)` to unit length.
2667
+ * @param x - X component.
2668
+ * @param y - Y component.
2669
+ * @param z - Z component.
2670
+ * @param epsilon - Length threshold below which the vector is treated as degenerate.
2671
+ * @returns The unit-length vector, or `[0, 1, 0]` if the input length is at or below `epsilon`.
2672
+ */
2673
+ export declare function normalizeVec3(x: number, y: number, z: number, epsilon?: number): Vec3Tuple;
2674
+
2675
+ /**
2676
+ * A 4-component quaternion whose `x`/`y`/`z`/`w` setters fire an `onDirty` callback
2677
+ * when a component actually changes, letting the hierarchy system detect rotation updates.
2678
+ */
2679
+ export declare class ObservableQuat implements Quat {
2680
+ private _x;
2681
+ private _y;
2682
+ private _z;
2683
+ private _w;
2684
+ private readonly _onDirty;
2685
+ constructor(x: number, y: number, z: number, w: number, onDirty: () => void);
2686
+ get x(): number;
2687
+ set x(v: number);
2688
+ get y(): number;
2689
+ set y(v: number);
2690
+ get z(): number;
2691
+ set z(v: number);
2692
+ get w(): number;
2693
+ set w(v: number);
2694
+ /** Bulk set — one dirty notification instead of four. */
2695
+ set(x: number, y: number, z: number, w: number): void;
2696
+ /** Copy values from another quaternion. */
2697
+ copyFrom(q: Quat): void;
2698
+ /** Copy into a Float32Array at offset. */
2699
+ toArray(out: Float32Array, offset?: number): void;
2700
+ }
2701
+
2702
+ export declare class ObservableVec3 implements Vec3 {
2703
+ private _x;
2704
+ private _y;
2705
+ private _z;
2706
+ private readonly _onDirty;
2707
+ constructor(x: number, y: number, z: number, onDirty: () => void);
2708
+ get x(): number;
2709
+ set x(v: number);
2710
+ get y(): number;
2711
+ set y(v: number);
2712
+ get z(): number;
2713
+ set z(v: number);
2714
+ /** Bulk set — one dirty notification instead of three. */
2715
+ set(x: number, y: number, z: number): void;
2716
+ /** Copy values from another vector. */
2717
+ copyFrom(v: Vec3): void;
2718
+ /** Copy into a Float32Array at offset. */
2719
+ toArray(out: Float32Array, offset?: number): void;
2720
+ }
2721
+
2722
+ /** Opaque handle returned by `addBoxObstacle` / `addCylinderObstacle`. */
2723
+ export declare interface ObstacleHandle {
2724
+
2725
+ /** Off-mesh connection (teleport segment) baked into the navmesh. */
2726
+ export declare interface OffMeshConnection {
2727
+ startPosition: Vec3;
2728
+ endPosition: Vec3;
2729
+ radius: number;
2730
+ bidirectional: boolean;
2731
+ /** @defaultValue 0 */
2732
+ area?: number;
2733
+ /** @defaultValue 1 */
2734
+ flags?: number;
2735
+ userId?: number;
2736
+ }
2737
+
2738
+ /** Register a callback to run before each rendered frame. */
2739
+ export declare function onBeforeRender(scene: SceneContext, cb: (deltaMs: number) => void): void;
2740
+
2741
+ /** Register a callback to run when `disposeScene` is called. Used to tie
2742
+ * user-owned GPU resources (e.g. a `SpriteRenderer`) to the scene's lifetime. */
2743
+ export declare function onSceneDispose(scene: SceneContext, cb: () => void): void;
2744
+
2745
+ /** Parse a Babylon NME graph (by snippet ID or inline JSON), emit WGSL, compile
2746
+ * the GPU pipeline, and return a ready-to-render `NodeMaterial`.
2747
+ * @param engine - Engine context.
2748
+ * @param snippetId - Snippet server ID; ignored when `options.json` is supplied.
2749
+ * @param options - Inline JSON, texture overrides, shadow generators, and graph flags.
2750
+ * @returns A promise resolving to the compiled `NodeMaterial`. */
2751
+ export declare function parseNodeMaterialFromSnippet(engine: EngineContext, snippetId: string, options?: ParseNodeMaterialOptions): Promise<NodeMaterial>;
2752
+
2753
+ /** Options for `parseNodeMaterialFromSnippet()`. */
2754
+ export declare interface ParseNodeMaterialOptions {
2755
+ readonly snippetServer?: string;
2756
+ /** Pre-resolved JSON (object or string). When provided, bypasses the network. */
2757
+ readonly json?: string | object;
2758
+ /** Texture overrides keyed by TextureBlock / ImageSourceBlock name. */
2759
+ readonly textures?: Readonly<Record<string, Texture2D>>;
2760
+ /** Shadow generators to integrate into the material. Each contributes
2761
+ * one shadow-light slot whose lightIndex is the position of its light in
2762
+ * `scene.lights` at the time of rendering. Materials built without this
2763
+ * option have zero shadow bindings / zero shadow WGSL. */
2764
+ readonly shadowGenerators?: readonly ShadowGenerator[];
2765
+ /** For each entry in shadowGenerators, the index of the owning light in
2766
+ * scene.lights. When omitted, defaults to [0, 1, …] (first N lights). */
2767
+ readonly shadowLightIndices?: readonly number[];
2768
+ /** When true, BonesBlock produces a skinned world matrix (requires all
2769
+ * meshes using this material to have a skeleton). Default false. */
2770
+ readonly hasSkeleton?: boolean;
2771
+ /** When true, InstancesBlock wires per-instance attributes. Default false. */
2772
+ readonly hasInstances?: boolean;
2773
+ /** Optional graph-specific block loader. Avoids the full default registry when callers know the exact block set. */
2774
+ readonly blockLoader?: (className: string) => Promise<BlockEmitter>;
2775
+ }
2776
+
2777
+ /** Base interface every frame-graph pass implements: a named unit of GPU work with `_initialize` / `_execute` / `_dispose` lifecycle hooks. */
2778
+ export declare interface Pass {
2779
+ readonly name: string;
2780
+
2781
+ /** Pause playback of an animation group. */
2782
+ export declare function pauseAnimation(group: AnimationGroup): void;
2783
+
2784
+ /** User-facing properties for a physically based (metallic-roughness) material.
2785
+ * Create one manually via `createPbrMaterial()` or let `loadGltf()` build it.
2786
+ * Optional sub-feature objects (clearcoat, sheen, anisotropy, subsurface) are
2787
+ * only bundled when referenced. */
2788
+ export declare interface PbrMaterialProps extends Material {
2789
+ baseColorTexture?: Texture2D;
2790
+ /** Linear RGB/A factor multiplied with the base-color texture (glTF baseColorFactor). Default [1,1,1,1]. */
2791
+ baseColorFactor?: [number, number, number, number];
2792
+ normalTexture?: Texture2D;
2793
+ /** Normal map scale (glTF normalTexture.scale). Default 1.0. */
2794
+ normalTextureScale?: number;
2795
+ /** Occlusion-Roughness-Metallic packed: R=occ, G=rough, B=metal. */
2796
+ ormTexture?: Texture2D;
2797
+ emissiveTexture?: Texture2D;
2798
+ /** Emissive color as float uniform (linear RGB). Used when no emissiveTexture.
2799
+ * If both set, emissiveColor multiplies emissiveTexture. */
2800
+ emissiveColor?: [number, number, number];
2801
+ /** KHR_materials_pbrSpecularGlossiness: RGB=specular, A=glossiness. */
2802
+ specGlossTexture?: Texture2D;
2803
+ /** Whether material is double-sided (disables back-face culling). */
2804
+ doubleSided?: boolean;
2805
+ /** Overall material alpha (0=fully transparent, 1=opaque). Default 1.0. */
2806
+ alpha?: number;
2807
+ /** Enable alpha blending (glTF alphaMode "BLEND"). Enables radianceOverAlpha + specularOverAlpha. */
2808
+ alphaBlend?: boolean;
2809
+ /** Alpha test cutoff (glTF alphaMode "MASK"). Fragments with base alpha * material alpha below this value are discarded. */
2810
+ alphaCutOff?: number;
2811
+ /** Scale factor for environment/IBL contribution. Default 1.0. */
2812
+ environmentIntensity?: number;
2813
+ /** Scale factor for direct light contribution. Default 1.0. */
2814
+ directIntensity?: number;
2815
+ /** Whether direct point/spot lights use physical inverse-square falloff.
2816
+ * Default true, matching Babylon.js PBRMaterial. Set false for Standard-style
2817
+ * linear range + spot exponent falloff (`usePhysicalLightFalloff = false`). */
2818
+ usePhysicalLightFalloff?: boolean;
2819
+ /** Dielectric F0 reflectance (default 0.04, glass ≈ 0.2). */
2820
+ reflectance?: number;
2821
+ /** glTF metallicFactor multiplier applied over ORM.b metallic channel. Default 1.0. */
2822
+ metallicFactor?: number;
2823
+ /** glTF roughnessFactor multiplier applied over ORM.g roughness channel. Default 1.0. */
2824
+ roughnessFactor?: number;
2825
+ /** Strength of ambient occlusion from ORM R channel. Default 1.0; 0.0 ignores R channel. */
2826
+ occlusionStrength?: number;
2827
+ /** UV set index for the occlusion texture (0 = UV1, 1 = UV2). Default 0. */
2828
+ occlusionTexCoord?: number;
2829
+ /** Separate occlusion texture sampled with UV2 when occlusionTexCoord=1.
2830
+ * R channel is occlusion. When set, ORM.r is NOT used for occlusion. */
2831
+ occlusionTexture?: Texture2D;
2832
+ /** Scales dielectric F0 (default 1.0). Maps to BJS metallicF0Factor. */
2833
+ metallicF0Factor?: number;
2834
+ /** Grazing specular/F90 weight (default follows metallicF0Factor for legacy callers). */
2835
+ specularWeight?: number;
2836
+ /** Tints dielectric reflectance (linear RGB, default [1,1,1]). Maps to BJS metallicReflectanceColor. */
2837
+ metallicReflectanceColor?: [number, number, number];
2838
+ /** Texture whose RGB tints reflectance and A scales F0. Maps to BJS metallicReflectanceTexture. */
2839
+ metallicReflectanceTexture?: Texture2D;
2840
+ /** Texture whose RGB tints reflectance only. Maps to BJS reflectanceTexture. */
2841
+ reflectanceTexture?: Texture2D;
2842
+ /** When true + both reflectance textures set, metallicReflectanceTexture only contributes A (F0 scalar). */
2843
+ useOnlyMetallicFromMetallicReflectanceTexture?: boolean;
2844
+ /** Enable specular anti-aliasing on IBL alphaG (matches BJS SPECULARAA). Default false.
2845
+ * Set automatically by the glTF loader for materials loaded from glTF files. */
2846
+ enableSpecularAA?: boolean;
2847
+ /** Clearcoat layer configuration. When set with isEnabled=true, adds a glossy transparent
2848
+ * top layer (like car paint or lacquer). Tree-shakable — only bundled when used. */
2849
+ clearCoat?: ClearCoatProps;
2850
+ /** Sheen layer configuration. When set with isEnabled=true, adds a soft velvet-like
2851
+ * sheen layer (like fabric or cloth). Tree-shakable — only bundled when used. */
2852
+ sheen?: SheenProps;
2853
+ /** Iridescence thin-film configuration. When set with isEnabled=true, replaces
2854
+ * base-layer F0 with a wavelength-dependent thin-film Fresnel blend.
2855
+ * Maps to BJS PBRMaterial.iridescence and KHR_materials_iridescence.
2856
+ * Tree-shakable — only bundled when used. */
2857
+ iridescence?: IridescenceProps;
2858
+ /** When true, the albedo texture is in sRGB/gamma space (loaded as rgba8unorm)
2859
+ * and the shader applies pow(baseColor, 2.2) for sRGB→linear conversion.
2860
+ * Matches BJS PBRMaterial's Texture.gammaSpace=true behavior.
2861
+ * When false (default), assumes the texture already provides linear values
2862
+ * (e.g. rgba8unorm-srgb format or glTF sRGB textures). */
2863
+ gammaAlbedo?: boolean;
2864
+ /** Anisotropy layer configuration. When set with isEnabled=true, stretches specular
2865
+ * highlights along a preferred direction. Tree-shakable — only bundled when used. */
2866
+ anisotropy?: AnisotropyProps;
2867
+ /** Subsurface configuration. Presence of nested sub-features (translucency, scattering)
2868
+ * enables them — no isEnabled booleans needed. Tree-shakable — only bundled when used. */
2869
+ subsurface?: SubSurfaceProps;
2870
+ /** True transmissive surface: render task provides a scene-color refraction texture
2871
+ * just before this material draws. Set by KHR_materials_transmission. */
2872
+ transmissive?: boolean;
2873
+ /** When true, the material samples the environment cubemap using the view direction
2874
+ * (camera→fragment) instead of the reflected view direction. Used for PBR skybox boxes
2875
+ * where the mesh surrounds the camera and should display the environment directly.
2876
+ * Also zeroes SH irradiance — skybox is pure cubemap + BRDF only. */
2877
+ skyboxMode?: boolean;
2878
+ /** When true, the material is unlit — the base color is output directly,
2879
+ * bypassing all lighting, IBL, tonemap, and shading calculations.
2880
+ * Matches `KHR_materials_unlit` glTF extension. Alpha handling is preserved. */
2881
+ unlit?: boolean;
2882
+ /** Linear-RGB tint applied to baseColor when `unlit` is true (i.e. glTF
2883
+ * `baseColorFactor`). When omitted or [1,1,1], no tint is applied.
2884
+ * Only bundled/bound when the unlit extension is active. */
2885
+ unlitColor?: [number, number, number];
2886
+
2887
+ /** Configuration for a directional-light PCF shadow generator: map size, depth bias, darkness, and ortho projection bounds. */
2888
+ export declare interface PcfDirectionalShadowGeneratorConfig {
2889
+ mapSize?: number;
2890
+ bias?: number;
2891
+ darkness?: number;
2892
+ normalBias?: number;
2893
+ /** Ortho near plane. Default 1. */
2894
+ orthoMinZ?: number;
2895
+ /** Ortho far plane. Default 10000. */
2896
+ orthoMaxZ?: number;
2897
+ /** Force the shadow map to be regenerated every frame. Default false. */
2898
+ forceRefreshEveryFrame?: boolean;
2899
+ }
2900
+
2901
+ /** Configuration for a spot-light PCF shadow generator: map size, depth bias, darkness, and projection near/far planes. */
2902
+ export declare interface PcfSpotlightShadowGeneratorConfig {
2903
+ mapSize?: number;
2904
+ bias?: number;
2905
+ darkness?: number;
2906
+ normalBias?: number;
2907
+ /** Near plane for the shadow projection. Default: uses camera near (1). */
2908
+ near?: number;
2909
+ /** Far plane for the shadow projection. Default: uses camera far or light range. */
2910
+ far?: number;
2911
+ /** Force the shadow map to be regenerated every frame. Default false. */
2912
+ forceRefreshEveryFrame?: boolean;
2913
+ }
2914
+
2915
+ /** A body and its shape wired together, as produced by `createPhysicsAggregate`. */
2916
+ export declare interface PhysicsAggregate {
2917
+ readonly body: PhysicsBody;
2918
+ readonly shape: PhysicsShape;
2919
+ }
2920
+
2921
+ /** Options for `createPhysicsAggregate`: mass, material (friction/restitution), and optional shape geometry overrides. */
2922
+ export declare interface PhysicsAggregateOptions {
2923
+ mass: number;
2924
+ friction?: number;
2925
+ restitution?: number;
2926
+ radius?: number;
2927
+ pointA?: Vec3;
2928
+ pointB?: Vec3;
2929
+ extents?: Vec3;
2930
+ rotation?: Quat;
2931
+ center?: Vec3;
2932
+ startAsleep?: boolean;
2933
+ isTriggerShape?: boolean;
2934
+ }
2935
+
2936
+ /** Opaque handle to a Havok rigid body, bound to a scene node and a motion type. */
2937
+ export declare interface PhysicsBody {
10
2938
  readonly node: SceneNode;
2939
+ readonly motionType: PhysicsMotionType;
2940
+ }
2941
+
2942
+ /** How a body moves: `STATIC` (immovable), `ANIMATED` (driven by the node transform), or `DYNAMIC` (simulated). */
2943
+ export declare const enum PhysicsMotionType {
2944
+ STATIC = 0,
2945
+ ANIMATED = 1,
2946
+ DYNAMIC = 2
2947
+ }
2948
+
2949
+ /** Opaque handle to a Havok collision shape. */
2950
+ export declare interface PhysicsShape {
2951
+
2952
+ /** Options for `createPhysicsShape`: the shape type plus its geometry parameters. */
2953
+ export declare interface PhysicsShapeOptions {
2954
+ type: PhysicsShapeType;
2955
+ parameters?: PhysicsShapeParameters;
2956
+ }
2957
+
2958
+ /** Geometry parameters describing a collision shape; which fields apply depends on the shape type. */
2959
+ export declare interface PhysicsShapeParameters {
2960
+ center?: Vec3;
2961
+ radius?: number;
2962
+ pointA?: Vec3;
2963
+ pointB?: Vec3;
2964
+ rotation?: Quat;
2965
+ extents?: Vec3;
2966
+ }
2967
+
2968
+ /** Geometry type of a physics collision shape. */
2969
+ export declare const enum PhysicsShapeType {
2970
+ SPHERE = 0,
2971
+ CAPSULE = 1,
2972
+ CYLINDER = 2,
2973
+ BOX = 3,
2974
+ CONVEX_HULL = 4,
2975
+ CONTAINER = 5,
2976
+ MESH = 6,
2977
+ HEIGHTFIELD = 7
2978
+ }
2979
+
2980
+ /** Pure-state handle to a Havok physics world: the WASM module, the native world, its bodies, and the timestep. */
2981
+ export declare interface PhysicsWorld {
2982
+
2983
+ /** Pick the mesh at CSS-space canvas coordinates, matching Babylon.js Scene.pick. Returns a PickingInfo. */
2984
+ export declare function pickAsync(picker: GpuPicker, x: number, y: number): Promise<PickingInfo>;
2985
+
2986
+ /** Result of a GPU pick operation. */
2987
+ export declare interface PickingInfo {
2988
+ hit: boolean;
2989
+ distance: number;
2990
+ pickedPoint: [number, number, number] | null;
2991
+ pickedNormal: [number, number, number] | null;
2992
+ pickedNormalWorld: [number, number, number] | null;
2993
+ pickedFaceNormal: [number, number, number] | null;
2994
+ pickedFaceNormalWorld: [number, number, number] | null;
2995
+ /** The picked mesh. May be a regular Lite `Mesh` or a `GaussianSplattingMesh`
2996
+ * (when GS picking via the gs-picking-pipeline ports the BJS
2997
+ * `GaussianSplattingGpuPickingMaterialPlugin`). */
2998
+ pickedMesh: Mesh | GaussianSplattingMesh | null;
2999
+ faceId: number;
3000
+ bu: number;
3001
+ bv: number;
3002
+ subMeshId: number;
3003
+ thinInstanceIndex: number;
3004
+ ray: Ray | null;
3005
+ }
3006
+
3007
+ /** Sampler and format overrides for `createTexture2DFromPixels()`. */
3008
+ export declare interface PixelsTexture2DOptions {
3009
+ /** Address mode U. Default 'clamp-to-edge'. */
3010
+ addressModeU?: GPUAddressMode;
3011
+ /** Address mode V. Default 'clamp-to-edge'. */
3012
+ addressModeV?: GPUAddressMode;
3013
+ /** Min filter. Default 'nearest'. */
3014
+ minFilter?: GPUFilterMode;
3015
+ /** Mag filter. Default 'nearest'. */
3016
+ magFilter?: GPUFilterMode;
3017
+ /** Use sRGB format (rgba8unorm-srgb) so the hardware converts to linear on
3018
+ * sample. Use for color data; leave false for lookup tables. Default false. */
3019
+ srgb?: boolean;
3020
+ }
3021
+
3022
+ /** A viewport expressed in integer render-target pixels, with `y` measured from the top (WebGPU convention). */
3023
+ export declare interface PixelViewport {
3024
+ x: number;
3025
+ y: number;
3026
+ width: number;
3027
+ height: number;
3028
+ }
3029
+
3030
+ /** Options for `createPlaneData`. Subset of Babylon's CreatePlane. */
3031
+ export declare interface PlaneOptions {
3032
+ size?: number;
3033
+ width?: number;
3034
+ height?: number;
3035
+ }
3036
+
3037
+ /** Start playing an animation group. */
3038
+ export declare function playAnimation(group: AnimationGroup): void;
3039
+
3040
+ /**
3041
+ * Plays a frame animation on a billboard sprite addressed by its stable handle.
3042
+ * The handle is resolved each tick, so the animation survives swap-remove reindexing.
3043
+ * @param manager - Animation manager that drives the playback.
3044
+ * @param handle - Stable handle of the billboard sprite to animate.
3045
+ * @param from - First frame index of the range.
3046
+ * @param to - Last frame index of the range.
3047
+ * @param loop - When `true`, the animation restarts after reaching `to`.
3048
+ * @param delayMs - Delay in milliseconds between frame steps.
3049
+ * @param options - Optional end callback and removal behaviour.
3050
+ * @returns The created sprite frame animation.
3051
+ */
3052
+ export declare function playBillboardSpriteAnimation(manager: SpriteAnimationManager, handle: BillboardSpriteHandle, from: number, to: number, loop: boolean, delayMs: number, options?: PlaySpriteAnimationOptions): SpriteFrameAnimation;
3053
+
3054
+ /**
3055
+ * Play a frame animation against a raw billboard sprite slot index.
3056
+ *
3057
+ * This is the zero-handle, slot-based path for structurally stable systems.
3058
+ * If the slot is swap-removed externally, the animation follows whatever
3059
+ * sprite later occupies the same index. Use `playBillboardSpriteAnimation`
3060
+ * with a handle when animation must track a stable sprite identity across removals.
3061
+ */
3062
+ export declare function playBillboardSpriteIndexAnimation(manager: SpriteAnimationManager, system: BillboardSpriteSystem, index: number, from: number, to: number, loop: boolean, delayMs: number, options?: PlaySpriteAnimationOptions): SpriteFrameAnimation;
3063
+
3064
+ /**
3065
+ * Plays a frame animation on a 2D sprite addressed by its stable handle.
3066
+ * The handle is resolved each tick, so the animation survives swap-remove reindexing.
3067
+ * @param manager - Animation manager that drives the playback.
3068
+ * @param handle - Stable handle of the sprite to animate.
3069
+ * @param from - First frame index of the range.
3070
+ * @param to - Last frame index of the range.
3071
+ * @param loop - When `true`, the animation restarts after reaching `to`.
3072
+ * @param delayMs - Delay in milliseconds between frame steps.
3073
+ * @param options - Optional end callback and removal behaviour.
3074
+ * @returns The created sprite frame animation.
3075
+ */
3076
+ export declare function playSprite2DAnimation(manager: SpriteAnimationManager, handle: Sprite2DHandle, from: number, to: number, loop: boolean, delayMs: number, options?: PlaySpriteAnimationOptions): SpriteFrameAnimation;
3077
+
3078
+ /**
3079
+ * Play a frame animation against a raw Sprite2D slot index.
3080
+ *
3081
+ * This is the zero-handle, slot-based path for structurally stable layers.
3082
+ * If the slot is swap-removed externally, the animation follows whatever
3083
+ * sprite later occupies the same index. Use `playSprite2DAnimation` with a
3084
+ * handle when animation must track a stable sprite identity across removals.
3085
+ */
3086
+ export declare function playSprite2DIndexAnimation(manager: SpriteAnimationManager, layer: Sprite2DLayer, index: number, from: number, to: number, loop: boolean, delayMs: number, options?: PlaySpriteAnimationOptions): SpriteFrameAnimation;
3087
+
3088
+ /** Optional callbacks and behaviour applied when starting a sprite frame animation. */
3089
+ export declare interface PlaySpriteAnimationOptions {
3090
+ /** Optional. Called once when a non-looping animation reaches its last frame. */
3091
+ readonly onEnd?: () => void;
3092
+ readonly removeWhenFinished?: boolean;
3093
+ }
3094
+
3095
+ /** Replay an animation; omit options to keep callbacks/removal, pass options to overwrite them, or `{}` to clear them. */
3096
+ export declare function playSpriteFrameAnimation(animation: SpriteFrameAnimation, from?: number, to?: number, loop?: boolean, delayMs?: number, options?: PlaySpriteAnimationOptions): void;
3097
+
3098
+ export declare interface PointLight extends LightBase {
3099
+ readonly lightType: "point";
3100
+ position: ObservableVec3;
3101
+ diffuse: [number, number, number];
3102
+ specular: [number, number, number];
3103
+ intensity: number;
3104
+ range: number;
3105
+ }
3106
+
3107
+ /** Options for `createPolyhedronData`. Subset of Babylon's CreatePolyhedron. */
3108
+ export declare interface PolyhedronOptions {
3109
+ /** Preset index 0-14. 0=Tetrahedron, 1=Octahedron, 2=Dodecahedron,
3110
+ * 3=Icosahedron, 4=Rhombicuboctahedron, 5=TriangularPrism, 6=PentagonalPrism,
3111
+ * 7=HexagonalPrism, 8=SquarePyramid(J1), 9=PentagonalPyramid(J2),
3112
+ * 10=TriangularDipyramid(J12), 11=PentagonalDipyramid(J13),
3113
+ * 12=ElongatedSquareDipyramid(J15), 13=ElongatedPentagonalDipyramid(J16),
3114
+ * 14=ElongatedPentagonalCupola(J20). Default 0. */
3115
+ type?: number;
3116
+ size?: number;
3117
+ sizeX?: number;
3118
+ sizeY?: number;
3119
+ sizeZ?: number;
3120
+ flat?: boolean;
3121
+ }
3122
+
3123
+ /** Output blend mode: `0` opaque, `1` additive, `2` premultiplied, `7` non-premultiplied alpha. */
3124
+ export declare type PostProcessAlphaMode = 0 | 1 | 2 | 7;
3125
+
3126
+ /** Source sampling filter for a post-process pass. */
3127
+ export declare type PostProcessSamplingMode = "nearest" | "linear";
3128
+
3129
+ /** A fullscreen post-process pass that samples a source texture, applies a fragment shader, and writes to an output target. */
3130
+ export declare interface PostProcessTask extends Task, PostProcessTaskSettings {
3131
+ readonly name: string;
3132
+ sourceSamplingMode: PostProcessSamplingMode;
3133
+ targetTexture: RenderTarget | null;
3134
+ alphaMode: PostProcessAlphaMode;
3135
+ viewport: NormalizedViewport | null;
3136
+ clear: boolean;
3137
+ outputTexture: RenderTarget;
3138
+ /** Recompute and upload the pass's uniform buffer from current settings. Call after mutating effect parameters. */
3139
+ updateUniforms(): void;
3140
+
3141
+ declare interface PostProcessTaskConfig extends PostProcessTaskSettings {
3142
+
3143
+ /** Shared user-facing settings for a post-process pass: source/target textures, sampling, alpha mode, viewport, and clear. */
3144
+ export declare interface PostProcessTaskSettings {
3145
+ name?: string;
3146
+ sourceTexture: RenderTarget;
3147
+ sourceSamplingMode?: PostProcessSamplingMode;
3148
+ targetTexture?: RenderTarget | null;
3149
+ alphaMode?: PostProcessAlphaMode;
3150
+ viewport?: NormalizedViewport | null;
3151
+ /** Clear the target before drawing. Set false when several viewport passes share a target. */
3152
+ clear?: boolean;
3153
+ }
3154
+
3155
+ declare interface PostProcessVec2 {
3156
+ x: number;
3157
+ y: number;
3158
+ }
3159
+
3160
+ declare interface PostProcessVec2_2 {
3161
+ x: number;
3162
+ y: number;
3163
+ }
3164
+
3165
+ /** Something that runs before the main render pass (shadow maps, compute, etc.). */
3166
+ export declare interface PrePassRenderable {
3167
+ /** Execute pre-pass work (e.g., render shadow depth map + blur). Returns the number of GPU draw calls issued. */
3168
+ execute(encoder: GPUCommandEncoder, engine: EngineContext): number;
3169
+ }
3170
+
3171
+ /** A reusable, target-independent set of compiled property tracks with a total duration. */
3172
+ export declare interface PropertyAnimationClip {
3173
+ readonly name: string;
3174
+ readonly tracks: readonly PropertyAnimationTrack[];
3175
+ readonly duration: number;
3176
+ readonly frameRate: number;
3177
+ }
3178
+
3179
+ /** Options for {@link createPropertyAnimationClip}. */
3180
+ export declare interface PropertyAnimationClipOptions {
3181
+ readonly frameRate?: number;
3182
+ }
3183
+
3184
+ /** Interpolation mode between keyframes: smooth `"linear"` or hold-previous `"step"`. */
3185
+ export declare type PropertyAnimationInterpolation = "linear" | "step";
3186
+
3187
+ /** A compiled animation track: a sampler plus the metadata needed to evaluate and write its property. */
3188
+ export declare interface PropertyAnimationTrack {
3189
+ readonly path: string;
3190
+ readonly sampler: AnimationSampler;
3191
+ readonly stride: number;
3192
+ readonly quaternion: boolean;
3193
+ }
3194
+
3195
+ /** Options describing one animated property track passed to {@link createPropertyAnimationClip}. */
3196
+ export declare interface PropertyAnimationTrackOptions {
3197
+ readonly path: string;
3198
+ readonly keys: readonly AnimationKeyframe[];
3199
+ readonly frameRate?: number;
3200
+ readonly interpolation?: PropertyAnimationInterpolation;
3201
+ readonly quaternion?: boolean;
3202
+ }
3203
+
3204
+ /** Quaternion rotation */
3205
+ declare interface Quat {
3206
+ x: number;
3207
+ y: number;
3208
+ z: number;
3209
+ w: number;
3210
+ }
3211
+
3212
+ /** A ray defined by origin, direction, and length. */
3213
+ declare interface Ray {
3214
+ origin: [number, number, number];
3215
+ direction: [number, number, number];
3216
+ length: number;
3217
+ }
3218
+
3219
+ /**
3220
+ * Cast a 'walkability' ray on the navmesh from `start` to `end`.
3221
+ * Matches BJS Addons semantics: `hit` is true only when `0 < t < 1` and
3222
+ * `hitPoint` is the linear interpolation between start and end at parameter t.
3223
+ *
3224
+ * Recast's raycast ignores the y component of the end position (2D check).
3225
+ */
3226
+ export declare function raycast(plugin: NavigationPlugin, start: Vec3, end: Vec3): {
3227
+ hit: boolean;
3228
+ hitPoint?: Vec3;
3229
+ };
3230
+
3231
+ /** Rebuild renderables whose pipeline/bind-group feature state depends on a material.
3232
+ * Use after texture, sampler, bind-group layout, culling, or feature changes.
3233
+ * UBO-only scalar/vector changes should use markMaterialUboDirty instead. */
3234
+ export declare function rebuildMaterial(scene: SceneContext, materialOrView: Material, options?: RebuildMaterialOptions): void;
3235
+
3236
+ declare interface RebuildMaterialOptions {
3237
+ /** Rebuild views created from the same source material. Defaults to true. */
3238
+ rebuildViews?: boolean;
3239
+ /** Rebuild the frame graph after material renderables are refreshed. Defaults to false so callers can batch updates. */
3240
+ rebuildFrameGraph?: boolean;
3241
+ }
3242
+
3243
+ /** Refraction sub-feature (KHR_materials_transmission + _volume + _ior).
3244
+ * Presence enables frame-graph scene-texture transmission. */
3245
+ export declare interface RefractionProps {
3246
+ /** Transmission factor (0=off, 1=fully transmissive). Default 0.
3247
+ * Maps to KHR_materials_transmission.transmissionFactor. */
3248
+ intensity?: number;
3249
+ /** Optional transmission texture (R channel). Multiplies `intensity`. */
3250
+ texture?: Texture2D;
3251
+ /** Index of refraction (KHR_materials_ior.ior). Default 1.5 (glass). */
3252
+ indexOfRefraction?: number;
3253
+ /** When true, the thickness value is also used as the refracted
3254
+ * sample offset depth (KHR_materials_volume — matches BJS
3255
+ * `useThicknessAsDepth`). Default true when volume is present. */
3256
+ useThicknessAsDepth?: boolean;
3257
+ /** Chromatic dispersion strength (KHR_materials_dispersion.dispersion).
3258
+ * Splits the refracted ray into per-RGB index-of-refraction offsets,
3259
+ * producing chromatic aberration. Requires volume. Default 0 (off). */
3260
+ dispersion?: number;
3261
+ }
3262
+
3263
+ /** Register the effect renderer with its engine. Idempotent — a second call is a no-op. */
3264
+ export declare function registerEffectRenderer(er: EffectRenderer): void;
3265
+
3266
+ /** Build and register the standalone frame-graph context with its engine. */
3267
+ export declare function registerFrameGraphContext(ctx: FrameGraphContext): void;
3268
+
3269
+ /**
3270
+ * Register a scene with the engine. Builds deferred work, sorts renderables by order,
3271
+ * and adds the scene to the engine's render list in overlay order.
3272
+ */
3273
+ export declare function registerScene(engine: EngineContext, scene: SceneContext): Promise<void>;
3274
+
3275
+ /**
3276
+ * Register a scene with the engine and install the scene-owned shadow frame-graph task.
3277
+ * Use only for scenes that generate shadow maps.
3278
+ */
3279
+ export declare function registerSceneWithShadowSupport(engine: EngineContext, scene: SceneContext): Promise<void>;
3280
+
3281
+ /** Push the renderer onto its engine's `_renderingContexts`. Idempotent — a second call is a no-op. */
3282
+ export declare function registerSpriteRenderer(sr: SpriteRenderer): void;
3283
+
3284
+ /** Detaches `group` from `manager`, removing its animation task so it is no longer ticked. */
3285
+ export declare function removeAnimationGroup(manager: AnimationManager, group: AnimationGroup): void;
3286
+
3287
+ /** Detaches `task` from `manager`, marking it inactive and running its dispose hook if it was attached. */
3288
+ export declare function removeAnimationTask(manager: AnimationManager, task: AnimationTask): void;
3289
+
3290
+ /**
3291
+ * Removes the billboard sprite referenced by `handle`. Does nothing if it is already gone.
3292
+ * @param handle - Handle of the sprite to remove.
3293
+ */
3294
+ export declare function removeBillboardSprite(handle: BillboardSpriteHandle): void;
3295
+
3296
+ /**
3297
+ * Removes the billboard sprite at the given instance index using swap-remove with the last sprite.
3298
+ * @param system - Billboard system that owns the sprite.
3299
+ * @param index - Instance index to remove.
3300
+ * @throws If `index` is out of range.
3301
+ */
3302
+ export declare function removeBillboardSpriteIndex(system: BillboardSpriteSystem, index: number): void;
3303
+
3304
+ /** Remove a mesh from the scene and destroy its GPU resources.
3305
+ * Standalone function for tree-shaking — only included when actually used. */
3306
+ export declare function removeFromScene(scene: SceneContext, mesh: Mesh): void;
3307
+
3308
+ /** Remove a mesh from this task's renderable + binding lists. Idempotent. */
3309
+ export declare function removeMeshFromTask(task: RenderTask, mesh: object): void;
3310
+
3311
+ /** Remove an obstacle previously added by `addBoxObstacle` / `addCylinderObstacle`. */
3312
+ export declare function removeObstacle(plugin: NavigationPlugin, obstacle: ObstacleHandle): void;
3313
+
3314
+ /**
3315
+ * Removes the sprite referenced by `handle`. Does nothing if it is already gone.
3316
+ * @param handle - Handle of the sprite to remove.
3317
+ */
3318
+ export declare function removeSprite2D(handle: Sprite2DHandle): void;
3319
+
3320
+ /** Swap-remove a sprite. The last sprite (if any) takes its slot. */
3321
+ export declare function removeSprite2DIndex(layer: Sprite2DLayer, index: number): void;
3322
+
3323
+ /**
3324
+ * Removes an animation from a manager and clears its ownership if the manager owns it.
3325
+ * @param manager - Manager to remove the animation from.
3326
+ * @param animation - Animation to remove.
3327
+ */
3328
+ export declare function removeSpriteAnimation(manager: SpriteAnimationManager, animation: SpriteFrameAnimation): void;
3329
+
3330
+ /**
3331
+ * Detaches a sprite animation manager previously attached with {@link addSpriteAnimationManager}.
3332
+ * @param manager - Animation manager the sprite manager was attached to.
3333
+ * @param spriteManager - Sprite animation manager to detach.
3334
+ */
3335
+ export declare function removeSpriteAnimationManager(manager: AnimationManager, spriteManager: SpriteAnimationManager): void;
3336
+
3337
+ /** Remove a layer from the renderer and destroy any GPU resources cached for it. */
3338
+ export declare function removeSpriteRendererLayer(sr: SpriteRenderer, layer: Sprite2DLayer): boolean;
3339
+
3340
+ /** Remove instance by index. Swap-removes: last instance fills the gap. */
3341
+ export declare function removeThinInstance(mesh: Mesh, index: number): void;
3342
+
3343
+ /** Something that draws itself into a render pass. The bind() method returns a
3344
+ * DrawBinding capturing target-specific GPU state and the per-frame draw closure. */
3345
+ export declare interface Renderable {
3346
+ /** Sort key for draw order (lower = drawn first). Default: 100 (opaque), 200 (transparent). */
3347
+ readonly order: number;
3348
+ /** Whether this renderable is transparent (auto-derived from material). */
3349
+ readonly isTransparent: boolean;
11
3350
  /** Reference to the source mesh (for distance sort + material-change detection). */
3351
+ readonly mesh?: Mesh;
12
3352
  /**
3353
+ * Resolve target-specific GPU state (pipeline) and return a `DrawBinding` whose
3354
+ * `draw` closure captures that state. Called by the render pass task at build/insert
3355
+ * time. The scene bind group (group 0) is set once per pass by the task — renderables
3356
+ * never see it. Renderables that need to participate in multiple passes with different
3357
+ * target formats should pick the appropriate pipeline based on `target`.
3358
+ */
3359
+ bind(engine: EngineContext, target: RenderTargetSignature): DrawBinding;
3360
+ }
3361
+
3362
+ /**
3363
+ * A surface Babylon Lite can render into. Either a DOM canvas (main thread) or an
3364
+ * `OffscreenCanvas` (e.g. one transferred to a Web Worker via
3365
+ * `transferControlToOffscreen()`). Both expose `getContext("webgpu")` plus a
3366
+ * read/write backing-store `width`/`height`; only the DOM canvas exposes layout
3367
+ * (`clientWidth`/`clientHeight`) and attributes (`setAttribute`).
3368
+ */
3369
+ export declare type RenderCanvas = HTMLCanvasElement | OffscreenCanvas;
3370
+
3371
+ /**
3372
+ * Minimal surface an engine sees for anything it renders. Scenes (and any other
3373
+ * future renderable thing) register themselves as a `RenderingContext` and
3374
+ * own their own update / record logic. Engine knows nothing of scene internals.
3375
+ */
3376
+ declare interface RenderingContext_2 {
13
3377
  /** Clear color used when this context is the first active one in a frame. */
3378
+ clearColor: GPUColorDict;
3379
+
3380
+ /** A frame-graph pass that begins a render pass into its bound `RenderTarget`, runs an execute callback, then ends the pass. */
3381
+ export declare interface RenderPass extends Pass {
14
3382
  /** Per-frame mutable state. RenderTask mirrors live scene state
3383
+ * (e.g. `scene.clearColor` for auto-filled tasks) into these fields
3384
+ * before iterating its passes. */
3385
+ clearColor: GPUColorDict;
3386
+ /** True → loadOp `"clear"`, false → `"load"` (overlay mode). */
3387
+ clear: boolean;
3388
+
3389
+ /** Body of a render pass — receives the live render-pass encoder and returns
3390
+ * the number of draws issued. */
3391
+ export declare type RenderPassExecuteFunc = (pass: GPURenderPassEncoder) => number;
3392
+
3393
+ /** Allocated GPU state for a render target. */
3394
+ export declare interface RenderTarget {
3395
+
3396
+ /** Describes a render target — what attachments to create, not the GPU objects
3397
+ * themselves. GPU textures are allocated later by `buildRenderTarget`. */
3398
+ export declare interface RenderTargetDescriptor {
3399
+ label?: string;
3400
+ colorFormat?: GPUTextureFormat;
3401
+ depthStencilFormat?: GPUTextureFormat;
15
3402
  sampleCount: number;
3403
+ /** 'canvas' means match the canvas pixel size. Otherwise explicit pixels. */
3404
+ size: "canvas" | {
3405
+ width: number;
3406
+ height: number;
3407
+ };
3408
+ /** If true, the color attachment resolves to the swapchain texture. The RT still
3409
+ * owns the MSAA texture (when sampleCount \> 1) and the depth texture; only the
3410
+ * final color is the swapchain view, acquired per frame and patched in at execute
3411
+ * time. With sampleCount === 1 the RT owns no color texture (the swap view is the
3412
+ * color attachment directly). */
3413
+ resolveToSwapchain?: boolean;
3414
+ /** Override projection Y-flip. Defaults to true for offscreen targets and false for swapchain targets. */
3415
+ flipY?: boolean;
3416
+ }
3417
+
3418
+ /** Signature of a render target's attachment set — enough to key a GPURenderPipeline. */
3419
+ export declare interface RenderTargetSignature {
3420
+
3421
+ /** A frame-graph task that records a single `RenderPass`, binds the scene's `RenderTarget`, and draws renderables into it. */
3422
+ export declare interface RenderTask extends Task {
3423
+ readonly name: string;
3424
+ /** Render tasks are scene-bound because they consume scene camera, lights, and renderables. */
3425
+ readonly scene: SceneContext;
16
3426
  /** Add a mesh to this task's explicit render list with an optional per-pass material override.
3427
+ * Resolved at `record()` time via `material._buildGroup._rebuildSingle`,
3428
+ * so the mesh's material family must already have been registered with
3429
+ * the scene (so its batch builder has run). */
3430
+ addMesh(mesh: Mesh, opts?: {
3431
+ material?: Material;
3432
+ }): void;
3433
+
3434
+ /** Configuration for `createRenderTask`: render target, clear state, optional camera override, and transmission settings. */
3435
+ export declare interface RenderTaskConfig {
3436
+ name: string;
3437
+ /** TODO: rt should not live in this config long-term. Until texture
3438
+ * management is virtualized, callers must provide the concrete target; once
3439
+ * virtualized, the task should create/manage its own render target. */
3440
+ rt: RenderTarget;
3441
+ /** Background clear color. May be mutated frame-to-frame. */
3442
+ clrColor?: GPUColorDict;
3443
+ /** When true, controls color + depth `loadOp` ("clear"). When false, use "load"
3444
+ * so this pass overlays previous content (UI overlays, second scene, etc.). */
3445
+ clr?: boolean;
3446
+ /** Per-pass camera override. Null/undefined uses `scene.camera`. */
3447
+ cam?: Camera | null;
3448
+ /** Use canvas dimensions, not render-target dimensions, for this pass's scene UBO aspect. */
3449
+ cs?: boolean;
3450
+ /** Scene-texture transmission settings. `copyCount: 0` copies before every transmissive draw.
3451
+ * `generateMipmaps: false` allocates only mip 0 for the refraction texture and skips mip generation. */
3452
+ transmission?: {
3453
+ copyCount?: number;
3454
+ generateMipmaps?: boolean;
3455
+ };
3456
+ }
3457
+
3458
+ /**
3459
+ * Reset all variant-participating meshes to their original (default) materials.
3460
+ */
3461
+ export declare function resetVariant(container: AssetContainer): void;
3462
+
3463
+ /** Resize the swapchain backing-store to match the canvas client size. When the size
3464
+ * changes, asks every registered rendering context to rebuild its canvas-sized GPU
3465
+ * resources via the optional `_resize` hook. If the canvas has not been laid out yet,
3466
+ * preserves its explicit backing-store size.
3467
+ *
3468
+ * Only DOM canvases are auto-sized from layout here. An `OffscreenCanvas` has no layout
3469
+ * box, so its size is pushed in externally via {@link setEngineSize} (e.g. from the host
3470
+ * thread that owns the visible canvas) and this call is a no-op for it. */
3471
+ export declare function resizeEngine(engine: EngineContext): void;
3472
+
3473
+ /** Resolve a Babylon-style normalized viewport to integer render-target pixels.
3474
+ * Babylon viewport y is normalized from the bottom; WebGPU viewport/scissor y is from the top. */
3475
+ export declare function resolveCameraViewport(camera: Camera | null | undefined, targetWidth: number, targetHeight: number): PixelViewport;
3476
+
3477
+ /** Options for `createRibbonData`: a set of parallel paths joined into a strip. */
3478
+ export declare interface RibbonOptions {
3479
+ pathArray: Vec3[][];
3480
+ closeArray?: boolean;
3481
+ closePath?: boolean;
3482
+ offset?: number;
3483
+ }
3484
+
3485
+ /** Scattering sub-feature. Presence enables screen-space subsurface scattering.
3486
+ * NOTE: PrePass/SSS pipeline is not yet implemented — this type is reserved. */
3487
+ declare interface ScatteringProps {
3488
+ /** Per-channel scattering diffusion distance. */
3489
+ diffusionDistance?: [number, number, number];
3490
+ /** World-space scale factor for the diffusion kernel. Default 1.0. */
3491
+ metersPerUnit?: number;
3492
+ }
3493
+
3494
+ /** Top-level scene context — pure state, no attached methods. */
3495
+ export declare interface SceneContext extends RenderingContext_2 {
3496
+ readonly engine: EngineContext;
3497
+ clearColor: GPUColorDict;
3498
+ camera: Camera | null;
3499
+ lights: LightBase[];
3500
+ imageProcessing: ImageProcessingConfig;
3501
+ /** All meshes added to the scene (standard + PBR). */
3502
+ meshes: Mesh[];
3503
+ /** Animation groups loaded from glTF or created manually. */
3504
+ animationGroups: AnimationGroup[];
3505
+ /** Fog configuration. Null = no fog. */
3506
+ fog: FogConfig | null;
3507
+ /** Scene clip plane as (normal.x, normal.y, normal.z, d). Matches Babylon.js Plane `dot(worldPosition, plane) > 0` discard semantics. */
3508
+ clipPlane: ClipPlane | null;
3509
+ /** Shadow generators registered on this scene. */
3510
+ shadowGenerators: ShadowGenerator[];
3511
+ /** Background material primaryColor (linear RGB). Default from Babylon createDefaultEnvironment. */
3512
+ environmentPrimaryColor?: [number, number, number];
3513
+ /** Environment cubemap Y rotation in radians. */
3514
+ envRotationY?: number;
3515
+ /** Fixed delta time in ms for deterministic animation. 0 = use real rAF delta. */
3516
+ fixedDeltaMs: number;
3517
+
3518
+ /** Options passed to the scene-context factory. */
3519
+ export declare interface SceneContextOptions {
3520
+ defaultRenderTask?: boolean;
3521
+ }
3522
+
3523
+ /** Common base for all scene entities: TRS transform, parent/children hierarchy, and a cached world matrix. */
3524
+ export declare interface SceneNode {
3525
+ name: string;
3526
+ children: SceneNode[];
3527
+ position: ObservableVec3;
3528
+ /** Quaternion rotation — source of truth for the local matrix. */
3529
+ rotationQuaternion: ObservableQuat;
3530
+ /** Euler XYZ bidirectional proxy — reads decompose current quat; writes update quat atomically. */
3531
+ rotation: EulerProxy;
3532
+ scaling: ObservableVec3;
3533
+ parent: IWorldMatrixProvider | null;
3534
+ readonly worldMatrix: Mat4;
3535
+ readonly worldMatrixVersion: number;
17
3536
  /** Self-visibility. Undefined/true = visible; `false` skips render + camera AABB.
3537
+ * Cascade is materialized at write-time by `setSubtreeVisible`. */
3538
+ visible?: boolean;
3539
+ }
3540
+
3541
+ /** Updatable scene uniforms — called once per frame before any draw calls.
3542
+ * Multiple renderables may share a scene UBO; only one updater is needed per UBO. */
3543
+ export declare interface SceneUniformUpdater {
3544
+ /** Write per-frame camera/light/fog data to the scene UBO. */
3545
+ update(engine: EngineContext): void;
3546
+ }
3547
+
3548
+ /**
3549
+ * Select a material variant by name on a loaded glTF asset.
3550
+ *
3551
+ * Two-step operation:
3552
+ * 1. Restores ALL variant-participating meshes to their original (default) materials.
3553
+ * 2. Applies the selected variant's material overrides.
3554
+ *
3555
+ * This ensures meshes without a mapping for the new variant revert to their defaults,
3556
+ * even when switching between variants (e.g. Red → White).
3557
+ *
3558
+ * Works both before and after addToScene():
3559
+ * - Before: materials are set directly (renderable built later).
3560
+ * - After: the property-setter intercept triggers renderable rebuild automatically.
3561
+ */
3562
+ export declare function selectVariant(container: AssetContainer, variantName: string): void;
3563
+
3564
+ /** Mark an animation group as additive. Reference defaults to frame 0, matching Babylon.js MakeAnimationAdditive. */
3565
+ export declare function setAnimationAdditive(group: AnimationGroup, options?: AnimationAdditiveOptions): void;
3566
+
3567
+ /** Registers a single category `handler` on `manager` that drives every task tagged with `category` in one pass.
3568
+ * @throws If `category` is empty. */
3569
+ export declare function setAnimationTaskCategoryHandler(manager: AnimationManager, category: string, handler: AnimationTaskCategoryHandler): void;
3570
+
3571
+ /** Set the weighted contribution for an animation group. Feature-specific mixers remain explicit opt-ins. */
3572
+ export declare function setAnimationWeight(group: AnimationGroup, weight: number): void;
3573
+
3574
+ /**
3575
+ * Set the custom-shader `fx.params` vec4 for a billboard system created with a `customShader`.
3576
+ * No-op effect on systems without one (the value is simply stored). Read in WGSL as `fx.params`.
3577
+ */
3578
+ export declare function setBillboardShaderParams(system: BillboardSpriteSystem, params: readonly [number, number, number, number]): void;
3579
+
3580
+ /**
3581
+ * Sets the atlas frame of the billboard sprite referenced by `handle`, preserving its world size and flip state.
3582
+ * @param handle - Handle of the sprite to update.
3583
+ * @param frame - Atlas frame index.
3584
+ * @throws If the handle has already been removed.
3585
+ */
3586
+ export declare function setBillboardSpriteFrame(handle: BillboardSpriteHandle, frame: number): void;
3587
+
3588
+ /**
3589
+ * Update only the frame UVs for one billboard sprite.
3590
+ *
3591
+ * The sprite keeps its explicit `sizeWorld`/saved size. Pixel frame dimensions
3592
+ * do not imply a world-space resize; call `updateBillboardSpriteIndex` with
3593
+ * both `frame` and `sizeWorld` when that is desired. Existing flip state is
3594
+ * preserved for non-degenerate UV ranges.
3595
+ */
3596
+ export declare function setBillboardSpriteFrameIndex(system: BillboardSpriteSystem, index: number, frame: number): void;
3597
+
3598
+ /**
3599
+ * Bind a texture to one of the effect's texture slots, marking the bind group dirty so it is rebuilt.
3600
+ * @param wrapper - The effect wrapper to update.
3601
+ * @param bindingNameOrIndex - The texture binding's name or numeric index.
3602
+ * @param texture - The texture to bind.
3603
+ */
3604
+ export declare function setEffectTexture(wrapper: EffectWrapper, bindingNameOrIndex: string | number, texture: Texture2D): void;
3605
+
3606
+ /**
3607
+ * Write data into the effect's uniform buffer(s). Pass a single buffer to write the
3608
+ * wrapper's only uniform slot, or a record keyed by binding name/index to write specific slots.
3609
+ * @param wrapper - The effect wrapper to update.
3610
+ * @param data - The uniform bytes, or a map of binding key to uniform bytes.
3611
+ */
3612
+ export declare function setEffectUniforms(wrapper: EffectWrapper, data: ArrayBuffer | ArrayBufferView | Record<string | number, ArrayBuffer | ArrayBufferView>): void;
3613
+
3614
+ /** Set the swapchain backing-store size directly, in device pixels. Use this when the
3615
+ * engine renders into an `OffscreenCanvas` whose layout size is only known on another
3616
+ * thread (the host posts the CSS size × devicePixelRatio). When the size changes, asks
3617
+ * every registered rendering context to rebuild its canvas-sized GPU resources via the
3618
+ * optional `_resize` hook. */
3619
+ export declare function setEngineSize(engine: EngineContext, widthPx: number, heightPx: number): void;
3620
+
3621
+ /** Raise (or lower) the maximum number of scene lights in the shared lights UBO.
3622
+ * Must be called BEFORE scene pipelines are compiled — existing pipelines
3623
+ * and UBOs bake the cap into their WGSL/layout. */
3624
+ export declare function setMaxLights(n: number): void;
3625
+
3626
+ /** Update morph target weights on CPU and GPU.
3627
+ * Only the first four weights are used, matching the current morph target limit.
3628
+ * @param engine - Engine context that owns the morph target GPU buffer.
3629
+ * @param morphTargets - Morph target data returned by `createMorphTargets()`.
3630
+ * @param weights - New morph weights; missing slots are reset to 0.
3631
+ */
3632
+ export declare function setMorphTargetWeights(engine: EngineContext, morphTargets: MorphTargetData, weights: ArrayLike<number>): void;
3633
+
3634
+ /** Set the seed used by Recast's randomized queries (e.g. `findRandomPointAroundCircle`). */
3635
+ export declare function setNavigationRandomSeed(plugin: NavigationPlugin, seed: number): void;
3636
+
3637
+ /**
3638
+ * Reparents `child` while preserving its current world-space transform, mirroring
3639
+ * Babylon.js `TransformNode.setParent()`.
3640
+ * @param child - The mesh to reparent.
3641
+ * @param parent - The new parent (any world-matrix provider), or `null` to detach to world space.
3642
+ */
3643
+ export declare function setParent(child: Mesh, parent: IWorldMatrixProvider | null): void;
3644
+
3645
+ /**
3646
+ * Sets a body's mass and a matching diagonal inertia tensor.
3647
+ * @param world - The physics world.
3648
+ * @param body - The body to update.
3649
+ * @param mass - Mass in kilograms.
3650
+ */
3651
+ export declare function setPhysicsBodyMass(world: PhysicsWorld, body: PhysicsBody, mass: number): void;
3652
+
3653
+ /**
3654
+ * Assigns a collision shape to a body.
3655
+ * @param world - The physics world.
3656
+ * @param body - The body to attach the shape to.
3657
+ * @param shape - The collision shape.
3658
+ */
3659
+ export declare function setPhysicsBodyShape(world: PhysicsWorld, body: PhysicsBody, shape: PhysicsShape): void;
3660
+
3661
+ /**
3662
+ * Sets the world's gravity vector.
3663
+ * @param world - The physics world.
3664
+ * @param gravity - Gravity acceleration in m/s².
3665
+ */
3666
+ export declare function setPhysicsGravity(world: PhysicsWorld, gravity: Vec3): void;
3667
+
3668
+ /**
3669
+ * Sets a shape's surface material properties.
3670
+ * @param world - The physics world.
3671
+ * @param shape - The collision shape.
3672
+ * @param friction - Friction coefficient (used for both static and dynamic friction).
3673
+ * @param restitution - Bounciness in `[0, 1]`.
3674
+ */
3675
+ export declare function setPhysicsShapeMaterial(world: PhysicsWorld, shape: PhysicsShape, friction: number, restitution: number): void;
3676
+
3677
+ /**
3678
+ * Sets the fixed simulation timestep used by each world step.
3679
+ * @param world - The physics world.
3680
+ * @param dt - Timestep in seconds (e.g. `1 / 60`).
3681
+ */
3682
+ export declare function setPhysicsTimestep(world: PhysicsWorld, dt: number): void;
3683
+
3684
+ /**
3685
+ * Clamps the maximum linear and angular speeds of bodies in the world.
3686
+ * @param world - The physics world.
3687
+ * @param maxLinear - Maximum linear speed.
3688
+ * @param maxAngular - Maximum angular speed.
3689
+ */
3690
+ export declare function setPhysicsVelocityLimits(world: PhysicsWorld, maxLinear: number, maxAngular: number): void;
3691
+
3692
+ /** Set a declared `f32` uniform. Convenience wrapper over `setShaderUniform()`. */
3693
+ export declare function setShaderFloat(material: ShaderMaterial, name: string, value: number): void;
3694
+
3695
+ /** Set a declared `mat4x4<f32>` uniform. Convenience wrapper over `setShaderUniform()`. */
3696
+ export declare function setShaderMatrix(material: ShaderMaterial, name: string, value: Float32Array): void;
3697
+
3698
+ /** Bind (or clear) the texture for a declared sampler, enforcing that depth and
3699
+ * non-depth samplers receive a matching `Texture2D`.
3700
+ * @param material - Target material.
3701
+ * @param name - Declared sampler name.
3702
+ * @param texture - Texture to bind, or `null` to clear. */
3703
+ export declare function setShaderTexture(material: ShaderMaterial, name: string, texture: Texture2D | null): void;
3704
+
3705
+ /** Set a declared uniform's value, validating its element count against the
3706
+ * declared type and bumping the material's UBO version.
3707
+ * @param material - Target material.
3708
+ * @param name - Declared uniform name.
3709
+ * @param value - New value (scalar, array, or `Float32Array`). */
3710
+ export declare function setShaderUniform(material: ShaderMaterial, name: string, value: ShaderUniformValue): void;
3711
+
3712
+ /** Set a declared `vec3<f32>` uniform. Convenience wrapper over `setShaderUniform()`. */
3713
+ export declare function setShaderVector3(material: ShaderMaterial, name: string, value: readonly [number, number, number]): void;
3714
+
3715
+ /** Register scene-owned shadow caster inputs for a generator. */
3716
+ export declare function setShadowTaskCasterMeshes(shadowGenerator: ShadowGenerator, casterMeshes: readonly Mesh[]): void;
3717
+
3718
+ /**
3719
+ * Sets the atlas frame of the sprite referenced by `handle`.
3720
+ * @param handle - Handle of the sprite to update.
3721
+ * @param frame - Atlas frame index.
3722
+ * @throws If the handle has already been removed.
3723
+ */
3724
+ export declare function setSprite2DFrame(handle: Sprite2DHandle, frame: number): void;
3725
+
3726
+ /**
3727
+ * Update only the frame UVs for one sprite.
3728
+ *
3729
+ * The sprite keeps its explicit `sizePx`/saved size. For atlas-driven size
3730
+ * changes, call `updateSprite2DIndex(layer, index, { frame, sizePx })`.
3731
+ * Existing flip state is preserved for non-degenerate UV ranges.
3732
+ */
3733
+ export declare function setSprite2DFrameIndex(layer: Sprite2DLayer, index: number, frame: number): void;
3734
+
3735
+ /**
3736
+ * Set the user `fx.params` vec4 fed to this layer's custom shader (`createSprite2DCustomShader`)
3737
+ * each frame. No visual effect unless the layer was created with a `customShader`. Read in WGSL
3738
+ * as `fx.params`. Mutates in place; the renderer re-uploads the small FX UBO next frame.
3739
+ */
3740
+ export declare function setSprite2DShaderParams(layer: Sprite2DLayer, params: readonly [number, number, number, number]): void;
3741
+
3742
+ /**
3743
+ * Set the per-sprite UV scroll offset for one sprite of a `uvScroll` layer (live). The two floats
3744
+ * are added to the sprite's sampled UV in the vertex stage — driving parallax / infinite-scroll
3745
+ * backgrounds without re-uploading texture coordinates. Marks only this sprite's range dirty.
3746
+ *
3747
+ * Throws if the layer was not created with `Sprite2DLayerOptions.uvScroll: true` (non-scroll layers
3748
+ * carry no uvOffset slot) or if `index` is out of range.
3749
+ */
3750
+ export declare function setSprite2DUvOffset(layer: Sprite2DLayer, index: number, uvOffset: readonly [number, number]): void;
3751
+
3752
+ /** Set `visible` on `node` and all descendants (via `node.children`). glTF
3753
+ * KHR_node_visibility specifies that children inherit their parent's
3754
+ * invisibility — we materialize this at set-time so the render hot-path
3755
+ * only has to check a single boolean per mesh. */
3756
+ declare function setSubtreeVisible(node: SceneNode, v: boolean): void;
3757
+ export { setSubtreeVisible as setMeshVisible }
3758
+ export { setSubtreeVisible }
3759
+
3760
+ /** Set per-instance RGBA colors for a thin-instanced mesh. */
3761
+ export declare function setThinInstanceColors(mesh: Mesh, colors: Float32Array): void;
3762
+
3763
+ /** Update one instance's matrix. */
3764
+ export declare function setThinInstanceMatrix(mesh: Mesh, index: number, matrix: Mat4): void;
3765
+
3766
+ /** Set all instances from a pre-built matrix array. */
3767
+ export declare function setThinInstances(mesh: Mesh, matrices: Float32Array, count: number): void;
3768
+
3769
+ /**
3770
+ * Write bytes into the uniform effect's single uniform buffer.
3771
+ * @param wrapper - The uniform effect wrapper to update.
3772
+ * @param data - Uniform bytes to upload.
3773
+ */
3774
+ export declare function setUniformEffectUniforms(wrapper: UniformEffectWrapper, data: ArrayBuffer | ArrayBufferView): void;
3775
+
3776
+ /** Vertex attribute names a ShaderMaterial can bind. */
3777
+ export declare type ShaderAttributeName = "position" | "normal" | "uv" | "uv2" | "tangent" | "color";
3778
+
3779
+ /** A resolved WGSL preprocessor define (name + value). */
3780
+ export declare interface ShaderDefine {
3781
+ readonly name: string;
3782
+ readonly value: ShaderDefineValue;
3783
+ }
3784
+
3785
+ /** Map of WGSL preprocessor define names to their values. */
3786
+ export declare type ShaderDefineMap = Readonly<Record<string, ShaderDefineValue>>;
3787
+
3788
+ /** Value of a WGSL preprocessor define — boolean toggle or numeric constant. */
3789
+ export declare type ShaderDefineValue = boolean | number;
3790
+
3791
+ /** A custom WGSL material: compiled from user-supplied vertex/fragment sources
3792
+ * with declared attributes, uniforms, samplers, and defines. Update its values
3793
+ * via `setShaderUniform()` / `setShaderTexture()` and friends. */
3794
+ export declare interface ShaderMaterial extends Material {
3795
+ readonly name?: string;
3796
+ readonly vertexSource: string;
3797
+ readonly fragmentSource: string;
3798
+ readonly attributes: readonly ShaderAttributeName[];
3799
+ readonly uniformDecls: readonly ShaderUniformDecl[];
3800
+ readonly samplerDecls: readonly ShaderSamplerDecl[];
3801
+ readonly defines: readonly ShaderDefine[];
3802
+ readonly needAlphaBlending: boolean;
3803
+ readonly blendMode: "alpha" | "additive";
3804
+ readonly needAlphaTesting: boolean;
3805
+ readonly backFaceCulling: boolean;
3806
+ readonly depthWrite: boolean;
3807
+ readonly depthCompare: GPUCompareFunction;
3808
+
3809
+ /** Options describing a ShaderMaterial: WGSL sources, attributes, uniforms,
3810
+ * samplers, defines, and blend/depth state. Passed to `createShaderMaterial()`. */
3811
+ export declare interface ShaderMaterialOptions {
3812
+ readonly name?: string;
3813
+ readonly vertexSource: string;
3814
+ readonly fragmentSource: string;
3815
+ readonly attributes: readonly ShaderAttributeName[];
3816
+ readonly uniforms?: readonly ShaderUniformOption[];
3817
+ readonly samplers?: readonly ShaderSamplerOption[];
3818
+ readonly defines?: ShaderDefineMap;
3819
+ readonly needAlphaBlending?: boolean;
3820
+ /** Blend equation used when `needAlphaBlending` is set. "alpha" (default) is
3821
+ * standard src-over; "additive" adds the fragment's premultiplied-by-alpha
3822
+ * color to the framebuffer, which is the right choice for glows/light FX. */
3823
+ readonly blendMode?: "alpha" | "additive";
3824
+ readonly needAlphaTesting?: boolean;
3825
+ readonly backFaceCulling?: boolean;
3826
+ readonly depthWrite?: boolean;
3827
+ readonly depthCompare?: GPUCompareFunction;
3828
+ }
3829
+
3830
+ /** A sampler declaration: WGSL identifier and the bound texture's sample type. */
3831
+ export declare interface ShaderSamplerDecl {
3832
+ readonly name: string;
3833
+ readonly sampleType?: "float" | "unfilterable-float" | "depth";
3834
+ }
3835
+
3836
+ /** A sampler entry: either a bare sampler name or an explicit declaration. */
3837
+ export declare type ShaderSamplerOption = string | ShaderSamplerDecl;
3838
+
3839
+ /** Built-in uniform names automatically populated by the renderer each frame
3840
+ * (transforms, camera position, screen size, alpha cutoff). */
3841
+ export declare type ShaderSystemUniformName = "world" | "view" | "projection" | "viewProjection" | "worldView" | "worldViewProjection" | "cameraPosition" | "screenSize" | "alphaCutoff";
3842
+
3843
+ /** A custom uniform declaration: WGSL identifier, type, and optional default. */
3844
+ export declare interface ShaderUniformDecl {
3845
+ readonly name: string;
3846
+ readonly type: ShaderUniformType;
3847
+ readonly defaultValue?: number | readonly number[];
3848
+ }
3849
+
3850
+ /** A uniform entry: either a system uniform name or an explicit custom declaration. */
3851
+ export declare type ShaderUniformOption = ShaderSystemUniformName | ShaderUniformDecl;
3852
+
3853
+ /** WGSL scalar/vector/matrix types supported for ShaderMaterial uniforms. */
3854
+ export declare type ShaderUniformType = "f32" | "u32" | "i32" | "vec2<f32>" | "vec3<f32>" | "vec4<f32>" | "mat4x4<f32>";
3855
+
3856
+ /** Accepted value shape when setting a ShaderMaterial uniform. */
3857
+ export declare type ShaderUniformValue = number | readonly number[] | Float32Array;
3858
+
3859
+ /** Runtime state for a light's shadow generator: shadow technique, map textures, light matrix, and per-frame task hooks. */
3860
+ export declare interface ShadowGenerator {
3861
+
3862
+ /** Scene-owned frame-graph task that schedules shadow-map generation across the scene's shadow generators. */
3863
+ export declare interface ShadowTask extends Task {
3864
+ readonly name: "shadow";
3865
+ }
3866
+
3867
+ /** Sheen layer properties. Maps to BJS PBRMaterial.sheen sub-object. */
3868
+ declare interface SheenProps {
3869
+ /** Whether sheen is active. Default false. */
3870
+ isEnabled: boolean;
3871
+ /** Sheen color (linear RGB). Default [1, 1, 1]. */
3872
+ color?: [number, number, number];
3873
+ /** Sheen roughness. Default 0.0. */
3874
+ roughness?: number;
3875
+ /** Sheen intensity (0=off, 1=full). Default 1.0. */
3876
+ intensity?: number;
3877
+ /** Optional sheen tint texture (modulates sheen color). Loaded via loadTexture2D(). */
3878
+ texture?: Texture2D;
3879
+ /** When true (recommended for glTF), applies proper sheen albedo scaling
3880
+ * on the base layer and treats the sheen texture as already-linear (no pow).
3881
+ * When false (default, legacy), applies pow(rgb, 2.2) to the sheen texture
3882
+ * and uses a (1-F0) attenuation on the sheen lobe without base-layer scaling. */
3883
+ albedoScaling?: boolean;
3884
+ }
3885
+
3886
+ /** Connects a skeleton to its GPU bone texture for per-frame updates. */
3887
+ declare interface SkeletonBinding {
3888
+ readonly jointNodes: readonly number[];
3889
+ readonly inverseBindMatrices: Float32Array;
3890
+ readonly invMeshWorld: Mat4;
3891
+ readonly boneTexture: GPUTexture;
3892
+ readonly boneCount: number;
3893
+ readonly boneMatrices: Float32Array;
3894
+ readonly runtimeSkeleton?: SkeletonData;
3895
+ }
3896
+
3897
+ /** Skeleton GPU data — bone texture + vertex buffers for skinning.
3898
+ * Created by createSkeleton() in skeleton/create-skeleton.ts.
3899
+ * Attached to mesh.skeleton. */
3900
+ declare interface SkeletonData {
3901
+ readonly boneTexture: GPUTexture;
3902
+ readonly boneCount: number;
3903
+ readonly jointsBuffer: GPUBuffer;
3904
+ readonly weightsBuffer: GPUBuffer;
3905
+ readonly joints: Uint16Array | Uint8Array;
3906
+ readonly weights: Float32Array;
3907
+ readonly boneMatrices: Float32Array;
3908
+ /** Extra joints/weights for 8-bone skinning (JOINTS_1/WEIGHTS_1). */
3909
+ readonly joints1Buffer: GPUBuffer | null;
3910
+ readonly weights1Buffer: GPUBuffer | null;
3911
+ readonly joints1: Uint16Array | Uint8Array | null;
3912
+ readonly weights1: Float32Array | null;
3913
+ }
3914
+
3915
+ /** Procedural UV sphere — matches Babylon MeshBuilder.CreateSphere defaults.
3916
+ * Generates vertex positions, normals, and indices for a unit sphere.
3917
+ * Left-handed winding (CCW front face) to match Babylon. */
3918
+ export declare interface SphereMeshData {
3919
+ positions: Float32Array;
3920
+ normals: Float32Array;
3921
+ uvs: Float32Array;
3922
+ indices: Uint32Array;
3923
+ vertexCount: number;
3924
+ indexCount: number;
3925
+ }
3926
+
3927
+ /** Options for {@link createSphereData}. Subset of Babylon's CreateSphere. */
3928
+ export declare interface SphereOptions {
3929
+ segments?: number;
3930
+ diameter?: number;
3931
+ diameterX?: number;
3932
+ diameterY?: number;
3933
+ diameterZ?: number;
3934
+ }
3935
+
3936
+ export declare interface SpotLight extends LightBase {
3937
+ readonly lightType: "spot";
3938
+ position: ObservableVec3;
3939
+ direction: ObservableVec3;
3940
+ /** Full cone angle in radians. */
3941
+ angle: number;
3942
+ /** Falloff exponent — higher = sharper spotlight. */
3943
+ exponent: number;
3944
+ diffuse: [number, number, number];
3945
+ specular: [number, number, number];
3946
+ intensity: number;
3947
+ range: number;
3948
+ }
3949
+
3950
+ /** A compiled-on-demand custom sprite shader. Pure data; pass as `customShader` to `createSprite2DLayer`. */
3951
+ export declare interface Sprite2DCustomShader {
3952
+
3953
+ /** Options for {@link createSprite2DCustomShader}. */
3954
+ export declare interface Sprite2DCustomShaderOptions {
3955
+ /** WGSL fragment body. See the module docs for the in-scope identifiers. */
3956
+ readonly fragment: string;
3957
+ /** Extra textures, in binding order. Each contributes a `texture_2d` + `sampler`. */
3958
+ readonly extraTextures?: readonly Sprite2DCustomTexture[];
3959
+ }
3960
+
3961
+ /** One extra texture bound after the atlas. In WGSL it becomes `<name>Tex` + `<name>Samp`. */
3962
+ export declare type Sprite2DCustomTexture = CustomShaderTexture;
3963
+
3964
+ /** Depth participation. `"none"` uses `SpriteRenderer`; depth-enabled modes use `addToScene`. */
3965
+ export declare type Sprite2DDepthMode = "none" | "test" | "test-write";
3966
+
3967
+ /** Stable identity for a single 2D sprite that survives swap-remove reindexing. */
3968
+ export declare interface Sprite2DHandle {
18
3969
  readonly layer: Sprite2DLayer;
3970
+ readonly id: number;
3971
+ }
3972
+
3973
+ /** A `Sprite2DLayer` — pure data, no methods. */
3974
+ export declare interface Sprite2DLayer {
19
3975
  readonly atlas: SpriteAtlas;
3976
+ readonly depth: Sprite2DDepthMode;
3977
+ readonly blendMode: SpriteBlendMode;
3978
+ opacity: number;
3979
+ visible: boolean;
3980
+ order: number;
3981
+ view: Sprite2DView;
3982
+ /** Layer-wide pivot in normalised sprite-local space; see `Sprite2DLayerOptions.pivot`. */
3983
+ pivot: [number, number];
3984
+ /**
3985
+ * Opt-in custom fragment shader for this layer; see `Sprite2DLayerOptions.customShader`.
3986
+ * **Absent** (not `null`) on plain layers — never default-initialized, so the always-loaded
3987
+ * path carries zero custom-shader bytes (see `sprite-fx-hook.ts`). Present only when the
3988
+ * layer was created with a `customShader`.
3989
+ */
3990
+ readonly customShader?: Sprite2DCustomShader;
3991
+ /**
3992
+ * User `fx.params` vec4 fed to a custom shader each frame; mutate via `setSprite2DShaderParams`.
3993
+ * **Absent** on plain layers (only allocated for custom-shader layers, or lazily by the setter).
3994
+ */
3995
+ shaderParams?: [number, number, number, number];
20
3996
  /** Default NDC depth for newly added sprites; see `Sprite2DLayerOptions.layerZ`. */
3997
+ layerZ: number;
3998
+ readonly count: number;
3999
+
4000
+ /** Options accepted by `createSprite2DLayer`. */
4001
+ export declare interface Sprite2DLayerOptions {
4002
+ capacity?: number;
4003
+ blendMode?: SpriteBlendMode;
4004
+ opacity?: number;
4005
+ visible?: boolean;
4006
+ order?: number;
4007
+ view?: Partial<Sprite2DView>;
4008
+ depth?: Sprite2DDepthMode;
4009
+ /**
4010
+ * Layer-wide rotation / scaling pivot in normalised sprite-local space
4011
+ * (`[0,0]` = top-left, `[0.5, 0.5]` = center, `[1,1]` = bottom-right).
4012
+ * The pivot point of every sprite in the layer lands at its `positionPx`
4013
+ * and is the center of `rotation`. Defaults to `[0.5, 0.5]` (center) to
4014
+ * match Babylon.js sprite behavior. Per-sprite / per-frame pivot is a
4015
+ * future PR — most 2D HUD layers want one uniform pivot anyway.
4016
+ */
4017
+ pivot?: [number, number];
4018
+ /**
4019
+ * Opt-in per-layer custom fragment shader (see `createSprite2DCustomShader`). Works on both
4020
+ * pure-2D (`depth: "none"`) layers drawn by a `SpriteRenderer` and depth-hosted
4021
+ * (`depth: "test" | "test-write"`) layers. Drives procedural effects (animated sky, clouds,
4022
+ * water / heat shimmer, twinkle, vignette) from a built-in `fx.time` clock plus an optional
4023
+ * `fx.params` vec4 set via `setSprite2DShaderParams`.
4024
+ */
4025
+ customShader?: Sprite2DCustomShader;
4026
+ /**
4027
+ * Default NDC depth (`0` = near, `1` = far) for sprites added to this layer when their
4028
+ * `Sprite2DProps.z` is omitted. Only meaningful for `depth: "test" | "test-write"` layers
4029
+ * (depth-hosted sprites added to a `SceneContext` via `addDepthHostedSpriteLayer`).
4030
+ *
4031
+ * Depth-hosted layers store one Z per sprite (slot [13] of their 14-float instance buffer),
4032
+ * so a single layer can mix sprites at different depths — e.g. one in front of a box, one
4033
+ * behind it. Pure-2D layers (`depth: "none"`) use the 13-float HUD layout and carry no Z slot.
4034
+ * Defaults to `0.5`. Mutating `layer.layerZ` after sprites have been added does **not**
4035
+ * retroactively change them; it only affects sprites added afterwards. To move an existing
4036
+ * depth-hosted sprite, call `updateSprite2DIndex(layer, idx, { z: … })`.
4037
+ */
4038
+ layerZ?: number;
4039
+ /**
4040
+ * Opt-in per-sprite UV scroll offset. When `true`, every sprite gains two extra instance
4041
+ * floats (`uvOffset.xy`) added to its sampled UV in the vertex stage — enabling parallax /
4042
+ * infinite-scroll backgrounds without re-uploading texture coordinates. Set the offset per
4043
+ * sprite via `Sprite2DProps.uvOffset` (on add) or `setSprite2DUvOffset` (live).
4044
+ *
4045
+ * **Zero cross-scene cost:** layers created without `uvScroll` keep the narrow 13/14-float
4046
+ * layout, the base vertex attributes, and the base WGSL — they ship none of the uvScroll
4047
+ * widening. The wider stride, the extra `@location(7)` attribute, and the `+ iUvOffset` WGSL
4048
+ * are gated directly on this per-layer flag. Defaults to `false`.
4049
+ *
4050
+ * Pairs naturally with a tileable atlas texture sampled in `repeat` wrap mode
4051
+ * (`loadSpriteAtlas(..., { textureOptions: { addressModeU: "repeat", addressModeV: "repeat" } })`).
4052
+ */
4053
+ uvScroll?: boolean;
4054
+ }
4055
+
4056
+ /** Per-sprite init record passed to `addSprite2DIndex` / `updateSprite2DIndex`. */
4057
+ export declare interface Sprite2DProps {
4058
+ positionPx: [number, number];
4059
+ sizePx?: [number, number];
4060
+ frame?: number;
4061
+ rotation?: number;
4062
+ color?: [number, number, number, number];
4063
+ flipX?: boolean;
4064
+ flipY?: boolean;
4065
+ visible?: boolean;
4066
+ /** Reserved for picking. Accepted but unused today. */
4067
+ pickable?: boolean;
4068
+ /** Reserved for clip animation. Accepted but unused today. */
4069
+ clip?: unknown;
4070
+ /**
4071
+ * Per-sprite NDC depth (`0` = near, `1` = far). Only stored and consumed by depth-hosted
4072
+ * layers (`depth: "test" | "test-write"`); pure-2D HUD layers use a 13-float layout and
4073
+ * do not allocate a Z slot. When omitted on add for a depth-hosted layer, defaults to the
4074
+ * **owning layer's** `layerZ` at the moment of insertion. When omitted on update, the
4075
+ * sprite's existing Z is preserved. Mutate freely — the next binding update will re-upload
4076
+ * only the dirty range.
4077
+ */
4078
+ z?: number;
4079
+ /**
4080
+ * Per-sprite UV scroll offset added to the sampled UV in the vertex stage. Only stored and
4081
+ * consumed by `uvScroll` layers (created with `Sprite2DLayerOptions.uvScroll: true`); non-scroll
4082
+ * layers use the narrow 13/14-float layout and do not allocate a uvOffset slot. When omitted on
4083
+ * add for a uvScroll layer, defaults to `[0, 0]`. When omitted on update, the sprite's existing
4084
+ * offset is preserved. Live updates: `setSprite2DUvOffset`.
4085
+ */
4086
+ uvOffset?: [number, number];
4087
+ }
4088
+
4089
+ /** Per-layer 2D camera (pan / zoom / rotation). Identity = pixel-perfect HUD. */
4090
+ export declare interface Sprite2DView {
4091
+ positionPx: [number, number];
4092
+ zoom: number;
4093
+ rotation: number;
4094
+ }
4095
+
4096
+ /** Handle to a sprite animation manager attached to a scene or renderer; dispose it to detach. */
4097
+ export declare interface SpriteAnimationBinding {
21
4098
  active: boolean;
4099
+
4100
+ /** Owns a set of sprite frame animations and advances them in lockstep. */
4101
+ export declare interface SpriteAnimationManager {
22
4102
  animations: SpriteFrameAnimation[];
4103
+ fixedDeltaMs: number;
4104
+ running: boolean;
4105
+
4106
+ /** Optional configuration for a sprite animation manager. */
4107
+ export declare interface SpriteAnimationManagerOptions {
4108
+ readonly fixedDeltaMs?: number;
4109
+ /** Optional. Called each tick of the manager's autonomous loop with the elapsed milliseconds. */
4110
+ readonly onUpdate?: (deltaMs: number) => void;
4111
+ }
4112
+
4113
+ /** Abstracts the sprite a frame animation drives, decoupling the animation core from each sprite family. */
4114
+ export declare interface SpriteAnimationTarget {
4115
+ /** Sets the target's current atlas frame. */
4116
+ readonly setFrame: (frame: number) => void;
4117
+ /** Optional. Removes the target from its system, used when `removeWhenFinished` is set. */
4118
+ readonly remove?: () => void;
4119
+ /** Optional. Returns `false` when the target no longer exists, stopping the animation. */
4120
+ readonly isAlive?: () => boolean;
4121
+ }
4122
+
4123
+ /** A loaded sprite atlas — pure data, no methods. Frames are addressed by integer index. */
4124
+ export declare interface SpriteAtlas {
4125
+ readonly texture: Texture2D;
4126
+ readonly textureSizePx: readonly [number, number];
4127
+ readonly frames: readonly SpriteFrame[];
4128
+ readonly premultipliedAlpha: boolean;
4129
+ }
4130
+
4131
+ /** One source frame for `createSpriteAtlasFromFrames`. */
4132
+ export declare interface SpriteAtlasFrameSource {
4133
+ /** Tightly packed RGBA8 bytes — `width * height * 4`, row-major, top-to-bottom, straight alpha. */
4134
+ readonly pixels: Uint8Array;
4135
+ readonly width: number;
4136
+ readonly height: number;
4137
+ /** Pivot in [0,1] of the frame. Default `[0.5, 0.5]`. */
4138
+ readonly pivot?: readonly [number, number];
4139
+ /** Recorded on the emitted `SpriteFrame.name`. */
4140
+ readonly name?: string;
4141
+ }
4142
+
4143
+ /** Options for `createSpriteAtlasFromFrames`. */
4144
+ export declare interface SpriteAtlasPackOptions {
4145
+ /** Transparent gap (px) between packed frames; guards against bilinear bleed. Default `1`. */
4146
+ paddingPx?: number;
4147
+ /** Shelf width (px) before wrapping to a new row. Default `1024`. */
4148
+ maxWidthPx?: number;
4149
+ /** Min/mag filter for the packed texture. Default `"nearest"`. */
4150
+ sampling?: SpriteSampling;
4151
+ premultipliedAlpha?: boolean;
4152
+ }
4153
+
4154
+ /**
4155
+ * Additive blending. The sprite's RGB, scaled by its own alpha, is added to the framebuffer,
4156
+ * so glows / light shafts / sparks stack and brighten (stars, embers, fireflies, sun shafts).
4157
+ */
4158
+ export declare const spriteBlendAdditive: SpriteBlendDescriptor;
4159
+
4160
+ /**
4161
+ * Straight-alpha "over" blending (the default). RGB is composited by source alpha; this is
4162
+ * the standard transparency mode for HUDs, UI, and soft-edged sprites.
4163
+ */
4164
+ export declare const spriteBlendAlpha: SpriteBlendDescriptor;
4165
+
4166
+ /**
4167
+ * A sprite-layer blend descriptor. Pass one of the exported `spriteBlend*` values to
4168
+ * `createSprite2DLayer({ blendMode })`. The fields are internal plumbing; treat the value
4169
+ * as opaque.
4170
+ */
4171
+ export declare interface SpriteBlendDescriptor {
4172
+
4173
+ /**
4174
+ * Output blend mode for a sprite layer — a pure-data descriptor value. Import one of
4175
+ * `spriteBlendAlpha` (default), `spriteBlendPremultiplied`, or `spriteBlendAdditive` and pass
4176
+ * it as `Sprite2DLayerOptions.blendMode`. (Type alias of {@link SpriteBlendDescriptor}.)
4177
+ */
4178
+ export declare type SpriteBlendMode = SpriteBlendDescriptor;
4179
+
4180
+ /**
4181
+ * Multiply blending. The framebuffer is multiplied by the sprite's RGB (`result = src * dst`),
4182
+ * so the sprite darkens / tints what is behind it — ideal for soft shadow blobs, dirt / grime
4183
+ * decals, ambient-occlusion stamps, and coloured "gel" overlays that modulate the scene colour.
4184
+ * Sprites should be opaque (or white where they must leave the background unchanged) since a pure
4185
+ * multiply ignores source alpha for RGB.
4186
+ */
4187
+ export declare const spriteBlendMultiply: SpriteBlendDescriptor;
4188
+
4189
+ /**
4190
+ * Premultiplied-alpha "over" blending. The sprite's RGB is assumed already multiplied by its
4191
+ * alpha; per-layer opacity scales RGB and A together for a correct fade.
4192
+ */
4193
+ export declare const spriteBlendPremultiplied: SpriteBlendDescriptor;
4194
+
4195
+ /** A single frame in an atlas. UVs in [0,1]; pivot in [0,1] of the frame. */
4196
+ export declare interface SpriteFrame {
4197
+ readonly name?: string;
4198
+ readonly uvMin: readonly [number, number];
4199
+ readonly uvMax: readonly [number, number];
4200
+ readonly sourceSizePx: readonly [number, number];
4201
+ readonly pivot: readonly [number, number];
4202
+ }
4203
+
4204
+ /** A single frame-range animation playing on a {@link SpriteAnimationTarget}. */
4205
+ export declare interface SpriteFrameAnimation {
23
4206
  readonly target: SpriteAnimationTarget;
4207
+ from: number;
4208
+ to: number;
4209
+ current: number;
4210
+ loop: boolean;
4211
+ delayMs: number;
4212
+ accumulatedMs: number;
4213
+ animationStarted: boolean;
4214
+ /** Optional. Called once when a non-looping animation reaches its last frame. */
4215
+ onEnd?: () => void;
4216
+ removeWhenFinished: boolean;
4217
+ }
4218
+
4219
+ /**
4220
+ * A `SpriteRenderer` — pure data, plugs into `engine._renderingContexts`.
4221
+ * Inherits `clearColor`, `_drawCallsPre`, `_update`, `_record` from `RenderingContext`;
4222
+ * adds only its discriminator tag and the renderer-owned layer list.
4223
+ *
4224
+ * **Lifecycle.** A `SpriteRenderer` is independent of any `SceneContext` — it is
4225
+ * registered directly on the engine, opens its own sampleCount=1 swapchain pass, and
4226
+ * must be disposed by the caller. Two patterns:
4227
+ *
4228
+ * 1. **Standalone** (no scene, or one or more renderers alongside a scene):
4229
+ * `registerSpriteRenderer` after `createSpriteRenderer`, `disposeSpriteRenderer`
4230
+ * on shutdown. Caller owns the lifetime end-to-end.
4231
+ * 2. **HUD-on-3D** (renderer overlaid on a scene): same `register` step,
4232
+ * then tie disposal to the scene with
4233
+ * `onSceneDispose(scene, () => disposeSpriteRenderer(hud))` —
4234
+ * `disposeScene` then cleans it up automatically. Register the renderer
4235
+ * *after* `registerScene` so it draws on top.
4236
+ *
4237
+ * Scene 52 demonstrates pattern (2). For depth-hosted sprites that should
4238
+ * sort against 3D meshes, use `addDepthHostedSpriteLayer(scene, layer)` with
4239
+ * a depth-enabled `Sprite2DLayer` instead — that route is fully owned by the scene.
4240
+ */
4241
+ export declare interface SpriteRenderer extends RenderingContext_2 {
24
4242
  /** Renderer-owned layer membership. Use `addSpriteRendererLayer` / `removeSpriteRendererLayer` to mutate. */
4243
+ readonly layers: readonly Sprite2DLayer[];
4244
+
4245
+ /** Options accepted by `createSpriteRenderer`. */
4246
+ export declare interface SpriteRendererOptions {
4247
+ /** Layers to draw, in registration order. The renderer also re-sorts internally each frame. */
4248
+ layers: readonly Sprite2DLayer[];
4249
+ /** Default true. Set false for HUD overlays so the sprite pass preserves existing scene color. */
4250
+ clear?: boolean;
4251
+ /** Default `{ r: 0, g: 0, b: 0, a: 1 }`. */
4252
+ clearValue?: GPUColorDict;
4253
+ }
4254
+
4255
+ /** Texture sampling mode for a sprite atlas. */
4256
+ export declare type SpriteSampling = "linear" | "nearest";
4257
+
4258
+ /** Which shader stage an emitter writes into. Neutral blocks can run in either;
4259
+ * the walker places them in the stage of their consumer (fragment by default). */
4260
+ declare type Stage = "vertex" | "fragment";
4261
+
4262
+ /** Accumulators for a single shader stage. */
4263
+ declare interface StageState {
4264
+ /** Top-level helper declarations (functions, constants) keyed by canonical id. */
4265
+ readonly helpers: Map<string, string>;
4266
+ /** Statements emitted inside main(). */
4267
+ readonly body: string[];
4268
+ /** Memoized (blockId, outputName) → expr for already-emitted values in this stage. */
4269
+ readonly memo: Map<string, NodeExpr>;
4270
+ }
4271
+
4272
+ /** StandardMaterial properties — plain data. */
4273
+ export declare interface StandardMaterialProps extends Material {
4274
+ diffuseColor: [number, number, number];
4275
+ alpha: number;
4276
+ specularColor: [number, number, number];
4277
+ specularPower: number;
4278
+ emissiveColor: [number, number, number];
4279
+ ambientColor: [number, number, number];
4280
+ /** Optional diffuse texture. Null = solid color only. */
4281
+ diffuseTexture: Texture2D | null;
4282
+ /** Diffuse texture UV channel. 0=UV1, 1=UV2. Default 0. */
4283
+ diffuseCoordIndex: 0 | 1;
4284
+ /** Optional emissive texture. Null = solid emissive color only. */
4285
+ emissiveTexture: Texture2D | null;
4286
+ /** Optional bump/normal-map texture. Uses cotangent-frame (no tangent attribute needed). */
4287
+ bumpTexture: Texture2D | null;
4288
+ /** Bump perturbation strength. Default 1.0 (maps to 1/level in BJS). */
4289
+ bumpLevel: number;
4290
+ /** Optional specular texture. Replaces specularColor; alpha modulates glossiness. */
4291
+ specularTexture: Texture2D | null;
4292
+ /** Specular texture UV channel. 0=UV1, 1=UV2. Default 0. */
4293
+ specularCoordIndex: 0 | 1;
4294
+ /** Optional ambient/occlusion texture. Multiplies final diffuse contribution. */
4295
+ ambientTexture: Texture2D | null;
4296
+ /** Ambient texture intensity. Default 1.0. */
4297
+ ambientTexLevel: number;
4298
+ /** Ambient texture UV channel. 0=UV1, 1=UV2. Default 0. */
4299
+ ambientCoordIndex: 0 | 1;
4300
+ /** Optional lightmap texture. Added to final color (additive mode). */
4301
+ lightmapTexture: Texture2D | null;
4302
+ /** Lightmap intensity. Default 1.0. */
4303
+ lightmapLevel: number;
4304
+ /** Lightmap UV channel. 0=UV1, 1=UV2. Default 1 (BJS convention). */
4305
+ lightmapCoordIndex: 0 | 1;
4306
+ /** Optional opacity texture. Multiplies alpha (.a channel). */
4307
+ opacityTexture: Texture2D | null;
4308
+ /** Opacity texture intensity. Default 1.0. */
4309
+ opacityLevel: number;
4310
+ /** When true, derive opacity from RGB luminance instead of .a channel. Default false. */
4311
+ opacityFromRGB: boolean;
4312
+ /** Alpha test cutoff. Fragments with `alpha < alphaCutOff` are discarded. Default 0 (no alpha test). */
4313
+ alphaCutOff: number;
4314
+ /** Optional reflection texture (2D spherical map). Null = no reflection. */
4315
+ reflectionTexture: Texture2D | null;
4316
+ /** Optional cube reflection texture. Null = no cube reflection. */
4317
+ reflectionCubeTexture: {
4318
+ texture: GPUTexture;
4319
+ view: GPUTextureView;
4320
+ sampler: GPUSampler;
4321
+ } | null;
4322
+ /** Reflection intensity. Default 1.0. */
4323
+ reflectionLevel: number;
4324
+ /** Reflection coordinate mode. 1=spherical, 2=planar. Default 1. */
4325
+ reflectionCoordMode: 1 | 2;
4326
+ /** UV tiling scale. Default [1, 1]. */
4327
+ uvScale: [number, number];
4328
+ /** Back-face culling. Default true (BJS convention). False = double-sided. */
4329
+ backFaceCulling: boolean;
4330
+ /** When true, skip all lighting and output emissive * diffuse * baseColor. Default false. */
4331
+ disableLighting: boolean;
4332
+ }
4333
+
4334
+ /** Starts the manager's autonomous requestAnimationFrame loop. No-op if already running.
4335
+ * @throws If `requestAnimationFrame` is unavailable in the host environment. */
4336
+ export declare function startAnimationManager(manager: AnimationManager): void;
4337
+
4338
+ /**
4339
+ * Start the render loop. Resolves after the first frame has been rendered.
4340
+ * Scenes registered via `registerScene()` before this call are included in
4341
+ * the first frame; later registrations join on subsequent frames.
4342
+ */
4343
+ export declare function startEngine(engine: EngineContext): Promise<void>;
4344
+
4345
+ /**
4346
+ * Starts a sprite animation manager on its own autonomous animation loop.
4347
+ * @param manager - Sprite animation manager to start.
4348
+ * @throws If the manager is already attached to a render loop or another manager.
4349
+ */
4350
+ export declare function startSpriteAnimationManager(manager: SpriteAnimationManager): void;
4351
+
4352
+ /** Stop playback and reset to frame 0. */
4353
+ export declare function stopAnimation(group: AnimationGroup): void;
4354
+
4355
+ /** Stops the manager's autonomous requestAnimationFrame loop. No-op if not running. */
4356
+ export declare function stopAnimationManager(manager: AnimationManager): void;
4357
+
4358
+ /** Stop the render loop. */
4359
+ export declare function stopEngine(engine: EngineContext): void;
4360
+
4361
+ /**
4362
+ * Pauses an animation without removing it; it can be resumed with `playSpriteFrameAnimation`.
4363
+ * @param animation - Animation to stop.
4364
+ */
4365
+ export declare function stopSpriteAnimation(animation: SpriteFrameAnimation): void;
4366
+
4367
+ /**
4368
+ * Stops a sprite animation manager started with {@link startSpriteAnimationManager}.
4369
+ * @param manager - Sprite animation manager to stop.
4370
+ */
4371
+ export declare function stopSpriteAnimationManager(manager: SpriteAnimationManager): void;
4372
+
4373
+ /** Subsurface configuration. Nested sub-features — presence = enabled. */
4374
+ export declare interface SubSurfaceProps {
4375
+ /** Translucency: light passing through thin surfaces. */
4376
+ translucency?: TranslucencyProps;
4377
+ /** Scattering: screen-space subsurface scattering (PrePass). Reserved — not yet implemented. */
4378
+ scattering?: ScatteringProps;
4379
+ /** Thickness: per-texel thickness for transmittance. */
4380
+ thickness?: ThicknessProps;
4381
+ /** Tint: absorption tint color for transmittance. */
4382
+ tint?: TintProps;
4383
+ /** Refraction: physical light transmission through the surface
4384
+ * (KHR_materials_transmission + _volume + _ior). Presence enables it.
4385
+ * Requires the frame graph to produce a transmission refraction texture. */
4386
+ refraction?: RefractionProps;
4387
+ }
4388
+
4389
+ declare type TargetPath = 0 | 1 | 2 | 3 | 4;
4390
+
4391
+ /** Polymorphic interface that all frame-graph tasks implement: records `Pass` objects during `record()` and is executed once per frame. */
4392
+ export declare interface Task {
4393
+ readonly name: string;
4394
+ /** Engine captured at task creation. */
4395
+ readonly engine: EngineContext;
4396
+ /** Owning scene for scene-bound tasks. Undefined for scene-less standalone frame graphs. */
4397
+ readonly scene?: SceneContext | undefined;
25
4398
  /** Called once when the frame graph is built. Must complete synchronously. */
4399
+ record(): void;
26
4400
  /** Optional fast path for built-in tasks that execute without recorded Pass objects. */
4401
+ execute?(): number;
4402
+ /** Free all GPU resources owned by this task. */
4403
+ dispose(): void;
4404
+ }
4405
+
4406
+ /** A loaded 2D texture: the GPU texture, its default view and sampler, pixel
4407
+ * dimensions, and an optional per-texture UV transform. This is the public
4408
+ * texture handle returned by `loadTexture2D()`, `createSolidTexture2D()`, etc. */
4409
+ export declare interface Texture2D {
4410
+ texture: GPUTexture;
4411
+ view: GPUTextureView;
4412
+ sampler: GPUSampler;
4413
+ width: number;
4414
+ height: number;
4415
+ /** Per-texture UV transform fields. All optional; defaults make identity.
4416
+ * Match BJS Texture.uScale/vScale/uOffset/vOffset/uAng semantics. These
4417
+ * fields are **build-time**: they are sampled when a material pipeline
4418
+ * is first compiled. Mutating them after the pipeline is built requires
4419
+ * a material rebuild (flag-based rebuild path). If a cached texture
4420
+ * wrapper needs a different transform than another use site, create a
4421
+ * fresh wrapper via `cloneTexture2D()`. */
4422
+ uScale?: number;
4423
+ vScale?: number;
4424
+ uOffset?: number;
4425
+ vOffset?: number;
4426
+ /** Rotation in radians around the (0,0) UV corner. */
4427
+ uAng?: number;
4428
+ /** True if the texel data is stored with origin at the top (y-down) and
4429
+ * must be flipped in V when sampled with standard (y-up) UVs. Applied at
4430
+ * UV-transform time in the material, so compressed-format textures (where
4431
+ * in-place row flipping is impractical) remain correct. */
4432
+ invertY?: boolean;
4433
+
4434
+ /** Sampler, format, and decode options for `loadTexture2D()`. */
4435
+ export declare interface Texture2DOptions {
4436
+ /** Generate mipmaps. Default true. */
4437
+ mipMaps?: boolean;
4438
+ /** Address mode U. Default 'repeat'. */
4439
+ addressModeU?: GPUAddressMode;
4440
+ /** Address mode V. Default 'repeat'. */
4441
+ addressModeV?: GPUAddressMode;
4442
+ /** Min filter. Default 'linear'. */
4443
+ minFilter?: GPUFilterMode;
4444
+ /** Mag filter. Default 'linear'. */
4445
+ magFilter?: GPUFilterMode;
4446
+ /** Flip Y axis during upload. Default true (matches Babylon.js convention). */
4447
+ invertY?: boolean;
4448
+ /** Use sRGB format (rgba8unorm-srgb). Enables hardware sRGB→linear on sample.
4449
+ * Use for color/albedo textures in PBR workflows. Default false. */
4450
+ srgb?: boolean;
4451
+ /** Premultiply alpha at decode time. Default false (straight RGBA, matches PNG-on-disk).
4452
+ * Set true for sprite atlases that will be rendered with a premultiplied blend pipeline
4453
+ * (`srcFactor: ONE`); doing so produces mathematically correct soft edges and stacked
4454
+ * translucency. */
4455
+ premultiplyAlpha?: boolean;
4456
+ }
4457
+
4458
+ /** Thickness sub-feature. Controls how thick the material is at each point. */
4459
+ export declare interface ThicknessProps {
4460
+ /** Thickness map texture. R channel is sampled by default (matches
4461
+ * existing BJS non-glTF path). Set `useGlTFChannel=true` for G-channel
4462
+ * sampling as specified by KHR_materials_volume. */
4463
+ texture?: Texture2D;
4464
+ /** When true, sample the thickness texture's G channel (KHR_materials_volume).
4465
+ * Default false — samples R channel (BJS default). Set by the glTF loader. */
4466
+ useGlTFChannel?: boolean;
4467
+ /** Minimum thickness. Default 0. */
4468
+ min?: number;
4469
+ /** Maximum thickness. Default 1.0. */
4470
+ max?: number;
4471
+ }
4472
+
4473
+ /** CPU-side data backing a thin-instanced mesh: world matrices, optional colors, and GPU sync state. */
4474
+ export declare interface ThinInstanceData {
4475
+ /** CPU-side instance world matrices (16 floats per instance). */
4476
+ matrices: Float32Array;
4477
+ /** Active instance count. */
4478
+ count: number;
27
4479
  /** Optional per-instance RGBA colors (4 floats per instance). */
4480
+ colors?: Float32Array | null;
4481
+
4482
+ /** Tint sub-feature. Controls absorption tint color for transmittance. */
4483
+ export declare interface TintProps {
4484
+ /** Tint color (linear RGB). Default [1,1,1]. */
4485
+ color?: [number, number, number];
4486
+ /** Distance at which the tint color is reached. Default 1.0. */
4487
+ atDistance?: number;
4488
+ }
4489
+
4490
+ /** Options for `createTorusData`. Subset of Babylon's CreateTorus. */
4491
+ export declare interface TorusOptions {
4492
+ diameter?: number;
4493
+ thickness?: number;
4494
+ tessellation?: number;
4495
+ }
4496
+
4497
+ /** TransformNode is a SceneNode — pure type alias, no extra fields. */
4498
+ export declare type TransformNode = SceneNode;
4499
+
4500
+ /** Translucency sub-feature. Presence enables translucency (no isEnabled boolean). */
4501
+ export declare interface TranslucencyProps {
4502
+ /** Translucency intensity (0=off, 1=full). Default 1.0. */
4503
+ intensity?: number;
4504
+ /** Translucency color (linear RGB). Tints the transmitted light. Default [1,1,1]. */
4505
+ color?: [number, number, number];
4506
+ /** Diffusion distance for the Burley transmittance BRDF. Controls how far
4507
+ * light travels through the material per RGB channel. Default [1,1,1]. */
4508
+ diffusionDistance?: [number, number, number];
4509
+ }
4510
+
4511
+ /** Options for `createTubeData`: a circular cross-section swept along a path. */
4512
+ export declare interface TubeOptions {
4513
+ path: Vec3[];
4514
+ radius?: number;
4515
+ tessellation?: number;
4516
+ /** Per-point radius override; receives the point index and its distance along the path. */
4517
+ radiusFunction?: (i: number, distance: number) => number;
4518
+ cap?: number;
4519
+ arc?: number;
4520
+ }
4521
+
4522
+ declare interface UboField {
4523
+
4524
+ /** A frame-graph task that draws a `UniformEffectWrapper` as a fullscreen pass into a render target. */
4525
+ export declare interface UniformEffectRenderTask extends Task {
4526
+ readonly name: string;
4527
+
4528
+ /** Configuration for `createUniformEffectRenderTask`: the uniform effect to draw, its render target, and optional clear state. */
4529
+ export declare interface UniformEffectRenderTaskConfig {
4530
+ name: string;
4531
+ effect: UniformEffectWrapper;
4532
+ target: RenderTarget;
4533
+ clear?: boolean;
4534
+ clearColor?: GPUColorDict;
4535
+ }
4536
+
4537
+ /** Lightweight reusable fullscreen effect with a single uniform buffer and no texture or sampler bindings. */
4538
+ export declare interface UniformEffectWrapper {
4539
+ readonly name: string;
4540
+ readonly options: UniformEffectWrapperOptions;
4541
+ }
4542
+
4543
+ /** Configuration for a lightweight fullscreen effect with exactly one uniform buffer at bind group 0 / binding 0. */
4544
+ export declare interface UniformEffectWrapperOptions {
4545
+ name?: string;
4546
+ fragmentWGSL: string;
4547
+ vertexWGSL?: string;
4548
+ uniformByteLength: number;
4549
+ }
4550
+
4551
+ /** Unregister the effect renderer from its engine. No-op if not registered. */
4552
+ export declare function unregisterEffectRenderer(er: EffectRenderer): void;
4553
+
4554
+ /** Unregister the standalone frame-graph context from its engine. */
4555
+ export declare function unregisterFrameGraphContext(ctx: FrameGraphContext): void;
4556
+
4557
+ /** Remove a previously-registered scene. Idempotent. Does not dispose scene resources. */
4558
+ export declare function unregisterScene(engine: EngineContext, scene: SceneContext): void;
4559
+
4560
+ /** Splice the renderer out of its engine's `_renderingContexts`. No-op if not present. */
4561
+ export declare function unregisterSpriteRenderer(sr: SpriteRenderer): void;
4562
+
4563
+ /** Advances every active task by `deltaMs` (or by `fixedDeltaMs` when set), running the category handler first.
4564
+ * Ignores non-finite or negative steps. */
4565
+ export declare function updateAnimationManager(manager: AnimationManager, deltaMs: number): void;
4566
+
4567
+ /**
4568
+ * Updates the properties of the billboard sprite referenced by `handle`.
4569
+ * @param handle - Handle of the sprite to update.
4570
+ * @param patch - Partial set of properties to overwrite.
4571
+ * @throws If the handle has already been removed.
4572
+ */
4573
+ export declare function updateBillboardSprite(handle: BillboardSpriteHandle, patch: Partial<BillboardSpriteInit>): void;
4574
+
4575
+ /**
4576
+ * Updates the billboard sprite at the given instance index.
4577
+ * @param system - Billboard system that owns the sprite.
4578
+ * @param index - Instance index to update.
4579
+ * @param patch - Partial set of properties to overwrite.
4580
+ * @throws If `index` is out of range.
4581
+ */
4582
+ export declare function updateBillboardSpriteIndex(system: BillboardSpriteSystem, index: number, patch: Partial<BillboardSpriteInit>): void;
4583
+
4584
+ /** Update a mesh's GPU vertex positions in place (e.g. CPU vertex animation).
4585
+ * `positions` must hold tightly-packed XYZ floats matching the mesh's vertex count.
4586
+ * `vertexOffset` is the first vertex to overwrite (defaults to 0).
4587
+ * The mesh must have been created via createMeshFromData / a mesh factory.
4588
+ * Zero-allocation GPU upload only — CPU-side picking geometry is not refreshed. */
4589
+ export declare function updateMeshPositions(engine: EngineContext, mesh: Mesh, positions: Float32Array, vertexOffset?: number): void;
4590
+
4591
+ /** Advance the crowd simulation by `dt` seconds. */
4592
+ export declare function updateNavCrowd(crowd: NavCrowd, dt: number): void;
4593
+
4594
+ /** Run `tileCache.update()` until all pending obstacle requests are resolved. */
4595
+ export declare function updateNavMeshObstacles(plugin: NavigationPlugin): void;
4596
+
4597
+ /**
4598
+ * Updates the properties of the sprite referenced by `handle`.
4599
+ * @param handle - Handle of the sprite to update.
4600
+ * @param patch - Partial set of properties to overwrite.
4601
+ * @throws If the handle has already been removed.
4602
+ */
4603
+ export declare function updateSprite2D(handle: Sprite2DHandle, patch: Partial<Sprite2DProps>): void;
4604
+
4605
+ /** Patch one sprite. Unspecified fields are preserved. */
4606
+ export declare function updateSprite2DIndex(layer: Sprite2DLayer, index: number, patch: Partial<Sprite2DProps>): void;
4607
+
4608
+ /**
4609
+ * Advances every animation in the manager by one time step, removing those that have finished.
4610
+ * Uses the manager's `fixedDeltaMs` when set, otherwise `deltaMs`.
4611
+ * @param manager - Manager to update.
4612
+ * @param deltaMs - Elapsed time in milliseconds since the last update.
4613
+ */
4614
+ export declare function updateSpriteAnimationManager(manager: SpriteAnimationManager, deltaMs: number): void;
4615
+
4616
+ /** Per-mesh original + variant material entry. */
4617
+ declare interface VariantMeshEntry {
4618
+ mesh: Mesh;
4619
+ material: AnyMaterial;
4620
+ }
4621
+
4622
+ declare interface Varying {
4623
+
4624
+ /** 3-component vector (position, direction, color) */
4625
+ export declare interface Vec3 {
4626
+ x: number;
4627
+ y: number;
4628
+ z: number;
4629
+ }
4630
+
4631
+ /** 3-component vector as a fixed-length `[x, y, z]` tuple. */
4632
+ export declare type Vec3Tuple = [number, number, number];
4633
+
4634
+ /** Babylon Lite version string. */
4635
+ export declare const VERSION = "0.1.0";
4636
+
4637
+ declare interface VertexAttribute {
4638
+
4639
+ export { }