@babylonjs/core 5.0.0-alpha.63 → 5.0.0-alpha.64

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 (384) hide show
  1. package/Animations/animation.js +42 -2
  2. package/Animations/animation.js.map +1 -1
  3. package/Animations/animationGroup.d.ts +1 -1
  4. package/Animations/animationGroup.js +1 -1
  5. package/Animations/animationGroup.js.map +1 -1
  6. package/Audio/sound.js +14 -0
  7. package/Audio/sound.js.map +1 -1
  8. package/Cameras/VR/vrDeviceOrientationArcRotateCamera.js +1 -1
  9. package/Cameras/VR/vrDeviceOrientationArcRotateCamera.js.map +1 -1
  10. package/Cameras/VR/vrExperienceHelper.d.ts +1 -1
  11. package/Cameras/VR/vrExperienceHelper.js +1 -1
  12. package/Cameras/VR/vrExperienceHelper.js.map +1 -1
  13. package/DeviceInput/Implementations/{nativeDeviceInputWrapper.d.ts → nativeDeviceInputSystem.d.ts} +5 -21
  14. package/DeviceInput/Implementations/{nativeDeviceInputWrapper.js → nativeDeviceInputSystem.js} +19 -20
  15. package/DeviceInput/Implementations/nativeDeviceInputSystem.js.map +1 -0
  16. package/DeviceInput/Implementations/webDeviceInputSystem.d.ts +7 -20
  17. package/DeviceInput/Implementations/webDeviceInputSystem.js +70 -62
  18. package/DeviceInput/Implementations/webDeviceInputSystem.js.map +1 -1
  19. package/DeviceInput/InputDevices/deviceSourceManager.d.ts +3 -2
  20. package/DeviceInput/InputDevices/deviceSourceManager.js +5 -1
  21. package/DeviceInput/InputDevices/deviceSourceManager.js.map +1 -1
  22. package/DeviceInput/Interfaces/inputInterfaces.d.ts +6 -13
  23. package/DeviceInput/Interfaces/inputInterfaces.js.map +1 -1
  24. package/DeviceInput/deviceInputSystem.d.ts +49 -5
  25. package/DeviceInput/deviceInputSystem.js +62 -10
  26. package/DeviceInput/deviceInputSystem.js.map +1 -1
  27. package/DeviceInput/index.d.ts +1 -1
  28. package/DeviceInput/index.js +1 -1
  29. package/DeviceInput/index.js.map +1 -1
  30. package/Engines/Extensions/engine.views.d.ts +1 -1
  31. package/Engines/Extensions/engine.views.js +1 -1
  32. package/Engines/Extensions/engine.views.js.map +1 -1
  33. package/Engines/Processors/iShaderProcessor.d.ts +1 -1
  34. package/Engines/Processors/iShaderProcessor.js.map +1 -1
  35. package/Engines/Processors/shaderProcessingOptions.d.ts +5 -0
  36. package/Engines/Processors/shaderProcessingOptions.js.map +1 -1
  37. package/Engines/Processors/shaderProcessor.js +8 -2
  38. package/Engines/Processors/shaderProcessor.js.map +1 -1
  39. package/Engines/WebGPU/webgpuBufferManager.d.ts +1 -1
  40. package/Engines/WebGPU/webgpuBufferManager.js.map +1 -1
  41. package/Engines/WebGPU/webgpuCacheBindGroups.js +3 -3
  42. package/Engines/WebGPU/webgpuCacheBindGroups.js.map +1 -1
  43. package/Engines/WebGPU/webgpuClearQuad.js +17 -8
  44. package/Engines/WebGPU/webgpuClearQuad.js.map +1 -1
  45. package/Engines/WebGPU/webgpuComputeContext.js +2 -2
  46. package/Engines/WebGPU/webgpuComputeContext.js.map +1 -1
  47. package/Engines/WebGPU/webgpuHardwareTexture.d.ts +2 -1
  48. package/Engines/WebGPU/webgpuHardwareTexture.js +10 -1
  49. package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
  50. package/Engines/WebGPU/webgpuShaderProcessingContext.js +2 -0
  51. package/Engines/WebGPU/webgpuShaderProcessingContext.js.map +1 -1
  52. package/Engines/WebGPU/webgpuShaderProcessor.d.ts +2 -0
  53. package/Engines/WebGPU/webgpuShaderProcessor.js +23 -0
  54. package/Engines/WebGPU/webgpuShaderProcessor.js.map +1 -1
  55. package/Engines/WebGPU/webgpuShaderProcessorsGLSL.d.ts +1 -0
  56. package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js +17 -1
  57. package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js.map +1 -1
  58. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.d.ts +1 -2
  59. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +10 -29
  60. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
  61. package/Engines/WebGPU/webgpuTextureHelper.js +4 -3
  62. package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
  63. package/Engines/engine.d.ts +63 -6
  64. package/Engines/engine.js.map +1 -1
  65. package/Engines/nativeEngine.js +3 -7
  66. package/Engines/nativeEngine.js.map +1 -1
  67. package/Engines/thinEngine.js +2 -2
  68. package/Engines/thinEngine.js.map +1 -1
  69. package/Engines/webgpuEngine.d.ts +5 -13
  70. package/Engines/webgpuEngine.js +18 -55
  71. package/Engines/webgpuEngine.js.map +1 -1
  72. package/Gizmos/positionGizmo.js +1 -1
  73. package/Gizmos/positionGizmo.js.map +1 -1
  74. package/Inputs/scene.inputManager.js +1 -1
  75. package/Inputs/scene.inputManager.js.map +1 -1
  76. package/Layers/highlightLayer.js +2 -0
  77. package/Layers/highlightLayer.js.map +1 -1
  78. package/Loading/Plugins/babylonFileLoader.js +3 -0
  79. package/Loading/Plugins/babylonFileLoader.js.map +1 -1
  80. package/Materials/Node/Blocks/customBlock.js +3 -3
  81. package/Materials/Node/Blocks/customBlock.js.map +1 -1
  82. package/Materials/Node/nodeMaterial.js +8 -0
  83. package/Materials/Node/nodeMaterial.js.map +1 -1
  84. package/Materials/Node/nodeMaterialBlock.js +1 -1
  85. package/Materials/Node/nodeMaterialBlock.js.map +1 -1
  86. package/Materials/PBR/index.d.ts +4 -0
  87. package/Materials/PBR/index.js +4 -0
  88. package/Materials/PBR/index.js.map +1 -1
  89. package/Materials/PBR/pbrAnisotropicConfiguration.d.ts +28 -96
  90. package/Materials/PBR/pbrAnisotropicConfiguration.js +50 -111
  91. package/Materials/PBR/pbrAnisotropicConfiguration.js.map +1 -1
  92. package/Materials/PBR/pbrBRDFConfiguration.d.ts +11 -37
  93. package/Materials/PBR/pbrBRDFConfiguration.js +39 -52
  94. package/Materials/PBR/pbrBRDFConfiguration.js.map +1 -1
  95. package/Materials/PBR/pbrBaseMaterial.d.ts +15 -74
  96. package/Materials/PBR/pbrBaseMaterial.js +66 -181
  97. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  98. package/Materials/PBR/pbrBaseSimpleMaterial.js.map +1 -1
  99. package/Materials/PBR/pbrClearCoatConfiguration.d.ts +23 -98
  100. package/Materials/PBR/pbrClearCoatConfiguration.js +91 -143
  101. package/Materials/PBR/pbrClearCoatConfiguration.js.map +1 -1
  102. package/Materials/PBR/pbrSheenConfiguration.d.ts +25 -93
  103. package/Materials/PBR/pbrSheenConfiguration.js +71 -126
  104. package/Materials/PBR/pbrSheenConfiguration.js.map +1 -1
  105. package/Materials/PBR/pbrSubSurfaceConfiguration.d.ts +28 -114
  106. package/Materials/PBR/pbrSubSurfaceConfiguration.js +150 -211
  107. package/Materials/PBR/pbrSubSurfaceConfiguration.js.map +1 -1
  108. package/Materials/Textures/dynamicTexture.d.ts +1 -1
  109. package/Materials/Textures/dynamicTexture.js +1 -1
  110. package/Materials/Textures/dynamicTexture.js.map +1 -1
  111. package/Materials/Textures/videoTexture.d.ts +1 -1
  112. package/Materials/Textures/videoTexture.js +1 -1
  113. package/Materials/Textures/videoTexture.js.map +1 -1
  114. package/Materials/effect.d.ts +6 -1
  115. package/Materials/effect.js +4 -1
  116. package/Materials/effect.js.map +1 -1
  117. package/Materials/fresnelParameters.d.ts +1 -1
  118. package/Materials/fresnelParameters.js +1 -1
  119. package/Materials/fresnelParameters.js.map +1 -1
  120. package/Materials/index.d.ts +4 -0
  121. package/Materials/index.js +4 -0
  122. package/Materials/index.js.map +1 -1
  123. package/Materials/material.d.ts +43 -2
  124. package/Materials/material.detailMapConfiguration.d.ts +29 -87
  125. package/Materials/material.detailMapConfiguration.js +50 -106
  126. package/Materials/material.detailMapConfiguration.js.map +1 -1
  127. package/Materials/material.js +99 -8
  128. package/Materials/material.js.map +1 -1
  129. package/Materials/materialDefines.d.ts +16 -0
  130. package/Materials/materialDefines.js +17 -5
  131. package/Materials/materialDefines.js.map +1 -1
  132. package/Materials/materialPluginBase.d.ts +182 -0
  133. package/Materials/materialPluginBase.js +209 -0
  134. package/Materials/materialPluginBase.js.map +1 -0
  135. package/Materials/materialPluginEvent.d.ts +98 -0
  136. package/Materials/materialPluginEvent.js +21 -0
  137. package/Materials/materialPluginEvent.js.map +1 -0
  138. package/Materials/materialPluginFactoryExport.d.ts +40 -0
  139. package/Materials/materialPluginFactoryExport.js +75 -0
  140. package/Materials/materialPluginFactoryExport.js.map +1 -0
  141. package/Materials/materialPluginManager.d.ts +90 -0
  142. package/Materials/materialPluginManager.js +323 -0
  143. package/Materials/materialPluginManager.js.map +1 -0
  144. package/Materials/shaderMaterial.d.ts +1 -1
  145. package/Materials/shaderMaterial.js +1 -1
  146. package/Materials/shaderMaterial.js.map +1 -1
  147. package/Materials/standardMaterial.d.ts +13 -10
  148. package/Materials/standardMaterial.js +44 -50
  149. package/Materials/standardMaterial.js.map +1 -1
  150. package/Meshes/Builders/capsuleBuilder.d.ts +1 -1
  151. package/Meshes/Builders/capsuleBuilder.js +1 -1
  152. package/Meshes/Builders/capsuleBuilder.js.map +1 -1
  153. package/Meshes/abstractMesh.d.ts +1 -1
  154. package/Meshes/abstractMesh.js +1 -1
  155. package/Meshes/abstractMesh.js.map +1 -1
  156. package/Meshes/linesMesh.d.ts +1 -1
  157. package/Meshes/linesMesh.js +3 -2
  158. package/Meshes/linesMesh.js.map +1 -1
  159. package/Meshes/mesh.lts.d.ts +8 -8
  160. package/Meshes/mesh.lts.js.map +1 -1
  161. package/Meshes/mesh.vertexData.js.map +1 -1
  162. package/Misc/PerformanceViewer/performanceViewerCollectionStrategies.d.ts +1 -1
  163. package/Misc/PerformanceViewer/performanceViewerCollectionStrategies.js +25 -25
  164. package/Misc/PerformanceViewer/performanceViewerCollectionStrategies.js.map +1 -1
  165. package/Misc/PerformanceViewer/performanceViewerCollector.d.ts +11 -1
  166. package/Misc/PerformanceViewer/performanceViewerCollector.js +30 -8
  167. package/Misc/PerformanceViewer/performanceViewerCollector.js.map +1 -1
  168. package/Misc/coroutine.d.ts +2 -6
  169. package/Misc/coroutine.js.map +1 -1
  170. package/Misc/sceneSerializer.js +1 -0
  171. package/Misc/sceneSerializer.js.map +1 -1
  172. package/Particles/particleSystem.js +3 -0
  173. package/Particles/particleSystem.js.map +1 -1
  174. package/Rendering/depthPeelingRenderer.d.ts +4 -1
  175. package/Rendering/depthPeelingRenderer.js +34 -9
  176. package/Rendering/depthPeelingRenderer.js.map +1 -1
  177. package/Rendering/renderingGroup.js +5 -1
  178. package/Rendering/renderingGroup.js.map +1 -1
  179. package/Shaders/ShadersInclude/defaultFragmentDeclaration.js +1 -1
  180. package/Shaders/ShadersInclude/defaultFragmentDeclaration.js.map +1 -1
  181. package/Shaders/ShadersInclude/defaultUboDeclaration.js +1 -1
  182. package/Shaders/ShadersInclude/defaultUboDeclaration.js.map +1 -1
  183. package/Shaders/ShadersInclude/defaultVertexDeclaration.js +1 -1
  184. package/Shaders/ShadersInclude/defaultVertexDeclaration.js.map +1 -1
  185. package/Shaders/ShadersInclude/pbrFragmentDeclaration.js +1 -1
  186. package/Shaders/ShadersInclude/pbrFragmentDeclaration.js.map +1 -1
  187. package/Shaders/ShadersInclude/pbrUboDeclaration.js +1 -1
  188. package/Shaders/ShadersInclude/pbrUboDeclaration.js.map +1 -1
  189. package/Shaders/ShadersInclude/pbrVertexDeclaration.js +1 -1
  190. package/Shaders/ShadersInclude/pbrVertexDeclaration.js.map +1 -1
  191. package/Shaders/anaglyph.fragment.js +1 -1
  192. package/Shaders/anaglyph.fragment.js.map +1 -1
  193. package/Shaders/background.fragment.js +1 -1
  194. package/Shaders/background.fragment.js.map +1 -1
  195. package/Shaders/background.vertex.js +1 -1
  196. package/Shaders/background.vertex.js.map +1 -1
  197. package/Shaders/blackAndWhite.fragment.js +1 -1
  198. package/Shaders/blackAndWhite.fragment.js.map +1 -1
  199. package/Shaders/bloomMerge.fragment.js +1 -1
  200. package/Shaders/bloomMerge.fragment.js.map +1 -1
  201. package/Shaders/blur.fragment.js +1 -1
  202. package/Shaders/blur.fragment.js.map +1 -1
  203. package/Shaders/boundingBoxRenderer.fragment.js +1 -1
  204. package/Shaders/boundingBoxRenderer.fragment.js.map +1 -1
  205. package/Shaders/boundingBoxRenderer.vertex.js +1 -1
  206. package/Shaders/boundingBoxRenderer.vertex.js.map +1 -1
  207. package/Shaders/chromaticAberration.fragment.js +1 -1
  208. package/Shaders/chromaticAberration.fragment.js.map +1 -1
  209. package/Shaders/circleOfConfusion.fragment.js +1 -1
  210. package/Shaders/circleOfConfusion.fragment.js.map +1 -1
  211. package/Shaders/clearQuad.vertex.js +1 -1
  212. package/Shaders/clearQuad.vertex.js.map +1 -1
  213. package/Shaders/color.fragment.js +1 -1
  214. package/Shaders/color.fragment.js.map +1 -1
  215. package/Shaders/color.vertex.js +1 -1
  216. package/Shaders/color.vertex.js.map +1 -1
  217. package/Shaders/colorCorrection.fragment.js +1 -1
  218. package/Shaders/colorCorrection.fragment.js.map +1 -1
  219. package/Shaders/convolution.fragment.js +1 -1
  220. package/Shaders/convolution.fragment.js.map +1 -1
  221. package/Shaders/default.fragment.js +1 -1
  222. package/Shaders/default.fragment.js.map +1 -1
  223. package/Shaders/depth.fragment.js +1 -1
  224. package/Shaders/depth.fragment.js.map +1 -1
  225. package/Shaders/depth.vertex.js +1 -1
  226. package/Shaders/depth.vertex.js.map +1 -1
  227. package/Shaders/depthBoxBlur.fragment.js +1 -1
  228. package/Shaders/depthBoxBlur.fragment.js.map +1 -1
  229. package/Shaders/depthOfField.fragment.js +1 -1
  230. package/Shaders/depthOfField.fragment.js.map +1 -1
  231. package/Shaders/depthOfFieldMerge.fragment.js +1 -1
  232. package/Shaders/depthOfFieldMerge.fragment.js.map +1 -1
  233. package/Shaders/displayPass.fragment.js +1 -1
  234. package/Shaders/displayPass.fragment.js.map +1 -1
  235. package/Shaders/extractHighlights.fragment.js +1 -1
  236. package/Shaders/extractHighlights.fragment.js.map +1 -1
  237. package/Shaders/filter.fragment.js +1 -1
  238. package/Shaders/filter.fragment.js.map +1 -1
  239. package/Shaders/fxaa.vertex.js +1 -1
  240. package/Shaders/fxaa.vertex.js.map +1 -1
  241. package/Shaders/geometry.vertex.js +1 -1
  242. package/Shaders/geometry.vertex.js.map +1 -1
  243. package/Shaders/glowBlurPostProcess.fragment.js +1 -1
  244. package/Shaders/glowBlurPostProcess.fragment.js.map +1 -1
  245. package/Shaders/glowMapGeneration.fragment.js +1 -1
  246. package/Shaders/glowMapGeneration.fragment.js.map +1 -1
  247. package/Shaders/glowMapGeneration.vertex.js +1 -1
  248. package/Shaders/glowMapGeneration.vertex.js.map +1 -1
  249. package/Shaders/glowMapMerge.fragment.js +1 -1
  250. package/Shaders/glowMapMerge.fragment.js.map +1 -1
  251. package/Shaders/glowMapMerge.vertex.js +1 -1
  252. package/Shaders/glowMapMerge.vertex.js.map +1 -1
  253. package/Shaders/grain.fragment.js +1 -1
  254. package/Shaders/grain.fragment.js.map +1 -1
  255. package/Shaders/hdrFiltering.vertex.js +1 -1
  256. package/Shaders/hdrFiltering.vertex.js.map +1 -1
  257. package/Shaders/highlights.fragment.js +1 -1
  258. package/Shaders/highlights.fragment.js.map +1 -1
  259. package/Shaders/imageProcessing.fragment.js +1 -1
  260. package/Shaders/imageProcessing.fragment.js.map +1 -1
  261. package/Shaders/kernelBlur.fragment.js +1 -1
  262. package/Shaders/kernelBlur.fragment.js.map +1 -1
  263. package/Shaders/kernelBlur.vertex.js +1 -1
  264. package/Shaders/kernelBlur.vertex.js.map +1 -1
  265. package/Shaders/layer.fragment.js +1 -1
  266. package/Shaders/layer.fragment.js.map +1 -1
  267. package/Shaders/layer.vertex.js +1 -1
  268. package/Shaders/layer.vertex.js.map +1 -1
  269. package/Shaders/lensFlare.fragment.js +1 -1
  270. package/Shaders/lensFlare.fragment.js.map +1 -1
  271. package/Shaders/lensFlare.vertex.js +1 -1
  272. package/Shaders/lensFlare.vertex.js.map +1 -1
  273. package/Shaders/lensHighlights.fragment.js +1 -1
  274. package/Shaders/lensHighlights.fragment.js.map +1 -1
  275. package/Shaders/line.fragment.js +1 -1
  276. package/Shaders/line.fragment.js.map +1 -1
  277. package/Shaders/line.vertex.js +1 -1
  278. package/Shaders/line.vertex.js.map +1 -1
  279. package/Shaders/minmaxRedux.fragment.js +1 -1
  280. package/Shaders/minmaxRedux.fragment.js.map +1 -1
  281. package/Shaders/motionBlur.fragment.js +1 -1
  282. package/Shaders/motionBlur.fragment.js.map +1 -1
  283. package/Shaders/noise.fragment.js +1 -1
  284. package/Shaders/noise.fragment.js.map +1 -1
  285. package/Shaders/outline.fragment.js +1 -1
  286. package/Shaders/outline.fragment.js.map +1 -1
  287. package/Shaders/outline.vertex.js +1 -1
  288. package/Shaders/outline.vertex.js.map +1 -1
  289. package/Shaders/particles.fragment.js +1 -1
  290. package/Shaders/particles.fragment.js.map +1 -1
  291. package/Shaders/particles.vertex.js +1 -1
  292. package/Shaders/particles.vertex.js.map +1 -1
  293. package/Shaders/pass.fragment.js +1 -1
  294. package/Shaders/pass.fragment.js.map +1 -1
  295. package/Shaders/passCube.fragment.js +1 -1
  296. package/Shaders/passCube.fragment.js.map +1 -1
  297. package/Shaders/pbr.fragment.js +1 -1
  298. package/Shaders/pbr.fragment.js.map +1 -1
  299. package/Shaders/postprocess.vertex.js +1 -1
  300. package/Shaders/postprocess.vertex.js.map +1 -1
  301. package/Shaders/procedural.vertex.js +1 -1
  302. package/Shaders/procedural.vertex.js.map +1 -1
  303. package/Shaders/rgbdDecode.fragment.js +1 -1
  304. package/Shaders/rgbdDecode.fragment.js.map +1 -1
  305. package/Shaders/rgbdEncode.fragment.js +1 -1
  306. package/Shaders/rgbdEncode.fragment.js.map +1 -1
  307. package/Shaders/screenSpaceCurvature.fragment.js +1 -1
  308. package/Shaders/screenSpaceCurvature.fragment.js.map +1 -1
  309. package/Shaders/shadowMap.fragment.js +1 -1
  310. package/Shaders/shadowMap.fragment.js.map +1 -1
  311. package/Shaders/shadowMap.vertex.js +1 -1
  312. package/Shaders/shadowMap.vertex.js.map +1 -1
  313. package/Shaders/sharpen.fragment.js +1 -1
  314. package/Shaders/sharpen.fragment.js.map +1 -1
  315. package/Shaders/sprites.fragment.js +1 -1
  316. package/Shaders/sprites.fragment.js.map +1 -1
  317. package/Shaders/sprites.vertex.js +1 -1
  318. package/Shaders/sprites.vertex.js.map +1 -1
  319. package/Shaders/ssaoCombine.fragment.js +1 -1
  320. package/Shaders/ssaoCombine.fragment.js.map +1 -1
  321. package/Shaders/standard.fragment.js +1 -1
  322. package/Shaders/standard.fragment.js.map +1 -1
  323. package/Shaders/stereoscopicInterlace.fragment.js +1 -1
  324. package/Shaders/stereoscopicInterlace.fragment.js.map +1 -1
  325. package/Shaders/subSurfaceScattering.fragment.js +1 -1
  326. package/Shaders/subSurfaceScattering.fragment.js.map +1 -1
  327. package/Shaders/tonemap.fragment.js +1 -1
  328. package/Shaders/tonemap.fragment.js.map +1 -1
  329. package/Shaders/volumetricLightScattering.fragment.js +1 -1
  330. package/Shaders/volumetricLightScattering.fragment.js.map +1 -1
  331. package/Shaders/volumetricLightScatteringPass.fragment.js +1 -1
  332. package/Shaders/volumetricLightScatteringPass.fragment.js.map +1 -1
  333. package/Shaders/volumetricLightScatteringPass.vertex.js +1 -1
  334. package/Shaders/volumetricLightScatteringPass.vertex.js.map +1 -1
  335. package/Shaders/vrDistortionCorrection.fragment.js +1 -1
  336. package/Shaders/vrDistortionCorrection.fragment.js.map +1 -1
  337. package/Shaders/vrMultiviewToSingleview.fragment.js +1 -1
  338. package/Shaders/vrMultiviewToSingleview.fragment.js.map +1 -1
  339. package/XR/features/WebXRHandTracking.d.ts +2 -0
  340. package/XR/features/WebXRHandTracking.js +34 -14
  341. package/XR/features/WebXRHandTracking.js.map +1 -1
  342. package/XR/features/WebXRLayers.d.ts +78 -0
  343. package/XR/features/WebXRLayers.js +243 -0
  344. package/XR/features/WebXRLayers.js.map +1 -0
  345. package/XR/features/WebXRPlaneDetector.js +8 -12
  346. package/XR/features/WebXRPlaneDetector.js.map +1 -1
  347. package/XR/features/index.d.ts +1 -0
  348. package/XR/features/index.js +1 -0
  349. package/XR/features/index.js.map +1 -1
  350. package/XR/native/index.d.ts +1 -0
  351. package/XR/native/index.js +2 -0
  352. package/XR/native/index.js.map +1 -0
  353. package/XR/native/nativeXRRenderTarget.d.ts +44 -0
  354. package/XR/native/nativeXRRenderTarget.js +81 -0
  355. package/XR/native/nativeXRRenderTarget.js.map +1 -0
  356. package/XR/webXRCamera.js +2 -10
  357. package/XR/webXRCamera.js.map +1 -1
  358. package/XR/webXRExperienceHelper.js +15 -13
  359. package/XR/webXRExperienceHelper.js.map +1 -1
  360. package/XR/webXRFeaturesManager.d.ts +4 -0
  361. package/XR/webXRFeaturesManager.js +4 -0
  362. package/XR/webXRFeaturesManager.js.map +1 -1
  363. package/XR/webXRLayerWrapper.d.ts +48 -0
  364. package/XR/webXRLayerWrapper.js +60 -0
  365. package/XR/webXRLayerWrapper.js.map +1 -0
  366. package/XR/webXRManagedOutputCanvas.d.ts +2 -1
  367. package/XR/webXRManagedOutputCanvas.js +36 -29
  368. package/XR/webXRManagedOutputCanvas.js.map +1 -1
  369. package/XR/webXRRenderTargetTextureProvider.d.ts +55 -0
  370. package/XR/webXRRenderTargetTextureProvider.js +63 -0
  371. package/XR/webXRRenderTargetTextureProvider.js.map +1 -0
  372. package/XR/webXRSessionManager.d.ts +30 -7
  373. package/XR/webXRSessionManager.js +62 -64
  374. package/XR/webXRSessionManager.js.map +1 -1
  375. package/XR/webXRTypes.d.ts +1 -1
  376. package/XR/webXRTypes.js.map +1 -1
  377. package/XR/webXRWebGLLayer.d.ts +36 -0
  378. package/XR/webXRWebGLLayer.js +69 -0
  379. package/XR/webXRWebGLLayer.js.map +1 -0
  380. package/abstractScene.d.ts +1 -1
  381. package/abstractScene.js +1 -1
  382. package/abstractScene.js.map +1 -1
  383. package/package.json +35 -5
  384. package/DeviceInput/Implementations/nativeDeviceInputWrapper.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"pbrClearCoatConfiguration.js","sourceRoot":"","sources":["../../../../sourceES6/core/Materials/PBR/pbrClearCoatConfiguration.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAChI,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAiChE;;GAEG;AACH;IAmII;;;OAGG;IACH,mCAAY,+BAA2C;QA/H/C,eAAU,GAAG,KAAK,CAAC;QAC3B;;WAEG;QAGI,cAAS,GAAG,KAAK,CAAC;QAEzB;;WAEG;QAEI,cAAS,GAAW,CAAC,CAAC;QAE7B;;WAEG;QAEI,cAAS,GAAW,CAAC,CAAC;QAErB,uBAAkB,GAAG,yBAAyB,CAAC,yBAAyB,CAAC;QACjF;;;;;WAKG;QAGI,sBAAiB,GAAG,yBAAyB,CAAC,yBAAyB,CAAC;QAEvE,aAAQ,GAA0B,IAAI,CAAC;QAC/C;;;;WAIG;QAGI,YAAO,GAA0B,IAAI,CAAC;QAErC,iCAA4B,GAAG,IAAI,CAAC;QAC5C;;;WAGG;QAGI,gCAA2B,GAAG,IAAI,CAAC;QAElC,sBAAiB,GAA0B,IAAI,CAAC;QACxD;;;WAGG;QAGI,qBAAgB,GAA0B,IAAI,CAAC;QAE9C,8BAAyB,GAAG,IAAI,CAAC;QACzC;;WAEG;QAGI,6BAAwB,GAAG,IAAI,CAAC;QAE/B,iBAAY,GAA0B,IAAI,CAAC;QACnD;;WAEG;QAGI,gBAAW,GAA0B,IAAI,CAAC;QAEzC,mBAAc,GAAG,KAAK,CAAC;QAC/B;;WAEG;QAGI,kBAAa,GAAG,KAAK,CAAC;QAE7B;;;WA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SAAS,EAAE;gEACiB;IAW7B;QAFC,SAAS,EAAE;QACX,gBAAgB,CAAC,kCAAkC,CAAC;wEAC0B;IAU/E;QAFC,kBAAkB,EAAE;QACpB,gBAAgB,CAAC,kCAAkC,CAAC;8DACR;IAS7C;QAFC,SAAS,EAAE;QACX,gBAAgB,CAAC,kCAAkC,CAAC;kFACX;IAS1C;QAFC,kBAAkB,EAAE;QACpB,gBAAgB,CAAC,kCAAkC,CAAC;uEACC;IAQtD;QAFC,SAAS,EAAE;QACX,gBAAgB,CAAC,kCAAkC,CAAC;+EACd;IAQvC;QAFC,kBAAkB,EAAE;QACpB,gBAAgB,CAAC,kCAAkC,CAAC;kEACJ;IAQjD;QAFC,SAAS,EAAE;QACX,gBAAgB,CAAC,kCAAkC,CAAC;oEACxB;IAO7B;QADC,iBAAiB,EAAE;gEACc;IAQlC;QADC,SAAS,EAAE;0EACmB;IAO/B;QADC,SAAS,EAAE;oEACqB;IAUjC;QAFC,kBAAkB,EAAE;QACpB,gBAAgB,CAAC,kCAAkC,CAAC;kEACJ;IAqYrD,gCAAC;CAAA,AA9fD,IA8fC;SA9fY,yBAAyB","sourcesContent":["import { Nullable } from \"../../types\";\nimport { SerializationHelper, serialize, serializeAsTexture, expandToProperty, serializeAsColor3 } from \"../../Misc/decorators\";\nimport { Color3 } from '../../Maths/math.color';\nimport { BaseTexture } from \"../../Materials/Textures/baseTexture\";\nimport { MaterialFlags } from \"../materialFlags\";\nimport { UniformBuffer } from \"../../Materials/uniformBuffer\";\nimport { MaterialHelper } from \"../../Materials/materialHelper\";\nimport { IAnimatable } from '../../Animations/animatable.interface';\nimport { EffectFallbacks } from '../effectFallbacks';\nimport { SubMesh } from '../../Meshes/subMesh';\n\ndeclare type Engine = import(\"../../Engines/engine\").Engine;\ndeclare type Scene = import(\"../../scene\").Scene;\n\n/**\n * @hidden\n */\nexport interface IMaterialClearCoatDefines {\n CLEARCOAT: boolean;\n CLEARCOAT_DEFAULTIOR: boolean;\n CLEARCOAT_TEXTURE: boolean;\n CLEARCOAT_TEXTURE_ROUGHNESS: boolean;\n CLEARCOAT_TEXTUREDIRECTUV: number;\n CLEARCOAT_TEXTURE_ROUGHNESSDIRECTUV: number;\n CLEARCOAT_BUMP: boolean;\n CLEARCOAT_BUMPDIRECTUV: number;\n CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE: boolean;\n CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL: boolean;\n CLEARCOAT_REMAP_F0: boolean;\n\n CLEARCOAT_TINT: boolean;\n CLEARCOAT_TINT_TEXTURE: boolean;\n CLEARCOAT_TINT_TEXTUREDIRECTUV: number;\n CLEARCOAT_TINT_GAMMATEXTURE: boolean;\n\n /** @hidden */\n _areTexturesDirty: boolean;\n}\n\n/**\n * Define the code related to the clear coat parameters of the pbr material.\n */\nexport class PBRClearCoatConfiguration {\n /**\n * This defaults to 1.5 corresponding to a 0.04 f0 or a 4% reflectance at normal incidence\n * The default fits with a polyurethane material.\n * @hidden\n */\n public static readonly _DefaultIndexOfRefraction = 1.5;\n\n private _isEnabled = false;\n /**\n * Defines if the clear coat is enabled in the material.\n */\n @serialize()\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\n public isEnabled = false;\n\n /**\n * Defines the clear coat layer strength (between 0 and 1) it defaults to 1.\n */\n @serialize()\n public intensity: number = 1;\n\n /**\n * Defines the clear coat layer roughness.\n */\n @serialize()\n public roughness: number = 0;\n\n private _indexOfRefraction = PBRClearCoatConfiguration._DefaultIndexOfRefraction;\n /**\n * Defines the index of refraction of the clear coat.\n * This defaults to 1.5 corresponding to a 0.04 f0 or a 4% reflectance at normal incidence\n * The default fits with a polyurethane material.\n * Changing the default value is more performance intensive.\n */\n @serialize()\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\n public indexOfRefraction = PBRClearCoatConfiguration._DefaultIndexOfRefraction;\n\n private _texture: Nullable<BaseTexture> = null;\n /**\n * Stores the clear coat values in a texture (red channel is intensity and green channel is roughness)\n * If useRoughnessFromMainTexture is false, the green channel of texture is not used and the green channel of textureRoughness is used instead\n * if textureRoughness is not empty, else no texture roughness is used\n */\n @serializeAsTexture()\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\n public texture: Nullable<BaseTexture> = null;\n\n private _useRoughnessFromMainTexture = true;\n /**\n * Indicates that the green channel of the texture property will be used for roughness (default: true)\n * If false, the green channel from textureRoughness is used for roughness\n */\n @serialize()\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\n public useRoughnessFromMainTexture = true;\n\n private _textureRoughness: Nullable<BaseTexture> = null;\n /**\n * Stores the clear coat roughness in a texture (green channel)\n * Not used if useRoughnessFromMainTexture is true\n */\n @serializeAsTexture()\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\n public textureRoughness: Nullable<BaseTexture> = null;\n\n private _remapF0OnInterfaceChange = true;\n /**\n * Defines if the F0 value should be remapped to account for the interface change in the material.\n */\n @serialize()\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\n public remapF0OnInterfaceChange = true;\n\n private _bumpTexture: Nullable<BaseTexture> = null;\n /**\n * Define the clear coat specific bump texture.\n */\n @serializeAsTexture()\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\n public bumpTexture: Nullable<BaseTexture> = null;\n\n private _isTintEnabled = false;\n /**\n * Defines if the clear coat tint is enabled in the material.\n */\n @serialize()\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\n public isTintEnabled = false;\n\n /**\n * Defines the clear coat tint of the material.\n * This is only use if tint is enabled\n */\n @serializeAsColor3()\n public tintColor = Color3.White();\n\n /**\n * Defines the distance at which the tint color should be found in the\n * clear coat media.\n * This is only use if tint is enabled\n */\n @serialize()\n public tintColorAtDistance = 1;\n\n /**\n * Defines the clear coat layer thickness.\n * This is only use if tint is enabled\n */\n @serialize()\n public tintThickness: number = 1;\n\n private _tintTexture: Nullable<BaseTexture> = null;\n /**\n * Stores the clear tint values in a texture.\n * rgb is tint\n * a is a thickness factor\n */\n @serializeAsTexture()\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\n public tintTexture: Nullable<BaseTexture> = null;\n\n /** @hidden */\n private _internalMarkAllSubMeshesAsTexturesDirty: () => void;\n\n /** @hidden */\n public _markAllSubMeshesAsTexturesDirty(): void {\n this._internalMarkAllSubMeshesAsTexturesDirty();\n }\n\n /**\n * Instantiate a new instance of clear coat configuration.\n * @param markAllSubMeshesAsTexturesDirty Callback to flag the material to dirty\n */\n constructor(markAllSubMeshesAsTexturesDirty: () => void) {\n this._internalMarkAllSubMeshesAsTexturesDirty = markAllSubMeshesAsTexturesDirty;\n }\n\n /**\n * Gets whether the submesh is ready to be used or not.\n * @param defines the list of \"defines\" to update.\n * @param scene defines the scene the material belongs to.\n * @param engine defines the engine the material belongs to.\n * @param disableBumpMap defines whether the material disables bump or not.\n * @returns - boolean indicating that the submesh is ready or not.\n */\n public isReadyForSubMesh(defines: IMaterialClearCoatDefines, scene: Scene, engine: Engine, disableBumpMap: boolean): boolean {\n if (!this._isEnabled) {\n return true;\n }\n\n if (defines._areTexturesDirty) {\n if (scene.texturesEnabled) {\n if (this._texture && MaterialFlags.ClearCoatTextureEnabled) {\n if (!this._texture.isReadyOrNotBlocking()) {\n return false;\n }\n }\n\n if (this._textureRoughness && MaterialFlags.ClearCoatTextureEnabled) {\n if (!this._textureRoughness.isReadyOrNotBlocking()) {\n return false;\n }\n }\n\n if (engine.getCaps().standardDerivatives && this._bumpTexture && MaterialFlags.ClearCoatBumpTextureEnabled && !disableBumpMap) {\n // Bump texture cannot be not blocking.\n if (!this._bumpTexture.isReady()) {\n return false;\n }\n }\n\n if (this._isTintEnabled && this._tintTexture && MaterialFlags.ClearCoatTintTextureEnabled) {\n if (!this._tintTexture.isReadyOrNotBlocking()) {\n return false;\n }\n }\n }\n }\n\n return true;\n }\n\n /**\n * Checks to see if a texture is used in the material.\n * @param defines the list of \"defines\" to update.\n * @param scene defines the scene to the material belongs to.\n */\n public prepareDefines(defines: IMaterialClearCoatDefines, scene: Scene): void {\n if (this._isEnabled) {\n defines.CLEARCOAT = true;\n defines.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE = this._useRoughnessFromMainTexture;\n defines.CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL = this._texture !== null && this._texture._texture === this._textureRoughness?._texture && this._texture.checkTransformsAreIdentical(this._textureRoughness);\n defines.CLEARCOAT_REMAP_F0 = this._remapF0OnInterfaceChange;\n\n if (defines._areTexturesDirty) {\n if (scene.texturesEnabled) {\n if (this._texture && MaterialFlags.ClearCoatTextureEnabled) {\n MaterialHelper.PrepareDefinesForMergedUV(this._texture, defines, \"CLEARCOAT_TEXTURE\");\n } else {\n defines.CLEARCOAT_TEXTURE = false;\n }\n\n if (this._textureRoughness && MaterialFlags.ClearCoatTextureEnabled) {\n MaterialHelper.PrepareDefinesForMergedUV(this._textureRoughness, defines, \"CLEARCOAT_TEXTURE_ROUGHNESS\");\n } else {\n defines.CLEARCOAT_TEXTURE_ROUGHNESS = false;\n }\n\n if (this._bumpTexture && MaterialFlags.ClearCoatBumpTextureEnabled) {\n MaterialHelper.PrepareDefinesForMergedUV(this._bumpTexture, defines, \"CLEARCOAT_BUMP\");\n } else {\n defines.CLEARCOAT_BUMP = false;\n }\n\n defines.CLEARCOAT_DEFAULTIOR = this._indexOfRefraction === PBRClearCoatConfiguration._DefaultIndexOfRefraction;\n\n if (this._isTintEnabled) {\n defines.CLEARCOAT_TINT = true;\n if (this._tintTexture && MaterialFlags.ClearCoatTintTextureEnabled) {\n MaterialHelper.PrepareDefinesForMergedUV(this._tintTexture, defines, \"CLEARCOAT_TINT_TEXTURE\");\n defines.CLEARCOAT_TINT_GAMMATEXTURE = this._tintTexture.gammaSpace;\n }\n else {\n defines.CLEARCOAT_TINT_TEXTURE = false;\n }\n }\n else {\n defines.CLEARCOAT_TINT = false;\n defines.CLEARCOAT_TINT_TEXTURE = false;\n }\n }\n }\n }\n else {\n defines.CLEARCOAT = false;\n defines.CLEARCOAT_TEXTURE = false;\n defines.CLEARCOAT_TEXTURE_ROUGHNESS = false;\n defines.CLEARCOAT_BUMP = false;\n defines.CLEARCOAT_TINT = false;\n defines.CLEARCOAT_TINT_TEXTURE = false;\n defines.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE = false;\n defines.CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL = false;\n }\n }\n\n /**\n * Binds the material data.\n * @param uniformBuffer defines the Uniform buffer to fill in.\n * @param scene defines the scene the material belongs to.\n * @param engine defines the engine the material belongs to.\n * @param disableBumpMap defines whether the material disables bump or not.\n * @param isFrozen defines whether the material is frozen or not.\n * @param invertNormalMapX If sets to true, x component of normal map value will be inverted (x = 1.0 - x).\n * @param invertNormalMapY If sets to true, y component of normal map value will be inverted (y = 1.0 - y).\n * @param subMesh the submesh to bind data for\n */\n public bindForSubMesh(uniformBuffer: UniformBuffer, scene: Scene, engine: Engine, disableBumpMap: boolean, isFrozen: boolean, invertNormalMapX: boolean, invertNormalMapY: boolean, subMesh?: SubMesh): void {\n if (!this._isEnabled) {\n return;\n }\n\n const defines = subMesh!.materialDefines as unknown as IMaterialClearCoatDefines;\n\n const identicalTextures = defines.CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL;\n\n if (!uniformBuffer.useUbo || !isFrozen || !uniformBuffer.isSync) {\n if (identicalTextures && MaterialFlags.ClearCoatTextureEnabled) {\n uniformBuffer.updateFloat4(\"vClearCoatInfos\", this._texture!.coordinatesIndex, this._texture!.level, -1, -1);\n MaterialHelper.BindTextureMatrix(this._texture!, uniformBuffer, \"clearCoat\");\n } else if ((this._texture || this._textureRoughness) && MaterialFlags.ClearCoatTextureEnabled) {\n uniformBuffer.updateFloat4(\"vClearCoatInfos\", this._texture?.coordinatesIndex ?? 0, this._texture?.level ?? 0, this._textureRoughness?.coordinatesIndex ?? 0, this._textureRoughness?.level ?? 0);\n if (this._texture) {\n MaterialHelper.BindTextureMatrix(this._texture, uniformBuffer, \"clearCoat\");\n }\n if (this._textureRoughness && !identicalTextures && !defines.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE) {\n MaterialHelper.BindTextureMatrix(this._textureRoughness, uniformBuffer, \"clearCoatRoughness\");\n }\n }\n\n if (this._bumpTexture && engine.getCaps().standardDerivatives && MaterialFlags.ClearCoatTextureEnabled && !disableBumpMap) {\n uniformBuffer.updateFloat2(\"vClearCoatBumpInfos\", this._bumpTexture.coordinatesIndex, this._bumpTexture.level);\n MaterialHelper.BindTextureMatrix(this._bumpTexture, uniformBuffer, \"clearCoatBump\");\n\n if (scene._mirroredCameraPosition) {\n uniformBuffer.updateFloat2(\"vClearCoatTangentSpaceParams\", invertNormalMapX ? 1.0 : -1.0, invertNormalMapY ? 1.0 : -1.0);\n } else {\n uniformBuffer.updateFloat2(\"vClearCoatTangentSpaceParams\", invertNormalMapX ? -1.0 : 1.0, invertNormalMapY ? -1.0 : 1.0);\n }\n }\n\n if (this._tintTexture && MaterialFlags.ClearCoatTintTextureEnabled) {\n uniformBuffer.updateFloat2(\"vClearCoatTintInfos\", this._tintTexture.coordinatesIndex, this._tintTexture.level);\n MaterialHelper.BindTextureMatrix(this._tintTexture, uniformBuffer, \"clearCoatTint\");\n }\n\n // Clear Coat General params\n uniformBuffer.updateFloat2(\"vClearCoatParams\", this.intensity, this.roughness);\n\n // Clear Coat Refraction params\n const a = 1 - this._indexOfRefraction;\n const b = 1 + this._indexOfRefraction;\n const f0 = Math.pow((-a / b), 2); // Schlicks approx: (ior1 - ior2) / (ior1 + ior2) where ior2 for air is close to vacuum = 1.\n const eta = 1 / this._indexOfRefraction;\n uniformBuffer.updateFloat4(\"vClearCoatRefractionParams\", f0, eta, a, b);\n\n if (this._isTintEnabled) {\n uniformBuffer.updateFloat4(\"vClearCoatTintParams\",\n this.tintColor.r,\n this.tintColor.g,\n this.tintColor.b,\n Math.max(0.00001, this.tintThickness));\n uniformBuffer.updateFloat(\"clearCoatColorAtDistance\", Math.max(0.00001, this.tintColorAtDistance));\n }\n }\n\n // Textures\n if (scene.texturesEnabled) {\n if (this._texture && MaterialFlags.ClearCoatTextureEnabled) {\n uniformBuffer.setTexture(\"clearCoatSampler\", this._texture);\n }\n\n if (this._textureRoughness && !identicalTextures && !defines.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE && MaterialFlags.ClearCoatTextureEnabled) {\n uniformBuffer.setTexture(\"clearCoatRoughnessSampler\", this._textureRoughness);\n }\n\n if (this._bumpTexture && engine.getCaps().standardDerivatives && MaterialFlags.ClearCoatBumpTextureEnabled && !disableBumpMap) {\n uniformBuffer.setTexture(\"clearCoatBumpSampler\", this._bumpTexture);\n }\n\n if (this._isTintEnabled && this._tintTexture && MaterialFlags.ClearCoatTintTextureEnabled) {\n uniformBuffer.setTexture(\"clearCoatTintSampler\", this._tintTexture);\n }\n }\n }\n\n /**\n * Checks to see if a texture is used in the material.\n * @param texture - Base texture to use.\n * @returns - Boolean specifying if a texture is used in the material.\n */\n public hasTexture(texture: BaseTexture): boolean {\n if (this._texture === texture) {\n return true;\n }\n\n if (this._textureRoughness === texture) {\n return true;\n }\n\n if (this._bumpTexture === texture) {\n return true;\n }\n\n if (this._tintTexture === texture) {\n return true;\n }\n\n return false;\n }\n\n /**\n * Returns an array of the actively used textures.\n * @param activeTextures Array of BaseTextures\n */\n public getActiveTextures(activeTextures: BaseTexture[]): void {\n if (this._texture) {\n activeTextures.push(this._texture);\n }\n\n if (this._textureRoughness) {\n activeTextures.push(this._textureRoughness);\n }\n\n if (this._bumpTexture) {\n activeTextures.push(this._bumpTexture);\n }\n\n if (this._tintTexture) {\n activeTextures.push(this._tintTexture);\n }\n }\n\n /**\n * Returns the animatable textures.\n * @param animatables Array of animatable textures.\n */\n public getAnimatables(animatables: IAnimatable[]): void {\n if (this._texture && this._texture.animations && this._texture.animations.length > 0) {\n animatables.push(this._texture);\n }\n\n if (this._textureRoughness && this._textureRoughness.animations && this._textureRoughness.animations.length > 0) {\n animatables.push(this._textureRoughness);\n }\n\n if (this._bumpTexture && this._bumpTexture.animations && this._bumpTexture.animations.length > 0) {\n animatables.push(this._bumpTexture);\n }\n\n if (this._tintTexture && this._tintTexture.animations && this._tintTexture.animations.length > 0) {\n animatables.push(this._tintTexture);\n }\n }\n\n /**\n * Disposes the resources of the material.\n * @param forceDisposeTextures - Forces the disposal of all textures.\n */\n public dispose(forceDisposeTextures?: boolean): void {\n if (forceDisposeTextures) {\n this._texture?.dispose();\n this._textureRoughness?.dispose();\n this._bumpTexture?.dispose();\n this._tintTexture?.dispose();\n }\n }\n\n /**\n * Get the current class name of the texture useful for serialization or dynamic coding.\n * @returns \"PBRClearCoatConfiguration\"\n */\n public getClassName(): string {\n return \"PBRClearCoatConfiguration\";\n }\n\n /**\n * Add fallbacks to the effect fallbacks list.\n * @param defines defines the Base texture to use.\n * @param fallbacks defines the current fallback list.\n * @param currentRank defines the current fallback rank.\n * @returns the new fallback rank.\n */\n public static AddFallbacks(defines: IMaterialClearCoatDefines, fallbacks: EffectFallbacks, currentRank: number): number {\n if (defines.CLEARCOAT_BUMP) {\n fallbacks.addFallback(currentRank++, \"CLEARCOAT_BUMP\");\n }\n if (defines.CLEARCOAT_TINT) {\n fallbacks.addFallback(currentRank++, \"CLEARCOAT_TINT\");\n }\n if (defines.CLEARCOAT) {\n fallbacks.addFallback(currentRank++, \"CLEARCOAT\");\n }\n return currentRank;\n }\n\n /**\n * Add the required uniforms to the current list.\n * @param uniforms defines the current uniform list.\n */\n public static AddUniforms(uniforms: string[]): void {\n uniforms.push(\"vClearCoatTangentSpaceParams\", \"vClearCoatParams\", \"vClearCoatRefractionParams\",\n \"vClearCoatTintParams\", \"clearCoatColorAtDistance\",\n \"clearCoatMatrix\", \"clearCoatRoughnessMatrix\", \"clearCoatBumpMatrix\", \"clearCoatTintMatrix\",\n \"vClearCoatInfos\", \"vClearCoatBumpInfos\", \"vClearCoatTintInfos\");\n }\n\n /**\n * Add the required samplers to the current list.\n * @param samplers defines the current sampler list.\n */\n public static AddSamplers(samplers: string[]): void {\n samplers.push(\"clearCoatSampler\", \"clearCoatRoughnessSampler\", \"clearCoatBumpSampler\", \"clearCoatTintSampler\");\n }\n\n /**\n * Add the required uniforms to the current buffer.\n * @param uniformBuffer defines the current uniform buffer.\n */\n public static PrepareUniformBuffer(uniformBuffer: UniformBuffer): void {\n uniformBuffer.addUniform(\"vClearCoatParams\", 2);\n uniformBuffer.addUniform(\"vClearCoatRefractionParams\", 4);\n uniformBuffer.addUniform(\"vClearCoatInfos\", 4);\n uniformBuffer.addUniform(\"clearCoatMatrix\", 16);\n uniformBuffer.addUniform(\"clearCoatRoughnessMatrix\", 16);\n uniformBuffer.addUniform(\"vClearCoatBumpInfos\", 2);\n uniformBuffer.addUniform(\"vClearCoatTangentSpaceParams\", 2);\n uniformBuffer.addUniform(\"clearCoatBumpMatrix\", 16);\n uniformBuffer.addUniform(\"vClearCoatTintParams\", 4);\n uniformBuffer.addUniform(\"clearCoatColorAtDistance\", 1);\n uniformBuffer.addUniform(\"vClearCoatTintInfos\", 2);\n uniformBuffer.addUniform(\"clearCoatTintMatrix\", 16);\n }\n\n /**\n * Makes a duplicate of the current configuration into another one.\n * @param clearCoatConfiguration define the config where to copy the info\n */\n public copyTo(clearCoatConfiguration: PBRClearCoatConfiguration): void {\n SerializationHelper.Clone(() => clearCoatConfiguration, this);\n }\n\n /**\n * Serializes this clear coat configuration.\n * @returns - An object with the serialized config.\n */\n public serialize(): any {\n return SerializationHelper.Serialize(this);\n }\n\n /**\n * Parses a anisotropy Configuration from a serialized object.\n * @param source - Serialized object.\n * @param scene Defines the scene we are parsing for\n * @param rootUrl Defines the rootUrl to load from\n */\n public parse(source: any, scene: Scene, rootUrl: string): void {\n SerializationHelper.Parse(() => this, source, scene, rootUrl);\n }\n}"]}
1
+ {"version":3,"file":"pbrClearCoatConfiguration.js","sourceRoot":"","sources":["../../../../sourceES6/core/Materials/PBR/pbrClearCoatConfiguration.ts"],"names":[],"mappings":";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","sourcesContent":["import { Nullable } from \"../../types\";\r\nimport { serialize, serializeAsTexture, expandToProperty, serializeAsColor3 } from \"../../Misc/decorators\";\r\nimport { Color3 } from '../../Maths/math.color';\r\nimport { BaseTexture } from \"../../Materials/Textures/baseTexture\";\r\nimport { MaterialFlags } from \"../materialFlags\";\r\nimport { UniformBuffer } from \"../../Materials/uniformBuffer\";\r\nimport { MaterialHelper } from \"../../Materials/materialHelper\";\r\nimport { IAnimatable } from '../../Animations/animatable.interface';\r\nimport { EffectFallbacks } from '../effectFallbacks';\r\nimport { SubMesh } from '../../Meshes/subMesh';\r\n\r\nimport { MaterialPluginBase } from \"../materialPluginBase\";\r\nimport { MaterialDefines } from \"../materialDefines\";\r\n\r\ndeclare type Engine = import(\"../../Engines/engine\").Engine;\r\ndeclare type Scene = import(\"../../scene\").Scene;\r\ndeclare type AbstractMesh = import(\"../../Meshes/abstractMesh\").AbstractMesh;\r\ndeclare type PBRBaseMaterial = import(\"./pbrBaseMaterial\").PBRBaseMaterial;\r\n\r\n/**\r\n * @hidden\r\n */\r\nexport class MaterialClearCoatDefines extends MaterialDefines {\r\n public CLEARCOAT = false;\r\n public CLEARCOAT_DEFAULTIOR = false;\r\n public CLEARCOAT_TEXTURE = false;\r\n public CLEARCOAT_TEXTURE_ROUGHNESS = false;\r\n public CLEARCOAT_TEXTUREDIRECTUV = 0;\r\n public CLEARCOAT_TEXTURE_ROUGHNESSDIRECTUV = 0;\r\n public CLEARCOAT_BUMP = false;\r\n public CLEARCOAT_BUMPDIRECTUV = 0;\r\n public CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE = false;\r\n public CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL = false;\r\n public CLEARCOAT_REMAP_F0 = false;\r\n\r\n public CLEARCOAT_TINT = false;\r\n public CLEARCOAT_TINT_TEXTURE = false;\r\n public CLEARCOAT_TINT_TEXTUREDIRECTUV = 0;\r\n public CLEARCOAT_TINT_GAMMATEXTURE = false;\r\n}\r\n\r\n/**\r\n * Plugin that implements the clear coat component of the PBR material\r\n */\r\nexport class PBRClearCoatConfiguration extends MaterialPluginBase {\r\n protected _material: PBRBaseMaterial;\r\n\r\n /**\r\n * This defaults to 1.5 corresponding to a 0.04 f0 or a 4% reflectance at normal incidence\r\n * The default fits with a polyurethane material.\r\n * @hidden\r\n */\r\n public static readonly _DefaultIndexOfRefraction = 1.5;\r\n\r\n private _isEnabled = false;\r\n /**\r\n * Defines if the clear coat is enabled in the material.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public isEnabled = false;\r\n\r\n /**\r\n * Defines the clear coat layer strength (between 0 and 1) it defaults to 1.\r\n */\r\n @serialize()\r\n public intensity: number = 1;\r\n\r\n /**\r\n * Defines the clear coat layer roughness.\r\n */\r\n @serialize()\r\n public roughness: number = 0;\r\n\r\n private _indexOfRefraction = PBRClearCoatConfiguration._DefaultIndexOfRefraction;\r\n /**\r\n * Defines the index of refraction of the clear coat.\r\n * This defaults to 1.5 corresponding to a 0.04 f0 or a 4% reflectance at normal incidence\r\n * The default fits with a polyurethane material.\r\n * Changing the default value is more performance intensive.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public indexOfRefraction = PBRClearCoatConfiguration._DefaultIndexOfRefraction;\r\n\r\n private _texture: Nullable<BaseTexture> = null;\r\n /**\r\n * Stores the clear coat values in a texture (red channel is intensity and green channel is roughness)\r\n * If useRoughnessFromMainTexture is false, the green channel of texture is not used and the green channel of textureRoughness is used instead\r\n * if textureRoughness is not empty, else no texture roughness is used\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public texture: Nullable<BaseTexture> = null;\r\n\r\n private _useRoughnessFromMainTexture = true;\r\n /**\r\n * Indicates that the green channel of the texture property will be used for roughness (default: true)\r\n * If false, the green channel from textureRoughness is used for roughness\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useRoughnessFromMainTexture = true;\r\n\r\n private _textureRoughness: Nullable<BaseTexture> = null;\r\n /**\r\n * Stores the clear coat roughness in a texture (green channel)\r\n * Not used if useRoughnessFromMainTexture is true\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public textureRoughness: Nullable<BaseTexture> = null;\r\n\r\n private _remapF0OnInterfaceChange = true;\r\n /**\r\n * Defines if the F0 value should be remapped to account for the interface change in the material.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public remapF0OnInterfaceChange = true;\r\n\r\n private _bumpTexture: Nullable<BaseTexture> = null;\r\n /**\r\n * Define the clear coat specific bump texture.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public bumpTexture: Nullable<BaseTexture> = null;\r\n\r\n private _isTintEnabled = false;\r\n /**\r\n * Defines if the clear coat tint is enabled in the material.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public isTintEnabled = false;\r\n\r\n /**\r\n * Defines the clear coat tint of the material.\r\n * This is only use if tint is enabled\r\n */\r\n @serializeAsColor3()\r\n public tintColor = Color3.White();\r\n\r\n /**\r\n * Defines the distance at which the tint color should be found in the\r\n * clear coat media.\r\n * This is only use if tint is enabled\r\n */\r\n @serialize()\r\n public tintColorAtDistance = 1;\r\n\r\n /**\r\n * Defines the clear coat layer thickness.\r\n * This is only use if tint is enabled\r\n */\r\n @serialize()\r\n public tintThickness: number = 1;\r\n\r\n private _tintTexture: Nullable<BaseTexture> = null;\r\n /**\r\n * Stores the clear tint values in a texture.\r\n * rgb is tint\r\n * a is a thickness factor\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public tintTexture: Nullable<BaseTexture> = null;\r\n\r\n /** @hidden */\r\n private _internalMarkAllSubMeshesAsTexturesDirty: () => void;\r\n\r\n /** @hidden */\r\n public _markAllSubMeshesAsTexturesDirty(): void {\r\n this._enable(this._isEnabled);\r\n this._internalMarkAllSubMeshesAsTexturesDirty();\r\n }\r\n\r\n constructor(material: PBRBaseMaterial, addToPluginList = true) {\r\n super(material, \"PBRClearCoat\", 100, new MaterialClearCoatDefines(), addToPluginList);\r\n\r\n this._internalMarkAllSubMeshesAsTexturesDirty = material._dirtyCallbacks[1];\r\n }\r\n\r\n public isReadyForSubMesh(defines: MaterialClearCoatDefines, scene: Scene, engine: Engine): boolean {\r\n if (!this._isEnabled) {\r\n return true;\r\n }\r\n\r\n const disableBumpMap = this._material._disableBumpMap;\r\n if (defines._areTexturesDirty) {\r\n if (scene.texturesEnabled) {\r\n if (this._texture && MaterialFlags.ClearCoatTextureEnabled) {\r\n if (!this._texture.isReadyOrNotBlocking()) {\r\n return false;\r\n }\r\n }\r\n\r\n if (this._textureRoughness && MaterialFlags.ClearCoatTextureEnabled) {\r\n if (!this._textureRoughness.isReadyOrNotBlocking()) {\r\n return false;\r\n }\r\n }\r\n\r\n if (engine.getCaps().standardDerivatives && this._bumpTexture && MaterialFlags.ClearCoatBumpTextureEnabled && !disableBumpMap) {\r\n // Bump texture cannot be not blocking.\r\n if (!this._bumpTexture.isReady()) {\r\n return false;\r\n }\r\n }\r\n\r\n if (this._isTintEnabled && this._tintTexture && MaterialFlags.ClearCoatTintTextureEnabled) {\r\n if (!this._tintTexture.isReadyOrNotBlocking()) {\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n public prepareDefines(defines: MaterialClearCoatDefines, scene: Scene, mesh: AbstractMesh): void {\r\n if (this._isEnabled) {\r\n defines.CLEARCOAT = true;\r\n defines.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE = this._useRoughnessFromMainTexture;\r\n defines.CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL = this._texture !== null && this._texture._texture === this._textureRoughness?._texture && this._texture.checkTransformsAreIdentical(this._textureRoughness);\r\n defines.CLEARCOAT_REMAP_F0 = this._remapF0OnInterfaceChange;\r\n\r\n if (defines._areTexturesDirty) {\r\n if (scene.texturesEnabled) {\r\n if (this._texture && MaterialFlags.ClearCoatTextureEnabled) {\r\n MaterialHelper.PrepareDefinesForMergedUV(this._texture, defines, \"CLEARCOAT_TEXTURE\");\r\n } else {\r\n defines.CLEARCOAT_TEXTURE = false;\r\n }\r\n\r\n if (this._textureRoughness && MaterialFlags.ClearCoatTextureEnabled) {\r\n MaterialHelper.PrepareDefinesForMergedUV(this._textureRoughness, defines, \"CLEARCOAT_TEXTURE_ROUGHNESS\");\r\n } else {\r\n defines.CLEARCOAT_TEXTURE_ROUGHNESS = false;\r\n }\r\n\r\n if (this._bumpTexture && MaterialFlags.ClearCoatBumpTextureEnabled) {\r\n MaterialHelper.PrepareDefinesForMergedUV(this._bumpTexture, defines, \"CLEARCOAT_BUMP\");\r\n } else {\r\n defines.CLEARCOAT_BUMP = false;\r\n }\r\n\r\n defines.CLEARCOAT_DEFAULTIOR = this._indexOfRefraction === PBRClearCoatConfiguration._DefaultIndexOfRefraction;\r\n\r\n if (this._isTintEnabled) {\r\n defines.CLEARCOAT_TINT = true;\r\n if (this._tintTexture && MaterialFlags.ClearCoatTintTextureEnabled) {\r\n MaterialHelper.PrepareDefinesForMergedUV(this._tintTexture, defines, \"CLEARCOAT_TINT_TEXTURE\");\r\n defines.CLEARCOAT_TINT_GAMMATEXTURE = this._tintTexture.gammaSpace;\r\n }\r\n else {\r\n defines.CLEARCOAT_TINT_TEXTURE = false;\r\n }\r\n }\r\n else {\r\n defines.CLEARCOAT_TINT = false;\r\n defines.CLEARCOAT_TINT_TEXTURE = false;\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n defines.CLEARCOAT = false;\r\n defines.CLEARCOAT_TEXTURE = false;\r\n defines.CLEARCOAT_TEXTURE_ROUGHNESS = false;\r\n defines.CLEARCOAT_BUMP = false;\r\n defines.CLEARCOAT_TINT = false;\r\n defines.CLEARCOAT_TINT_TEXTURE = false;\r\n defines.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE = false;\r\n defines.CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL = false;\r\n }\r\n }\r\n\r\n public bindForSubMesh(uniformBuffer: UniformBuffer, scene: Scene, engine: Engine, subMesh: SubMesh): void {\r\n if (!this._isEnabled) {\r\n return;\r\n }\r\n\r\n const defines = subMesh!.materialDefines as unknown as MaterialClearCoatDefines;\r\n\r\n const isFrozen = this._material.isFrozen;\r\n\r\n const disableBumpMap = this._material._disableBumpMap;\r\n const invertNormalMapX = this._material._invertNormalMapX;\r\n const invertNormalMapY = this._material._invertNormalMapY;\r\n\r\n const identicalTextures = defines.CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL;\r\n\r\n if (!uniformBuffer.useUbo || !isFrozen || !uniformBuffer.isSync) {\r\n if (identicalTextures && MaterialFlags.ClearCoatTextureEnabled) {\r\n uniformBuffer.updateFloat4(\"vClearCoatInfos\", this._texture!.coordinatesIndex, this._texture!.level, -1, -1);\r\n MaterialHelper.BindTextureMatrix(this._texture!, uniformBuffer, \"clearCoat\");\r\n } else if ((this._texture || this._textureRoughness) && MaterialFlags.ClearCoatTextureEnabled) {\r\n uniformBuffer.updateFloat4(\"vClearCoatInfos\", this._texture?.coordinatesIndex ?? 0, this._texture?.level ?? 0, this._textureRoughness?.coordinatesIndex ?? 0, this._textureRoughness?.level ?? 0);\r\n if (this._texture) {\r\n MaterialHelper.BindTextureMatrix(this._texture, uniformBuffer, \"clearCoat\");\r\n }\r\n if (this._textureRoughness && !identicalTextures && !defines.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE) {\r\n MaterialHelper.BindTextureMatrix(this._textureRoughness, uniformBuffer, \"clearCoatRoughness\");\r\n }\r\n }\r\n\r\n if (this._bumpTexture && engine.getCaps().standardDerivatives && MaterialFlags.ClearCoatTextureEnabled && !disableBumpMap) {\r\n uniformBuffer.updateFloat2(\"vClearCoatBumpInfos\", this._bumpTexture.coordinatesIndex, this._bumpTexture.level);\r\n MaterialHelper.BindTextureMatrix(this._bumpTexture, uniformBuffer, \"clearCoatBump\");\r\n\r\n if (scene._mirroredCameraPosition) {\r\n uniformBuffer.updateFloat2(\"vClearCoatTangentSpaceParams\", invertNormalMapX ? 1.0 : -1.0, invertNormalMapY ? 1.0 : -1.0);\r\n } else {\r\n uniformBuffer.updateFloat2(\"vClearCoatTangentSpaceParams\", invertNormalMapX ? -1.0 : 1.0, invertNormalMapY ? -1.0 : 1.0);\r\n }\r\n }\r\n\r\n if (this._tintTexture && MaterialFlags.ClearCoatTintTextureEnabled) {\r\n uniformBuffer.updateFloat2(\"vClearCoatTintInfos\", this._tintTexture.coordinatesIndex, this._tintTexture.level);\r\n MaterialHelper.BindTextureMatrix(this._tintTexture, uniformBuffer, \"clearCoatTint\");\r\n }\r\n\r\n // Clear Coat General params\r\n uniformBuffer.updateFloat2(\"vClearCoatParams\", this.intensity, this.roughness);\r\n\r\n // Clear Coat Refraction params\r\n const a = 1 - this._indexOfRefraction;\r\n const b = 1 + this._indexOfRefraction;\r\n const f0 = Math.pow((-a / b), 2); // Schlicks approx: (ior1 - ior2) / (ior1 + ior2) where ior2 for air is close to vacuum = 1.\r\n const eta = 1 / this._indexOfRefraction;\r\n uniformBuffer.updateFloat4(\"vClearCoatRefractionParams\", f0, eta, a, b);\r\n\r\n if (this._isTintEnabled) {\r\n uniformBuffer.updateFloat4(\"vClearCoatTintParams\",\r\n this.tintColor.r,\r\n this.tintColor.g,\r\n this.tintColor.b,\r\n Math.max(0.00001, this.tintThickness));\r\n uniformBuffer.updateFloat(\"clearCoatColorAtDistance\", Math.max(0.00001, this.tintColorAtDistance));\r\n }\r\n }\r\n\r\n // Textures\r\n if (scene.texturesEnabled) {\r\n if (this._texture && MaterialFlags.ClearCoatTextureEnabled) {\r\n uniformBuffer.setTexture(\"clearCoatSampler\", this._texture);\r\n }\r\n\r\n if (this._textureRoughness && !identicalTextures && !defines.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE && MaterialFlags.ClearCoatTextureEnabled) {\r\n uniformBuffer.setTexture(\"clearCoatRoughnessSampler\", this._textureRoughness);\r\n }\r\n\r\n if (this._bumpTexture && engine.getCaps().standardDerivatives && MaterialFlags.ClearCoatBumpTextureEnabled && !disableBumpMap) {\r\n uniformBuffer.setTexture(\"clearCoatBumpSampler\", this._bumpTexture);\r\n }\r\n\r\n if (this._isTintEnabled && this._tintTexture && MaterialFlags.ClearCoatTintTextureEnabled) {\r\n uniformBuffer.setTexture(\"clearCoatTintSampler\", this._tintTexture);\r\n }\r\n }\r\n }\r\n\r\n public hasTexture(texture: BaseTexture): boolean {\r\n if (this._texture === texture) {\r\n return true;\r\n }\r\n\r\n if (this._textureRoughness === texture) {\r\n return true;\r\n }\r\n\r\n if (this._bumpTexture === texture) {\r\n return true;\r\n }\r\n\r\n if (this._tintTexture === texture) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n public getActiveTextures(activeTextures: BaseTexture[]): void {\r\n if (this._texture) {\r\n activeTextures.push(this._texture);\r\n }\r\n\r\n if (this._textureRoughness) {\r\n activeTextures.push(this._textureRoughness);\r\n }\r\n\r\n if (this._bumpTexture) {\r\n activeTextures.push(this._bumpTexture);\r\n }\r\n\r\n if (this._tintTexture) {\r\n activeTextures.push(this._tintTexture);\r\n }\r\n }\r\n\r\n public getAnimatables(animatables: IAnimatable[]): void {\r\n if (this._texture && this._texture.animations && this._texture.animations.length > 0) {\r\n animatables.push(this._texture);\r\n }\r\n\r\n if (this._textureRoughness && this._textureRoughness.animations && this._textureRoughness.animations.length > 0) {\r\n animatables.push(this._textureRoughness);\r\n }\r\n\r\n if (this._bumpTexture && this._bumpTexture.animations && this._bumpTexture.animations.length > 0) {\r\n animatables.push(this._bumpTexture);\r\n }\r\n\r\n if (this._tintTexture && this._tintTexture.animations && this._tintTexture.animations.length > 0) {\r\n animatables.push(this._tintTexture);\r\n }\r\n }\r\n\r\n public dispose(forceDisposeTextures?: boolean): void {\r\n if (forceDisposeTextures) {\r\n this._texture?.dispose();\r\n this._textureRoughness?.dispose();\r\n this._bumpTexture?.dispose();\r\n this._tintTexture?.dispose();\r\n }\r\n }\r\n\r\n public getClassName(): string {\r\n return \"PBRClearCoatConfiguration\";\r\n }\r\n\r\n public addFallbacks(defines: MaterialClearCoatDefines, fallbacks: EffectFallbacks, currentRank: number): number {\r\n if (defines.CLEARCOAT_BUMP) {\r\n fallbacks.addFallback(currentRank++, \"CLEARCOAT_BUMP\");\r\n }\r\n if (defines.CLEARCOAT_TINT) {\r\n fallbacks.addFallback(currentRank++, \"CLEARCOAT_TINT\");\r\n }\r\n if (defines.CLEARCOAT) {\r\n fallbacks.addFallback(currentRank++, \"CLEARCOAT\");\r\n }\r\n return currentRank;\r\n }\r\n\r\n public getSamplers(samplers: string[]): void {\r\n samplers.push(\"clearCoatSampler\", \"clearCoatRoughnessSampler\", \"clearCoatBumpSampler\", \"clearCoatTintSampler\");\r\n }\r\n\r\n public getUniforms(): { ubo?: Array<{ name: string; size: number; type: string }>; vertex?: string; fragment?: string } {\r\n return {\r\n ubo: [\r\n { name: \"vClearCoatParams\", size: 2, type: \"vec2\" },\r\n { name: \"vClearCoatRefractionParams\", size: 4, type: \"vec4\" },\r\n { name: \"vClearCoatInfos\", size: 4, type: \"vec4\" },\r\n { name: \"clearCoatMatrix\", size: 16, type: \"mat4\" },\r\n { name: \"clearCoatRoughnessMatrix\", size: 16, type: \"mat4\" },\r\n { name: \"vClearCoatBumpInfos\", size: 2, type: \"vec2\" },\r\n { name: \"vClearCoatTangentSpaceParams\", size: 2, type: \"vec2\" },\r\n { name: \"clearCoatBumpMatrix\", size: 16, type: \"mat4\" },\r\n { name: \"vClearCoatTintParams\", size: 4, type: \"vec4\" },\r\n { name: \"clearCoatColorAtDistance\", size: 1, type: \"float\" },\r\n { name: \"vClearCoatTintInfos\", size: 2, type: \"vec2\" },\r\n { name: \"clearCoatTintMatrix\", size: 16, type: \"mat4\" },\r\n ],\r\n };\r\n }\r\n}\r\n"]}
@@ -1,15 +1,20 @@
1
1
  import { UniformBuffer } from "../../Materials/uniformBuffer";
2
2
  import { Color3 } from '../../Maths/math.color';
3
- import { Scene } from "../../scene";
4
3
  import { BaseTexture } from "../../Materials/Textures/baseTexture";
5
4
  import { Nullable } from "../../types";
6
5
  import { IAnimatable } from '../../Animations/animatable.interface';
7
6
  import { EffectFallbacks } from '../effectFallbacks';
8
7
  import { SubMesh } from '../../Meshes/subMesh';
8
+ import { MaterialPluginBase } from "../materialPluginBase";
9
+ import { MaterialDefines } from "../materialDefines";
10
+ declare type Engine = import("../../Engines/engine").Engine;
11
+ declare type Scene = import("../../scene").Scene;
12
+ declare type AbstractMesh = import("../../Meshes/abstractMesh").AbstractMesh;
13
+ declare type PBRBaseMaterial = import("./pbrBaseMaterial").PBRBaseMaterial;
9
14
  /**
10
15
  * @hidden
11
16
  */
12
- export interface IMaterialSheenDefines {
17
+ export declare class MaterialSheenDefines extends MaterialDefines {
13
18
  SHEEN: boolean;
14
19
  SHEEN_TEXTURE: boolean;
15
20
  SHEEN_GAMMATEXTURE: boolean;
@@ -21,13 +26,11 @@ export interface IMaterialSheenDefines {
21
26
  SHEEN_ALBEDOSCALING: boolean;
22
27
  SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE: boolean;
23
28
  SHEEN_TEXTURE_ROUGHNESS_IDENTICAL: boolean;
24
- /** @hidden */
25
- _areTexturesDirty: boolean;
26
29
  }
27
30
  /**
28
- * Define the code related to the Sheen parameters of the pbr material.
31
+ * Plugin that implements the sheen component of the PBR material.
29
32
  */
30
- export declare class PBRSheenConfiguration {
33
+ export declare class PBRSheenConfiguration extends MaterialPluginBase {
31
34
  private _isEnabled;
32
35
  /**
33
36
  * Defines if the material uses sheen.
@@ -84,96 +87,25 @@ export declare class PBRSheenConfiguration {
84
87
  private _internalMarkAllSubMeshesAsTexturesDirty;
85
88
  /** @hidden */
86
89
  _markAllSubMeshesAsTexturesDirty(): void;
87
- /**
88
- * Instantiate a new instance of clear coat configuration.
89
- * @param markAllSubMeshesAsTexturesDirty Callback to flag the material to dirty
90
- */
91
- constructor(markAllSubMeshesAsTexturesDirty: () => void);
92
- /**
93
- * Specifies that the submesh is ready to be used.
94
- * @param defines the list of "defines" to update.
95
- * @param scene defines the scene the material belongs to.
96
- * @returns - boolean indicating that the submesh is ready or not.
97
- */
98
- isReadyForSubMesh(defines: IMaterialSheenDefines, scene: Scene): boolean;
99
- /**
100
- * Checks to see if a texture is used in the material.
101
- * @param defines the list of "defines" to update.
102
- * @param scene defines the scene the material belongs to.
103
- */
104
- prepareDefines(defines: IMaterialSheenDefines, scene: Scene): void;
105
- /**
106
- * Binds the material data.
107
- * @param uniformBuffer defines the Uniform buffer to fill in.
108
- * @param scene defines the scene the material belongs to.
109
- * @param isFrozen defines whether the material is frozen or not.
110
- * @param subMesh the submesh to bind data for
111
- */
112
- bindForSubMesh(uniformBuffer: UniformBuffer, scene: Scene, isFrozen: boolean, subMesh?: SubMesh): void;
113
- /**
114
- * Checks to see if a texture is used in the material.
115
- * @param texture - Base texture to use.
116
- * @returns - Boolean specifying if a texture is used in the material.
117
- */
90
+ constructor(material: PBRBaseMaterial, addToPluginList?: boolean);
91
+ isReadyForSubMesh(defines: MaterialSheenDefines, scene: Scene, engine: Engine): boolean;
92
+ prepareDefines(defines: MaterialSheenDefines, scene: Scene, mesh: AbstractMesh): void;
93
+ bindForSubMesh(uniformBuffer: UniformBuffer, scene: Scene, engine: Engine, subMesh: SubMesh): void;
118
94
  hasTexture(texture: BaseTexture): boolean;
119
- /**
120
- * Returns an array of the actively used textures.
121
- * @param activeTextures Array of BaseTextures
122
- */
123
95
  getActiveTextures(activeTextures: BaseTexture[]): void;
124
- /**
125
- * Returns the animatable textures.
126
- * @param animatables Array of animatable textures.
127
- */
128
96
  getAnimatables(animatables: IAnimatable[]): void;
129
- /**
130
- * Disposes the resources of the material.
131
- * @param forceDisposeTextures - Forces the disposal of all textures.
132
- */
133
97
  dispose(forceDisposeTextures?: boolean): void;
134
- /**
135
- * Get the current class name of the texture useful for serialization or dynamic coding.
136
- * @returns "PBRSheenConfiguration"
137
- */
138
98
  getClassName(): string;
139
- /**
140
- * Add fallbacks to the effect fallbacks list.
141
- * @param defines defines the Base texture to use.
142
- * @param fallbacks defines the current fallback list.
143
- * @param currentRank defines the current fallback rank.
144
- * @returns the new fallback rank.
145
- */
146
- static AddFallbacks(defines: IMaterialSheenDefines, fallbacks: EffectFallbacks, currentRank: number): number;
147
- /**
148
- * Add the required uniforms to the current list.
149
- * @param uniforms defines the current uniform list.
150
- */
151
- static AddUniforms(uniforms: string[]): void;
152
- /**
153
- * Add the required uniforms to the current buffer.
154
- * @param uniformBuffer defines the current uniform buffer.
155
- */
156
- static PrepareUniformBuffer(uniformBuffer: UniformBuffer): void;
157
- /**
158
- * Add the required samplers to the current list.
159
- * @param samplers defines the current sampler list.
160
- */
161
- static AddSamplers(samplers: string[]): void;
162
- /**
163
- * Makes a duplicate of the current configuration into another one.
164
- * @param sheenConfiguration define the config where to copy the info
165
- */
166
- copyTo(sheenConfiguration: PBRSheenConfiguration): void;
167
- /**
168
- * Serializes this BRDF configuration.
169
- * @returns - An object with the serialized config.
170
- */
171
- serialize(): any;
172
- /**
173
- * Parses a anisotropy Configuration from a serialized object.
174
- * @param source - Serialized object.
175
- * @param scene Defines the scene we are parsing for
176
- * @param rootUrl Defines the rootUrl to load from
177
- */
178
- parse(source: any, scene: Scene, rootUrl: string): void;
99
+ addFallbacks(defines: MaterialSheenDefines, fallbacks: EffectFallbacks, currentRank: number): number;
100
+ getSamplers(samplers: string[]): void;
101
+ getUniforms(): {
102
+ ubo?: Array<{
103
+ name: string;
104
+ size: number;
105
+ type: string;
106
+ }>;
107
+ vertex?: string;
108
+ fragment?: string;
109
+ };
179
110
  }
111
+ export {};
@@ -1,82 +1,102 @@
1
- import { __decorate } from "tslib";
2
- import { SerializationHelper, serialize, expandToProperty, serializeAsColor3, serializeAsTexture } from "../../Misc/decorators.js";
1
+ import { __decorate, __extends } from "tslib";
2
+ import { serialize, expandToProperty, serializeAsColor3, serializeAsTexture } from "../../Misc/decorators.js";
3
3
  import { Color3 } from '../../Maths/math.color.js';
4
4
  import { MaterialFlags } from "../../Materials/materialFlags.js";
5
5
  import { MaterialHelper } from "../../Materials/materialHelper.js";
6
+ import { MaterialPluginBase } from "../materialPluginBase.js";
7
+ import { MaterialDefines } from "../materialDefines.js";
6
8
  /**
7
- * Define the code related to the Sheen parameters of the pbr material.
9
+ * @hidden
8
10
  */
9
- var PBRSheenConfiguration = /** @class */ (function () {
10
- /**
11
- * Instantiate a new instance of clear coat configuration.
12
- * @param markAllSubMeshesAsTexturesDirty Callback to flag the material to dirty
13
- */
14
- function PBRSheenConfiguration(markAllSubMeshesAsTexturesDirty) {
15
- this._isEnabled = false;
11
+ var MaterialSheenDefines = /** @class */ (function (_super) {
12
+ __extends(MaterialSheenDefines, _super);
13
+ function MaterialSheenDefines() {
14
+ var _this = _super !== null && _super.apply(this, arguments) || this;
15
+ _this.SHEEN = false;
16
+ _this.SHEEN_TEXTURE = false;
17
+ _this.SHEEN_GAMMATEXTURE = false;
18
+ _this.SHEEN_TEXTURE_ROUGHNESS = false;
19
+ _this.SHEEN_TEXTUREDIRECTUV = 0;
20
+ _this.SHEEN_TEXTURE_ROUGHNESSDIRECTUV = 0;
21
+ _this.SHEEN_LINKWITHALBEDO = false;
22
+ _this.SHEEN_ROUGHNESS = false;
23
+ _this.SHEEN_ALBEDOSCALING = false;
24
+ _this.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE = false;
25
+ _this.SHEEN_TEXTURE_ROUGHNESS_IDENTICAL = false;
26
+ return _this;
27
+ }
28
+ return MaterialSheenDefines;
29
+ }(MaterialDefines));
30
+ export { MaterialSheenDefines };
31
+ /**
32
+ * Plugin that implements the sheen component of the PBR material.
33
+ */
34
+ var PBRSheenConfiguration = /** @class */ (function (_super) {
35
+ __extends(PBRSheenConfiguration, _super);
36
+ function PBRSheenConfiguration(material, addToPluginList) {
37
+ if (addToPluginList === void 0) { addToPluginList = true; }
38
+ var _this = _super.call(this, material, "Sheen", 120, new MaterialSheenDefines(), addToPluginList) || this;
39
+ _this._isEnabled = false;
16
40
  /**
17
41
  * Defines if the material uses sheen.
18
42
  */
19
- this.isEnabled = false;
20
- this._linkSheenWithAlbedo = false;
43
+ _this.isEnabled = false;
44
+ _this._linkSheenWithAlbedo = false;
21
45
  /**
22
46
  * Defines if the sheen is linked to the sheen color.
23
47
  */
24
- this.linkSheenWithAlbedo = false;
48
+ _this.linkSheenWithAlbedo = false;
25
49
  /**
26
50
  * Defines the sheen intensity.
27
51
  */
28
- this.intensity = 1;
52
+ _this.intensity = 1;
29
53
  /**
30
54
  * Defines the sheen color.
31
55
  */
32
- this.color = Color3.White();
33
- this._texture = null;
56
+ _this.color = Color3.White();
57
+ _this._texture = null;
34
58
  /**
35
59
  * Stores the sheen tint values in a texture.
36
60
  * rgb is tint
37
61
  * a is a intensity or roughness if the roughness property has been defined and useRoughnessFromTexture is true (in that case, textureRoughness won't be used)
38
62
  * If the roughness property has been defined and useRoughnessFromTexture is false then the alpha channel is not used to modulate roughness
39
63
  */
40
- this.texture = null;
41
- this._useRoughnessFromMainTexture = true;
64
+ _this.texture = null;
65
+ _this._useRoughnessFromMainTexture = true;
42
66
  /**
43
67
  * Indicates that the alpha channel of the texture property will be used for roughness.
44
68
  * Has no effect if the roughness (and texture!) property is not defined
45
69
  */
46
- this.useRoughnessFromMainTexture = true;
47
- this._roughness = null;
70
+ _this.useRoughnessFromMainTexture = true;
71
+ _this._roughness = null;
48
72
  /**
49
73
  * Defines the sheen roughness.
50
74
  * It is not taken into account if linkSheenWithAlbedo is true.
51
75
  * To stay backward compatible, material roughness is used instead if sheen roughness = null
52
76
  */
53
- this.roughness = null;
54
- this._textureRoughness = null;
77
+ _this.roughness = null;
78
+ _this._textureRoughness = null;
55
79
  /**
56
80
  * Stores the sheen roughness in a texture.
57
81
  * alpha channel is the roughness. This texture won't be used if the texture property is not empty and useRoughnessFromTexture is true
58
82
  */
59
- this.textureRoughness = null;
60
- this._albedoScaling = false;
83
+ _this.textureRoughness = null;
84
+ _this._albedoScaling = false;
61
85
  /**
62
86
  * If true, the sheen effect is layered above the base BRDF with the albedo-scaling technique.
63
87
  * It allows the strength of the sheen effect to not depend on the base color of the material,
64
88
  * making it easier to setup and tweak the effect
65
89
  */
66
- this.albedoScaling = false;
67
- this._internalMarkAllSubMeshesAsTexturesDirty = markAllSubMeshesAsTexturesDirty;
90
+ _this.albedoScaling = false;
91
+ _this._internalMarkAllSubMeshesAsTexturesDirty = material._dirtyCallbacks[1];
92
+ return _this;
68
93
  }
69
94
  /** @hidden */
70
95
  PBRSheenConfiguration.prototype._markAllSubMeshesAsTexturesDirty = function () {
96
+ this._enable(this._isEnabled);
71
97
  this._internalMarkAllSubMeshesAsTexturesDirty();
72
98
  };
73
- /**
74
- * Specifies that the submesh is ready to be used.
75
- * @param defines the list of "defines" to update.
76
- * @param scene defines the scene the material belongs to.
77
- * @returns - boolean indicating that the submesh is ready or not.
78
- */
79
- PBRSheenConfiguration.prototype.isReadyForSubMesh = function (defines, scene) {
99
+ PBRSheenConfiguration.prototype.isReadyForSubMesh = function (defines, scene, engine) {
80
100
  if (!this._isEnabled) {
81
101
  return true;
82
102
  }
@@ -96,15 +116,10 @@ var PBRSheenConfiguration = /** @class */ (function () {
96
116
  }
97
117
  return true;
98
118
  };
99
- /**
100
- * Checks to see if a texture is used in the material.
101
- * @param defines the list of "defines" to update.
102
- * @param scene defines the scene the material belongs to.
103
- */
104
- PBRSheenConfiguration.prototype.prepareDefines = function (defines, scene) {
119
+ PBRSheenConfiguration.prototype.prepareDefines = function (defines, scene, mesh) {
105
120
  var _a;
106
121
  if (this._isEnabled) {
107
- defines.SHEEN = this._isEnabled;
122
+ defines.SHEEN = true;
108
123
  defines.SHEEN_LINKWITHALBEDO = this._linkSheenWithAlbedo;
109
124
  defines.SHEEN_ROUGHNESS = this._roughness !== null;
110
125
  defines.SHEEN_ALBEDOSCALING = this._albedoScaling;
@@ -139,19 +154,13 @@ var PBRSheenConfiguration = /** @class */ (function () {
139
154
  defines.SHEEN_TEXTURE_ROUGHNESS_IDENTICAL = false;
140
155
  }
141
156
  };
142
- /**
143
- * Binds the material data.
144
- * @param uniformBuffer defines the Uniform buffer to fill in.
145
- * @param scene defines the scene the material belongs to.
146
- * @param isFrozen defines whether the material is frozen or not.
147
- * @param subMesh the submesh to bind data for
148
- */
149
- PBRSheenConfiguration.prototype.bindForSubMesh = function (uniformBuffer, scene, isFrozen, subMesh) {
157
+ PBRSheenConfiguration.prototype.bindForSubMesh = function (uniformBuffer, scene, engine, subMesh) {
150
158
  var _a, _b, _c, _d, _e, _f, _g, _h;
151
159
  if (!this._isEnabled) {
152
160
  return;
153
161
  }
154
162
  var defines = subMesh.materialDefines;
163
+ var isFrozen = this._material.isFrozen;
155
164
  var identicalTextures = defines.SHEEN_TEXTURE_ROUGHNESS_IDENTICAL;
156
165
  if (!uniformBuffer.useUbo || !isFrozen || !uniformBuffer.isSync) {
157
166
  if (identicalTextures && MaterialFlags.SheenTextureEnabled) {
@@ -183,11 +192,6 @@ var PBRSheenConfiguration = /** @class */ (function () {
183
192
  }
184
193
  }
185
194
  };
186
- /**
187
- * Checks to see if a texture is used in the material.
188
- * @param texture - Base texture to use.
189
- * @returns - Boolean specifying if a texture is used in the material.
190
- */
191
195
  PBRSheenConfiguration.prototype.hasTexture = function (texture) {
192
196
  if (this._texture === texture) {
193
197
  return true;
@@ -197,10 +201,6 @@ var PBRSheenConfiguration = /** @class */ (function () {
197
201
  }
198
202
  return false;
199
203
  };
200
- /**
201
- * Returns an array of the actively used textures.
202
- * @param activeTextures Array of BaseTextures
203
- */
204
204
  PBRSheenConfiguration.prototype.getActiveTextures = function (activeTextures) {
205
205
  if (this._texture) {
206
206
  activeTextures.push(this._texture);
@@ -209,10 +209,6 @@ var PBRSheenConfiguration = /** @class */ (function () {
209
209
  activeTextures.push(this._textureRoughness);
210
210
  }
211
211
  };
212
- /**
213
- * Returns the animatable textures.
214
- * @param animatables Array of animatable textures.
215
- */
216
212
  PBRSheenConfiguration.prototype.getAnimatables = function (animatables) {
217
213
  if (this._texture && this._texture.animations && this._texture.animations.length > 0) {
218
214
  animatables.push(this._texture);
@@ -221,10 +217,6 @@ var PBRSheenConfiguration = /** @class */ (function () {
221
217
  animatables.push(this._textureRoughness);
222
218
  }
223
219
  };
224
- /**
225
- * Disposes the resources of the material.
226
- * @param forceDisposeTextures - Forces the disposal of all textures.
227
- */
228
220
  PBRSheenConfiguration.prototype.dispose = function (forceDisposeTextures) {
229
221
  var _a, _b;
230
222
  if (forceDisposeTextures) {
@@ -232,75 +224,28 @@ var PBRSheenConfiguration = /** @class */ (function () {
232
224
  (_b = this._textureRoughness) === null || _b === void 0 ? void 0 : _b.dispose();
233
225
  }
234
226
  };
235
- /**
236
- * Get the current class name of the texture useful for serialization or dynamic coding.
237
- * @returns "PBRSheenConfiguration"
238
- */
239
227
  PBRSheenConfiguration.prototype.getClassName = function () {
240
228
  return "PBRSheenConfiguration";
241
229
  };
242
- /**
243
- * Add fallbacks to the effect fallbacks list.
244
- * @param defines defines the Base texture to use.
245
- * @param fallbacks defines the current fallback list.
246
- * @param currentRank defines the current fallback rank.
247
- * @returns the new fallback rank.
248
- */
249
- PBRSheenConfiguration.AddFallbacks = function (defines, fallbacks, currentRank) {
230
+ PBRSheenConfiguration.prototype.addFallbacks = function (defines, fallbacks, currentRank) {
250
231
  if (defines.SHEEN) {
251
232
  fallbacks.addFallback(currentRank++, "SHEEN");
252
233
  }
253
234
  return currentRank;
254
235
  };
255
- /**
256
- * Add the required uniforms to the current list.
257
- * @param uniforms defines the current uniform list.
258
- */
259
- PBRSheenConfiguration.AddUniforms = function (uniforms) {
260
- uniforms.push("vSheenColor", "vSheenRoughness", "vSheenInfos", "sheenMatrix", "sheenRoughnessMatrix");
261
- };
262
- /**
263
- * Add the required uniforms to the current buffer.
264
- * @param uniformBuffer defines the current uniform buffer.
265
- */
266
- PBRSheenConfiguration.PrepareUniformBuffer = function (uniformBuffer) {
267
- uniformBuffer.addUniform("vSheenColor", 4);
268
- uniformBuffer.addUniform("vSheenRoughness", 1);
269
- uniformBuffer.addUniform("vSheenInfos", 4);
270
- uniformBuffer.addUniform("sheenMatrix", 16);
271
- uniformBuffer.addUniform("sheenRoughnessMatrix", 16);
272
- };
273
- /**
274
- * Add the required samplers to the current list.
275
- * @param samplers defines the current sampler list.
276
- */
277
- PBRSheenConfiguration.AddSamplers = function (samplers) {
278
- samplers.push("sheenSampler");
279
- samplers.push("sheenRoughnessSampler");
280
- };
281
- /**
282
- * Makes a duplicate of the current configuration into another one.
283
- * @param sheenConfiguration define the config where to copy the info
284
- */
285
- PBRSheenConfiguration.prototype.copyTo = function (sheenConfiguration) {
286
- SerializationHelper.Clone(function () { return sheenConfiguration; }, this);
287
- };
288
- /**
289
- * Serializes this BRDF configuration.
290
- * @returns - An object with the serialized config.
291
- */
292
- PBRSheenConfiguration.prototype.serialize = function () {
293
- return SerializationHelper.Serialize(this);
236
+ PBRSheenConfiguration.prototype.getSamplers = function (samplers) {
237
+ samplers.push("sheenSampler", "sheenRoughnessSampler");
294
238
  };
295
- /**
296
- * Parses a anisotropy Configuration from a serialized object.
297
- * @param source - Serialized object.
298
- * @param scene Defines the scene we are parsing for
299
- * @param rootUrl Defines the rootUrl to load from
300
- */
301
- PBRSheenConfiguration.prototype.parse = function (source, scene, rootUrl) {
302
- var _this = this;
303
- SerializationHelper.Parse(function () { return _this; }, source, scene, rootUrl);
239
+ PBRSheenConfiguration.prototype.getUniforms = function () {
240
+ return {
241
+ ubo: [
242
+ { name: "vSheenColor", size: 4, type: "vec4" },
243
+ { name: "vSheenRoughness", size: 1, type: "float" },
244
+ { name: "vSheenInfos", size: 4, type: "vec4" },
245
+ { name: "sheenMatrix", size: 16, type: "mat4" },
246
+ { name: "sheenRoughnessMatrix", size: 16, type: "mat4" },
247
+ ],
248
+ };
304
249
  };
305
250
  __decorate([
306
251
  serialize(),
@@ -337,6 +282,6 @@ var PBRSheenConfiguration = /** @class */ (function () {
337
282
  expandToProperty("_markAllSubMeshesAsTexturesDirty")
338
283
  ], PBRSheenConfiguration.prototype, "albedoScaling", void 0);
339
284
  return PBRSheenConfiguration;
340
- }());
285
+ }(MaterialPluginBase));
341
286
  export { PBRSheenConfiguration };
342
287
  //# sourceMappingURL=pbrSheenConfiguration.js.map