@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
@@ -31,7 +31,23 @@ export declare class MaterialDefines {
31
31
  _needNormals: boolean;
32
32
  /** @hidden */
33
33
  _needUVs: boolean;
34
+ protected _externalProperties?: {
35
+ [name: string]: {
36
+ type: string;
37
+ default: any;
38
+ };
39
+ };
34
40
  [id: string]: any;
41
+ /**
42
+ * Creates a new instance
43
+ * @param externalProperties list of external properties to inject into the object
44
+ */
45
+ constructor(externalProperties?: {
46
+ [name: string]: {
47
+ type: string;
48
+ default: any;
49
+ };
50
+ });
35
51
  /**
36
52
  * Specifies if the material needs to be re-calculated
37
53
  */
@@ -2,7 +2,11 @@
2
2
  * Manages the defines for the Material
3
3
  */
4
4
  var MaterialDefines = /** @class */ (function () {
5
- function MaterialDefines() {
5
+ /**
6
+ * Creates a new instance
7
+ * @param externalProperties list of external properties to inject into the object
8
+ */
9
+ function MaterialDefines(externalProperties) {
6
10
  this._isDirty = true;
7
11
  /** @hidden */
8
12
  this._areLightsDirty = true;
@@ -28,6 +32,7 @@ var MaterialDefines = /** @class */ (function () {
28
32
  this._needNormals = false;
29
33
  /** @hidden */
30
34
  this._needUVs = false;
35
+ this._externalProperties = externalProperties;
31
36
  }
32
37
  Object.defineProperty(MaterialDefines.prototype, "isDirty", {
33
38
  /**
@@ -135,6 +140,11 @@ var MaterialDefines = /** @class */ (function () {
135
140
  }
136
141
  this._keys.push(key);
137
142
  }
143
+ if (this._externalProperties) {
144
+ for (var name_1 in this._externalProperties) {
145
+ this._keys.push(name_1);
146
+ }
147
+ }
138
148
  };
139
149
  /**
140
150
  * Specifies if two material defines are equal
@@ -170,18 +180,20 @@ var MaterialDefines = /** @class */ (function () {
170
180
  * Resets the material define values
171
181
  */
172
182
  MaterialDefines.prototype.reset = function () {
183
+ var _a, _b, _c, _d, _e;
173
184
  for (var index = 0; index < this._keys.length; index++) {
174
185
  var prop = this._keys[index];
175
- var type = typeof this[prop];
186
+ var type = (_c = (_b = (_a = this._externalProperties) === null || _a === void 0 ? void 0 : _a[prop]) === null || _b === void 0 ? void 0 : _b.type) !== null && _c !== void 0 ? _c : typeof this[prop];
187
+ var defValue = (_e = (_d = this._externalProperties) === null || _d === void 0 ? void 0 : _d[prop]) === null || _e === void 0 ? void 0 : _e.default;
176
188
  switch (type) {
177
189
  case "number":
178
- this[prop] = 0;
190
+ this[prop] = defValue !== null && defValue !== void 0 ? defValue : 0;
179
191
  break;
180
192
  case "string":
181
- this[prop] = "";
193
+ this[prop] = defValue !== null && defValue !== void 0 ? defValue : "";
182
194
  break;
183
195
  default:
184
- this[prop] = false;
196
+ this[prop] = defValue !== null && defValue !== void 0 ? defValue : false;
185
197
  break;
186
198
  }
187
199
  }
@@ -1 +1 @@
1
- {"version":3,"file":"materialDefines.js","sourceRoot":"","sources":["../../../sourceES6/core/Materials/materialDefines.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;IAAA;QAGY,aAAQ,GAAG,IAAI,CAAC;QAIxB,cAAc;QACP,oBAAe,GAAG,IAAI,CAAC;QAC9B,cAAc;QACP,uBAAkB,GAAG,KAAK,CAAC;QAClC,cAAc;QACP,wBAAmB,GAAG,IAAI,CAAC;QAClC,cAAc;QACP,sBAAiB,GAAG,IAAI,CAAC;QAChC,cAAc;QACP,qBAAgB,GAAG,IAAI,CAAC;QAC/B,cAAc;QACP,kBAAa,GAAG,IAAI,CAAC;QAC5B,cAAc;QACP,qBAAgB,GAAG,IAAI,CAAC;QAC/B,cAAc;QACP,6BAAwB,GAAG,IAAI,CAAC;QAEvC,cAAc;QACP,aAAQ,GAAG,KAAK,CAAC;QACxB,cAAc;QACP,SAAI,GAAG,KAAK,CAAC;QAEpB,cAAc;QACP,iBAAY,GAAG,KAAK,CAAC;QAC5B,cAAc;QACP,aAAQ,GAAG,KAAK,CAAC;IA4M5B,CAAC;IArMG,sBAAW,oCAAO;QAHlB;;WAEG;aACH;YACI,OAAO,IAAI,CAAC,QAAQ,CAAC;QACzB,CAAC;;;OAAA;IAED;;OAEG;IACI,yCAAe,GAAtB;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AK,CAAC;oBAC1B,MAAM;aACb;SACJ;IACL,CAAC;IAED;;;OAGG;IACI,kCAAQ,GAAf;QACI,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;YACpD,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC7B,IAAI,KAAK,GAAS,IAAK,CAAC,IAAI,CAAC,CAAC;YAC9B,IAAI,IAAI,GAAG,OAAO,KAAK,CAAC;YAExB,QAAQ,IAAI,EAAE;gBACV,KAAK,QAAQ,CAAC;gBACd,KAAK,QAAQ;oBACT,MAAM,IAAI,UAAU,GAAG,IAAI,GAAG,GAAG,GAAG,KAAK,GAAG,IAAI,CAAC;oBACjD,MAAM;gBACV;oBACI,IAAI,KAAK,EAAE;wBACP,MAAM,IAAI,UAAU,GAAG,IAAI,GAAG,IAAI,CAAC;qBACtC;oBACD,MAAM;aACb;SACJ;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;IACL,sBAAC;AAAD,CAAC,AA5OD,IA4OC","sourcesContent":["/**\r\n * Manages the defines for the Material\r\n */\r\nexport class MaterialDefines {\r\n /** @hidden */\r\n protected _keys: string[];\r\n private _isDirty = true;\r\n /** @hidden */\r\n public _renderId: number;\r\n\r\n /** @hidden */\r\n public _areLightsDirty = true;\r\n /** @hidden */\r\n public _areLightsDisposed = false;\r\n /** @hidden */\r\n public _areAttributesDirty = true;\r\n /** @hidden */\r\n public _areTexturesDirty = true;\r\n /** @hidden */\r\n public _areFresnelDirty = true;\r\n /** @hidden */\r\n public _areMiscDirty = true;\r\n /** @hidden */\r\n public _arePrePassDirty = true;\r\n /** @hidden */\r\n public _areImageProcessingDirty = true;\r\n\r\n /** @hidden */\r\n public _normals = false;\r\n /** @hidden */\r\n public _uvs = false;\r\n\r\n /** @hidden */\r\n public _needNormals = false;\r\n /** @hidden */\r\n public _needUVs = false;\r\n\r\n [id: string]: any;\r\n\r\n /**\r\n * Specifies if the material needs to be re-calculated\r\n */\r\n public get isDirty(): boolean {\r\n return this._isDirty;\r\n }\r\n\r\n /**\r\n * Marks the material to indicate that it has been re-calculated\r\n */\r\n public markAsProcessed() {\r\n this._isDirty = false;\r\n this._areAttributesDirty = false;\r\n this._areTexturesDirty = false;\r\n this._areFresnelDirty = false;\r\n this._areLightsDirty = false;\r\n this._areLightsDisposed = false;\r\n this._areMiscDirty = false;\r\n this._arePrePassDirty = false;\r\n this._areImageProcessingDirty = false;\r\n }\r\n\r\n /**\r\n * Marks the material to indicate that it needs to be re-calculated\r\n */\r\n public markAsUnprocessed() {\r\n this._isDirty = true;\r\n }\r\n\r\n /**\r\n * Marks the material to indicate all of its defines need to be re-calculated\r\n */\r\n public markAllAsDirty() {\r\n this._areTexturesDirty = true;\r\n this._areAttributesDirty = true;\r\n this._areLightsDirty = true;\r\n this._areFresnelDirty = true;\r\n this._areMiscDirty = true;\r\n this._areImageProcessingDirty = true;\r\n this._isDirty = true;\r\n }\r\n\r\n /**\r\n * Marks the material to indicate that image processing needs to be re-calculated\r\n */\r\n public markAsImageProcessingDirty() {\r\n this._areImageProcessingDirty = true;\r\n this._isDirty = true;\r\n }\r\n\r\n /**\r\n * Marks the material to indicate the lights need to be re-calculated\r\n * @param disposed Defines whether the light is dirty due to dispose or not\r\n */\r\n public markAsLightDirty(disposed = false) {\r\n this._areLightsDirty = true;\r\n this._areLightsDisposed = this._areLightsDisposed || disposed;\r\n this._isDirty = true;\r\n }\r\n\r\n /**\r\n * Marks the attribute state as changed\r\n */\r\n public markAsAttributesDirty() {\r\n this._areAttributesDirty = true;\r\n this._isDirty = true;\r\n }\r\n\r\n /**\r\n * Marks the texture state as changed\r\n */\r\n public markAsTexturesDirty() {\r\n this._areTexturesDirty = true;\r\n this._isDirty = true;\r\n }\r\n\r\n /**\r\n * Marks the fresnel state as changed\r\n */\r\n public markAsFresnelDirty() {\r\n this._areFresnelDirty = true;\r\n this._isDirty = true;\r\n }\r\n\r\n /**\r\n * Marks the misc state as changed\r\n */\r\n public markAsMiscDirty() {\r\n this._areMiscDirty = true;\r\n this._isDirty = true;\r\n }\r\n\r\n /**\r\n * Marks the prepass state as changed\r\n */\r\n public markAsPrePassDirty() {\r\n this._arePrePassDirty = true;\r\n this._isDirty = true;\r\n }\r\n\r\n /**\r\n * Rebuilds the material defines\r\n */\r\n public rebuild() {\r\n this._keys = [];\r\n\r\n for (var key of Object.keys(this)) {\r\n if (key[0] === \"_\") {\r\n continue;\r\n }\r\n\r\n this._keys.push(key);\r\n }\r\n }\r\n\r\n /**\r\n * Specifies if two material defines are equal\r\n * @param other - A material define instance to compare to\r\n * @returns - Boolean indicating if the material defines are equal (true) or not (false)\r\n */\r\n public isEqual(other: MaterialDefines): boolean {\r\n if (this._keys.length !== other._keys.length) {\r\n return false;\r\n }\r\n\r\n for (var index = 0; index < this._keys.length; index++) {\r\n var prop = this._keys[index];\r\n\r\n if ((<any>this)[prop] !== (<any>other)[prop]) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * Clones this instance's defines to another instance\r\n * @param other - material defines to clone values to\r\n */\r\n public cloneTo(other: MaterialDefines): void {\r\n if (this._keys.length !== other._keys.length) {\r\n other._keys = this._keys.slice(0);\r\n }\r\n\r\n for (var index = 0; index < this._keys.length; index++) {\r\n var prop = this._keys[index];\r\n\r\n (<any>other)[prop] = (<any>this)[prop];\r\n }\r\n }\r\n\r\n /**\r\n * Resets the material define values\r\n */\r\n public reset(): void {\r\n for (var index = 0; index < this._keys.length; index++) {\r\n var prop = this._keys[index];\r\n var type = typeof (<any>this)[prop];\r\n\r\n switch (type) {\r\n case \"number\":\r\n (<any>this)[prop] = 0;\r\n break;\r\n case \"string\":\r\n (<any>this)[prop] = \"\";\r\n break;\r\n default:\r\n (<any>this)[prop] = false;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Converts the material define values to a string\r\n * @returns - String of material define information\r\n */\r\n public toString(): string {\r\n var result = \"\";\r\n for (var index = 0; index < this._keys.length; index++) {\r\n var prop = this._keys[index];\r\n var value = (<any>this)[prop];\r\n var type = typeof value;\r\n\r\n switch (type) {\r\n case \"number\":\r\n case \"string\":\r\n result += \"#define \" + prop + \" \" + value + \"\\n\";\r\n break;\r\n default:\r\n if (value) {\r\n result += \"#define \" + prop + \"\\n\";\r\n }\r\n break;\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n}"]}
1
+ {"version":3,"file":"materialDefines.js","sourceRoot":"","sources":["../../../sourceES6/core/Materials/materialDefines.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;IAsCI;;;OAGG;IACH,yBAAY,kBAAuE;QAvC3E,aAAQ,GAAG,IAAI,CAAC;QAIxB,cAAc;QACP,oBAAe,GAAG,IAAI,CAAC;QAC9B,cAAc;QACP,uBAAkB,GAAG,KAAK,CAAC;QAClC,cAAc;QACP,wBAAmB,GAAG,IAAI,CAAC;QAClC,cAAc;QACP,sBAAiB,GAAG,IAAI,CAAC;QAChC,cAAc;QACP,qBAAgB,GAAG,IAAI,CAAC;QAC/B,cAAc;QACP,kBAAa,GAAG,IAAI,CAAC;QAC5B,cAAc;QACP,qBAAgB,GAAG,IAAI,CAAC;QAC/B,cAAc;QACP,6BAAwB,GAAG,IAAI,CAAC;QAEvC,cAAc;QACP,aAAQ,GAAG,KAAK,CAAC;QACxB,cAAc;QACP,SAAI,GAAG,KAAK,CAAC;QAEpB,cAAc;QACP,iBAAY,GAAG,KAAK,CAAC;QAC5B,cAAc;QACP,aAAQ,GAAG,KAAK,CAAC;QAWpB,IAAI,CAAC,mBAAmB,GAAG,kBAAkB,CAAC;IAClD,CAAC;IAKD,sBAAW,oCAAO;QAHlB;;WAEG;aACH;YACI,OAAO,IAAI,CAAC,QAAQ,CAAC;QACzB,CAAC;;;OAAA;IAED;;OAEG;IACI,yCAAe,GAAtB;QACI,IAAI,CAAC,Q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ines {\r\n /** @hidden */\r\n protected _keys: string[];\r\n private _isDirty = true;\r\n /** @hidden */\r\n public _renderId: number;\r\n\r\n /** @hidden */\r\n public _areLightsDirty = true;\r\n /** @hidden */\r\n public _areLightsDisposed = false;\r\n /** @hidden */\r\n public _areAttributesDirty = true;\r\n /** @hidden */\r\n public _areTexturesDirty = true;\r\n /** @hidden */\r\n public _areFresnelDirty = true;\r\n /** @hidden */\r\n public _areMiscDirty = true;\r\n /** @hidden */\r\n public _arePrePassDirty = true;\r\n /** @hidden */\r\n public _areImageProcessingDirty = true;\r\n\r\n /** @hidden */\r\n public _normals = false;\r\n /** @hidden */\r\n public _uvs = false;\r\n\r\n /** @hidden */\r\n public _needNormals = false;\r\n /** @hidden */\r\n public _needUVs = false;\r\n\r\n protected _externalProperties?: { [name: string]: { type: string, default: any } };\r\n\r\n [id: string]: any;\r\n\r\n /**\r\n * Creates a new instance\r\n * @param externalProperties list of external properties to inject into the object\r\n */\r\n constructor(externalProperties?: { [name: string]: { type: string, default: any } }) {\r\n this._externalProperties = externalProperties;\r\n }\r\n\r\n /**\r\n * Specifies if the material needs to be re-calculated\r\n */\r\n public get isDirty(): boolean {\r\n return this._isDirty;\r\n }\r\n\r\n /**\r\n * Marks the material to indicate that it has been re-calculated\r\n */\r\n public markAsProcessed() {\r\n this._isDirty = false;\r\n this._areAttributesDirty = false;\r\n this._areTexturesDirty = false;\r\n this._areFresnelDirty = false;\r\n this._areLightsDirty = false;\r\n this._areLightsDisposed = false;\r\n this._areMiscDirty = false;\r\n this._arePrePassDirty = false;\r\n this._areImageProcessingDirty = false;\r\n }\r\n\r\n /**\r\n * Marks the material to indicate that it needs to be re-calculated\r\n */\r\n public markAsUnprocessed() {\r\n this._isDirty = true;\r\n }\r\n\r\n /**\r\n * Marks the material to indicate all of its defines need to be re-calculated\r\n */\r\n public markAllAsDirty() {\r\n this._areTexturesDirty = true;\r\n this._areAttributesDirty = true;\r\n this._areLightsDirty = true;\r\n this._areFresnelDirty = true;\r\n this._areMiscDirty = true;\r\n this._areImageProcessingDirty = true;\r\n this._isDirty = true;\r\n }\r\n\r\n /**\r\n * Marks the material to indicate that image processing needs to be re-calculated\r\n */\r\n public markAsImageProcessingDirty() {\r\n this._areImageProcessingDirty = true;\r\n this._isDirty = true;\r\n }\r\n\r\n /**\r\n * Marks the material to indicate the lights need to be re-calculated\r\n * @param disposed Defines whether the light is dirty due to dispose or not\r\n */\r\n public markAsLightDirty(disposed = false) {\r\n this._areLightsDirty = true;\r\n this._areLightsDisposed = this._areLightsDisposed || disposed;\r\n this._isDirty = true;\r\n }\r\n\r\n /**\r\n * Marks the attribute state as changed\r\n */\r\n public markAsAttributesDirty() {\r\n this._areAttributesDirty = true;\r\n this._isDirty = true;\r\n }\r\n\r\n /**\r\n * Marks the texture state as changed\r\n */\r\n public markAsTexturesDirty() {\r\n this._areTexturesDirty = true;\r\n this._isDirty = true;\r\n }\r\n\r\n /**\r\n * Marks the fresnel state as changed\r\n */\r\n public markAsFresnelDirty() {\r\n this._areFresnelDirty = true;\r\n this._isDirty = true;\r\n }\r\n\r\n /**\r\n * Marks the misc state as changed\r\n */\r\n public markAsMiscDirty() {\r\n this._areMiscDirty = true;\r\n this._isDirty = true;\r\n }\r\n\r\n /**\r\n * Marks the prepass state as changed\r\n */\r\n public markAsPrePassDirty() {\r\n this._arePrePassDirty = true;\r\n this._isDirty = true;\r\n }\r\n\r\n /**\r\n * Rebuilds the material defines\r\n */\r\n public rebuild() {\r\n this._keys = [];\r\n\r\n for (var key of Object.keys(this)) {\r\n if (key[0] === \"_\") {\r\n continue;\r\n }\r\n\r\n this._keys.push(key);\r\n }\r\n\r\n if (this._externalProperties) {\r\n for (const name in this._externalProperties) {\r\n this._keys.push(name);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Specifies if two material defines are equal\r\n * @param other - A material define instance to compare to\r\n * @returns - Boolean indicating if the material defines are equal (true) or not (false)\r\n */\r\n public isEqual(other: MaterialDefines): boolean {\r\n if (this._keys.length !== other._keys.length) {\r\n return false;\r\n }\r\n\r\n for (var index = 0; index < this._keys.length; index++) {\r\n var prop = this._keys[index];\r\n\r\n if ((<any>this)[prop] !== (<any>other)[prop]) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * Clones this instance's defines to another instance\r\n * @param other - material defines to clone values to\r\n */\r\n public cloneTo(other: MaterialDefines): void {\r\n if (this._keys.length !== other._keys.length) {\r\n other._keys = this._keys.slice(0);\r\n }\r\n\r\n for (var index = 0; index < this._keys.length; index++) {\r\n var prop = this._keys[index];\r\n\r\n (<any>other)[prop] = (<any>this)[prop];\r\n }\r\n }\r\n\r\n /**\r\n * Resets the material define values\r\n */\r\n public reset(): void {\r\n for (var index = 0; index < this._keys.length; index++) {\r\n var prop = this._keys[index];\r\n var type = this._externalProperties?.[prop]?.type ?? typeof (<any>this)[prop];\r\n var defValue = this._externalProperties?.[prop]?.default;\r\n\r\n switch (type) {\r\n case \"number\":\r\n (<any>this)[prop] = defValue ?? 0;\r\n break;\r\n case \"string\":\r\n (<any>this)[prop] = defValue ?? \"\";\r\n break;\r\n default:\r\n (<any>this)[prop] = defValue ?? false;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Converts the material define values to a string\r\n * @returns - String of material define information\r\n */\r\n public toString(): string {\r\n var result = \"\";\r\n for (var index = 0; index < this._keys.length; index++) {\r\n var prop = this._keys[index];\r\n var value = (<any>this)[prop];\r\n var type = typeof value;\r\n\r\n switch (type) {\r\n case \"number\":\r\n case \"string\":\r\n result += \"#define \" + prop + \" \" + value + \"\\n\";\r\n break;\r\n default:\r\n if (value) {\r\n result += \"#define \" + prop + \"\\n\";\r\n }\r\n break;\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n}"]}
@@ -0,0 +1,182 @@
1
+ import { Nullable } from "../types";
2
+ import { MaterialPluginManager } from "./materialPluginManager";
3
+ import { SmartArray } from "../Misc/smartArray";
4
+ declare type Engine = import("../Engines/engine").Engine;
5
+ declare type Scene = import("../scene").Scene;
6
+ declare type AbstractMesh = import("../Meshes/abstractMesh").AbstractMesh;
7
+ declare type SubMesh = import("../Meshes/subMesh").SubMesh;
8
+ declare type IAnimatable = import("../Animations/animatable.interface").IAnimatable;
9
+ declare type UniformBuffer = import("./uniformBuffer").UniformBuffer;
10
+ declare type EffectFallbacks = import("./effectFallbacks").EffectFallbacks;
11
+ declare type MaterialDefines = import("./materialDefines").MaterialDefines;
12
+ declare type Material = import("./material").Material;
13
+ declare type BaseTexture = import("./Textures/baseTexture").BaseTexture;
14
+ declare type RenderTargetTexture = import("./Textures/renderTargetTexture").RenderTargetTexture;
15
+ /**
16
+ * Base class for material plugins.
17
+ * @since 5.0
18
+ */
19
+ export declare class MaterialPluginBase {
20
+ /**
21
+ * Defines the name of the plugin
22
+ */
23
+ name: string;
24
+ /**
25
+ * Defines the priority of the plugin. Lower numbers run first.
26
+ */
27
+ priority: number;
28
+ /**
29
+ * Indicates that this plugin should be notified for the extra events (HasRenderTargetTextures / FillRenderTargetTextures / HardBindForSubMesh)
30
+ */
31
+ registerForExtraEvents: boolean;
32
+ protected _material: Material;
33
+ protected _pluginManager: MaterialPluginManager;
34
+ protected _pluginDefineNames?: {
35
+ [name: string]: any;
36
+ };
37
+ protected _enable(enable: boolean): void;
38
+ /**
39
+ * Creates a new material plugin
40
+ * @param material parent material of the plugin
41
+ * @param name name of the plugin
42
+ * @param priority priority of the plugin
43
+ * @param defines list of defines used by the plugin. The value of the property is the default value for this property
44
+ * @param addToPluginList true to add the plugin to the list of plugins managed by the material plugin manager of the material (default: true)
45
+ */
46
+ constructor(material: Material, name: string, priority: number, defines?: {
47
+ [key: string]: any;
48
+ }, addToPluginList?: boolean);
49
+ /**
50
+ * Gets the current class name useful for serialization or dynamic coding.
51
+ * @returns The class name.
52
+ */
53
+ getClassName(): string;
54
+ /**
55
+ * Specifies that the submesh is ready to be used.
56
+ * @param defines the list of "defines" to update.
57
+ * @param scene defines the scene the material belongs to.
58
+ * @param engine the engine this scene belongs to.
59
+ * @param subMesh the submesh to check for readiness
60
+ * @returns - boolean indicating that the submesh is ready or not.
61
+ */
62
+ isReadyForSubMesh(defines: MaterialDefines, scene: Scene, engine: Engine, subMesh: SubMesh): boolean;
63
+ /**
64
+ * Binds the material data (this function is called even if mustRebind() returns false)
65
+ * @param uniformBuffer defines the Uniform buffer to fill in.
66
+ * @param scene defines the scene the material belongs to.
67
+ * @param engine defines the engine the material belongs to.
68
+ * @param subMesh the submesh to bind data for
69
+ */
70
+ hardBindForSubMesh(uniformBuffer: UniformBuffer, scene: Scene, engine: Engine, subMesh: SubMesh): void;
71
+ /**
72
+ * Binds the material data.
73
+ * @param uniformBuffer defines the Uniform buffer to fill in.
74
+ * @param scene defines the scene the material belongs to.
75
+ * @param engine the engine this scene belongs to.
76
+ * @param subMesh the submesh to bind data for
77
+ */
78
+ bindForSubMesh(uniformBuffer: UniformBuffer, scene: Scene, engine: Engine, subMesh: SubMesh): void;
79
+ /**
80
+ * Disposes the resources of the material.
81
+ * @param forceDisposeTextures - Forces the disposal of all textures.
82
+ */
83
+ dispose(forceDisposeTextures?: boolean): void;
84
+ /**
85
+ * Returns a list of custom shader code fragments to customize the shader.
86
+ * @param shaderType "vertex" or "fragment"
87
+ * @returns null if no code to be added, or a list of pointName => code.
88
+ * Note that `pointName` can also be a regular expression if it starts with a `!`.
89
+ * In that case, the string found by the regular expression (if any) will be
90
+ * replaced by the code provided.
91
+ */
92
+ getCustomCode(shaderType: string): Nullable<{
93
+ [pointName: string]: string;
94
+ }>;
95
+ /**
96
+ * Collects all defines.
97
+ * @param defines The object to append to.
98
+ */
99
+ collectDefines(defines: {
100
+ [name: string]: {
101
+ type: string;
102
+ default: any;
103
+ };
104
+ }): void;
105
+ /**
106
+ * Sets the defines for the next rendering
107
+ * @param defines the list of "defines" to update.
108
+ * @param scene defines the scene to the material belongs to.
109
+ * @param mesh the mesh being rendered
110
+ */
111
+ prepareDefines(defines: MaterialDefines, scene: Scene, mesh: AbstractMesh): void;
112
+ /**
113
+ * Checks to see if a texture is used in the material.
114
+ * @param texture - Base texture to use.
115
+ * @returns - Boolean specifying if a texture is used in the material.
116
+ */
117
+ hasTexture(texture: BaseTexture): boolean;
118
+ /**
119
+ * Gets a boolean indicating that current material needs to register RTT
120
+ * @returns true if this uses a render target otherwise false.
121
+ */
122
+ hasRenderTargetTextures(): boolean;
123
+ /**
124
+ * Fills the list of render target textures.
125
+ * @param renderTargets the list of render targets to update
126
+ */
127
+ fillRenderTargetTextures(renderTargets: SmartArray<RenderTargetTexture>): void;
128
+ /**
129
+ * Returns an array of the actively used textures.
130
+ * @param activeTextures Array of BaseTextures
131
+ */
132
+ getActiveTextures(activeTextures: BaseTexture[]): void;
133
+ /**
134
+ * Returns the animatable textures.
135
+ * @param animatables Array of animatable textures.
136
+ */
137
+ getAnimatables(animatables: IAnimatable[]): void;
138
+ /**
139
+ * Add fallbacks to the effect fallbacks list.
140
+ * @param defines defines the Base texture to use.
141
+ * @param fallbacks defines the current fallback list.
142
+ * @param currentRank defines the current fallback rank.
143
+ * @returns the new fallback rank.
144
+ */
145
+ addFallbacks(defines: MaterialDefines, fallbacks: EffectFallbacks, currentRank: number): number;
146
+ /**
147
+ * Gets the samplers used by the plugin.
148
+ * @param samplers list that the sampler names should be added to.
149
+ */
150
+ getSamplers(samplers: string[]): void;
151
+ /**
152
+ * Gets the description of the uniforms to add to the ubo (if engine supports ubos) or to inject directly in the vertex/fragment shaders (if engine does not support ubos)
153
+ * @returns the description of the uniforms
154
+ */
155
+ getUniforms(): {
156
+ ubo?: Array<{
157
+ name: string;
158
+ size: number;
159
+ type: string;
160
+ }>;
161
+ vertex?: string;
162
+ fragment?: string;
163
+ };
164
+ /**
165
+ * Makes a duplicate of the current configuration into another one.
166
+ * @param plugin define the config where to copy the info
167
+ */
168
+ copyTo(plugin: MaterialPluginBase): void;
169
+ /**
170
+ * Serializes this clear coat configuration.
171
+ * @returns - An object with the serialized config.
172
+ */
173
+ serialize(): any;
174
+ /**
175
+ * Parses a anisotropy Configuration from a serialized object.
176
+ * @param source - Serialized object.
177
+ * @param scene Defines the scene we are parsing for
178
+ * @param rootUrl Defines the rootUrl to load from
179
+ */
180
+ parse(source: any, scene: Scene, rootUrl: string): void;
181
+ }
182
+ export {};
@@ -0,0 +1,209 @@
1
+ import { __decorate } from "tslib";
2
+ import { SerializationHelper, serialize } from "../Misc/decorators.js";
3
+ import { MaterialPluginManager } from "./materialPluginManager.js";
4
+ /**
5
+ * Base class for material plugins.
6
+ * @since 5.0
7
+ */
8
+ var MaterialPluginBase = /** @class */ (function () {
9
+ /**
10
+ * Creates a new material plugin
11
+ * @param material parent material of the plugin
12
+ * @param name name of the plugin
13
+ * @param priority priority of the plugin
14
+ * @param defines list of defines used by the plugin. The value of the property is the default value for this property
15
+ * @param addToPluginList true to add the plugin to the list of plugins managed by the material plugin manager of the material (default: true)
16
+ */
17
+ function MaterialPluginBase(material, name, priority, defines, addToPluginList) {
18
+ if (addToPluginList === void 0) { addToPluginList = true; }
19
+ /**
20
+ * Defines the priority of the plugin. Lower numbers run first.
21
+ */
22
+ this.priority = 500;
23
+ /**
24
+ * Indicates that this plugin should be notified for the extra events (HasRenderTargetTextures / FillRenderTargetTextures / HardBindForSubMesh)
25
+ */
26
+ this.registerForExtraEvents = false;
27
+ this._material = material;
28
+ this.name = name;
29
+ this.priority = priority;
30
+ if (!material.pluginManager) {
31
+ material.pluginManager = new MaterialPluginManager(material);
32
+ }
33
+ this._pluginDefineNames = defines;
34
+ this._pluginManager = material.pluginManager;
35
+ if (addToPluginList) {
36
+ this._pluginManager._addPlugin(this);
37
+ }
38
+ }
39
+ MaterialPluginBase.prototype._enable = function (enable) {
40
+ if (enable) {
41
+ this._pluginManager._activatePlugin(this);
42
+ }
43
+ };
44
+ /**
45
+ * Gets the current class name useful for serialization or dynamic coding.
46
+ * @returns The class name.
47
+ */
48
+ MaterialPluginBase.prototype.getClassName = function () {
49
+ return "MaterialPluginBase";
50
+ };
51
+ /**
52
+ * Specifies that the submesh is ready to be used.
53
+ * @param defines the list of "defines" to update.
54
+ * @param scene defines the scene the material belongs to.
55
+ * @param engine the engine this scene belongs to.
56
+ * @param subMesh the submesh to check for readiness
57
+ * @returns - boolean indicating that the submesh is ready or not.
58
+ */
59
+ MaterialPluginBase.prototype.isReadyForSubMesh = function (defines, scene, engine, subMesh) {
60
+ return true;
61
+ };
62
+ /**
63
+ * Binds the material data (this function is called even if mustRebind() returns false)
64
+ * @param uniformBuffer defines the Uniform buffer to fill in.
65
+ * @param scene defines the scene the material belongs to.
66
+ * @param engine defines the engine the material belongs to.
67
+ * @param subMesh the submesh to bind data for
68
+ */
69
+ MaterialPluginBase.prototype.hardBindForSubMesh = function (uniformBuffer, scene, engine, subMesh) { };
70
+ /**
71
+ * Binds the material data.
72
+ * @param uniformBuffer defines the Uniform buffer to fill in.
73
+ * @param scene defines the scene the material belongs to.
74
+ * @param engine the engine this scene belongs to.
75
+ * @param subMesh the submesh to bind data for
76
+ */
77
+ MaterialPluginBase.prototype.bindForSubMesh = function (uniformBuffer, scene, engine, subMesh) { };
78
+ /**
79
+ * Disposes the resources of the material.
80
+ * @param forceDisposeTextures - Forces the disposal of all textures.
81
+ */
82
+ MaterialPluginBase.prototype.dispose = function (forceDisposeTextures) { };
83
+ /**
84
+ * Returns a list of custom shader code fragments to customize the shader.
85
+ * @param shaderType "vertex" or "fragment"
86
+ * @returns null if no code to be added, or a list of pointName => code.
87
+ * Note that `pointName` can also be a regular expression if it starts with a `!`.
88
+ * In that case, the string found by the regular expression (if any) will be
89
+ * replaced by the code provided.
90
+ */
91
+ MaterialPluginBase.prototype.getCustomCode = function (shaderType) {
92
+ return null;
93
+ };
94
+ /**
95
+ * Collects all defines.
96
+ * @param defines The object to append to.
97
+ */
98
+ MaterialPluginBase.prototype.collectDefines = function (defines) {
99
+ if (!this._pluginDefineNames) {
100
+ return;
101
+ }
102
+ for (var _i = 0, _a = Object.keys(this._pluginDefineNames); _i < _a.length; _i++) {
103
+ var key = _a[_i];
104
+ if (key[0] === "_") {
105
+ continue;
106
+ }
107
+ var type = typeof this._pluginDefineNames[key];
108
+ defines[key] = {
109
+ type: type === "number" ? "number" : type === "string" ? "string" : type === "boolean" ? "boolean" : "object",
110
+ default: this._pluginDefineNames[key],
111
+ };
112
+ }
113
+ };
114
+ /**
115
+ * Sets the defines for the next rendering
116
+ * @param defines the list of "defines" to update.
117
+ * @param scene defines the scene to the material belongs to.
118
+ * @param mesh the mesh being rendered
119
+ */
120
+ MaterialPluginBase.prototype.prepareDefines = function (defines, scene, mesh) { };
121
+ /**
122
+ * Checks to see if a texture is used in the material.
123
+ * @param texture - Base texture to use.
124
+ * @returns - Boolean specifying if a texture is used in the material.
125
+ */
126
+ MaterialPluginBase.prototype.hasTexture = function (texture) {
127
+ return false;
128
+ };
129
+ /**
130
+ * Gets a boolean indicating that current material needs to register RTT
131
+ * @returns true if this uses a render target otherwise false.
132
+ */
133
+ MaterialPluginBase.prototype.hasRenderTargetTextures = function () {
134
+ return false;
135
+ };
136
+ /**
137
+ * Fills the list of render target textures.
138
+ * @param renderTargets the list of render targets to update
139
+ */
140
+ MaterialPluginBase.prototype.fillRenderTargetTextures = function (renderTargets) { };
141
+ /**
142
+ * Returns an array of the actively used textures.
143
+ * @param activeTextures Array of BaseTextures
144
+ */
145
+ MaterialPluginBase.prototype.getActiveTextures = function (activeTextures) { };
146
+ /**
147
+ * Returns the animatable textures.
148
+ * @param animatables Array of animatable textures.
149
+ */
150
+ MaterialPluginBase.prototype.getAnimatables = function (animatables) { };
151
+ /**
152
+ * Add fallbacks to the effect fallbacks list.
153
+ * @param defines defines the Base texture to use.
154
+ * @param fallbacks defines the current fallback list.
155
+ * @param currentRank defines the current fallback rank.
156
+ * @returns the new fallback rank.
157
+ */
158
+ MaterialPluginBase.prototype.addFallbacks = function (defines, fallbacks, currentRank) {
159
+ return currentRank;
160
+ };
161
+ /**
162
+ * Gets the samplers used by the plugin.
163
+ * @param samplers list that the sampler names should be added to.
164
+ */
165
+ MaterialPluginBase.prototype.getSamplers = function (samplers) { };
166
+ /**
167
+ * Gets the description of the uniforms to add to the ubo (if engine supports ubos) or to inject directly in the vertex/fragment shaders (if engine does not support ubos)
168
+ * @returns the description of the uniforms
169
+ */
170
+ MaterialPluginBase.prototype.getUniforms = function () {
171
+ return {};
172
+ };
173
+ /**
174
+ * Makes a duplicate of the current configuration into another one.
175
+ * @param plugin define the config where to copy the info
176
+ */
177
+ MaterialPluginBase.prototype.copyTo = function (plugin) {
178
+ SerializationHelper.Clone(function () { return plugin; }, this);
179
+ };
180
+ /**
181
+ * Serializes this clear coat configuration.
182
+ * @returns - An object with the serialized config.
183
+ */
184
+ MaterialPluginBase.prototype.serialize = function () {
185
+ return SerializationHelper.Serialize(this);
186
+ };
187
+ /**
188
+ * Parses a anisotropy Configuration from a serialized object.
189
+ * @param source - Serialized object.
190
+ * @param scene Defines the scene we are parsing for
191
+ * @param rootUrl Defines the rootUrl to load from
192
+ */
193
+ MaterialPluginBase.prototype.parse = function (source, scene, rootUrl) {
194
+ var _this = this;
195
+ SerializationHelper.Parse(function () { return _this; }, source, scene, rootUrl);
196
+ };
197
+ __decorate([
198
+ serialize()
199
+ ], MaterialPluginBase.prototype, "name", void 0);
200
+ __decorate([
201
+ serialize()
202
+ ], MaterialPluginBase.prototype, "priority", void 0);
203
+ __decorate([
204
+ serialize()
205
+ ], MaterialPluginBase.prototype, "registerForExtraEvents", void 0);
206
+ return MaterialPluginBase;
207
+ }());
208
+ export { MaterialPluginBase };
209
+ //# sourceMappingURL=materialPluginBase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"materialPluginBase.js","sourceRoot":"","sources":["../../../sourceES6/core/Materials/materialPluginBase.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAehE;;;GAGG;AACH;IA6BI;;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Ac,GAArB,UAAsB,WAA0B,IAAS,CAAC;IAE1D;;;;;;OAMG;IACI,yCAAY,GAAnB,UAAoB,OAAwB,EAAE,SAA0B,EAAE,WAAmB;QACzF,OAAO,WAAW,CAAC;IACvB,CAAC;IAED;;;OAGG;IACI,wCAAW,GAAlB,UAAmB,QAAkB,IAAS,CAAC;IAE/C;;;OAGG;IACI,wCAAW,GAAlB;QACI,OAAO,EAAE,CAAC;IACd,CAAC;IAED;;;OAGG;IACI,mCAAM,GAAb,UAAc,MAA0B;QACpC,mBAAmB,CAAC,KAAK,CAAC,cAAM,OAAA,MAAM,EAAN,CAAM,EAAE,IAAI,CAAC,CAAC;IAClD,CAAC;IAED;;;OAGG;IACI,sCAAS,GAAhB;QACI,OAAO,mBAAmB,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC/C,CAAC;IAED;;;;;OAKG;IACI,kCAAK,GAAZ,UAAa,MAAW,EAAE,KAAY,EAAE,OAAe;QAAvD,iBAEC;QADG,mBAAmB,CAAC,KAAK,CAAC,cAAM,OAAA,KAAI,EAAJ,CAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC;IA1ND;QADC,SAAS,EAAE;oDACQ;IAMpB;QADC,SAAS,EAAE;wDACkB;IAM9B;QADC,SAAS,EAAE;sEACmC;IA+MnD,yBAAC;CAAA,AAhOD,IAgOC;SAhOY,kBAAkB","sourcesContent":["import { SerializationHelper, serialize } from \"../Misc/decorators\";\r\nimport { Nullable } from \"../types\";\r\nimport { MaterialPluginManager } from \"./materialPluginManager\";\r\nimport { SmartArray } from \"../Misc/smartArray\";\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 SubMesh = import(\"../Meshes/subMesh\").SubMesh;\r\ndeclare type IAnimatable = import(\"../Animations/animatable.interface\").IAnimatable;\r\ndeclare type UniformBuffer = import(\"./uniformBuffer\").UniformBuffer;\r\ndeclare type EffectFallbacks = import(\"./effectFallbacks\").EffectFallbacks;\r\ndeclare type MaterialDefines = import(\"./materialDefines\").MaterialDefines;\r\ndeclare type Material = import(\"./material\").Material;\r\ndeclare type BaseTexture = import(\"./Textures/baseTexture\").BaseTexture;\r\ndeclare type RenderTargetTexture = import(\"./Textures/renderTargetTexture\").RenderTargetTexture;\r\n\r\n/**\r\n * Base class for material plugins.\r\n * @since 5.0\r\n */\r\nexport class MaterialPluginBase {\r\n /**\r\n * Defines the name of the plugin\r\n */\r\n @serialize()\r\n public name: string;\r\n\r\n /**\r\n * Defines the priority of the plugin. Lower numbers run first.\r\n */\r\n @serialize()\r\n public priority: number = 500;\r\n\r\n /**\r\n * Indicates that this plugin should be notified for the extra events (HasRenderTargetTextures / FillRenderTargetTextures / HardBindForSubMesh)\r\n */\r\n @serialize()\r\n public registerForExtraEvents: boolean = false;\r\n\r\n protected _material: Material;\r\n protected _pluginManager: MaterialPluginManager;\r\n protected _pluginDefineNames?: { [name: string]: any };\r\n\r\n protected _enable(enable: boolean) {\r\n if (enable) {\r\n this._pluginManager._activatePlugin(this);\r\n }\r\n }\r\n\r\n /**\r\n * Creates a new material plugin\r\n * @param material parent material of the plugin\r\n * @param name name of the plugin\r\n * @param priority priority of the plugin\r\n * @param defines list of defines used by the plugin. The value of the property is the default value for this property\r\n * @param addToPluginList true to add the plugin to the list of plugins managed by the material plugin manager of the material (default: true)\r\n */\r\n constructor(material: Material, name: string, priority: number, defines?: { [key: string]: any }, addToPluginList = true) {\r\n this._material = material;\r\n this.name = name;\r\n this.priority = priority;\r\n\r\n if (!material.pluginManager) {\r\n material.pluginManager = new MaterialPluginManager(material);\r\n }\r\n\r\n this._pluginDefineNames = defines;\r\n this._pluginManager = material.pluginManager;\r\n\r\n if (addToPluginList) {\r\n this._pluginManager._addPlugin(this);\r\n }\r\n }\r\n\r\n /**\r\n * Gets the current class name useful for serialization or dynamic coding.\r\n * @returns The class name.\r\n */\r\n public getClassName(): string {\r\n return \"MaterialPluginBase\";\r\n }\r\n\r\n /**\r\n * Specifies that the submesh is ready to be used.\r\n * @param defines the list of \"defines\" to update.\r\n * @param scene defines the scene the material belongs to.\r\n * @param engine the engine this scene belongs to.\r\n * @param subMesh the submesh to check for readiness\r\n * @returns - boolean indicating that the submesh is ready or not.\r\n */\r\n public isReadyForSubMesh(defines: MaterialDefines, scene: Scene, engine: Engine, subMesh: SubMesh): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Binds the material data (this function is called even if mustRebind() returns false)\r\n * @param uniformBuffer defines the Uniform buffer to fill in.\r\n * @param scene defines the scene the material belongs to.\r\n * @param engine defines the engine the material belongs to.\r\n * @param subMesh the submesh to bind data for\r\n */\r\n public hardBindForSubMesh(uniformBuffer: UniformBuffer, scene: Scene, engine: Engine, subMesh: SubMesh): void {}\r\n\r\n /**\r\n * Binds the material data.\r\n * @param uniformBuffer defines the Uniform buffer to fill in.\r\n * @param scene defines the scene the material belongs to.\r\n * @param engine the engine this scene belongs to.\r\n * @param subMesh the submesh to bind data for\r\n */\r\n public bindForSubMesh(uniformBuffer: UniformBuffer, scene: Scene, engine: Engine, subMesh: SubMesh): void {}\r\n\r\n /**\r\n * Disposes the resources of the material.\r\n * @param forceDisposeTextures - Forces the disposal of all textures.\r\n */\r\n public dispose(forceDisposeTextures?: boolean): void {}\r\n\r\n /**\r\n * Returns a list of custom shader code fragments to customize the shader.\r\n * @param shaderType \"vertex\" or \"fragment\"\r\n * @returns null if no code to be added, or a list of pointName => code.\r\n * Note that `pointName` can also be a regular expression if it starts with a `!`.\r\n * In that case, the string found by the regular expression (if any) will be\r\n * replaced by the code provided.\r\n */\r\n public getCustomCode(shaderType: string): Nullable<{ [pointName: string]: string }> {\r\n return null;\r\n }\r\n\r\n /**\r\n * Collects all defines.\r\n * @param defines The object to append to.\r\n */\r\n public collectDefines(defines: { [name: string]: { type: string; default: any } }): void {\r\n if (!this._pluginDefineNames) {\r\n return;\r\n }\r\n for (const key of Object.keys(this._pluginDefineNames)) {\r\n if (key[0] === \"_\") {\r\n continue;\r\n }\r\n\r\n const type = typeof this._pluginDefineNames[key];\r\n defines[key] = {\r\n type: type === \"number\" ? \"number\" : type === \"string\" ? \"string\" : type === \"boolean\" ? \"boolean\" : \"object\",\r\n default: this._pluginDefineNames[key],\r\n };\r\n }\r\n }\r\n\r\n /**\r\n * Sets the defines for the next rendering\r\n * @param defines the list of \"defines\" to update.\r\n * @param scene defines the scene to the material belongs to.\r\n * @param mesh the mesh being rendered\r\n */\r\n public prepareDefines(defines: MaterialDefines, scene: Scene, mesh: AbstractMesh): void {}\r\n\r\n /**\r\n * Checks to see if a texture is used in the material.\r\n * @param texture - Base texture to use.\r\n * @returns - Boolean specifying if a texture is used in the material.\r\n */\r\n public hasTexture(texture: BaseTexture): boolean {\r\n return false;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating that current material needs to register RTT\r\n * @returns true if this uses a render target otherwise false.\r\n */\r\n public hasRenderTargetTextures(): boolean {\r\n return false;\r\n }\r\n\r\n /**\r\n * Fills the list of render target textures.\r\n * @param renderTargets the list of render targets to update\r\n */\r\n public fillRenderTargetTextures(renderTargets: SmartArray<RenderTargetTexture>): void {}\r\n\r\n /**\r\n * Returns an array of the actively used textures.\r\n * @param activeTextures Array of BaseTextures\r\n */\r\n public getActiveTextures(activeTextures: BaseTexture[]): void {}\r\n\r\n /**\r\n * Returns the animatable textures.\r\n * @param animatables Array of animatable textures.\r\n */\r\n public getAnimatables(animatables: IAnimatable[]): void {}\r\n\r\n /**\r\n * Add fallbacks to the effect fallbacks list.\r\n * @param defines defines the Base texture to use.\r\n * @param fallbacks defines the current fallback list.\r\n * @param currentRank defines the current fallback rank.\r\n * @returns the new fallback rank.\r\n */\r\n public addFallbacks(defines: MaterialDefines, fallbacks: EffectFallbacks, currentRank: number): number {\r\n return currentRank;\r\n }\r\n\r\n /**\r\n * Gets the samplers used by the plugin.\r\n * @param samplers list that the sampler names should be added to.\r\n */\r\n public getSamplers(samplers: string[]): void {}\r\n\r\n /**\r\n * Gets the description of the uniforms to add to the ubo (if engine supports ubos) or to inject directly in the vertex/fragment shaders (if engine does not support ubos)\r\n * @returns the description of the uniforms\r\n */\r\n public getUniforms(): { ubo?: Array<{ name: string; size: number; type: string }>; vertex?: string; fragment?: string } {\r\n return {};\r\n }\r\n\r\n /**\r\n * Makes a duplicate of the current configuration into another one.\r\n * @param plugin define the config where to copy the info\r\n */\r\n public copyTo(plugin: MaterialPluginBase): void {\r\n SerializationHelper.Clone(() => plugin, this);\r\n }\r\n\r\n /**\r\n * Serializes this clear coat configuration.\r\n * @returns - An object with the serialized config.\r\n */\r\n public serialize(): any {\r\n return SerializationHelper.Serialize(this);\r\n }\r\n\r\n /**\r\n * Parses a anisotropy Configuration from a serialized object.\r\n * @param source - Serialized object.\r\n * @param scene Defines the scene we are parsing for\r\n * @param rootUrl Defines the rootUrl to load from\r\n */\r\n public parse(source: any, scene: Scene, rootUrl: string): void {\r\n SerializationHelper.Parse(() => this, source, scene, rootUrl);\r\n }\r\n}\r\n"]}
@@ -0,0 +1,98 @@
1
+ import { ShaderCustomProcessingFunction } from "../Engines/Processors/shaderProcessingOptions";
2
+ import { SmartArray } from "../Misc/smartArray";
3
+ declare type BaseTexture = import("./Textures/baseTexture").BaseTexture;
4
+ declare type EffectFallbacks = import("./effectFallbacks").EffectFallbacks;
5
+ declare type MaterialDefines = import("./materialDefines").MaterialDefines;
6
+ declare type UniformBuffer = import("./uniformBuffer").UniformBuffer;
7
+ declare type SubMesh = import("../Meshes/subMesh").SubMesh;
8
+ declare type AbstractMesh = import("../Meshes/abstractMesh").AbstractMesh;
9
+ declare type IAnimatable = import("../Animations/animatable.interface").IAnimatable;
10
+ declare type RenderTargetTexture = import("./Textures/renderTargetTexture").RenderTargetTexture;
11
+ /** @hidden */
12
+ export declare type MaterialPluginCreated = {};
13
+ /** @hidden */
14
+ export declare type MaterialPluginDisposed = {
15
+ forceDisposeTextures?: boolean;
16
+ };
17
+ /** @hidden */
18
+ export declare type MaterialPluginHasTexture = {
19
+ hasTexture: boolean;
20
+ texture: BaseTexture;
21
+ };
22
+ /** @hidden */
23
+ export declare type MaterialPluginIsReadyForSubMesh = {
24
+ isReadyForSubMesh: boolean;
25
+ defines: MaterialDefines;
26
+ subMesh: SubMesh;
27
+ };
28
+ /** @hidden */
29
+ export declare type MaterialPluginGetDefineNames = {
30
+ defineNames?: {
31
+ [name: string]: {
32
+ type: string;
33
+ default: any;
34
+ };
35
+ };
36
+ };
37
+ /** @hidden */
38
+ export declare type MaterialPluginPrepareEffect = {
39
+ defines: MaterialDefines;
40
+ fallbacks: EffectFallbacks;
41
+ fallbackRank: number;
42
+ customCode?: ShaderCustomProcessingFunction;
43
+ uniforms: string[];
44
+ samplers: string[];
45
+ };
46
+ /** @hidden */
47
+ export declare type MaterialPluginPrepareDefines = {
48
+ defines: MaterialDefines;
49
+ mesh: AbstractMesh;
50
+ };
51
+ /** @hidden */
52
+ export declare type MaterialPluginPrepareUniformBuffer = {
53
+ ubo: UniformBuffer;
54
+ };
55
+ /** @hidden */
56
+ export declare type MaterialPluginBindForSubMesh = {
57
+ subMesh: SubMesh;
58
+ };
59
+ /** @hidden */
60
+ export declare type MaterialPluginGetAnimatables = {
61
+ animatables: IAnimatable[];
62
+ };
63
+ /** @hidden */
64
+ export declare type MaterialPluginGetActiveTextures = {
65
+ activeTextures: BaseTexture[];
66
+ };
67
+ /** @hidden */
68
+ export declare type MaterialPluginFillRenderTargetTextures = {
69
+ renderTargets: SmartArray<RenderTargetTexture>;
70
+ };
71
+ /** @hidden */
72
+ export declare type MaterialPluginHasRenderTargetTextures = {
73
+ hasRenderTargetTextures: boolean;
74
+ };
75
+ /** @hidden */
76
+ export declare type MaterialPluginHardBindForSubMesh = {
77
+ subMesh: SubMesh;
78
+ };
79
+ /**
80
+ * @hidden
81
+ */
82
+ export declare enum MaterialPluginEvent {
83
+ Created = 1,
84
+ Disposed = 2,
85
+ GetDefineNames = 4,
86
+ PrepareUniformBuffer = 8,
87
+ IsReadyForSubMesh = 16,
88
+ PrepareDefines = 32,
89
+ BindForSubMesh = 64,
90
+ PrepareEffect = 128,
91
+ GetAnimatables = 256,
92
+ GetActiveTextures = 512,
93
+ HasTexture = 1024,
94
+ FillRenderTargetTextures = 2048,
95
+ HasRenderTargetTextures = 4096,
96
+ HardBindForSubMesh = 8192
97
+ }
98
+ export {};