@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
@@ -0,0 +1,581 @@
1
+ import { aO as getOrCreateSampler, bq as createImageProcessingTask, br as biasedMipLevelCount, b2 as getBilinearSampler, bs as _vis, bt as recordMipmaps, bo as PBR2_HAS_REFRACTION, bu as PBR2_HAS_REFRACTION_MAP, aH as PBR_HAS_THICKNESS_MAP, bv as PBR2_LINEAR_IMAGE_PROCESSING, bw as PBR2_HAS_DISPERSION, aJ as PBR2_HAS_THICKNESS_GLTF_CHANNEL, bx as PBR2_HAS_VOLUME } from "./index-C8HOR2sB.js";
2
+ const _trilinearAnisotropicDesc = {
3
+ magFilter: "linear",
4
+ minFilter: "linear",
5
+ mipmapFilter: "linear",
6
+ addressModeU: "repeat",
7
+ addressModeV: "repeat",
8
+ addressModeW: "repeat",
9
+ maxAnisotropy: 4
10
+ };
11
+ function getTrilinearAnisotropicSampler(engine) {
12
+ return getOrCreateSampler(engine, _trilinearAnisotropicDesc);
13
+ }
14
+ const BLIT_SHADER = `@group(0)@binding(0)var t:texture_2d<f32>;@group(0)@binding(1)var s:sampler;struct V{@builtin(position)p:vec4f,@location(0)u:vec2f};@vertex fn vs(@builtin(vertex_index)i:u32)->V{var p=array<vec2f,3>(vec2f(-1,-1),vec2f(3,-1),vec2f(-1,3));var u=array<vec2f,3>(vec2f(0,1),vec2f(2,1),vec2f(0,-1));return V(vec4f(p[i],0,1),u[i]);}@fragment fn fs(v:V)->@location(0)vec4f{return textureSample(t,s,v.u);}`;
15
+ const BLIT_MSAA_SHADER = `@group(0)@binding(0)var t:texture_multisampled_2d<f32>;struct V{@builtin(position)p:vec4f,@location(0)u:vec2f};@vertex fn vs(@builtin(vertex_index)i:u32)->V{var p=array<vec2f,3>(vec2f(-1,-1),vec2f(3,-1),vec2f(-1,3));var u=array<vec2f,3>(vec2f(0,1),vec2f(2,1),vec2f(0,-1));return V(vec4f(p[i],0,1),u[i]);}fn l(p:vec2i)->vec4f{let n=textureNumSamples(t);var c=vec4f(0);for(var i=0u;i<n;i++){c+=textureLoad(t,p,i);}return c/f32(n);}@fragment fn fs(v:V)->@location(0)vec4f{let d=vec2i(textureDimensions(t));let q=clamp(v.u*vec2f(d)-.5,vec2f(0),vec2f(d-vec2i(1)));let p=vec2i(floor(q));let f=fract(q);let p1=min(p+vec2i(1),d-vec2i(1));return mix(mix(l(p),l(vec2i(p1.x,p.y)),f.x),mix(l(vec2i(p.x,p1.y)),l(p1),f.x),f.y);}`;
16
+ const REFRACTION_LOD_BIAS = 4;
17
+ let blitPipelines = null;
18
+ let blitShader = null;
19
+ let blitMsaaShader = null;
20
+ let blitBgl = null;
21
+ let blitMsaaBgl = null;
22
+ let blitDevice = null;
23
+ function enableSceneTransmission(scene, engine) {
24
+ markPbrMaterialsLinear(scene);
25
+ let lastRenderTask = null;
26
+ for (const task of scene._frameGraph._tasks) {
27
+ if ("_renderables" in task) {
28
+ const renderTask = task;
29
+ enableRenderTaskTransmission(renderTask, engine);
30
+ lastRenderTask = renderTask;
31
+ }
32
+ }
33
+ if (lastRenderTask && !scene._frameGraph._tasks.some((task) => task.name === "transmission-image-processing")) {
34
+ scene._frameGraph._tasks.push(createImageProcessingTask({ name: "transmission-image-processing", source: lastRenderTask._config.rt }, engine, scene));
35
+ }
36
+ }
37
+ function enableRenderTaskTransmission(task, engine) {
38
+ var _a, _b;
39
+ if (task._executeWithTransmission) {
40
+ return;
41
+ }
42
+ retargetRenderTaskToLinearOffscreen(task, engine);
43
+ let state = null;
44
+ const record = task.record.bind(task);
45
+ const execute = (_a = task.execute) == null ? void 0 : _a.bind(task);
46
+ const dispose = (_b = task.dispose) == null ? void 0 : _b.bind(task);
47
+ task.record = () => {
48
+ disposeRenderTaskTransmission(state);
49
+ state = createRenderTaskTransmission(task, engine);
50
+ task._targetSignature._transmissionTexture = state.texture;
51
+ record();
52
+ configureTransmissionSource(state, task, engine);
53
+ };
54
+ if (execute) {
55
+ task.execute = () => executeRenderTaskLinear(task.scene, execute);
56
+ }
57
+ task.dispose = () => {
58
+ disposeRenderTaskTransmission(state);
59
+ state = null;
60
+ dispose == null ? void 0 : dispose();
61
+ };
62
+ task._executeWithTransmission = (sampleCount) => executePassWithTransmission(task, engine, state, sampleCount);
63
+ }
64
+ function retargetRenderTaskToLinearOffscreen(task, engine) {
65
+ const desc = task._config.rt._descriptor;
66
+ if (desc.resolveToSwapchain) {
67
+ desc.resolveToSwapchain = false;
68
+ desc.colorFormat = "rgba16float";
69
+ desc.flipY = false;
70
+ task._opaqueBundles.length = 0;
71
+ task._lastVersion = -1;
72
+ } else if (!desc.colorFormat) {
73
+ desc.colorFormat = "rgba16float";
74
+ }
75
+ desc.sampleCount = engine.msaaSamples;
76
+ const sig = task._targetSignature;
77
+ sig._colorFormat = desc.colorFormat;
78
+ sig._depthStencilFormat = desc.depthStencilFormat;
79
+ sig._depthCompare = desc._depthCompare;
80
+ sig._sampleCount = desc.sampleCount;
81
+ sig._flipY = desc.flipY ?? true;
82
+ }
83
+ function executeRenderTaskLinear(scene, execute) {
84
+ const imageProcessing = scene.imageProcessing;
85
+ const toneMappingEnabled = imageProcessing.toneMappingEnabled;
86
+ const clearColor = scene.clearColor;
87
+ const linearClearColor = inverseImageProcessedColor(clearColor, imageProcessing.exposure, imageProcessing.contrast, toneMappingEnabled === true);
88
+ imageProcessing.toneMappingEnabled = -1;
89
+ scene.clearColor = linearClearColor;
90
+ try {
91
+ return execute();
92
+ } finally {
93
+ scene.clearColor = clearColor;
94
+ imageProcessing.toneMappingEnabled = toneMappingEnabled;
95
+ }
96
+ }
97
+ function inverseImageProcessedColor(color, exposure, contrast, toneMapping) {
98
+ return {
99
+ r: inverseImageProcessedChannel(color.r, exposure, contrast, toneMapping),
100
+ g: inverseImageProcessedChannel(color.g, exposure, contrast, toneMapping),
101
+ b: inverseImageProcessedChannel(color.b, exposure, contrast, toneMapping),
102
+ a: color.a
103
+ };
104
+ }
105
+ function inverseImageProcessedChannel(value, exposure, contrast, toneMapping) {
106
+ let c = clamp01(value);
107
+ if (contrast < 1) {
108
+ c = contrast > 0 ? clamp01((c - 0.5 * (1 - contrast)) / contrast) : 0.5;
109
+ } else if (contrast > 1) {
110
+ const mixAmount = contrast - 1;
111
+ let lo = 0;
112
+ let hi = 1;
113
+ for (let i = 0; i < 16; i++) {
114
+ const mid = (lo + hi) * 0.5;
115
+ const high = mid * mid * (3 - 2 * mid);
116
+ const out = mid + (high - mid) * mixAmount;
117
+ if (out < c) {
118
+ lo = mid;
119
+ } else {
120
+ hi = mid;
121
+ }
122
+ }
123
+ c = (lo + hi) * 0.5;
124
+ }
125
+ c = c ** 2.2;
126
+ if (toneMapping) {
127
+ c = -Math.log2(Math.max(1 - c, 1e-6)) / 1.5905790328979492;
128
+ }
129
+ return exposure > 0 ? c / exposure : c;
130
+ }
131
+ function clamp01(v) {
132
+ return Math.min(Math.max(v, 0), 1);
133
+ }
134
+ function markPbrMaterialsLinear(scene) {
135
+ for (const mesh of scene.meshes) {
136
+ const mat = mesh.material;
137
+ if (mat) {
138
+ mat._linearImageProcessing = true;
139
+ mat._renderFeatures = void 0;
140
+ }
141
+ }
142
+ }
143
+ function createRenderTaskTransmission(task, engine) {
144
+ const rt = task._config.rt;
145
+ const width = 1024;
146
+ const height = 1024;
147
+ const format = "rgba16float";
148
+ const generateMipmaps = shouldGenerateMipmaps(task._config.transmission);
149
+ const texture = engine._device.createTexture({
150
+ label: task.name,
151
+ size: { width, height },
152
+ format,
153
+ mipLevelCount: generateMipmaps ? biasedMipLevelCount(width, height, REFRACTION_LOD_BIAS) : 1,
154
+ usage: GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST
155
+ });
156
+ const tex = {
157
+ texture,
158
+ view: texture.createView(),
159
+ sampler: getTrilinearAnisotropicSampler(engine),
160
+ width,
161
+ height,
162
+ invertY: false
163
+ };
164
+ return {
165
+ texture: tex,
166
+ _baseView: texture.createView({ baseMipLevel: 0, mipLevelCount: 1 }),
167
+ _sourceWidth: rt._width,
168
+ _sourceHeight: rt._height,
169
+ _sourceTexture: null,
170
+ _blit: null,
171
+ _copyCount: normalizeCopyCount(task._config.transmission),
172
+ _generateMipmaps: generateMipmaps,
173
+ _copies: 0
174
+ };
175
+ }
176
+ function configureTransmissionSource(state, task, engine) {
177
+ const rt = task._config.rt;
178
+ state._sourceWidth = rt._width;
179
+ state._sourceHeight = rt._height;
180
+ state._sourceTexture = rt._colorTexture;
181
+ const sampleCount = task._targetSignature._sampleCount;
182
+ if (!state._sourceTexture) {
183
+ return;
184
+ }
185
+ state._blit = shouldBlitTransmission(state, sampleCount) ? createTransmissionBlit(state, engine, state._sourceTexture, sampleCount > 1) : null;
186
+ }
187
+ function disposeRenderTaskTransmission(state) {
188
+ state == null ? void 0 : state.texture.texture.destroy();
189
+ }
190
+ function executePassWithTransmission(task, engine, state, sampleCount) {
191
+ state._copies = 0;
192
+ const transparent = task._transparentBindings;
193
+ let pass = beginTaskPass(task, null, sampleCount, false);
194
+ let draws = drawBaseTask(task, pass);
195
+ let lastPipeline = null;
196
+ for (let i = 0; i < transparent.length; i++) {
197
+ const binding = transparent[i];
198
+ const transmissive = binding.renderable._transmissive === true;
199
+ if (transmissive && canUpdateTransmission(state)) {
200
+ pass.end();
201
+ updateTransmissionTexture(state, engine);
202
+ pass = beginTaskPass(task, null, sampleCount, true);
203
+ setPassState(task, pass);
204
+ lastPipeline = null;
205
+ }
206
+ const mesh = binding.renderable.mesh;
207
+ if (mesh && mesh.visible === false) {
208
+ continue;
209
+ }
210
+ if (binding.pipeline !== lastPipeline) {
211
+ pass.setPipeline(binding.pipeline);
212
+ lastPipeline = binding.pipeline;
213
+ }
214
+ draws += binding.draw(pass, engine);
215
+ }
216
+ pass.end();
217
+ return draws;
218
+ }
219
+ function updateTransmissionTexture(state, engine) {
220
+ if (!state._sourceTexture) {
221
+ throw new Error("No transmission source");
222
+ }
223
+ if (state._blit) {
224
+ blitToTransmission(state, engine);
225
+ } else {
226
+ engine._currentEncoder.copyTextureToTexture(
227
+ { texture: state._sourceTexture },
228
+ { texture: state.texture.texture },
229
+ { width: state.texture.width, height: state.texture.height }
230
+ );
231
+ }
232
+ if (state._generateMipmaps) {
233
+ recordMipmaps(engine, state.texture.texture, engine._currentEncoder);
234
+ }
235
+ state._copies++;
236
+ }
237
+ function getBlitPipeline(engine, format, multisampled) {
238
+ const device = engine._device;
239
+ if (device !== blitDevice) {
240
+ blitPipelines == null ? void 0 : blitPipelines.clear();
241
+ blitPipelines = null;
242
+ blitShader = null;
243
+ blitMsaaShader = null;
244
+ blitBgl = null;
245
+ blitMsaaBgl = null;
246
+ blitDevice = device;
247
+ }
248
+ if (multisampled) {
249
+ blitMsaaShader ?? (blitMsaaShader = device.createShaderModule({ code: BLIT_MSAA_SHADER }));
250
+ blitMsaaBgl ?? (blitMsaaBgl = device.createBindGroupLayout({
251
+ entries: [{ binding: 0, visibility: GPUShaderStage.FRAGMENT, texture: { sampleType: "unfilterable-float", multisampled: true } }]
252
+ }));
253
+ } else {
254
+ blitShader ?? (blitShader = device.createShaderModule({ code: BLIT_SHADER }));
255
+ blitBgl ?? (blitBgl = device.createBindGroupLayout({
256
+ entries: [
257
+ { binding: 0, visibility: GPUShaderStage.FRAGMENT, texture: { sampleType: "float" } },
258
+ { binding: 1, visibility: GPUShaderStage.FRAGMENT, sampler: {} }
259
+ ]
260
+ }));
261
+ }
262
+ blitPipelines ?? (blitPipelines = /* @__PURE__ */ new Map());
263
+ const key = `${format}:${multisampled ? "msaa" : ""}`;
264
+ let pipeline = blitPipelines.get(key);
265
+ if (!pipeline) {
266
+ const bgl = multisampled ? blitMsaaBgl : blitBgl;
267
+ pipeline = device.createRenderPipeline({
268
+ label: "transmission-copy",
269
+ layout: device.createPipelineLayout({ bindGroupLayouts: [bgl] }),
270
+ vertex: { module: multisampled ? blitMsaaShader : blitShader, entryPoint: "vs" },
271
+ fragment: { module: multisampled ? blitMsaaShader : blitShader, entryPoint: "fs", targets: [{ format }] },
272
+ primitive: { topology: "triangle-list" }
273
+ });
274
+ blitPipelines.set(key, pipeline);
275
+ }
276
+ return pipeline;
277
+ }
278
+ function shouldBlitTransmission(state, sampleCount) {
279
+ return sampleCount > 1 || state._sourceWidth !== state.texture.width || state._sourceHeight !== state.texture.height;
280
+ }
281
+ function createTransmissionBlit(state, engine, source, multisampled) {
282
+ const device = engine._device;
283
+ const pipeline = getBlitPipeline(engine, state.texture.texture.format, multisampled);
284
+ const bindGroup = device.createBindGroup({
285
+ layout: multisampled ? blitMsaaBgl : blitBgl,
286
+ entries: multisampled ? [{ binding: 0, resource: source.createView() }] : [
287
+ { binding: 0, resource: source.createView() },
288
+ { binding: 1, resource: getBilinearSampler(engine) }
289
+ ]
290
+ });
291
+ return { _pipeline: pipeline, _bindGroup: bindGroup };
292
+ }
293
+ function blitToTransmission(state, engine) {
294
+ const blit = state._blit;
295
+ const pass = engine._currentEncoder.beginRenderPass({
296
+ colorAttachments: [{ view: state._baseView, loadOp: "clear", storeOp: "store", clearValue: { r: 0, g: 0, b: 0, a: 0 } }]
297
+ });
298
+ pass.setPipeline(blit._pipeline);
299
+ pass.setBindGroup(0, blit._bindGroup);
300
+ pass.draw(3);
301
+ pass.end();
302
+ }
303
+ function canUpdateTransmission(state) {
304
+ return state._copyCount === 0 || state._copies < state._copyCount;
305
+ }
306
+ function beginTaskPass(task, resolveTarget, sampleCount, load) {
307
+ const att = task._colorAttachment;
308
+ const depthLoadOp = load || !task._config.clr ? "load" : "clear";
309
+ if (load) {
310
+ att.loadOp = "load";
311
+ }
312
+ const depthAttachment = task._renderPassDescriptor.depthStencilAttachment;
313
+ if (depthAttachment) {
314
+ depthAttachment.depthLoadOp = depthLoadOp;
315
+ if (depthAttachment.stencilLoadOp) {
316
+ depthAttachment.stencilLoadOp = depthLoadOp;
317
+ }
318
+ }
319
+ if (sampleCount > 1) {
320
+ att.resolveTarget = void 0;
321
+ } else {
322
+ att.resolveTarget = void 0;
323
+ }
324
+ return task.engine._currentEncoder.beginRenderPass(task._renderPassDescriptor);
325
+ }
326
+ function setPassState(task, pass) {
327
+ const cfg = task._config;
328
+ const rt = cfg.rt;
329
+ const scene = task.scene;
330
+ const camera = cfg.cam ?? scene.camera;
331
+ const v = camera == null ? void 0 : camera.viewport;
332
+ if (v) {
333
+ const rw = rt._width;
334
+ const rh = rt._height;
335
+ const x = Math.floor(v.x * rw);
336
+ const y = Math.floor((1 - v.y - v.height) * rh);
337
+ const w = Math.ceil((v.x + v.width) * rw) - x;
338
+ const h = Math.ceil((1 - v.y) * rh) - y;
339
+ pass.setViewport(x, y, w, h, 0, 1);
340
+ pass.setScissorRect(x, y, w, h);
341
+ }
342
+ pass.setBindGroup(0, task._sceneBG);
343
+ }
344
+ function drawBaseTask(task, pass) {
345
+ const eng = task.engine;
346
+ const rt = task._config.rt;
347
+ const scene = task.scene;
348
+ const opaqueBindings = task._opaqueBindings;
349
+ const opaqueBundles = task._opaqueBundles;
350
+ setPassState(task, pass);
351
+ if (task._lastVersion !== scene._renderableVersion || task._lastVis !== _vis || opaqueBundles.length === 0) {
352
+ const desc = rt._descriptor;
353
+ const be = eng._device.createRenderBundleEncoder({
354
+ colorFormats: desc.colorFormat ? [desc.colorFormat] : [],
355
+ depthStencilFormat: desc.depthStencilFormat,
356
+ sampleCount: desc.sampleCount ?? 1
357
+ });
358
+ be.setBindGroup(0, task._sceneBG);
359
+ drawList(be, opaqueBindings, eng);
360
+ opaqueBundles[0] = be.finish();
361
+ task._lastVersion = scene._renderableVersion;
362
+ task._lastVis = _vis;
363
+ }
364
+ let draws = opaqueBindings.length;
365
+ pass.executeBundles(opaqueBundles);
366
+ pass.setBindGroup(0, task._sceneBG);
367
+ draws += drawList(pass, task._directBindings, eng);
368
+ return draws;
369
+ }
370
+ function drawList(enc, list, engine) {
371
+ let lp = null;
372
+ let draws = 0;
373
+ for (const b of list) {
374
+ const mesh = b.renderable.mesh;
375
+ if (mesh && mesh.visible === false) {
376
+ continue;
377
+ }
378
+ if (b.pipeline !== lp) {
379
+ enc.setPipeline(b.pipeline);
380
+ lp = b.pipeline;
381
+ }
382
+ draws += b.draw(enc, engine);
383
+ }
384
+ return draws;
385
+ }
386
+ function normalizeCopyCount(cfg) {
387
+ const count = (cfg == null ? void 0 : cfg.copyCount) ?? 1;
388
+ return count === Infinity ? 0 : Math.max(0, count | 0);
389
+ }
390
+ function shouldGenerateMipmaps(cfg) {
391
+ return (cfg == null ? void 0 : cfg.generateMipmaps) !== false;
392
+ }
393
+ const LINEAR_IMAGE_PROCESSING_SLOTS = { NI: `if(scene.vImageInfos.w>=0.0){`, BC: `}` };
394
+ function makeRefractionMod(hasVolume, hasMap, hasThicknessMap, useGltfThicknessChannel, hasDispersion, dispersionSampleWgsl) {
395
+ const thicknessScaleLine = hasVolume || hasThicknessMap ? `let ts=max(length(mesh.world[0].xyz),max(length(mesh.world[1].xyz),length(mesh.world[2].xyz)));` : ``;
396
+ const thicknessLine = hasThicknessMap ? `let ths=textureSample(thicknessTexture_,thicknessSampler_,input.uv).${useGltfThicknessChannel ? "g" : "r"};
397
+ let th=(material.thicknessParams.x+ths*material.thicknessParams.y)*ts;` : hasVolume ? `let th=material.refractionParams.z*ts;` : `let th=material.refractionParams.z;`;
398
+ const textureLine = hasMap ? `let ri=material.refractionParams.x*textureSample(refractionMapTexture,refractionMapSampler,input.uv).r;` : `let ri=material.refractionParams.x;`;
399
+ const absorptionLine = hasVolume ? `let ab=exp(material.volumeParams.rgb*th);` : ``;
400
+ const refractionLine = hasVolume ? `let fr=er*surfaceAlbedo*(ri*ab)*(vec3<f32>(1.0)-colorSpecularEnvReflectance.rgb);` : `let fr=er*surfaceAlbedo*ri*(vec3<f32>(1.0)-colorSpecularEnvReflectance.rgb);`;
401
+ const sampleLines = hasDispersion && dispersionSampleWgsl ? dispersionSampleWgsl : `let rd=refract(-V,N,material.refractionParams.y);
402
+ let cp=scene.viewProjection*vec4<f32>(input.worldPos+rd*th,1.0);
403
+ let ruv=(cp.xy/cp.w)*vec2<f32>(0.5,-0.5)+vec2<f32>(0.5,0.5);
404
+ let er=textureSampleLevel(refractionTexture,refractionSampler_,ruv,lv).rgb*material.environmentIntensity;`;
405
+ return `{
406
+ ${thicknessScaleLine}
407
+ ${textureLine}
408
+ ${thicknessLine}
409
+ let ro=1.0-ri;
410
+ let ra=mix(alphaG,0.0,clamp(material.refractionParams.w*3.0-2.0,0.0,1.0));
411
+ let lv=clamp(log2(f32(textureDimensions(refractionTexture).x)*ra)-4.0,0.0,f32(textureNumLevels(refractionTexture)-1));
412
+ ${sampleLines}
413
+ ${absorptionLine}
414
+ ${refractionLine}
415
+ color=finalIrradiance*ro*ro+finalRadianceScaled+finalSpecularScaled+directDiffuse*ro*ro+fr+emissive;
416
+ }`;
417
+ }
418
+ function createRefractionRttFragment(hasVolume, hasMap, hasThicknessMap, useGltfThicknessChannel, linearImageProcessing, hasDispersion, dispersionSampleWgsl) {
419
+ const uboFields = [{ _name: "refractionParams", _type: "vec4<f32>" }];
420
+ if (hasVolume) {
421
+ uboFields.push({ _name: "volumeParams", _type: "vec4<f32>" });
422
+ }
423
+ if (hasThicknessMap) {
424
+ uboFields.push({ _name: "thicknessParams", _type: "vec4<f32>" });
425
+ }
426
+ const bindings = [
427
+ { _name: "refractionTexture", _type: { _kind: "texture", _textureType: "texture_2d<f32>" }, _visibility: 2 },
428
+ { _name: "refractionSampler_", _type: { _kind: "sampler", _samplerType: "sampler" }, _visibility: 2 }
429
+ ];
430
+ if (hasMap) {
431
+ bindings.push(
432
+ { _name: "refractionMapTexture", _type: { _kind: "texture", _textureType: "texture_2d<f32>" }, _visibility: 2 },
433
+ { _name: "refractionMapSampler", _type: { _kind: "sampler", _samplerType: "sampler" }, _visibility: 2 }
434
+ );
435
+ }
436
+ if (hasThicknessMap) {
437
+ bindings.push(
438
+ { _name: "thicknessTexture_", _type: { _kind: "texture", _textureType: "texture_2d<f32>" }, _visibility: 2 },
439
+ { _name: "thicknessSampler_", _type: { _kind: "sampler", _samplerType: "sampler" }, _visibility: 2 }
440
+ );
441
+ }
442
+ return {
443
+ _id: "refraction",
444
+ _dependencies: ["ibl"],
445
+ _uboFields: uboFields,
446
+ _bindings: bindings,
447
+ _fragmentSlots: linearImageProcessing ? { AI: makeRefractionMod(hasVolume, hasMap, hasThicknessMap, useGltfThicknessChannel, hasDispersion, dispersionSampleWgsl), ...LINEAR_IMAGE_PROCESSING_SLOTS } : { AI: makeRefractionMod(hasVolume, hasMap, hasThicknessMap, useGltfThicknessChannel, hasDispersion, dispersionSampleWgsl) }
448
+ };
449
+ }
450
+ function writeRefractionUBO(data, mat, offsets) {
451
+ var _a, _b;
452
+ const ss = mat.subsurface;
453
+ const refr = ss == null ? void 0 : ss.refraction;
454
+ if (!refr) {
455
+ return;
456
+ }
457
+ const off = offsets.get("refractionParams");
458
+ if (off === void 0) {
459
+ return;
460
+ }
461
+ const o = off / 4;
462
+ data[o] = refr.intensity ?? 0;
463
+ const ior = refr.indexOfRefraction ?? 1.5;
464
+ const thick = ss.thickness;
465
+ data[o + 1] = 1 / (refr.useThicknessAsDepth && (thick == null ? void 0 : thick.max) ? ior : 1);
466
+ data[o + 2] = refr.useThicknessAsDepth ? (thick == null ? void 0 : thick.max) ?? 0 : 1;
467
+ data[o + 3] = 1 / ior;
468
+ const vOff = offsets.get("volumeParams");
469
+ if (vOff !== void 0) {
470
+ const vo = vOff / 4;
471
+ const tint = ((_a = ss.tint) == null ? void 0 : _a.color) ?? [1, 1, 1];
472
+ const dist = Math.max(((_b = ss.tint) == null ? void 0 : _b.atDistance) ?? 1, 1e-4);
473
+ data[vo] = Math.log(Math.max(tint[0], 1e-6)) / dist;
474
+ data[vo + 1] = Math.log(Math.max(tint[1], 1e-6)) / dist;
475
+ data[vo + 2] = Math.log(Math.max(tint[2], 1e-6)) / dist;
476
+ data[vo + 3] = refr.dispersion ?? 0;
477
+ }
478
+ const tOff = offsets.get("thicknessParams");
479
+ if (tOff !== void 0) {
480
+ const to = tOff / 4;
481
+ const min = (thick == null ? void 0 : thick.min) ?? 0;
482
+ const max = (thick == null ? void 0 : thick.max) ?? 1;
483
+ data[to] = min;
484
+ data[to + 1] = max - min;
485
+ }
486
+ }
487
+ function makeRefractionRttExt(dispersionSampleWgsl) {
488
+ return {
489
+ id: "refraction",
490
+ phase: "fragment",
491
+ detect(mat) {
492
+ var _a, _b, _c;
493
+ const m = mat;
494
+ const ss = m.subsurface;
495
+ const refr = ss == null ? void 0 : ss.refraction;
496
+ const linearImageProcessing = m._linearImageProcessing ? PBR2_LINEAR_IMAGE_PROCESSING : 0;
497
+ const intensity = m.transmissive ? (refr == null ? void 0 : refr.intensity) ?? 0 : 0;
498
+ if (intensity <= 0) {
499
+ return { f: 0, f2: linearImageProcessing };
500
+ }
501
+ let f = 0;
502
+ let f2 = linearImageProcessing | PBR2_HAS_REFRACTION;
503
+ if (refr == null ? void 0 : refr.texture) {
504
+ f2 |= PBR2_HAS_REFRACTION_MAP;
505
+ }
506
+ if ((_a = ss == null ? void 0 : ss.thickness) == null ? void 0 : _a.texture) {
507
+ f |= PBR_HAS_THICKNESS_MAP;
508
+ }
509
+ if ((_b = ss == null ? void 0 : ss.thickness) == null ? void 0 : _b.useGlTFChannel) {
510
+ f2 |= PBR2_HAS_THICKNESS_GLTF_CHANNEL;
511
+ }
512
+ if (((_c = ss == null ? void 0 : ss.tint) == null ? void 0 : _c.atDistance) !== void 0) {
513
+ f2 |= PBR2_HAS_VOLUME;
514
+ if (refr == null ? void 0 : refr.dispersion) {
515
+ f2 |= PBR2_HAS_DISPERSION;
516
+ }
517
+ }
518
+ return { f, f2 };
519
+ },
520
+ frag(ctx) {
521
+ const linearImageProcessing = (ctx._features2 & PBR2_LINEAR_IMAGE_PROCESSING) !== 0;
522
+ if (!(ctx._features2 & PBR2_HAS_REFRACTION)) {
523
+ return linearImageProcessing ? { _id: "linear", _fragmentSlots: LINEAR_IMAGE_PROCESSING_SLOTS } : null;
524
+ }
525
+ return createRefractionRttFragment(
526
+ (ctx._features2 & PBR2_HAS_VOLUME) !== 0,
527
+ (ctx._features2 & PBR2_HAS_REFRACTION_MAP) !== 0,
528
+ (ctx._features & PBR_HAS_THICKNESS_MAP) !== 0,
529
+ (ctx._features2 & PBR2_HAS_THICKNESS_GLTF_CHANNEL) !== 0,
530
+ linearImageProcessing,
531
+ (ctx._features2 & PBR2_HAS_DISPERSION) !== 0,
532
+ dispersionSampleWgsl
533
+ );
534
+ },
535
+ writeUbo(data, mat, offsets) {
536
+ writeRefractionUBO(data, mat, offsets);
537
+ },
538
+ bind(ctx, entries, b) {
539
+ var _a, _b, _c, _d;
540
+ if (!(ctx._features2 & PBR2_HAS_REFRACTION)) {
541
+ return b;
542
+ }
543
+ const texture = ctx._refractionTexture;
544
+ if (!texture) {
545
+ throw new Error("PBR transmission requires a frame-graph refraction texture.");
546
+ }
547
+ entries.push({ binding: b++, resource: texture.view });
548
+ entries.push({ binding: b++, resource: texture.sampler });
549
+ if ((ctx._features2 & PBR2_HAS_REFRACTION_MAP) !== 0) {
550
+ const map = (_b = (_a = ctx._material.subsurface) == null ? void 0 : _a.refraction) == null ? void 0 : _b.texture;
551
+ entries.push({ binding: b++, resource: map.view });
552
+ entries.push({ binding: b++, resource: getTrilinearAnisotropicSampler(ctx._engine) });
553
+ }
554
+ if ((ctx._features & PBR_HAS_THICKNESS_MAP) !== 0) {
555
+ const thickness = (_d = (_c = ctx._material.subsurface) == null ? void 0 : _c.thickness) == null ? void 0 : _d.texture;
556
+ entries.push({ binding: b++, resource: thickness.view });
557
+ entries.push({ binding: b++, resource: thickness.sampler });
558
+ }
559
+ return b;
560
+ },
561
+ textures(mat, out) {
562
+ var _a, _b, _c, _d;
563
+ const tex = (_b = (_a = mat.subsurface) == null ? void 0 : _a.refraction) == null ? void 0 : _b.texture;
564
+ if (tex) {
565
+ out.push(tex);
566
+ }
567
+ const thickness = (_d = (_c = mat.subsurface) == null ? void 0 : _c.thickness) == null ? void 0 : _d.texture;
568
+ if (thickness) {
569
+ out.push(thickness);
570
+ }
571
+ }
572
+ };
573
+ }
574
+ function registerPbrTransmission(scene, engine, register, dispersionSampleWgsl) {
575
+ enableSceneTransmission(scene, engine);
576
+ register(makeRefractionRttExt(dispersionSampleWgsl));
577
+ }
578
+ export {
579
+ registerPbrTransmission
580
+ };
581
+ //# sourceMappingURL=pbr-transmission-ext-BxW4CEGu.js.map