@babylonjs/core 5.26.1 → 5.27.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (433) hide show
  1. package/Animations/animatable.js +2 -1
  2. package/Animations/animatable.js.map +1 -1
  3. package/Animations/runtimeAnimation.js +1 -1
  4. package/Animations/runtimeAnimation.js.map +1 -1
  5. package/Audio/audioSceneComponent.js +2 -1
  6. package/Audio/audioSceneComponent.js.map +1 -1
  7. package/Audio/sound.js +70 -45
  8. package/Audio/sound.js.map +1 -1
  9. package/Audio/soundTrack.js +12 -6
  10. package/Audio/soundTrack.js.map +1 -1
  11. package/BakedVertexAnimation/bakedVertexAnimationManager.js +2 -1
  12. package/BakedVertexAnimation/bakedVertexAnimationManager.js.map +1 -1
  13. package/Behaviors/Cameras/autoRotationBehavior.js +1 -1
  14. package/Behaviors/Cameras/autoRotationBehavior.js.map +1 -1
  15. package/Behaviors/Meshes/followBehavior.js +2 -1
  16. package/Behaviors/Meshes/followBehavior.js.map +1 -1
  17. package/Behaviors/Meshes/handConstraintBehavior.js +2 -2
  18. package/Behaviors/Meshes/handConstraintBehavior.js.map +1 -1
  19. package/Bones/bone.js +2 -1
  20. package/Bones/bone.js.map +1 -1
  21. package/Bones/skeleton.js +3 -2
  22. package/Bones/skeleton.js.map +1 -1
  23. package/Cameras/Inputs/BaseCameraPointersInput.js +2 -2
  24. package/Cameras/Inputs/BaseCameraPointersInput.js.map +1 -1
  25. package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js +5 -3
  26. package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js.map +1 -1
  27. package/Cameras/Inputs/flyCameraMouseInput.js +2 -2
  28. package/Cameras/Inputs/flyCameraMouseInput.js.map +1 -1
  29. package/Cameras/Inputs/freeCameraMouseInput.js +2 -2
  30. package/Cameras/Inputs/freeCameraMouseInput.js.map +1 -1
  31. package/Cameras/arcRotateCamera.js +2 -1
  32. package/Cameras/arcRotateCamera.js.map +1 -1
  33. package/Cameras/camera.js +6 -4
  34. package/Cameras/camera.js.map +1 -1
  35. package/Compute/computeEffect.js +8 -5
  36. package/Compute/computeEffect.js.map +1 -1
  37. package/Compute/computeShader.js +12 -11
  38. package/Compute/computeShader.js.map +1 -1
  39. package/Culling/Octrees/octreeSceneComponent.js +2 -1
  40. package/Culling/Octrees/octreeSceneComponent.js.map +1 -1
  41. package/Culling/boundingBox.js +3 -2
  42. package/Culling/boundingBox.js.map +1 -1
  43. package/Culling/ray.js +2 -1
  44. package/Culling/ray.js.map +1 -1
  45. package/Debug/debugLayer.d.ts +3 -3
  46. package/Debug/debugLayer.js +2 -2
  47. package/Debug/debugLayer.js.map +1 -1
  48. package/Debug/directionalLightFrustumViewer.js +9 -7
  49. package/Debug/directionalLightFrustumViewer.js.map +1 -1
  50. package/Debug/rayHelper.js +2 -1
  51. package/Debug/rayHelper.js.map +1 -1
  52. package/Debug/skeletonViewer.js +29 -24
  53. package/Debug/skeletonViewer.js.map +1 -1
  54. package/DeviceInput/InputDevices/deviceSourceManager.js +5 -3
  55. package/DeviceInput/InputDevices/deviceSourceManager.js.map +1 -1
  56. package/DeviceInput/internalDeviceSourceManager.js +2 -1
  57. package/DeviceInput/internalDeviceSourceManager.js.map +1 -1
  58. package/DeviceInput/webDeviceInputSystem.js +12 -9
  59. package/DeviceInput/webDeviceInputSystem.js.map +1 -1
  60. package/Engines/Extensions/engine.rawTexture.js +4 -4
  61. package/Engines/Extensions/engine.rawTexture.js.map +1 -1
  62. package/Engines/Extensions/engine.readTexture.js +3 -2
  63. package/Engines/Extensions/engine.readTexture.js.map +1 -1
  64. package/Engines/Extensions/engine.views.js +2 -1
  65. package/Engines/Extensions/engine.views.js.map +1 -1
  66. package/Engines/Processors/shaderProcessor.js +11 -6
  67. package/Engines/Processors/shaderProcessor.js.map +1 -1
  68. package/Engines/WebGPU/Extensions/engine.cubeTexture.js +1 -1
  69. package/Engines/WebGPU/Extensions/engine.cubeTexture.js.map +1 -1
  70. package/Engines/WebGPU/Extensions/engine.dynamicTexture.js +2 -1
  71. package/Engines/WebGPU/Extensions/engine.dynamicTexture.js.map +1 -1
  72. package/Engines/WebGPU/Extensions/engine.multiRender.js +2 -1
  73. package/Engines/WebGPU/Extensions/engine.multiRender.js.map +1 -1
  74. package/Engines/WebGPU/Extensions/engine.query.js +4 -2
  75. package/Engines/WebGPU/Extensions/engine.query.js.map +1 -1
  76. package/Engines/WebGPU/Extensions/engine.rawTexture.js +4 -4
  77. package/Engines/WebGPU/Extensions/engine.rawTexture.js.map +1 -1
  78. package/Engines/WebGPU/Extensions/engine.renderTarget.js +2 -1
  79. package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
  80. package/Engines/WebGPU/Extensions/engine.storageBuffer.js +3 -2
  81. package/Engines/WebGPU/Extensions/engine.storageBuffer.js.map +1 -1
  82. package/Engines/WebGPU/Extensions/engine.textureSampler.js +2 -1
  83. package/Engines/WebGPU/Extensions/engine.textureSampler.js.map +1 -1
  84. package/Engines/WebGPU/Extensions/engine.videoTexture.js +2 -1
  85. package/Engines/WebGPU/Extensions/engine.videoTexture.js.map +1 -1
  86. package/Engines/WebGPU/webgpuCacheBindGroups.js +7 -6
  87. package/Engines/WebGPU/webgpuCacheBindGroups.js.map +1 -1
  88. package/Engines/WebGPU/webgpuCacheRenderPipeline.js +18 -14
  89. package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
  90. package/Engines/WebGPU/webgpuCacheSampler.js +4 -3
  91. package/Engines/WebGPU/webgpuCacheSampler.js.map +1 -1
  92. package/Engines/WebGPU/webgpuClearQuad.js +3 -2
  93. package/Engines/WebGPU/webgpuClearQuad.js.map +1 -1
  94. package/Engines/WebGPU/webgpuComputePipelineContext.js +2 -1
  95. package/Engines/WebGPU/webgpuComputePipelineContext.js.map +1 -1
  96. package/Engines/WebGPU/webgpuDepthCullingState.js +2 -2
  97. package/Engines/WebGPU/webgpuDepthCullingState.js.map +1 -1
  98. package/Engines/WebGPU/webgpuDrawContext.js +2 -1
  99. package/Engines/WebGPU/webgpuDrawContext.js.map +1 -1
  100. package/Engines/WebGPU/webgpuHardwareTexture.js +4 -3
  101. package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
  102. package/Engines/WebGPU/webgpuMaterialContext.js +5 -4
  103. package/Engines/WebGPU/webgpuMaterialContext.js.map +1 -1
  104. package/Engines/WebGPU/webgpuOcclusionQuery.js +5 -3
  105. package/Engines/WebGPU/webgpuOcclusionQuery.js.map +1 -1
  106. package/Engines/WebGPU/webgpuPipelineContext.js +4 -2
  107. package/Engines/WebGPU/webgpuPipelineContext.js.map +1 -1
  108. package/Engines/WebGPU/webgpuShaderProcessingContext.js +4 -2
  109. package/Engines/WebGPU/webgpuShaderProcessingContext.js.map +1 -1
  110. package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js +2 -1
  111. package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js.map +1 -1
  112. package/Engines/WebGPU/webgpuSnapshotRendering.js +3 -2
  113. package/Engines/WebGPU/webgpuSnapshotRendering.js.map +1 -1
  114. package/Engines/WebGPU/webgpuStencilStateComposer.js +2 -1
  115. package/Engines/WebGPU/webgpuStencilStateComposer.js.map +1 -1
  116. package/Engines/WebGPU/webgpuTextureHelper.js +40 -38
  117. package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
  118. package/Engines/engine.js +5 -3
  119. package/Engines/engine.js.map +1 -1
  120. package/Engines/nativeEngine.js +7 -5
  121. package/Engines/nativeEngine.js.map +1 -1
  122. package/Engines/renderTargetWrapper.js +14 -9
  123. package/Engines/renderTargetWrapper.js.map +1 -1
  124. package/Engines/thinEngine.js +29 -20
  125. package/Engines/thinEngine.js.map +1 -1
  126. package/Engines/webgpuEngine.js +87 -61
  127. package/Engines/webgpuEngine.js.map +1 -1
  128. package/Gamepads/gamepadManager.js +1 -1
  129. package/Gamepads/gamepadManager.js.map +1 -1
  130. package/Gizmos/axisDragGizmo.js +4 -2
  131. package/Gizmos/axisDragGizmo.js.map +1 -1
  132. package/Gizmos/axisScaleGizmo.js +6 -4
  133. package/Gizmos/axisScaleGizmo.js.map +1 -1
  134. package/Gizmos/gizmo.js +21 -6
  135. package/Gizmos/gizmo.js.map +1 -1
  136. package/Gizmos/gizmoManager.js +3 -2
  137. package/Gizmos/gizmoManager.js.map +1 -1
  138. package/Gizmos/planeDragGizmo.js +4 -2
  139. package/Gizmos/planeDragGizmo.js.map +1 -1
  140. package/Gizmos/planeRotationGizmo.js +4 -2
  141. package/Gizmos/planeRotationGizmo.js.map +1 -1
  142. package/Helpers/videoDome.js +2 -1
  143. package/Helpers/videoDome.js.map +1 -1
  144. package/Inputs/scene.inputManager.js +1 -1
  145. package/Inputs/scene.inputManager.js.map +1 -1
  146. package/Layers/effectLayer.js +5 -3
  147. package/Layers/effectLayer.js.map +1 -1
  148. package/Layers/glowLayer.d.ts +5 -0
  149. package/Layers/glowLayer.js +25 -11
  150. package/Layers/glowLayer.js.map +1 -1
  151. package/Layers/highlightLayer.js +2 -1
  152. package/Layers/highlightLayer.js.map +1 -1
  153. package/LensFlares/lensFlareSystem.js +2 -1
  154. package/LensFlares/lensFlareSystem.js.map +1 -1
  155. package/Lights/Shadows/cascadedShadowGenerator.js +25 -21
  156. package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
  157. package/Lights/Shadows/shadowGenerator.js +13 -8
  158. package/Lights/Shadows/shadowGenerator.js.map +1 -1
  159. package/Loading/Plugins/babylonFileLoader.js +5 -4
  160. package/Loading/Plugins/babylonFileLoader.js.map +1 -1
  161. package/Loading/sceneLoader.js +1 -1
  162. package/Loading/sceneLoader.js.map +1 -1
  163. package/Materials/Node/Blocks/Dual/imageSourceBlock.js +2 -1
  164. package/Materials/Node/Blocks/Dual/imageSourceBlock.js.map +1 -1
  165. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js +2 -1
  166. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js.map +1 -1
  167. package/Materials/Node/Blocks/Dual/textureBlock.js +10 -6
  168. package/Materials/Node/Blocks/Dual/textureBlock.js.map +1 -1
  169. package/Materials/Node/Blocks/Fragment/TBNBlock.js +3 -2
  170. package/Materials/Node/Blocks/Fragment/TBNBlock.js.map +1 -1
  171. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js +2 -1
  172. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
  173. package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js +2 -1
  174. package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js.map +1 -1
  175. package/Materials/Node/Blocks/Input/inputBlock.js +2 -1
  176. package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
  177. package/Materials/Node/Blocks/PBR/clearCoatBlock.js +26 -24
  178. package/Materials/Node/Blocks/PBR/clearCoatBlock.js.map +1 -1
  179. package/Materials/Node/Blocks/PBR/iridescenceBlock.js +3 -3
  180. package/Materials/Node/Blocks/PBR/iridescenceBlock.js.map +1 -1
  181. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +48 -44
  182. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
  183. package/Materials/Node/Blocks/PBR/reflectionBlock.js +2 -1
  184. package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
  185. package/Materials/Node/Blocks/PBR/refractionBlock.js +2 -1
  186. package/Materials/Node/Blocks/PBR/refractionBlock.js.map +1 -1
  187. package/Materials/Node/Blocks/PBR/sheenBlock.js +13 -13
  188. package/Materials/Node/Blocks/PBR/sheenBlock.js.map +1 -1
  189. package/Materials/Node/Blocks/PBR/subSurfaceBlock.js +27 -26
  190. package/Materials/Node/Blocks/PBR/subSurfaceBlock.js.map +1 -1
  191. package/Materials/Node/Blocks/Vertex/instancesBlock.js +2 -2
  192. package/Materials/Node/Blocks/Vertex/instancesBlock.js.map +1 -1
  193. package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js +6 -6
  194. package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js.map +1 -1
  195. package/Materials/Node/Blocks/cloudBlock.js +3 -2
  196. package/Materials/Node/Blocks/cloudBlock.js.map +1 -1
  197. package/Materials/Node/Blocks/colorMergerBlock.js +5 -4
  198. package/Materials/Node/Blocks/colorMergerBlock.js.map +1 -1
  199. package/Materials/Node/Blocks/customBlock.js +4 -3
  200. package/Materials/Node/Blocks/customBlock.js.map +1 -1
  201. package/Materials/Node/Blocks/vectorMergerBlock.js +5 -4
  202. package/Materials/Node/Blocks/vectorMergerBlock.js.map +1 -1
  203. package/Materials/Node/nodeMaterial.js +7 -6
  204. package/Materials/Node/nodeMaterial.js.map +1 -1
  205. package/Materials/Node/nodeMaterialBlock.js +4 -3
  206. package/Materials/Node/nodeMaterialBlock.js.map +1 -1
  207. package/Materials/Node/nodeMaterialDecorator.js +1 -1
  208. package/Materials/Node/nodeMaterialDecorator.js.map +1 -1
  209. package/Materials/PBR/pbrAnisotropicConfiguration.js +2 -0
  210. package/Materials/PBR/pbrAnisotropicConfiguration.js.map +1 -1
  211. package/Materials/PBR/pbrBaseMaterial.js +25 -19
  212. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  213. package/Materials/PBR/pbrClearCoatConfiguration.js +16 -6
  214. package/Materials/PBR/pbrClearCoatConfiguration.js.map +1 -1
  215. package/Materials/PBR/pbrIridescenceConfiguration.js +9 -4
  216. package/Materials/PBR/pbrIridescenceConfiguration.js.map +1 -1
  217. package/Materials/PBR/pbrSheenConfiguration.js +10 -4
  218. package/Materials/PBR/pbrSheenConfiguration.js.map +1 -1
  219. package/Materials/PBR/pbrSubSurfaceConfiguration.js +22 -0
  220. package/Materials/PBR/pbrSubSurfaceConfiguration.js.map +1 -1
  221. package/Materials/Textures/Loaders/envTextureLoader.js +2 -2
  222. package/Materials/Textures/Loaders/envTextureLoader.js.map +1 -1
  223. package/Materials/Textures/Packer/packer.js +14 -13
  224. package/Materials/Textures/Packer/packer.js.map +1 -1
  225. package/Materials/Textures/Procedurals/customProceduralTexture.d.ts +2 -1
  226. package/Materials/Textures/Procedurals/customProceduralTexture.js.map +1 -1
  227. package/Materials/Textures/Procedurals/noiseProceduralTexture.js +2 -1
  228. package/Materials/Textures/Procedurals/noiseProceduralTexture.js.map +1 -1
  229. package/Materials/Textures/Procedurals/proceduralTexture.js +7 -4
  230. package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
  231. package/Materials/Textures/cubeTexture.js +8 -4
  232. package/Materials/Textures/cubeTexture.js.map +1 -1
  233. package/Materials/Textures/hdrCubeTexture.js +4 -2
  234. package/Materials/Textures/hdrCubeTexture.js.map +1 -1
  235. package/Materials/Textures/internalTexture.js +4 -2
  236. package/Materials/Textures/internalTexture.js.map +1 -1
  237. package/Materials/Textures/mirrorTexture.js +6 -3
  238. package/Materials/Textures/mirrorTexture.js.map +1 -1
  239. package/Materials/Textures/multiRenderTarget.js +6 -4
  240. package/Materials/Textures/multiRenderTarget.js.map +1 -1
  241. package/Materials/Textures/rawTexture.js +1 -1
  242. package/Materials/Textures/rawTexture.js.map +1 -1
  243. package/Materials/Textures/renderTargetTexture.js +26 -15
  244. package/Materials/Textures/renderTargetTexture.js.map +1 -1
  245. package/Materials/Textures/texture.d.ts +7 -2
  246. package/Materials/Textures/texture.js +49 -41
  247. package/Materials/Textures/texture.js.map +1 -1
  248. package/Materials/Textures/thinRenderTargetTexture.js +4 -2
  249. package/Materials/Textures/thinRenderTargetTexture.js.map +1 -1
  250. package/Materials/Textures/videoTexture.js +3 -3
  251. package/Materials/Textures/videoTexture.js.map +1 -1
  252. package/Materials/drawWrapper.js +4 -2
  253. package/Materials/drawWrapper.js.map +1 -1
  254. package/Materials/effect.js +15 -10
  255. package/Materials/effect.js.map +1 -1
  256. package/Materials/material.d.ts +14 -0
  257. package/Materials/material.detailMapConfiguration.js +2 -1
  258. package/Materials/material.detailMapConfiguration.js.map +1 -1
  259. package/Materials/material.js +35 -3
  260. package/Materials/material.js.map +1 -1
  261. package/Materials/materialDefines.js +6 -5
  262. package/Materials/materialDefines.js.map +1 -1
  263. package/Materials/materialHelper.js +1 -1
  264. package/Materials/materialHelper.js.map +1 -1
  265. package/Materials/materialPluginManager.js +3 -2
  266. package/Materials/materialPluginManager.js.map +1 -1
  267. package/Materials/multiMaterial.js +2 -1
  268. package/Materials/multiMaterial.js.map +1 -1
  269. package/Materials/shaderMaterial.js +12 -9
  270. package/Materials/shaderMaterial.js.map +1 -1
  271. package/Materials/shadowDepthWrapper.js +13 -8
  272. package/Materials/shadowDepthWrapper.js.map +1 -1
  273. package/Materials/standardMaterial.js +12 -10
  274. package/Materials/standardMaterial.js.map +1 -1
  275. package/Materials/uniformBuffer.js +1 -1
  276. package/Materials/uniformBuffer.js.map +1 -1
  277. package/Maths/math.polar.d.ts +2 -2
  278. package/Maths/math.polar.js +4 -4
  279. package/Maths/math.polar.js.map +1 -1
  280. package/Maths/math.vector.d.ts +69 -7
  281. package/Maths/math.vector.js +72 -9
  282. package/Maths/math.vector.js.map +1 -1
  283. package/Meshes/Builders/groundBuilder.js +1 -1
  284. package/Meshes/Builders/groundBuilder.js.map +1 -1
  285. package/Meshes/abstractMesh.d.ts +8 -0
  286. package/Meshes/abstractMesh.js +20 -5
  287. package/Meshes/abstractMesh.js.map +1 -1
  288. package/Meshes/csg.js +2 -1
  289. package/Meshes/csg.js.map +1 -1
  290. package/Meshes/instancedMesh.js +2 -1
  291. package/Meshes/instancedMesh.js.map +1 -1
  292. package/Meshes/mesh.js +25 -13
  293. package/Meshes/mesh.js.map +1 -1
  294. package/Meshes/mesh.vertexData.js +4 -3
  295. package/Meshes/mesh.vertexData.js.map +1 -1
  296. package/Meshes/subMesh.js +14 -8
  297. package/Meshes/subMesh.js.map +1 -1
  298. package/Meshes/thinInstanceMesh.js +18 -12
  299. package/Meshes/thinInstanceMesh.js.map +1 -1
  300. package/Meshes/transformNode.js +4 -3
  301. package/Meshes/transformNode.js.map +1 -1
  302. package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js +2 -1
  303. package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js.map +1 -1
  304. package/Misc/PerformanceViewer/performanceViewerCollectionStrategies.js +12 -8
  305. package/Misc/PerformanceViewer/performanceViewerCollectionStrategies.js.map +1 -1
  306. package/Misc/PerformanceViewer/performanceViewerCollector.js +3 -2
  307. package/Misc/PerformanceViewer/performanceViewerCollector.js.map +1 -1
  308. package/Misc/arrayTools.js +1 -1
  309. package/Misc/arrayTools.js.map +1 -1
  310. package/Misc/computePressure.js +9 -6
  311. package/Misc/computePressure.js.map +1 -1
  312. package/Misc/dataStorage.js +1 -1
  313. package/Misc/dataStorage.js.map +1 -1
  314. package/Misc/environmentTextureTools.js +2 -1
  315. package/Misc/environmentTextureTools.js.map +1 -1
  316. package/Misc/fileTools.js +31 -8
  317. package/Misc/fileTools.js.map +1 -1
  318. package/Misc/logger.js +2 -1
  319. package/Misc/logger.js.map +1 -1
  320. package/Misc/minMaxReducer.js +3 -2
  321. package/Misc/minMaxReducer.js.map +1 -1
  322. package/Misc/sceneRecorder.js +1 -1
  323. package/Misc/sceneRecorder.js.map +1 -1
  324. package/Misc/screenshotTools.js +2 -12
  325. package/Misc/screenshotTools.js.map +1 -1
  326. package/Misc/textureTools.js +3 -3
  327. package/Misc/textureTools.js.map +1 -1
  328. package/Misc/timer.js +5 -3
  329. package/Misc/timer.js.map +1 -1
  330. package/Misc/tools.d.ts +2 -8
  331. package/Misc/tools.js +6 -6
  332. package/Misc/tools.js.map +1 -1
  333. package/Misc/trajectoryClassifier.js +3 -3
  334. package/Misc/trajectoryClassifier.js.map +1 -1
  335. package/Particles/EmitterTypes/meshParticleEmitter.js +2 -1
  336. package/Particles/EmitterTypes/meshParticleEmitter.js.map +1 -1
  337. package/Particles/computeShaderParticleSystem.js +6 -3
  338. package/Particles/computeShaderParticleSystem.js.map +1 -1
  339. package/Particles/gpuParticleSystem.js +13 -8
  340. package/Particles/gpuParticleSystem.js.map +1 -1
  341. package/Particles/particleSystem.js +22 -14
  342. package/Particles/particleSystem.js.map +1 -1
  343. package/Particles/particleSystemComponent.js +2 -1
  344. package/Particles/particleSystemComponent.js.map +1 -1
  345. package/Particles/pointsCloudSystem.js +7 -4
  346. package/Particles/pointsCloudSystem.js.map +1 -1
  347. package/Particles/solidParticleSystem.js +2 -2
  348. package/Particles/solidParticleSystem.js.map +1 -1
  349. package/Particles/webgl2ParticleSystem.js +2 -1
  350. package/Particles/webgl2ParticleSystem.js.map +1 -1
  351. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js +5 -4
  352. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js.map +1 -1
  353. package/PostProcesses/blackAndWhitePostProcess.d.ts +1 -1
  354. package/PostProcesses/blackAndWhitePostProcess.js.map +1 -1
  355. package/PostProcesses/colorCorrectionPostProcess.d.ts +1 -1
  356. package/PostProcesses/colorCorrectionPostProcess.js +2 -1
  357. package/PostProcesses/colorCorrectionPostProcess.js.map +1 -1
  358. package/PostProcesses/postProcess.js +8 -5
  359. package/PostProcesses/postProcess.js.map +1 -1
  360. package/PostProcesses/postProcessManager.js +6 -4
  361. package/PostProcesses/postProcessManager.js.map +1 -1
  362. package/PostProcesses/refractionPostProcess.d.ts +2 -1
  363. package/PostProcesses/refractionPostProcess.js.map +1 -1
  364. package/PostProcesses/screenSpaceReflectionPostProcess.js +1 -1
  365. package/PostProcesses/screenSpaceReflectionPostProcess.js.map +1 -1
  366. package/PostProcesses/tonemapPostProcess.d.ts +2 -1
  367. package/PostProcesses/tonemapPostProcess.js.map +1 -1
  368. package/PostProcesses/volumetricLightScatteringPostProcess.d.ts +2 -1
  369. package/PostProcesses/volumetricLightScatteringPostProcess.js +7 -4
  370. package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
  371. package/PostProcesses/vrDistortionCorrectionPostProcess.d.ts +2 -1
  372. package/PostProcesses/vrDistortionCorrectionPostProcess.js.map +1 -1
  373. package/PostProcesses/vrMultiviewToSingleviewPostProcess.d.ts +2 -1
  374. package/PostProcesses/vrMultiviewToSingleviewPostProcess.js +3 -2
  375. package/PostProcesses/vrMultiviewToSingleviewPostProcess.js.map +1 -1
  376. package/Probes/reflectionProbe.js +4 -2
  377. package/Probes/reflectionProbe.js.map +1 -1
  378. package/Rendering/boundingBoxRenderer.js +3 -2
  379. package/Rendering/boundingBoxRenderer.js.map +1 -1
  380. package/Rendering/depthPeelingRenderer.d.ts +12 -0
  381. package/Rendering/depthPeelingRenderer.js +30 -6
  382. package/Rendering/depthPeelingRenderer.js.map +1 -1
  383. package/Rendering/depthPeelingSceneComponent.js +4 -2
  384. package/Rendering/depthPeelingSceneComponent.js.map +1 -1
  385. package/Rendering/depthRenderer.js +10 -6
  386. package/Rendering/depthRenderer.js.map +1 -1
  387. package/Rendering/edgesRenderer.js +11 -8
  388. package/Rendering/edgesRenderer.js.map +1 -1
  389. package/Rendering/outlineRenderer.js +2 -2
  390. package/Rendering/outlineRenderer.js.map +1 -1
  391. package/Rendering/prePassRenderer.js +4 -2
  392. package/Rendering/prePassRenderer.js.map +1 -1
  393. package/Shaders/pbr.fragment.js +4 -1
  394. package/Shaders/pbr.fragment.js.map +1 -1
  395. package/Sprites/spriteManager.js +2 -1
  396. package/Sprites/spriteManager.js.map +1 -1
  397. package/Sprites/spriteRenderer.js +2 -1
  398. package/Sprites/spriteRenderer.js.map +1 -1
  399. package/States/stencilStateComposer.js +4 -2
  400. package/States/stencilStateComposer.js.map +1 -1
  401. package/XR/features/WebXRAnchorSystem.js +2 -1
  402. package/XR/features/WebXRAnchorSystem.js.map +1 -1
  403. package/XR/features/WebXRControllerMovement.js +7 -6
  404. package/XR/features/WebXRControllerMovement.js.map +1 -1
  405. package/XR/features/WebXRControllerPhysics.js +6 -4
  406. package/XR/features/WebXRControllerPhysics.js.map +1 -1
  407. package/XR/features/WebXRControllerPointerSelection.js +2 -1
  408. package/XR/features/WebXRControllerPointerSelection.js.map +1 -1
  409. package/XR/features/WebXRHandTracking.js +26 -18
  410. package/XR/features/WebXRHandTracking.js.map +1 -1
  411. package/XR/features/WebXRLayers.js +1 -1
  412. package/XR/features/WebXRLayers.js.map +1 -1
  413. package/XR/features/WebXRLightEstimation.js +6 -3
  414. package/XR/features/WebXRLightEstimation.js.map +1 -1
  415. package/XR/features/WebXRMeshDetector.js +2 -1
  416. package/XR/features/WebXRMeshDetector.js.map +1 -1
  417. package/XR/features/WebXRNearInteraction.js +7 -4
  418. package/XR/features/WebXRNearInteraction.js.map +1 -1
  419. package/XR/features/WebXRPlaneDetector.js +2 -1
  420. package/XR/features/WebXRPlaneDetector.js.map +1 -1
  421. package/XR/native/nativeXRFrame.js +2 -1
  422. package/XR/native/nativeXRFrame.js.map +1 -1
  423. package/XR/webXRCamera.js +2 -1
  424. package/XR/webXRCamera.js.map +1 -1
  425. package/XR/webXRExperienceHelper.js +7 -5
  426. package/XR/webXRExperienceHelper.js.map +1 -1
  427. package/XR/webXRInputSource.js +2 -1
  428. package/XR/webXRInputSource.js.map +1 -1
  429. package/XR/webXRSessionManager.js +27 -14
  430. package/XR/webXRSessionManager.js.map +1 -1
  431. package/package.json +1 -1
  432. package/scene.js +17 -11
  433. package/scene.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"rawTexture.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/Materials/Textures/rawTexture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,4CAA4C,CAAC;AAMpD;;;;GAIG;AACH,MAAM,OAAO,UAAW,SAAQ,OAAO;IACnC;;;;;;;;;;;;;;;;OAgBG;IACH,YACI,IAA+B,EAC/B,KAAa,EACb,MAAc;IACd;;OAEG;IACI,MAAc,EACrB,aAA2C,EAC3C,kBAA2B,IAAI,EAC/B,UAAmB,KAAK,EACxB,eAAuB,SAAS,CAAC,8BAA8B,EAC/D,OAAe,SAAS,CAAC,wBAA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aAA2C,EAC3C,kBAA2B,IAAI,EAC/B,UAAmB,KAAK,EACxB,eAAuB,OAAO,CAAC,sBAAsB,EACrD,OAAe,SAAS,CAAC,iBAAiB;QAE1C,OAAO,IAAI,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;IACvI,CAAC;IAED;;;;;;;;;;;OAWG;IACI,MAAM,CAAC,qBAAqB,CAC/B,IAA+B,EAC/B,KAAa,EACb,MAAc,EACd,aAA2C,EAC3C,kBAA2B,IAAI,EAC/B,UAAmB,KAAK,EACxB,eAAuB,OAAO,CAAC,sBAAsB,EACrD,OAAe,SAAS,CAAC,iBAAiB;QAE1C,OAAO,IAAI,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,CAAC,4BAA4B,CAAC,CAAC;IAC/K,CAAC;CACJ","sourcesContent":["import { Texture } from \"./texture\";\r\nimport { Constants } from \"../../Engines/constants\";\r\nimport \"../../Engines/Extensions/engine.rawTexture\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { ThinEngine } from \"../../Engines/thinEngine\";\r\n\r\ndeclare type Scene = import(\"../../scene\").Scene;\r\n\r\n/**\r\n * Raw texture can help creating a texture directly from an array of data.\r\n * This can be super useful if you either get the data from an uncompressed source or\r\n * if you wish to create your texture pixel by pixel.\r\n */\r\nexport class RawTexture extends Texture {\r\n /**\r\n * Instantiates a new RawTexture.\r\n * Raw texture can help creating a texture directly from an array of data.\r\n * This can be super useful if you either get the data from an uncompressed source or\r\n * if you wish to create your texture pixel by pixel.\r\n * @param data define the array of data to use to create the texture (null to create an empty texture)\r\n * @param width define the width of the texture\r\n * @param height define the height of the texture\r\n * @param format define the format of the data (RGB, RGBA... Engine.TEXTUREFORMAT_xxx)\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps define whether mip maps should be generated or not\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).\r\n */\r\n constructor(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n /**\r\n * Define the format of the data (RGB, RGBA... Engine.TEXTUREFORMAT_xxx)\r\n */\r\n public format: number,\r\n sceneOrEngine: Nullable<Scene | ThinEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n creationFlags?: number,\r\n useSRGBBuffer?: boolean\r\n ) {\r\n super(null, sceneOrEngine, !generateMipMaps, invertY, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, creationFlags);\r\n\r\n if (!this._engine) {\r\n return;\r\n }\r\n\r\n if (!this._engine._caps.textureFloatLinearFiltering && type === Constants.TEXTURETYPE_FLOAT) {\r\n samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n }\r\n if (!this._engine._caps.textureHalfFloatLinearFiltering && type === Constants.TEXTURETYPE_HALF_FLOAT) {\r\n samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n }\r\n\r\n this._texture = this._engine.createRawTexture(data, width, height, format, generateMipMaps, invertY, samplingMode, null, type, creationFlags ?? 0, useSRGBBuffer ?? false);\r\n\r\n this.wrapU = Texture.CLAMP_ADDRESSMODE;\r\n this.wrapV = Texture.CLAMP_ADDRESSMODE;\r\n }\r\n\r\n /**\r\n * Updates the texture underlying data.\r\n * @param data Define the new data of the texture\r\n */\r\n public update(data: ArrayBufferView): void {\r\n this._getEngine()!.updateRawTexture(this._texture, data, this._texture!.format, this._texture!.invertY, null, this._texture!.type, this._texture!._useSRGBBuffer);\r\n }\r\n\r\n /**\r\n * Creates a luminance texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @returns the luminance texture\r\n */\r\n public static CreateLuminanceTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | ThinEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_LUMINANCE, sceneOrEngine, generateMipMaps, invertY, samplingMode);\r\n }\r\n\r\n /**\r\n * Creates a luminance alpha texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @returns the luminance alpha texture\r\n */\r\n public static CreateLuminanceAlphaTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | ThinEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_LUMINANCE_ALPHA, sceneOrEngine, generateMipMaps, invertY, samplingMode);\r\n }\r\n\r\n /**\r\n * Creates an alpha texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @returns the alpha texture\r\n */\r\n public static CreateAlphaTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | ThinEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_ALPHA, sceneOrEngine, generateMipMaps, invertY, samplingMode);\r\n }\r\n\r\n /**\r\n * Creates a RGB texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).\r\n * @returns the RGB alpha texture\r\n */\r\n public static CreateRGBTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | ThinEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n creationFlags: number = 0,\r\n useSRGBBuffer: boolean = false\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_RGB, sceneOrEngine, generateMipMaps, invertY, samplingMode, type, creationFlags, useSRGBBuffer);\r\n }\r\n\r\n /**\r\n * Creates a RGBA texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).\r\n * @returns the RGBA texture\r\n */\r\n public static CreateRGBATexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | ThinEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n creationFlags: number = 0,\r\n useSRGBBuffer: boolean = false\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_RGBA, sceneOrEngine, generateMipMaps, invertY, samplingMode, type, creationFlags, useSRGBBuffer);\r\n }\r\n\r\n /**\r\n * Creates a RGBA storage texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).\r\n * @returns the RGBA texture\r\n */\r\n public static CreateRGBAStorageTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | ThinEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n useSRGBBuffer: boolean = false\r\n ): RawTexture {\r\n return new RawTexture(\r\n data,\r\n width,\r\n height,\r\n Constants.TEXTUREFORMAT_RGBA,\r\n sceneOrEngine,\r\n generateMipMaps,\r\n invertY,\r\n samplingMode,\r\n type,\r\n Constants.TEXTURE_CREATIONFLAG_STORAGE,\r\n useSRGBBuffer\r\n );\r\n }\r\n\r\n /**\r\n * Creates a R texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @returns the R texture\r\n */\r\n public static CreateRTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | ThinEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_FLOAT\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_R, sceneOrEngine, generateMipMaps, invertY, samplingMode, type);\r\n }\r\n\r\n /**\r\n * Creates a R storage texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @returns the R texture\r\n */\r\n public static CreateRStorageTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | ThinEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_FLOAT\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_R, sceneOrEngine, generateMipMaps, invertY, samplingMode, type, Constants.TEXTURE_CREATIONFLAG_STORAGE);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"rawTexture.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/Materials/Textures/rawTexture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,4CAA4C,CAAC;AAMpD;;;;GAIG;AACH,MAAM,OAAO,UAAW,SAAQ,OAAO;IACnC;;;;;;;;;;;;;;;;OAgBG;IACH,YACI,IAA+B,EAC/B,KAAa,EACb,MAAc;IACd;;OAEG;IACI,MAAc,EACrB,aAA2C,EAC3C,kBAA2B,IAAI,EAC/B,UAAmB,KAAK,EACxB,eAAuB,SAAS,CAAC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IAED;;;;;;;;;;;OAWG;IACI,MAAM,CAAC,cAAc,CACxB,IAA+B,EAC/B,KAAa,EACb,MAAc,EACd,aAA2C,EAC3C,kBAA2B,IAAI,EAC/B,UAAmB,KAAK,EACxB,eAAuB,OAAO,CAAC,sBAAsB,EACrD,OAAe,SAAS,CAAC,iBAAiB;QAE1C,OAAO,IAAI,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;IACvI,CAAC;IAED;;;;;;;;;;;OAWG;IACI,MAAM,CAAC,qBAAqB,CAC/B,IAA+B,EAC/B,KAAa,EACb,MAAc,EACd,aAA2C,EAC3C,kBAA2B,IAAI,EAC/B,UAAmB,KAAK,EACxB,eAAuB,OAAO,CAAC,sBAAsB,EACrD,OAAe,SAAS,CAAC,iBAAiB;QAE1C,OAAO,IAAI,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,CAAC,4BAA4B,CAAC,CAAC;IAC/K,CAAC;CACJ","sourcesContent":["import { Texture } from \"./texture\";\r\nimport { Constants } from \"../../Engines/constants\";\r\nimport \"../../Engines/Extensions/engine.rawTexture\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { ThinEngine } from \"../../Engines/thinEngine\";\r\n\r\ndeclare type Scene = import(\"../../scene\").Scene;\r\n\r\n/**\r\n * Raw texture can help creating a texture directly from an array of data.\r\n * This can be super useful if you either get the data from an uncompressed source or\r\n * if you wish to create your texture pixel by pixel.\r\n */\r\nexport class RawTexture extends Texture {\r\n /**\r\n * Instantiates a new RawTexture.\r\n * Raw texture can help creating a texture directly from an array of data.\r\n * This can be super useful if you either get the data from an uncompressed source or\r\n * if you wish to create your texture pixel by pixel.\r\n * @param data define the array of data to use to create the texture (null to create an empty texture)\r\n * @param width define the width of the texture\r\n * @param height define the height of the texture\r\n * @param format define the format of the data (RGB, RGBA... Engine.TEXTUREFORMAT_xxx)\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps define whether mip maps should be generated or not\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).\r\n */\r\n constructor(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n /**\r\n * Define the format of the data (RGB, RGBA... Engine.TEXTUREFORMAT_xxx)\r\n */\r\n public format: number,\r\n sceneOrEngine: Nullable<Scene | ThinEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n creationFlags?: number,\r\n useSRGBBuffer?: boolean\r\n ) {\r\n super(null, sceneOrEngine, !generateMipMaps, invertY, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, creationFlags);\r\n\r\n if (!this._engine) {\r\n return;\r\n }\r\n\r\n if (!this._engine._caps.textureFloatLinearFiltering && type === Constants.TEXTURETYPE_FLOAT) {\r\n samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n }\r\n if (!this._engine._caps.textureHalfFloatLinearFiltering && type === Constants.TEXTURETYPE_HALF_FLOAT) {\r\n samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n }\r\n\r\n this._texture = this._engine.createRawTexture(data, width, height, format, generateMipMaps, invertY, samplingMode, null, type, creationFlags ?? 0, useSRGBBuffer ?? false);\r\n\r\n this.wrapU = Texture.CLAMP_ADDRESSMODE;\r\n this.wrapV = Texture.CLAMP_ADDRESSMODE;\r\n }\r\n\r\n /**\r\n * Updates the texture underlying data.\r\n * @param data Define the new data of the texture\r\n */\r\n public update(data: ArrayBufferView): void {\r\n this._getEngine()!.updateRawTexture(this._texture, data, this._texture!.format, this._texture!.invertY, null, this._texture!.type, this._texture!._useSRGBBuffer);\r\n }\r\n\r\n /**\r\n * Creates a luminance texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @returns the luminance texture\r\n */\r\n public static CreateLuminanceTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | ThinEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_LUMINANCE, sceneOrEngine, generateMipMaps, invertY, samplingMode);\r\n }\r\n\r\n /**\r\n * Creates a luminance alpha texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @returns the luminance alpha texture\r\n */\r\n public static CreateLuminanceAlphaTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | ThinEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_LUMINANCE_ALPHA, sceneOrEngine, generateMipMaps, invertY, samplingMode);\r\n }\r\n\r\n /**\r\n * Creates an alpha texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @returns the alpha texture\r\n */\r\n public static CreateAlphaTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | ThinEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_ALPHA, sceneOrEngine, generateMipMaps, invertY, samplingMode);\r\n }\r\n\r\n /**\r\n * Creates a RGB texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).\r\n * @returns the RGB alpha texture\r\n */\r\n public static CreateRGBTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | ThinEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n creationFlags: number = 0,\r\n useSRGBBuffer: boolean = false\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_RGB, sceneOrEngine, generateMipMaps, invertY, samplingMode, type, creationFlags, useSRGBBuffer);\r\n }\r\n\r\n /**\r\n * Creates a RGBA texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).\r\n * @returns the RGBA texture\r\n */\r\n public static CreateRGBATexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | ThinEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n creationFlags: number = 0,\r\n useSRGBBuffer: boolean = false\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_RGBA, sceneOrEngine, generateMipMaps, invertY, samplingMode, type, creationFlags, useSRGBBuffer);\r\n }\r\n\r\n /**\r\n * Creates a RGBA storage texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).\r\n * @returns the RGBA texture\r\n */\r\n public static CreateRGBAStorageTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | ThinEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n useSRGBBuffer: boolean = false\r\n ): RawTexture {\r\n return new RawTexture(\r\n data,\r\n width,\r\n height,\r\n Constants.TEXTUREFORMAT_RGBA,\r\n sceneOrEngine,\r\n generateMipMaps,\r\n invertY,\r\n samplingMode,\r\n type,\r\n Constants.TEXTURE_CREATIONFLAG_STORAGE,\r\n useSRGBBuffer\r\n );\r\n }\r\n\r\n /**\r\n * Creates a R texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @returns the R texture\r\n */\r\n public static CreateRTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | ThinEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_FLOAT\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_R, sceneOrEngine, generateMipMaps, invertY, samplingMode, type);\r\n }\r\n\r\n /**\r\n * Creates a R storage texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @returns the R texture\r\n */\r\n public static CreateRStorageTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | ThinEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_FLOAT\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_R, sceneOrEngine, generateMipMaps, invertY, samplingMode, type, Constants.TEXTURE_CREATIONFLAG_STORAGE);\r\n }\r\n}\r\n"]}
@@ -37,12 +37,14 @@ export class RenderTargetTexture extends Texture {
37
37
  * @param useSRGBBuffer True to create a SRGB texture
38
38
  */
39
39
  constructor(name, size, scene, generateMipMaps, doNotChangeAspectRatio = true, type = 0, isCube = false, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, generateDepthBuffer = true, generateStencilBuffer = false, isMulti = false, format = 5, delayAllocation = false, samples, creationFlags, noColorTarget = false, useSRGBBuffer = false) {
40
+ var _a;
40
41
  super(null, scene, !generateMipMaps, undefined, samplingMode, undefined, undefined, undefined, undefined, format);
41
42
  this._unObserveRenderList = null;
42
43
  this._renderListHasChanged = (_functionName, previousLength) => {
44
+ var _a;
43
45
  const newLength = this._renderList ? this._renderList.length : 0;
44
46
  if ((previousLength === 0 && newLength > 0) || newLength === 0) {
45
- this.getScene()?.meshes.forEach((mesh) => {
47
+ (_a = this.getScene()) === null || _a === void 0 ? void 0 : _a.meshes.forEach((mesh) => {
46
48
  mesh._markSubMeshesAsLightDirty();
47
49
  });
48
50
  }
@@ -125,7 +127,7 @@ export class RenderTargetTexture extends Texture {
125
127
  this._renderTargetOptions = {
126
128
  generateMipMaps: generateMipMaps,
127
129
  type: type,
128
- format: this._format ?? undefined,
130
+ format: (_a = this._format) !== null && _a !== void 0 ? _a : undefined,
129
131
  samplingMode: this.samplingMode,
130
132
  generateDepthBuffer: generateDepthBuffer,
131
133
  generateStencilBuffer: generateStencilBuffer,
@@ -292,7 +294,8 @@ export class RenderTargetTexture extends Texture {
292
294
  * Otherwise, return null.
293
295
  */
294
296
  get depthStencilTexture() {
295
- return this._renderTarget?._depthStencilTexture ?? null;
297
+ var _a, _b;
298
+ return (_b = (_a = this._renderTarget) === null || _a === void 0 ? void 0 : _a._depthStencilTexture) !== null && _b !== void 0 ? _b : null;
296
299
  }
297
300
  /**
298
301
  * Creates a depth stencil texture.
@@ -304,7 +307,8 @@ export class RenderTargetTexture extends Texture {
304
307
  * @param format format of the depth texture (default: 14)
305
308
  */
306
309
  createDepthStencilTexture(comparisonFunction = 0, bilinearFiltering = true, generateStencil = false, samples = 1, format = 14) {
307
- this._renderTarget?.createDepthStencilTexture(comparisonFunction, bilinearFiltering, generateStencil, samples, format);
310
+ var _a;
311
+ (_a = this._renderTarget) === null || _a === void 0 ? void 0 : _a.createDepthStencilTexture(comparisonFunction, bilinearFiltering, generateStencil, samples, format);
308
312
  }
309
313
  _releaseRenderPassId() {
310
314
  if (this._scene) {
@@ -342,7 +346,8 @@ export class RenderTargetTexture extends Texture {
342
346
  * It defaults to one meaning no MSAA has been enabled.
343
347
  */
344
348
  get samples() {
345
- return this._renderTarget?.samples ?? this._samples;
349
+ var _a, _b;
350
+ return (_b = (_a = this._renderTarget) === null || _a === void 0 ? void 0 : _a.samples) !== null && _b !== void 0 ? _b : this._samples;
346
351
  }
347
352
  set samples(value) {
348
353
  if (this._renderTarget) {
@@ -506,8 +511,9 @@ export class RenderTargetTexture extends Texture {
506
511
  * - or an object containing a ratio { ratio: number }
507
512
  */
508
513
  resize(size) {
514
+ var _a;
509
515
  const wasCube = this.isCube;
510
- this._renderTarget?.dispose();
516
+ (_a = this._renderTarget) === null || _a === void 0 ? void 0 : _a.dispose();
511
517
  this._renderTarget = null;
512
518
  const scene = this.getScene();
513
519
  if (!scene) {
@@ -544,6 +550,7 @@ export class RenderTargetTexture extends Texture {
544
550
  return this._render(false, false, true);
545
551
  }
546
552
  _render(useCameraPostProcess = false, dumpForDebug = false, checkReadiness = false) {
553
+ var _a;
547
554
  const scene = this.getScene();
548
555
  if (!scene) {
549
556
  return checkReadiness;
@@ -587,7 +594,7 @@ export class RenderTargetTexture extends Texture {
587
594
  this.onBeforeBindObservable.notifyObservers(this);
588
595
  // Set custom projection.
589
596
  // Needs to be before binding to prevent changing the aspect ratio.
590
- const camera = this.activeCamera ?? scene.activeCamera;
597
+ const camera = (_a = this.activeCamera) !== null && _a !== void 0 ? _a : scene.activeCamera;
591
598
  const sceneCamera = scene.activeCamera;
592
599
  if (camera) {
593
600
  if (camera !== scene.activeCamera) {
@@ -785,12 +792,13 @@ export class RenderTargetTexture extends Texture {
785
792
  }
786
793
  }
787
794
  _renderToTarget(faceIndex, useCameraPostProcess, dumpForDebug, layer = 0, camera = null) {
795
+ var _a, _b, _c, _d, _e, _f;
788
796
  const scene = this.getScene();
789
797
  if (!scene) {
790
798
  return;
791
799
  }
792
800
  const engine = scene.getEngine();
793
- engine._debugPushGroup?.(`render to face #${faceIndex} layer #${layer}`, 1);
801
+ (_a = engine._debugPushGroup) === null || _a === void 0 ? void 0 : _a.call(engine, `render to face #${faceIndex} layer #${layer}`, 1);
794
802
  // Bind
795
803
  this._prepareFrame(scene, faceIndex, layer, useCameraPostProcess);
796
804
  if (this.is2DArray) {
@@ -849,17 +857,17 @@ export class RenderTargetTexture extends Texture {
849
857
  for (const step of scene._afterRenderTargetDrawStage) {
850
858
  step.action(this, faceIndex, layer);
851
859
  }
852
- const saveGenerateMipMaps = this._texture?.generateMipMaps ?? false;
860
+ const saveGenerateMipMaps = (_c = (_b = this._texture) === null || _b === void 0 ? void 0 : _b.generateMipMaps) !== null && _c !== void 0 ? _c : false;
853
861
  if (this._texture) {
854
862
  this._texture.generateMipMaps = false; // if left true, the mipmaps will be generated (if this._texture.generateMipMaps = true) when the first post process binds its own RTT: by doing so it will unbind the current RTT,
855
863
  // which will trigger a mipmap generation. We don't want this because it's a wasted work, we will do an unbind of the current RTT at the end of the process (see unbindFrameBuffer) which will
856
864
  // trigger the generation of the final mipmaps
857
865
  }
858
866
  if (this._postProcessManager) {
859
- this._postProcessManager._finalizeFrame(false, this._renderTarget ?? undefined, faceIndex, this._postProcesses, this.ignoreCameraViewport);
867
+ this._postProcessManager._finalizeFrame(false, (_d = this._renderTarget) !== null && _d !== void 0 ? _d : undefined, faceIndex, this._postProcesses, this.ignoreCameraViewport);
860
868
  }
861
869
  else if (useCameraPostProcess) {
862
- scene.postProcessManager._finalizeFrame(false, this._renderTarget ?? undefined, faceIndex);
870
+ scene.postProcessManager._finalizeFrame(false, (_e = this._renderTarget) !== null && _e !== void 0 ? _e : undefined, faceIndex);
863
871
  }
864
872
  for (const step of scene._afterRenderTargetPostProcessStage) {
865
873
  step.action(this, faceIndex, layer);
@@ -891,7 +899,7 @@ export class RenderTargetTexture extends Texture {
891
899
  if (this._texture && this.isCube && faceIndex === 5) {
892
900
  engine.generateMipMapsForCubemap(this._texture);
893
901
  }
894
- engine._debugPopGroup?.(1);
902
+ (_f = engine._debugPopGroup) === null || _f === void 0 ? void 0 : _f.call(engine, 1);
895
903
  }
896
904
  /**
897
905
  * Overrides the default sort function applied in the rendering group to prepare the meshes.
@@ -954,19 +962,22 @@ export class RenderTargetTexture extends Texture {
954
962
  * This will remove the attached framebuffer objects. The texture will not be able to be used as render target anymore
955
963
  */
956
964
  disposeFramebufferObjects() {
957
- this._renderTarget?.dispose(true);
965
+ var _a;
966
+ (_a = this._renderTarget) === null || _a === void 0 ? void 0 : _a.dispose(true);
958
967
  }
959
968
  /**
960
969
  * Release and destroy the underlying lower level texture aka internalTexture.
961
970
  */
962
971
  releaseInternalTexture() {
963
- this._renderTarget?.releaseTextures();
972
+ var _a;
973
+ (_a = this._renderTarget) === null || _a === void 0 ? void 0 : _a.releaseTextures();
964
974
  this._texture = null;
965
975
  }
966
976
  /**
967
977
  * Dispose the texture and release its associated resources.
968
978
  */
969
979
  dispose() {
980
+ var _a;
970
981
  this.onResizeObservable.clear();
971
982
  this.onClearObservable.clear();
972
983
  this.onAfterRenderObservable.clear();
@@ -1002,7 +1013,7 @@ export class RenderTargetTexture extends Texture {
1002
1013
  camera.customRenderTargets.splice(index, 1);
1003
1014
  }
1004
1015
  }
1005
- this._renderTarget?.dispose();
1016
+ (_a = this._renderTarget) === null || _a === void 0 ? void 0 : _a.dispose();
1006
1017
  this._renderTarget = null;
1007
1018
  this._texture = null;
1008
1019
  super.dispose();