@babylonjs/core 7.2.2 → 7.2.3

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 (376) hide show
  1. package/Animations/runtimeAnimation.d.ts +1 -0
  2. package/Animations/runtimeAnimation.js +12 -3
  3. package/Animations/runtimeAnimation.js.map +1 -1
  4. package/Audio/audioEngine.js +2 -2
  5. package/Audio/audioEngine.js.map +1 -1
  6. package/Bones/boneLookController.js +3 -0
  7. package/Bones/boneLookController.js.map +1 -1
  8. package/Buffers/buffer.d.ts +5 -5
  9. package/Buffers/buffer.js.map +1 -1
  10. package/Buffers/storageBuffer.d.ts +2 -2
  11. package/Buffers/storageBuffer.js.map +1 -1
  12. package/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.js.map +1 -1
  13. package/Cameras/Inputs/flyCameraKeyboardInput.js.map +1 -1
  14. package/Cameras/Inputs/followCameraKeyboardMoveInput.js.map +1 -1
  15. package/Cameras/Inputs/freeCameraKeyboardMoveInput.js.map +1 -1
  16. package/Compute/computeEffect.d.ts +3 -3
  17. package/Compute/computeEffect.js.map +1 -1
  18. package/Compute/computeShader.d.ts +10 -2
  19. package/Compute/computeShader.js +53 -35
  20. package/Compute/computeShader.js.map +1 -1
  21. package/DeviceInput/InputDevices/deviceSourceManager.d.ts +2 -2
  22. package/DeviceInput/InputDevices/deviceSourceManager.js.map +1 -1
  23. package/DeviceInput/internalDeviceSourceManager.d.ts +4 -4
  24. package/DeviceInput/internalDeviceSourceManager.js.map +1 -1
  25. package/DeviceInput/webDeviceInputSystem.d.ts +2 -2
  26. package/DeviceInput/webDeviceInputSystem.js.map +1 -1
  27. package/Engines/AbstractEngine/abstractEngine.alpha.d.ts +10 -0
  28. package/Engines/AbstractEngine/abstractEngine.alpha.js +29 -0
  29. package/Engines/AbstractEngine/abstractEngine.alpha.js.map +1 -0
  30. package/Engines/AbstractEngine/abstractEngine.cubeTexture.d.ts +17 -0
  31. package/Engines/AbstractEngine/abstractEngine.cubeTexture.js +138 -0
  32. package/Engines/AbstractEngine/abstractEngine.cubeTexture.js.map +1 -0
  33. package/Engines/AbstractEngine/abstractEngine.dom.d.ts +61 -0
  34. package/Engines/AbstractEngine/abstractEngine.dom.js +27 -0
  35. package/Engines/AbstractEngine/abstractEngine.dom.js.map +1 -0
  36. package/Engines/AbstractEngine/abstractEngine.loadingScreen.d.ts +30 -0
  37. package/Engines/AbstractEngine/abstractEngine.loadingScreen.js +48 -0
  38. package/Engines/AbstractEngine/abstractEngine.loadingScreen.js.map +1 -0
  39. package/Engines/AbstractEngine/abstractEngine.query.d.ts +122 -0
  40. package/Engines/AbstractEngine/abstractEngine.query.js +175 -0
  41. package/Engines/AbstractEngine/abstractEngine.query.js.map +1 -0
  42. package/Engines/AbstractEngine/abstractEngine.renderPass.d.ts +26 -0
  43. package/Engines/AbstractEngine/abstractEngine.renderPass.js +29 -0
  44. package/Engines/AbstractEngine/abstractEngine.renderPass.js.map +1 -0
  45. package/Engines/AbstractEngine/abstractEngine.states.d.ts +162 -0
  46. package/Engines/AbstractEngine/abstractEngine.states.js +105 -0
  47. package/Engines/AbstractEngine/abstractEngine.states.js.map +1 -0
  48. package/Engines/AbstractEngine/abstractEngine.texture.d.ts +16 -0
  49. package/Engines/AbstractEngine/abstractEngine.texture.js +11 -0
  50. package/Engines/AbstractEngine/abstractEngine.texture.js.map +1 -0
  51. package/Engines/AbstractEngine/index.d.ts +8 -0
  52. package/Engines/AbstractEngine/index.js +10 -0
  53. package/Engines/AbstractEngine/index.js.map +1 -0
  54. package/Engines/Extensions/engine.alpha.d.ts +0 -24
  55. package/Engines/Extensions/engine.alpha.js +0 -35
  56. package/Engines/Extensions/engine.alpha.js.map +1 -1
  57. package/Engines/Extensions/engine.computeShader.d.ts +15 -2
  58. package/Engines/Extensions/engine.computeShader.js +5 -1
  59. package/Engines/Extensions/engine.computeShader.js.map +1 -1
  60. package/Engines/Extensions/engine.cubeTexture.d.ts +0 -8
  61. package/Engines/Extensions/engine.cubeTexture.js +2 -135
  62. package/Engines/Extensions/engine.cubeTexture.js.map +1 -1
  63. package/Engines/Extensions/engine.debugging.d.ts +2 -2
  64. package/Engines/Extensions/engine.debugging.js +5 -5
  65. package/Engines/Extensions/engine.debugging.js.map +1 -1
  66. package/Engines/Extensions/engine.dynamicTexture.js +3 -2
  67. package/Engines/Extensions/engine.dynamicTexture.js.map +1 -1
  68. package/Engines/Extensions/engine.multiview.js.map +1 -1
  69. package/Engines/Extensions/engine.query.d.ts +5 -120
  70. package/Engines/Extensions/engine.query.js +14 -150
  71. package/Engines/Extensions/engine.query.js.map +1 -1
  72. package/Engines/Extensions/engine.renderTarget.js +0 -9
  73. package/Engines/Extensions/engine.renderTarget.js.map +1 -1
  74. package/Engines/Extensions/engine.views.d.ts +3 -2
  75. package/Engines/Extensions/engine.views.js.map +1 -1
  76. package/Engines/Processors/iShaderProcessor.d.ts +2 -2
  77. package/Engines/Processors/iShaderProcessor.js.map +1 -1
  78. package/Engines/Processors/shaderProcessor.d.ts +3 -3
  79. package/Engines/Processors/shaderProcessor.js.map +1 -1
  80. package/Engines/WebGL/webGLRenderTargetWrapper.js +12 -9
  81. package/Engines/WebGL/webGLRenderTargetWrapper.js.map +1 -1
  82. package/Engines/WebGL/webGLShaderProcessors.d.ts +2 -2
  83. package/Engines/WebGL/webGLShaderProcessors.js.map +1 -1
  84. package/Engines/WebGPU/Extensions/engine.alpha.d.ts +35 -0
  85. package/Engines/WebGPU/Extensions/engine.alpha.js +4 -4
  86. package/Engines/WebGPU/Extensions/engine.alpha.js.map +1 -1
  87. package/Engines/WebGPU/Extensions/engine.computeShader.d.ts +9 -0
  88. package/Engines/WebGPU/Extensions/engine.computeShader.js +13 -2
  89. package/Engines/WebGPU/Extensions/engine.computeShader.js.map +1 -1
  90. package/Engines/WebGPU/Extensions/engine.cubeTexture.d.ts +78 -1
  91. package/Engines/WebGPU/Extensions/engine.cubeTexture.js.map +1 -1
  92. package/Engines/WebGPU/Extensions/engine.dynamicTexture.d.ts +27 -1
  93. package/Engines/WebGPU/Extensions/engine.dynamicTexture.js +3 -3
  94. package/Engines/WebGPU/Extensions/engine.dynamicTexture.js.map +1 -1
  95. package/Engines/WebGPU/Extensions/engine.externalTexture.d.ts +16 -0
  96. package/Engines/WebGPU/Extensions/engine.externalTexture.js.map +1 -1
  97. package/Engines/WebGPU/Extensions/engine.multiRender.d.ts +55 -1
  98. package/Engines/WebGPU/Extensions/engine.multiRender.js.map +1 -1
  99. package/Engines/WebGPU/Extensions/engine.query.d.ts +1 -1
  100. package/Engines/WebGPU/Extensions/engine.query.js +1 -0
  101. package/Engines/WebGPU/Extensions/engine.query.js.map +1 -1
  102. package/Engines/WebGPU/Extensions/engine.rawTexture.d.ts +185 -1
  103. package/Engines/WebGPU/Extensions/engine.rawTexture.js.map +1 -1
  104. package/Engines/WebGPU/Extensions/engine.readTexture.d.ts +10 -1
  105. package/Engines/WebGPU/Extensions/engine.readTexture.js.map +1 -1
  106. package/Engines/WebGPU/Extensions/engine.renderTarget.d.ts +38 -1
  107. package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
  108. package/Engines/WebGPU/Extensions/engine.renderTargetCube.d.ts +13 -1
  109. package/Engines/WebGPU/Extensions/engine.renderTargetCube.js.map +1 -1
  110. package/Engines/WebGPU/Extensions/engine.storageBuffer.d.ts +38 -1
  111. package/Engines/WebGPU/Extensions/engine.storageBuffer.js.map +1 -1
  112. package/Engines/WebGPU/Extensions/engine.textureSampler.d.ts +10 -0
  113. package/Engines/WebGPU/Extensions/engine.textureSampler.js.map +1 -1
  114. package/Engines/WebGPU/Extensions/engine.videoTexture.d.ts +14 -1
  115. package/Engines/WebGPU/Extensions/engine.videoTexture.js.map +1 -1
  116. package/Engines/WebGPU/webgpuShaderProcessorsGLSL.d.ts +2 -2
  117. package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js.map +1 -1
  118. package/Engines/abstractEngine.d.ts +1688 -0
  119. package/Engines/abstractEngine.js +1354 -0
  120. package/Engines/abstractEngine.js.map +1 -0
  121. package/Engines/engine.common.d.ts +39 -0
  122. package/Engines/engine.common.js +226 -0
  123. package/Engines/engine.common.js.map +1 -0
  124. package/Engines/engine.d.ts +40 -447
  125. package/Engines/engine.js +64 -810
  126. package/Engines/engine.js.map +1 -1
  127. package/Engines/engineFactory.d.ts +2 -2
  128. package/Engines/engineFactory.js.map +1 -1
  129. package/Engines/engineStore.d.ts +4 -4
  130. package/Engines/engineStore.js.map +1 -1
  131. package/Engines/index.d.ts +3 -0
  132. package/Engines/index.js +3 -0
  133. package/Engines/index.js.map +1 -1
  134. package/Engines/nativeEngine.d.ts +1 -1
  135. package/Engines/nativeEngine.js +2 -1
  136. package/Engines/nativeEngine.js.map +1 -1
  137. package/Engines/nullEngine.d.ts +2 -2
  138. package/Engines/nullEngine.js +2 -3
  139. package/Engines/nullEngine.js.map +1 -1
  140. package/Engines/renderTargetWrapper.d.ts +3 -3
  141. package/Engines/renderTargetWrapper.js.map +1 -1
  142. package/Engines/thinEngine.d.ts +35 -591
  143. package/Engines/thinEngine.js +84 -1134
  144. package/Engines/thinEngine.js.map +1 -1
  145. package/Engines/webgpuEngine.d.ts +149 -109
  146. package/Engines/webgpuEngine.js +249 -161
  147. package/Engines/webgpuEngine.js.map +1 -1
  148. package/Instrumentation/engineInstrumentation.d.ts +5 -4
  149. package/Instrumentation/engineInstrumentation.js.map +1 -1
  150. package/Layers/effectLayer.d.ts +2 -2
  151. package/Layers/effectLayer.js +3 -3
  152. package/Layers/effectLayer.js.map +1 -1
  153. package/Layers/effectLayerSceneComponent.js.map +1 -1
  154. package/Layers/glowLayer.js +3 -3
  155. package/Layers/glowLayer.js.map +1 -1
  156. package/Layers/highlightLayer.js +3 -3
  157. package/Layers/highlightLayer.js.map +1 -1
  158. package/Layers/layerSceneComponent.js.map +1 -1
  159. package/Loading/loadingScreen.js +2 -2
  160. package/Loading/loadingScreen.js.map +1 -1
  161. package/Loading/sceneLoader.d.ts +3 -3
  162. package/Loading/sceneLoader.js +1 -1
  163. package/Loading/sceneLoader.js.map +1 -1
  164. package/Materials/GreasedLine/greasedLinePluginMaterial.js.map +1 -1
  165. package/Materials/Textures/Filtering/hdrFiltering.d.ts +2 -2
  166. package/Materials/Textures/Filtering/hdrFiltering.js.map +1 -1
  167. package/Materials/Textures/Loaders/basisTextureLoader.js +2 -2
  168. package/Materials/Textures/Loaders/basisTextureLoader.js.map +1 -1
  169. package/Materials/Textures/MultiviewRenderTarget.d.ts +1 -0
  170. package/Materials/Textures/MultiviewRenderTarget.js +1 -0
  171. package/Materials/Textures/MultiviewRenderTarget.js.map +1 -1
  172. package/Materials/Textures/Procedurals/proceduralTexture.js +1 -1
  173. package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
  174. package/Materials/Textures/baseTexture.d.ts +3 -3
  175. package/Materials/Textures/baseTexture.js.map +1 -1
  176. package/Materials/Textures/colorGradingTexture.d.ts +2 -2
  177. package/Materials/Textures/colorGradingTexture.js.map +1 -1
  178. package/Materials/Textures/cubeTexture.d.ts +3 -2
  179. package/Materials/Textures/cubeTexture.js +1 -0
  180. package/Materials/Textures/cubeTexture.js.map +1 -1
  181. package/Materials/Textures/hdrCubeTexture.d.ts +2 -2
  182. package/Materials/Textures/hdrCubeTexture.js.map +1 -1
  183. package/Materials/Textures/htmlElementTexture.d.ts +2 -2
  184. package/Materials/Textures/htmlElementTexture.js.map +1 -1
  185. package/Materials/Textures/internalTexture.d.ts +3 -3
  186. package/Materials/Textures/internalTexture.js.map +1 -1
  187. package/Materials/Textures/rawTexture.d.ts +10 -10
  188. package/Materials/Textures/rawTexture.js.map +1 -1
  189. package/Materials/Textures/renderTargetTexture.d.ts +4 -4
  190. package/Materials/Textures/renderTargetTexture.js +4 -4
  191. package/Materials/Textures/renderTargetTexture.js.map +1 -1
  192. package/Materials/Textures/texture.d.ts +2 -2
  193. package/Materials/Textures/texture.js.map +1 -1
  194. package/Materials/Textures/thinTexture.d.ts +3 -3
  195. package/Materials/Textures/thinTexture.js +1 -1
  196. package/Materials/Textures/thinTexture.js.map +1 -1
  197. package/Materials/drawWrapper.d.ts +2 -3
  198. package/Materials/drawWrapper.functions.d.ts +8 -0
  199. package/Materials/drawWrapper.functions.js +9 -0
  200. package/Materials/drawWrapper.functions.js.map +1 -0
  201. package/Materials/drawWrapper.js +0 -3
  202. package/Materials/drawWrapper.js.map +1 -1
  203. package/Materials/effect.d.ts +4 -5
  204. package/Materials/effect.js.map +1 -1
  205. package/Materials/effectRenderer.d.ts +4 -4
  206. package/Materials/effectRenderer.js.map +1 -1
  207. package/Materials/index.d.ts +1 -0
  208. package/Materials/index.js +1 -0
  209. package/Materials/index.js.map +1 -1
  210. package/Materials/materialHelper.functions.d.ts +2 -2
  211. package/Materials/materialHelper.functions.js.map +1 -1
  212. package/Materials/materialPluginBase.d.ts +4 -4
  213. package/Materials/materialPluginBase.js.map +1 -1
  214. package/Materials/materialPluginManager.d.ts +2 -2
  215. package/Materials/materialPluginManager.js.map +1 -1
  216. package/Materials/meshDebugPluginMaterial.js +1 -1
  217. package/Materials/meshDebugPluginMaterial.js.map +1 -1
  218. package/Materials/uniformBuffer.d.ts +2 -2
  219. package/Materials/uniformBuffer.js.map +1 -1
  220. package/Meshes/Builders/greasedLineBuilder.d.ts +6 -0
  221. package/Meshes/Builders/greasedLineBuilder.js +15 -8
  222. package/Meshes/Builders/greasedLineBuilder.js.map +1 -1
  223. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +1 -1
  224. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
  225. package/Meshes/GreasedLine/greasedLineBaseMesh.d.ts +2 -2
  226. package/Meshes/GreasedLine/greasedLineBaseMesh.js.map +1 -1
  227. package/Meshes/GreasedLine/greasedLineMesh.js +1 -1
  228. package/Meshes/GreasedLine/greasedLineMesh.js.map +1 -1
  229. package/Meshes/geometry.d.ts +2 -2
  230. package/Meshes/geometry.js +3 -2
  231. package/Meshes/geometry.js.map +1 -1
  232. package/Meshes/instancedMesh.js.map +1 -1
  233. package/Meshes/mesh.d.ts +3 -3
  234. package/Meshes/mesh.js.map +1 -1
  235. package/Meshes/subMesh.d.ts +2 -2
  236. package/Meshes/subMesh.js.map +1 -1
  237. package/Misc/PerformanceViewer/performanceViewerCollectionStrategies.js.map +1 -1
  238. package/Misc/copyTextureToTexture.d.ts +2 -2
  239. package/Misc/copyTextureToTexture.js.map +1 -1
  240. package/Misc/dds.d.ts +3 -2
  241. package/Misc/dds.js +2 -1
  242. package/Misc/dds.js.map +1 -1
  243. package/Misc/dumpTools.d.ts +2 -2
  244. package/Misc/dumpTools.js.map +1 -1
  245. package/Misc/fileTools.js +3 -3
  246. package/Misc/fileTools.js.map +1 -1
  247. package/Misc/khronosTextureContainer2.d.ts +8 -2
  248. package/Misc/khronosTextureContainer2.js +3 -2
  249. package/Misc/khronosTextureContainer2.js.map +1 -1
  250. package/Misc/minMaxReducer.d.ts +2 -2
  251. package/Misc/minMaxReducer.js.map +1 -1
  252. package/Misc/textureTools.js.map +1 -1
  253. package/Misc/tools.d.ts +7 -7
  254. package/Misc/tools.functions.d.ts +26 -0
  255. package/Misc/tools.functions.js +62 -0
  256. package/Misc/tools.functions.js.map +1 -1
  257. package/Misc/tools.js.map +1 -1
  258. package/Misc/videoRecorder.d.ts +3 -3
  259. package/Misc/videoRecorder.js.map +1 -1
  260. package/Particles/baseParticleSystem.d.ts +2 -2
  261. package/Particles/baseParticleSystem.js.map +1 -1
  262. package/Particles/computeShaderParticleSystem.d.ts +2 -2
  263. package/Particles/computeShaderParticleSystem.js.map +1 -1
  264. package/Particles/gpuParticleSystem.d.ts +3 -3
  265. package/Particles/gpuParticleSystem.js +2 -2
  266. package/Particles/gpuParticleSystem.js.map +1 -1
  267. package/Particles/particle.js +1 -1
  268. package/Particles/particle.js.map +1 -1
  269. package/Particles/particleSystem.d.ts +3 -3
  270. package/Particles/particleSystem.js +3 -3
  271. package/Particles/particleSystem.js.map +1 -1
  272. package/Particles/particleSystemComponent.d.ts +2 -2
  273. package/Particles/particleSystemComponent.js +2 -2
  274. package/Particles/particleSystemComponent.js.map +1 -1
  275. package/Particles/subEmitter.d.ts +3 -3
  276. package/Particles/subEmitter.js.map +1 -1
  277. package/Particles/thinParticleSystem.d.ts +2 -2
  278. package/Particles/thinParticleSystem.js.map +1 -1
  279. package/Physics/v2/physicsBody.js +3 -3
  280. package/Physics/v2/physicsBody.js.map +1 -1
  281. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
  282. package/PostProcesses/RenderPipeline/postProcessRenderEffect.d.ts +2 -2
  283. package/PostProcesses/RenderPipeline/postProcessRenderEffect.js.map +1 -1
  284. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.d.ts +2 -2
  285. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js.map +1 -1
  286. package/PostProcesses/blackAndWhitePostProcess.d.ts +2 -2
  287. package/PostProcesses/blackAndWhitePostProcess.js.map +1 -1
  288. package/PostProcesses/bloomMergePostProcess.d.ts +2 -2
  289. package/PostProcesses/bloomMergePostProcess.js.map +1 -1
  290. package/PostProcesses/blurPostProcess.d.ts +2 -2
  291. package/PostProcesses/blurPostProcess.js.map +1 -1
  292. package/PostProcesses/chromaticAberrationPostProcess.d.ts +2 -2
  293. package/PostProcesses/chromaticAberrationPostProcess.js.map +1 -1
  294. package/PostProcesses/circleOfConfusionPostProcess.d.ts +2 -2
  295. package/PostProcesses/circleOfConfusionPostProcess.js.map +1 -1
  296. package/PostProcesses/colorCorrectionPostProcess.d.ts +2 -2
  297. package/PostProcesses/colorCorrectionPostProcess.js.map +1 -1
  298. package/PostProcesses/convolutionPostProcess.d.ts +2 -2
  299. package/PostProcesses/convolutionPostProcess.js.map +1 -1
  300. package/PostProcesses/depthOfFieldBlurPostProcess.d.ts +2 -2
  301. package/PostProcesses/depthOfFieldBlurPostProcess.js.map +1 -1
  302. package/PostProcesses/depthOfFieldEffect.js +1 -1
  303. package/PostProcesses/depthOfFieldEffect.js.map +1 -1
  304. package/PostProcesses/depthOfFieldMergePostProcess.d.ts +2 -2
  305. package/PostProcesses/depthOfFieldMergePostProcess.js.map +1 -1
  306. package/PostProcesses/displayPassPostProcess.d.ts +2 -2
  307. package/PostProcesses/displayPassPostProcess.js.map +1 -1
  308. package/PostProcesses/extractHighlightsPostProcess.d.ts +2 -2
  309. package/PostProcesses/extractHighlightsPostProcess.js.map +1 -1
  310. package/PostProcesses/filterPostProcess.d.ts +2 -2
  311. package/PostProcesses/filterPostProcess.js.map +1 -1
  312. package/PostProcesses/fxaaPostProcess.d.ts +2 -2
  313. package/PostProcesses/fxaaPostProcess.js +2 -2
  314. package/PostProcesses/fxaaPostProcess.js.map +1 -1
  315. package/PostProcesses/grainPostProcess.d.ts +2 -2
  316. package/PostProcesses/grainPostProcess.js.map +1 -1
  317. package/PostProcesses/imageProcessingPostProcess.d.ts +2 -2
  318. package/PostProcesses/imageProcessingPostProcess.js.map +1 -1
  319. package/PostProcesses/motionBlurPostProcess.d.ts +2 -2
  320. package/PostProcesses/motionBlurPostProcess.js.map +1 -1
  321. package/PostProcesses/passPostProcess.d.ts +3 -3
  322. package/PostProcesses/passPostProcess.js +2 -2
  323. package/PostProcesses/passPostProcess.js.map +1 -1
  324. package/PostProcesses/postProcess.d.ts +4 -4
  325. package/PostProcesses/postProcess.js +3 -3
  326. package/PostProcesses/postProcess.js.map +1 -1
  327. package/PostProcesses/refractionPostProcess.d.ts +2 -2
  328. package/PostProcesses/refractionPostProcess.js.map +1 -1
  329. package/PostProcesses/screenSpaceCurvaturePostProcess.d.ts +2 -2
  330. package/PostProcesses/screenSpaceCurvaturePostProcess.js.map +1 -1
  331. package/PostProcesses/screenSpaceReflectionPostProcess.d.ts +2 -2
  332. package/PostProcesses/screenSpaceReflectionPostProcess.js.map +1 -1
  333. package/PostProcesses/sharpenPostProcess.d.ts +2 -2
  334. package/PostProcesses/sharpenPostProcess.js.map +1 -1
  335. package/PostProcesses/subSurfaceScatteringPostProcess.d.ts +2 -2
  336. package/PostProcesses/subSurfaceScatteringPostProcess.js.map +1 -1
  337. package/PostProcesses/volumetricLightScatteringPostProcess.d.ts +2 -2
  338. package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
  339. package/Rendering/GlobalIllumination/giRSMManager.js.map +1 -1
  340. package/Rendering/depthPeelingRenderer.js.map +1 -1
  341. package/Rendering/fluidRenderer/fluidRenderer.js.map +1 -1
  342. package/Rendering/fluidRenderer/fluidRenderingDepthTextureCopy.d.ts +2 -2
  343. package/Rendering/fluidRenderer/fluidRenderingDepthTextureCopy.js.map +1 -1
  344. package/Rendering/fluidRenderer/fluidRenderingObject.d.ts +2 -2
  345. package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
  346. package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.d.ts +2 -2
  347. package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js.map +1 -1
  348. package/Rendering/fluidRenderer/fluidRenderingTextures.d.ts +2 -2
  349. package/Rendering/fluidRenderer/fluidRenderingTextures.js.map +1 -1
  350. package/Rendering/geometryBufferRenderer.js +24 -18
  351. package/Rendering/geometryBufferRenderer.js.map +1 -1
  352. package/Rendering/outlineRenderer.js.map +1 -1
  353. package/Rendering/prePassRenderer.js.map +1 -1
  354. package/Sprites/spriteRenderer.d.ts +2 -2
  355. package/Sprites/spriteRenderer.js.map +1 -1
  356. package/XR/features/WebXRDepthSensing.js.map +1 -1
  357. package/XR/features/WebXRImageTracking.js.map +1 -1
  358. package/XR/features/WebXRLayers.d.ts +2 -2
  359. package/XR/features/WebXRLayers.js.map +1 -1
  360. package/XR/features/WebXRLightEstimation.js.map +1 -1
  361. package/XR/features/WebXRRawCameraAccess.d.ts +1 -1
  362. package/XR/features/WebXRRawCameraAccess.js.map +1 -1
  363. package/XR/features/WebXRSpaceWarp.js +1 -3
  364. package/XR/features/WebXRSpaceWarp.js.map +1 -1
  365. package/XR/features/WebXRWalkingLocomotion.js.map +1 -1
  366. package/XR/webXRExperienceHelper.js.map +1 -1
  367. package/XR/webXRManagedOutputCanvas.d.ts +2 -2
  368. package/XR/webXRManagedOutputCanvas.js.map +1 -1
  369. package/XR/webXRRenderTargetTextureProvider.js.map +1 -1
  370. package/XR/webXRSessionManager.js.map +1 -1
  371. package/assetContainer.js.map +1 -1
  372. package/node.d.ts +2 -2
  373. package/node.js.map +1 -1
  374. package/package.json +1 -1
  375. package/scene.d.ts +3 -3
  376. package/scene.js.map +1 -1
@@ -0,0 +1,1688 @@
1
+ import type { DataArray, FloatArray, ImageSource, IndicesArray, Nullable } from "../types";
2
+ import type { PerfCounter } from "../Misc/perfCounter";
3
+ import type { PostProcess } from "../PostProcesses/postProcess";
4
+ import type { Scene } from "../scene";
5
+ import type { IColor4Like, IViewportLike } from "../Maths/math.like";
6
+ import type { ICanvas, IImage } from "./ICanvas";
7
+ import type { HardwareTextureWrapper } from "../Materials/Textures/hardwareTextureWrapper";
8
+ import type { EngineCapabilities } from "./engineCapabilities";
9
+ import type { DataBuffer } from "../Buffers/dataBuffer";
10
+ import type { RenderTargetWrapper } from "./renderTargetWrapper";
11
+ import type { IShaderProcessor } from "./Processors/iShaderProcessor";
12
+ import type { ShaderLanguage } from "../Materials/shaderLanguage";
13
+ import type { IAudioEngineOptions } from "../Audio/Interfaces/IAudioEngineOptions";
14
+ import type { EngineFeatures } from "./engineFeatures";
15
+ import type { UniformBuffer } from "../Materials/uniformBuffer";
16
+ import type { StorageBuffer } from "../Buffers/storageBuffer";
17
+ import type { IEffectCreationOptions, IShaderPath } from "../Materials/effect";
18
+ import type { IOfflineProvider } from "../Offline/IOfflineProvider";
19
+ import type { IWebRequest } from "../Misc/interfaces/iWebRequest";
20
+ import type { IFileRequest } from "../Misc/fileRequest";
21
+ import type { Texture } from "../Materials/Textures/texture";
22
+ import type { LoadFileError } from "../Misc/fileTools";
23
+ import type { ShaderProcessingContext } from "./Processors/shaderProcessingOptions";
24
+ import type { IPipelineContext } from "./IPipelineContext";
25
+ import type { ThinTexture } from "../Materials/Textures/thinTexture";
26
+ import type { RenderTargetTexture } from "../Materials/Textures/renderTargetTexture";
27
+ import type { IInternalTextureLoader } from "../Materials/Textures/internalTextureLoader";
28
+ import type { ExternalTexture } from "../Materials/Textures/externalTexture";
29
+ import type { TextureSampler } from "../Materials/Textures/textureSampler";
30
+ import type { DepthTextureCreationOptions, InternalTextureCreationOptions, RenderTargetCreationOptions, TextureSize } from "../Materials/Textures/textureCreationOptions";
31
+ import type { IMultiRenderTargetOptions } from "../Materials/Textures/multiRenderTarget";
32
+ import type { EffectFallbacks } from "../Materials/effectFallbacks";
33
+ import type { IMaterialContext } from "./IMaterialContext";
34
+ import type { IStencilState } from "../States/IStencilState";
35
+ import type { DrawWrapper } from "../Materials/drawWrapper";
36
+ import type { IDrawContext } from "./IDrawContext";
37
+ import type { VertexBuffer } from "../Meshes/buffer";
38
+ import type { IAudioEngine } from "../Audio/Interfaces/IAudioEngine";
39
+ import type { WebRequest } from "../Misc/webRequest.js";
40
+ import type { PerformanceMonitor } from "../Misc/performanceMonitor.js";
41
+ import type { ILoadingScreen } from "../Loading/loadingScreen";
42
+ import { Effect } from "../Materials/effect";
43
+ import { DepthCullingState } from "../States/depthCullingState";
44
+ import { StencilStateComposer } from "../States/stencilStateComposer";
45
+ import { StencilState } from "../States/stencilState";
46
+ import { AlphaState } from "../States/alphaCullingState";
47
+ import { InternalTexture, InternalTextureSource } from "../Materials/Textures/internalTexture";
48
+ import { Observable } from "../Misc/observable";
49
+ /**
50
+ * Defines the interface used by objects working like Scene
51
+ * @internal
52
+ */
53
+ export interface ISceneLike {
54
+ /** Add pending data (to load) */
55
+ addPendingData(data: any): void;
56
+ /** Remove pending data */
57
+ removePendingData(data: any): void;
58
+ /** Offline provider */
59
+ offlineProvider: IOfflineProvider;
60
+ }
61
+ /**
62
+ * Queue a new function into the requested animation frame pool (ie. this function will be executed by the browser (or the javascript engine) for the next frame)
63
+ * @param func - the function to be called
64
+ * @param requester - the object that will request the next frame. Falls back to window.
65
+ * @returns frame number
66
+ */
67
+ export declare function QueueNewFrame(func: () => void, requester?: any): number;
68
+ /** Interface defining initialization parameters for AbstractEngine class */
69
+ export interface AbstractEngineOptions {
70
+ /**
71
+ * Defines if the engine should no exceed a specified device ratio
72
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio
73
+ */
74
+ limitDeviceRatio?: number;
75
+ /**
76
+ * Defines if webaudio should be initialized as well
77
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic
78
+ */
79
+ audioEngine?: boolean;
80
+ /**
81
+ * Specifies options for the audio engine
82
+ */
83
+ audioEngineOptions?: IAudioEngineOptions;
84
+ /**
85
+ * Defines if animations should run using a deterministic lock step
86
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#deterministic-lockstep
87
+ */
88
+ deterministicLockstep?: boolean;
89
+ /** Defines the maximum steps to use with deterministic lock step mode */
90
+ lockstepMaxSteps?: number;
91
+ /** Defines the seconds between each deterministic lock step */
92
+ timeStep?: number;
93
+ /**
94
+ * Defines that engine should ignore context lost events
95
+ * If this event happens when this parameter is true, you will have to reload the page to restore rendering
96
+ */
97
+ doNotHandleContextLost?: boolean;
98
+ /**
99
+ * Defines that engine should ignore modifying touch action attribute and style
100
+ * If not handle, you might need to set it up on your side for expected touch devices behavior.
101
+ */
102
+ doNotHandleTouchAction?: boolean;
103
+ /**
104
+ * Make the matrix computations to be performed in 64 bits instead of 32 bits. False by default
105
+ */
106
+ useHighPrecisionMatrix?: boolean;
107
+ /**
108
+ * Defines whether to adapt to the device's viewport characteristics (default: false)
109
+ */
110
+ adaptToDeviceRatio?: boolean;
111
+ /**
112
+ * Defines whether MSAA is enabled on the canvas.
113
+ */
114
+ antialias?: boolean;
115
+ /**
116
+ * Defines whether the stencil buffer should be enabled.
117
+ */
118
+ stencil?: boolean;
119
+ /**
120
+ * Defines whether the canvas should be created in "premultiplied" mode (if false, the canvas is created in the "opaque" mode) (true by default)
121
+ */
122
+ premultipliedAlpha?: boolean;
123
+ /**
124
+ * True if the more expensive but exact conversions should be used for transforming colors to and from linear space within shaders.
125
+ * Otherwise, the default is to use a cheaper approximation.
126
+ */
127
+ useExactSrgbConversions?: boolean;
128
+ }
129
+ /**
130
+ * Information about the current host
131
+ */
132
+ export interface HostInformation {
133
+ /**
134
+ * Defines if the current host is a mobile
135
+ */
136
+ isMobile: boolean;
137
+ }
138
+ /**
139
+ * The parent class for specialized engines (WebGL, WebGPU)
140
+ */
141
+ export declare abstract class AbstractEngine {
142
+ /** @internal */
143
+ static _TextureLoaders: IInternalTextureLoader[];
144
+ /** @internal */
145
+ protected _colorWrite: boolean;
146
+ /** @internal */
147
+ protected _colorWriteChanged: boolean;
148
+ /** @internal */
149
+ _depthCullingState: DepthCullingState;
150
+ /** @internal */
151
+ protected _stencilStateComposer: StencilStateComposer;
152
+ /** @internal */
153
+ _stencilState: StencilState;
154
+ /** @internal */
155
+ _alphaState: AlphaState;
156
+ /** @internal */
157
+ _alphaMode: number;
158
+ /** @internal */
159
+ _alphaEquation: number;
160
+ /** @internal */
161
+ _badOS: boolean;
162
+ /** @internal */
163
+ _badDesktopOS: boolean;
164
+ /** @internal */
165
+ _videoTextureSupported: boolean;
166
+ protected _compatibilityMode: boolean;
167
+ /** @internal */
168
+ _pointerLockRequested: boolean;
169
+ /** @internal */
170
+ _loadingScreen: ILoadingScreen;
171
+ /** @internal */
172
+ _renderingCanvas: Nullable<HTMLCanvasElement>;
173
+ /** @internal */
174
+ _internalTexturesCache: InternalTexture[];
175
+ private _activeRequests;
176
+ protected _currentEffect: Nullable<Effect>;
177
+ /** @internal */
178
+ protected _cachedVertexBuffers: any;
179
+ /** @internal */
180
+ protected _cachedIndexBuffer: Nullable<DataBuffer>;
181
+ /** @internal */
182
+ protected _cachedEffectForVertexBuffers: Nullable<Effect>;
183
+ /** @internal */
184
+ _currentRenderTarget: Nullable<RenderTargetWrapper>;
185
+ /** @internal */
186
+ _caps: EngineCapabilities;
187
+ /** @internal */
188
+ protected _cachedViewport: Nullable<IViewportLike>;
189
+ /** @internal */
190
+ _currentDrawContext: IDrawContext;
191
+ /** @internal */
192
+ protected _boundTexturesCache: {
193
+ [key: string]: Nullable<InternalTexture>;
194
+ };
195
+ /** @internal */
196
+ protected _activeChannel: number;
197
+ /** @internal */
198
+ protected _currentTextureChannel: number;
199
+ /** @internal */
200
+ protected _viewportCached: {
201
+ x: number;
202
+ y: number;
203
+ z: number;
204
+ w: number;
205
+ };
206
+ /** @internal */
207
+ protected _isWebGPU: boolean;
208
+ /** @internal */
209
+ _onFocus: () => void;
210
+ /** @internal */
211
+ _onBlur: () => void;
212
+ /** @internal */
213
+ _onCanvasPointerOut: (event: PointerEvent) => void;
214
+ /** @internal */
215
+ _onCanvasBlur: () => void;
216
+ /** @internal */
217
+ _onCanvasFocus: () => void;
218
+ /** @internal */
219
+ _onCanvasContextMenu: (evt: Event) => void;
220
+ /** @internal */
221
+ _onFullscreenChange: () => void;
222
+ /**
223
+ * Observable event triggered each time the canvas loses focus
224
+ */
225
+ onCanvasBlurObservable: Observable<AbstractEngine>;
226
+ /**
227
+ * Observable event triggered each time the canvas gains focus
228
+ */
229
+ onCanvasFocusObservable: Observable<AbstractEngine>;
230
+ /**
231
+ * Event raised when a new scene is created
232
+ */
233
+ onNewSceneAddedObservable: Observable<Scene>;
234
+ /**
235
+ * Observable event triggered each time the rendering canvas is resized
236
+ */
237
+ onResizeObservable: Observable<AbstractEngine>;
238
+ /**
239
+ * Observable event triggered each time the canvas receives pointerout event
240
+ */
241
+ onCanvasPointerOutObservable: Observable<PointerEvent>;
242
+ /**
243
+ * Turn this value on if you want to pause FPS computation when in background
244
+ */
245
+ disablePerformanceMonitorInBackground: boolean;
246
+ /**
247
+ * Gets or sets a boolean indicating that vertex array object must be disabled even if they are supported
248
+ */
249
+ disableVertexArrayObjects: boolean;
250
+ /** @internal */
251
+ protected _frameId: number;
252
+ /**
253
+ * Gets the current frame id
254
+ */
255
+ get frameId(): number;
256
+ /**
257
+ * Gets a boolean indicating if the engine runs in WebGPU or not.
258
+ */
259
+ get isWebGPU(): boolean;
260
+ protected _shaderProcessor: Nullable<IShaderProcessor>;
261
+ /**
262
+ * @internal
263
+ */
264
+ _getShaderProcessor(shaderLanguage: ShaderLanguage): Nullable<IShaderProcessor>;
265
+ /**
266
+ * Gets a boolean indicating if all created effects are ready
267
+ * @returns true if all effects are ready
268
+ */
269
+ abstract areAllEffectsReady(): boolean;
270
+ /**
271
+ * @internal
272
+ */
273
+ abstract _executeWhenRenderingStateIsCompiled(pipelineContext: IPipelineContext, action: () => void): void;
274
+ /**
275
+ * Sets a texture to the according uniform.
276
+ * @param channel The texture channel
277
+ * @param unused unused parameter
278
+ * @param texture The texture to apply
279
+ * @param name The name of the uniform in the effect
280
+ */
281
+ abstract setTexture(channel: number, unused: Nullable<WebGLUniformLocation>, texture: Nullable<ThinTexture>, name: string): void;
282
+ /**
283
+ * Binds an effect to the webGL context
284
+ * @param effect defines the effect to bind
285
+ */
286
+ abstract bindSamplers(effect: Effect): void;
287
+ /**
288
+ * Creates an external texture
289
+ * @param video video element
290
+ * @returns the external texture, or null if external textures are not supported by the engine
291
+ */
292
+ abstract createExternalTexture(video: HTMLVideoElement): Nullable<ExternalTexture>;
293
+ /**
294
+ * Sets an internal texture to the according uniform.
295
+ * @param name The name of the uniform in the effect
296
+ * @param texture The texture to apply
297
+ */
298
+ abstract setExternalTexture(name: string, texture: Nullable<ExternalTexture>): void;
299
+ /**
300
+ * @internal
301
+ */
302
+ abstract _bindTexture(channel: number, texture: Nullable<InternalTexture>, name: string): void;
303
+ /**
304
+ * @internal
305
+ */
306
+ abstract _deletePipelineContext(pipelineContext: IPipelineContext): void;
307
+ /**
308
+ * @internal
309
+ */
310
+ abstract _preparePipelineContext(pipelineContext: IPipelineContext, vertexSourceCode: string, fragmentSourceCode: string, createAsRaw: boolean, rawVertexSourceCode: string, rawFragmentSourceCode: string, rebuildRebind: any, defines: Nullable<string>, transformFeedbackVaryings: Nullable<string[]>, key: string): void;
311
+ /** @internal */
312
+ protected _shaderPlatformName: string;
313
+ /**
314
+ * Gets the shader platform name used by the effects.
315
+ */
316
+ get shaderPlatformName(): string;
317
+ /**
318
+ * Gets information about the current host
319
+ */
320
+ hostInformation: HostInformation;
321
+ /**
322
+ * Gets a boolean indicating if the engine is currently rendering in fullscreen mode
323
+ */
324
+ isFullscreen: boolean;
325
+ /**
326
+ * Gets or sets a boolean to enable/disable IndexedDB support and avoid XHR on .manifest
327
+ **/
328
+ enableOfflineSupport: boolean;
329
+ /**
330
+ * Gets or sets a boolean to enable/disable checking manifest if IndexedDB support is enabled (js will always consider the database is up to date)
331
+ **/
332
+ disableManifestCheck: boolean;
333
+ /**
334
+ * Gets or sets a boolean to enable/disable the context menu (right-click) from appearing on the main canvas
335
+ */
336
+ disableContextMenu: boolean;
337
+ /**
338
+ * Gets or sets the current render pass id
339
+ */
340
+ currentRenderPassId: number;
341
+ /**
342
+ * Gets a boolean indicating if the pointer is currently locked
343
+ */
344
+ isPointerLock: boolean;
345
+ /**
346
+ * Gets the list of created postprocesses
347
+ */
348
+ postProcesses: PostProcess[];
349
+ /** Gets or sets the tab index to set to the rendering canvas. 1 is the minimum value to set to be able to capture keyboard events */
350
+ canvasTabIndex: number;
351
+ /** @internal */
352
+ protected _onContextLost: (evt: Event) => void;
353
+ /** @internal */
354
+ protected _onContextRestored: (evt: Event) => void;
355
+ /** @internal */
356
+ protected _contextWasLost: boolean;
357
+ private _emptyTexture;
358
+ private _emptyCubeTexture;
359
+ private _emptyTexture3D;
360
+ private _emptyTexture2DArray;
361
+ protected _clearEmptyResources(): void;
362
+ abstract wipeCaches(bruteForce?: boolean): void;
363
+ private _useReverseDepthBuffer;
364
+ /**
365
+ * Gets or sets a boolean indicating if depth buffer should be reverse, going from far to near.
366
+ * This can provide greater z depth for distant objects.
367
+ */
368
+ get useReverseDepthBuffer(): boolean;
369
+ set useReverseDepthBuffer(useReverse: boolean);
370
+ /**
371
+ * Enable or disable color writing
372
+ * @param enable defines the state to set
373
+ */
374
+ setColorWrite(enable: boolean): void;
375
+ /**
376
+ * Gets a boolean indicating if color writing is enabled
377
+ * @returns the current color writing state
378
+ */
379
+ getColorWrite(): boolean;
380
+ /**
381
+ * Gets the depth culling state manager
382
+ */
383
+ get depthCullingState(): DepthCullingState;
384
+ /**
385
+ * Gets the alpha state manager
386
+ */
387
+ get alphaState(): AlphaState;
388
+ /**
389
+ * Gets the stencil state manager
390
+ */
391
+ get stencilState(): StencilState;
392
+ /**
393
+ * Gets the stencil state composer
394
+ */
395
+ get stencilStateComposer(): StencilStateComposer;
396
+ /**
397
+ * Indicates if the z range in NDC space is 0..1 (value: true) or -1..1 (value: false)
398
+ */
399
+ readonly isNDCHalfZRange: boolean;
400
+ /**
401
+ * Indicates that the origin of the texture/framebuffer space is the bottom left corner. If false, the origin is top left
402
+ */
403
+ readonly hasOriginBottomLeft: boolean;
404
+ /**
405
+ * Gets a boolean indicating if the exact sRGB conversions or faster approximations are used for converting to and from linear space.
406
+ */
407
+ readonly useExactSrgbConversions: boolean;
408
+ /** @internal */
409
+ _getGlobalDefines(defines?: {
410
+ [key: string]: string;
411
+ }): string | undefined;
412
+ /** @internal */
413
+ _renderTargetWrapperCache: RenderTargetWrapper[];
414
+ /** @internal */
415
+ protected _compiledEffects: {
416
+ [key: string]: Effect;
417
+ };
418
+ private _rebuildInternalTextures;
419
+ private _rebuildRenderTargetWrappers;
420
+ private _rebuildEffects;
421
+ protected _rebuildGraphicsResources(): void;
422
+ protected _flagContextRestored(): void;
423
+ protected _restoreEngineAfterContextLost(initEngine: () => void): void;
424
+ /** @internal */
425
+ protected _isDisposed: boolean;
426
+ /** Gets a boolean indicating if the engine was disposed */
427
+ get isDisposed(): boolean;
428
+ /**
429
+ * Gets the list of created scenes
430
+ */
431
+ scenes: Scene[];
432
+ /** @internal */
433
+ _virtualScenes: Scene[];
434
+ /** @internal */
435
+ _features: EngineFeatures;
436
+ /**
437
+ * Enables or disables the snapshot rendering mode
438
+ * Note that the WebGL engine does not support snapshot rendering so setting the value won't have any effect for this engine
439
+ */
440
+ get snapshotRendering(): boolean;
441
+ set snapshotRendering(activate: boolean);
442
+ /**
443
+ * Gets or sets the snapshot rendering mode
444
+ */
445
+ get snapshotRenderingMode(): number;
446
+ set snapshotRenderingMode(mode: number);
447
+ /**
448
+ * Observable event triggered before each texture is initialized
449
+ */
450
+ onBeforeTextureInitObservable: Observable<Texture>;
451
+ /**
452
+ * Gets or sets a boolean indicating if the engine must keep rendering even if the window is not in foreground
453
+ */
454
+ renderEvenInBackground: boolean;
455
+ /**
456
+ * Gets or sets a boolean indicating that cache can be kept between frames
457
+ */
458
+ preventCacheWipeBetweenFrames: boolean;
459
+ /**
460
+ * Returns the string "AbstractEngine"
461
+ * @returns "AbstractEngine"
462
+ */
463
+ getClassName(): string;
464
+ /**
465
+ * Gets the default empty texture
466
+ */
467
+ get emptyTexture(): InternalTexture;
468
+ /**
469
+ * Gets the default empty 3D texture
470
+ */
471
+ get emptyTexture3D(): InternalTexture;
472
+ /**
473
+ * Gets the default empty 2D array texture
474
+ */
475
+ get emptyTexture2DArray(): InternalTexture;
476
+ /**
477
+ * Gets the default empty cube texture
478
+ */
479
+ get emptyCubeTexture(): InternalTexture;
480
+ /** @internal */
481
+ _frameHandler: number;
482
+ /** @internal */
483
+ protected _activeRenderLoops: (() => void)[];
484
+ /**
485
+ * Gets the list of current active render loop functions
486
+ * @returns a read only array with the current render loop functions
487
+ */
488
+ get activeRenderLoops(): ReadonlyArray<() => void>;
489
+ /**
490
+ * stop executing a render loop function and remove it from the execution array
491
+ * @param renderFunction defines the function to be removed. If not provided all functions will be removed.
492
+ */
493
+ stopRenderLoop(renderFunction?: () => void): void;
494
+ protected _cancelFrame(): void;
495
+ /** @internal */
496
+ _windowIsBackground: boolean;
497
+ /**
498
+ * Begin a new frame
499
+ */
500
+ beginFrame(): void;
501
+ /**
502
+ * End the current frame
503
+ */
504
+ endFrame(): void;
505
+ /**
506
+ * Gets the performance monitor attached to this engine
507
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#engineinstrumentation
508
+ */
509
+ abstract get performanceMonitor(): PerformanceMonitor;
510
+ /** @internal */
511
+ _boundRenderFunction: any;
512
+ /** @internal */
513
+ _renderLoop(): void;
514
+ /**
515
+ * Can be used to override the current requestAnimationFrame requester.
516
+ * @internal
517
+ */
518
+ protected _queueNewFrame(bindedRenderFunction: any, requester?: any): number;
519
+ /**
520
+ * Register and execute a render loop. The engine can have more than one render function
521
+ * @param renderFunction defines the function to continuously execute
522
+ */
523
+ runRenderLoop(renderFunction: () => void): void;
524
+ /**
525
+ * Gets a boolean indicating if depth testing is enabled
526
+ * @returns the current state
527
+ */
528
+ getDepthBuffer(): boolean;
529
+ /**
530
+ * Enable or disable depth buffering
531
+ * @param enable defines the state to set
532
+ */
533
+ setDepthBuffer(enable: boolean): void;
534
+ /**
535
+ * Set the z offset Factor to apply to current rendering
536
+ * @param value defines the offset to apply
537
+ */
538
+ setZOffset(value: number): void;
539
+ /**
540
+ * Gets the current value of the zOffset Factor
541
+ * @returns the current zOffset Factor state
542
+ */
543
+ getZOffset(): number;
544
+ /**
545
+ * Set the z offset Units to apply to current rendering
546
+ * @param value defines the offset to apply
547
+ */
548
+ setZOffsetUnits(value: number): void;
549
+ /**
550
+ * Gets the current value of the zOffset Units
551
+ * @returns the current zOffset Units state
552
+ */
553
+ getZOffsetUnits(): number;
554
+ /**
555
+ * Gets host window
556
+ * @returns the host window object
557
+ */
558
+ getHostWindow(): Nullable<Window>;
559
+ /**
560
+ * (WebGPU only) True (default) to be in compatibility mode, meaning rendering all existing scenes without artifacts (same rendering than WebGL).
561
+ * Setting the property to false will improve performances but may not work in some scenes if some precautions are not taken.
562
+ * See https://doc.babylonjs.com/setup/support/webGPU/webGPUOptimization/webGPUNonCompatibilityMode for more details
563
+ */
564
+ get compatibilityMode(): boolean;
565
+ set compatibilityMode(mode: boolean);
566
+ /**
567
+ * Observable raised when the engine is about to compile a shader
568
+ */
569
+ onBeforeShaderCompilationObservable: Observable<AbstractEngine>;
570
+ /**
571
+ * Observable raised when the engine has just compiled a shader
572
+ */
573
+ onAfterShaderCompilationObservable: Observable<AbstractEngine>;
574
+ /**
575
+ * Observable raised when the engine begins a new frame
576
+ */
577
+ onBeginFrameObservable: Observable<AbstractEngine>;
578
+ /**
579
+ * Observable raised when the engine ends the current frame
580
+ */
581
+ onEndFrameObservable: Observable<AbstractEngine>;
582
+ protected _rebuildTextures(): void;
583
+ /**
584
+ * @internal
585
+ */
586
+ abstract _setCubeMapTextureParams(texture: InternalTexture, loadMipmap: boolean, maxLevel?: number): void;
587
+ /**
588
+ * @internal
589
+ */
590
+ abstract _getRGBABufferInternalSizedFormat(type: number, format?: number, useSRGBBuffer?: boolean): number;
591
+ /** @internal */
592
+ abstract _getUnpackAlignement(): number;
593
+ /**
594
+ * @internal
595
+ */
596
+ abstract _uploadCompressedDataToTextureDirectly(texture: InternalTexture, internalFormat: number, width: number, height: number, data: ArrayBufferView, faceIndex: number, lod?: number): void;
597
+ /**
598
+ * @internal
599
+ */
600
+ abstract _bindTextureDirectly(target: number, texture: Nullable<InternalTexture>, forTextureDataUpdate?: boolean, force?: boolean): boolean;
601
+ /**
602
+ * @internal
603
+ */
604
+ abstract _uploadDataToTextureDirectly(texture: InternalTexture, imageData: ArrayBufferView, faceIndex?: number, lod?: number, babylonInternalFormat?: number, useTextureWidthAndHeight?: boolean): void;
605
+ /** @internal */
606
+ abstract _readTexturePixels(texture: InternalTexture, width: number, height: number, faceIndex?: number, level?: number, buffer?: Nullable<ArrayBufferView>, flushRenderer?: boolean, noDataConversion?: boolean, x?: number, y?: number): Promise<ArrayBufferView>;
607
+ /** @internal */
608
+ abstract _readTexturePixelsSync(texture: InternalTexture, width: number, height: number, faceIndex?: number, level?: number, buffer?: Nullable<ArrayBufferView>, flushRenderer?: boolean, noDataConversion?: boolean, x?: number, y?: number): ArrayBufferView;
609
+ /**
610
+ * Reads pixels from the current frame buffer. Please note that this function can be slow
611
+ * @param x defines the x coordinate of the rectangle where pixels must be read
612
+ * @param y defines the y coordinate of the rectangle where pixels must be read
613
+ * @param width defines the width of the rectangle where pixels must be read
614
+ * @param height defines the height of the rectangle where pixels must be read
615
+ * @param hasAlpha defines whether the output should have alpha or not (defaults to true)
616
+ * @param flushRenderer true to flush the renderer from the pending commands before reading the pixels
617
+ * @returns a ArrayBufferView promise (Uint8Array) containing RGBA colors
618
+ */
619
+ abstract readPixels(x: number, y: number, width: number, height: number, hasAlpha?: boolean, flushRenderer?: boolean): Promise<ArrayBufferView>;
620
+ /**
621
+ * Force a WebGPU flush (ie. a flush of all waiting commands)
622
+ */
623
+ abstract flushFramebuffer(): void;
624
+ /** @internal */
625
+ abstract _currentFrameBufferIsDefaultFrameBuffer(): boolean;
626
+ /**
627
+ * Creates an internal texture without binding it to a framebuffer
628
+ * @internal
629
+ * @param size defines the size of the texture
630
+ * @param options defines the options used to create the texture
631
+ * @param delayGPUTextureCreation true to delay the texture creation the first time it is really needed. false to create it right away
632
+ * @param source source type of the texture
633
+ * @returns a new internal texture
634
+ */
635
+ abstract _createInternalTexture(size: TextureSize, options: boolean | InternalTextureCreationOptions, delayGPUTextureCreation?: boolean, source?: InternalTextureSource): InternalTexture;
636
+ /** @internal */
637
+ abstract applyStates(): void;
638
+ /**
639
+ * Binds the frame buffer to the specified texture.
640
+ * @param texture The render target wrapper to render to
641
+ * @param faceIndex The face of the texture to render to in case of cube texture
642
+ * @param requiredWidth The width of the target to render to
643
+ * @param requiredHeight The height of the target to render to
644
+ * @param forceFullscreenViewport Forces the viewport to be the entire texture/screen if true
645
+ * @param lodLevel defines the lod level to bind to the frame buffer
646
+ * @param layer defines the 2d array index to bind to frame buffer to
647
+ */
648
+ abstract bindFramebuffer(texture: RenderTargetWrapper, faceIndex?: number, requiredWidth?: number, requiredHeight?: number, forceFullscreenViewport?: boolean, lodLevel?: number, layer?: number): void;
649
+ /**
650
+ * Update the sampling mode of a given texture
651
+ * @param texture defines the texture to update
652
+ * @param wrapU defines the texture wrap mode of the u coordinates
653
+ * @param wrapV defines the texture wrap mode of the v coordinates
654
+ * @param wrapR defines the texture wrap mode of the r coordinates
655
+ */
656
+ abstract updateTextureWrappingMode(texture: InternalTexture, wrapU: Nullable<number>, wrapV?: Nullable<number>, wrapR?: Nullable<number>): void;
657
+ /**
658
+ * Update a video texture
659
+ * @param texture defines the texture to update
660
+ * @param video defines the video element to use
661
+ * @param invertY defines if data must be stored with Y axis inverted
662
+ */
663
+ abstract updateVideoTexture(texture: Nullable<InternalTexture>, video: HTMLVideoElement | Nullable<ExternalTexture>, invertY: boolean): void;
664
+ /**
665
+ * Unbind the current render target and bind the default framebuffer
666
+ */
667
+ abstract restoreDefaultFramebuffer(): void;
668
+ /**
669
+ * Update a raw texture
670
+ * @param texture defines the texture to update
671
+ * @param data defines the data to store in the texture
672
+ * @param format defines the format of the data
673
+ * @param invertY defines if data must be stored with Y axis inverted
674
+ * @param compression defines the compression used (null by default)
675
+ * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
676
+ * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
677
+ */
678
+ abstract updateRawTexture(texture: Nullable<InternalTexture>, data: Nullable<ArrayBufferView>, format: number, invertY: boolean, compression?: Nullable<string>, type?: number, useSRGBBuffer?: boolean): void;
679
+ /**
680
+ * Creates a storage buffer
681
+ * @param data the data for the storage buffer or the size of the buffer
682
+ * @param creationFlags flags to use when creating the buffer (see Constants.BUFFER_CREATIONFLAG_XXX). The BUFFER_CREATIONFLAG_STORAGE flag will be automatically added
683
+ * @param label defines the label of the buffer (for debug purpose)
684
+ * @returns the new buffer
685
+ */
686
+ abstract createStorageBuffer(data: DataArray | number, creationFlags: number, label?: string): DataBuffer;
687
+ /**
688
+ * Updates a storage buffer
689
+ * @param buffer the storage buffer to update
690
+ * @param data the data used to update the storage buffer
691
+ * @param byteOffset the byte offset of the data
692
+ * @param byteLength the byte length of the data
693
+ */
694
+ abstract updateStorageBuffer(buffer: DataBuffer, data: DataArray, byteOffset?: number, byteLength?: number): void;
695
+ /**
696
+ * Read data from a storage buffer
697
+ * @param storageBuffer The storage buffer to read from
698
+ * @param offset The offset in the storage buffer to start reading from (default: 0)
699
+ * @param size The number of bytes to read from the storage buffer (default: capacity of the buffer)
700
+ * @param buffer The buffer to write the data we have read from the storage buffer to (optional)
701
+ * @param noDelay If true, a call to flushFramebuffer will be issued so that the data can be read back immediately and not in engine.onEndFrameObservable. This can speed up data retrieval, at the cost of a small perf penalty (default: false).
702
+ * @returns If not undefined, returns the (promise) buffer (as provided by the 4th parameter) filled with the data, else it returns a (promise) Uint8Array with the data read from the storage buffer
703
+ */
704
+ abstract readFromStorageBuffer(storageBuffer: DataBuffer, offset?: number, size?: number, buffer?: ArrayBufferView, noDelay?: boolean): Promise<ArrayBufferView>;
705
+ /**
706
+ * Draw a list of indexed primitives
707
+ * @param fillMode defines the primitive to use
708
+ * @param indexStart defines the starting index
709
+ * @param indexCount defines the number of index to draw
710
+ * @param instancesCount defines the number of instances to draw (if instantiation is enabled)
711
+ */
712
+ abstract drawElementsType(fillMode: number, indexStart: number, indexCount: number, instancesCount?: number): void;
713
+ /**
714
+ * Unbind the current render target texture from the webGL context
715
+ * @param texture defines the render target wrapper to unbind
716
+ * @param disableGenerateMipMaps defines a boolean indicating that mipmaps must not be generated
717
+ * @param onBeforeUnbind defines a function which will be called before the effective unbind
718
+ */
719
+ abstract unBindFramebuffer(texture: RenderTargetWrapper, disableGenerateMipMaps?: boolean, onBeforeUnbind?: () => void): void;
720
+ /**Gets driver info if available */
721
+ abstract extractDriverInfo(): string;
722
+ /**
723
+ * Creates a layout object to draw/clear on specific textures in a MRT
724
+ * @param textureStatus textureStatus[i] indicates if the i-th is active
725
+ * @returns A layout to be fed to the engine, calling `bindAttachments`.
726
+ */
727
+ abstract buildTextureLayout(textureStatus: boolean[]): number[];
728
+ /**
729
+ * Restores the webgl state to only draw on the main color attachment
730
+ * when the frame buffer associated is the canvas frame buffer
731
+ */
732
+ abstract restoreSingleAttachment(): void;
733
+ /**
734
+ * Select a subsets of attachments to draw to.
735
+ * @param attachments gl attachments
736
+ */
737
+ abstract bindAttachments(attachments: number[]): void;
738
+ /**
739
+ * Bind a list of vertex buffers to the webGL context
740
+ * @param vertexBuffers defines the list of vertex buffers to bind
741
+ * @param indexBuffer defines the index buffer to bind
742
+ * @param effect defines the effect associated with the vertex buffers
743
+ * @param overrideVertexBuffers defines optional list of avertex buffers that overrides the entries in vertexBuffers
744
+ */
745
+ abstract bindBuffers(vertexBuffers: {
746
+ [key: string]: Nullable<VertexBuffer>;
747
+ }, indexBuffer: Nullable<DataBuffer>, effect: Effect, overrideVertexBuffers?: {
748
+ [kind: string]: Nullable<VertexBuffer>;
749
+ }): void;
750
+ /**
751
+ * @internal
752
+ */
753
+ _releaseRenderTargetWrapper(rtWrapper: RenderTargetWrapper): void;
754
+ /**
755
+ * Activates an effect, making it the current one (ie. the one used for rendering)
756
+ * @param effect defines the effect to activate
757
+ */
758
+ abstract enableEffect(effect: Nullable<Effect | DrawWrapper>): void;
759
+ /**
760
+ * Set various states to the webGL context
761
+ * @param culling defines culling state: true to enable culling, false to disable it
762
+ * @param zOffset defines the value to apply to zOffset (0 by default)
763
+ * @param force defines if states must be applied even if cache is up to date
764
+ * @param reverseSide defines if culling must be reversed (CCW if false, CW if true)
765
+ * @param cullBackFaces true to cull back faces, false to cull front faces (if culling is enabled)
766
+ * @param stencil stencil states to set
767
+ * @param zOffsetUnits defines the value to apply to zOffsetUnits (0 by default)
768
+ */
769
+ abstract setState(culling: boolean, zOffset?: number, force?: boolean, reverseSide?: boolean, cullBackFaces?: boolean, stencil?: IStencilState, zOffsetUnits?: number): void;
770
+ /**
771
+ * Creates a new material context
772
+ * @returns the new context
773
+ */
774
+ abstract createMaterialContext(): IMaterialContext | undefined;
775
+ /**
776
+ * Creates a new draw context
777
+ * @returns the new context
778
+ */
779
+ abstract createDrawContext(): IDrawContext | undefined;
780
+ /**
781
+ * Create a new effect (used to store vertex/fragment shaders)
782
+ * @param baseName defines the base name of the effect (The name of file without .fragment.fx or .vertex.fx)
783
+ * @param attributesNamesOrOptions defines either a list of attribute names or an IEffectCreationOptions object
784
+ * @param uniformsNamesOrEngine defines either a list of uniform names or the engine to use
785
+ * @param samplers defines an array of string used to represent textures
786
+ * @param defines defines the string containing the defines to use to compile the shaders
787
+ * @param fallbacks defines the list of potential fallbacks to use if shader compilation fails
788
+ * @param onCompiled defines a function to call when the effect creation is successful
789
+ * @param onError defines a function to call when the effect creation has failed
790
+ * @param indexParameters defines an object containing the index values to use to compile shaders (like the maximum number of simultaneous lights)
791
+ * @param shaderLanguage the language the shader is written in (default: GLSL)
792
+ * @returns the new Effect
793
+ */
794
+ abstract createEffect(baseName: string | (IShaderPath & {
795
+ vertexToken?: string;
796
+ fragmentToken?: string;
797
+ }), attributesNamesOrOptions: string[] | IEffectCreationOptions, uniformsNamesOrEngine: string[] | AbstractEngine, samplers?: string[], defines?: string, fallbacks?: EffectFallbacks, onCompiled?: Nullable<(effect: Effect) => void>, onError?: Nullable<(effect: Effect, errors: string) => void>, indexParameters?: any, shaderLanguage?: ShaderLanguage): Effect;
798
+ /**
799
+ * Clear the current render buffer or the current render target (if any is set up)
800
+ * @param color defines the color to use
801
+ * @param backBuffer defines if the back buffer must be cleared
802
+ * @param depth defines if the depth buffer must be cleared
803
+ * @param stencil defines if the stencil buffer must be cleared
804
+ */
805
+ abstract clear(color: Nullable<IColor4Like>, backBuffer: boolean, depth: boolean, stencil?: boolean): void;
806
+ /**
807
+ * Sets the current alpha mode
808
+ * @param mode defines the mode to use (one of the Engine.ALPHA_XXX)
809
+ * @param noDepthWriteChange defines if depth writing state should remains unchanged (false by default)
810
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/advanced/transparent_rendering
811
+ */
812
+ abstract setAlphaMode(mode: number, noDepthWriteChange?: boolean): void;
813
+ /**
814
+ * Gets a boolean indicating that only power of 2 textures are supported
815
+ * Please note that you can still use non power of 2 textures but in this case the engine will forcefully convert them
816
+ */
817
+ abstract get needPOTTextures(): boolean;
818
+ /**
819
+ * Creates a new index buffer
820
+ * @param indices defines the content of the index buffer
821
+ * @param _updatable defines if the index buffer must be updatable
822
+ * @param label defines the label of the buffer (for debug purpose)
823
+ * @returns a new buffer
824
+ */
825
+ abstract createIndexBuffer(indices: IndicesArray, _updatable?: boolean, label?: string): DataBuffer;
826
+ /**
827
+ * Creates a new render target texture
828
+ * @param size defines the size of the texture
829
+ * @param options defines the options used to create the texture
830
+ * @returns a new render target wrapper ready to render texture
831
+ */
832
+ abstract createRenderTargetTexture(size: TextureSize, options: boolean | RenderTargetCreationOptions): RenderTargetWrapper;
833
+ /**
834
+ * Creates a new render target cube wrapper
835
+ * @param size defines the size of the texture
836
+ * @param options defines the options used to create the texture
837
+ * @returns a new render target cube wrapper
838
+ */
839
+ abstract createRenderTargetCubeTexture(size: number, options?: RenderTargetCreationOptions): RenderTargetWrapper;
840
+ /**
841
+ * Create a multi render target texture
842
+ * @see https://doc.babylonjs.com/setup/support/webGL2#multiple-render-target
843
+ * @param size defines the size of the texture
844
+ * @param options defines the creation options
845
+ * @param initializeBuffers if set to true, the engine will make an initializing call of drawBuffers
846
+ * @returns a new render target wrapper ready to render textures
847
+ */
848
+ abstract createMultipleRenderTarget(size: TextureSize, options: IMultiRenderTargetOptions, initializeBuffers?: boolean): RenderTargetWrapper;
849
+ /** @internal */
850
+ abstract _createDepthStencilTexture(size: TextureSize, options: DepthTextureCreationOptions, rtWrapper: RenderTargetWrapper): InternalTexture;
851
+ /**
852
+ * Creates a depth stencil cube texture.
853
+ * This is only available in WebGL 2.
854
+ * @param size The size of face edge in the cube texture.
855
+ * @param options The options defining the cube texture.
856
+ * @returns The cube texture
857
+ */
858
+ abstract _createDepthStencilCubeTexture(size: number, options: DepthTextureCreationOptions): InternalTexture;
859
+ /**
860
+ * Update the sample count for a given multiple render target texture
861
+ * @see https://doc.babylonjs.com/setup/support/webGL2#multisample-render-targets
862
+ * @param rtWrapper defines the render target wrapper to update
863
+ * @param samples defines the sample count to set
864
+ * @param initializeBuffers if set to true, the engine will make an initializing call of drawBuffers
865
+ * @returns the effective sample count (could be 0 if multisample render targets are not supported)
866
+ */
867
+ abstract updateMultipleRenderTargetTextureSampleCount(rtWrapper: Nullable<RenderTargetWrapper>, samples: number, initializeBuffers?: boolean): number;
868
+ /**
869
+ * Updates the sample count of a render target texture
870
+ * @see https://doc.babylonjs.com/setup/support/webGL2#multisample-render-targets
871
+ * @param rtWrapper defines the render target wrapper to update
872
+ * @param samples defines the sample count to set
873
+ * @returns the effective sample count (could be 0 if multisample render targets are not supported)
874
+ */
875
+ abstract updateRenderTargetTextureSampleCount(rtWrapper: Nullable<RenderTargetWrapper>, samples: number): number;
876
+ /**
877
+ * Draw a list of unindexed primitives
878
+ * @param fillMode defines the primitive to use
879
+ * @param verticesStart defines the index of first vertex to draw
880
+ * @param verticesCount defines the count of vertices to draw
881
+ * @param instancesCount defines the number of instances to draw (if instantiation is enabled)
882
+ */
883
+ abstract drawArraysType(fillMode: number, verticesStart: number, verticesCount: number, instancesCount?: number): void;
884
+ /**
885
+ * @internal
886
+ */
887
+ abstract _viewport(x: number, y: number, width: number, height: number): void;
888
+ /**
889
+ * Gets the current viewport
890
+ */
891
+ get currentViewport(): Nullable<IViewportLike>;
892
+ /**
893
+ * Set the WebGL's viewport
894
+ * @param viewport defines the viewport element to be used
895
+ * @param requiredWidth defines the width required for rendering. If not provided the rendering canvas' width is used
896
+ * @param requiredHeight defines the height required for rendering. If not provided the rendering canvas' height is used
897
+ */
898
+ setViewport(viewport: IViewportLike, requiredWidth?: number, requiredHeight?: number): void;
899
+ /**
900
+ * Sets a storage buffer in the shader
901
+ * @param name Defines the name of the storage buffer as defined in the shader
902
+ * @param buffer Defines the value to give to the uniform
903
+ */
904
+ abstract setStorageBuffer(name: string, buffer: Nullable<StorageBuffer>): void;
905
+ /**
906
+ * Sets a texture sampler to the according uniform.
907
+ * @param name The name of the uniform in the effect
908
+ * @param sampler The sampler to apply
909
+ */
910
+ abstract setTextureSampler(name: string, sampler: Nullable<TextureSampler>): void;
911
+ /**
912
+ * Update the sampling mode of a given texture
913
+ * @param samplingMode defines the required sampling mode
914
+ * @param texture defines the texture to update
915
+ * @param generateMipMaps defines whether to generate mipmaps for the texture
916
+ */
917
+ abstract updateTextureSamplingMode(samplingMode: number, texture: InternalTexture, generateMipMaps?: boolean): void;
918
+ /**
919
+ * Sets a texture to the context from a postprocess
920
+ * @param channel defines the channel to use
921
+ * @param postProcess defines the source postprocess
922
+ * @param name name of the channel
923
+ */
924
+ abstract setTextureFromPostProcess(channel: number, postProcess: Nullable<PostProcess>, name: string): void;
925
+ /**
926
+ * Binds the output of the passed in post process to the texture channel specified
927
+ * @param channel The channel the texture should be bound to
928
+ * @param postProcess The post process which's output should be bound
929
+ * @param name name of the channel
930
+ */
931
+ abstract setTextureFromPostProcessOutput(channel: number, postProcess: Nullable<PostProcess>, name: string): void;
932
+ /**
933
+ * Sets an array of texture to the webGL context
934
+ * @param channel defines the channel where the texture array must be set
935
+ * @param uniform defines the associated uniform location
936
+ * @param textures defines the array of textures to bind
937
+ * @param name name of the channel
938
+ */
939
+ abstract setTextureArray(channel: number, uniform: Nullable<WebGLUniformLocation>, textures: ThinTexture[], name: string): void;
940
+ /** @internal */
941
+ _transformTextureUrl: Nullable<(url: string) => string>;
942
+ /**
943
+ * Unbind all instance attributes
944
+ */
945
+ abstract unbindInstanceAttributes(): void;
946
+ /**
947
+ * @internal
948
+ */
949
+ abstract _getUseSRGBBuffer(useSRGBBuffer: boolean, noMipmap: boolean): boolean;
950
+ /**
951
+ * Create an image to use with canvas
952
+ * @returns IImage interface
953
+ */
954
+ createCanvasImage(): IImage;
955
+ /**
956
+ * Returns a string describing the current engine
957
+ */
958
+ get description(): string;
959
+ protected _createTextureBase(url: Nullable<string>, noMipmap: boolean, invertY: boolean, scene: Nullable<ISceneLike>, samplingMode: number | undefined, onLoad: Nullable<(texture: InternalTexture) => void> | undefined, onError: Nullable<(message: string, exception: any) => void> | undefined, prepareTexture: (texture: InternalTexture, extension: string, scene: Nullable<ISceneLike>, img: HTMLImageElement | ImageBitmap | {
960
+ width: number;
961
+ height: number;
962
+ }, invertY: boolean, noMipmap: boolean, isCompressed: boolean, processFunction: (width: number, height: number, img: HTMLImageElement | ImageBitmap | {
963
+ width: number;
964
+ height: number;
965
+ }, extension: string, texture: InternalTexture, continuationCallback: () => void) => boolean, samplingMode: number) => void, prepareTextureProcessFunction: (width: number, height: number, img: HTMLImageElement | ImageBitmap | {
966
+ width: number;
967
+ height: number;
968
+ }, extension: string, texture: InternalTexture, continuationCallback: () => void) => boolean, buffer?: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob | ImageBitmap>, fallback?: Nullable<InternalTexture>, format?: Nullable<number>, forcedExtension?: Nullable<string>, mimeType?: string, loaderOptions?: any, useSRGBBuffer?: boolean): InternalTexture;
969
+ /**
970
+ * Creates a new pipeline context
971
+ * @param shaderProcessingContext defines the shader processing context used during the processing if available
972
+ * @returns the new pipeline
973
+ */
974
+ abstract createPipelineContext(shaderProcessingContext: Nullable<ShaderProcessingContext>): IPipelineContext;
975
+ /**
976
+ * Inline functions in shader code that are marked to be inlined
977
+ * @param code code to inline
978
+ * @returns inlined code
979
+ */
980
+ abstract inlineShaderCode(code: string): string;
981
+ /**
982
+ * Gets a boolean indicating that the engine supports uniform buffers
983
+ */
984
+ abstract get supportsUniformBuffers(): boolean;
985
+ /**
986
+ * Returns the version of the engine
987
+ */
988
+ abstract get version(): number;
989
+ /**
990
+ * @internal
991
+ */
992
+ abstract _releaseEffect(effect: Effect): void;
993
+ /**
994
+ * Bind a buffer to the current draw context
995
+ * @param buffer defines the buffer to bind
996
+ * @param _location not used in WebGPU
997
+ * @param name Name of the uniform variable to bind
998
+ */
999
+ abstract bindUniformBufferBase(buffer: DataBuffer, _location: number, name: string): void;
1000
+ /**
1001
+ * Bind a specific block at a given index in a specific shader program
1002
+ * @param pipelineContext defines the pipeline context to use
1003
+ * @param blockName defines the block name
1004
+ * @param index defines the index where to bind the block
1005
+ */
1006
+ abstract bindUniformBlock(pipelineContext: IPipelineContext, blockName: string, index: number): void;
1007
+ /**
1008
+ * Sets a depth stencil texture from a render target to the according uniform.
1009
+ * @param channel The texture channel
1010
+ * @param uniform The uniform to set
1011
+ * @param texture The render target texture containing the depth stencil texture to apply
1012
+ * @param name The texture name
1013
+ */
1014
+ abstract setDepthStencilTexture(channel: number, uniform: Nullable<WebGLUniformLocation>, texture: Nullable<RenderTargetTexture>, name?: string): void;
1015
+ /** @internal */
1016
+ _uniformBuffers: UniformBuffer[];
1017
+ /** @internal */
1018
+ _storageBuffers: StorageBuffer[];
1019
+ protected _rebuildBuffers(): void;
1020
+ protected _highPrecisionShadersAllowed: boolean;
1021
+ /** @internal */
1022
+ get _shouldUseHighPrecisionShader(): boolean;
1023
+ /**
1024
+ * @internal
1025
+ */
1026
+ abstract _getShaderProcessingContext(shaderLanguage: ShaderLanguage): Nullable<ShaderProcessingContext>;
1027
+ /**
1028
+ * Gets host document
1029
+ * @returns the host document object
1030
+ */
1031
+ getHostDocument(): Nullable<Document>;
1032
+ /**
1033
+ * Observable signaled when a context lost event is raised
1034
+ */
1035
+ onContextLostObservable: Observable<AbstractEngine>;
1036
+ /**
1037
+ * Observable signaled when a context restored event is raised
1038
+ */
1039
+ onContextRestoredObservable: Observable<AbstractEngine>;
1040
+ /**
1041
+ * Gets the list of loaded textures
1042
+ * @returns an array containing all loaded textures
1043
+ */
1044
+ getLoadedTexturesCache(): InternalTexture[];
1045
+ /**
1046
+ * Clears the list of texture accessible through engine.
1047
+ * This can help preventing texture load conflict due to name collision.
1048
+ */
1049
+ clearInternalTexturesCache(): void;
1050
+ /**
1051
+ * @internal
1052
+ */
1053
+ abstract _releaseTexture(texture: InternalTexture): void;
1054
+ /**
1055
+ * Gets the object containing all engine capabilities
1056
+ * @returns the EngineCapabilities object
1057
+ */
1058
+ getCaps(): EngineCapabilities;
1059
+ /**
1060
+ * Reset the texture cache to empty state
1061
+ */
1062
+ resetTextureCache(): void;
1063
+ /** @internal */
1064
+ protected _name: string;
1065
+ /**
1066
+ * Gets or sets the name of the engine
1067
+ */
1068
+ get name(): string;
1069
+ set name(value: string);
1070
+ /**
1071
+ * Returns the current npm package of the sdk
1072
+ */
1073
+ static get NpmPackage(): string;
1074
+ /**
1075
+ * Returns the current version of the framework
1076
+ */
1077
+ static get Version(): string;
1078
+ /**
1079
+ * The time (in milliseconds elapsed since the current page has been loaded) when the engine was initialized
1080
+ */
1081
+ readonly startTime: number;
1082
+ /** @internal */
1083
+ protected _audioContext: Nullable<AudioContext>;
1084
+ /** @internal */
1085
+ protected _audioDestination: Nullable<AudioDestinationNode | MediaStreamAudioDestinationNode>;
1086
+ /**
1087
+ * Gets the HTML canvas attached with the current webGL context
1088
+ * @returns a HTML canvas
1089
+ */
1090
+ getRenderingCanvas(): Nullable<HTMLCanvasElement>;
1091
+ /**
1092
+ * Gets the audio context specified in engine initialization options
1093
+ * @returns an Audio Context
1094
+ */
1095
+ getAudioContext(): Nullable<AudioContext>;
1096
+ /**
1097
+ * Gets the audio destination specified in engine initialization options
1098
+ * @returns an audio destination node
1099
+ */
1100
+ getAudioDestination(): Nullable<AudioDestinationNode | MediaStreamAudioDestinationNode>;
1101
+ /**
1102
+ * Defines whether the engine has been created with the premultipliedAlpha option on or not.
1103
+ */
1104
+ premultipliedAlpha: boolean;
1105
+ /**
1106
+ * If set to true zooming in and out in the browser will rescale the hardware-scaling correctly.
1107
+ */
1108
+ adaptToDeviceRatio: boolean;
1109
+ /** @internal */
1110
+ protected _lastDevicePixelRatio: number;
1111
+ /** @internal */
1112
+ _hardwareScalingLevel: number;
1113
+ /**
1114
+ * Defines the hardware scaling level.
1115
+ * By default the hardware scaling level is computed from the window device ratio.
1116
+ * if level = 1 then the engine will render at the exact resolution of the canvas. If level = 0.5 then the engine will render at twice the size of the canvas.
1117
+ * @param level defines the level to use
1118
+ */
1119
+ setHardwareScalingLevel(level: number): void;
1120
+ /**
1121
+ * Gets the current hardware scaling level.
1122
+ * By default the hardware scaling level is computed from the window device ratio.
1123
+ * if level = 1 then the engine will render at the exact resolution of the canvas. If level = 0.5 then the engine will render at twice the size of the canvas.
1124
+ * @returns a number indicating the current hardware scaling level
1125
+ */
1126
+ getHardwareScalingLevel(): number;
1127
+ /** @internal */
1128
+ _doNotHandleContextLost: boolean;
1129
+ /**
1130
+ * Gets or sets a boolean indicating if resources should be retained to be able to handle context lost events
1131
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#handling-webgl-context-lost
1132
+ */
1133
+ get doNotHandleContextLost(): boolean;
1134
+ set doNotHandleContextLost(value: boolean);
1135
+ /** @internal */
1136
+ protected _isStencilEnable: boolean;
1137
+ /**
1138
+ * Returns true if the stencil buffer has been enabled through the creation option of the context.
1139
+ */
1140
+ get isStencilEnable(): boolean;
1141
+ /**
1142
+ * Creates a new engine
1143
+ * @param antialias defines enable antialiasing (default: false)
1144
+ * @param options defines further options to be sent to the creation context
1145
+ * @param adaptToDeviceRatio defines whether to adapt to the device's viewport characteristics (default: false)
1146
+ */
1147
+ constructor(antialias: boolean, options: AbstractEngineOptions, adaptToDeviceRatio?: boolean);
1148
+ /**
1149
+ * Resize the view according to the canvas' size
1150
+ * @param forceSetSize true to force setting the sizes of the underlying canvas
1151
+ */
1152
+ resize(forceSetSize?: boolean): void;
1153
+ /**
1154
+ * Force a specific size of the canvas
1155
+ * @param width defines the new canvas' width
1156
+ * @param height defines the new canvas' height
1157
+ * @param forceSetSize true to force setting the sizes of the underlying canvas
1158
+ * @returns true if the size was changed
1159
+ */
1160
+ setSize(width: number, height: number, forceSetSize?: boolean): boolean;
1161
+ /**
1162
+ * @internal
1163
+ */
1164
+ abstract _releaseBuffer(buffer: DataBuffer): boolean;
1165
+ /**
1166
+ * Create a dynamic uniform buffer
1167
+ * @see https://doc.babylonjs.com/setup/support/webGL2#uniform-buffer-objets
1168
+ * @param elements defines the content of the uniform buffer
1169
+ * @param label defines a name for the buffer (for debugging purpose)
1170
+ * @returns the webGL uniform buffer
1171
+ */
1172
+ abstract createDynamicUniformBuffer(elements: FloatArray, label?: string): DataBuffer;
1173
+ /**
1174
+ * Create an uniform buffer
1175
+ * @see https://doc.babylonjs.com/setup/support/webGL2#uniform-buffer-objets
1176
+ * @param elements defines the content of the uniform buffer
1177
+ * @param label defines a name for the buffer (for debugging purpose)
1178
+ * @returns the webGL uniform buffer
1179
+ */
1180
+ abstract createUniformBuffer(elements: FloatArray, label?: string): DataBuffer;
1181
+ /**
1182
+ * Update an existing uniform buffer
1183
+ * @see https://doc.babylonjs.com/setup/support/webGL2#uniform-buffer-objets
1184
+ * @param uniformBuffer defines the target uniform buffer
1185
+ * @param elements defines the content to update
1186
+ * @param offset defines the offset in the uniform buffer where update should start
1187
+ * @param count defines the size of the data to update
1188
+ */
1189
+ abstract updateUniformBuffer(uniformBuffer: DataBuffer, elements: FloatArray, offset?: number, count?: number): void;
1190
+ /**
1191
+ * Update a dynamic index buffer
1192
+ * @param indexBuffer defines the target index buffer
1193
+ * @param indices defines the data to update
1194
+ * @param offset defines the offset in the target index buffer where update should start
1195
+ */
1196
+ abstract updateDynamicIndexBuffer(indexBuffer: DataBuffer, indices: IndicesArray, offset?: number): void;
1197
+ /**
1198
+ * Updates a dynamic vertex buffer.
1199
+ * @param vertexBuffer the vertex buffer to update
1200
+ * @param data the data used to update the vertex buffer
1201
+ * @param byteOffset the byte offset of the data
1202
+ * @param byteLength the byte length of the data
1203
+ */
1204
+ abstract updateDynamicVertexBuffer(vertexBuffer: DataBuffer, data: DataArray, byteOffset?: number, byteLength?: number): void;
1205
+ /**
1206
+ * Creates a dynamic vertex buffer
1207
+ * @param data the data for the dynamic vertex buffer
1208
+ * @param _label defines the label of the buffer (for debug purpose)
1209
+ * @returns the new WebGL dynamic buffer
1210
+ */
1211
+ abstract createDynamicVertexBuffer(data: DataArray | number, _label?: string): DataBuffer;
1212
+ /**
1213
+ * Creates a vertex buffer
1214
+ * @param data the data or size for the vertex buffer
1215
+ * @param _updatable whether the buffer should be created as updatable
1216
+ * @param _label defines the label of the buffer (for debug purpose)
1217
+ * @returns the new WebGL static buffer
1218
+ */
1219
+ abstract createVertexBuffer(data: DataArray | number, _updatable?: boolean, _label?: string): DataBuffer;
1220
+ /**
1221
+ * Update the dimensions of a texture
1222
+ * @param texture texture to update
1223
+ * @param width new width of the texture
1224
+ * @param height new height of the texture
1225
+ * @param depth new depth of the texture
1226
+ */
1227
+ abstract updateTextureDimensions(texture: InternalTexture, width: number, height: number, depth: number): void;
1228
+ /**
1229
+ * Usually called from Texture.ts.
1230
+ * Passed information to create a WebGLTexture
1231
+ * @param url defines a value which contains one of the following:
1232
+ * * A conventional http URL, e.g. 'http://...' or 'file://...'
1233
+ * * A base64 string of in-line texture data, e.g. 'data:image/jpg;base64,/...'
1234
+ * * An indicator that data being passed using the buffer parameter, e.g. 'data:mytexture.jpg'
1235
+ * @param noMipmap defines a boolean indicating that no mipmaps shall be generated. Ignored for compressed textures. They must be in the file
1236
+ * @param invertY when true, image is flipped when loaded. You probably want true. Certain compressed textures may invert this if their default is inverted (eg. ktx)
1237
+ * @param scene needed for loading to the correct scene
1238
+ * @param samplingMode mode with should be used sample / access the texture (Default: Texture.TRILINEAR_SAMPLINGMODE)
1239
+ * @param onLoad optional callback to be called upon successful completion
1240
+ * @param onError optional callback to be called upon failure
1241
+ * @param buffer a source of a file previously fetched as either a base64 string, an ArrayBuffer (compressed or image format), HTMLImageElement (image format), or a Blob
1242
+ * @param fallback an internal argument in case the function must be called again, due to etc1 not having alpha capabilities
1243
+ * @param format internal format. Default: RGB when extension is '.jpg' else RGBA. Ignored for compressed textures
1244
+ * @param forcedExtension defines the extension to use to pick the right loader
1245
+ * @param mimeType defines an optional mime type
1246
+ * @param loaderOptions options to be passed to the loader
1247
+ * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)
1248
+ * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
1249
+ * @returns a InternalTexture for assignment back into BABYLON.Texture
1250
+ */
1251
+ abstract createTexture(url: Nullable<string>, noMipmap: boolean, invertY: boolean, scene: Nullable<ISceneLike>, samplingMode?: number, onLoad?: Nullable<(texture: InternalTexture) => void>, onError?: Nullable<(message: string, exception: any) => void>, buffer?: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob | ImageBitmap>, fallback?: Nullable<InternalTexture>, format?: Nullable<number>, forcedExtension?: Nullable<string>, mimeType?: string, loaderOptions?: any, creationFlags?: number, useSRGBBuffer?: boolean): InternalTexture;
1252
+ /**
1253
+ * @internal
1254
+ */
1255
+ abstract _setupDepthStencilTexture(internalTexture: InternalTexture, size: number | {
1256
+ width: number;
1257
+ height: number;
1258
+ layers?: number;
1259
+ }, generateStencil: boolean, bilinearFiltering: boolean, comparisonFunction: number, samples?: number): void;
1260
+ /**
1261
+ * Creates a raw texture
1262
+ * @param data defines the data to store in the texture
1263
+ * @param width defines the width of the texture
1264
+ * @param height defines the height of the texture
1265
+ * @param format defines the format of the data
1266
+ * @param generateMipMaps defines if the engine should generate the mip levels
1267
+ * @param invertY defines if data must be stored with Y axis inverted
1268
+ * @param samplingMode defines the required sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
1269
+ * @param compression defines the compression used (null by default)
1270
+ * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
1271
+ * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)
1272
+ * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
1273
+ * @returns the raw texture inside an InternalTexture
1274
+ */
1275
+ abstract createRawTexture(data: Nullable<ArrayBufferView>, width: number, height: number, format: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression?: Nullable<string>, type?: number, creationFlags?: number, useSRGBBuffer?: boolean): InternalTexture;
1276
+ /**
1277
+ * Create a cube texture from prefiltered data (ie. the mipmaps contain ready to use data for PBR reflection)
1278
+ * @param rootUrl defines the url where the file to load is located
1279
+ * @param scene defines the current scene
1280
+ * @param lodScale defines scale to apply to the mip map selection
1281
+ * @param lodOffset defines offset to apply to the mip map selection
1282
+ * @param onLoad defines an optional callback raised when the texture is loaded
1283
+ * @param onError defines an optional callback raised if there is an issue to load the texture
1284
+ * @param format defines the format of the data
1285
+ * @param forcedExtension defines the extension to use to pick the right loader
1286
+ * @param createPolynomials defines wheter or not to create polynomails harmonics for the texture
1287
+ * @returns the cube texture as an InternalTexture
1288
+ */
1289
+ abstract createPrefilteredCubeTexture(rootUrl: string, scene: Nullable<Scene>, lodScale: number, lodOffset: number, onLoad?: Nullable<(internalTexture: Nullable<InternalTexture>) => void>, onError?: Nullable<(message?: string, exception?: any) => void>, format?: number, forcedExtension?: any, createPolynomials?: boolean): InternalTexture;
1290
+ /**
1291
+ * Creates a dynamic texture
1292
+ * @param width defines the width of the texture
1293
+ * @param height defines the height of the texture
1294
+ * @param generateMipMaps defines if the engine should generate the mip levels
1295
+ * @param samplingMode defines the required sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
1296
+ * @returns the dynamic texture inside an InternalTexture
1297
+ */
1298
+ abstract createDynamicTexture(width: number, height: number, generateMipMaps: boolean, samplingMode: number): InternalTexture;
1299
+ /**
1300
+ * Update the content of a dynamic texture
1301
+ * @param texture defines the texture to update
1302
+ * @param source defines the source containing the data
1303
+ * @param invertY defines if data must be stored with Y axis inverted
1304
+ * @param premulAlpha defines if alpha is stored as premultiplied
1305
+ * @param format defines the format of the data
1306
+ * @param forceBindTexture if the texture should be forced to be bound eg. after a graphics context loss (Default: false)
1307
+ * @param allowGPUOptimization true to allow some specific GPU optimizations (subject to engine feature "allowGPUOptimizationsForGUI" being true)
1308
+ */
1309
+ abstract updateDynamicTexture(texture: Nullable<InternalTexture>, source: ImageSource | ICanvas, invertY?: boolean, premulAlpha?: boolean, format?: number, forceBindTexture?: boolean, allowGPUOptimization?: boolean): void;
1310
+ /**
1311
+ * Creates a cube texture
1312
+ * @param rootUrl defines the url where the files to load is located
1313
+ * @param scene defines the current scene
1314
+ * @param files defines the list of files to load (1 per face)
1315
+ * @param noMipmap defines a boolean indicating that no mipmaps shall be generated (false by default)
1316
+ * @param onLoad defines an optional callback raised when the texture is loaded
1317
+ * @param onError defines an optional callback raised if there is an issue to load the texture
1318
+ * @param format defines the format of the data
1319
+ * @param forcedExtension defines the extension to use to pick the right loader
1320
+ * @param createPolynomials if a polynomial sphere should be created for the cube texture
1321
+ * @param lodScale defines the scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness
1322
+ * @param lodOffset defines the offset applied to environment texture. This manages first LOD level used for IBL according to the roughness
1323
+ * @param fallback defines texture to use while falling back when (compressed) texture file not found.
1324
+ * @param loaderOptions options to be passed to the loader
1325
+ * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
1326
+ * @returns the cube texture as an InternalTexture
1327
+ */
1328
+ abstract createCubeTexture(rootUrl: string, scene: Nullable<Scene>, files: Nullable<string[]>, noMipmap: boolean | undefined, onLoad: Nullable<(data?: any) => void>, onError: Nullable<(message?: string, exception?: any) => void>, format: number | undefined, forcedExtension: any, createPolynomials: boolean, lodScale: number, lodOffset: number, fallback: Nullable<InternalTexture>, loaderOptions: any, useSRGBBuffer: boolean): InternalTexture;
1329
+ /**
1330
+ * Creates a cube texture
1331
+ * @param rootUrl defines the url where the files to load is located
1332
+ * @param scene defines the current scene
1333
+ * @param files defines the list of files to load (1 per face)
1334
+ * @param noMipmap defines a boolean indicating that no mipmaps shall be generated (false by default)
1335
+ * @param onLoad defines an optional callback raised when the texture is loaded
1336
+ * @param onError defines an optional callback raised if there is an issue to load the texture
1337
+ * @param format defines the format of the data
1338
+ * @param forcedExtension defines the extension to use to pick the right loader
1339
+ * @returns the cube texture as an InternalTexture
1340
+ */
1341
+ abstract createCubeTexture(rootUrl: string, scene: Nullable<Scene>, files: Nullable<string[]>, noMipmap: boolean, onLoad: Nullable<(data?: any) => void>, onError: Nullable<(message?: string, exception?: any) => void>, format: number | undefined, forcedExtension: any): InternalTexture;
1342
+ /**
1343
+ * Creates a cube texture
1344
+ * @param rootUrl defines the url where the files to load is located
1345
+ * @param scene defines the current scene
1346
+ * @param files defines the list of files to load (1 per face)
1347
+ * @param noMipmap defines a boolean indicating that no mipmaps shall be generated (false by default)
1348
+ * @param onLoad defines an optional callback raised when the texture is loaded
1349
+ * @param onError defines an optional callback raised if there is an issue to load the texture
1350
+ * @param format defines the format of the data
1351
+ * @param forcedExtension defines the extension to use to pick the right loader
1352
+ * @param createPolynomials if a polynomial sphere should be created for the cube texture
1353
+ * @param lodScale defines the scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness
1354
+ * @param lodOffset defines the offset applied to environment texture. This manages first LOD level used for IBL according to the roughness
1355
+ * @returns the cube texture as an InternalTexture
1356
+ */
1357
+ abstract createCubeTexture(rootUrl: string, scene: Nullable<Scene>, files: Nullable<string[]>, noMipmap: boolean, onLoad: Nullable<(data?: any) => void>, onError: Nullable<(message?: string, exception?: any) => void>, format: number | undefined, forcedExtension: any, createPolynomials: boolean, lodScale: number, lodOffset: number): InternalTexture;
1358
+ /**
1359
+ * Creates a new raw cube texture
1360
+ * @param data defines the array of data to use to create each face
1361
+ * @param size defines the size of the textures
1362
+ * @param format defines the format of the data
1363
+ * @param type defines the type of the data (like Engine.TEXTURETYPE_UNSIGNED_INT)
1364
+ * @param generateMipMaps defines if the engine should generate the mip levels
1365
+ * @param invertY defines if data must be stored with Y axis inverted
1366
+ * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)
1367
+ * @param compression defines the compression used (null by default)
1368
+ * @returns the cube texture as an InternalTexture
1369
+ */
1370
+ abstract createRawCubeTexture(data: Nullable<ArrayBufferView[]>, size: number, format: number, type: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression?: Nullable<string>): InternalTexture;
1371
+ /**
1372
+ * Update a raw cube texture
1373
+ * @param texture defines the texture to update
1374
+ * @param data defines the data to store
1375
+ * @param format defines the data format
1376
+ * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
1377
+ * @param invertY defines if data must be stored with Y axis inverted
1378
+ */
1379
+ abstract updateRawCubeTexture(texture: InternalTexture, data: ArrayBufferView[], format: number, type: number, invertY: boolean): void;
1380
+ /**
1381
+ * Update a raw cube texture
1382
+ * @param texture defines the texture to update
1383
+ * @param data defines the data to store
1384
+ * @param format defines the data format
1385
+ * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
1386
+ * @param invertY defines if data must be stored with Y axis inverted
1387
+ * @param compression defines the compression used (null by default)
1388
+ */
1389
+ abstract updateRawCubeTexture(texture: InternalTexture, data: ArrayBufferView[], format: number, type: number, invertY: boolean, compression: Nullable<string>): void;
1390
+ /**
1391
+ * Update a raw cube texture
1392
+ * @param texture defines the texture to update
1393
+ * @param data defines the data to store
1394
+ * @param format defines the data format
1395
+ * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
1396
+ * @param invertY defines if data must be stored with Y axis inverted
1397
+ * @param compression defines the compression used (null by default)
1398
+ * @param level defines which level of the texture to update
1399
+ */
1400
+ abstract updateRawCubeTexture(texture: InternalTexture, data: ArrayBufferView[], format: number, type: number, invertY: boolean, compression: Nullable<string>, level: number): void;
1401
+ /**
1402
+ * Creates a new raw cube texture from a specified url
1403
+ * @param url defines the url where the data is located
1404
+ * @param scene defines the current scene
1405
+ * @param size defines the size of the textures
1406
+ * @param format defines the format of the data
1407
+ * @param type defines the type fo the data (like Engine.TEXTURETYPE_UNSIGNED_INT)
1408
+ * @param noMipmap defines if the engine should avoid generating the mip levels
1409
+ * @param callback defines a callback used to extract texture data from loaded data
1410
+ * @param mipmapGenerator defines to provide an optional tool to generate mip levels
1411
+ * @param onLoad defines a callback called when texture is loaded
1412
+ * @param onError defines a callback called if there is an error
1413
+ * @returns the cube texture as an InternalTexture
1414
+ */
1415
+ abstract createRawCubeTextureFromUrl(url: string, scene: Nullable<Scene>, size: number, format: number, type: number, noMipmap: boolean, callback: (ArrayBuffer: ArrayBuffer) => Nullable<ArrayBufferView[]>, mipmapGenerator: Nullable<(faces: ArrayBufferView[]) => ArrayBufferView[][]>, onLoad: Nullable<() => void>, onError: Nullable<(message?: string, exception?: any) => void>): InternalTexture;
1416
+ /**
1417
+ * Creates a new raw cube texture from a specified url
1418
+ * @param url defines the url where the data is located
1419
+ * @param scene defines the current scene
1420
+ * @param size defines the size of the textures
1421
+ * @param format defines the format of the data
1422
+ * @param type defines the type fo the data (like Engine.TEXTURETYPE_UNSIGNED_INT)
1423
+ * @param noMipmap defines if the engine should avoid generating the mip levels
1424
+ * @param callback defines a callback used to extract texture data from loaded data
1425
+ * @param mipmapGenerator defines to provide an optional tool to generate mip levels
1426
+ * @param onLoad defines a callback called when texture is loaded
1427
+ * @param onError defines a callback called if there is an error
1428
+ * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)
1429
+ * @param invertY defines if data must be stored with Y axis inverted
1430
+ * @returns the cube texture as an InternalTexture
1431
+ */
1432
+ abstract createRawCubeTextureFromUrl(url: string, scene: Nullable<Scene>, size: number, format: number, type: number, noMipmap: boolean, callback: (ArrayBuffer: ArrayBuffer) => Nullable<ArrayBufferView[]>, mipmapGenerator: Nullable<(faces: ArrayBufferView[]) => ArrayBufferView[][]>, onLoad: Nullable<() => void>, onError: Nullable<(message?: string, exception?: any) => void>, samplingMode: number, invertY: boolean): InternalTexture;
1433
+ /**
1434
+ * Creates a new raw 3D texture
1435
+ * @param data defines the data used to create the texture
1436
+ * @param width defines the width of the texture
1437
+ * @param height defines the height of the texture
1438
+ * @param depth defines the depth of the texture
1439
+ * @param format defines the format of the texture
1440
+ * @param generateMipMaps defines if the engine must generate mip levels
1441
+ * @param invertY defines if data must be stored with Y axis inverted
1442
+ * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)
1443
+ * @param compression defines the compressed used (can be null)
1444
+ * @param textureType defines the compressed used (can be null)
1445
+ * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)
1446
+ * @returns a new raw 3D texture (stored in an InternalTexture)
1447
+ */
1448
+ abstract createRawTexture3D(data: Nullable<ArrayBufferView>, width: number, height: number, depth: number, format: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression?: Nullable<string>, textureType?: number, creationFlags?: number): InternalTexture;
1449
+ /**
1450
+ * Update a raw 3D texture
1451
+ * @param texture defines the texture to update
1452
+ * @param data defines the data to store
1453
+ * @param format defines the data format
1454
+ * @param invertY defines if data must be stored with Y axis inverted
1455
+ */
1456
+ abstract updateRawTexture3D(texture: InternalTexture, data: Nullable<ArrayBufferView>, format: number, invertY: boolean): void;
1457
+ /**
1458
+ * Update a raw 3D texture
1459
+ * @param texture defines the texture to update
1460
+ * @param data defines the data to store
1461
+ * @param format defines the data format
1462
+ * @param invertY defines if data must be stored with Y axis inverted
1463
+ * @param compression defines the used compression (can be null)
1464
+ * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_INT, Engine.TEXTURETYPE_FLOAT...)
1465
+ */
1466
+ abstract updateRawTexture3D(texture: InternalTexture, data: Nullable<ArrayBufferView>, format: number, invertY: boolean, compression: Nullable<string>, textureType: number): void;
1467
+ /**
1468
+ * Creates a new raw 2D array texture
1469
+ * @param data defines the data used to create the texture
1470
+ * @param width defines the width of the texture
1471
+ * @param height defines the height of the texture
1472
+ * @param depth defines the number of layers of the texture
1473
+ * @param format defines the format of the texture
1474
+ * @param generateMipMaps defines if the engine must generate mip levels
1475
+ * @param invertY defines if data must be stored with Y axis inverted
1476
+ * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)
1477
+ * @param compression defines the compressed used (can be null)
1478
+ * @param textureType defines the compressed used (can be null)
1479
+ * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)
1480
+ * @returns a new raw 2D array texture (stored in an InternalTexture)
1481
+ */
1482
+ abstract createRawTexture2DArray(data: Nullable<ArrayBufferView>, width: number, height: number, depth: number, format: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression?: Nullable<string>, textureType?: number, creationFlags?: number): InternalTexture;
1483
+ /**
1484
+ * Update a raw 2D array texture
1485
+ * @param texture defines the texture to update
1486
+ * @param data defines the data to store
1487
+ * @param format defines the data format
1488
+ * @param invertY defines if data must be stored with Y axis inverted
1489
+ */
1490
+ abstract updateRawTexture2DArray(texture: InternalTexture, data: Nullable<ArrayBufferView>, format: number, invertY: boolean): void;
1491
+ /**
1492
+ * Update a raw 2D array texture
1493
+ * @param texture defines the texture to update
1494
+ * @param data defines the data to store
1495
+ * @param format defines the data format
1496
+ * @param invertY defines if data must be stored with Y axis inverted
1497
+ * @param compression defines the used compression (can be null)
1498
+ * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_INT, Engine.TEXTURETYPE_FLOAT...)
1499
+ */
1500
+ abstract updateRawTexture2DArray(texture: InternalTexture, data: Nullable<ArrayBufferView>, format: number, invertY: boolean, compression: Nullable<string>, textureType: number): void;
1501
+ /**
1502
+ * Gets or sets a boolean indicating if back faces must be culled. If false, front faces are culled instead (true by default)
1503
+ * If non null, this takes precedence over the value from the material
1504
+ */
1505
+ cullBackFaces: Nullable<boolean>;
1506
+ /**
1507
+ * Gets the current render width
1508
+ * @param useScreen defines if screen size must be used (or the current render target if any)
1509
+ * @returns a number defining the current render width
1510
+ */
1511
+ abstract getRenderWidth(useScreen?: boolean): number;
1512
+ /**
1513
+ * Gets the current render height
1514
+ * @param useScreen defines if screen size must be used (or the current render target if any)
1515
+ * @returns a number defining the current render height
1516
+ */
1517
+ abstract getRenderHeight(useScreen?: boolean): number;
1518
+ /**
1519
+ * Shared initialization across engines types.
1520
+ * @param canvas The canvas associated with this instance of the engine.
1521
+ */
1522
+ protected _sharedInit(canvas: HTMLCanvasElement): void;
1523
+ private _checkForMobile;
1524
+ protected _setupMobileChecks(): void;
1525
+ /** @internal */
1526
+ static _RenderPassIdCounter: number;
1527
+ /** @internal */
1528
+ _renderPassNames: string[];
1529
+ /** @internal */
1530
+ abstract _createHardwareTexture(): HardwareTextureWrapper;
1531
+ /**
1532
+ * creates and returns a new video element
1533
+ * @param constraints video constraints
1534
+ * @returns video element
1535
+ */
1536
+ createVideoElement(constraints: MediaTrackConstraints): any;
1537
+ protected _fps: number;
1538
+ protected _deltaTime: number;
1539
+ /** @internal */
1540
+ _drawCalls: PerfCounter;
1541
+ /**
1542
+ * @internal
1543
+ */
1544
+ _reportDrawCall(numDrawCalls?: number): void;
1545
+ /**
1546
+ * Gets the current framerate
1547
+ * @returns a number representing the framerate
1548
+ */
1549
+ getFps(): number;
1550
+ /**
1551
+ * Gets the time spent between current and previous frame
1552
+ * @returns a number representing the delta time in ms
1553
+ */
1554
+ getDeltaTime(): number;
1555
+ /** @internal */
1556
+ _deterministicLockstep: boolean;
1557
+ /** @internal */
1558
+ _lockstepMaxSteps: number;
1559
+ /** @internal */
1560
+ _timeStep: number;
1561
+ /**
1562
+ * Gets a boolean indicating that the engine is running in deterministic lock step mode
1563
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#deterministic-lockstep
1564
+ * @returns true if engine is in deterministic lock step mode
1565
+ */
1566
+ isDeterministicLockStep(): boolean;
1567
+ /**
1568
+ * Gets the max steps when engine is running in deterministic lock step
1569
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#deterministic-lockstep
1570
+ * @returns the max steps
1571
+ */
1572
+ getLockstepMaxSteps(): number;
1573
+ /**
1574
+ * Returns the time in ms between steps when using deterministic lock step.
1575
+ * @returns time step in (ms)
1576
+ */
1577
+ getTimeStep(): number;
1578
+ /**
1579
+ * Force the mipmap generation for the given render target texture
1580
+ * @param texture defines the render target texture to use
1581
+ * @param unbind defines whether or not to unbind the texture after generation. Defaults to true.
1582
+ */
1583
+ abstract generateMipMapsForCubemap(texture: InternalTexture, unbind: boolean): void;
1584
+ /**
1585
+ * Engine abstraction for loading and creating an image bitmap from a given source string.
1586
+ * @param imageSource source to load the image from.
1587
+ * @param options An object that sets options for the image's extraction.
1588
+ */
1589
+ _createImageBitmapFromSource(imageSource: string, options?: ImageBitmapOptions): Promise<ImageBitmap>;
1590
+ /**
1591
+ * Engine abstraction for createImageBitmap
1592
+ * @param image source for image
1593
+ * @param options An object that sets options for the image's extraction.
1594
+ * @returns ImageBitmap
1595
+ */
1596
+ createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>;
1597
+ /**
1598
+ * Resize an image and returns the image data as an uint8array
1599
+ * @param image image to resize
1600
+ * @param bufferWidth destination buffer width
1601
+ * @param bufferHeight destination buffer height
1602
+ */
1603
+ resizeImageBitmap(image: HTMLImageElement | ImageBitmap, bufferWidth: number, bufferHeight: number): Uint8Array;
1604
+ /**
1605
+ * Get the current error code of the webGL context
1606
+ * @returns the error code
1607
+ */
1608
+ abstract getError(): number;
1609
+ /**
1610
+ * Get Font size information
1611
+ * @param font font name
1612
+ */
1613
+ getFontOffset(font: string): {
1614
+ ascent: number;
1615
+ height: number;
1616
+ descent: number;
1617
+ };
1618
+ protected static _CreateCanvas(width: number, height: number): ICanvas;
1619
+ /**
1620
+ * Create a canvas. This method is overridden by other engines
1621
+ * @param width width
1622
+ * @param height height
1623
+ * @returns ICanvas interface
1624
+ */
1625
+ createCanvas(width: number, height: number): ICanvas;
1626
+ /**
1627
+ * Loads an image as an HTMLImageElement.
1628
+ * @param input url string, ArrayBuffer, or Blob to load
1629
+ * @param onLoad callback called when the image successfully loads
1630
+ * @param onError callback called when the image fails to load
1631
+ * @param offlineProvider offline provider for caching
1632
+ * @param mimeType optional mime type
1633
+ * @param imageBitmapOptions optional the options to use when creating an ImageBitmap
1634
+ * @returns the HTMLImageElement of the loaded image
1635
+ * @internal
1636
+ */
1637
+ static _FileToolsLoadImage(input: string | ArrayBuffer | ArrayBufferView | Blob, onLoad: (img: HTMLImageElement | ImageBitmap) => void, onError: (message?: string, exception?: any) => void, offlineProvider: Nullable<IOfflineProvider>, mimeType?: string, imageBitmapOptions?: ImageBitmapOptions): Nullable<HTMLImageElement>;
1638
+ /**
1639
+ * Loads a file from a url
1640
+ * @param url url to load
1641
+ * @param onSuccess callback called when the file successfully loads
1642
+ * @param onProgress callback called while file is loading (if the server supports this mode)
1643
+ * @param offlineProvider defines the offline provider for caching
1644
+ * @param useArrayBuffer defines a boolean indicating that date must be returned as ArrayBuffer
1645
+ * @param onError callback called when the file fails to load
1646
+ * @returns a file request object
1647
+ * @internal
1648
+ */
1649
+ static _FileToolsLoadFile(url: string, onSuccess: (data: string | ArrayBuffer, responseURL?: string) => void, onProgress?: (ev: ProgressEvent) => void, offlineProvider?: IOfflineProvider, useArrayBuffer?: boolean, onError?: (request?: WebRequest, exception?: LoadFileError) => void): IFileRequest;
1650
+ /**
1651
+ * @internal
1652
+ */
1653
+ _loadFile(url: string, onSuccess: (data: string | ArrayBuffer, responseURL?: string) => void, onProgress?: (data: any) => void, offlineProvider?: IOfflineProvider, useArrayBuffer?: boolean, onError?: (request?: IWebRequest, exception?: any) => void): IFileRequest;
1654
+ /**
1655
+ * An event triggered when the engine is disposed.
1656
+ */
1657
+ readonly onDisposeObservable: Observable<AbstractEngine>;
1658
+ /**
1659
+ * Dispose and release all associated resources
1660
+ */
1661
+ dispose(): void;
1662
+ /**
1663
+ * Method called to create the default rescale post process on each engine.
1664
+ */
1665
+ static _RescalePostProcessFactory: Nullable<(engine: AbstractEngine) => PostProcess>;
1666
+ /**
1667
+ * Method called to create the default loading screen.
1668
+ * This can be overridden in your own app.
1669
+ * @param canvas The rendering canvas element
1670
+ */
1671
+ static DefaultLoadingScreenFactory(canvas: HTMLCanvasElement): ILoadingScreen;
1672
+ /**
1673
+ * Gets the audio engine
1674
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic
1675
+ * @ignorenaming
1676
+ */
1677
+ static audioEngine: Nullable<IAudioEngine>;
1678
+ /**
1679
+ * Default AudioEngine factory responsible of creating the Audio Engine.
1680
+ * By default, this will create a BabylonJS Audio Engine if the workload has been embedded.
1681
+ */
1682
+ static AudioEngineFactory: (hostElement: Nullable<HTMLElement>, audioContext: Nullable<AudioContext>, audioDestination: Nullable<AudioDestinationNode | MediaStreamAudioDestinationNode>) => IAudioEngine;
1683
+ /**
1684
+ * Default offline support factory responsible of creating a tool used to store data locally.
1685
+ * By default, this will create a Database object if the workload has been embedded.
1686
+ */
1687
+ static OfflineProviderFactory: (urlToScene: string, callbackManifestChecked: (checked: boolean) => any, disableManifestCheck: boolean) => IOfflineProvider;
1688
+ }