python-cad-tools 0.1.0rc1__py3-none-any.whl

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 (236) hide show
  1. python_cad_tools/__init__.py +10 -0
  2. python_cad_tools/_locking.py +63 -0
  3. python_cad_tools/_project_loader.py +273 -0
  4. python_cad_tools/_project_state.py +65 -0
  5. python_cad_tools/_scaffold.py +66 -0
  6. python_cad_tools/_transaction.py +208 -0
  7. python_cad_tools/_viewer_static/app.webmanifest +18 -0
  8. python_cad_tools/_viewer_static/asset-manifest.json +1 -0
  9. python_cad_tools/_viewer_static/assets/animationGroup-Sd34ntWg.js +1 -0
  10. python_cad_tools/_viewer_static/assets/bakedVertexAnimation-Cd_pRdrn.js +316 -0
  11. python_cad_tools/_viewer_static/assets/basisTextureLoader-DWgvS_1G.js +1 -0
  12. python_cad_tools/_viewer_static/assets/brdfTextureTools-CWGiG1W2.js +2 -0
  13. python_cad_tools/_viewer_static/assets/bumpFragment-CWULheF1.js +127 -0
  14. python_cad_tools/_viewer_static/assets/bumpVertex-DqzFZayE.js +6 -0
  15. python_cad_tools/_viewer_static/assets/bumpVertexDeclaration-C5EFyTio.js +6 -0
  16. python_cad_tools/_viewer_static/assets/clipPlaneFragment-BXRtt4jj.js +46 -0
  17. python_cad_tools/_viewer_static/assets/clipPlaneVertex-B_VhD1oQ.js +37 -0
  18. python_cad_tools/_viewer_static/assets/cubemapToSphericalPolynomial-DRpaukza.js +1 -0
  19. python_cad_tools/_viewer_static/assets/dds-Dkb2Cx2N.js +1 -0
  20. python_cad_tools/_viewer_static/assets/dds.pure-DtvJsKvY.js +1 -0
  21. python_cad_tools/_viewer_static/assets/ddsTextureLoader-H78xux1g.js +1 -0
  22. python_cad_tools/_viewer_static/assets/default.fragment-oSQ-tWhe.js +469 -0
  23. python_cad_tools/_viewer_static/assets/default.vertex-DhFjw_Da.js +209 -0
  24. python_cad_tools/_viewer_static/assets/defaultUboDeclaration-BMDHNppx.js +5 -0
  25. python_cad_tools/_viewer_static/assets/dumpTools-BaNZPjUX.js +2 -0
  26. python_cad_tools/_viewer_static/assets/envTextureLoader-V0YnLcIM.js +1 -0
  27. python_cad_tools/_viewer_static/assets/exrTextureLoader-CjGyIK3x.js +1 -0
  28. python_cad_tools/_viewer_static/assets/flowGraphApplyForceBlock-CW5nuobR.js +1 -0
  29. python_cad_tools/_viewer_static/assets/flowGraphApplyImpulseBlock-LFqYIkhj.js +1 -0
  30. python_cad_tools/_viewer_static/assets/flowGraphArrayIndexBlock-BMOHUbBm.js +1 -0
  31. python_cad_tools/_viewer_static/assets/flowGraphBezierCurveEasingBlock-knmTiuEk.js +1 -0
  32. python_cad_tools/_viewer_static/assets/flowGraphBinaryOperationBlock-DFLuCAKJ.js +1 -0
  33. python_cad_tools/_viewer_static/assets/flowGraphBranchBlock-BJRHMXMo.js +1 -0
  34. python_cad_tools/_viewer_static/assets/flowGraphCachedOperationBlock-Dng-6jE0.js +1 -0
  35. python_cad_tools/_viewer_static/assets/flowGraphCancelDelayBlock-CgbK3CQZ.js +1 -0
  36. python_cad_tools/_viewer_static/assets/flowGraphCodeExecutionBlock-8zMtq9tg.js +1 -0
  37. python_cad_tools/_viewer_static/assets/flowGraphConditionalDataBlock-BiLr2rkI.js +1 -0
  38. python_cad_tools/_viewer_static/assets/flowGraphConsoleLogBlock-J1vcCtNP.js +1 -0
  39. python_cad_tools/_viewer_static/assets/flowGraphConstantBlock-CFb5nuaV.js +1 -0
  40. python_cad_tools/_viewer_static/assets/flowGraphContextBlock-DAeGVzhC.js +1 -0
  41. python_cad_tools/_viewer_static/assets/flowGraphCounterBlock-lZlAQiJd.js +1 -0
  42. python_cad_tools/_viewer_static/assets/flowGraphDataSwitchBlock-BIzvmbVy.js +1 -0
  43. python_cad_tools/_viewer_static/assets/flowGraphDebounceBlock-DvNuMVwy.js +1 -0
  44. python_cad_tools/_viewer_static/assets/flowGraphDebugBlock-Dymd2VEE.js +1 -0
  45. python_cad_tools/_viewer_static/assets/flowGraphDoNBlock-v68aoNLH.js +1 -0
  46. python_cad_tools/_viewer_static/assets/flowGraphEasingBlock-CTnGv92q.js +1 -0
  47. python_cad_tools/_viewer_static/assets/flowGraphFlipFlopBlock-DXsO0Chw.js +1 -0
  48. python_cad_tools/_viewer_static/assets/flowGraphForLoopBlock-CPpe9T75.js +1 -0
  49. python_cad_tools/_viewer_static/assets/flowGraphFunctionReferenceBlock-DjDev4Pq.js +1 -0
  50. python_cad_tools/_viewer_static/assets/flowGraphGLTFDataProvider-GIYCz4AQ.js +1 -0
  51. python_cad_tools/_viewer_static/assets/flowGraphGetAngularVelocityBlock-BStkOVeL.js +1 -0
  52. python_cad_tools/_viewer_static/assets/flowGraphGetAssetBlock-Eiqoivbz.js +1 -0
  53. python_cad_tools/_viewer_static/assets/flowGraphGetLinearVelocityBlock-B0cpV5ws.js +1 -0
  54. python_cad_tools/_viewer_static/assets/flowGraphGetPhysicsMassPropertiesBlock-B-H64yaI.js +1 -0
  55. python_cad_tools/_viewer_static/assets/flowGraphGetPropertyBlock-CUyOsPw0.js +1 -0
  56. python_cad_tools/_viewer_static/assets/flowGraphGetSoundVolumeBlock-C0FjrsUz.js +1 -0
  57. python_cad_tools/_viewer_static/assets/flowGraphGetVariableBlock-O4597zBl.js +1 -0
  58. python_cad_tools/_viewer_static/assets/flowGraphIndexOfBlock-E00Z3KXM.js +1 -0
  59. python_cad_tools/_viewer_static/assets/flowGraphInterpolationBlock-DnkA9MNH.js +1 -0
  60. python_cad_tools/_viewer_static/assets/flowGraphIsKeyPressedBlock-DDfeuAyf.js +1 -0
  61. python_cad_tools/_viewer_static/assets/flowGraphIsSoundPlayingBlock-DMXg8jdM.js +1 -0
  62. python_cad_tools/_viewer_static/assets/flowGraphJsonPointerParserBlock-OmCorK0y.js +1 -0
  63. python_cad_tools/_viewer_static/assets/flowGraphKeyDownEventBlock-RuVtj6g2.js +1 -0
  64. python_cad_tools/_viewer_static/assets/flowGraphKeyUpEventBlock-DO4pAfHi.js +1 -0
  65. python_cad_tools/_viewer_static/assets/flowGraphKeyboardEventBlock-Bx3pAzzh.js +1 -0
  66. python_cad_tools/_viewer_static/assets/flowGraphMathBlocks-7W1XYOC8.js +1 -0
  67. python_cad_tools/_viewer_static/assets/flowGraphMathCombineExtractBlocks-a4f0Kv6e.js +1 -0
  68. python_cad_tools/_viewer_static/assets/flowGraphMatrixMathBlocks-C5Z-y1Au.js +1 -0
  69. python_cad_tools/_viewer_static/assets/flowGraphMeshPickEventBlock-D4m-I4CS.js +1 -0
  70. python_cad_tools/_viewer_static/assets/flowGraphMultiGateBlock-BISVSMw6.js +1 -0
  71. python_cad_tools/_viewer_static/assets/flowGraphPauseAnimationBlock-BYP2Z-HG.js +1 -0
  72. python_cad_tools/_viewer_static/assets/flowGraphPauseSoundBlock-Drh1EeW6.js +1 -0
  73. python_cad_tools/_viewer_static/assets/flowGraphPhysicsCollisionEventBlock-BoziAQ75.js +1 -0
  74. python_cad_tools/_viewer_static/assets/flowGraphPlayAnimationBlock-Clry-68M.js +1 -0
  75. python_cad_tools/_viewer_static/assets/flowGraphPlaySoundBlock-LbBVxGBE.js +1 -0
  76. python_cad_tools/_viewer_static/assets/flowGraphPointerDownEventBlock-DIVXCSHh.js +1 -0
  77. python_cad_tools/_viewer_static/assets/flowGraphPointerMoveEventBlock-BNNOzY2W.js +1 -0
  78. python_cad_tools/_viewer_static/assets/flowGraphPointerOutEventBlock-B8f2dOFT.js +1 -0
  79. python_cad_tools/_viewer_static/assets/flowGraphPointerOverEventBlock-CQr8LCee.js +1 -0
  80. python_cad_tools/_viewer_static/assets/flowGraphPointerUpEventBlock-DMg_iEHl.js +1 -0
  81. python_cad_tools/_viewer_static/assets/flowGraphReceiveCustomEventBlock-B8GJm9Ai.js +1 -0
  82. python_cad_tools/_viewer_static/assets/flowGraphSceneReadyEventBlock-Dcdb29K2.js +1 -0
  83. python_cad_tools/_viewer_static/assets/flowGraphSceneTickEventBlock-BLE5p4mi.js +1 -0
  84. python_cad_tools/_viewer_static/assets/flowGraphSendCustomEventBlock-BMzDItQ5.js +1 -0
  85. python_cad_tools/_viewer_static/assets/flowGraphSequenceBlock-DRURovjn.js +1 -0
  86. python_cad_tools/_viewer_static/assets/flowGraphSetAngularVelocityBlock-Ba8dhkLM.js +1 -0
  87. python_cad_tools/_viewer_static/assets/flowGraphSetDelayBlock-CnQR--Gn.js +1 -0
  88. python_cad_tools/_viewer_static/assets/flowGraphSetLinearVelocityBlock-Dm1r3vkh.js +1 -0
  89. python_cad_tools/_viewer_static/assets/flowGraphSetPhysicsMotionTypeBlock-BNtMLimi.js +1 -0
  90. python_cad_tools/_viewer_static/assets/flowGraphSetPropertyBlock-C-uv2jhP.js +1 -0
  91. python_cad_tools/_viewer_static/assets/flowGraphSetSoundVolumeBlock-D9LDx3lg.js +1 -0
  92. python_cad_tools/_viewer_static/assets/flowGraphSetVariableBlock-DszzRB5X.js +1 -0
  93. python_cad_tools/_viewer_static/assets/flowGraphSoundEndedEventBlock-DeTDSudb.js +1 -0
  94. python_cad_tools/_viewer_static/assets/flowGraphStopAnimationBlock-DWuwoFWr.js +1 -0
  95. python_cad_tools/_viewer_static/assets/flowGraphStopSoundBlock-DEnj2cQw.js +1 -0
  96. python_cad_tools/_viewer_static/assets/flowGraphSwitchBlock-zs8Fp9ky.js +1 -0
  97. python_cad_tools/_viewer_static/assets/flowGraphThrottleBlock-BYAKUQXd.js +1 -0
  98. python_cad_tools/_viewer_static/assets/flowGraphTransformCoordinatesSystemBlock-DYP54m5P.js +1 -0
  99. python_cad_tools/_viewer_static/assets/flowGraphTypeToTypeBlocks-vFwn79bS.js +1 -0
  100. python_cad_tools/_viewer_static/assets/flowGraphUnaryOperationBlock-CaRh4Ef0.js +1 -0
  101. python_cad_tools/_viewer_static/assets/flowGraphVectorMathBlocks-BEIhMs-A.js +1 -0
  102. python_cad_tools/_viewer_static/assets/flowGraphWaitAllBlock-DFbELP_j.js +1 -0
  103. python_cad_tools/_viewer_static/assets/flowGraphWhileLoopBlock-C1OKQ-_F.js +1 -0
  104. python_cad_tools/_viewer_static/assets/fogFragment-DtDlQBnz.js +25 -0
  105. python_cad_tools/_viewer_static/assets/gaussianSplatting-Cfigjb15.js +242 -0
  106. python_cad_tools/_viewer_static/assets/gaussianSplatting-DIn8R8oF.js +296 -0
  107. python_cad_tools/_viewer_static/assets/gaussianSplatting.fragment-BxeRJ2k-.js +38 -0
  108. python_cad_tools/_viewer_static/assets/gaussianSplatting.fragment-DNDmvRs-.js +37 -0
  109. python_cad_tools/_viewer_static/assets/gaussianSplatting.vertex-D92z5jYn.js +86 -0
  110. python_cad_tools/_viewer_static/assets/gaussianSplatting.vertex-DSWfFnKQ.js +86 -0
  111. python_cad_tools/_viewer_static/assets/gaussianSplattingVoxel.fragment-DBQE2gDk.js +12 -0
  112. python_cad_tools/_viewer_static/assets/gaussianSplattingVoxel.fragment-qwx5ntqJ.js +17 -0
  113. python_cad_tools/_viewer_static/assets/gaussianSplattingVoxel.vertex-CP2kd3jU.js +30 -0
  114. python_cad_tools/_viewer_static/assets/gaussianSplattingVoxel.vertex-Dr-fEg_W.js +19 -0
  115. python_cad_tools/_viewer_static/assets/geometry.fragment-CsJIm2H0.js +242 -0
  116. python_cad_tools/_viewer_static/assets/geometry.fragment-Dph3muZt.js +262 -0
  117. python_cad_tools/_viewer_static/assets/geometry.vertex-BXGMTA_J.js +212 -0
  118. python_cad_tools/_viewer_static/assets/geometry.vertex-Bm9Wg3Gi.js +214 -0
  119. python_cad_tools/_viewer_static/assets/glowBlurPostProcess.fragment-BJSwKIJD.js +7 -0
  120. python_cad_tools/_viewer_static/assets/glowMapGeneration.fragment-DcyS1cTF.js +63 -0
  121. python_cad_tools/_viewer_static/assets/glowMapGeneration.vertex-BGq1Fakj.js +75 -0
  122. python_cad_tools/_viewer_static/assets/glowMapMerge.fragment-DxcneU_F.js +25 -0
  123. python_cad_tools/_viewer_static/assets/glowMapMerge.vertex-DaJJKqMV.js +8 -0
  124. python_cad_tools/_viewer_static/assets/harmonicsFunctions-DzJcvNWG.js +16 -0
  125. python_cad_tools/_viewer_static/assets/hdrTextureLoader-BGQvgh0h.js +2 -0
  126. python_cad_tools/_viewer_static/assets/helperFunctions-Cugfp1Fz.js +87 -0
  127. python_cad_tools/_viewer_static/assets/iesTextureLoader-CO4G0p2M.js +2 -0
  128. python_cad_tools/_viewer_static/assets/index-B2zBEWsq.js +7007 -0
  129. python_cad_tools/_viewer_static/assets/index-DcTTrc-8.css +1 -0
  130. python_cad_tools/_viewer_static/assets/kernelBlur.fragment-B6CTXTxY.js +57 -0
  131. python_cad_tools/_viewer_static/assets/kernelBlur.fragment-BkKbudbW.js +57 -0
  132. python_cad_tools/_viewer_static/assets/kernelBlur.vertex-BYwFU5IS.js +11 -0
  133. python_cad_tools/_viewer_static/assets/kernelBlur.vertex-D371zUfT.js +11 -0
  134. python_cad_tools/_viewer_static/assets/kernelBlurVaryingDeclaration-CgBGaCHg.js +1 -0
  135. python_cad_tools/_viewer_static/assets/kernelBlurVaryingDeclaration-YS8JpqdO.js +1 -0
  136. python_cad_tools/_viewer_static/assets/ktxTextureLoader-ncMSJTjl.js +1 -0
  137. python_cad_tools/_viewer_static/assets/lightFragment-skHiFbKB.js +398 -0
  138. python_cad_tools/_viewer_static/assets/logDepthDeclaration-BR8XRz9F.js +4 -0
  139. python_cad_tools/_viewer_static/assets/logDepthVertex-UKrhEIvg.js +14 -0
  140. python_cad_tools/_viewer_static/assets/mainUVVaryingDeclaration-BxQWGFcG.js +4 -0
  141. python_cad_tools/_viewer_static/assets/mesh.vertexData.functions-ayNlGC5K.js +1 -0
  142. python_cad_tools/_viewer_static/assets/meshUboDeclaration-BnX046aQ.js +4 -0
  143. python_cad_tools/_viewer_static/assets/oitFragment-CTMCOfNP.js +605 -0
  144. python_cad_tools/_viewer_static/assets/openpbr.fragment-DPJPqi6p.js +1530 -0
  145. python_cad_tools/_viewer_static/assets/openpbr.fragment-Dv6qTVVi.js +1384 -0
  146. python_cad_tools/_viewer_static/assets/openpbr.vertex-Bn2wrdGL.js +364 -0
  147. python_cad_tools/_viewer_static/assets/openpbr.vertex-CHESW3gB.js +251 -0
  148. python_cad_tools/_viewer_static/assets/openpbrMaterial.pure-BdK7VgO_.js +3 -0
  149. python_cad_tools/_viewer_static/assets/openpbrMaterialLoadingAdapter-Bm_AHDUN.js +4 -0
  150. python_cad_tools/_viewer_static/assets/openpbrTransmissionLayerData-BDa9qEoN.js +339 -0
  151. python_cad_tools/_viewer_static/assets/openpbrTransmissionLayerData-Ba_ly4LE.js +343 -0
  152. python_cad_tools/_viewer_static/assets/openpbrUboDeclaration-BY2lSH2C.js +5 -0
  153. python_cad_tools/_viewer_static/assets/openpbrUboDeclaration-DajhikDS.js +6 -0
  154. python_cad_tools/_viewer_static/assets/packingFunctions-BHPwcGG2.js +4 -0
  155. python_cad_tools/_viewer_static/assets/packingFunctions-DTwzBRBx.js +4 -0
  156. python_cad_tools/_viewer_static/assets/pass.fragment-9oKU4pI3.js +4 -0
  157. python_cad_tools/_viewer_static/assets/passCube.fragment-CpAeiYx1.js +23 -0
  158. python_cad_tools/_viewer_static/assets/passCube.fragment-DHtSWVRF.js +23 -0
  159. python_cad_tools/_viewer_static/assets/pbr.fragment-cIhMKwLs.js +2560 -0
  160. python_cad_tools/_viewer_static/assets/pbr.vertex-BfdONsf2.js +255 -0
  161. python_cad_tools/_viewer_static/assets/pbrBRDFFunctions-B_ppOzPO.js +173 -0
  162. python_cad_tools/_viewer_static/assets/pbrDebug-DDdwL5_t.js +693 -0
  163. python_cad_tools/_viewer_static/assets/pbrIBLFunctions-b1zdpzOP.js +43 -0
  164. python_cad_tools/_viewer_static/assets/pbrMaterial.pure-BZA7yVhu.js +2 -0
  165. python_cad_tools/_viewer_static/assets/pbrMaterialLoadingAdapter-BRvKRnjl.js +1 -0
  166. python_cad_tools/_viewer_static/assets/pbrUboDeclaration-CMZp25k3.js +5 -0
  167. python_cad_tools/_viewer_static/assets/postprocess.vertex-DzdUpNbW.js +9 -0
  168. python_cad_tools/_viewer_static/assets/procedural.vertex-BnbuQ-1f.js +7 -0
  169. python_cad_tools/_viewer_static/assets/procedural.vertex-Dp-Ng7Pc.js +8 -0
  170. python_cad_tools/_viewer_static/assets/reflectionFunction-DBlr3oDs.js +83 -0
  171. python_cad_tools/_viewer_static/assets/rgbdDecode.fragment-CyvnZFOJ.js +5 -0
  172. python_cad_tools/_viewer_static/assets/rgbdEncode.fragment-Dz4zLnoD.js +5 -0
  173. python_cad_tools/_viewer_static/assets/rgbdEncode.fragment-iscgpA1_.js +5 -0
  174. python_cad_tools/_viewer_static/assets/sceneUboDeclaration-BzFIc4mb.js +11 -0
  175. python_cad_tools/_viewer_static/assets/textureProcessor.fragment-C9D0rd-M.js +151 -0
  176. python_cad_tools/_viewer_static/assets/textureProcessor.fragment-JMKyWZng.js +146 -0
  177. python_cad_tools/_viewer_static/assets/tgaTextureLoader-oxTElIQJ.js +1 -0
  178. python_cad_tools/_viewer_static/assets/vertexColorMixing-mdC9xZe1.js +418 -0
  179. python_cad_tools/_viewer_static/favicon.svg +10 -0
  180. python_cad_tools/_viewer_static/index.html +18 -0
  181. python_cad_tools/_viewer_static/sw.js +61 -0
  182. python_cad_tools/artifacts.py +546 -0
  183. python_cad_tools/build-info.json +1 -0
  184. python_cad_tools/build.py +270 -0
  185. python_cad_tools/cli.py +212 -0
  186. python_cad_tools/context.py +67 -0
  187. python_cad_tools/determinism.py +66 -0
  188. python_cad_tools/drawings/__init__.py +124 -0
  189. python_cad_tools/drawings/_catalog.py +79 -0
  190. python_cad_tools/drawings/_validation.py +238 -0
  191. python_cad_tools/elements.py +121 -0
  192. python_cad_tools/exceptions.py +45 -0
  193. python_cad_tools/exporters/__init__.py +8 -0
  194. python_cad_tools/exporters/base.py +24 -0
  195. python_cad_tools/exporters/drawings/__init__.py +5 -0
  196. python_cad_tools/exporters/drawings/annotations.py +444 -0
  197. python_cad_tools/exporters/drawings/dxf.py +110 -0
  198. python_cad_tools/exporters/drawings/model.py +70 -0
  199. python_cad_tools/exporters/drawings/pdf.py +119 -0
  200. python_cad_tools/exporters/drawings/primitives.py +93 -0
  201. python_cad_tools/exporters/drawings/projection.py +64 -0
  202. python_cad_tools/exporters/drawings/svg.py +135 -0
  203. python_cad_tools/exporters/glb.py +100 -0
  204. python_cad_tools/exporters/ifc.py +229 -0
  205. python_cad_tools/exporters/quantities.py +136 -0
  206. python_cad_tools/exporters/step.py +117 -0
  207. python_cad_tools/geometry.py +187 -0
  208. python_cad_tools/manifests.py +338 -0
  209. python_cad_tools/project_config.py +174 -0
  210. python_cad_tools/py.typed +1 -0
  211. python_cad_tools/runtime_sync.py +126 -0
  212. python_cad_tools/schemas/build-manifest-1.json +1 -0
  213. python_cad_tools/schemas/design-manifest-1.json +1 -0
  214. python_cad_tools/schemas/download-manifest-2.json +46 -0
  215. python_cad_tools/schemas/drawing-annotations-1.json +66 -0
  216. python_cad_tools/schemas/glb-manifest-1.json +1 -0
  217. python_cad_tools/schemas/ifc-validation-1.json +1 -0
  218. python_cad_tools/schemas/quantities-1.json +1 -0
  219. python_cad_tools/schemas/run-metadata-1.json +1 -0
  220. python_cad_tools/schemas/site-metadata-1.json +34 -0
  221. python_cad_tools/schemas/step-validation-1.json +1 -0
  222. python_cad_tools/site.py +676 -0
  223. python_cad_tools/templates/project/.gitignore +9 -0
  224. python_cad_tools/templates/project/README.md +38 -0
  225. python_cad_tools/templates/project/config.py +36 -0
  226. python_cad_tools/templates/project/drawing_annotations.py +117 -0
  227. python_cad_tools/templates/project/model.py +87 -0
  228. python_cad_tools/templates/project/pyproject.toml +27 -0
  229. python_cad_tools/units.py +207 -0
  230. python_cad_tools/validation.py +153 -0
  231. python_cad_tools-0.1.0rc1.dist-info/METADATA +149 -0
  232. python_cad_tools-0.1.0rc1.dist-info/RECORD +236 -0
  233. python_cad_tools-0.1.0rc1.dist-info/WHEEL +5 -0
  234. python_cad_tools-0.1.0rc1.dist-info/entry_points.txt +2 -0
  235. python_cad_tools-0.1.0rc1.dist-info/licenses/LICENSE +679 -0
  236. python_cad_tools-0.1.0rc1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,3 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./geometry.vertex-BXGMTA_J.js","./index-B2zBEWsq.js","./index-DcTTrc-8.css","./bakedVertexAnimation-Cd_pRdrn.js","./sceneUboDeclaration-BzFIc4mb.js","./clipPlaneVertex-B_VhD1oQ.js","./harmonicsFunctions-DzJcvNWG.js","./bumpVertex-DqzFZayE.js","./geometry.fragment-Dph3muZt.js","./clipPlaneFragment-BXRtt4jj.js","./bumpFragment-CWULheF1.js","./reflectionFunction-DBlr3oDs.js","./helperFunctions-Cugfp1Fz.js","./pbrIBLFunctions-b1zdpzOP.js","./pbrBRDFFunctions-B_ppOzPO.js","./openpbrTransmissionLayerData-Ba_ly4LE.js","./geometry.vertex-Bm9Wg3Gi.js","./geometry.fragment-CsJIm2H0.js","./openpbrTransmissionLayerData-BDa9qEoN.js","./openpbr.vertex-CHESW3gB.js","./meshUboDeclaration-BnX046aQ.js","./openpbrUboDeclaration-BY2lSH2C.js","./vertexColorMixing-mdC9xZe1.js","./mainUVVaryingDeclaration-BxQWGFcG.js","./logDepthVertex-UKrhEIvg.js","./logDepthDeclaration-BR8XRz9F.js","./openpbr.fragment-Dv6qTVVi.js","./oitFragment-CTMCOfNP.js","./pbrDebug-DDdwL5_t.js","./fogFragment-DtDlQBnz.js","./openpbr.vertex-Bn2wrdGL.js","./openpbrUboDeclaration-DajhikDS.js","./openpbr.fragment-DPJPqi6p.js"])))=>i.map(i=>d[i]);
2
+ import{bp as Ae,L as De,av as Ll,aS as Zl,aw as Pe,b8 as zt,aN as wt,aA as Gt,ay as be,aR as $,bq as ae,br as Ul,bs as Kl,bt as jl,bu as Ql,M as ql,bv as $l,aT as ne,bw as Wl,bx as wl,by as Jl,bz as c,bA as _,a9 as ve,c as Re,aO as i,a7 as Gl,bB as eo,au as to,bC as Dl,bD as Pl,bE as so,bF as io,a0 as pe,bG as Ut,bH as ro,bI as ao,bJ as no,bK as lo,bL as oo,bM as uo,bN as ho,bO as co,bP as _o,bQ as fo,bR as To,bS as go,bT as mo,bU as po,bV as xo,bW as Ro,bX as Ao,bY as Wt,bZ as Eo,b_ as So,b$ as Mo,c0 as Io,c1 as bo,c2 as yo,c3 as Oo,c4 as Co,c5 as Fo,aU as h,c6 as Lo,c7 as Do,i as Po,c8 as No,c9 as vo,V as ko,ca as Bo,cb as zo,cc as Uo,cd as p,aV as X,ce as Y}from"./index-B2zBEWsq.js";import{G as Wo,a as Nl}from"./brdfTextureTools-CWGiG1W2.js";function wo(r){return class extends r{constructor(){super(...arguments),this.REFLECTION=!1,this.REFLECTIONMAP_3D=!1,this.REFLECTIONMAP_SPHERICAL=!1,this.REFLECTIONMAP_PLANAR=!1,this.REFLECTIONMAP_CUBIC=!1,this.USE_LOCAL_REFLECTIONMAP_CUBIC=!1,this.REFLECTIONMAP_PROJECTION=!1,this.REFLECTIONMAP_SKYBOX=!1,this.REFLECTIONMAP_EXPLICIT=!1,this.REFLECTIONMAP_EQUIRECTANGULAR=!1,this.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,this.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,this.INVERTCUBICMAP=!1,this.USESPHERICALFROMREFLECTIONMAP=!1,this.USEIRRADIANCEMAP=!1,this.USE_IRRADIANCE_DOMINANT_DIRECTION=!1,this.USESPHERICALINVERTEX=!1,this.REFLECTIONMAP_OPPOSITEZ=!1,this.LODINREFLECTIONALPHA=!1,this.GAMMAREFLECTION=!1,this.RGBDREFLECTION=!1}}}let vl=!1;function Go(){vl||(vl=!0,Ae.prototype.restoreSingleAttachment=function(){const r=this._gl;this.bindAttachments([r.BACK])},Ae.prototype.restoreSingleAttachmentForRenderTarget=function(){const r=this._gl;this.bindAttachments([r.COLOR_ATTACHMENT0])},Ae.prototype.buildTextureLayout=function(r,s=!1){const o=this._gl,l=[];if(s)l.push(o.BACK);else for(let n=0;n<r.length;n++)r[n]?l.push(o["COLOR_ATTACHMENT"+n]):l.push(o.NONE);return l},Ae.prototype.bindAttachments=function(r){this._gl.drawBuffers(r)},Ae.prototype.unBindMultiColorAttachmentFramebuffer=function(r,s=!1,o){this._currentRenderTarget=null,r.disableAutomaticMSAAResolve||this.resolveMultiFramebuffer(r),s||this.generateMipMapsMultiFramebuffer(r),o&&(r._MSAAFramebuffer&&this._bindUnboundFramebuffer(r._framebuffer),o()),this._bindUnboundFramebuffer(null)},Ae.prototype.createMultipleRenderTarget=function(r,s,o=!0){let l=!1,n=!0,m=!1,d=!1,I,k=1,U=1;const M=0,N=3,J=!1,se=5,_e=3553;let te=[],v=[],x=[],A=[],W=[],G=[],y=[],T=[],le=[],ie=!1;const V=this._createHardwareRenderTargetWrapper(!0,!1,r);s!==void 0&&(l=s.generateMipMaps===void 0?!1:s.generateMipMaps,n=s.generateDepthBuffer===void 0?!0:s.generateDepthBuffer,m=s.generateStencilBuffer===void 0?!1:s.generateStencilBuffer,d=s.generateDepthTexture===void 0?!1:s.generateDepthTexture,k=s.textureCount??1,U=s.samples??U,te=s.types||te,v=s.samplingModes||v,x=s.useSRGBBuffers||x,A=s.formats||A,W=s.targetTypes||W,G=s.faceIndex||G,y=s.layerIndex||y,T=s.layerCounts||T,le=s.labels||le,ie=s.dontCreateTextures??!1,this.webGLVersion>1&&(s.depthTextureFormat===13||s.depthTextureFormat===17||s.depthTextureFormat===16||s.depthTextureFormat===14||s.depthTextureFormat===18)&&(I=s.depthTextureFormat)),I===void 0&&(I=m?13:14);const g=this._gl,f=this._currentFramebuffer,fe=g.createFramebuffer();this._bindUnboundFramebuffer(fe);const oe=r.width??r,R=r.height??r,ue=[],E=[],Q=this.webGLVersion>1&&(I===13||I===17||I===18);V.label=s?.label??"MultiRenderTargetWrapper",V._framebuffer=fe,V._generateDepthBuffer=d||n,V._generateStencilBuffer=d?Q:m,V._depthStencilBuffer=this._setupFramebufferDepthAttachments(V._generateStencilBuffer,V._generateDepthBuffer,oe,R,1,I),V._attachments=E;for(let P=0;P<k;P++){let he=v[P]||N,q=te[P]||M,Te=x[P]||J;const ce=A[P]||se,j=W[P]||_e,ye=T[P]??1;(q===1&&!this._caps.textureFloatLinearFiltering||q===2&&!this._caps.textureHalfFloatLinearFiltering)&&(he=1);const Oe=this._getSamplingParameters(he,l);q===1&&!this._caps.textureFloat&&(q=0,De.Warn("Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type")),Te=Te&&this._caps.supportSRGBBuffers&&(this.webGLVersion>1||this.isWebGPU);const Ce=this.webGLVersion>1,Fe=g[Ce?"COLOR_ATTACHMENT"+P:"COLOR_ATTACHMENT"+P+"_WEBGL"];if(E.push(Fe),j===-1||ie)continue;const Z=new Ll(this,6);ue[P]=Z,g.activeTexture(g["TEXTURE"+P]),g.bindTexture(j,Z._hardwareTexture.underlyingResource),g.texParameteri(j,g.TEXTURE_MAG_FILTER,Oe.mag),g.texParameteri(j,g.TEXTURE_MIN_FILTER,Oe.min),g.texParameteri(j,g.TEXTURE_WRAP_S,g.CLAMP_TO_EDGE),g.texParameteri(j,g.TEXTURE_WRAP_T,g.CLAMP_TO_EDGE);const Ee=this._getRGBABufferInternalSizedFormat(q,ce,Te),Se=this._getInternalFormat(ce),Me=this._getWebGLTextureType(q);if(Ce&&(j===35866||j===32879))j===35866?Z.is2DArray=!0:Z.is3D=!0,Z.baseDepth=Z.depth=ye,g.texImage3D(j,0,Ee,oe,R,ye,0,Se,Me,null);else if(j===34067){for(let Ie=0;Ie<6;Ie++)g.texImage2D(g.TEXTURE_CUBE_MAP_POSITIVE_X+Ie,0,Ee,oe,R,0,Se,Me,null);Z.isCube=!0}else g.texImage2D(g.TEXTURE_2D,0,Ee,oe,R,0,Se,Me,null);l&&g.generateMipmap(j),this._bindTextureDirectly(j,null),Z.baseWidth=oe,Z.baseHeight=R,Z.width=oe,Z.height=R,Z.isReady=!0,Z.samples=1,Z.generateMipMaps=l,Z.samplingMode=he,Z.type=q,Z._useSRGBBuffer=Te,Z.format=ce,Z.label=le[P]??V.label+"-Texture"+P,this._internalTexturesCache.push(Z)}if(d&&this._caps.depthTextureExtension&&!ie){const P=new Ll(this,14);let he=5,q=g.DEPTH_COMPONENT16,Te=g.DEPTH_COMPONENT,ce=g.UNSIGNED_SHORT,j=g.DEPTH_ATTACHMENT;this.webGLVersion<2?q=g.DEPTH_COMPONENT:I===14?(he=1,ce=g.FLOAT,q=g.DEPTH_COMPONENT32F):I===18?(he=0,ce=g.FLOAT_32_UNSIGNED_INT_24_8_REV,q=g.DEPTH32F_STENCIL8,Te=g.DEPTH_STENCIL,j=g.DEPTH_STENCIL_ATTACHMENT):I===16?(he=0,ce=g.UNSIGNED_INT,q=g.DEPTH_COMPONENT24,j=g.DEPTH_ATTACHMENT):(I===13||I===17)&&(he=12,ce=g.UNSIGNED_INT_24_8,q=g.DEPTH24_STENCIL8,Te=g.DEPTH_STENCIL,j=g.DEPTH_STENCIL_ATTACHMENT),this._bindTextureDirectly(g.TEXTURE_2D,P,!0),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MAG_FILTER,g.NEAREST),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MIN_FILTER,g.NEAREST),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_S,g.CLAMP_TO_EDGE),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_T,g.CLAMP_TO_EDGE),g.texImage2D(g.TEXTURE_2D,0,q,oe,R,0,Te,ce,null),g.framebufferTexture2D(g.FRAMEBUFFER,j,g.TEXTURE_2D,P._hardwareTexture.underlyingResource,0),this._bindTextureDirectly(g.TEXTURE_2D,null),V._depthStencilTexture=P,V._depthStencilTextureWithStencil=Q,P.baseWidth=oe,P.baseHeight=R,P.width=oe,P.height=R,P.isReady=!0,P.samples=1,P.generateMipMaps=l,P.samplingMode=1,P.format=I,P.type=he,P.label=V.label+"-DepthStencil",ue[k]=P,this._internalTexturesCache.push(P)}if(V.setTextures(ue),o&&g.drawBuffers(E),this._bindUnboundFramebuffer(f),V.setLayerAndFaceIndices(y,G),this.resetTextureCache(),!ie)this.updateMultipleRenderTargetTextureSampleCount(V,U,o);else if(U>1){const P=g.createFramebuffer();if(!P)throw new Error("Unable to create multi sampled framebuffer");V._samples=U,V._MSAAFramebuffer=P,k>0&&o&&(this._bindUnboundFramebuffer(P),g.drawBuffers(E),this._bindUnboundFramebuffer(f))}return V},Ae.prototype.updateMultipleRenderTargetTextureSampleCount=function(r,s,o=!0){if(this.webGLVersion<2||!r)return 1;if(r.samples===s)return s;const l=this._gl;s=Math.min(s,this.getCaps().maxMSAASamples),r._depthStencilBuffer&&(l.deleteRenderbuffer(r._depthStencilBuffer),r._depthStencilBuffer=null),r._MSAAFramebuffer&&(l.deleteFramebuffer(r._MSAAFramebuffer),r._MSAAFramebuffer=null);const n=r._attachments.length;for(let d=0;d<n;d++)r.textures[d]._hardwareTexture?.releaseMSAARenderBuffers();if(s>1&&typeof l.renderbufferStorageMultisample=="function"){const d=l.createFramebuffer();if(!d)throw new Error("Unable to create multi sampled framebuffer");r._MSAAFramebuffer=d,this._bindUnboundFramebuffer(d);const I=[];for(let k=0;k<n;k++){const U=r.textures[k],M=U._hardwareTexture,N=l[this.webGLVersion>1?"COLOR_ATTACHMENT"+k:"COLOR_ATTACHMENT"+k+"_WEBGL"],J=this._createRenderBuffer(U.width,U.height,s,-1,this._getRGBABufferInternalSizedFormat(U.type,U.format,U._useSRGBBuffer),N);if(!J)throw new Error("Unable to create multi sampled framebuffer");M.addMSAARenderBuffer(J),U.samples=s,I.push(N)}o&&l.drawBuffers(I)}else this._bindUnboundFramebuffer(r._framebuffer);const m=r._depthStencilTexture?r._depthStencilTexture.format:void 0;return r._depthStencilBuffer=this._setupFramebufferDepthAttachments(r._generateStencilBuffer,r._generateDepthBuffer,r.width,r.height,s,m),this._bindUnboundFramebuffer(null),r._samples=s,s},Ae.prototype.generateMipMapsMultiFramebuffer=function(r){const s=r,o=this._gl;if(s.isMulti)for(let l=0;l<s._attachments.length;l++){const n=s.textures[l];n?.generateMipMaps&&!n?.isCube&&!n?.is3D&&(this._bindTextureDirectly(o.TEXTURE_2D,n,!0),o.generateMipmap(o.TEXTURE_2D),this._bindTextureDirectly(o.TEXTURE_2D,null))}},Ae.prototype.resolveMultiFramebuffer=function(r){const s=r,o=this._gl;if(!s._MSAAFramebuffer||!s.isMulti)return;let l=s.resolveMSAAColors?o.COLOR_BUFFER_BIT:0;l|=s._generateDepthBuffer&&s.resolveMSAADepth?o.DEPTH_BUFFER_BIT:0,l|=s._generateStencilBuffer&&s.resolveMSAAStencil?o.STENCIL_BUFFER_BIT:0;const n=s._attachments,m=n.length;o.bindFramebuffer(o.READ_FRAMEBUFFER,s._MSAAFramebuffer),o.bindFramebuffer(o.DRAW_FRAMEBUFFER,s._framebuffer);for(let d=0;d<m;d++){const I=s.textures[d];for(let k=0;k<m;k++)n[k]=o.NONE;n[d]=o[this.webGLVersion>1?"COLOR_ATTACHMENT"+d:"COLOR_ATTACHMENT"+d+"_WEBGL"],o.readBuffer(n[d]),o.drawBuffers(n),o.blitFramebuffer(0,0,I.width,I.height,0,0,I.width,I.height,l,o.NEAREST)}for(let d=0;d<m;d++)n[d]=o[this.webGLVersion>1?"COLOR_ATTACHMENT"+d:"COLOR_ATTACHMENT"+d+"_WEBGL"];o.drawBuffers(n),o.bindFramebuffer(this._gl.FRAMEBUFFER,s._MSAAFramebuffer)})}class Ho extends Zl{get isSupported(){return this._engine?.getCaps().drawBuffersExtension??!1}get textures(){return this._textures}get count(){return this._count}get depthTexture(){return this._textures[this._textures.length-1]}set wrapU(s){if(this._textures)for(let o=0;o<this._textures.length;o++)this._textures[o].wrapU=s}set wrapV(s){if(this._textures)for(let o=0;o<this._textures.length;o++)this._textures[o].wrapV=s}constructor(s,o,l,n,m,d){const I=m&&m.generateMipMaps?m.generateMipMaps:!1,k=m&&m.generateDepthTexture?m.generateDepthTexture:!1,U=m&&m.depthTextureFormat?m.depthTextureFormat:15,M=!m||m.doNotChangeAspectRatio===void 0?!0:m.doNotChangeAspectRatio,N=m&&m.drawOnlyOnFirstAttachmentByDefault?m.drawOnlyOnFirstAttachmentByDefault:!1;if(super(s,o,n,I,M,void 0,void 0,void 0,void 0,void 0,void 0,void 0,!0),Go(),!this.isSupported){this.dispose();return}this._textureNames=d;const J=[],se=[],_e=[],te=[],v=[],x=[],A=[],W=[];this._initTypes(l,J,se,_e,te,v,x,A,W,m);const G=!m||m.generateDepthBuffer===void 0?!0:m.generateDepthBuffer,y=!m||m.generateStencilBuffer===void 0?!1:m.generateStencilBuffer,T=m&&m.samples?m.samples:1;this._multiRenderTargetOptions={samplingModes:se,generateMipMaps:I,generateDepthBuffer:G,generateStencilBuffer:y,generateDepthTexture:k,depthTextureFormat:U,types:J,textureCount:l,useSRGBBuffers:_e,samples:T,formats:te,targetTypes:v,faceIndex:x,layerIndex:A,layerCounts:W,labels:d,label:s},this._count=l,this._drawOnlyOnFirstAttachmentByDefault=N,l>0&&(this._createInternalTextures(),this._createTextures(d))}_initTypes(s,o,l,n,m,d,I,k,U,M){for(let N=0;N<s;N++)M&&M.types&&M.types[N]!==void 0?o.push(M.types[N]):o.push(M&&M.defaultType?M.defaultType:0),M&&M.samplingModes&&M.samplingModes[N]!==void 0?l.push(M.samplingModes[N]):l.push(Pe.BILINEAR_SAMPLINGMODE),M&&M.useSRGBBuffers&&M.useSRGBBuffers[N]!==void 0?n.push(M.useSRGBBuffers[N]):n.push(!1),M&&M.formats&&M.formats[N]!==void 0?m.push(M.formats[N]):m.push(5),M&&M.targetTypes&&M.targetTypes[N]!==void 0?d.push(M.targetTypes[N]):d.push(3553),M&&M.faceIndex&&M.faceIndex[N]!==void 0?I.push(M.faceIndex[N]):I.push(0),M&&M.layerIndex&&M.layerIndex[N]!==void 0?k.push(M.layerIndex[N]):k.push(0),M&&M.layerCounts&&M.layerCounts[N]!==void 0?U.push(M.layerCounts[N]):U.push(1)}_createInternaTextureIndexMapping(){const s={},o=[];if(!this._renderTarget)return o;const l=this._renderTarget.textures;for(let n=0;n<l.length;n++){const m=l[n];if(!m)continue;const d=s[m.uniqueId];d!==void 0?o[n]=d:s[m.uniqueId]=n}return o}_rebuild(s=!1,o=!1,l){if(this._count<1||s)return;const n=this._createInternaTextureIndexMapping();this.releaseInternalTextures(),this._createInternalTextures(),o&&(this._releaseTextures(),this._createTextures(l));const m=this._renderTarget.textures;for(let d=0;d<m.length;d++){const I=this._textures[d];n[d]!==void 0&&this._renderTarget.setTexture(m[n[d]],d),I._texture=m[d],I._texture&&(I._noMipmap=!I._texture.useMipMaps,I._useSRGBBuffer=I._texture._useSRGBBuffer)}this.samples!==1&&this._renderTarget.setSamples(this.samples,!this._drawOnlyOnFirstAttachmentByDefault,!0)}_createInternalTextures(){this._renderTarget=this._getEngine().createMultipleRenderTarget(this._size,this._multiRenderTargetOptions,!this._drawOnlyOnFirstAttachmentByDefault),this._texture=this._renderTarget.texture}_releaseTextures(){if(this._textures)for(let s=0;s<this._textures.length;s++)this._textures[s]._texture=null,this._textures[s].dispose()}_createTextures(s){const o=this._renderTarget.textures;this._textures=[];for(let l=0;l<o.length;l++){const n=new Pe(null,this.getScene());s?.[l]&&(n.name=s[l]),n._texture=o[l],n._texture&&(n._noMipmap=!n._texture.useMipMaps,n._useSRGBBuffer=n._texture._useSRGBBuffer),this._textures.push(n)}}setInternalTexture(s,o,l=!0){if(this.renderTarget&&(o===0&&(this._texture=s),this.renderTarget.setTexture(s,o,l),this.textures[o]||(this.textures[o]=new Pe(null,this.getScene()),this.textures[o].name=this._textureNames?.[o]??this.textures[o].name),this.textures[o]._texture=s,this.textures[o]._noMipmap=!s.useMipMaps,this.textures[o]._useSRGBBuffer=s._useSRGBBuffer,this._count=this.renderTarget.textures?this.renderTarget.textures.length:0,this._multiRenderTargetOptions.types&&(this._multiRenderTargetOptions.types[o]=s.type),this._multiRenderTargetOptions.samplingModes&&(this._multiRenderTargetOptions.samplingModes[o]=s.samplingMode),this._multiRenderTargetOptions.useSRGBBuffers&&(this._multiRenderTargetOptions.useSRGBBuffers[o]=s._useSRGBBuffer),this._multiRenderTargetOptions.targetTypes&&this._multiRenderTargetOptions.targetTypes[o]!==-1)){let n;s.is2DArray?n=35866:s.isCube?n=34067:s.is3D?n=32879:n=3553,this._multiRenderTargetOptions.targetTypes[o]=n}}setLayerAndFaceIndex(s,o=-1,l=-1){!this.textures[s]||!this.renderTarget||(this._multiRenderTargetOptions.layerIndex&&(this._multiRenderTargetOptions.layerIndex[s]=o),this._multiRenderTargetOptions.faceIndex&&(this._multiRenderTargetOptions.faceIndex[s]=l),this.renderTarget.setLayerAndFaceIndex(s,o,l))}setLayerAndFaceIndices(s,o){this.renderTarget&&(this._multiRenderTargetOptions.layerIndex=s,this._multiRenderTargetOptions.faceIndex=o,this.renderTarget.setLayerAndFaceIndices(s,o))}get samples(){return this._samples}set samples(s){this._renderTarget?this._samples=this._renderTarget.setSamples(s):this._samples=s}resize(s){this._processSizeParameter(s),this._rebuild(!1,void 0,this._textureNames)}updateCount(s,o,l){this._multiRenderTargetOptions.textureCount=s,this._count=s;const n=[],m=[],d=[],I=[],k=[],U=[],M=[],N=[];this._textureNames=l,this._initTypes(s,n,m,d,I,k,U,M,N,o),this._multiRenderTargetOptions.types=n,this._multiRenderTargetOptions.samplingModes=m,this._multiRenderTargetOptions.useSRGBBuffers=d,this._multiRenderTargetOptions.formats=I,this._multiRenderTargetOptions.targetTypes=k,this._multiRenderTargetOptions.faceIndex=U,this._multiRenderTargetOptions.layerIndex=M,this._multiRenderTargetOptions.layerCounts=N,this._multiRenderTargetOptions.labels=l,this._rebuild(!1,!0,l)}_unbindFrameBuffer(s,o){this._renderTarget&&s.unBindMultiColorAttachmentFramebuffer(this._renderTarget,this.isCube,()=>{this.onAfterRenderObservable.notifyObservers(o)})}dispose(s=!1){this._releaseTextures(),s?this._texture=null:this.releaseInternalTextures(),super.dispose()}releaseInternalTextures(){const s=this._renderTarget?.textures;if(s){for(let o=s.length-1;o>=0;o--)this._textures[o]._texture=null;this._renderTarget?.dispose(),this._renderTarget=null}}}class Vo{constructor(s){this.name=wt.NAME_GEOMETRYBUFFERRENDERER,this.scene=s}register(){this.scene._gatherRenderTargetsStage.registerStep(wt.STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER,this,this._gatherRenderTargets)}rebuild(){}dispose(){}_gatherRenderTargets(s){this.scene._geometryBufferRenderer&&s.push(this.scene._geometryBufferRenderer.getGBuffer())}}let kl=!1;function Xo(r){kl||(kl=!0,Object.defineProperty(zt.prototype,"geometryBufferRenderer",{get:function(){return this._geometryBufferRenderer},set:function(s){s&&s.isSupported&&(this._geometryBufferRenderer=s)},enumerable:!0,configurable:!0}),zt.prototype.enableGeometryBufferRenderer=function(s=1,o=15,l){return this._geometryBufferRenderer?this._geometryBufferRenderer:(this._geometryBufferRenderer=new r(this,s,o,l),this._geometryBufferRenderer.isSupported||(this._geometryBufferRenderer=null),this._geometryBufferRenderer)},zt.prototype.disableGeometryBufferRenderer=function(){this._geometryBufferRenderer&&(this._geometryBufferRenderer.dispose(),this._geometryBufferRenderer=null)},r._SceneComponentInitialization=s=>{let o=s._getComponent(wt.NAME_GEOMETRYBUFFERRENDERER);o||(o=new Vo(s),s._addComponent(o))})}const Yo=["diffuseSampler","bumpSampler","reflectivitySampler","albedoSampler","morphTargets","boneSampler","transmissionWeightSampler","subsurfaceWeightSampler","iblShadowSampler"],Zo=["world","mBones","viewProjection","diffuseMatrix","view","previousWorld","previousViewProjection","mPreviousBones","bumpMatrix","reflectivityMatrix","albedoMatrix","reflectivityColor","albedoColor","reflectionMatrix","vTransmissionWeight","vSubsurfaceWeight","vEyePosition","vTransmissionScatterAnisotropy","vSubsurfaceScatterAnisotropy","shadowTextureSize","metallic","glossiness","vTangentSpaceParams","vBumpInfos","morphTargetInfluences","morphTargetCount","morphTargetTextureInfo","morphTargetTextureIndices","boneTextureInfo"];class D{get normalsAreUnsigned(){return this._normalsAreUnsigned}_linkPrePassRenderer(s){this._linkedWithPrePass=!0,this._prePassRenderer=s,this._multiRenderTarget&&(this._multiRenderTarget.onClearObservable.clear(),this._multiRenderTarget.onClearObservable.add(()=>{}))}_unlinkPrePassRenderer(){this._linkedWithPrePass=!1,this._createRenderTargets()}_resetLayout(){this._enableDepth=!0,this._enableNormal=!0,this._enablePosition=!1,this._enableReflectivity=!1,this._enableVelocity=!1,this._enableVelocityLinear=!1,this._enableScreenspaceDepth=!1,this._enableIrradiance=!1,this._attachmentsFromPrePass=[]}_forceTextureType(s,o){s===D.POSITION_TEXTURE_TYPE?(this._positionIndex=o,this._enablePosition=!0):s===D.VELOCITY_TEXTURE_TYPE?(this._velocityIndex=o,this._enableVelocity=!0):s===D.VELOCITY_LINEAR_TEXTURE_TYPE?(this._velocityLinearIndex=o,this._enableVelocityLinear=!0):s===D.REFLECTIVITY_TEXTURE_TYPE?(this._reflectivityIndex=o,this._enableReflectivity=!0):s===D.DEPTH_TEXTURE_TYPE?(this._depthIndex=o,this._enableDepth=!0):s===D.NORMAL_TEXTURE_TYPE?(this._normalIndex=o,this._enableNormal=!0):s===D.SCREENSPACE_DEPTH_TEXTURE_TYPE?(this._screenspaceDepthIndex=o,this._enableScreenspaceDepth=!0):s===D.IRRADIANCE_TEXTURE_TYPE&&(this._irradianceIndex=o,this._enableIrradiance=!0)}_setAttachments(s){this._attachmentsFromPrePass=s}_linkInternalTexture(s){this._multiRenderTarget.setInternalTexture(s,0,!1)}get renderList(){return this._multiRenderTarget.renderList}set renderList(s){this._multiRenderTarget.renderList=s}get isSupported(){return this._multiRenderTarget.isSupported}getTextureIndex(s){switch(s){case D.POSITION_TEXTURE_TYPE:return this._positionIndex;case D.VELOCITY_TEXTURE_TYPE:return this._velocityIndex;case D.VELOCITY_LINEAR_TEXTURE_TYPE:return this._velocityLinearIndex;case D.REFLECTIVITY_TEXTURE_TYPE:return this._reflectivityIndex;case D.DEPTH_TEXTURE_TYPE:return this._depthIndex;case D.NORMAL_TEXTURE_TYPE:return this._normalIndex;case D.SCREENSPACE_DEPTH_TEXTURE_TYPE:return this._screenspaceDepthIndex;case D.IRRADIANCE_TEXTURE_TYPE:return this._irradianceIndex;default:return-1}}get enableDepth(){return this._enableDepth}set enableDepth(s){this._enableDepth=s,this._linkedWithPrePass||(this.dispose(),this._createRenderTargets())}get enableNormal(){return this._enableNormal}set enableNormal(s){this._enableNormal=s,this._linkedWithPrePass||(this.dispose(),this._createRenderTargets())}get enablePosition(){return this._enablePosition}set enablePosition(s){this._enablePosition=s,this._linkedWithPrePass||(this.dispose(),this._createRenderTargets())}get enableVelocity(){return this._enableVelocity}set enableVelocity(s){this._enableVelocity=s,s||(this._previousTransformationMatrices={}),this._linkedWithPrePass||(this.dispose(),this._createRenderTargets()),this._scene.needsPreviousWorldMatrices=s}get enableVelocityLinear(){return this._enableVelocityLinear}set enableVelocityLinear(s){this._enableVelocityLinear=s,this._linkedWithPrePass||(this.dispose(),this._createRenderTargets())}get enableReflectivity(){return this._enableReflectivity}set enableReflectivity(s){this._enableReflectivity=s,this._linkedWithPrePass||(this.dispose(),this._createRenderTargets())}get enableScreenspaceDepth(){return this._enableScreenspaceDepth}set enableScreenspaceDepth(s){this._enableScreenspaceDepth=s,this._linkedWithPrePass||(this.dispose(),this._createRenderTargets())}get enableIrradiance(){return this._enableIrradiance}set enableIrradiance(s){this._enableIrradiance=s,this._linkedWithPrePass||(this.dispose(),this._createRenderTargets())}get scene(){return this._scene}get ratio(){return typeof this._ratioOrDimensions=="object"?1:this._ratioOrDimensions}get shaderLanguage(){return this._shaderLanguage}constructor(s,o=1,l=15,n){this._previousTransformationMatrices={},this._previousBonesTransformationMatrices={},this.excludedSkinnedMeshesFromVelocity=[],this.renderTransparentMeshes=!0,this.generateNormalsInWorldSpace=!1,this._normalsAreUnsigned=!1,this._resizeObserver=null,this._enableDepth=!0,this._enableNormal=!0,this._enablePosition=!1,this._enableVelocity=!1,this._enableVelocityLinear=!1,this._enableReflectivity=!1,this._enableScreenspaceDepth=!1,this._enableIrradiance=!1,this._clearColor=new Gt(0,0,0,0),this._clearDepthColor=new Gt(0,0,0,1),this._positionIndex=-1,this._velocityIndex=-1,this._velocityLinearIndex=-1,this._reflectivityIndex=-1,this._depthIndex=-1,this._normalIndex=-1,this._screenspaceDepthIndex=-1,this._irradianceIndex=-1,this._linkedWithPrePass=!1,this.generateIrradianceWithScatterMask=!1,this.useSpecificClearForDepthTexture=!1,this._shaderLanguage=0,this._shadersLoaded=!1,this._scene=s,this._ratioOrDimensions=o,this._useUbo=s.getEngine().supportsUniformBuffers,this._depthFormat=l,this._textureTypesAndFormats=n||{},this._initShaderSourceAsync(),Xo(D),D._SceneComponentInitialization(this._scene),this._createRenderTargets()}async _initShaderSourceAsync(){this._scene.getEngine().isWebGPU&&!D.ForceGLSL?(this._shaderLanguage=1,await Promise.all([be(()=>import("./geometry.vertex-BXGMTA_J.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url),be(()=>import("./geometry.fragment-Dph3muZt.js"),__vite__mapDeps([8,1,2,9,10,11,12,13,4,14,15]),import.meta.url)])):await Promise.all([be(()=>import("./geometry.vertex-Bm9Wg3Gi.js"),__vite__mapDeps([16,1,2]),import.meta.url),be(()=>import("./geometry.fragment-CsJIm2H0.js"),__vite__mapDeps([17,1,2,18]),import.meta.url)]),this._shadersLoaded=!0}isReady(s,o){if(!this._shadersLoaded)return!1;const l=s.getMaterial();if(l&&l.disableDepthWrite||s.getMesh().getClassName()==="GaussianSplattingMesh")return!1;const n=[],m=[$.PositionKind],d=s.getMesh();d.isVerticesDataPresent($.NormalKind)&&(n.push("#define HAS_NORMAL_ATTRIBUTE"),m.push($.NormalKind));let k=!1,U=!1;const M=!1;if(l){let v=!1;if(l.needAlphaTestingForMesh(d)&&l.getAlphaTestTexture()&&(n.push("#define ALPHATEST"),n.push(`#define ALPHATEST_UV${l.getAlphaTestTexture().coordinatesIndex+1}`),v=!0),(l.bumpTexture||l.normalTexture||l.geometryNormalTexture)&&ae.BumpTextureEnabled){const x=l.bumpTexture||l.normalTexture||l.geometryNormalTexture;n.push("#define BUMP"),n.push(`#define BUMP_UV${x.coordinatesIndex+1}`),v=!0}if(this._enableReflectivity){let x=!1;if(l.getClassName()==="PBRMetallicRoughnessMaterial")l.metallicRoughnessTexture&&(n.push("#define ORMTEXTURE"),n.push(`#define REFLECTIVITY_UV${l.metallicRoughnessTexture.coordinatesIndex+1}`),n.push("#define METALLICWORKFLOW"),v=!0,x=!0),l.metallic!=null&&(n.push("#define METALLIC"),n.push("#define METALLICWORKFLOW"),x=!0),l.roughness!=null&&(n.push("#define ROUGHNESS"),n.push("#define METALLICWORKFLOW"),x=!0),x&&(l.baseTexture&&(n.push("#define ALBEDOTEXTURE"),n.push(`#define ALBEDO_UV${l.baseTexture.coordinatesIndex+1}`),l.baseTexture.gammaSpace&&n.push("#define GAMMAALBEDO"),v=!0),l.baseColor&&n.push("#define ALBEDOCOLOR"));else if(l.getClassName()==="PBRSpecularGlossinessMaterial")l.specularGlossinessTexture?(n.push("#define SPECULARGLOSSINESSTEXTURE"),n.push(`#define REFLECTIVITY_UV${l.specularGlossinessTexture.coordinatesIndex+1}`),v=!0,l.specularGlossinessTexture.gammaSpace&&n.push("#define GAMMAREFLECTIVITYTEXTURE")):l.specularColor&&n.push("#define REFLECTIVITYCOLOR"),l.glossiness!=null&&n.push("#define GLOSSINESS");else if(l.getClassName()==="PBRMaterial")l.metallicTexture&&(n.push("#define ORMTEXTURE"),n.push(`#define REFLECTIVITY_UV${l.metallicTexture.coordinatesIndex+1}`),n.push("#define METALLICWORKFLOW"),v=!0,x=!0),l.metallic!=null&&(n.push("#define METALLIC"),n.push("#define METALLICWORKFLOW"),x=!0),l.roughness!=null&&(n.push("#define ROUGHNESS"),n.push("#define METALLICWORKFLOW"),x=!0),x?(l.albedoTexture&&(n.push("#define ALBEDOTEXTURE"),n.push(`#define ALBEDO_UV${l.albedoTexture.coordinatesIndex+1}`),l.albedoTexture.gammaSpace&&n.push("#define GAMMAALBEDO"),v=!0),l.albedoColor&&n.push("#define ALBEDOCOLOR")):(l.reflectivityTexture?(n.push("#define SPECULARGLOSSINESSTEXTURE"),n.push(`#define REFLECTIVITY_UV${l.reflectivityTexture.coordinatesIndex+1}`),l.reflectivityTexture.gammaSpace&&n.push("#define GAMMAREFLECTIVITYTEXTURE"),v=!0):l.reflectivityColor&&n.push("#define REFLECTIVITYCOLOR"),l.microSurface!=null&&n.push("#define GLOSSINESS"));else if(l.getClassName()==="StandardMaterial")l.specularTexture&&(n.push("#define REFLECTIVITYTEXTURE"),n.push(`#define REFLECTIVITY_UV${l.specularTexture.coordinatesIndex+1}`),l.specularTexture.gammaSpace&&n.push("#define GAMMAREFLECTIVITYTEXTURE"),v=!0),l.specularColor&&n.push("#define REFLECTIVITYCOLOR");else if(l.getClassName()==="OpenPBRMaterial"){const A=l;n.push("#define METALLIC"),n.push("#define ROUGHNESS"),A._useRoughnessFromMetallicTextureGreen&&A.baseMetalnessTexture?(n.push("#define ORMTEXTURE"),n.push(`#define REFLECTIVITY_UV${A.baseMetalnessTexture.coordinatesIndex+1}`),v=!0):A.baseMetalnessTexture?(n.push("#define METALLIC_TEXTURE"),n.push(`#define METALLIC_UV${A.baseMetalnessTexture.coordinatesIndex+1}`),v=!0):A.specularRoughnessTexture&&(n.push("#define ROUGHNESS_TEXTURE"),n.push(`#define ROUGHNESS_UV${A.specularRoughnessTexture.coordinatesIndex+1}`),v=!0),A.baseColorTexture&&(n.push("#define ALBEDOTEXTURE"),n.push(`#define ALBEDO_UV${A.baseColorTexture.coordinatesIndex+1}`),A.baseColorTexture.gammaSpace&&n.push("#define GAMMAALBEDO"),v=!0),A.baseColor&&n.push("#define ALBEDOCOLOR")}}if(this._enableIrradiance&&this.generateIrradianceWithScatterMask&&(n.push("#define IRRADIANCE_SCATTER_MASK"),l.getClassName()==="OpenPBRMaterial")){const x=l;x.subsurfaceWeight>0&&x.subsurfaceWeightTexture&&(n.push("#define SUBSURFACE_WEIGHT"),n.push(`#define SUBSURFACEWEIGHT_UV${x.subsurfaceWeightTexture.coordinatesIndex+1}`),v=!0),x.transmissionWeight>0&&x.transmissionWeightTexture&&(n.push("#define TRANSMISSION_WEIGHT"),n.push(`#define TRANSMISSIONWEIGHT_UV${x.transmissionWeightTexture.coordinatesIndex+1}`),v=!0)}v&&(n.push("#define NEED_UV"),d.isVerticesDataPresent($.UVKind)&&(m.push($.UVKind),n.push("#define UV1"),k=!0),d.isVerticesDataPresent($.UV2Kind)&&(m.push($.UV2Kind),n.push("#define UV2"),U=!0))}if(this._enableDepth&&(n.push("#define DEPTH"),n.push("#define DEPTH_INDEX "+this._depthIndex)),this._enableNormal&&(n.push("#define NORMAL"),n.push("#define NORMAL_INDEX "+this._normalIndex)),this._enablePosition&&(n.push("#define POSITION"),n.push("#define POSITION_INDEX "+this._positionIndex)),this._enableVelocity&&(n.push("#define VELOCITY"),n.push("#define VELOCITY_INDEX "+this._velocityIndex),this.excludedSkinnedMeshesFromVelocity.indexOf(d)===-1&&n.push("#define BONES_VELOCITY_ENABLED")),this._enableVelocityLinear&&(n.push("#define VELOCITY_LINEAR"),n.push("#define VELOCITY_LINEAR_INDEX "+this._velocityLinearIndex),this.excludedSkinnedMeshesFromVelocity.indexOf(d)===-1&&n.push("#define BONES_VELOCITY_ENABLED")),this._enableReflectivity&&(n.push("#define REFLECTIVITY"),n.push("#define REFLECTIVITY_INDEX "+this._reflectivityIndex)),this._enableScreenspaceDepth&&this._screenspaceDepthIndex!==-1&&(n.push("#define SCREENSPACE_DEPTH_INDEX "+this._screenspaceDepthIndex),n.push("#define SCREENSPACE_DEPTH")),this._enableIrradiance&&this._irradianceIndex!==-1){n.push("#define IRRADIANCE_INDEX "+this._irradianceIndex),n.push("#define IRRADIANCE");const v=this._scene;if(v.environmentTexture){const x={};let A=!1,W=0;(l.getClassName()==="OpenPBRMaterial"||l.getClassName()==="StandardMaterial"||l.getClassName()==="PBRMetallicRoughnessMaterial"||l.getClassName()==="PBRSpecularGlossinessMaterial"||l.getClassName()==="PBRMaterial")&&(A=!!l.realtimeFiltering,W=l.realtimeFilteringQuality||0),Ul(v,v.environmentTexture,x,A,W,!0);for(const y in x)x[y]&&n.push("#define "+y);x.USEIRRADIANCEMAP||n.push("#define SPHERICAL_HARMONICS");const G=v.postProcessRenderPipelineManager.supportedPipelines.find(y=>y.getClassName()==="IBLShadowsRenderPipeline");if(G){const y=G;y._getAccumulatedTexture()&&(n.push("#define IBL_SHADOW_TEXTURE"),y.coloredShadows&&n.push("#define COLORED_IBL_SHADOWS"))}}}this.generateNormalsInWorldSpace&&n.push("#define NORMAL_WORLDSPACE"),this._normalsAreUnsigned&&n.push("#define ENCODE_NORMAL"),d.useBones&&d.computeBonesUsingShaders&&d.skeleton?(m.push($.MatricesIndicesKind),m.push($.MatricesWeightsKind),d.numBoneInfluencers>4&&(m.push($.MatricesIndicesExtraKind),m.push($.MatricesWeightsExtraKind)),n.push("#define NUM_BONE_INFLUENCERS "+d.numBoneInfluencers),n.push("#define BONETEXTURE "+d.skeleton.isUsingTextureForMatrices),n.push("#define BonesPerMesh "+(d.skeleton.bones.length+1))):(n.push("#define NUM_BONE_INFLUENCERS 0"),n.push("#define BONETEXTURE false"),n.push("#define BonesPerMesh 0"));const N=d.morphTargetManager?Kl(d.morphTargetManager,n,m,d,!0,!0,!1,k,U,M):0;o&&(n.push("#define INSTANCES"),jl(m,this._enableVelocity||this._enableVelocityLinear),s.getRenderingMesh().hasThinInstances&&n.push("#define THIN_INSTANCES")),this._linkedWithPrePass?n.push("#define SCENE_MRT_COUNT "+this._attachmentsFromPrePass.length):n.push("#define SCENE_MRT_COUNT "+this._multiRenderTarget.textures.length),Ql(l,this._scene,n);const J=this._scene.getEngine(),se=s._getDrawWrapper(void 0,!0),_e=se.defines,te=n.join(`
3
+ `);return _e!==te&&se.setEffect(J.createEffect("geometry",{attributes:m,uniformsNames:Zo,samplers:Yo,defines:te,onCompiled:null,fallbacks:null,onError:null,uniformBuffersNames:["Scene"],indexParameters:{buffersCount:this._multiRenderTarget.textures.length-1,maxSimultaneousMorphTargets:N},shaderLanguage:this.shaderLanguage},J),te),se.effect.isReady()}getGBuffer(){return this._multiRenderTarget}get samples(){return this._multiRenderTarget.samples}set samples(s){this._multiRenderTarget.samples=s}dispose(){this._resizeObserver&&(this._scene.getEngine().onResizeObservable.remove(this._resizeObserver),this._resizeObserver=null),this._multiRenderTarget?.renderTarget&&this.scene.getEngine()._currentRenderTarget===this._multiRenderTarget.renderTarget&&this.scene.getEngine().unBindFramebuffer(this._multiRenderTarget?.renderTarget),this.getGBuffer().dispose()}_assignRenderTargetIndices(){const s=[],o=[];let l=0;return this._enableDepth&&(this._depthIndex=l,l++,s.push("gBuffer_Depth"),o.push(this._textureTypesAndFormats[D.DEPTH_TEXTURE_TYPE])),this._enableNormal&&(this._normalIndex=l,l++,s.push("gBuffer_Normal"),o.push(this._textureTypesAndFormats[D.NORMAL_TEXTURE_TYPE])),this._enablePosition&&(this._positionIndex=l,l++,s.push("gBuffer_Position"),o.push(this._textureTypesAndFormats[D.POSITION_TEXTURE_TYPE])),this._enableVelocity&&(this._velocityIndex=l,l++,s.push("gBuffer_Velocity"),o.push(this._textureTypesAndFormats[D.VELOCITY_TEXTURE_TYPE])),this._enableVelocityLinear&&(this._velocityLinearIndex=l,l++,s.push("gBuffer_VelocityLinear"),o.push(this._textureTypesAndFormats[D.VELOCITY_LINEAR_TEXTURE_TYPE])),this._enableReflectivity&&(this._reflectivityIndex=l,l++,s.push("gBuffer_Reflectivity"),o.push(this._textureTypesAndFormats[D.REFLECTIVITY_TEXTURE_TYPE])),this._enableScreenspaceDepth&&(this._screenspaceDepthIndex=l,l++,s.push("gBuffer_ScreenspaceDepth"),o.push(this._textureTypesAndFormats[D.SCREENSPACE_DEPTH_TEXTURE_TYPE])),this._enableIrradiance&&(this._irradianceIndex=l,l++,s.push("gBuffer_Irradiance"),o.push(this._textureTypesAndFormats[D.IRRADIANCE_TEXTURE_TYPE])),[l,s,o]}_createRenderTargets(){const s=this._scene.getEngine(),[o,l,n]=this._assignRenderTargetIndices();let m=0;s._caps.textureFloat&&s._caps.textureFloatLinearFiltering?m=1:s._caps.textureHalfFloat&&s._caps.textureHalfFloatLinearFiltering&&(m=2);const d=this._ratioOrDimensions.width!==void 0?this._ratioOrDimensions:{width:s.getRenderWidth()*this._ratioOrDimensions,height:s.getRenderHeight()*this._ratioOrDimensions},I=[],k=[],U=[];for(const x of n)x?(I.push(x.textureType),k.push(x.textureFormat),U.push(x.samplingMode??2)):(I.push(m),k.push(5),U.push(2));if(this._normalsAreUnsigned=I[D.NORMAL_TEXTURE_TYPE]===11||I[D.NORMAL_TEXTURE_TYPE]===13,this._multiRenderTarget=new Ho("gBuffer",d,o,this._scene,{generateMipMaps:!1,generateDepthTexture:!0,types:I,formats:k,samplingModes:U,depthTextureFormat:this._depthFormat},l.concat("gBuffer_DepthBuffer")),!this.isSupported)return;this._multiRenderTarget.wrapU=Pe.CLAMP_ADDRESSMODE,this._multiRenderTarget.wrapV=Pe.CLAMP_ADDRESSMODE,this._multiRenderTarget.refreshRate=1,this._multiRenderTarget.renderParticles=!1,this._multiRenderTarget.renderList=null;const M=[!0],N=[!1],J=[!0];for(let x=1;x<o;++x)M.push(!0),J.push(!1),N.push(!0);const se=s.buildTextureLayout(M),_e=s.buildTextureLayout(N),te=s.buildTextureLayout(J);this._multiRenderTarget.onClearObservable.add(x=>{x.bindAttachments(this.useSpecificClearForDepthTexture?_e:se),x.clear(this._clearColor,!0,!0,!0),this.useSpecificClearForDepthTexture&&(x.bindAttachments(te),x.clear(this._clearDepthColor,!0,!0,!0)),x.bindAttachments(se)}),this._resizeObserver=s.onResizeObservable.add(()=>{if(this._multiRenderTarget){const x=this._ratioOrDimensions.width!==void 0?this._ratioOrDimensions:{width:s.getRenderWidth()*this._ratioOrDimensions,height:s.getRenderHeight()*this._ratioOrDimensions};this._multiRenderTarget.resize(x)}});const v=x=>{const A=x.getRenderingMesh(),W=x.getEffectiveMesh(),G=this._scene,y=G.getEngine(),T=x.getMaterial();if(!T)return;if(W._internalAbstractMeshDataInfo._isActiveIntermediate=!1,(this._enableVelocity||this._enableVelocityLinear)&&!this._previousTransformationMatrices[W.uniqueId]&&(this._previousTransformationMatrices[W.uniqueId]={world:ql.Identity(),viewProjection:G.getTransformMatrix()},A.skeleton)){const g=A.skeleton.getTransformMatrices(A);this._previousBonesTransformationMatrices[A.uniqueId]=this._copyBonesTransformationMatrices(g,new Float32Array(g.length))}const le=A._getInstancesRenderList(x._id,!!x.getReplacementMesh());if(le.mustReturn)return;const ie=y.getCaps().instancedArrays&&(le.visibleInstances[x._id]!==null||A.hasThinInstances),V=W.getWorldMatrix();if(this.isReady(x,ie)){const g=x._getDrawWrapper();if(!g)return;const f=g.effect;y.enableEffect(g),ie||A._bind(x,f,T.fillMode),this._useUbo?($l(f,this._scene.getSceneUniformBuffer()),this._scene.finalizeSceneUbo()):(f.setMatrix("viewProjection",G.getTransformMatrix()),f.setMatrix("view",G.getViewMatrix()),this._scene.bindEyePosition(f,"vEyePosition"));let fe;if(!A._instanceDataStorage.isFrozen&&(T.backFaceCulling||T.sideOrientation!==null)){const R=W._getWorldMatrixDeterminant();fe=T._getEffectiveOrientation(A),R<0&&(fe=fe===ne.ClockWiseSideOrientation?ne.CounterClockWiseSideOrientation:ne.ClockWiseSideOrientation)}else fe=A._effectiveSideOrientation;if(T._preBind(g,fe),T.needAlphaTestingForMesh(W)){const R=T.getAlphaTestTexture();R&&(f.setTexture("diffuseSampler",R),f.setMatrix("diffuseMatrix",R.getTextureMatrix()))}if((T.bumpTexture||T.normalTexture||T.geometryNormalTexture)&&G.getEngine().getCaps().standardDerivatives&&ae.BumpTextureEnabled){const R=T.bumpTexture||T.normalTexture||T.geometryNormalTexture;f.setFloat3("vBumpInfos",R.coordinatesIndex,1/R.level,T.parallaxScaleBias),f.setMatrix("bumpMatrix",R.getTextureMatrix()),f.setTexture("bumpSampler",R),f.setFloat2("vTangentSpaceParams",T.invertNormalMapX?-1:1,T.invertNormalMapY?-1:1)}if(this._enableReflectivity){if(T.getClassName()==="PBRMetallicRoughnessMaterial")T.metallicRoughnessTexture!==null&&(f.setTexture("reflectivitySampler",T.metallicRoughnessTexture),f.setMatrix("reflectivityMatrix",T.metallicRoughnessTexture.getTextureMatrix())),T.metallic!==null&&f.setFloat("metallic",T.metallic),T.roughness!==null&&f.setFloat("glossiness",1-T.roughness),T.baseTexture!==null&&(f.setTexture("albedoSampler",T.baseTexture),f.setMatrix("albedoMatrix",T.baseTexture.getTextureMatrix())),T.baseColor!==null&&f.setColor3("albedoColor",T.baseColor);else if(T.getClassName()==="PBRSpecularGlossinessMaterial")T.specularGlossinessTexture!==null?(f.setTexture("reflectivitySampler",T.specularGlossinessTexture),f.setMatrix("reflectivityMatrix",T.specularGlossinessTexture.getTextureMatrix())):T.specularColor!==null&&f.setColor3("reflectivityColor",T.specularColor),T.glossiness!==null&&f.setFloat("glossiness",T.glossiness);else if(T.getClassName()==="PBRMaterial")T.metallicTexture!==null&&(f.setTexture("reflectivitySampler",T.metallicTexture),f.setMatrix("reflectivityMatrix",T.metallicTexture.getTextureMatrix())),T.metallic!==null&&f.setFloat("metallic",T.metallic),T.roughness!==null&&f.setFloat("glossiness",1-T.roughness),T.roughness!==null||T.metallic!==null||T.metallicTexture!==null?(T.albedoTexture!==null&&(f.setTexture("albedoSampler",T.albedoTexture),f.setMatrix("albedoMatrix",T.albedoTexture.getTextureMatrix())),T.albedoColor!==null&&f.setColor3("albedoColor",T.albedoColor)):(T.reflectivityTexture!==null?(f.setTexture("reflectivitySampler",T.reflectivityTexture),f.setMatrix("reflectivityMatrix",T.reflectivityTexture.getTextureMatrix())):T.reflectivityColor!==null&&f.setColor3("reflectivityColor",T.reflectivityColor),T.microSurface!==null&&f.setFloat("glossiness",T.microSurface));else if(T.getClassName()==="StandardMaterial")T.specularTexture!==null&&(f.setTexture("reflectivitySampler",T.specularTexture),f.setMatrix("reflectivityMatrix",T.specularTexture.getTextureMatrix())),T.specularColor!==null&&f.setColor3("reflectivityColor",T.specularColor);else if(T.getClassName()==="OpenPBRMaterial"){const R=T;R._useRoughnessFromMetallicTextureGreen&&R.baseMetalnessTexture?(f.setTexture("reflectivitySampler",R.baseMetalnessTexture),f.setMatrix("reflectivityMatrix",R.baseMetalnessTexture.getTextureMatrix())):R.baseMetalnessTexture?(f.setTexture("metallicSampler",R.baseMetalnessTexture),f.setMatrix("metallicMatrix",R.baseMetalnessTexture.getTextureMatrix())):R.specularRoughnessTexture&&(f.setTexture("roughnessSampler",R.specularRoughnessTexture),f.setMatrix("roughnessMatrix",R.specularRoughnessTexture.getTextureMatrix())),f.setFloat("metallic",R.baseMetalness),f.setFloat("glossiness",1-R.specularRoughness),R.baseColorTexture!==null&&(f.setTexture("albedoSampler",R.baseColorTexture),f.setMatrix("albedoMatrix",R.baseColorTexture.getTextureMatrix())),R.baseColor!==null&&f.setColor3("albedoColor",R.baseColor)}}if(this._enableIrradiance&&G.environmentTexture){const R=G.environmentTexture,ue=G.postProcessRenderPipelineManager.supportedPipelines.find(E=>E.getClassName()==="IBLShadowsRenderPipeline");if(ue){const Q=ue._getAccumulatedTexture();Q&&(f.setTexture("iblShadowSampler",Q),f.setFloat2("shadowTextureSize",Q.getSize().width,Q.getSize().height))}if(f.setMatrix("reflectionMatrix",R.getReflectionTextureMatrix()),f.setFloat2("vReflectionInfos",R.level*G.iblIntensity,0),f.setTexture("reflectionSampler",R),R.irradianceTexture&&(f.setTexture("irradianceSampler",R.irradianceTexture),R.irradianceTexture._dominantDirection&&f.setVector3("vReflectionDominantDirection",R.irradianceTexture._dominantDirection)),R.sphericalPolynomial){const E=R.sphericalPolynomial;if(E.preScaledHarmonics){const Q=E.preScaledHarmonics;f.setVector3("vSphericalL00",Q.l00),f.setVector3("vSphericalL1_1",Q.l1_1),f.setVector3("vSphericalL10",Q.l10),f.setVector3("vSphericalL11",Q.l11),f.setVector3("vSphericalL2_2",Q.l2_2),f.setVector3("vSphericalL2_1",Q.l2_1),f.setVector3("vSphericalL20",Q.l20),f.setVector3("vSphericalL21",Q.l21),f.setVector3("vSphericalL22",Q.l22)}else f.setFloat3("vSphericalX",E.x.x,E.x.y,E.x.z),f.setFloat3("vSphericalY",E.y.x,E.y.y,E.y.z),f.setFloat3("vSphericalZ",E.z.x,E.z.y,E.z.z),f.setFloat3("vSphericalXX_ZZ",E.xx.x-E.zz.x,E.xx.y-E.zz.y,E.xx.z-E.zz.z),f.setFloat3("vSphericalYY_ZZ",E.yy.x-E.zz.x,E.yy.y-E.zz.y,E.yy.z-E.zz.z),f.setFloat3("vSphericalZZ",E.zz.x,E.zz.y,E.zz.z),f.setFloat3("vSphericalXY",E.xy.x,E.xy.y,E.xy.z),f.setFloat3("vSphericalYZ",E.yz.x,E.yz.y,E.yz.z),f.setFloat3("vSphericalZX",E.zx.x,E.zx.y,E.zx.z)}if(this.generateIrradianceWithScatterMask&&T.getClassName()==="OpenPBRMaterial"){const E=T;f.setFloat("vSubsurfaceWeight",E.subsurfaceWeight),E.subsurfaceWeightTexture&&(f.setTexture("subsurfaceWeightSampler",E.subsurfaceWeightTexture),f.setMatrix("subsurfaceWeightMatrix",E.subsurfaceWeightTexture.getTextureMatrix())),f.setFloat("vTransmissionWeight",E.transmissionWeight),E.transmissionWeightTexture&&(f.setTexture("transmissionWeightSampler",E.transmissionWeightTexture),f.setMatrix("transmissionWeightMatrix",E.transmissionWeightTexture.getTextureMatrix())),f.setFloat("vTransmissionScatterAnisotropy",E.transmissionScatterAnisotropy),f.setFloat("vSubsurfaceScatterAnisotropy",E.subsurfaceScatterAnisotropy)}}if(Wl(f,T,this._scene),A.useBones&&A.computeBonesUsingShaders&&A.skeleton){const R=A.skeleton;if(R.isUsingTextureForMatrices&&f.getUniformIndex("boneTextureInfo")>-1){const ue=R.getTransformMatrixTexture(A);f.setTexture("boneSampler",ue),f.setFloat2("boneTextureInfo",R._textureWidth,R._textureHeight)}else f.setMatrices("mBones",A.skeleton.getTransformMatrices(A));(this._enableVelocity||this._enableVelocityLinear)&&f.setMatrices("mPreviousBones",this._previousBonesTransformationMatrices[A.uniqueId])}wl(A,f),A.morphTargetManager&&A.morphTargetManager.isUsingTextureForTargets&&A.morphTargetManager._bind(f),(this._enableVelocity||this._enableVelocityLinear)&&(f.setMatrix("previousWorld",this._previousTransformationMatrices[W.uniqueId].world),f.setMatrix("previousViewProjection",this._previousTransformationMatrices[W.uniqueId].viewProjection)),ie&&A.hasThinInstances&&f.setMatrix("world",V),A._processRendering(W,x,f,T.fillMode,le,ie,(R,ue)=>{R||f.setMatrix("world",ue)})}(this._enableVelocity||this._enableVelocityLinear)&&(this._previousTransformationMatrices[W.uniqueId].world=V.clone(),this._previousTransformationMatrices[W.uniqueId].viewProjection=this._scene.getTransformMatrix().clone(),A.skeleton&&this._copyBonesTransformationMatrices(A.skeleton.getTransformMatrices(A),this._previousBonesTransformationMatrices[W.uniqueId]))};this._multiRenderTarget.customIsReadyFunction=(x,A,W)=>{if((W||A===0)&&x.subMeshes)for(let G=0;G<x.subMeshes.length;++G){const y=x.subMeshes[G],T=y.getMaterial(),le=y.getRenderingMesh();if(!T)continue;const ie=le._getInstancesRenderList(y._id,!!y.getReplacementMesh()),V=s.getCaps().instancedArrays&&(ie.visibleInstances[y._id]!==null||le.hasThinInstances);if(!this.isReady(y,V))return!1}return!0},this._multiRenderTarget.customRenderFunction=(x,A,W,G)=>{let y;if(this._linkedWithPrePass){if(!this._prePassRenderer.enabled)return;this._scene.getEngine().bindAttachments(this._attachmentsFromPrePass)}if(G.length){for(s.setColorWrite(!1),y=0;y<G.length;y++)v(G.data[y]);s.setColorWrite(!0)}for(y=0;y<x.length;y++)v(x.data[y]);for(s.setDepthWrite(!1),y=0;y<A.length;y++)v(A.data[y]);if(this.renderTransparentMeshes)for(y=0;y<W.length;y++)v(W.data[y]);s.setDepthWrite(!0)}}_copyBonesTransformationMatrices(s,o){for(let l=0;l<s.length;l++)o[l]=s[l];return o}}D.ForceGLSL=!1;D.DEPTH_TEXTURE_TYPE=0;D.NORMAL_TEXTURE_TYPE=1;D.POSITION_TEXTURE_TYPE=2;D.VELOCITY_TEXTURE_TYPE=3;D.REFLECTIVITY_TEXTURE_TYPE=4;D.SCREENSPACE_DEPTH_TEXTURE_TYPE=5;D.VELOCITY_LINEAR_TEXTURE_TYPE=6;D.IRRADIANCE_TEXTURE_TYPE=7;D._SceneComponentInitialization=r=>{throw Jl("GeometryBufferRendererSceneComponent")};const Le={effect:null,subMesh:null};function Hl(r){if(typeof r=="number")return 1;if(r instanceof ve)return 2;if(r instanceof ko||r instanceof Re)return 3;if(r instanceof Gl||r instanceof Gt)return 4;throw new Error("Unsupported OpenPBR property type.")}class Ne{populateVectorFromLinkedProperties(s){const o=Hl(s);for(const l in this.linkedProperties){const n=this.linkedProperties[l],m=n.numComponents;if(o<m||n.targetUniformComponentOffset>o-m){m==1?De.Error(`Float property ${n.name} has an offset that is too large.`):De.Error(`Vector${m} property ${n.name} won't fit in Vector${o} or has an offset that is too large.`);return}typeof n.value=="number"?Ne._tmpArray[n.targetUniformComponentOffset]=n.value:n.value.toArray(Ne._tmpArray,n.targetUniformComponentOffset)}s.fromArray(Ne._tmpArray)}constructor(s,o){this.linkedProperties={},this.firstLinkedKey="",this.name=s,this.numComponents=o}}Ne._tmpArray=[0,0,0,0];class L{constructor(s,o,l,n,m=0,d){this.targetUniformComponentNum=4,this.targetUniformComponentOffset=0,this.name=s,this.targetUniformName=l,this.defaultValue=o,this.value=o,this.targetUniformComponentNum=n,this.targetUniformComponentOffset=m,this.requiredDefine=d}get numComponents(){return typeof this.defaultValue=="number"?1:Hl(this.defaultValue)}}class z{get samplerName(){return this.samplerPrefix+"Sampler"}get samplerInfoName(){return"v"+this.samplerPrefix.charAt(0).toUpperCase()+this.samplerPrefix.slice(1)+"Infos"}get samplerMatrixName(){return this.samplerPrefix+"Matrix"}constructor(s,o,l){this.value=null,this.samplerPrefix="",this.textureDefine="",this.name=s,this.samplerPrefix=o,this.textureDefine=l}}class Ko extends Bo(zo(Uo)){}class jo extends wo(Ko){}class Bl extends Lo(jo){constructor(s){super(s),this.NUM_SAMPLES="0",this.REALTIME_FILTERING=!1,this.IBL_CDF_FILTERING=!1,this.LIGHTCOUNT=0,this.VERTEXCOLOR=!1,this.BAKED_VERTEX_ANIMATION_TEXTURE=!1,this.VERTEXALPHA=!1,this.ALPHATEST=!1,this.DEPTHPREPASS=!1,this.ALPHABLEND=!1,this.ALPHA_FROM_BASE_COLOR_TEXTURE=!1,this.ALPHATESTVALUE="0.5",this.PREMULTIPLYALPHA=!1,this.REFLECTIVITY_GAMMA=!1,this.REFLECTIVITYDIRECTUV=0,this.SPECULARTERM=!1,this.LODBASEDMICROSFURACE=!0,this.SPECULAR_ROUGHNESS_FROM_METALNESS_TEXTURE_GREEN=!1,this.BASE_METALNESS_FROM_METALNESS_TEXTURE_BLUE=!1,this.AOSTOREINMETALMAPRED=!1,this.SPECULAR_WEIGHT_IN_ALPHA=!1,this.SPECULAR_WEIGHT_FROM_SPECULAR_COLOR_TEXTURE=!1,this.SPECULAR_ROUGHNESS_ANISOTROPY_FROM_TANGENT_TEXTURE=!1,this.COAT_ROUGHNESS_FROM_GREEN_CHANNEL=!1,this.COAT_ROUGHNESS_ANISOTROPY_FROM_TANGENT_TEXTURE=!1,this.USE_GLTF_STYLE_ANISOTROPY=!1,this.THIN_FILM_THICKNESS_FROM_THIN_FILM_TEXTURE=!1,this.FUZZ_ROUGHNESS_FROM_TEXTURE_ALPHA=!1,this.SUBSURFACE_WEIGHT_FROM_TEXTURE_ALPHA=!1,this.GEOMETRY_THICKNESS_FROM_GREEN_CHANNEL=!1,this.ENVIRONMENTBRDF=!1,this.ENVIRONMENTBRDF_RGBD=!1,this.FUZZENVIRONMENTBRDF=!1,this.NORMAL=!1,this.TANGENT=!1,this.OBJECTSPACE_NORMALMAP=!1,this.PARALLAX=!1,this.PARALLAX_RHS=!1,this.PARALLAXOCCLUSION=!1,this.NORMALXYSCALE=!0,this.ANISOTROPIC=!1,this.ANISOTROPIC_OPENPBR=!0,this.ANISOTROPIC_BASE=!1,this.ANISOTROPIC_COAT=!1,this.FUZZ_IBL_SAMPLES=6,this.REFRACTION_HIGH_QUALITY_BLUR=!1,this.FUZZ=!1,this.THIN_FILM=!1,this.IRIDESCENCE=!1,this.DISPERSION=!1,this.SCATTERING=!1,this.USE_IRRADIANCE_TEXTURE_FOR_SCATTERING=!1,this.SSS_SAMPLE_COUNT=16,this.USE_IRRADIANCE_TEXTURE_FOR_SCATTERING_GBUFFER=!1,this.TRANSMISSION_SLAB=!1,this.TRANSMISSION_SLAB_VOLUME=!1,this.SUBSURFACE_SLAB=!1,this.GEOMETRY_THIN_WALLED=!1,this.REFRACTED_BACKGROUND=!1,this.REFRACTED_LIGHTS=!1,this.REFRACTED_ENVIRONMENT=!1,this.REFRACTED_ENVIRONMENT_OPPOSITEZ=!1,this.REFRACTED_ENVIRONMENT_LOCAL_CUBE=!1,this.RADIANCEOCCLUSION=!1,this.HORIZONOCCLUSION=!1,this.INSTANCES=!1,this.THIN_INSTANCES=!1,this.INSTANCESCOLOR=!1,this.NUM_BONE_INFLUENCERS=0,this.BonesPerMesh=0,this.BONETEXTURE=!1,this.BONES_VELOCITY_ENABLED=!1,this.NONUNIFORMSCALING=!1,this.MORPHTARGETS=!1,this.MORPHTARGETS_POSITION=!1,this.MORPHTARGETS_NORMAL=!1,this.MORPHTARGETS_TANGENT=!1,this.MORPHTARGETS_UV=!1,this.MORPHTARGETS_UV2=!1,this.MORPHTARGETS_COLOR=!1,this.MORPHTARGETTEXTURE_HASPOSITIONS=!1,this.MORPHTARGETTEXTURE_HASNORMALS=!1,this.MORPHTARGETTEXTURE_HASTANGENTS=!1,this.MORPHTARGETTEXTURE_HASUVS=!1,this.MORPHTARGETTEXTURE_HASUV2S=!1,this.MORPHTARGETTEXTURE_HASCOLORS=!1,this.NUM_MORPH_INFLUENCERS=0,this.MORPHTARGETS_TEXTURE=!1,this.USEPHYSICALLIGHTFALLOFF=!1,this.USEGLTFLIGHTFALLOFF=!1,this.TWOSIDEDLIGHTING=!1,this.MIRRORED=!1,this.SHADOWFLOAT=!1,this.CLIPPLANE=!1,this.CLIPPLANE2=!1,this.CLIPPLANE3=!1,this.CLIPPLANE4=!1,this.CLIPPLANE5=!1,this.CLIPPLANE6=!1,this.POINTSIZE=!1,this.FOG=!1,this.LOGARITHMICDEPTH=!1,this.CAMERA_ORTHOGRAPHIC=!1,this.CAMERA_PERSPECTIVE=!1,this.AREALIGHTSUPPORTED=!0,this.FORCENORMALFORWARD=!1,this.SPECULARAA=!1,this.UNLIT=!1,this.DECAL_AFTER_DETAIL=!1,this.TEXTURE_REPETITION_MODE=0,this.DEBUGMODE=0,this.USE_VERTEX_PULLING=!1,this.VERTEX_PULLING_USE_INDEX_BUFFER=!1,this.VERTEX_PULLING_INDEX_BUFFER_32BITS=!1,this.RIGHT_HANDED=!1,this.CLUSTLIGHT_SLICES=0,this.CLUSTLIGHT_BATCH=0,this.BRDF_V_HEIGHT_CORRELATED=!0,this.MS_BRDF_ENERGY_CONSERVATION=!0,this.SPHERICAL_HARMONICS=!0,this.SPECULAR_GLOSSINESS_ENERGY_CONSERVATION=!0,this.MIX_IBL_RADIANCE_WITH_IRRADIANCE=!0,this.LEGACY_SPECULAR_ENERGY_CONSERVATION=!1,this.BASE_DIFFUSE_MODEL=0,this.DIELECTRIC_SPECULAR_MODEL=1,this.CONDUCTOR_SPECULAR_MODEL=1,this.rebuild()}reset(){super.reset(),this.ALPHATESTVALUE="0.5",this.NORMALXYSCALE=!0}}class Qo extends No(vo){}let qo=(()=>{var r,s,o,l,n,m,d,I,k,U,M,N,J,se,_e,te,v,x,A,W,G,y,T,le,ie,V,g,f,fe,oe,R,ue,E,Q,P,he,q,Te,ce,j,ye,Oe,Ce,Fe,Z,Ee,Se,Me,Ie,ke,Be,ze,Ue,We,we,Ge,He,Ve,Xe,Ye,Ze,Ke,je,Qe,qe,$e,Je,et,tt,st,it,rt,at,nt,lt,ot,ut,ht,ct,_t,ft,Tt,gt,mt,pt,dt,xt,Rt,At,Et,St,Mt,It,bt,yt,Ot,Ct,Ft,Lt,Dt,Pt,Nt,vt;let Ht=Qo,kt=[],Vt,Xt=[],Yt=[],Zt,Kt=[],jt=[],Qt,qt=[],$t=[],Jt,es=[],ts=[],ss,is=[],rs=[],as,ns=[],ls=[],os,us=[],hs=[],cs,_s=[],fs=[],Ts,gs=[],ms=[],ps,ds=[],xs=[],Rs,As=[],Es=[],Ss,Ms=[],Is=[],bs,ys=[],Os=[],Cs,Fs=[],Ls=[],Ds,Ps=[],Ns=[],vs,ks=[],Bs=[],zs,Us=[],Ws=[],ws,Gs=[],Hs=[],Vs,Xs=[],Ys=[],Zs,Ks=[],js=[],Qs,qs=[],$s=[],Js,ei=[],ti=[],si,ii=[],ri=[],ai,ni=[],li=[],oi,ui=[],hi=[],ci,_i=[],fi=[],Ti,gi=[],mi=[],pi,di=[],xi=[],Ri,Ai=[],Ei=[],Si,Mi=[],Ii=[],bi,yi=[],Oi=[],Ci,Fi=[],Li=[],Di,Pi=[],Ni=[],vi,ki=[],Bi=[],zi,Ui=[],Wi=[],wi,Gi=[],Hi=[],Vi,Xi=[],Yi=[],Zi,Ki=[],ji=[],Qi,qi=[],$i=[],Ji,er=[],tr=[],sr,ir=[],rr=[],ar,nr=[],lr=[],or,ur=[],hr=[],cr,_r=[],fr=[],Tr,gr=[],mr=[],pr,dr=[],xr=[],Rr,Ar=[],Er=[],Sr,Mr=[],Ir=[],br,yr=[],Or=[],Cr,Fr=[],Lr=[],Dr,Pr=[],Nr=[],vr,kr=[],Br=[],zr,Ur=[],Wr=[],wr,Gr=[],Hr=[],Vr,Xr=[],Yr=[],Zr,Kr=[],jr=[],Qr,qr=[],$r=[],Jr,ea=[],ta=[],sa,ia=[],ra=[],aa,na=[],la=[],oa,ua=[],ha=[],ca,_a=[],fa=[],Ta,ga=[],ma=[],pa,da=[],xa=[],Ra,Aa=[],Ea=[],Sa,Ma=[],Ia=[],ba,ya=[],Oa=[],Ca,Fa=[],La=[],Da,Pa=[],Na=[],va,ka=[],Ba=[],za,Ua=[],Wa=[],wa,Ga=[],Ha=[],Va,Xa=[],Ya=[],Za,Ka=[],ja=[],Qa,qa=[],$a=[],Ja,en=[],tn=[],sn,rn=[],an=[],nn,ln=[],on=[],un,hn=[],cn=[],_n,fn=[],Tn=[],gn,mn=[],pn=[],dn,xn=[],Rn=[],An,En,Sn,Mn=[],In=[],bn,yn=[],On=[],Cn,Fn=[],Ln=[],Dn,Pn=[],Nn=[],vn,kn=[],Bn=[],zn,Un=[],Wn=[],wn,Gn=[],Hn=[],Vn,Xn=[],Yn=[],Zn,Kn=[],jn=[],Qn,qn=[],$n=[],Jn,el=[],tl=[],sl,il=[],rl=[],al,nl=[],ll=[],ol,ul=[],hl=[],cl,_l=[],fl=[],Tl,gl=[],ml=[],pl,dl=[],xl=[],Rl,Al=[],El=[],Sl,Ml=[],Il=[],bl,yl=[],Ol=[],Cl;return r=class extends Ht{get baseWeight(){return c(this,s,"f")}set baseWeight(e){_(this,s,e,"f")}get baseWeightTexture(){return c(this,o,"f")}set baseWeightTexture(e){_(this,o,e,"f")}get baseColor(){return c(this,l,"f")}set baseColor(e){_(this,l,e,"f")}get baseColorTexture(){return c(this,n,"f")}set baseColorTexture(e){_(this,n,e,"f")}get baseDiffuseRoughness(){return c(this,m,"f")}set baseDiffuseRoughness(e){_(this,m,e,"f")}get baseDiffuseRoughnessTexture(){return c(this,d,"f")}set baseDiffuseRoughnessTexture(e){_(this,d,e,"f")}get baseMetalness(){return c(this,I,"f")}set baseMetalness(e){_(this,I,e,"f")}get baseMetalnessTexture(){return c(this,k,"f")}set baseMetalnessTexture(e){_(this,k,e,"f")}get specularWeight(){return c(this,U,"f")}set specularWeight(e){_(this,U,e,"f")}get specularWeightTexture(){return c(this,M,"f")}set specularWeightTexture(e){_(this,M,e,"f")}get specularColor(){return c(this,N,"f")}set specularColor(e){_(this,N,e,"f")}get specularColorTexture(){return c(this,J,"f")}set specularColorTexture(e){_(this,J,e,"f")}get specularRoughness(){return c(this,se,"f")}set specularRoughness(e){_(this,se,e,"f")}get specularRoughnessTexture(){return c(this,_e,"f")}set specularRoughnessTexture(e){_(this,_e,e,"f")}get specularRoughnessAnisotropy(){return c(this,te,"f")}set specularRoughnessAnisotropy(e){_(this,te,e,"f")}get specularRoughnessAnisotropyTexture(){return c(this,v,"f")}set specularRoughnessAnisotropyTexture(e){_(this,v,e,"f")}get specularIor(){return c(this,x,"f")}set specularIor(e){_(this,x,e,"f")}get transmissionWeight(){return c(this,A,"f")}set transmissionWeight(e){_(this,A,e,"f")}get transmissionWeightTexture(){return c(this,W,"f")}set transmissionWeightTexture(e){_(this,W,e,"f")}get transmissionColor(){return c(this,G,"f")}set transmissionColor(e){_(this,G,e,"f")}get transmissionColorTexture(){return c(this,y,"f")}set transmissionColorTexture(e){_(this,y,e,"f")}get transmissionDepth(){return c(this,T,"f")}set transmissionDepth(e){_(this,T,e,"f")}get transmissionDepthTexture(){return c(this,le,"f")}set transmissionDepthTexture(e){_(this,le,e,"f")}get transmissionScatter(){return c(this,ie,"f")}set transmissionScatter(e){_(this,ie,e,"f")}get transmissionScatterTexture(){return c(this,V,"f")}set transmissionScatterTexture(e){_(this,V,e,"f")}get transmissionScatterAnisotropy(){return c(this,g,"f")}set transmissionScatterAnisotropy(e){_(this,g,e,"f")}get transmissionDispersionScale(){return c(this,f,"f")}set transmissionDispersionScale(e){_(this,f,e,"f")}get transmissionDispersionScaleTexture(){return c(this,fe,"f")}set transmissionDispersionScaleTexture(e){_(this,fe,e,"f")}get transmissionDispersionAbbeNumber(){return c(this,oe,"f")}set transmissionDispersionAbbeNumber(e){_(this,oe,e,"f")}get subsurfaceWeight(){return c(this,R,"f")}set subsurfaceWeight(e){_(this,R,e,"f")}get subsurfaceWeightTexture(){return c(this,ue,"f")}set subsurfaceWeightTexture(e){_(this,ue,e,"f")}get subsurfaceColor(){return c(this,E,"f")}set subsurfaceColor(e){_(this,E,e,"f")}get subsurfaceColorTexture(){return c(this,Q,"f")}set subsurfaceColorTexture(e){_(this,Q,e,"f")}get subsurfaceRadius(){return c(this,P,"f")}set subsurfaceRadius(e){_(this,P,e,"f")}get subsurfaceRadiusScale(){return c(this,he,"f")}set subsurfaceRadiusScale(e){_(this,he,e,"f")}get subsurfaceRadiusScaleTexture(){return c(this,q,"f")}set subsurfaceRadiusScaleTexture(e){_(this,q,e,"f")}get subsurfaceScatterAnisotropy(){return c(this,Te,"f")}set subsurfaceScatterAnisotropy(e){_(this,Te,e,"f")}get coatWeight(){return c(this,ce,"f")}set coatWeight(e){_(this,ce,e,"f")}get coatWeightTexture(){return c(this,j,"f")}set coatWeightTexture(e){_(this,j,e,"f")}get coatColor(){return c(this,ye,"f")}set coatColor(e){_(this,ye,e,"f")}get coatColorTexture(){return c(this,Oe,"f")}set coatColorTexture(e){_(this,Oe,e,"f")}get coatRoughness(){return c(this,Ce,"f")}set coatRoughness(e){_(this,Ce,e,"f")}get coatRoughnessTexture(){return c(this,Fe,"f")}set coatRoughnessTexture(e){_(this,Fe,e,"f")}get coatRoughnessAnisotropy(){return c(this,Z,"f")}set coatRoughnessAnisotropy(e){_(this,Z,e,"f")}get coatRoughnessAnisotropyTexture(){return c(this,Ee,"f")}set coatRoughnessAnisotropyTexture(e){_(this,Ee,e,"f")}get coatIor(){return c(this,Se,"f")}set coatIor(e){_(this,Se,e,"f")}get coatDarkening(){return c(this,Me,"f")}set coatDarkening(e){_(this,Me,e,"f")}get coatDarkeningTexture(){return c(this,Ie,"f")}set coatDarkeningTexture(e){_(this,Ie,e,"f")}get fuzzWeight(){return c(this,ke,"f")}set fuzzWeight(e){_(this,ke,e,"f")}get fuzzWeightTexture(){return c(this,Be,"f")}set fuzzWeightTexture(e){_(this,Be,e,"f")}get fuzzColor(){return c(this,ze,"f")}set fuzzColor(e){_(this,ze,e,"f")}get fuzzColorTexture(){return c(this,Ue,"f")}set fuzzColorTexture(e){_(this,Ue,e,"f")}get fuzzRoughness(){return c(this,We,"f")}set fuzzRoughness(e){_(this,We,e,"f")}get fuzzRoughnessTexture(){return c(this,we,"f")}set fuzzRoughnessTexture(e){_(this,we,e,"f")}get geometryThinWalled(){return c(this,Ge,"f")}set geometryThinWalled(e){_(this,Ge,e,"f")}get geometryNormalTexture(){return c(this,He,"f")}set geometryNormalTexture(e){_(this,He,e,"f")}get geometryTangent(){return c(this,Ve,"f")}set geometryTangent(e){_(this,Ve,e,"f")}get geometryTangentAngle(){return Math.atan2(this.geometryTangent.y,this.geometryTangent.x)}set geometryTangentAngle(e){this.geometryTangent=new ve(Math.cos(e),Math.sin(e))}get geometryTangentTexture(){return c(this,Xe,"f")}set geometryTangentTexture(e){_(this,Xe,e,"f")}get geometryCoatNormalTexture(){return c(this,Ye,"f")}set geometryCoatNormalTexture(e){_(this,Ye,e,"f")}get geometryCoatTangent(){return c(this,Ze,"f")}set geometryCoatTangent(e){_(this,Ze,e,"f")}get geometryCoatTangentAngle(){return Math.atan2(this.geometryCoatTangent.y,this.geometryCoatTangent.x)}set geometryCoatTangentAngle(e){this.geometryCoatTangent=new ve(Math.cos(e),Math.sin(e))}get geometryCoatTangentTexture(){return c(this,Ke,"f")}set geometryCoatTangentTexture(e){_(this,Ke,e,"f")}get geometryOpacity(){return c(this,je,"f")}set geometryOpacity(e){_(this,je,e,"f")}get geometryOpacityTexture(){return c(this,Qe,"f")}set geometryOpacityTexture(e){_(this,Qe,e,"f")}get geometryThickness(){return c(this,qe,"f")}set geometryThickness(e){_(this,qe,e,"f")}get geometryThicknessTexture(){return c(this,$e,"f")}set geometryThicknessTexture(e){_(this,$e,e,"f")}get emissionLuminance(){return c(this,Je,"f")}set emissionLuminance(e){_(this,Je,e,"f")}get emissionColor(){return c(this,et,"f")}set emissionColor(e){_(this,et,e,"f")}get emissionColorTexture(){return c(this,tt,"f")}set emissionColorTexture(e){_(this,tt,e,"f")}get thinFilmWeight(){return c(this,st,"f")}set thinFilmWeight(e){_(this,st,e,"f")}get thinFilmWeightTexture(){return c(this,it,"f")}set thinFilmWeightTexture(e){_(this,it,e,"f")}get thinFilmThickness(){return c(this,rt,"f")}set thinFilmThickness(e){_(this,rt,e,"f")}get thinFilmThicknessMin(){return c(this,at,"f")}set thinFilmThicknessMin(e){_(this,at,e,"f")}get thinFilmThicknessTexture(){return c(this,nt,"f")}set thinFilmThicknessTexture(e){_(this,nt,e,"f")}get thinFilmIor(){return c(this,lt,"f")}set thinFilmIor(e){_(this,lt,e,"f")}get ambientOcclusionTexture(){return c(this,ot,"f")}set ambientOcclusionTexture(e){_(this,ot,e,"f")}get sssQuality(){return this._sssQuality}set sssQuality(e){this._sssQuality!==e&&(this._sssQuality=e,this.markAsDirty(1))}get sssIrradianceTexture(){return this._sssIrradianceTexture}set sssIrradianceTexture(e){this._sssIrradianceTexture!==e&&(this._sssIrradianceTexture=e,this._markAllSubMeshesAsTexturesDirty())}get sssDepthTexture(){return this._sssDepthTexture}set sssDepthTexture(e){this._sssDepthTexture!==e&&(this._sssDepthTexture=e,this._markAllSubMeshesAsTexturesDirty())}get directIntensity(){return c(this,ut,"f")}set directIntensity(e){_(this,ut,e,"f")}get environmentIntensity(){return c(this,ht,"f")}set environmentIntensity(e){_(this,ht,e,"f")}get useSpecularWeightFromTextureAlpha(){return c(this,ct,"f")}set useSpecularWeightFromTextureAlpha(e){_(this,ct,e,"f")}get forceAlphaTest(){return c(this,_t,"f")}set forceAlphaTest(e){_(this,_t,e,"f")}get alphaCutOff(){return c(this,ft,"f")}set alphaCutOff(e){_(this,ft,e,"f")}get useAmbientOcclusionFromMetallicTextureRed(){return c(this,Tt,"f")}set useAmbientOcclusionFromMetallicTextureRed(e){_(this,Tt,e,"f")}get useAmbientInGrayScale(){return c(this,gt,"f")}set useAmbientInGrayScale(e){_(this,gt,e,"f")}get hasTransparency(){return this.subsurfaceWeight>0||this.transmissionWeight>0}get hasScattering(){return this.transmissionWeight>0&&this.transmissionDepth>0&&!this.transmissionScatter.equals(Re.BlackReadOnly)||this.subsurfaceWeight>0}get usePhysicalLightFalloff(){return this._lightFalloff===ne.LIGHTFALLOFF_PHYSICAL}set usePhysicalLightFalloff(e){e!==this.usePhysicalLightFalloff&&(this._markAllSubMeshesAsTexturesDirty(),e?this._lightFalloff=ne.LIGHTFALLOFF_PHYSICAL:this._lightFalloff=ne.LIGHTFALLOFF_STANDARD)}get useGLTFLightFalloff(){return this._lightFalloff===ne.LIGHTFALLOFF_GLTF}set useGLTFLightFalloff(e){e!==this.useGLTFLightFalloff&&(this._markAllSubMeshesAsTexturesDirty(),e?this._lightFalloff=ne.LIGHTFALLOFF_GLTF:this._lightFalloff=ne.LIGHTFALLOFF_STANDARD)}get useObjectSpaceNormalMap(){return c(this,mt,"f")}set useObjectSpaceNormalMap(e){_(this,mt,e,"f")}get useParallax(){return c(this,pt,"f")}set useParallax(e){_(this,pt,e,"f")}get useParallaxOcclusion(){return c(this,dt,"f")}set useParallaxOcclusion(e){_(this,dt,e,"f")}get parallaxScaleBias(){return c(this,xt,"f")}set parallaxScaleBias(e){_(this,xt,e,"f")}get disableLighting(){return c(this,Rt,"f")}set disableLighting(e){_(this,Rt,e,"f")}get forceIrradianceInFragment(){return c(this,At,"f")}set forceIrradianceInFragment(e){_(this,At,e,"f")}get maxSimultaneousLights(){return c(this,Et,"f")}set maxSimultaneousLights(e){_(this,Et,e,"f")}get invertNormalMapX(){return c(this,St,"f")}set invertNormalMapX(e){_(this,St,e,"f")}get invertNormalMapY(){return c(this,Mt,"f")}set invertNormalMapY(e){_(this,Mt,e,"f")}get twoSidedLighting(){return c(this,It,"f")}set twoSidedLighting(e){_(this,It,e,"f")}get useAlphaFresnel(){return c(this,bt,"f")}set useAlphaFresnel(e){_(this,bt,e,"f")}get useLinearAlphaFresnel(){return c(this,yt,"f")}set useLinearAlphaFresnel(e){_(this,yt,e,"f")}get environmentBRDFTexture(){return c(this,Ot,"f")}set environmentBRDFTexture(e){_(this,Ot,e,"f")}get forceNormalForward(){return c(this,Ct,"f")}set forceNormalForward(e){_(this,Ct,e,"f")}get enableSpecularAntiAliasing(){return c(this,Ft,"f")}set enableSpecularAntiAliasing(e){_(this,Ft,e,"f")}get useHorizonOcclusion(){return c(this,Lt,"f")}set useHorizonOcclusion(e){_(this,Lt,e,"f")}get useRadianceOcclusion(){return c(this,Dt,"f")}set useRadianceOcclusion(e){_(this,Dt,e,"f")}get unlit(){return c(this,Pt,"f")}set unlit(e){_(this,Pt,e,"f")}get applyDecalMapAfterDetailMap(){return c(this,Nt,"f")}set applyDecalMapAfterDetailMap(e){_(this,Nt,e,"f")}get backgroundRefractionTexture(){return this._backgroundRefractionTexture}set backgroundRefractionTexture(e){this._backgroundRefractionTexture=e,this._markAllSubMeshesAsTexturesDirty()}get refractionHighQualityBlur(){return this._refractionHighQualityBlur}set refractionHighQualityBlur(e){this._refractionHighQualityBlur!==e&&(this._refractionHighQualityBlur=e,this.markAsDirty(1))}get realTimeFiltering(){return this._realTimeFiltering}set realTimeFiltering(e){this._realTimeFiltering=e,this.markAsDirty(1)}get realTimeFilteringQuality(){return this._realTimeFilteringQuality}set realTimeFilteringQuality(e){this._realTimeFilteringQuality=e,this.markAsDirty(1)}get fuzzSampleNumber(){return this._fuzzSampleNumber}set fuzzSampleNumber(e){this._fuzzSampleNumber=e,this.markAsDirty(1)}get canRenderToMRT(){return!0}get debugMode(){return c(this,vt,"f")}set debugMode(e){_(this,vt,e,"f")}constructor(e,t,a=!1){super(e,t,void 0,a||r.ForceGLSL),s.set(this,(i(this,kt),i(this,Xt,void 0))),this._baseWeight=(i(this,Yt),new L("base_weight",1,"vBaseWeight",1)),o.set(this,i(this,Kt,void 0)),this._baseWeightTexture=(i(this,jt),new z("base_weight","baseWeight","BASE_WEIGHT")),l.set(this,i(this,qt,void 0)),this._baseColor=(i(this,$t),new L("base_color",Re.White(),"vBaseColor",4)),n.set(this,i(this,es,void 0)),this._baseColorTexture=(i(this,ts),new z("base_color","baseColor","BASE_COLOR")),m.set(this,i(this,is,void 0)),this._baseDiffuseRoughness=(i(this,rs),new L("base_diffuse_roughness",0,"vBaseDiffuseRoughness",1)),d.set(this,i(this,ns,void 0)),this._baseDiffuseRoughnessTexture=(i(this,ls),new z("base_diffuse_roughness","baseDiffuseRoughness","BASE_DIFFUSE_ROUGHNESS")),I.set(this,i(this,us,void 0)),this._baseMetalness=(i(this,hs),new L("base_metalness",0,"vReflectanceInfo",4,0)),k.set(this,i(this,_s,void 0)),this._baseMetalnessTexture=(i(this,fs),new z("base_metalness","baseMetalness","BASE_METALNESS")),U.set(this,i(this,gs,void 0)),this._specularWeight=(i(this,ms),new L("specular_weight",1,"vReflectanceInfo",4,3)),M.set(this,i(this,ds,void 0)),this._specularWeightTexture=(i(this,xs),new z("specular_weight","specularWeight","SPECULAR_WEIGHT")),N.set(this,i(this,As,void 0)),this._specularColor=(i(this,Es),new L("specular_color",Re.White(),"vSpecularColor",4)),J.set(this,i(this,Ms,void 0)),this._specularColorTexture=(i(this,Is),new z("specular_color","specularColor","SPECULAR_COLOR")),se.set(this,i(this,ys,void 0)),this._specularRoughness=(i(this,Os),new L("specular_roughness",.3,"vReflectanceInfo",4,1)),_e.set(this,i(this,Fs,void 0)),this._specularRoughnessTexture=(i(this,Ls),new z("specular_roughness","specularRoughness","SPECULAR_ROUGHNESS")),te.set(this,i(this,Ps,void 0)),this._specularRoughnessAnisotropy=(i(this,Ns),new L("specular_roughness_anisotropy",0,"vSpecularAnisotropy",3,2)),v.set(this,i(this,ks,void 0)),this._specularRoughnessAnisotropyTexture=(i(this,Bs),new z("specular_roughness_anisotropy","specularRoughnessAnisotropy","SPECULAR_ROUGHNESS_ANISOTROPY")),x.set(this,i(this,Us,void 0)),this._specularIor=(i(this,Ws),new L("specular_ior",1.5,"vReflectanceInfo",4,2)),A.set(this,i(this,Gs,void 0)),this._transmissionWeight=(i(this,Hs),new L("transmission_weight",0,"vTransmissionWeight",1)),W.set(this,i(this,Xs,void 0)),this._transmissionWeightTexture=(i(this,Ys),new z("transmission_weight","transmissionWeight","TRANSMISSION_WEIGHT")),G.set(this,i(this,Ks,void 0)),this._transmissionColor=(i(this,js),new L("transmission_color",Re.White(),"vTransmissionColor",3,0)),y.set(this,i(this,qs,void 0)),this._transmissionColorTexture=(i(this,$s),new z("transmission_color","transmissionColor","TRANSMISSION_COLOR")),T.set(this,i(this,ei,void 0)),this._transmissionDepth=(i(this,ti),new L("transmission_depth",0,"vTransmissionDepth",1,0)),le.set(this,i(this,ii,void 0)),this._transmissionDepthTexture=(i(this,ri),new z("transmission_depth","transmissionDepth","TRANSMISSION_DEPTH")),ie.set(this,i(this,ni,void 0)),this._transmissionScatter=(i(this,li),new L("transmission_scatter",Re.Black(),"vTransmissionScatter",3,0)),V.set(this,i(this,ui,void 0)),this._transmissionScatterTexture=(i(this,hi),new z("transmission_scatter","transmissionScatter","TRANSMISSION_SCATTER")),g.set(this,i(this,_i,void 0)),this._transmissionScatterAnisotropy=(i(this,fi),new L("transmission_scatter_anisotropy",0,"vTransmissionScatterAnisotropy",1,0)),f.set(this,i(this,gi,void 0)),this._transmissionDispersionScale=(i(this,mi),new L("transmission_dispersion_scale",0,"vTransmissionDispersionScale",1,0)),fe.set(this,i(this,di,void 0)),this._transmissionDispersionScaleTexture=(i(this,xi),new z("transmission_dispersion_scale","transmissionDispersionScale","TRANSMISSION_DISPERSION_SCALE")),oe.set(this,i(this,Ai,void 0)),this._transmissionDispersionAbbeNumber=(i(this,Ei),new L("transmission_dispersion_abbe_number",20,"vTransmissionDispersionAbbeNumber",1,0)),R.set(this,i(this,Mi,void 0)),this._subsurfaceWeight=(i(this,Ii),new L("subsurface_weight",0,"vSubsurfaceWeight",1,0,"SUBSURFACE_SLAB")),ue.set(this,i(this,yi,void 0)),this._subsurfaceWeightTexture=(i(this,Oi),new z("subsurface_weight","subsurfaceWeight","SUBSURFACE_WEIGHT")),E.set(this,i(this,Fi,void 0)),this._subsurfaceColor=(i(this,Li),new L("subsurface_color",new Re(.8,.8,.8),"vSubsurfaceColor",3,0,"SUBSURFACE_SLAB")),Q.set(this,i(this,Pi,void 0)),this._subsurfaceColorTexture=(i(this,Ni),new z("subsurface_color","subsurfaceColor","SUBSURFACE_COLOR")),P.set(this,i(this,ki,void 0)),this._subsurfaceRadius=(i(this,Bi),new L("subsurface_radius",.1,"vSubsurfaceRadius",1,0,"SUBSURFACE_SLAB")),he.set(this,i(this,Ui,void 0)),this._subsurfaceRadiusScale=(i(this,Wi),new L("subsurface_radius_scale",new Re(1,.5,.25),"vSubsurfaceRadiusScale",3,0,"SUBSURFACE_SLAB")),q.set(this,i(this,Gi,void 0)),this._subsurfaceRadiusScaleTexture=(i(this,Hi),new z("subsurface_radius_scale","subsurfaceRadiusScale","SUBSURFACE_RADIUS_SCALE")),Te.set(this,i(this,Xi,void 0)),this._subsurfaceScatterAnisotropy=(i(this,Yi),new L("subsurface_scatter_anisotropy",0,"vSubsurfaceScatterAnisotropy",1,0,"SUBSURFACE_SLAB")),ce.set(this,i(this,Ki,void 0)),this._coatWeight=(i(this,ji),new L("coat_weight",0,"vCoatWeight",1,0)),j.set(this,i(this,qi,void 0)),this._coatWeightTexture=(i(this,$i),new z("coat_weight","coatWeight","COAT_WEIGHT")),ye.set(this,i(this,er,void 0)),this._coatColor=(i(this,tr),new L("coat_color",Re.White(),"vCoatColor",3,0)),Oe.set(this,i(this,ir,void 0)),this._coatColorTexture=(i(this,rr),new z("coat_color","coatColor","COAT_COLOR")),Ce.set(this,i(this,nr,void 0)),this._coatRoughness=(i(this,lr),new L("coat_roughness",0,"vCoatRoughness",1,0)),Fe.set(this,i(this,ur,void 0)),this._coatRoughnessTexture=(i(this,hr),new z("coat_roughness","coatRoughness","COAT_ROUGHNESS")),Z.set(this,i(this,_r,void 0)),this._coatRoughnessAnisotropy=(i(this,fr),new L("coat_roughness_anisotropy",0,"vCoatRoughnessAnisotropy",1)),Ee.set(this,i(this,gr,void 0)),this._coatRoughnessAnisotropyTexture=(i(this,mr),new z("coat_roughness_anisotropy","coatRoughnessAnisotropy","COAT_ROUGHNESS_ANISOTROPY")),Se.set(this,i(this,dr,void 0)),this._coatIor=(i(this,xr),new L("coat_ior",1.5,"vCoatIor",1,0)),Me.set(this,i(this,Ar,void 0)),this._coatDarkening=(i(this,Er),new L("coat_darkening",1,"vCoatDarkening",1,0)),Ie.set(this,i(this,Mr,void 0)),this._coatDarkeningTexture=(i(this,Ir),new z("coat_darkening","coatDarkening","COAT_DARKENING")),this.useCoatRoughnessFromWeightTexture=!1,ke.set(this,i(this,yr,void 0)),this._fuzzWeight=(i(this,Or),new L("fuzz_weight",0,"vFuzzWeight",1,0)),Be.set(this,i(this,Fr,void 0)),this._fuzzWeightTexture=(i(this,Lr),new z("fuzz_weight","fuzzWeight","FUZZ_WEIGHT")),ze.set(this,i(this,Pr,void 0)),this._fuzzColor=(i(this,Nr),new L("fuzz_color",Re.White(),"vFuzzColor",3,0)),Ue.set(this,i(this,kr,void 0)),this._fuzzColorTexture=(i(this,Br),new z("fuzz_color","fuzzColor","FUZZ_COLOR")),We.set(this,i(this,Ur,void 0)),this._fuzzRoughness=(i(this,Wr),new L("fuzz_roughness",.5,"vFuzzRoughness",1,0)),we.set(this,i(this,Gr,void 0)),this._fuzzRoughnessTexture=(i(this,Hr),new z("fuzz_roughness","fuzzRoughness","FUZZ_ROUGHNESS")),Ge.set(this,i(this,Xr,void 0)),this._geometryThinWalled=(i(this,Yr),new L("geometry_thin_walled",0,"vGeometryThinWalled",1,0)),He.set(this,i(this,Kr,void 0)),this._geometryNormalTexture=(i(this,jr),new z("geometry_normal","geometryNormal","GEOMETRY_NORMAL")),Ve.set(this,i(this,qr,void 0)),this._geometryTangent=(i(this,$r),new L("geometry_tangent",new ve(1,0),"vSpecularAnisotropy",3,0)),Xe.set(this,i(this,ea,void 0)),this._geometryTangentTexture=(i(this,ta),new z("geometry_tangent","geometryTangent","GEOMETRY_TANGENT")),Ye.set(this,i(this,ia,void 0)),this._geometryCoatNormalTexture=(i(this,ra),new z("geometry_coat_normal","geometryCoatNormal","GEOMETRY_COAT_NORMAL")),Ze.set(this,i(this,na,void 0)),this._geometryCoatTangent=(i(this,la),new L("geometry_coat_tangent",new ve(1,0),"vGeometryCoatTangent",2,0)),Ke.set(this,i(this,ua,void 0)),this._geometryCoatTangentTexture=(i(this,ha),new z("geometry_coat_tangent","geometryCoatTangent","GEOMETRY_COAT_TANGENT")),je.set(this,i(this,_a,void 0)),this._geometryOpacity=(i(this,fa),new L("geometry_opacity",1,"vBaseColor",4,3)),Qe.set(this,i(this,ga,void 0)),this._geometryOpacityTexture=(i(this,ma),new z("geometry_opacity","geometryOpacity","GEOMETRY_OPACITY")),qe.set(this,i(this,da,void 0)),this._geometryThickness=(i(this,xa),new L("geometry_thickness",0,"vGeometryThickness",1,0)),$e.set(this,i(this,Aa,void 0)),this._geometryThicknessTexture=(i(this,Ea),new z("geometry_thickness","geometryThickness","GEOMETRY_THICKNESS")),Je.set(this,i(this,Ma,void 0)),this._emissionLuminance=(i(this,Ia),new L("emission_luminance",1,"vLightingIntensity",4,1)),et.set(this,i(this,ya,void 0)),this._emissionColor=(i(this,Oa),new L("emission_color",Re.Black(),"vEmissionColor",3)),tt.set(this,i(this,Fa,void 0)),this._emissionColorTexture=(i(this,La),new z("emission_color","emissionColor","EMISSION_COLOR")),st.set(this,i(this,Pa,void 0)),this._thinFilmWeight=(i(this,Na),new L("thin_film_weight",0,"vThinFilmWeight",1,0)),it.set(this,i(this,ka,void 0)),this._thinFilmWeightTexture=(i(this,Ba),new z("thin_film_weight","thinFilmWeight","THIN_FILM_WEIGHT")),rt.set(this,i(this,Ua,void 0)),this._thinFilmThickness=(i(this,Wa),new L("thin_film_thickness",.5,"vThinFilmThickness",2,0)),at.set(this,i(this,Ga,void 0)),this._thinFilmThicknessMin=(i(this,Ha),new L("thin_film_thickness_min",0,"vThinFilmThickness",2,1)),nt.set(this,i(this,Xa,void 0)),this._thinFilmThicknessTexture=(i(this,Ya),new z("thin_film_thickness","thinFilmThickness","THIN_FILM_THICKNESS")),lt.set(this,i(this,Ka,void 0)),this._thinFilmIor=(i(this,ja),new L("thin_film_ior",1.4,"vThinFilmIor",1,0)),ot.set(this,i(this,qa,void 0)),this._ambientOcclusionTexture=(i(this,$a),new z("ambient_occlusion","ambientOcclusion","AMBIENT_OCCLUSION")),this._sssQuality=r.SSS_QUALITY_MEDIUM,this._sssIrradianceTexture=null,this._sssDepthTexture=null,this._uniformsList={},this._uniformsArray=[],this._samplersList={},this._samplerDefines={},ut.set(this,i(this,en,1)),ht.set(this,(i(this,tn),i(this,rn,1))),ct.set(this,(i(this,an),i(this,ln,!1))),_t.set(this,(i(this,on),i(this,hn,!1))),ft.set(this,(i(this,cn),i(this,fn,.4))),Tt.set(this,(i(this,Tn),i(this,mn,!1))),gt.set(this,(i(this,pn),i(this,xn,!1))),mt.set(this,(i(this,Rn),i(this,Mn,!1))),pt.set(this,(i(this,In),i(this,yn,!1))),dt.set(this,(i(this,On),i(this,Fn,!1))),xt.set(this,(i(this,Ln),i(this,Pn,.05))),Rt.set(this,(i(this,Nn),i(this,kn,!1))),At.set(this,(i(this,Bn),i(this,Un,!1))),Et.set(this,(i(this,Wn),i(this,Gn,4))),St.set(this,(i(this,Hn),i(this,Xn,!1))),Mt.set(this,(i(this,Yn),i(this,Kn,!1))),It.set(this,(i(this,jn),i(this,qn,!1))),bt.set(this,(i(this,$n),i(this,el,!1))),yt.set(this,(i(this,tl),i(this,il,!1))),Ot.set(this,(i(this,rl),i(this,nl,null))),Ct.set(this,(i(this,ll),i(this,ul,!1))),Ft.set(this,(i(this,hl),i(this,_l,!1))),Lt.set(this,(i(this,fl),i(this,gl,!0))),Dt.set(this,(i(this,ml),i(this,dl,!0))),Pt.set(this,(i(this,xl),i(this,Al,!1))),Nt.set(this,(i(this,El),i(this,Ml,!1))),this._lightingInfos=(i(this,Il),new Gl(this.directIntensity,1,this.environmentIntensity,1)),this._radianceTexture=null,this._useSpecularWeightFromAlpha=!1,this._useSpecularWeightFromSpecularColorTexture=!1,this._useSpecularRoughnessAnisotropyFromTangentTexture=!1,this._useCoatRoughnessAnisotropyFromTangentTexture=!1,this._useCoatRoughnessFromGreenChannel=!1,this._useGltfStyleAnisotropy=!1,this._useFuzzRoughnessFromTextureAlpha=!1,this._useSubsurfaceWeightFromTextureAlpha=!1,this._useHorizonOcclusion=!0,this._useRadianceOcclusion=!0,this._useAlphaFromBaseColorTexture=!1,this._useAmbientOcclusionFromMetallicTextureRed=!1,this._useRoughnessFromMetallicTextureGreen=!1,this._useMetallicFromMetallicTextureBlue=!1,this._useThinFilmThicknessFromTextureGreen=!1,this._useGeometryThicknessFromGreenChannel=!1,this._lightFalloff=ne.LIGHTFALLOFF_PHYSICAL,this._useObjectSpaceNormalMap=!1,this._useParallax=!1,this._useParallaxOcclusion=!1,this._parallaxScaleBias=.05,this._disableLighting=!1,this._maxSimultaneousLights=4,this._invertNormalMapX=!1,this._invertNormalMapY=!1,this._twoSidedLighting=!1,this._alphaCutOff=.4,this._useAlphaFresnel=!1,this._useLinearAlphaFresnel=!1,this._environmentBRDFTexture=null,this._environmentFuzzBRDFTexture=null,this._backgroundRefractionTexture=null,this._refractionHighQualityBlur=!0,this._forceIrradianceInFragment=!1,this._realTimeFiltering=!1,this._realTimeFilteringQuality=8,this._fuzzSampleNumber=4,this._forceNormalForward=!1,this._enableSpecularAntiAliasing=!1,this._renderTargets=new eo(16),this._unlit=!1,this._applyDecalMapAfterDetailMap=!1,this._debugMode=0,this._shadersLoaded=!1,this._breakShaderLoadedCheck=!1,this._vertexPullingMetadata=null,vt.set(this,i(this,yl,0)),this.debugLimit=(i(this,Ol),-1),this.debugFactor=1,this._cacheHasRenderTargetTextures=!1,this._transparencyMode=ne.MATERIAL_OPAQUE,this.getScene()&&!this.getScene()?.getEngine().isWebGPU&&this.getScene().getEngine().webGLVersion<2&&De.Error("OpenPBRMaterial: WebGL 2.0 or above is required for this material."),r._noiseTextures[this.getScene().uniqueId]||(r._noiseTextures[this.getScene().uniqueId]=new Pe(to.GetAssetUrl("https://assets.babylonjs.com/core/blue_noise/blue_noise_rgb.png"),this.getScene(),!1,!0,1),this.getScene().onDisposeObservable.addOnce(()=>{r._noiseTextures[this.getScene().uniqueId]?.dispose(),delete r._noiseTextures[this.getScene().uniqueId]})),this._attachImageProcessingConfiguration(null),this.getRenderTargetTextures=()=>(this._renderTargets.reset(),ae.ReflectionTextureEnabled&&this._radianceTexture&&this._radianceTexture.isRenderTarget&&this._renderTargets.push(this._radianceTexture),ae.RefractionTextureEnabled&&this._backgroundRefractionTexture&&this._backgroundRefractionTexture.isRenderTarget&&this._renderTargets.push(this._backgroundRefractionTexture),this._eventInfo.renderTargets=this._renderTargets,this._callbackPluginEventFillRenderTargetTextures(this._eventInfo),this._renderTargets),this._environmentBRDFTexture=Wo(this.getScene()),this._environmentFuzzBRDFTexture=Nl(this.getScene()),this.prePassConfiguration=new Dl,this._propertyList={};for(const b of Object.getOwnPropertyNames(this)){const F=this[b];F instanceof L&&(this._propertyList[b]=F)}Object.keys(this._propertyList).forEach(b=>{const F=this._propertyList[b];let O=this._uniformsList[F.targetUniformName];O?O.numComponents!==F.targetUniformComponentNum?De.Error(`Uniform ${F.targetUniformName} already exists of size ${O.numComponents}, but trying to set it to ${F.targetUniformComponentNum}.`):O.requiredDefine!==F.requiredDefine&&(O.requiredDefine=void 0):(O=new Ne(F.targetUniformName,F.targetUniformComponentNum),O.requiredDefine=F.requiredDefine,this._uniformsList[F.targetUniformName]=O),O.firstLinkedKey===""&&(O.firstLinkedKey=F.name),O.linkedProperties[F.name]=F}),this._uniformsArray=Object.values(this._uniformsList),this._samplersList={};for(const b of Object.getOwnPropertyNames(this)){const F=this[b];F instanceof z&&(this._samplersList[b]=F)}for(const b in this._samplersList){const O=this._samplersList[b].textureDefine;this._samplerDefines[O]={type:"boolean",default:!1},this._samplerDefines[O+"DIRECTUV"]={type:"number",default:0},this._samplerDefines[O+"_GAMMA"]={type:"boolean",default:!1}}this._baseWeight,this._baseWeightTexture,this._baseColor,this._baseColorTexture,this._baseDiffuseRoughness,this._baseDiffuseRoughnessTexture,this._baseMetalness,this._baseMetalnessTexture,this._specularWeight,this._specularWeightTexture,this._specularColor,this._specularColorTexture,this._specularRoughness,this._specularIor,this._specularRoughnessTexture,this._specularRoughnessAnisotropy,this._specularRoughnessAnisotropyTexture,this._transmissionWeight,this._transmissionWeightTexture,this._transmissionColor,this._transmissionColorTexture,this._transmissionDepth,this._transmissionDepthTexture,this._transmissionScatter,this._transmissionScatterTexture,this._transmissionScatterAnisotropy,this._transmissionDispersionScale,this._transmissionDispersionScaleTexture,this._transmissionDispersionAbbeNumber,this._subsurfaceWeight,this._subsurfaceWeightTexture,this._subsurfaceColor,this._subsurfaceColorTexture,this._subsurfaceRadius,this._subsurfaceRadiusScale,this._subsurfaceRadiusScaleTexture,this._subsurfaceScatterAnisotropy,this._coatWeight,this._coatWeightTexture,this._coatColor,this._coatColorTexture,this._coatRoughness,this._coatRoughnessTexture,this._coatRoughnessAnisotropy,this._coatRoughnessAnisotropyTexture,this._coatIor,this._coatDarkening,this._coatDarkeningTexture,this._fuzzWeight,this._fuzzWeightTexture,this._fuzzColor,this._fuzzColorTexture,this._fuzzRoughness,this._fuzzRoughnessTexture,this._geometryThinWalled,this._geometryNormalTexture,this._geometryTangent,this._geometryTangentTexture,this._geometryCoatNormalTexture,this._geometryCoatTangent,this._geometryCoatTangentTexture,this._geometryOpacity,this._geometryOpacityTexture,this._geometryThickness,this._geometryThicknessTexture,this._thinFilmWeight,this._thinFilmWeightTexture,this._thinFilmThickness,this._thinFilmThicknessMin,this._thinFilmThicknessTexture,this._thinFilmIor,this._emissionLuminance,this._emissionColor,this._emissionColorTexture,this._ambientOcclusionTexture}get hasRenderTargetTextures(){return ae.ReflectionTextureEnabled&&this._radianceTexture&&this._radianceTexture.isRenderTarget||ae.RefractionTextureEnabled&&this._backgroundRefractionTexture&&this._backgroundRefractionTexture.isRenderTarget?!0:this._cacheHasRenderTargetTextures}get isPrePassCapable(){return!this.disableDepthWrite}getClassName(){return"OpenPBRMaterial"}get transparencyMode(){return this._transparencyMode}set transparencyMode(e){this._transparencyMode!==e&&(this._transparencyMode=e,this._markAllSubMeshesAsTexturesAndMiscDirty())}_shouldUseAlphaFromBaseColorTexture(){return this._hasAlphaChannel()&&this._transparencyMode!==ne.MATERIAL_OPAQUE&&!this.geometryOpacityTexture}_hasAlphaChannel(){return this.baseColorTexture!=null&&this.baseColorTexture.hasAlpha&&this._useAlphaFromBaseColorTexture||this.geometryOpacityTexture!=null}needAlphaBlending(){return this.geometryOpacity<1||this.geometryOpacityTexture!=null}needAlphaBlendingForMesh(e){return this.geometryOpacity<1||this.geometryOpacityTexture!=null||super.needAlphaBlendingForMesh(e)}clone(e,t=!0,a=""){const C=Pl.Clone(()=>new r(e,this.getScene()),this,{cloneTexturesOnlyOnce:t});return C.id=e,C.name=e,this.stencil.copyTo(C.stencil),this._clonePlugins(C,a),C}serialize(){const e=super.serialize();return e.customType="BABYLON.OpenPBRMaterial",e}static Parse(e,t,a){const C=Pl.Parse(()=>new r(e.name,t),e,t,a);return e.stencil&&C.stencil.parse(e.stencil,t,a),ne._ParsePlugins(e,C,t,a),C}forceCompilation(e,t,a){const C={clipPlane:!1,useInstances:!1,...a};this._uniformBufferLayoutBuilt||this.buildUniformLayout(),this._callbackPluginEventGeneric(4,this._eventInfo),(()=>{if(this._breakShaderLoadedCheck)return;const F=new Bl({...this._eventInfo.defineNames||{},...this._samplerDefines||{}}),O=this._prepareEffect(e,e,F,void 0,void 0,C.useInstances,C.clipPlane);this._onEffectCreatedObservable&&(Le.effect=O,Le.subMesh=null,this._onEffectCreatedObservable.notifyObservers(Le)),O.isReady()?t&&t(this):O.onCompileObservable.add(()=>{t&&t(this)})})()}isReadyForSubMesh(e,t,a){this._uniformBufferLayoutBuilt||this.buildUniformLayout();const C=t._drawWrapper;if(C.effect&&this.isFrozen&&C._wasPreviouslyReady&&C._wasPreviouslyUsingInstances===a)return!0;t.materialDefines||(this._callbackPluginEventGeneric(4,this._eventInfo),t.materialDefines=new Bl({...this._eventInfo.defineNames||{},...this._samplerDefines||{}}));const b=t.materialDefines;if(this._isReadyForSubMesh(t))return!0;const F=this.getScene(),O=F.getEngine();if(b._areTexturesDirty&&(this._eventInfo.hasRenderTargetTextures=!1,this._callbackPluginEventHasRenderTargetTextures(this._eventInfo),this._cacheHasRenderTargetTextures=this._eventInfo.hasRenderTargetTextures,F.texturesEnabled)){for(const re in this._samplersList){const H=this._samplersList[re];if(H.value&&!H.value.isReadyOrNotBlocking())return!1}const S=this._getRadianceTexture();if(S&&ae.ReflectionTextureEnabled){if(!S.isReadyOrNotBlocking())return!1;if(S.irradianceTexture){if(!S.irradianceTexture.isReadyOrNotBlocking())return!1}else if(!S.sphericalPolynomial&&S.getInternalTexture()?._sphericalPolynomialPromise)return!1}if(this._environmentBRDFTexture&&ae.ReflectionTextureEnabled&&!this._environmentBRDFTexture.isReady()||this._environmentFuzzBRDFTexture&&ae.ReflectionTextureEnabled&&!this._environmentFuzzBRDFTexture.isReady()||this._backgroundRefractionTexture&&ae.RefractionTextureEnabled&&!this._backgroundRefractionTexture.isReadyOrNotBlocking()||r._noiseTextures[F.uniqueId]&&!r._noiseTextures[F.uniqueId].isReady()||this._sssIrradianceTexture&&this._sssDepthTexture&&(!this._sssIrradianceTexture.isReady()||!this._sssDepthTexture.isReady()))return!1}if(this._eventInfo.isReadyForSubMesh=!0,this._eventInfo.defines=b,this._eventInfo.subMesh=t,this._callbackPluginEventIsReadyForSubMesh(this._eventInfo),!this._eventInfo.isReadyForSubMesh||b._areImageProcessingDirty&&this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.isReady())return!1;if(b.AREALIGHTUSED){for(let S=0;S<e.lightSources.length;S++)if(!e.lightSources[S]._isReady())return!1}if(!O.getCaps().standardDerivatives&&!e.isVerticesDataPresent($.NormalKind)&&(e.createNormals(!0),De.Warn("OpenPBRMaterial: Normals have been created for the mesh: "+e.name)),!so(F,e,this._maxSimultaneousLights,this._disableLighting))return!1;const ge=t.effect,de=b._areLightsDisposed,w=this._prepareEffect(e,t.getRenderingMesh(),b,this.onCompiled,this.onError,a,null);let B=!1;if(w)if(this._onEffectCreatedObservable&&(Le.effect=w,Le.subMesh=t,this._onEffectCreatedObservable.notifyObservers(Le)),this.allowShaderHotSwapping&&ge&&!w.isReady()){if(b.markAsUnprocessed(),B=this.isFrozen,de)return b._areLightsDisposed=!0,!1}else F.resetCachedMaterial(),t.setEffect(w,b,this._materialContext);return!t.effect||!t.effect.isReady()?!1:(b._renderId=F.getRenderId(),C._wasPreviouslyReady=!B,C._wasPreviouslyUsingInstances=!!a,this._checkScenePerformancePriority(),!0)}buildUniformLayout(){const e=this._uniformBuffer;e.addUniform("vTangentSpaceParams",2),e.addUniform("vLightingIntensity",4),e.addUniform("pointSize",1),e.addUniform("vDebugMode",2),e.addUniform("renderTargetSize",2),e.addUniform("cameraInfo",4),e.addUniform("vTextureRepetitionHexTilingParams",4),e.addUniform("backgroundRefractionMatrix",16),e.addUniform("vBackgroundRefractionInfos",3),io(e,!0,!0,!0,!0,!0),Object.values(this._uniformsList).forEach(t=>{e.addUniform(t.name,t.numComponents)}),Object.values(this._samplersList).forEach(t=>{e.addUniform(t.samplerInfoName,2),e.addUniform(t.samplerMatrixName,16)}),super.buildUniformLayout()}bindPropertiesForSubMesh(e,t,a,C){if(this.geometryThickness===0)e.updateFloat("vGeometryThickness",0);else{C.getRenderingMesh().getWorldMatrix().decompose(pe.Vector3[0]);const b=Math.max(Math.abs(pe.Vector3[0].x),Math.abs(pe.Vector3[0].y),Math.abs(pe.Vector3[0].z));e.updateFloat("vGeometryThickness",this.geometryThickness*b)}}bindForSubMesh(e,t,a){const C=this.getScene(),b=a.materialDefines;if(!b)return;const F=a.effect;if(!F)return;this._activeEffect=F,t.getMeshUniformBuffer().bindToEffect(F,"Mesh"),t.transferToEffect(e);const O=C.getEngine();this._uniformBuffer.bindToEffect(F,"Material"),this.prePassConfiguration.bindForSubMesh(this._activeEffect,C,t,e,this.isFrozen),Ut.Bind(O.currentRenderPassId,this._activeEffect,t,e,this);const ge=C.activeCamera;ge?this._uniformBuffer.updateFloat4("cameraInfo",ge.minZ,ge.maxZ,0,0):this._uniformBuffer.updateFloat4("cameraInfo",0,0,0,0);const de=this.textureRepetitionHexTilingParams;this._uniformBuffer.updateFloat4("vTextureRepetitionHexTilingParams",de[0],de[1],de[2],de[3]),this._eventInfo.subMesh=a,this._callbackPluginEventHardBindForSubMesh(this._eventInfo),b.OBJECTSPACE_NORMALMAP&&(e.toNormalMatrix(this._normalMatrix),this.bindOnlyNormalMatrix(this._normalMatrix));const w=this._mustRebind(C,F,a,t.visibility),B=O._features.needToAlwaysBindUniformBuffers;ro(t,this._activeEffect,this.prePassConfiguration),this._vertexPullingMetadata&&ao(this._activeEffect,this._vertexPullingMetadata);const S=this._uniformBuffer;if(w){this.bindViewProjection(F);const re=this._getRadianceTexture();if(!S.useUbo||!this.isFrozen||!S.isSync||a._drawWrapper._forceRebindOnNextCall){if(C.texturesEnabled){for(const K in this._samplersList){const me=this._samplersList[K];me.value&&(S.updateFloat2(me.samplerInfoName,me.value.coordinatesIndex,me.value.level),no(me.value,S,me.samplerPrefix))}(this.geometryNormalTexture||this.geometryCoatNormalTexture)&&(C._mirroredCameraPosition?S.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?1:-1,this._invertNormalMapY?1:-1):S.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?-1:1,this._invertNormalMapY?-1:1)),lo(C,b,S,Re.White(),re,this.realTimeFiltering,!0,!0,!0,!0,!0)}this.pointsCloud&&S.updateFloat("pointSize",this.pointSize);const H=this._uniformsArray;for(let K=0,me=H.length;K<me;K++){const ee=H[K];ee.requiredDefine!==void 0&&!b[ee.requiredDefine]||(ee.numComponents===4?(ee.populateVectorFromLinkedProperties(pe.Vector4[0]),S.updateVector4(ee.name,pe.Vector4[0])):ee.numComponents===3?(ee.populateVectorFromLinkedProperties(pe.Vector3[0]),S.updateVector3(ee.name,pe.Vector3[0])):ee.numComponents===2?(ee.populateVectorFromLinkedProperties(pe.Vector2[0]),S.updateFloat2(ee.name,pe.Vector2[0].x,pe.Vector2[0].y)):ee.numComponents===1&&S.updateFloat(ee.name,ee.linkedProperties[ee.firstLinkedKey].value))}this._lightingInfos.x=this.directIntensity,this._lightingInfos.y=this.emissionLuminance,this._lightingInfos.z=this.environmentIntensity*C.environmentIntensity,this._lightingInfos.w=1,S.updateVector4("vLightingIntensity",this._lightingInfos),S.updateFloat2("vDebugMode",this.debugLimit,this.debugFactor)}if(C.texturesEnabled){for(const H in this._samplersList){const K=this._samplersList[H];K.value&&S.setTexture(K.samplerName,K.value)}if(oo(C,b,S,re,this.realTimeFiltering),b.ENVIRONMENTBRDF&&S.setTexture("environmentBrdfSampler",this._environmentBRDFTexture),b.FUZZENVIRONMENTBRDF&&S.setTexture("environmentFuzzBrdfSampler",this._environmentFuzzBRDFTexture),b.REFRACTED_BACKGROUND&&(S.setTexture("backgroundRefractionSampler",this._backgroundRefractionTexture),S.updateMatrix("backgroundRefractionMatrix",this._backgroundRefractionTexture.getReflectionTextureMatrix()),pe.Vector3[1].set(Math.log2(this._backgroundRefractionTexture.getSize().width),0,0),S.updateVector3("vBackgroundRefractionInfos",pe.Vector3[1])),(b.ANISOTROPIC||b.FUZZ||b.REFRACTED_BACKGROUND||b.USE_IRRADIANCE_TEXTURE_FOR_SCATTERING)&&S.setTexture("blueNoiseSampler",r._noiseTextures[this.getScene().uniqueId]),b.USE_IRRADIANCE_TEXTURE_FOR_SCATTERING&&this.sssIrradianceTexture&&this.sssDepthTexture){const H=this.sssIrradianceTexture.getSize().width,K=this.sssIrradianceTexture.getSize().height;S.setTexture("sceneIrradianceSampler",this.sssIrradianceTexture),S.setTexture("sceneDepthSampler",this.sssDepthTexture),S.updateFloat2("renderTargetSize",H,K)}}this.getScene().useOrderIndependentTransparency&&this.needAlphaBlendingForMesh(t)&&this.getScene().depthPeelingRenderer.bind(F),this._eventInfo.subMesh=a,this._callbackPluginEventBindForSubMesh(this._eventInfo),Wl(this._activeEffect,this,C),this.bindEyePosition(F)}else B&&(this._needToBindSceneUbo=!0);this.bindPropertiesForSubMesh(this._uniformBuffer,C,C.getEngine(),a),(w||!this.isFrozen||B)&&C.lightsEnabled&&!this._disableLighting&&uo(C,t,this._activeEffect,b,this._maxSimultaneousLights),(w||!this.isFrozen)&&(this.bindView(F),ho(C,t,this._activeEffect,!0),b.NUM_MORPH_INFLUENCERS&&wl(t,this._activeEffect),b.BAKED_VERTEX_ANIMATION_TEXTURE&&t.bakedVertexAnimationManager?.bind(F,b.INSTANCES),this._imageProcessingConfiguration.bind(this._activeEffect),co(b,this._activeEffect,C)),this._afterBind(t,this._activeEffect,a),S.update()}getAnimatables(){const e=super.getAnimatables();for(const t in this._samplersList){const a=this._samplersList[t];a.value&&a.value.animations&&a.value.animations.length>0&&e.push(a.value)}return this._radianceTexture&&this._radianceTexture.animations&&this._radianceTexture.animations.length>0&&e.push(this._radianceTexture),e}getActiveTextures(){const e=super.getActiveTextures();for(const t in this._samplersList){const a=this._samplersList[t];a.value&&e.push(a.value)}return this._radianceTexture&&e.push(this._radianceTexture),e}hasTexture(e){if(super.hasTexture(e))return!0;for(const t in this._samplersList)if(this._samplersList[t].value===e)return!0;return this._radianceTexture===e}setPrePassRenderer(){return!1}dispose(e,t){if(this._breakShaderLoadedCheck=!0,t){this._environmentBRDFTexture&&this.getScene().openPBREnvironmentBRDFTexture!==this._environmentBRDFTexture&&this._environmentBRDFTexture.dispose(),this._environmentFuzzBRDFTexture&&this.getScene().environmentFuzzBRDFTexture!==this._environmentFuzzBRDFTexture&&this._environmentFuzzBRDFTexture.dispose(),this._backgroundRefractionTexture=null;for(const a in this._samplersList)this._samplersList[a].value?.dispose();this._radianceTexture?.dispose()}this._renderTargets.dispose(),this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),super.dispose(e,t)}_getRadianceTexture(){return this._radianceTexture?this._radianceTexture:this.getScene().environmentTexture}_prepareEffect(e,t,a,C=null,b=null,F=null,O=null){if(this._prepareDefines(e,t,a,F,O),!a.isDirty)return null;a.markAsProcessed();const de=this.getScene().getEngine(),w=new _o;let B=0;a.USESPHERICALINVERTEX&&w.addFallback(B++,"USESPHERICALINVERTEX"),a.FOG&&w.addFallback(B,"FOG"),a.SPECULARAA&&w.addFallback(B,"SPECULARAA"),a.POINTSIZE&&w.addFallback(B,"POINTSIZE"),a.LOGARITHMICDEPTH&&w.addFallback(B,"LOGARITHMICDEPTH"),a.PARALLAX&&w.addFallback(B,"PARALLAX"),a.PARALLAX_RHS&&w.addFallback(B,"PARALLAX_RHS"),a.PARALLAXOCCLUSION&&w.addFallback(B++,"PARALLAXOCCLUSION"),a.ENVIRONMENTBRDF&&w.addFallback(B++,"ENVIRONMENTBRDF"),a.TANGENT&&w.addFallback(B++,"TANGENT"),B=fo(a,w,this._maxSimultaneousLights,B),a.SPECULARTERM&&w.addFallback(B++,"SPECULARTERM"),a.USESPHERICALFROMREFLECTIONMAP&&w.addFallback(B++,"USESPHERICALFROMREFLECTIONMAP"),a.USEIRRADIANCEMAP&&w.addFallback(B++,"USEIRRADIANCEMAP"),a.NORMAL&&w.addFallback(B++,"NORMAL"),a.VERTEXCOLOR&&w.addFallback(B++,"VERTEXCOLOR"),a.MORPHTARGETS&&w.addFallback(B++,"MORPHTARGETS"),a.MULTIVIEW&&w.addFallback(0,"MULTIVIEW");const S=[$.PositionKind];a.NORMAL&&S.push($.NormalKind),a.TANGENT&&S.push($.TangentKind);for(let xe=1;xe<=6;++xe)a["UV"+xe]&&S.push(`uv${xe===1?"":xe}`);a.VERTEXCOLOR&&S.push($.ColorKind),To(S,e,a,w),go(S,a),mo(S,e,a),po(S,e,a);let re="openpbr";const H=["world","view","viewProjection","projection","vEyePosition","inverseProjection","renderTargetSize","vLightsType","visibility","vFogInfos","vFogColor","pointSize","mBones","normalMatrix","vLightingIntensity","logarithmicDepthConstant","vTangentSpaceParams","boneTextureInfo","vDebugMode","morphTargetTextureInfo","morphTargetTextureIndices","cameraInfo","vTextureRepetitionHexTilingParams","backgroundRefractionMatrix","vBackgroundRefractionInfos"];for(const xe in this._uniformsList)H.push(xe);const K=["environmentBrdfSampler","boneSampler","morphTargets","oitDepthSampler","oitFrontColorSampler","areaLightsLTC1Sampler","areaLightsLTC2Sampler"];a.FUZZENVIRONMENTBRDF&&K.push("environmentFuzzBrdfSampler"),a.REFRACTED_BACKGROUND&&K.push("backgroundRefractionSampler"),(a.ANISOTROPIC||a.FUZZ||a.REFRACTED_BACKGROUND||a.USE_IRRADIANCE_TEXTURE_FOR_SCATTERING)&&K.push("blueNoiseSampler"),a.USE_IRRADIANCE_TEXTURE_FOR_SCATTERING&&(K.push("sceneIrradianceSampler"),K.push("sceneDepthSampler"));for(const xe in this._samplersList){const Bt=this._samplersList[xe];K.push(Bt.samplerName),H.push(Bt.samplerInfoName),H.push(Bt.samplerMatrixName)}xo(H,K,!0);const me=["Material","Scene","Mesh"],ee={maxSimultaneousLights:this._maxSimultaneousLights,maxSimultaneousMorphTargets:a.NUM_MORPH_INFLUENCERS};if(this._eventInfo.fallbacks=w,this._eventInfo.fallbackRank=B,this._eventInfo.defines=a,this._eventInfo.uniforms=H,this._eventInfo.attributes=S,this._eventInfo.samplers=K,this._eventInfo.uniformBuffersNames=me,this._eventInfo.customCode=void 0,this._eventInfo.mesh=e,this._eventInfo.indexParameters=ee,this._callbackPluginEventGeneric(128,this._eventInfo),Ut.AddUniformsAndSamplers(H,K),Dl.AddUniforms(H),Ro(H),this._useVertexPulling){const xe=t?.geometry;xe&&(this._vertexPullingMetadata=Ao(xe),this._vertexPullingMetadata&&this._vertexPullingMetadata.forEach((Bt,Yl)=>{H.push(`vp_${Yl}_info`)}))}else this._vertexPullingMetadata=null;Wt&&(Wt.PrepareUniforms(H,a),Wt.PrepareSamplers(K,a)),Eo({uniformsNames:H,uniformBuffersNames:me,samplers:K,defines:a,maxSimultaneousLights:this._maxSimultaneousLights,shaderLanguage:this._shaderLanguage});const Fl={};this.customShaderNameResolve&&(re=this.customShaderNameResolve(re,H,me,K,a,S,Fl));const Vl=a.toString(),Xl=de.createEffect(re,{attributes:S,uniformsNames:H,uniformBuffersNames:me,samplers:K,defines:Vl,fallbacks:w,onCompiled:C,onError:b,indexParameters:ee,processFinalCode:Fl.processFinalCode,processCodeAfterIncludes:this._eventInfo.customCode,multiTarget:a.PREPASS,shaderLanguage:this._shaderLanguage,extraInitializationsAsync:this._shadersLoaded?void 0:async()=>{this.shaderLanguage===1?await Promise.all([be(()=>import("./openpbr.vertex-CHESW3gB.js"),__vite__mapDeps([19,1,2,4,20,21,22,23,12,14,3,6,5,24,25]),import.meta.url),be(()=>import("./openpbr.fragment-Dv6qTVVi.js"),__vite__mapDeps([26,1,2,27,4,20,21,23,28,11,13,9,25,29,12,6,14,15]),import.meta.url)]):await Promise.all([be(()=>import("./openpbr.vertex-Bn2wrdGL.js"),__vite__mapDeps([30,1,2,31]),import.meta.url),be(()=>import("./openpbr.fragment-DPJPqi6p.js"),__vite__mapDeps([32,1,2,18,31]),import.meta.url)]),this._shadersLoaded=!0}},de);return this._eventInfo.customCode=void 0,Xl}_prepareDefines(e,t,a,C=null,b=null){const F=t.hasThinInstances,O=this.getScene(),ge=O.getEngine();So(O,e,a,!0,this._maxSimultaneousLights,this._disableLighting),a._needNormals=!0,Mo(O,a);const de=this.needAlphaBlendingForMesh(e)&&this.getScene().useOrderIndependentTransparency;if(Io(O,a,this.canRenderToMRT&&!de),bo(O,a,de),Ut.PrepareDefines(ge.currentRenderPassId,e,a),a._areTexturesDirty){a._needUVs=!1;for(let B=1;B<=6;++B)a["MAINUV"+B]=!1;if(O.texturesEnabled){for(const re in this._samplersList){const H=this._samplersList[re];H.value?(yo(H.value,a,H.textureDefine),a[H.textureDefine+"_GAMMA"]=H.value.gammaSpace):a[H.textureDefine]=!1}const B=this._getRadianceTexture(),S=this._forceIrradianceInFragment||this.realTimeFiltering||this._twoSidedLighting||ge.getCaps().maxVaryingVectors<=8||this._baseDiffuseRoughnessTexture!=null;if(Ul(O,B,a,this.realTimeFiltering,this.realTimeFilteringQuality,!S),this._baseMetalnessTexture&&(a.AOSTOREINMETALMAPRED=this._useAmbientOcclusionFromMetallicTextureRed),a.SPECULAR_WEIGHT_IN_ALPHA=this._useSpecularWeightFromAlpha,a.SPECULAR_WEIGHT_FROM_SPECULAR_COLOR_TEXTURE=this._useSpecularWeightFromSpecularColorTexture,a.SPECULAR_ROUGHNESS_ANISOTROPY_FROM_TANGENT_TEXTURE=this._useSpecularRoughnessAnisotropyFromTangentTexture,a.COAT_ROUGHNESS_ANISOTROPY_FROM_TANGENT_TEXTURE=this._useCoatRoughnessAnisotropyFromTangentTexture,a.COAT_ROUGHNESS_FROM_GREEN_CHANNEL=this._useCoatRoughnessFromGreenChannel,a.SPECULAR_ROUGHNESS_FROM_METALNESS_TEXTURE_GREEN=this._useRoughnessFromMetallicTextureGreen,a.FUZZ_ROUGHNESS_FROM_TEXTURE_ALPHA=this._useFuzzRoughnessFromTextureAlpha,a.SUBSURFACE_WEIGHT_FROM_TEXTURE_ALPHA=this._useSubsurfaceWeightFromTextureAlpha,a.BASE_METALNESS_FROM_METALNESS_TEXTURE_BLUE=this._useMetallicFromMetallicTextureBlue,a.THIN_FILM_THICKNESS_FROM_THIN_FILM_TEXTURE=this._useThinFilmThicknessFromTextureGreen,a.GEOMETRY_THICKNESS_FROM_GREEN_CHANNEL=this._useGeometryThicknessFromGreenChannel,this.geometryNormalTexture?(this._useParallax&&this.baseColorTexture&&ae.DiffuseTextureEnabled?(a.PARALLAX=!0,a.PARALLAX_RHS=O.useRightHandedSystem,a.PARALLAXOCCLUSION=!!this._useParallaxOcclusion):a.PARALLAX=!1,a.OBJECTSPACE_NORMALMAP=this._useObjectSpaceNormalMap):(a.PARALLAX=!1,a.PARALLAX_RHS=!1,a.PARALLAXOCCLUSION=!1,a.OBJECTSPACE_NORMALMAP=!1),this._environmentBRDFTexture&&ae.ReflectionTextureEnabled?(a.ENVIRONMENTBRDF=!0,a.ENVIRONMENTBRDF_RGBD=this._environmentBRDFTexture.isRGBD):(a.ENVIRONMENTBRDF=!1,a.ENVIRONMENTBRDF_RGBD=!1),this._environmentFuzzBRDFTexture?a.FUZZENVIRONMENTBRDF=!0:a.FUZZENVIRONMENTBRDF=!1,this.hasTransparency){a.REFRACTED_BACKGROUND=!!this._backgroundRefractionTexture&&ae.RefractionTextureEnabled,a.REFRACTION_HIGH_QUALITY_BLUR=this._refractionHighQualityBlur,a.REFRACTED_LIGHTS=!0;const re=this._getRadianceTexture();re?(a.REFRACTED_ENVIRONMENT=ae.RefractionTextureEnabled,a.REFRACTED_ENVIRONMENT_OPPOSITEZ=this.getScene().useRightHandedSystem?!re.invertZ:re.invertZ,a.REFRACTED_ENVIRONMENT_LOCAL_CUBE=re.isCube&&re.boundingBoxSize):a.REFRACTED_ENVIRONMENT=!1}else a.REFRACTED_BACKGROUND=!1,a.REFRACTED_LIGHTS=!1,a.REFRACTED_ENVIRONMENT=!1;this._shouldUseAlphaFromBaseColorTexture()?a.ALPHA_FROM_BASE_COLOR_TEXTURE=!0:a.ALPHA_FROM_BASE_COLOR_TEXTURE=!1}this._lightFalloff===ne.LIGHTFALLOFF_STANDARD?(a.USEPHYSICALLIGHTFALLOFF=!1,a.USEGLTFLIGHTFALLOFF=!1):this._lightFalloff===ne.LIGHTFALLOFF_GLTF?(a.USEPHYSICALLIGHTFALLOFF=!1,a.USEGLTFLIGHTFALLOFF=!0):(a.USEPHYSICALLIGHTFALLOFF=!0,a.USEGLTFLIGHTFALLOFF=!1),!this.backFaceCulling&&this._twoSidedLighting?a.TWOSIDEDLIGHTING=!0:a.TWOSIDEDLIGHTING=!1,a.MIRRORED=!!O._mirroredCameraPosition,a.SPECULARAA=ge.getCaps().standardDerivatives&&this._enableSpecularAntiAliasing}(a._areTexturesDirty||a._areMiscDirty)&&(a.ALPHATESTVALUE=`${this._alphaCutOff}${this._alphaCutOff%1===0?".":""}`,a.PREMULTIPLYALPHA=this.alphaMode===7||this.alphaMode===8,a.ALPHABLEND=this.needAlphaBlendingForMesh(e)),a._areTexturesDirty&&(a.TEXTURE_REPETITION_MODE=ge.version>1||ge.isWebGPU?this.textureRepetitionMode:0),a._areImageProcessingDirty&&this._imageProcessingConfiguration&&this._imageProcessingConfiguration.prepareDefines(a),a.FORCENORMALFORWARD=this._forceNormalForward,a.RADIANCEOCCLUSION=this._useRadianceOcclusion,a.HORIZONOCCLUSION=this._useHorizonOcclusion,(this.specularRoughnessAnisotropy>0||this.coatRoughnessAnisotropy>0)&&r._noiseTextures[O.uniqueId]&&ae.ReflectionTextureEnabled?(a.ANISOTROPIC=!0,e.isVerticesDataPresent($.TangentKind)||(a._needUVs=!0,a.MAINUV1=!0),this._useGltfStyleAnisotropy&&(a.USE_GLTF_STYLE_ANISOTROPY=!0),a.ANISOTROPIC_BASE=this.specularRoughnessAnisotropy>0,a.ANISOTROPIC_COAT=this.coatRoughnessAnisotropy>0):(a.ANISOTROPIC=!1,a.USE_GLTF_STYLE_ANISOTROPY=!1,a.ANISOTROPIC_BASE=!1,a.ANISOTROPIC_COAT=!1),a.THIN_FILM=this.thinFilmWeight>0,a.IRIDESCENCE=this.thinFilmWeight>0,a.DISPERSION=this.transmissionDispersionScale>0,a.SCATTERING=this.hasScattering;const w=[8,16,32];if(a.SSS_SAMPLE_COUNT=w[this._sssQuality]??16,a.TRANSMISSION_SLAB=this.transmissionWeight>0,a.TRANSMISSION_SLAB_VOLUME=this.transmissionWeight>0&&this.transmissionDepth>0,a.SUBSURFACE_SLAB=this.subsurfaceWeight>0,!a.PREPASS&&(a.SUBSURFACE_SLAB||a.TRANSMISSION_SLAB_VOLUME)){let B=!1;if(!this.sssIrradianceTexture&&O.geometryBufferRenderer){const S=O.geometryBufferRenderer.getTextureIndex(D.IRRADIANCE_TEXTURE_TYPE);this.sssIrradianceTexture=O.geometryBufferRenderer.getGBuffer().textures[S],B=!0}if(!this.sssDepthTexture&&O.geometryBufferRenderer){const S=O.geometryBufferRenderer.getTextureIndex(D.SCREENSPACE_DEPTH_TEXTURE_TYPE);this.sssDepthTexture=O.geometryBufferRenderer.getGBuffer().textures[S],B=!0}this.sssIrradianceTexture&&this.sssDepthTexture&&(a.USE_IRRADIANCE_TEXTURE_FOR_SCATTERING=!0,B&&(a.USE_IRRADIANCE_TEXTURE_FOR_SCATTERING_GBUFFER=!0))}a.FUZZ=this.fuzzWeight>0&&ae.ReflectionTextureEnabled,a.GEOMETRY_THIN_WALLED=this.geometryThinWalled!=0,a.FUZZ?(e.isVerticesDataPresent($.TangentKind)||(a._needUVs=!0,a.MAINUV1=!0),this._environmentFuzzBRDFTexture=Nl(this.getScene()),a.FUZZ_IBL_SAMPLES=this.fuzzSampleNumber):(this._environmentFuzzBRDFTexture=null,a.FUZZENVIRONMENTBRDF=!1,a.FUZZ_IBL_SAMPLES=0),a._areMiscDirty&&(Oo(e,O,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this.needAlphaTestingForMesh(e),a,this._applyDecalMapAfterDetailMap,this._useVertexPulling,t,this._isVertexOutputInvariant),a.UNLIT=this._unlit||(this.pointsCloud||this.wireframe)&&!e.isVerticesDataPresent($.NormalKind),a.DEBUGMODE=this._debugMode),Co(O,ge,this,a,!!C,b,F),this._eventInfo.defines=a,this._eventInfo.mesh=e,this._callbackPluginEventPrepareDefinesBeforeAttributes(this._eventInfo),Fo(e,a,!0,!0,!0,this._transparencyMode!==ne.MATERIAL_OPAQUE),this._callbackPluginEventPrepareDefines(this._eventInfo)}},s=new WeakMap,o=new WeakMap,l=new WeakMap,n=new WeakMap,m=new WeakMap,d=new WeakMap,I=new WeakMap,k=new WeakMap,U=new WeakMap,M=new WeakMap,N=new WeakMap,J=new WeakMap,se=new WeakMap,_e=new WeakMap,te=new WeakMap,v=new WeakMap,x=new WeakMap,A=new WeakMap,W=new WeakMap,G=new WeakMap,y=new WeakMap,T=new WeakMap,le=new WeakMap,ie=new WeakMap,V=new WeakMap,g=new WeakMap,f=new WeakMap,fe=new WeakMap,oe=new WeakMap,R=new WeakMap,ue=new WeakMap,E=new WeakMap,Q=new WeakMap,P=new WeakMap,he=new WeakMap,q=new WeakMap,Te=new WeakMap,ce=new WeakMap,j=new WeakMap,ye=new WeakMap,Oe=new WeakMap,Ce=new WeakMap,Fe=new WeakMap,Z=new WeakMap,Ee=new WeakMap,Se=new WeakMap,Me=new WeakMap,Ie=new WeakMap,ke=new WeakMap,Be=new WeakMap,ze=new WeakMap,Ue=new WeakMap,We=new WeakMap,we=new WeakMap,Ge=new WeakMap,He=new WeakMap,Ve=new WeakMap,Xe=new WeakMap,Ye=new WeakMap,Ze=new WeakMap,Ke=new WeakMap,je=new WeakMap,Qe=new WeakMap,qe=new WeakMap,$e=new WeakMap,Je=new WeakMap,et=new WeakMap,tt=new WeakMap,st=new WeakMap,it=new WeakMap,rt=new WeakMap,at=new WeakMap,nt=new WeakMap,lt=new WeakMap,ot=new WeakMap,ut=new WeakMap,ht=new WeakMap,ct=new WeakMap,_t=new WeakMap,ft=new WeakMap,Tt=new WeakMap,gt=new WeakMap,mt=new WeakMap,pt=new WeakMap,dt=new WeakMap,xt=new WeakMap,Rt=new WeakMap,At=new WeakMap,Et=new WeakMap,St=new WeakMap,Mt=new WeakMap,It=new WeakMap,bt=new WeakMap,yt=new WeakMap,Ot=new WeakMap,Ct=new WeakMap,Ft=new WeakMap,Lt=new WeakMap,Dt=new WeakMap,Pt=new WeakMap,Nt=new WeakMap,vt=new WeakMap,(()=>{const u=typeof Symbol=="function"&&Symbol.metadata?Object.create(Ht[Symbol.metadata]??null):void 0;Vt=[p("_markAllSubMeshesAsTexturesDirty")],Zt=[p("_markAllSubMeshesAsTexturesDirty")],Qt=[p("_markAllSubMeshesAsTexturesDirty")],Jt=[p("_markAllSubMeshesAsTexturesDirty")],ss=[p("_markAllSubMeshesAsTexturesDirty")],as=[p("_markAllSubMeshesAsTexturesDirty")],os=[p("_markAllSubMeshesAsTexturesDirty")],cs=[p("_markAllSubMeshesAsTexturesDirty")],Ts=[p("_markAllSubMeshesAsTexturesDirty")],ps=[p("_markAllSubMeshesAsTexturesDirty")],Rs=[p("_markAllSubMeshesAsTexturesDirty")],Ss=[p("_markAllSubMeshesAsTexturesDirty")],bs=[p("_markAllSubMeshesAsTexturesDirty")],Cs=[p("_markAllSubMeshesAsTexturesDirty")],Ds=[p("_markAllSubMeshesAsTexturesDirty")],vs=[p("_markAllSubMeshesAsTexturesDirty")],zs=[p("_markAllSubMeshesAsTexturesDirty")],ws=[p("_markAllSubMeshesAsTexturesDirty")],Vs=[p("_markAllSubMeshesAsTexturesDirty")],Zs=[p("_markAllSubMeshesAsTexturesDirty")],Qs=[p("_markAllSubMeshesAsTexturesDirty")],Js=[p("_markAllSubMeshesAsTexturesDirty")],si=[p("_markAllSubMeshesAsTexturesDirty")],ai=[p("_markAllSubMeshesAsTexturesDirty")],oi=[p("_markAllSubMeshesAsTexturesDirty")],ci=[p("_markAllSubMeshesAsTexturesDirty")],Ti=[p("_markAllSubMeshesAsTexturesDirty")],pi=[p("_markAllSubMeshesAsTexturesDirty")],Ri=[p("_markAllSubMeshesAsTexturesDirty")],Si=[p("_markAllSubMeshesAsTexturesDirty")],bi=[p("_markAllSubMeshesAsTexturesDirty")],Ci=[p("_markAllSubMeshesAsTexturesDirty")],Di=[p("_markAllSubMeshesAsTexturesDirty")],vi=[p("_markAllSubMeshesAsTexturesDirty")],zi=[p("_markAllSubMeshesAsTexturesDirty")],wi=[p("_markAllSubMeshesAsTexturesDirty")],Vi=[p("_markAllSubMeshesAsTexturesDirty")],Zi=[p("_markAllSubMeshesAsTexturesDirty")],Qi=[p("_markAllSubMeshesAsTexturesDirty")],Ji=[p("_markAllSubMeshesAsTexturesDirty")],sr=[p("_markAllSubMeshesAsTexturesDirty")],ar=[p("_markAllSubMeshesAsTexturesDirty")],or=[p("_markAllSubMeshesAsTexturesDirty")],cr=[p("_markAllSubMeshesAsTexturesDirty")],Tr=[p("_markAllSubMeshesAsTexturesDirty")],pr=[p("_markAllSubMeshesAsTexturesDirty")],Rr=[p("_markAllSubMeshesAsTexturesDirty")],Sr=[p("_markAllSubMeshesAsTexturesDirty")],br=[p("_markAllSubMeshesAsTexturesDirty")],Cr=[p("_markAllSubMeshesAsTexturesDirty")],Dr=[p("_markAllSubMeshesAsTexturesDirty")],vr=[p("_markAllSubMeshesAsTexturesDirty")],zr=[p("_markAllSubMeshesAsTexturesDirty")],wr=[p("_markAllSubMeshesAsTexturesDirty")],Vr=[p("_markAllSubMeshesAsTexturesDirty")],Zr=[p("_markAllSubMeshesAsTexturesDirty")],Qr=[p("_markAllSubMeshesAsTexturesDirty")],Jr=[p("_markAllSubMeshesAsTexturesDirty")],sa=[p("_markAllSubMeshesAsTexturesDirty")],aa=[p("_markAllSubMeshesAsTexturesDirty")],oa=[p("_markAllSubMeshesAsTexturesDirty")],ca=[p("_markAllSubMeshesAsTexturesDirty")],Ta=[p("_markAllSubMeshesAsTexturesDirty")],pa=[p("_markAllSubMeshesAsTexturesDirty")],Ra=[p("_markAllSubMeshesAsTexturesDirty")],Sa=[p("_markAllSubMeshesAsTexturesDirty")],ba=[p("_markAllSubMeshesAsTexturesDirty")],Ca=[p("_markAllSubMeshesAsTexturesDirty")],Da=[p("_markAllSubMeshesAsTexturesDirty")],va=[p("_markAllSubMeshesAsTexturesDirty")],za=[p("_markAllSubMeshesAsTexturesDirty")],wa=[p("_markAllSubMeshesAsTexturesDirty")],Va=[p("_markAllSubMeshesAsTexturesDirty")],Za=[p("_markAllSubMeshesAsTexturesDirty")],Qa=[p("_markAllSubMeshesAsTexturesDirty")],Ja=[X(),Y("_markAllSubMeshesAsTexturesDirty")],sn=[X(),Y("_markAllSubMeshesAsTexturesDirty")],nn=[X(),Y("_markAllSubMeshesAsTexturesDirty")],un=[X(),Y("_markAllSubMeshesAsTexturesAndMiscDirty")],_n=[X(),Y("_markAllSubMeshesAsTexturesAndMiscDirty")],gn=[X(),Y("_markAllSubMeshesAsTexturesDirty")],dn=[X(),Y("_markAllSubMeshesAsTexturesDirty")],An=[X()],En=[X()],Sn=[X(),Y("_markAllSubMeshesAsTexturesDirty")],bn=[X(),Y("_markAllSubMeshesAsTexturesDirty")],Cn=[X(),Y("_markAllSubMeshesAsTexturesDirty")],Dn=[X(),Y("_markAllSubMeshesAsTexturesDirty")],vn=[X(),Y("_markAllSubMeshesAsLightsDirty")],zn=[X(),Y("_markAllSubMeshesAsTexturesDirty")],wn=[X(),Y("_markAllSubMeshesAsLightsDirty")],Vn=[X(),Y("_markAllSubMeshesAsTexturesDirty")],Zn=[X(),Y("_markAllSubMeshesAsTexturesDirty")],Qn=[X(),Y("_markAllSubMeshesAsTexturesDirty")],Jn=[X(),Y("_markAllSubMeshesAsTexturesDirty")],sl=[X(),Y("_markAllSubMeshesAsTexturesDirty")],al=[Y("_markAllSubMeshesAsTexturesDirty")],ol=[X(),Y("_markAllSubMeshesAsTexturesDirty")],cl=[X(),Y("_markAllSubMeshesAsTexturesDirty")],Tl=[X(),Y("_markAllSubMeshesAsTexturesDirty")],pl=[X(),Y("_markAllSubMeshesAsTexturesDirty")],Rl=[X(),Y("_markAllSubMeshesAsMiscDirty")],Sl=[X(),Y("_markAllSubMeshesAsMiscDirty")],bl=[Y("_markAllSubMeshesAsMiscDirty")],Cl=[X()],h(r,null,Vt,{kind:"accessor",name:"baseWeight",static:!1,private:!1,access:{has:e=>"baseWeight"in e,get:e=>e.baseWeight,set:(e,t)=>{e.baseWeight=t}},metadata:u},Xt,Yt),h(r,null,Zt,{kind:"accessor",name:"baseWeightTexture",static:!1,private:!1,access:{has:e=>"baseWeightTexture"in e,get:e=>e.baseWeightTexture,set:(e,t)=>{e.baseWeightTexture=t}},metadata:u},Kt,jt),h(r,null,Qt,{kind:"accessor",name:"baseColor",static:!1,private:!1,access:{has:e=>"baseColor"in e,get:e=>e.baseColor,set:(e,t)=>{e.baseColor=t}},metadata:u},qt,$t),h(r,null,Jt,{kind:"accessor",name:"baseColorTexture",static:!1,private:!1,access:{has:e=>"baseColorTexture"in e,get:e=>e.baseColorTexture,set:(e,t)=>{e.baseColorTexture=t}},metadata:u},es,ts),h(r,null,ss,{kind:"accessor",name:"baseDiffuseRoughness",static:!1,private:!1,access:{has:e=>"baseDiffuseRoughness"in e,get:e=>e.baseDiffuseRoughness,set:(e,t)=>{e.baseDiffuseRoughness=t}},metadata:u},is,rs),h(r,null,as,{kind:"accessor",name:"baseDiffuseRoughnessTexture",static:!1,private:!1,access:{has:e=>"baseDiffuseRoughnessTexture"in e,get:e=>e.baseDiffuseRoughnessTexture,set:(e,t)=>{e.baseDiffuseRoughnessTexture=t}},metadata:u},ns,ls),h(r,null,os,{kind:"accessor",name:"baseMetalness",static:!1,private:!1,access:{has:e=>"baseMetalness"in e,get:e=>e.baseMetalness,set:(e,t)=>{e.baseMetalness=t}},metadata:u},us,hs),h(r,null,cs,{kind:"accessor",name:"baseMetalnessTexture",static:!1,private:!1,access:{has:e=>"baseMetalnessTexture"in e,get:e=>e.baseMetalnessTexture,set:(e,t)=>{e.baseMetalnessTexture=t}},metadata:u},_s,fs),h(r,null,Ts,{kind:"accessor",name:"specularWeight",static:!1,private:!1,access:{has:e=>"specularWeight"in e,get:e=>e.specularWeight,set:(e,t)=>{e.specularWeight=t}},metadata:u},gs,ms),h(r,null,ps,{kind:"accessor",name:"specularWeightTexture",static:!1,private:!1,access:{has:e=>"specularWeightTexture"in e,get:e=>e.specularWeightTexture,set:(e,t)=>{e.specularWeightTexture=t}},metadata:u},ds,xs),h(r,null,Rs,{kind:"accessor",name:"specularColor",static:!1,private:!1,access:{has:e=>"specularColor"in e,get:e=>e.specularColor,set:(e,t)=>{e.specularColor=t}},metadata:u},As,Es),h(r,null,Ss,{kind:"accessor",name:"specularColorTexture",static:!1,private:!1,access:{has:e=>"specularColorTexture"in e,get:e=>e.specularColorTexture,set:(e,t)=>{e.specularColorTexture=t}},metadata:u},Ms,Is),h(r,null,bs,{kind:"accessor",name:"specularRoughness",static:!1,private:!1,access:{has:e=>"specularRoughness"in e,get:e=>e.specularRoughness,set:(e,t)=>{e.specularRoughness=t}},metadata:u},ys,Os),h(r,null,Cs,{kind:"accessor",name:"specularRoughnessTexture",static:!1,private:!1,access:{has:e=>"specularRoughnessTexture"in e,get:e=>e.specularRoughnessTexture,set:(e,t)=>{e.specularRoughnessTexture=t}},metadata:u},Fs,Ls),h(r,null,Ds,{kind:"accessor",name:"specularRoughnessAnisotropy",static:!1,private:!1,access:{has:e=>"specularRoughnessAnisotropy"in e,get:e=>e.specularRoughnessAnisotropy,set:(e,t)=>{e.specularRoughnessAnisotropy=t}},metadata:u},Ps,Ns),h(r,null,vs,{kind:"accessor",name:"specularRoughnessAnisotropyTexture",static:!1,private:!1,access:{has:e=>"specularRoughnessAnisotropyTexture"in e,get:e=>e.specularRoughnessAnisotropyTexture,set:(e,t)=>{e.specularRoughnessAnisotropyTexture=t}},metadata:u},ks,Bs),h(r,null,zs,{kind:"accessor",name:"specularIor",static:!1,private:!1,access:{has:e=>"specularIor"in e,get:e=>e.specularIor,set:(e,t)=>{e.specularIor=t}},metadata:u},Us,Ws),h(r,null,ws,{kind:"accessor",name:"transmissionWeight",static:!1,private:!1,access:{has:e=>"transmissionWeight"in e,get:e=>e.transmissionWeight,set:(e,t)=>{e.transmissionWeight=t}},metadata:u},Gs,Hs),h(r,null,Vs,{kind:"accessor",name:"transmissionWeightTexture",static:!1,private:!1,access:{has:e=>"transmissionWeightTexture"in e,get:e=>e.transmissionWeightTexture,set:(e,t)=>{e.transmissionWeightTexture=t}},metadata:u},Xs,Ys),h(r,null,Zs,{kind:"accessor",name:"transmissionColor",static:!1,private:!1,access:{has:e=>"transmissionColor"in e,get:e=>e.transmissionColor,set:(e,t)=>{e.transmissionColor=t}},metadata:u},Ks,js),h(r,null,Qs,{kind:"accessor",name:"transmissionColorTexture",static:!1,private:!1,access:{has:e=>"transmissionColorTexture"in e,get:e=>e.transmissionColorTexture,set:(e,t)=>{e.transmissionColorTexture=t}},metadata:u},qs,$s),h(r,null,Js,{kind:"accessor",name:"transmissionDepth",static:!1,private:!1,access:{has:e=>"transmissionDepth"in e,get:e=>e.transmissionDepth,set:(e,t)=>{e.transmissionDepth=t}},metadata:u},ei,ti),h(r,null,si,{kind:"accessor",name:"transmissionDepthTexture",static:!1,private:!1,access:{has:e=>"transmissionDepthTexture"in e,get:e=>e.transmissionDepthTexture,set:(e,t)=>{e.transmissionDepthTexture=t}},metadata:u},ii,ri),h(r,null,ai,{kind:"accessor",name:"transmissionScatter",static:!1,private:!1,access:{has:e=>"transmissionScatter"in e,get:e=>e.transmissionScatter,set:(e,t)=>{e.transmissionScatter=t}},metadata:u},ni,li),h(r,null,oi,{kind:"accessor",name:"transmissionScatterTexture",static:!1,private:!1,access:{has:e=>"transmissionScatterTexture"in e,get:e=>e.transmissionScatterTexture,set:(e,t)=>{e.transmissionScatterTexture=t}},metadata:u},ui,hi),h(r,null,ci,{kind:"accessor",name:"transmissionScatterAnisotropy",static:!1,private:!1,access:{has:e=>"transmissionScatterAnisotropy"in e,get:e=>e.transmissionScatterAnisotropy,set:(e,t)=>{e.transmissionScatterAnisotropy=t}},metadata:u},_i,fi),h(r,null,Ti,{kind:"accessor",name:"transmissionDispersionScale",static:!1,private:!1,access:{has:e=>"transmissionDispersionScale"in e,get:e=>e.transmissionDispersionScale,set:(e,t)=>{e.transmissionDispersionScale=t}},metadata:u},gi,mi),h(r,null,pi,{kind:"accessor",name:"transmissionDispersionScaleTexture",static:!1,private:!1,access:{has:e=>"transmissionDispersionScaleTexture"in e,get:e=>e.transmissionDispersionScaleTexture,set:(e,t)=>{e.transmissionDispersionScaleTexture=t}},metadata:u},di,xi),h(r,null,Ri,{kind:"accessor",name:"transmissionDispersionAbbeNumber",static:!1,private:!1,access:{has:e=>"transmissionDispersionAbbeNumber"in e,get:e=>e.transmissionDispersionAbbeNumber,set:(e,t)=>{e.transmissionDispersionAbbeNumber=t}},metadata:u},Ai,Ei),h(r,null,Si,{kind:"accessor",name:"subsurfaceWeight",static:!1,private:!1,access:{has:e=>"subsurfaceWeight"in e,get:e=>e.subsurfaceWeight,set:(e,t)=>{e.subsurfaceWeight=t}},metadata:u},Mi,Ii),h(r,null,bi,{kind:"accessor",name:"subsurfaceWeightTexture",static:!1,private:!1,access:{has:e=>"subsurfaceWeightTexture"in e,get:e=>e.subsurfaceWeightTexture,set:(e,t)=>{e.subsurfaceWeightTexture=t}},metadata:u},yi,Oi),h(r,null,Ci,{kind:"accessor",name:"subsurfaceColor",static:!1,private:!1,access:{has:e=>"subsurfaceColor"in e,get:e=>e.subsurfaceColor,set:(e,t)=>{e.subsurfaceColor=t}},metadata:u},Fi,Li),h(r,null,Di,{kind:"accessor",name:"subsurfaceColorTexture",static:!1,private:!1,access:{has:e=>"subsurfaceColorTexture"in e,get:e=>e.subsurfaceColorTexture,set:(e,t)=>{e.subsurfaceColorTexture=t}},metadata:u},Pi,Ni),h(r,null,vi,{kind:"accessor",name:"subsurfaceRadius",static:!1,private:!1,access:{has:e=>"subsurfaceRadius"in e,get:e=>e.subsurfaceRadius,set:(e,t)=>{e.subsurfaceRadius=t}},metadata:u},ki,Bi),h(r,null,zi,{kind:"accessor",name:"subsurfaceRadiusScale",static:!1,private:!1,access:{has:e=>"subsurfaceRadiusScale"in e,get:e=>e.subsurfaceRadiusScale,set:(e,t)=>{e.subsurfaceRadiusScale=t}},metadata:u},Ui,Wi),h(r,null,wi,{kind:"accessor",name:"subsurfaceRadiusScaleTexture",static:!1,private:!1,access:{has:e=>"subsurfaceRadiusScaleTexture"in e,get:e=>e.subsurfaceRadiusScaleTexture,set:(e,t)=>{e.subsurfaceRadiusScaleTexture=t}},metadata:u},Gi,Hi),h(r,null,Vi,{kind:"accessor",name:"subsurfaceScatterAnisotropy",static:!1,private:!1,access:{has:e=>"subsurfaceScatterAnisotropy"in e,get:e=>e.subsurfaceScatterAnisotropy,set:(e,t)=>{e.subsurfaceScatterAnisotropy=t}},metadata:u},Xi,Yi),h(r,null,Zi,{kind:"accessor",name:"coatWeight",static:!1,private:!1,access:{has:e=>"coatWeight"in e,get:e=>e.coatWeight,set:(e,t)=>{e.coatWeight=t}},metadata:u},Ki,ji),h(r,null,Qi,{kind:"accessor",name:"coatWeightTexture",static:!1,private:!1,access:{has:e=>"coatWeightTexture"in e,get:e=>e.coatWeightTexture,set:(e,t)=>{e.coatWeightTexture=t}},metadata:u},qi,$i),h(r,null,Ji,{kind:"accessor",name:"coatColor",static:!1,private:!1,access:{has:e=>"coatColor"in e,get:e=>e.coatColor,set:(e,t)=>{e.coatColor=t}},metadata:u},er,tr),h(r,null,sr,{kind:"accessor",name:"coatColorTexture",static:!1,private:!1,access:{has:e=>"coatColorTexture"in e,get:e=>e.coatColorTexture,set:(e,t)=>{e.coatColorTexture=t}},metadata:u},ir,rr),h(r,null,ar,{kind:"accessor",name:"coatRoughness",static:!1,private:!1,access:{has:e=>"coatRoughness"in e,get:e=>e.coatRoughness,set:(e,t)=>{e.coatRoughness=t}},metadata:u},nr,lr),h(r,null,or,{kind:"accessor",name:"coatRoughnessTexture",static:!1,private:!1,access:{has:e=>"coatRoughnessTexture"in e,get:e=>e.coatRoughnessTexture,set:(e,t)=>{e.coatRoughnessTexture=t}},metadata:u},ur,hr),h(r,null,cr,{kind:"accessor",name:"coatRoughnessAnisotropy",static:!1,private:!1,access:{has:e=>"coatRoughnessAnisotropy"in e,get:e=>e.coatRoughnessAnisotropy,set:(e,t)=>{e.coatRoughnessAnisotropy=t}},metadata:u},_r,fr),h(r,null,Tr,{kind:"accessor",name:"coatRoughnessAnisotropyTexture",static:!1,private:!1,access:{has:e=>"coatRoughnessAnisotropyTexture"in e,get:e=>e.coatRoughnessAnisotropyTexture,set:(e,t)=>{e.coatRoughnessAnisotropyTexture=t}},metadata:u},gr,mr),h(r,null,pr,{kind:"accessor",name:"coatIor",static:!1,private:!1,access:{has:e=>"coatIor"in e,get:e=>e.coatIor,set:(e,t)=>{e.coatIor=t}},metadata:u},dr,xr),h(r,null,Rr,{kind:"accessor",name:"coatDarkening",static:!1,private:!1,access:{has:e=>"coatDarkening"in e,get:e=>e.coatDarkening,set:(e,t)=>{e.coatDarkening=t}},metadata:u},Ar,Er),h(r,null,Sr,{kind:"accessor",name:"coatDarkeningTexture",static:!1,private:!1,access:{has:e=>"coatDarkeningTexture"in e,get:e=>e.coatDarkeningTexture,set:(e,t)=>{e.coatDarkeningTexture=t}},metadata:u},Mr,Ir),h(r,null,br,{kind:"accessor",name:"fuzzWeight",static:!1,private:!1,access:{has:e=>"fuzzWeight"in e,get:e=>e.fuzzWeight,set:(e,t)=>{e.fuzzWeight=t}},metadata:u},yr,Or),h(r,null,Cr,{kind:"accessor",name:"fuzzWeightTexture",static:!1,private:!1,access:{has:e=>"fuzzWeightTexture"in e,get:e=>e.fuzzWeightTexture,set:(e,t)=>{e.fuzzWeightTexture=t}},metadata:u},Fr,Lr),h(r,null,Dr,{kind:"accessor",name:"fuzzColor",static:!1,private:!1,access:{has:e=>"fuzzColor"in e,get:e=>e.fuzzColor,set:(e,t)=>{e.fuzzColor=t}},metadata:u},Pr,Nr),h(r,null,vr,{kind:"accessor",name:"fuzzColorTexture",static:!1,private:!1,access:{has:e=>"fuzzColorTexture"in e,get:e=>e.fuzzColorTexture,set:(e,t)=>{e.fuzzColorTexture=t}},metadata:u},kr,Br),h(r,null,zr,{kind:"accessor",name:"fuzzRoughness",static:!1,private:!1,access:{has:e=>"fuzzRoughness"in e,get:e=>e.fuzzRoughness,set:(e,t)=>{e.fuzzRoughness=t}},metadata:u},Ur,Wr),h(r,null,wr,{kind:"accessor",name:"fuzzRoughnessTexture",static:!1,private:!1,access:{has:e=>"fuzzRoughnessTexture"in e,get:e=>e.fuzzRoughnessTexture,set:(e,t)=>{e.fuzzRoughnessTexture=t}},metadata:u},Gr,Hr),h(r,null,Vr,{kind:"accessor",name:"geometryThinWalled",static:!1,private:!1,access:{has:e=>"geometryThinWalled"in e,get:e=>e.geometryThinWalled,set:(e,t)=>{e.geometryThinWalled=t}},metadata:u},Xr,Yr),h(r,null,Zr,{kind:"accessor",name:"geometryNormalTexture",static:!1,private:!1,access:{has:e=>"geometryNormalTexture"in e,get:e=>e.geometryNormalTexture,set:(e,t)=>{e.geometryNormalTexture=t}},metadata:u},Kr,jr),h(r,null,Qr,{kind:"accessor",name:"geometryTangent",static:!1,private:!1,access:{has:e=>"geometryTangent"in e,get:e=>e.geometryTangent,set:(e,t)=>{e.geometryTangent=t}},metadata:u},qr,$r),h(r,null,Jr,{kind:"accessor",name:"geometryTangentTexture",static:!1,private:!1,access:{has:e=>"geometryTangentTexture"in e,get:e=>e.geometryTangentTexture,set:(e,t)=>{e.geometryTangentTexture=t}},metadata:u},ea,ta),h(r,null,sa,{kind:"accessor",name:"geometryCoatNormalTexture",static:!1,private:!1,access:{has:e=>"geometryCoatNormalTexture"in e,get:e=>e.geometryCoatNormalTexture,set:(e,t)=>{e.geometryCoatNormalTexture=t}},metadata:u},ia,ra),h(r,null,aa,{kind:"accessor",name:"geometryCoatTangent",static:!1,private:!1,access:{has:e=>"geometryCoatTangent"in e,get:e=>e.geometryCoatTangent,set:(e,t)=>{e.geometryCoatTangent=t}},metadata:u},na,la),h(r,null,oa,{kind:"accessor",name:"geometryCoatTangentTexture",static:!1,private:!1,access:{has:e=>"geometryCoatTangentTexture"in e,get:e=>e.geometryCoatTangentTexture,set:(e,t)=>{e.geometryCoatTangentTexture=t}},metadata:u},ua,ha),h(r,null,ca,{kind:"accessor",name:"geometryOpacity",static:!1,private:!1,access:{has:e=>"geometryOpacity"in e,get:e=>e.geometryOpacity,set:(e,t)=>{e.geometryOpacity=t}},metadata:u},_a,fa),h(r,null,Ta,{kind:"accessor",name:"geometryOpacityTexture",static:!1,private:!1,access:{has:e=>"geometryOpacityTexture"in e,get:e=>e.geometryOpacityTexture,set:(e,t)=>{e.geometryOpacityTexture=t}},metadata:u},ga,ma),h(r,null,pa,{kind:"accessor",name:"geometryThickness",static:!1,private:!1,access:{has:e=>"geometryThickness"in e,get:e=>e.geometryThickness,set:(e,t)=>{e.geometryThickness=t}},metadata:u},da,xa),h(r,null,Ra,{kind:"accessor",name:"geometryThicknessTexture",static:!1,private:!1,access:{has:e=>"geometryThicknessTexture"in e,get:e=>e.geometryThicknessTexture,set:(e,t)=>{e.geometryThicknessTexture=t}},metadata:u},Aa,Ea),h(r,null,Sa,{kind:"accessor",name:"emissionLuminance",static:!1,private:!1,access:{has:e=>"emissionLuminance"in e,get:e=>e.emissionLuminance,set:(e,t)=>{e.emissionLuminance=t}},metadata:u},Ma,Ia),h(r,null,ba,{kind:"accessor",name:"emissionColor",static:!1,private:!1,access:{has:e=>"emissionColor"in e,get:e=>e.emissionColor,set:(e,t)=>{e.emissionColor=t}},metadata:u},ya,Oa),h(r,null,Ca,{kind:"accessor",name:"emissionColorTexture",static:!1,private:!1,access:{has:e=>"emissionColorTexture"in e,get:e=>e.emissionColorTexture,set:(e,t)=>{e.emissionColorTexture=t}},metadata:u},Fa,La),h(r,null,Da,{kind:"accessor",name:"thinFilmWeight",static:!1,private:!1,access:{has:e=>"thinFilmWeight"in e,get:e=>e.thinFilmWeight,set:(e,t)=>{e.thinFilmWeight=t}},metadata:u},Pa,Na),h(r,null,va,{kind:"accessor",name:"thinFilmWeightTexture",static:!1,private:!1,access:{has:e=>"thinFilmWeightTexture"in e,get:e=>e.thinFilmWeightTexture,set:(e,t)=>{e.thinFilmWeightTexture=t}},metadata:u},ka,Ba),h(r,null,za,{kind:"accessor",name:"thinFilmThickness",static:!1,private:!1,access:{has:e=>"thinFilmThickness"in e,get:e=>e.thinFilmThickness,set:(e,t)=>{e.thinFilmThickness=t}},metadata:u},Ua,Wa),h(r,null,wa,{kind:"accessor",name:"thinFilmThicknessMin",static:!1,private:!1,access:{has:e=>"thinFilmThicknessMin"in e,get:e=>e.thinFilmThicknessMin,set:(e,t)=>{e.thinFilmThicknessMin=t}},metadata:u},Ga,Ha),h(r,null,Va,{kind:"accessor",name:"thinFilmThicknessTexture",static:!1,private:!1,access:{has:e=>"thinFilmThicknessTexture"in e,get:e=>e.thinFilmThicknessTexture,set:(e,t)=>{e.thinFilmThicknessTexture=t}},metadata:u},Xa,Ya),h(r,null,Za,{kind:"accessor",name:"thinFilmIor",static:!1,private:!1,access:{has:e=>"thinFilmIor"in e,get:e=>e.thinFilmIor,set:(e,t)=>{e.thinFilmIor=t}},metadata:u},Ka,ja),h(r,null,Qa,{kind:"accessor",name:"ambientOcclusionTexture",static:!1,private:!1,access:{has:e=>"ambientOcclusionTexture"in e,get:e=>e.ambientOcclusionTexture,set:(e,t)=>{e.ambientOcclusionTexture=t}},metadata:u},qa,$a),h(r,null,Ja,{kind:"accessor",name:"directIntensity",static:!1,private:!1,access:{has:e=>"directIntensity"in e,get:e=>e.directIntensity,set:(e,t)=>{e.directIntensity=t}},metadata:u},en,tn),h(r,null,sn,{kind:"accessor",name:"environmentIntensity",static:!1,private:!1,access:{has:e=>"environmentIntensity"in e,get:e=>e.environmentIntensity,set:(e,t)=>{e.environmentIntensity=t}},metadata:u},rn,an),h(r,null,nn,{kind:"accessor",name:"useSpecularWeightFromTextureAlpha",static:!1,private:!1,access:{has:e=>"useSpecularWeightFromTextureAlpha"in e,get:e=>e.useSpecularWeightFromTextureAlpha,set:(e,t)=>{e.useSpecularWeightFromTextureAlpha=t}},metadata:u},ln,on),h(r,null,un,{kind:"accessor",name:"forceAlphaTest",static:!1,private:!1,access:{has:e=>"forceAlphaTest"in e,get:e=>e.forceAlphaTest,set:(e,t)=>{e.forceAlphaTest=t}},metadata:u},hn,cn),h(r,null,_n,{kind:"accessor",name:"alphaCutOff",static:!1,private:!1,access:{has:e=>"alphaCutOff"in e,get:e=>e.alphaCutOff,set:(e,t)=>{e.alphaCutOff=t}},metadata:u},fn,Tn),h(r,null,gn,{kind:"accessor",name:"useAmbientOcclusionFromMetallicTextureRed",static:!1,private:!1,access:{has:e=>"useAmbientOcclusionFromMetallicTextureRed"in e,get:e=>e.useAmbientOcclusionFromMetallicTextureRed,set:(e,t)=>{e.useAmbientOcclusionFromMetallicTextureRed=t}},metadata:u},mn,pn),h(r,null,dn,{kind:"accessor",name:"useAmbientInGrayScale",static:!1,private:!1,access:{has:e=>"useAmbientInGrayScale"in e,get:e=>e.useAmbientInGrayScale,set:(e,t)=>{e.useAmbientInGrayScale=t}},metadata:u},xn,Rn),h(r,null,An,{kind:"getter",name:"usePhysicalLightFalloff",static:!1,private:!1,access:{has:e=>"usePhysicalLightFalloff"in e,get:e=>e.usePhysicalLightFalloff},metadata:u},null,kt),h(r,null,En,{kind:"getter",name:"useGLTFLightFalloff",static:!1,private:!1,access:{has:e=>"useGLTFLightFalloff"in e,get:e=>e.useGLTFLightFalloff},metadata:u},null,kt),h(r,null,Sn,{kind:"accessor",name:"useObjectSpaceNormalMap",static:!1,private:!1,access:{has:e=>"useObjectSpaceNormalMap"in e,get:e=>e.useObjectSpaceNormalMap,set:(e,t)=>{e.useObjectSpaceNormalMap=t}},metadata:u},Mn,In),h(r,null,bn,{kind:"accessor",name:"useParallax",static:!1,private:!1,access:{has:e=>"useParallax"in e,get:e=>e.useParallax,set:(e,t)=>{e.useParallax=t}},metadata:u},yn,On),h(r,null,Cn,{kind:"accessor",name:"useParallaxOcclusion",static:!1,private:!1,access:{has:e=>"useParallaxOcclusion"in e,get:e=>e.useParallaxOcclusion,set:(e,t)=>{e.useParallaxOcclusion=t}},metadata:u},Fn,Ln),h(r,null,Dn,{kind:"accessor",name:"parallaxScaleBias",static:!1,private:!1,access:{has:e=>"parallaxScaleBias"in e,get:e=>e.parallaxScaleBias,set:(e,t)=>{e.parallaxScaleBias=t}},metadata:u},Pn,Nn),h(r,null,vn,{kind:"accessor",name:"disableLighting",static:!1,private:!1,access:{has:e=>"disableLighting"in e,get:e=>e.disableLighting,set:(e,t)=>{e.disableLighting=t}},metadata:u},kn,Bn),h(r,null,zn,{kind:"accessor",name:"forceIrradianceInFragment",static:!1,private:!1,access:{has:e=>"forceIrradianceInFragment"in e,get:e=>e.forceIrradianceInFragment,set:(e,t)=>{e.forceIrradianceInFragment=t}},metadata:u},Un,Wn),h(r,null,wn,{kind:"accessor",name:"maxSimultaneousLights",static:!1,private:!1,access:{has:e=>"maxSimultaneousLights"in e,get:e=>e.maxSimultaneousLights,set:(e,t)=>{e.maxSimultaneousLights=t}},metadata:u},Gn,Hn),h(r,null,Vn,{kind:"accessor",name:"invertNormalMapX",static:!1,private:!1,access:{has:e=>"invertNormalMapX"in e,get:e=>e.invertNormalMapX,set:(e,t)=>{e.invertNormalMapX=t}},metadata:u},Xn,Yn),h(r,null,Zn,{kind:"accessor",name:"invertNormalMapY",static:!1,private:!1,access:{has:e=>"invertNormalMapY"in e,get:e=>e.invertNormalMapY,set:(e,t)=>{e.invertNormalMapY=t}},metadata:u},Kn,jn),h(r,null,Qn,{kind:"accessor",name:"twoSidedLighting",static:!1,private:!1,access:{has:e=>"twoSidedLighting"in e,get:e=>e.twoSidedLighting,set:(e,t)=>{e.twoSidedLighting=t}},metadata:u},qn,$n),h(r,null,Jn,{kind:"accessor",name:"useAlphaFresnel",static:!1,private:!1,access:{has:e=>"useAlphaFresnel"in e,get:e=>e.useAlphaFresnel,set:(e,t)=>{e.useAlphaFresnel=t}},metadata:u},el,tl),h(r,null,sl,{kind:"accessor",name:"useLinearAlphaFresnel",static:!1,private:!1,access:{has:e=>"useLinearAlphaFresnel"in e,get:e=>e.useLinearAlphaFresnel,set:(e,t)=>{e.useLinearAlphaFresnel=t}},metadata:u},il,rl),h(r,null,al,{kind:"accessor",name:"environmentBRDFTexture",static:!1,private:!1,access:{has:e=>"environmentBRDFTexture"in e,get:e=>e.environmentBRDFTexture,set:(e,t)=>{e.environmentBRDFTexture=t}},metadata:u},nl,ll),h(r,null,ol,{kind:"accessor",name:"forceNormalForward",static:!1,private:!1,access:{has:e=>"forceNormalForward"in e,get:e=>e.forceNormalForward,set:(e,t)=>{e.forceNormalForward=t}},metadata:u},ul,hl),h(r,null,cl,{kind:"accessor",name:"enableSpecularAntiAliasing",static:!1,private:!1,access:{has:e=>"enableSpecularAntiAliasing"in e,get:e=>e.enableSpecularAntiAliasing,set:(e,t)=>{e.enableSpecularAntiAliasing=t}},metadata:u},_l,fl),h(r,null,Tl,{kind:"accessor",name:"useHorizonOcclusion",static:!1,private:!1,access:{has:e=>"useHorizonOcclusion"in e,get:e=>e.useHorizonOcclusion,set:(e,t)=>{e.useHorizonOcclusion=t}},metadata:u},gl,ml),h(r,null,pl,{kind:"accessor",name:"useRadianceOcclusion",static:!1,private:!1,access:{has:e=>"useRadianceOcclusion"in e,get:e=>e.useRadianceOcclusion,set:(e,t)=>{e.useRadianceOcclusion=t}},metadata:u},dl,xl),h(r,null,Rl,{kind:"accessor",name:"unlit",static:!1,private:!1,access:{has:e=>"unlit"in e,get:e=>e.unlit,set:(e,t)=>{e.unlit=t}},metadata:u},Al,El),h(r,null,Sl,{kind:"accessor",name:"applyDecalMapAfterDetailMap",static:!1,private:!1,access:{has:e=>"applyDecalMapAfterDetailMap"in e,get:e=>e.applyDecalMapAfterDetailMap,set:(e,t)=>{e.applyDecalMapAfterDetailMap=t}},metadata:u},Ml,Il),h(r,null,bl,{kind:"accessor",name:"debugMode",static:!1,private:!1,access:{has:e=>"debugMode"in e,get:e=>e.debugMode,set:(e,t)=>{e.debugMode=t}},metadata:u},yl,Ol),h(r,null,Cl,{kind:"getter",name:"transparencyMode",static:!1,private:!1,access:{has:e=>"transparencyMode"in e,get:e=>e.transparencyMode},metadata:u},null,kt),u&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:u})})(),r.SSS_QUALITY_LOW=0,r.SSS_QUALITY_MEDIUM=1,r.SSS_QUALITY_HIGH=2,r._noiseTextures={},r.ForceGLSL=!1,r})(),zl=!1;function tu(){zl||(zl=!0,Do(),Po("BABYLON.OpenPBRMaterial",qo))}export{qo as OpenPBRMaterial,Bl as OpenPBRMaterialDefines,tu as RegisterOpenpbrMaterial};
@@ -0,0 +1,4 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./procedural.vertex-Dp-Ng7Pc.js","./index-B2zBEWsq.js","./index-DcTTrc-8.css","./procedural.vertex-BnbuQ-1f.js","./textureProcessor.fragment-C9D0rd-M.js","./textureProcessor.fragment-JMKyWZng.js"])))=>i.map(i=>d[i]);
2
+ import{aN as j,au as Z,aO as E,az as Q,aw as Y,aP as ae,aQ as ne,aR as D,aS as J,ay as G,aT as ee,aU as F,aV as L,aA as _,c as I}from"./index-B2zBEWsq.js";class oe{constructor(e){this.name=j.NAME_PROCEDURALTEXTURE,this.scene=e}register(){this.scene._beforeClearStage.registerStep(j.STEP_BEFORECLEAR_PROCEDURALTEXTURE,this,this._beforeClear)}rebuild(){}dispose(){}_beforeClear(){if(this.scene.proceduralTexturesEnabled){Z.StartPerformanceCounter("Procedural textures",this.scene.proceduralTextures.length>0);for(let e=0;e<this.scene.proceduralTextures.length;e++){const s=this.scene.proceduralTextures[e];s._shouldRender()&&s.render()}Z.EndPerformanceCounter("Procedural textures",this.scene.proceduralTextures.length>0)}}}let ue=(()=>{var t;let e=Y,s=[],a,o=[],h=[],f,m=[],x=[],u,d=[],C=[],A,w=[],M=[],O;return t=class extends e{get shaderLanguage(){return this._shaderLanguage}constructor(r,i,l,R,n=null,b=!0,T=!1,q=0){super(null,R,!b),this.isEnabled=(E(this,s),E(this,o,!0)),this.autoClear=(E(this,h),E(this,m,!0)),this.onGenerated=E(this,x),this.onGeneratedObservable=new Q,this.onBeforeGenerationObservable=new Q,this.nodeMaterialSource=null,this.defines="",this._generateMipMaps=E(this,d,void 0),this._drawWrapper=E(this,C),this._textures={},this._size=E(this,w,void 0),this._textureType=E(this,M),this._currentRefreshId=-1,this._frameId=-1,this._refreshRate=1,this._vertexBuffers={},this._uniforms=new Array,this._samplers=new Array,this._floats={},this._ints={},this._floatsArrays={},this._colors3={},this._colors4={},this._vectors2={},this._vectors3={},this._vectors4={},this._matrices={},this._fallbackTextureUsed=!1,this._cachedDefines=null,this._contentUpdateId=-1,this._rtWrapper=null,n!==null&&!(n instanceof Y)?(this._options=n,this._fallbackTexture=n.fallbackTexture??null):(this._options={},this._fallbackTexture=n),this._shaderLanguage=this._options.shaderLanguage??0,R=this.getScene()||ae.LastCreatedScene;let H=R._getComponent(j.NAME_PROCEDURALTEXTURE);H||(H=new oe(R),R._addComponent(H)),this._options.skipSceneRegistration||R.proceduralTextures.push(this),this._fullEngine=R.getEngine(),this.name=r,this.isRenderTarget=!0,this._size=i,this._textureType=q,this._generateMipMaps=b,this._drawWrapper=new ne(this._fullEngine),this.setFragment(l);const ie=this._createRtWrapper(T,i,b,q);this._texture=ie.texture;const z=[];z.push(1,1),z.push(-1,1),z.push(-1,-1),z.push(1,-1),this._vertexBuffers[D.PositionKind]=new D(this._fullEngine,z,D.PositionKind,!1,!1,2),this._createIndexBuffer()}_createRtWrapper(r,i,l,R){return r?(this._rtWrapper=this._fullEngine.createRenderTargetCubeTexture(i,{generateMipMaps:l,generateDepthBuffer:!1,generateStencilBuffer:!1,type:R,...this._options}),this.setFloat("face",0)):(this._rtWrapper=this._fullEngine.createRenderTargetTexture(i,{generateMipMaps:l,generateDepthBuffer:!1,generateStencilBuffer:!1,type:R,...this._options}),this._rtWrapper.is3D&&(this.setFloat("layer",0),this.setInt("layerNum",0))),this._rtWrapper}getEffect(){return this._drawWrapper.effect}_setEffect(r){this._drawWrapper.effect=r}getContent(){return this._contentData&&this._frameId===this._contentUpdateId?this._contentData:(this._contentData?this._contentData.then(r=>{this._contentData=this.readPixels(0,0,r),this._contentUpdateId=this._frameId}):(this._contentData=this.readPixels(0,0),this._contentUpdateId=this._frameId),this._contentData)}_createIndexBuffer(){const r=this._fullEngine,i=[];i.push(0),i.push(1),i.push(2),i.push(0),i.push(2),i.push(3),this._indexBuffer=r.createIndexBuffer(i)}_rebuild(){const r=this._vertexBuffers[D.PositionKind];r&&r._rebuild(),this._createIndexBuffer(),this.refreshRate===J.REFRESHRATE_RENDER_ONCE&&(this.refreshRate=J.REFRESHRATE_RENDER_ONCE)}reset(){this._drawWrapper.effect?.dispose(),this._drawWrapper.effect=null,this._cachedDefines=null}_getDefines(){return this.defines}executeWhenReady(r){if(this.isReady()){r(this);return}const i=this.getEffect();i&&i.executeWhenCompiled(()=>{r(this)})}isReady(){const r=this._fullEngine;if(this.nodeMaterialSource)return this._drawWrapper.effect?.isReady()??!1;if(!this._fragment)return!1;if(this._fallbackTextureUsed)return!0;if(!this._texture)return!1;const i=this._getDefines();if(this._drawWrapper.effect&&i===this._cachedDefines&&this._drawWrapper.effect.isReady())return!0;const l={vertex:"procedural",fragmentElement:this._fragment.fragmentElement,fragmentSource:this._fragment.fragmentSource,fragment:typeof this._fragment=="string"?this._fragment:void 0};return this._cachedDefines!==i&&(this._cachedDefines=i,this._drawWrapper.effect=r.createEffect(l,[D.PositionKind],this._uniforms,this._samplers,i,void 0,void 0,()=>{this._rtWrapper?.dispose(),this._rtWrapper=this._texture=null,this._fallbackTexture&&(this._texture=this._fallbackTexture._texture,this._texture&&this._texture.incrementReferences()),this._fallbackTextureUsed=!0},void 0,this._shaderLanguage,async()=>{this._options.extraInitializationsAsync?this.shaderLanguage===1?await Promise.all([G(()=>import("./procedural.vertex-Dp-Ng7Pc.js"),__vite__mapDeps([0,1,2]),import.meta.url),this._options.extraInitializationsAsync()]):await Promise.all([G(()=>import("./procedural.vertex-BnbuQ-1f.js"),__vite__mapDeps([3,1,2]),import.meta.url),this._options.extraInitializationsAsync()]):this.shaderLanguage===1?await G(()=>import("./procedural.vertex-Dp-Ng7Pc.js"),__vite__mapDeps([0,1,2]),import.meta.url):await G(()=>import("./procedural.vertex-BnbuQ-1f.js"),__vite__mapDeps([3,1,2]),import.meta.url)})),this._drawWrapper.effect.isReady()}resetRefreshCounter(){this._currentRefreshId=-1}setFragment(r){this._fragment=r}get refreshRate(){return this._refreshRate}set refreshRate(r){this._refreshRate=r,this.resetRefreshCounter()}_shouldRender(){return!this.isEnabled||!this.isReady()||!this._texture?(this._texture&&(this._texture.isReady=!1),!1):this._fallbackTextureUsed?!1:this._currentRefreshId===-1?(this._currentRefreshId=1,this._frameId++,!0):this.refreshRate===this._currentRefreshId?(this._currentRefreshId=1,this._frameId++,!0):(this._currentRefreshId++,!1)}getRenderSize(){return this._size}resize(r,i){if(this._fallbackTextureUsed||!this._rtWrapper||!this._texture)return;const l=this._texture.isCube;this._rtWrapper.dispose();const R=this._createRtWrapper(l,r,i,this._textureType);this._texture=R.texture,this._size=r,this._generateMipMaps=i}_checkUniform(r){this._uniforms.indexOf(r)===-1&&this._uniforms.push(r)}setTexture(r,i){return this._samplers.indexOf(r)===-1&&this._samplers.push(r),this._textures[r]=i,this}setFloat(r,i){return this._checkUniform(r),this._floats[r]=i,this}setInt(r,i){return this._checkUniform(r),this._ints[r]=i,this}setFloats(r,i){return this._checkUniform(r),this._floatsArrays[r]=i,this}setColor3(r,i){return this._checkUniform(r),this._colors3[r]=i,this}setColor4(r,i){return this._checkUniform(r),this._colors4[r]=i,this}setVector2(r,i){return this._checkUniform(r),this._vectors2[r]=i,this}setVector3(r,i){return this._checkUniform(r),this._vectors3[r]=i,this}setVector4(r,i){return this._checkUniform(r),this._vectors4[r]=i,this}setMatrix(r,i){return this._checkUniform(r),this._matrices[r]=i,this}render(r){const i=this.getScene();if(!i)return;const l=this._fullEngine;if(l.enableEffect(this._drawWrapper),this.onBeforeGenerationObservable.notifyObservers(this),l.setState(!1),!this.nodeMaterialSource){for(const n in this._textures)this._drawWrapper.effect.setTexture(n,this._textures[n]);for(const n in this._ints)this._drawWrapper.effect.setInt(n,this._ints[n]);for(const n in this._floats)this._drawWrapper.effect.setFloat(n,this._floats[n]);for(const n in this._floatsArrays)this._drawWrapper.effect.setArray(n,this._floatsArrays[n]);for(const n in this._colors3)this._drawWrapper.effect.setColor3(n,this._colors3[n]);for(const n in this._colors4){const b=this._colors4[n];this._drawWrapper.effect.setFloat4(n,b.r,b.g,b.b,b.a)}for(const n in this._vectors2)this._drawWrapper.effect.setVector2(n,this._vectors2[n]);for(const n in this._vectors3)this._drawWrapper.effect.setVector3(n,this._vectors3[n]);for(const n in this._vectors4)this._drawWrapper.effect.setVector4(n,this._vectors4[n]);for(const n in this._matrices)this._drawWrapper.effect.setMatrix(n,this._matrices[n])}if(!this._texture||!this._rtWrapper)return;l._enableGPUDebugMarkers&&l._debugPushGroup?.(`procedural texture generation for ${this.name}`);const R=l.currentViewport;if(this.isCube)for(let n=0;n<6;n++)l.bindFramebuffer(this._rtWrapper,n,void 0,void 0,!0),l.bindBuffers(this._vertexBuffers,this._indexBuffer,this._drawWrapper.effect),this._drawWrapper.effect.setFloat("face",n),this.autoClear&&l.clear(i.clearColor,!0,!1,!1),l.drawElementsType(ee.TriangleFillMode,0,6),l.unBindFramebuffer(this._rtWrapper,!0);else{let n=1;this._rtWrapper.is3D?n=this._rtWrapper.depth:this._rtWrapper.is2DArray&&(n=this._rtWrapper.layers);for(let b=0;b<n;b++){if(l.bindFramebuffer(this._rtWrapper,0,void 0,void 0,!0,0,b),l.bindBuffers(this._vertexBuffers,this._indexBuffer,this._drawWrapper.effect),this._rtWrapper.is3D||this._rtWrapper.is2DArray){this._drawWrapper.effect?.setFloat("layer",n!==1?b/(n-1):0),this._drawWrapper.effect?.setInt("layerNum",b);for(const T in this._textures)this._drawWrapper.effect.setTexture(T,this._textures[T])}this.autoClear&&l.clear(i.clearColor,!0,!1,!1),l.drawElementsType(ee.TriangleFillMode,0,6),l.unBindFramebuffer(this._rtWrapper,!this._generateMipMaps)}}R&&l.setViewport(R),this.isCube&&l.generateMipMapsForCubemap(this._texture,!0),l._enableGPUDebugMarkers&&l._debugPopGroup?.(),this.onGenerated&&this.onGenerated(),this.onGeneratedObservable.notifyObservers(this)}clone(){const r=this.getSize(),i=new t(this.name,r.width,this._fragment,this.getScene(),this._fallbackTexture,this._generateMipMaps);return i.hasAlpha=this.hasAlpha,i.level=this.level,i.coordinatesMode=this.coordinatesMode,i}dispose(){const r=this.getScene();if(!r)return;const i=r.proceduralTextures.indexOf(this);i>=0&&r.proceduralTextures.splice(i,1);const l=this._vertexBuffers[D.PositionKind];l&&(l.dispose(),this._vertexBuffers[D.PositionKind]=null),this._indexBuffer&&this._fullEngine._releaseBuffer(this._indexBuffer)&&(this._indexBuffer=null),this.onGeneratedObservable.clear(),this.onBeforeGenerationObservable.clear(),super.dispose()}},(()=>{const W=typeof Symbol=="function"&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;a=[L()],f=[L()],u=[L()],A=[L()],O=[L()],F(t,null,O,{kind:"getter",name:"refreshRate",static:!1,private:!1,access:{has:r=>"refreshRate"in r,get:r=>r.refreshRate},metadata:W},null,s),F(null,null,a,{kind:"field",name:"isEnabled",static:!1,private:!1,access:{has:r=>"isEnabled"in r,get:r=>r.isEnabled,set:(r,i)=>{r.isEnabled=i}},metadata:W},o,h),F(null,null,f,{kind:"field",name:"autoClear",static:!1,private:!1,access:{has:r=>"autoClear"in r,get:r=>r.autoClear,set:(r,i)=>{r.autoClear=i}},metadata:W},m,x),F(null,null,u,{kind:"field",name:"_generateMipMaps",static:!1,private:!1,access:{has:r=>"_generateMipMaps"in r,get:r=>r._generateMipMaps,set:(r,i)=>{r._generateMipMaps=i}},metadata:W},d,C),F(null,null,A,{kind:"field",name:"_size",static:!1,private:!1,access:{has:r=>"_size"in r,get:r=>r._size,set:(r,i)=>{r._size=i}},metadata:W},w,M),W&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:W})})(),t})();const le="textureProcessor";var y;(function(t){t[t.Linear=0]="Linear",t[t.SRGB=1]="SRGB"})(y||(y={}));var p;(function(t){t[t.R=1]="R",t[t.G=2]="G",t[t.B=4]="B",t[t.A=8]="A",t[t.RGB=7]="RGB",t[t.RGBA=15]="RGBA"})(p||(p={}));var c;(function(t){t[t.RGBA=0]="RGBA",t[t.R=1]="R",t[t.G=2]="G",t[t.B=3]="B",t[t.A=4]="A"})(c||(c={}));function he(t){return{texture:null,factor:t}}function g(t,e,s,a){const o={texture:t,factor:e};return s&&(o.channel=s),a&&(o.colorSpace=a),o}function S(t){return t.factor??new _(1,1,1,1)}function ce(t,e){return new _(t.r*e.r,t.g*e.g,t.b*e.b,t.a*e.a)}function fe(t,e,s){return new _(t.r+(e.r-t.r)*s.r,t.g+(e.g-t.g)*s.g,t.b+(e.b-t.b)*s.b,t.a+(e.a-t.a)*s.a)}function N(t){let e=0,s=512;for(const a of t)if(a.texture){const o=a.texture.getSize(),h=Math.max(o.width,o.height);h>e&&(e=h,s=o.width===o.height?h:o)}return s}function k(t){return!t.getTextureMatrix().isIdentity()}function te(t){if(t.length<=1)return!0;const e=t[0].getTextureMatrix();for(let s=1;s<t.length;s++)if(!e.equals(t[s].getTextureMatrix()))return!1;return!0}function V(t,e,s){if(e.coordinatesIndex=t.coordinatesIndex,e.wrapU=t.wrapU,e.wrapV=t.wrapV,s){const a=t;e.uOffset=a.uOffset??0,e.vOffset=a.vOffset??0,e.uScale=a.uScale??1,e.vScale=a.vScale??1,e.wAng=a.wAng??0}}function re(t){switch(t){case c.R:return"R";case c.G:return"G";case c.B:return"B";case c.A:return"A";default:return""}}function _e(t,e){switch(e){case c.R:return new _(t.r,t.r,t.r,t.a);case c.G:return new _(t.g,t.g,t.g,t.a);case c.B:return new _(t.b,t.b,t.b,t.a);case c.A:return new _(t.a,t.a,t.a,t.a);default:return t}}function me(t){const e=["OP_INVERT"];return t&p.R&&e.push("INVERT_R"),t&p.G&&e.push("INVERT_G"),t&p.B&&e.push("INVERT_B"),t&p.A&&e.push("INVERT_A"),e}function X(t){const e=[];return t&p.R||e.push("OUTPUT_MASK_R_ZERO"),t&p.G||e.push("OUTPUT_MASK_G_ZERO"),t&p.B||e.push("OUTPUT_MASK_B_ZERO"),t&p.A||e.push("OUTPUT_MASK_A_ONE"),e}function U(t,e){return new _(e&p.R?t.r:0,e&p.G?t.g:0,e&p.B?t.b:0,e&p.A?t.a:1)}function v(t,e,s){const a=[];return t.texture&&(a.push(`OPERAND_${e}_TEXTURE`),s&&k(t.texture)&&a.push(`OPERAND_${e}_MATRIX`),t.colorSpace&&a.push(`OPERAND_${e}_SRGB`),t.channel&&a.push(`OPERAND_${e}_CHANNEL_${re(t.channel)}`)),(t.factor!==void 0||!t.texture)&&a.push(`OPERAND_${e}_FACTOR`),a}function ge(t,e){const s=[];return t.texture&&(s.push("LERP_T_TEXTURE"),e&&k(t.texture)&&s.push("LERP_T_MATRIX"),t.factor!==void 0&&s.push("LERP_T_FACTOR"),t.colorSpace&&s.push("LERP_T_SRGB"),t.channel&&s.push(`LERP_T_CHANNEL_${re(t.channel)}`)),s}function P(t,e,s,a,o){e.texture&&(t.setTexture(s,e.texture),o&&k(e.texture)&&t.setMatrix(`${s}Matrix`,e.texture.getTextureMatrix())),(e.factor!==void 0||!e.texture)&&t.setColor4(a,S(e))}function pe(t,e,s){e.texture?(t.setTexture("textureT",e.texture),s&&k(e.texture)&&t.setMatrix("textureTMatrix",e.texture.getTextureMatrix()),e.factor!==void 0&&t.setColor4("factorT",e.factor)):t.setColor4("factorT",S(e))}function K(t,e,s,a,o=y.Linear){const h={type:0,format:5,samplingMode:2,generateDepthBuffer:!1,generateMipMaps:!1,gammaSpace:o===y.SRGB,shaderLanguage:a.getEngine().isWebGPU?1:0,extraInitializationsAsync:async()=>{a.getEngine().isWebGPU?await Promise.all([G(()=>import("./textureProcessor.fragment-C9D0rd-M.js"),__vite__mapDeps([4,1,2]),import.meta.url)]):await Promise.all([G(()=>import("./textureProcessor.fragment-JMKyWZng.js"),__vite__mapDeps([5,1,2]),import.meta.url)])},skipSceneRegistration:!0},f=new ue(t,s,le,a,h);return f.refreshRate=-1,f.defines=e.length>0?"#define "+e.join(`
3
+ #define `)+`
4
+ `:"",f}async function $(t){return await new Promise((e,s)=>{t.executeWhenReady(()=>{try{t.render(),e()}catch(a){s(a instanceof Error?a:new Error(String(a)))}})})}async function se(t,e,s,a,o,h){if(!e.texture&&!s.texture){const A=ce(S(e),S(s));return{texture:null,factor:h?U(A,h):A}}const f=[];e.texture&&f.push(e.texture),s.texture&&f.push(s.texture);const m=te(f),x=!m,u=[...v(e,"A",x),...v(s,"B",x),...h?X(h):[]];o&&u.push("OUTPUT_SRGB");const d=K(t,u,N([e,s]),a,o);P(d,e,"textureA","factorA",x),P(d,s,"textureB","factorB",x);try{await $(d)}catch(A){throw e.dispose?.(),s.dispose?.(),A}e.dispose?.(),s.dispose?.(),V(f[0],d,m);const C={texture:d,dispose:()=>d.dispose()};return o&&(C.colorSpace=o),C}async function B(t,e,s,a,o,h,f){if(!e.texture&&!s.texture&&!a.texture){const w=fe(S(e),S(s),S(a));return{texture:null,factor:f?U(w,f):w}}const m=[];e.texture&&m.push(e.texture),s.texture&&m.push(s.texture),a.texture&&m.push(a.texture);const x=te(m),u=!x,d=["OP_LERP",...v(e,"A",u),...v(s,"B",u),...ge(a,u),...f?X(f):[]];h&&d.push("OUTPUT_SRGB");const C=K(t,d,N([e,s,a]),o,h);P(C,e,"textureA","factorA",u),P(C,s,"textureB","factorB",u),pe(C,a,u);try{await $(C)}catch(w){throw e.dispose?.(),s.dispose?.(),a.dispose?.(),w}e.dispose?.(),s.dispose?.(),a.dispose?.(),V(m[0],C,x);const A={texture:C,dispose:()=>C.dispose()};return h&&(A.colorSpace=h),A}async function de(t,e,s,a=p.RGBA,o,h){if(!e.texture){const u=S(e),d=new _(a&p.R?1-u.r:u.r,a&p.G?1-u.g:u.g,a&p.B?1-u.b:u.b,a&p.A?1-u.a:u.a);return{texture:null,factor:h?U(d,h):d}}const f=[...v(e,"A",!1),...me(a),...h?X(h):[]];o&&f.push("OUTPUT_SRGB");const m=K(t,f,N([e]),s,o);P(m,e,"textureA","factorA",!1);try{await $(m)}catch(u){throw e.dispose?.(),u}e.dispose?.(),V(e.texture,m,!0);const x={texture:m,dispose:()=>m.dispose()};return o&&(x.colorSpace=o),x}async function xe(t,e,s,a=!1,o,h){if(!e.texture){const u=S(e),d=a?Math.max(u.r,u.g,u.b,u.a):Math.max(u.r,u.g,u.b),C=new _(d,d,d,a?d:u.a);return{texture:null,factor:h?U(C,h):C}}const f=[...v(e,"A",!1),"OP_CHANNEL_MAX",...h?X(h):[]];a&&f.push("CHANNEL_MAX_INCLUDE_ALPHA"),o&&f.push("OUTPUT_SRGB");const m=K(t,f,N([e]),s,o);P(m,e,"textureA","factorA",!1);try{await $(m)}catch(u){throw e.dispose?.(),u}e.dispose?.(),V(e.texture,m,!0);const x={texture:m,dispose:()=>m.dispose()};return o&&(x.colorSpace=o),x}async function Te(t,e,s,a,o,h){if(!e.texture){const f=_e(S(e),s);return{texture:null,factor:h?U(f,h):f}}return await se(t,{...e,channel:s},he(new _(1,1,1,1)),a,o,h)}class be{constructor(e){this._specWorkflow=!1,this._diffuseTransmissionTint=I.White(),this._diffuseTransmissionTintTexture=null,this._material=e}get material(){return this._material}get isUnlit(){return this._material.unlit}set isUnlit(e){this._material.unlit=e}set backFaceCulling(e){this._material.backFaceCulling=e}get backFaceCulling(){return this._material.backFaceCulling}set twoSidedLighting(e){this._material.twoSidedLighting=e}get twoSidedLighting(){return this._material.twoSidedLighting}set alphaCutOff(e){this._material.alphaCutOff=e}get alphaCutOff(){return this._material.alphaCutOff}set useAlphaFromBaseColorTexture(e){this._material._useAlphaFromBaseColorTexture=e}get useAlphaFromBaseColorTexture(){return this._material._useAlphaFromBaseColorTexture}get transparencyAsAlphaCoverage(){return!1}set transparencyAsAlphaCoverage(e){}set baseColor(e){this._material.baseColor=e}get baseColor(){return this._material.baseColor}set baseColorTexture(e){this._material.baseColorTexture=e}get baseColorTexture(){return this._material.baseColorTexture}set baseDiffuseRoughness(e){this._material.baseDiffuseRoughness=e}get baseDiffuseRoughness(){return this._material.baseDiffuseRoughness}set baseDiffuseRoughnessTexture(e){this._material.baseDiffuseRoughnessTexture=e}get baseDiffuseRoughnessTexture(){return this._material.baseDiffuseRoughnessTexture}set baseMetalness(e){this._material.baseMetalness=e}get baseMetalness(){return this._material.baseMetalness}set baseMetalnessTexture(e){this._material.baseMetalnessTexture=e}get baseMetalnessTexture(){return this._material.baseMetalnessTexture}set useRoughnessFromMetallicTextureGreen(e){this._material._useRoughnessFromMetallicTextureGreen=e}set useMetallicFromMetallicTextureBlue(e){this._material._useMetallicFromMetallicTextureBlue=e}enableSpecularEdgeColor(e=!1){}configureSpecularGlossiness(){this._specWorkflow=!0}set specularWeight(e){this._material.specularWeight=e}get specularWeight(){return this._material.specularWeight}set specularWeightTexture(e){this._material.specularColorTexture===e?(this._material.specularWeightTexture=null,this._material._useSpecularWeightFromSpecularColorTexture=!0,this._material._useSpecularWeightFromAlpha=!0):this._material.specularWeightTexture=e}get specularWeightTexture(){return this._material.specularWeightTexture}set specularColor(e){this._material.specularColor=e}get specularColor(){return this._material.specularColor}set specularColorTexture(e){this._material.specularColorTexture=e,this._material.specularWeightTexture===this._material.specularColorTexture&&(this._material.specularWeightTexture=null,this._material._useSpecularWeightFromSpecularColorTexture=!0,this._material._useSpecularWeightFromAlpha=!0)}get specularColorTexture(){return this._material.specularColorTexture}set specularRoughness(e){this._material.specularRoughness=e}get specularRoughness(){return this._material.specularRoughness}set specularRoughnessTexture(e){this._material.specularRoughnessTexture=e}get specularRoughnessTexture(){return this._material.specularRoughnessTexture}set specularIor(e){this._material.specularIor=e}get specularIor(){return this._material.specularIor}set glossiness(e){this._material.specularRoughness=Math.max(1-e,0)}get glossiness(){return 1-this._material.specularRoughness}set emissionColor(e){this._material.emissionColor=e}get emissionColor(){return this._material.emissionColor}set emissionLuminance(e){this._material.emissionLuminance=e}get emissionLuminance(){return this._material.emissionLuminance}set emissionColorTexture(e){this._material.emissionColorTexture=e}get emissionColorTexture(){return this._material.emissionColorTexture}set ambientOcclusionTexture(e){this._material.ambientOcclusionTexture=e}get ambientOcclusionTexture(){return this._material.ambientOcclusionTexture}set ambientOcclusionTextureStrength(e){const s=this._material.ambientOcclusionTexture;s&&(s.level=e)}get ambientOcclusionTextureStrength(){return this._material.ambientOcclusionTexture?.level??1}configureCoat(){}set coatWeight(e){this._material.coatWeight=e}get coatWeight(){return this._material.coatWeight}set coatWeightTexture(e){this._material.coatWeightTexture=e}get coatWeightTexture(){return this._material.coatWeightTexture}set coatColor(e){this._material.coatColor=e}get coatColor(){return this._material.coatColor}set coatColorTexture(e){this._material.coatColorTexture=e}set coatRoughness(e){this._material.coatRoughness=e}get coatRoughness(){return this._material.coatRoughness}set coatRoughnessTexture(e){this._material.coatRoughnessTexture=e,e&&(this._material._useCoatRoughnessFromGreenChannel=!0)}get coatRoughnessTexture(){return this._material.coatRoughnessTexture}set coatIor(e){this._material.coatIor=e}get coatIor(){return this._material.coatIor}set coatDarkening(e){this._material.coatDarkening=e}get coatDarkening(){return this._material.coatDarkening}set coatDarkeningTexture(e){this._material.coatDarkeningTexture=e}set coatRoughnessAnisotropy(e){this._material.coatRoughnessAnisotropy=e}get coatRoughnessAnisotropy(){return this._material.coatRoughnessAnisotropy}set geometryCoatTangentAngle(e){this._material.geometryCoatTangentAngle=e}set geometryCoatTangentTexture(e){this._material.geometryCoatTangentTexture=e,e&&(this._material._useCoatRoughnessAnisotropyFromTangentTexture=!0)}get geometryCoatTangentTexture(){return this._material.geometryCoatTangentTexture}configureTransmission(){this._material.geometryThinWalled=1,this._material.transmissionDepth=0}set transmissionWeight(e){this._material.transmissionWeight=e}set transmissionWeightTexture(e){this._material.transmissionWeightTexture=e}get transmissionWeightTexture(){return this._material.transmissionWeightTexture}get transmissionWeight(){return this._material.transmissionWeight}set transmissionScatter(e){this._material.transmissionScatter=e}get transmissionScatter(){return this._material.transmissionScatter}set transmissionScatterTexture(e){this._material.transmissionScatterTexture=e}get transmissionScatterTexture(){return this._material.transmissionScatterTexture}set transmissionScatterAnisotropy(e){this._material.transmissionScatterAnisotropy=e}set transmissionDispersionAbbeNumber(e){this._material.transmissionDispersionAbbeNumber=e}set transmissionDispersionScale(e){this._material.transmissionDispersionScale=e}set transmissionDepth(e){e!==Number.MAX_VALUE||this._material.transmissionDepth!==0?this._material.transmissionDepth=e:this._material.transmissionDepth=0}get transmissionDepth(){return this._material.transmissionDepth}set transmissionColor(e){e.equals(I.White())||(this._material.transmissionColor=e)}get transmissionColor(){return this._material.transmissionColor}get refractionBackgroundTexture(){return this._material.backgroundRefractionTexture}set refractionBackgroundTexture(e){this._material.backgroundRefractionTexture=e}configureVolume(){this._material.geometryThinWalled=0}set geometryThinWalled(e){this._material.geometryThinWalled=e?1:0}get geometryThinWalled(){return!!this._material.geometryThinWalled}set volumeThicknessTexture(e){this._material.geometryThicknessTexture=e,this._material._useGeometryThicknessFromGreenChannel=!0}set volumeThickness(e){this._material.geometryThickness=e}configureSubsurface(){this._material.geometryThinWalled=1,this._material.subsurfaceScatterAnisotropy=1}set subsurfaceWeight(e){this._material.subsurfaceWeight=e}get subsurfaceWeight(){return this._material.subsurfaceWeight}set subsurfaceWeightTexture(e){this._material.subsurfaceWeightTexture=e,this._material._useSubsurfaceWeightFromTextureAlpha=!0}get subsurfaceWeightTexture(){return this._material.subsurfaceWeightTexture}set subsurfaceColor(e){this._material.subsurfaceColor=e}set subsurfaceColorTexture(e){this._material.subsurfaceColorTexture=e}set diffuseTransmissionTint(e){this._diffuseTransmissionTint=e}get diffuseTransmissionTint(){return this._diffuseTransmissionTint}set diffuseTransmissionTintTexture(e){this._diffuseTransmissionTintTexture=e}get subsurfaceRadius(){return this._material.subsurfaceRadius}set subsurfaceRadius(e){this._material.subsurfaceRadius=e}get subsurfaceRadiusScale(){return this._material.subsurfaceRadiusScale}set subsurfaceRadiusScale(e){this._material.subsurfaceRadiusScale=e}set subsurfaceScatterAnisotropy(e){this._material.subsurfaceScatterAnisotropy=e}isTranslucent(){return this.transmissionWeight>0||this.subsurfaceWeight>0}configureFuzz(){}set fuzzWeight(e){this._material.fuzzWeight=e}set fuzzWeightTexture(e){this._material.fuzzWeightTexture=e}set fuzzColor(e){this._material.fuzzColor=e}set fuzzColorTexture(e){this._material.fuzzColorTexture=e}set fuzzRoughness(e){this._material.fuzzRoughness=e}set fuzzRoughnessTexture(e){this._material.fuzzRoughnessTexture=e,this._material._useFuzzRoughnessFromTextureAlpha=!0}set specularRoughnessAnisotropy(e){this._material.specularRoughnessAnisotropy=e}get specularRoughnessAnisotropy(){return this._material.specularRoughnessAnisotropy}set geometryTangentAngle(e){this._material.geometryTangentAngle=e}set geometryTangentTexture(e){this._material.geometryTangentTexture=e,this._material._useSpecularRoughnessAnisotropyFromTangentTexture=!0}get geometryTangentTexture(){return this._material.geometryTangentTexture}configureGltfStyleAnisotropy(e=!0){this._material._useGltfStyleAnisotropy=e}set thinFilmWeight(e){this._material.thinFilmWeight=e}set thinFilmIor(e){this._material.thinFilmIor=e}set thinFilmThicknessMinimum(e){this._material.thinFilmThicknessMin=e/1e3}set thinFilmThicknessMaximum(e){this._material.thinFilmThickness=e/1e3}set thinFilmWeightTexture(e){this._material.thinFilmWeightTexture=e}set thinFilmThicknessTexture(e){this._material.thinFilmThicknessTexture=e,this._material._useThinFilmThicknessFromTextureGreen=!0}set unlit(e){this._material.unlit=e}set geometryOpacity(e){this._material.geometryOpacity=e}get geometryOpacity(){return this._material.geometryOpacity}set geometryNormalTexture(e){this._material.geometryNormalTexture=e}get geometryNormalTexture(){return this._material.geometryNormalTexture}setNormalMapInversions(e,s){}set geometryCoatNormalTexture(e){this._material.geometryCoatNormalTexture=e}get geometryCoatNormalTexture(){return this._material.geometryCoatNormalTexture}set geometryCoatNormalTextureScale(e){this._material.geometryCoatNormalTexture&&(this._material.geometryCoatNormalTexture.level=e)}async finalizeAsync(e){if(this._diffuseTransmissionTint&&!this._diffuseTransmissionTint.equals(I.White())||this._diffuseTransmissionTintTexture){if(this._material.geometryThinWalled)this.subsurfaceColor=this._diffuseTransmissionTint,this.subsurfaceColorTexture=this._diffuseTransmissionTintTexture;else if(await this.copySurfaceToCoatAsync(e,this.subsurfaceWeight,this.subsurfaceWeightTexture,c.A,this._diffuseTransmissionTint,this._diffuseTransmissionTintTexture,!0),e._disposed)return}if(this.transmissionWeight>0){if(this._material.geometryThinWalled||this._material.transmissionDepth===0)this._material.transmissionColor=this._material.baseColor,this._material.transmissionColorTexture=this._material.baseColorTexture;else if((!this.baseColor.equals(I.White())||this.baseColorTexture!==null)&&(await this.copySurfaceToCoatAsync(e,this.transmissionWeight,this.transmissionWeightTexture,c.R,this.baseColor,this.baseColorTexture,!1),e._disposed))return}if(this._specWorkflow){const s=await de("newRoughnessTexture ("+this._material.name+")",await Te("glossiness ("+this._material.name+")",g(this.specularColorTexture,new _(this.specularColor.r,this.specularColor.g,this.specularColor.b,this.glossiness),c.A,y.Linear),c.A,this._material.getScene(),y.Linear,p.R),this._material.getScene(),p.R,y.Linear,p.R);if(e._disposed){s.texture?.dispose();return}this.specularRoughnessTexture=s.texture,this.specularRoughness=s.factor?s.factor.r:1;const a=await xe("metallicTexture ("+this._material.name+")",g(this.specularColorTexture,this.specularColor.toColor4(),c.RGBA,y.Linear),this._material.getScene(),!1,y.SRGB,p.RGB);if(e._disposed){a.texture?.dispose();return}this.baseMetalnessTexture=a.texture,this.baseMetalness=a.factor?a.factor.r:1;const o=await B("newBaseColor ("+this._material.name+")",g(this.baseColorTexture,this.baseColor.toColor4(),c.RGBA,y.Linear),g(this.specularColorTexture,this.specularColor.toColor4(),c.RGBA,y.Linear),{...a,dispose:void 0,colorSpace:y.Linear},this._material.getScene(),y.SRGB,p.RGB);if(e._disposed){o.texture?.dispose();return}this.baseColorTexture?.dispose(),this.baseColorTexture=o.texture,this.baseColor=o.factor?new I(o.factor.r,o.factor.g,o.factor.b):I.White(),this.specularColorTexture?.dispose(),this.specularColorTexture=null}}async copySurfaceToCoatAsync(e,s,a,o,h,f,m=!1){const x=this._material.coatWeight,u=this._material.coatWeightTexture,d=this._material.coatColor.clone(),C=this._material.coatColorTexture,A=this._material.geometryCoatNormalTexture,w=new _(x,x,x,x),M=new _(s,s,s,s);this.coatWeightTexture=null,this.coatWeight=1;const O=await Promise.allSettled([B("lerpExistingCoat",g(null,new _(1,1,1,1)),g(C,d.toColor4(),c.RGBA,y.SRGB),g(u,w,c.R),this._material.getScene(),y.SRGB),B("lerpSurfaceColor",g(null,new _(1,1,1,1)),g(f,h.toColor4(),c.RGBA,y.SRGB),g(a,M,o),this._material.getScene(),y.SRGB)]),W=O.find(T=>T.status==="rejected");if(W){for(const T of O)T.status==="fulfilled"&&T.value.texture?.dispose();throw W.reason}const[r,i]=O.map(T=>T.value);if(e._disposed){r.texture?.dispose(),i.texture?.dispose();return}const l=await se("newCoatColor ("+this._material.name+")",r,i,this._material.getScene(),y.SRGB);if(e._disposed){l.texture?.dispose();return}l.texture?(this.coatColorTexture=l.texture,this.coatColor=I.White()):l.factor&&(this.coatColorTexture=null,this.coatColor.fromArray([l.factor.r,l.factor.g,l.factor.b]));const R=await B("newCoatIor ("+this._material.name+")",g(null,new _(this._material.specularIor,this._material.specularIor,this._material.specularIor,1),c.R),g(null,new _(this.coatIor,this.coatIor,this.coatIor,1),c.R),g(u,w,c.R),this._material.getScene());if(e._disposed){R.texture?.dispose();return}this.coatIor=R.factor?R.factor.r:this.coatIor;const n=await B("newCoatRoughness ("+this._material.name+")",g(this.specularRoughnessTexture,new _(this.specularRoughness,this.specularRoughness,this.specularRoughness,1),c.G),g(this.coatRoughnessTexture,new _(this.coatRoughness,this.coatRoughness,this.coatRoughness,1),c.G),g(u,w,c.R),this._material.getScene());if(e._disposed){n.texture?.dispose();return}this.coatRoughness=n.factor?n.factor.r:1,this.coatRoughnessTexture=n.texture;const b=await B("newCoatDarkening ("+this._material.name+")",g(null,new _(0,0,0,1),c.R),g(null,new _(this.coatDarkening,this.coatDarkening,this.coatDarkening,1),c.R),g(u,w,c.R),this._material.getScene());if(e._disposed){b.texture?.dispose();return}if(this.coatDarkening=b.factor?b.factor.r:this.coatDarkening,m){const T=await B("newSpecularRoughness ("+this._material.name+")",g(this.specularRoughnessTexture,new _(this._material.specularRoughness,this._material.specularRoughness,this._material.specularRoughness,1),c.G),g(null,new _(1,1,1,1),c.R),g(a,M,o),this._material.getScene());if(e._disposed){T.texture?.dispose();return}this.specularRoughness=T.factor?T.factor.r:1,this.specularRoughnessTexture=T.texture}if(A||this.geometryNormalTexture){const T=await B("newCoatNormal ("+this._material.name+")",g(this.geometryNormalTexture,this.geometryNormalTexture?new _(1,1,1,1):new _(.5,.5,1,1),c.RGBA),g(A,A?new _(1,1,1,1):new _(.5,.5,1,1),c.RGBA),g(u,w,c.R),this._material.getScene());if(e._disposed){T.texture?.dispose();return}T.texture&&(this.geometryCoatNormalTexture=T.texture)}}}export{be as OpenPBRMaterialLoadingAdapter};