@babylonjs/core 6.33.2 → 6.34.0-alpha.0

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 (332) hide show
  1. package/Animations/animation.js +1 -1
  2. package/Animations/animation.js.map +1 -1
  3. package/Buffers/storageBuffer.d.ts +2 -1
  4. package/Buffers/storageBuffer.js +3 -2
  5. package/Buffers/storageBuffer.js.map +1 -1
  6. package/Cameras/Inputs/followCameraMouseWheelInput.js +12 -9
  7. package/Cameras/Inputs/followCameraMouseWheelInput.js.map +1 -1
  8. package/Cameras/Inputs/followCameraPointersInput.js +28 -9
  9. package/Cameras/Inputs/followCameraPointersInput.js.map +1 -1
  10. package/Cameras/arcRotateCamera.js +1 -1
  11. package/Cameras/arcRotateCamera.js.map +1 -1
  12. package/Cameras/followCameraInputsManager.js +2 -1
  13. package/Cameras/followCameraInputsManager.js.map +1 -1
  14. package/Debug/skeletonViewer.js +2 -1
  15. package/Debug/skeletonViewer.js.map +1 -1
  16. package/Engines/Extensions/engine.alpha.js +8 -116
  17. package/Engines/Extensions/engine.alpha.js.map +1 -1
  18. package/Engines/Extensions/engine.cubeTexture.d.ts +1 -1
  19. package/Engines/Extensions/engine.cubeTexture.js +11 -213
  20. package/Engines/Extensions/engine.cubeTexture.js.map +1 -1
  21. package/Engines/Extensions/engine.dynamicBuffer.js +5 -42
  22. package/Engines/Extensions/engine.dynamicBuffer.js.map +1 -1
  23. package/Engines/Extensions/engine.dynamicTexture.d.ts +1 -1
  24. package/Engines/Extensions/engine.dynamicTexture.js +5 -47
  25. package/Engines/Extensions/engine.dynamicTexture.js.map +1 -1
  26. package/Engines/Extensions/engine.multiRender.js +11 -341
  27. package/Engines/Extensions/engine.multiRender.js.map +1 -1
  28. package/Engines/Extensions/engine.multiview.js +6 -57
  29. package/Engines/Extensions/engine.multiview.js.map +1 -1
  30. package/Engines/Extensions/engine.query.d.ts +8 -2
  31. package/Engines/Extensions/engine.query.js +44 -152
  32. package/Engines/Extensions/engine.query.js.map +1 -1
  33. package/Engines/Extensions/engine.rawTexture.d.ts +1 -1
  34. package/Engines/Extensions/engine.rawTexture.js +20 -361
  35. package/Engines/Extensions/engine.rawTexture.js.map +1 -1
  36. package/Engines/Extensions/engine.readTexture.js +6 -112
  37. package/Engines/Extensions/engine.readTexture.js.map +1 -1
  38. package/Engines/Extensions/engine.renderTarget.d.ts +1 -1
  39. package/Engines/Extensions/engine.renderTarget.js +8 -173
  40. package/Engines/Extensions/engine.renderTarget.js.map +1 -1
  41. package/Engines/Extensions/engine.renderTargetCube.js +4 -55
  42. package/Engines/Extensions/engine.renderTargetCube.js.map +1 -1
  43. package/Engines/Extensions/engine.storageBuffer.d.ts +2 -1
  44. package/Engines/Extensions/engine.storageBuffer.js.map +1 -1
  45. package/Engines/Extensions/engine.textureSelector.js +11 -52
  46. package/Engines/Extensions/engine.textureSelector.js.map +1 -1
  47. package/Engines/Extensions/engine.transformFeedback.js +10 -11
  48. package/Engines/Extensions/engine.transformFeedback.js.map +1 -1
  49. package/Engines/Extensions/engine.uniformBuffer.js +9 -59
  50. package/Engines/Extensions/engine.uniformBuffer.js.map +1 -1
  51. package/Engines/Extensions/engine.videoTexture.js +4 -54
  52. package/Engines/Extensions/engine.videoTexture.js.map +1 -1
  53. package/Engines/Extensions/engine.views.d.ts +2 -24
  54. package/Engines/Extensions/engine.views.js +17 -136
  55. package/Engines/Extensions/engine.views.js.map +1 -1
  56. package/Engines/Processors/shaderCodeInliner.js +15 -14
  57. package/Engines/Processors/shaderCodeInliner.js.map +1 -1
  58. package/Engines/WebGPU/Extensions/engine.computeShader.js +3 -2
  59. package/Engines/WebGPU/Extensions/engine.computeShader.js.map +1 -1
  60. package/Engines/WebGPU/Extensions/engine.storageBuffer.js +14 -5
  61. package/Engines/WebGPU/Extensions/engine.storageBuffer.js.map +1 -1
  62. package/Engines/WebGPU/webgpuShaderProcessor.js +2 -1
  63. package/Engines/WebGPU/webgpuShaderProcessor.js.map +1 -1
  64. package/Engines/WebGPU/webgpuTintWASM.js +3 -2
  65. package/Engines/WebGPU/webgpuTintWASM.js.map +1 -1
  66. package/Engines/engine.d.ts +15 -64
  67. package/Engines/engine.js +322 -773
  68. package/Engines/engine.js.map +1 -1
  69. package/Engines/nativeEngine.d.ts +1 -1
  70. package/Engines/nativeEngine.js.map +1 -1
  71. package/Engines/nullEngine.d.ts +1 -1
  72. package/Engines/nullEngine.js.map +1 -1
  73. package/Engines/thinEngine.d.ts +160 -151
  74. package/Engines/thinEngine.js +712 -3281
  75. package/Engines/thinEngine.js.map +1 -1
  76. package/Engines/webgpuEngine.d.ts +5 -8
  77. package/Engines/webgpuEngine.js +143 -112
  78. package/Engines/webgpuEngine.js.map +1 -1
  79. package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js +2 -1
  80. package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js.map +1 -1
  81. package/FlowGraph/flowGraphBlock.js +1 -21
  82. package/FlowGraph/flowGraphBlock.js.map +1 -1
  83. package/FlowGraph/flowGraphExecutionBlock.d.ts +1 -0
  84. package/FlowGraph/flowGraphExecutionBlock.js +20 -0
  85. package/FlowGraph/flowGraphExecutionBlock.js.map +1 -1
  86. package/Gizmos/axisScaleGizmo.d.ts +1 -0
  87. package/Gizmos/axisScaleGizmo.js +12 -0
  88. package/Gizmos/axisScaleGizmo.js.map +1 -1
  89. package/Gizmos/lightGizmo.js +2 -1
  90. package/Gizmos/lightGizmo.js.map +1 -1
  91. package/Gizmos/rotationGizmo.js +1 -1
  92. package/Gizmos/rotationGizmo.js.map +1 -1
  93. package/Lights/Shadows/cascadedShadowGenerator.js +1 -1
  94. package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
  95. package/Materials/Node/Blocks/Dual/lightBlock.js +2 -1
  96. package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
  97. package/Materials/Node/Blocks/Dual/reflectionTextureBlock.js +3 -2
  98. package/Materials/Node/Blocks/Dual/reflectionTextureBlock.js.map +1 -1
  99. package/Materials/Node/Blocks/Fragment/fragDepthBlock.js +2 -1
  100. package/Materials/Node/Blocks/Fragment/fragDepthBlock.js.map +1 -1
  101. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js +2 -1
  102. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js.map +1 -1
  103. package/Materials/Node/Blocks/PBR/anisotropyBlock.js +2 -1
  104. package/Materials/Node/Blocks/PBR/anisotropyBlock.js.map +1 -1
  105. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +3 -2
  106. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
  107. package/Materials/Node/Blocks/PBR/reflectionBlock.js +2 -1
  108. package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
  109. package/Materials/Node/nodeMaterial.js +9 -8
  110. package/Materials/Node/nodeMaterial.js.map +1 -1
  111. package/Materials/Node/nodeMaterialBlock.js +2 -1
  112. package/Materials/Node/nodeMaterialBlock.js.map +1 -1
  113. package/Materials/drawWrapper.js +3 -2
  114. package/Materials/drawWrapper.js.map +1 -1
  115. package/Materials/effect.js +2 -1
  116. package/Materials/effect.js.map +1 -1
  117. package/Materials/material.js +2 -1
  118. package/Materials/material.js.map +1 -1
  119. package/Materials/uniformBuffer.d.ts +4 -1
  120. package/Materials/uniformBuffer.js +5 -2
  121. package/Materials/uniformBuffer.js.map +1 -1
  122. package/Meshes/Node/nodeGeometryBlock.js +2 -1
  123. package/Meshes/Node/nodeGeometryBlock.js.map +1 -1
  124. package/Meshes/abstractMesh.js +3 -1
  125. package/Meshes/abstractMesh.js.map +1 -1
  126. package/Misc/assetsManager.js +2 -2
  127. package/Misc/assetsManager.js.map +1 -1
  128. package/Misc/dds.d.ts +2 -0
  129. package/Misc/dds.js +27 -23
  130. package/Misc/dds.js.map +1 -1
  131. package/Misc/logger.d.ts +3 -3
  132. package/Misc/logger.js +8 -4
  133. package/Misc/logger.js.map +1 -1
  134. package/Misc/sceneSerializer.js +2 -1
  135. package/Misc/sceneSerializer.js.map +1 -1
  136. package/Navigation/Plugins/recastJSPlugin.js +2 -2
  137. package/Navigation/Plugins/recastJSPlugin.js.map +1 -1
  138. package/Physics/v2/Plugins/havokPlugin.js +1 -1
  139. package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
  140. package/Physics/v2/index.d.ts +1 -0
  141. package/Physics/v2/index.js +1 -0
  142. package/Physics/v2/index.js.map +1 -1
  143. package/Physics/v2/ragdoll.d.ts +107 -0
  144. package/Physics/v2/ragdoll.js +228 -0
  145. package/Physics/v2/ragdoll.js.map +1 -0
  146. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js +2 -2
  147. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js.map +1 -1
  148. package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js +3 -2
  149. package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js.map +1 -1
  150. package/PostProcesses/index.d.ts +1 -1
  151. package/PostProcesses/index.js +1 -1
  152. package/PostProcesses/index.js.map +1 -1
  153. package/PostProcesses/passPostProcess.d.ts +1 -0
  154. package/PostProcesses/passPostProcess.js +6 -2
  155. package/PostProcesses/passPostProcess.js.map +1 -1
  156. package/PostProcesses/screenSpaceCurvaturePostProcess.js +1 -1
  157. package/PostProcesses/screenSpaceCurvaturePostProcess.js.map +1 -1
  158. package/PostProcesses/screenSpaceReflectionPostProcess.js +3 -2
  159. package/PostProcesses/screenSpaceReflectionPostProcess.js.map +1 -1
  160. package/Rendering/depthPeelingRenderer.js +2 -1
  161. package/Rendering/depthPeelingRenderer.js.map +1 -1
  162. package/Shaders/ShadersInclude/pbrBlockSubSurface.js +3 -2
  163. package/Shaders/ShadersInclude/pbrBlockSubSurface.js.map +1 -1
  164. package/XR/features/WebXRControllerPhysics.js +2 -2
  165. package/XR/features/WebXRControllerPhysics.js.map +1 -1
  166. package/XR/features/WebXRMeshDetector.js +2 -1
  167. package/XR/features/WebXRMeshDetector.js.map +1 -1
  168. package/XR/features/WebXRWalkingLocomotion.js +1 -1
  169. package/XR/features/WebXRWalkingLocomotion.js.map +1 -1
  170. package/XR/webXRExperienceHelper.js +2 -2
  171. package/XR/webXRExperienceHelper.js.map +1 -1
  172. package/assetContainer.js +2 -2
  173. package/assetContainer.js.map +1 -1
  174. package/esm/Engines/Extensions/alpha/alpha.base.d.ts +34 -0
  175. package/esm/Engines/Extensions/alpha/alpha.base.js +2 -0
  176. package/esm/Engines/Extensions/alpha/alpha.base.js.map +1 -0
  177. package/esm/Engines/Extensions/computeShaders/computeShaders.base.d.ts +87 -0
  178. package/esm/Engines/Extensions/computeShaders/computeShaders.base.js +12 -0
  179. package/esm/Engines/Extensions/computeShaders/computeShaders.base.js.map +1 -0
  180. package/esm/Engines/Extensions/cubeTexture/cubeTexture.base.d.ts +79 -0
  181. package/esm/Engines/Extensions/cubeTexture/cubeTexture.base.js +2 -0
  182. package/esm/Engines/Extensions/cubeTexture/cubeTexture.base.js.map +1 -0
  183. package/esm/Engines/Extensions/debugging/debugging.base.d.ts +11 -0
  184. package/esm/Engines/Extensions/debugging/debugging.base.js +2 -0
  185. package/esm/Engines/Extensions/debugging/debugging.base.js.map +1 -0
  186. package/esm/Engines/Extensions/dynamicBuffer/dynamicBuffer.base.d.ts +20 -0
  187. package/esm/Engines/Extensions/dynamicBuffer/dynamicBuffer.base.js +2 -0
  188. package/esm/Engines/Extensions/dynamicBuffer/dynamicBuffer.base.js.map +1 -0
  189. package/esm/Engines/Extensions/dynamicTexture/dynamicTexture.base.d.ts +26 -0
  190. package/esm/Engines/Extensions/dynamicTexture/dynamicTexture.base.js +2 -0
  191. package/esm/Engines/Extensions/dynamicTexture/dynamicTexture.base.js.map +1 -0
  192. package/esm/Engines/Extensions/engine.extensions.d.ts +67 -0
  193. package/esm/Engines/Extensions/engine.extensions.js +49 -0
  194. package/esm/Engines/Extensions/engine.extensions.js.map +1 -0
  195. package/esm/Engines/Extensions/externalTexture/externalTexture.base.d.ts +16 -0
  196. package/esm/Engines/Extensions/externalTexture/externalTexture.base.js +2 -0
  197. package/esm/Engines/Extensions/externalTexture/externalTexture.base.js.map +1 -0
  198. package/esm/Engines/Extensions/multiRender/multiRender.base.d.ts +54 -0
  199. package/esm/Engines/Extensions/multiRender/multiRender.base.js +2 -0
  200. package/esm/Engines/Extensions/multiRender/multiRender.base.js.map +1 -0
  201. package/esm/Engines/Extensions/multiview/multiview.base.d.ts +67 -0
  202. package/esm/Engines/Extensions/multiview/multiview.base.js +79 -0
  203. package/esm/Engines/Extensions/multiview/multiview.base.js.map +1 -0
  204. package/esm/Engines/Extensions/query/query.base.d.ts +164 -0
  205. package/esm/Engines/Extensions/query/query.base.js +168 -0
  206. package/esm/Engines/Extensions/query/query.base.js.map +1 -0
  207. package/esm/Engines/Extensions/rawTexture/engine.rawTexture.base.d.ts +187 -0
  208. package/esm/Engines/Extensions/rawTexture/engine.rawTexture.base.js +2 -0
  209. package/esm/Engines/Extensions/rawTexture/engine.rawTexture.base.js.map +1 -0
  210. package/esm/Engines/Extensions/readTexture/readTexture.base.d.ts +9 -0
  211. package/esm/Engines/Extensions/readTexture/readTexture.base.js +2 -0
  212. package/esm/Engines/Extensions/readTexture/readTexture.base.js.map +1 -0
  213. package/esm/Engines/Extensions/renderTarget/renderTarget.base.d.ts +35 -0
  214. package/esm/Engines/Extensions/renderTarget/renderTarget.base.js +2 -0
  215. package/esm/Engines/Extensions/renderTarget/renderTarget.base.js.map +1 -0
  216. package/esm/Engines/Extensions/renderTargetCube/renderTargetCube.base.d.ts +12 -0
  217. package/esm/Engines/Extensions/renderTargetCube/renderTargetCube.base.js +2 -0
  218. package/esm/Engines/Extensions/renderTargetCube/renderTargetCube.base.js.map +1 -0
  219. package/esm/Engines/Extensions/storageBuffer/storageBuffer.base.d.ts +36 -0
  220. package/esm/Engines/Extensions/storageBuffer/storageBuffer.base.js +2 -0
  221. package/esm/Engines/Extensions/storageBuffer/storageBuffer.base.js.map +1 -0
  222. package/esm/Engines/Extensions/textureSampler/textureSampler.base.d.ts +11 -0
  223. package/esm/Engines/Extensions/textureSampler/textureSampler.base.js +2 -0
  224. package/esm/Engines/Extensions/textureSampler/textureSampler.base.js.map +1 -0
  225. package/esm/Engines/Extensions/textureSelector/textureSelector.base.d.ts +50 -0
  226. package/esm/Engines/Extensions/textureSelector/textureSelector.base.js +53 -0
  227. package/esm/Engines/Extensions/textureSelector/textureSelector.base.js.map +1 -0
  228. package/esm/Engines/Extensions/transformFeedback/engine.transformFeedback.base.d.ts +42 -0
  229. package/esm/Engines/Extensions/transformFeedback/engine.transformFeedback.base.js +2 -0
  230. package/esm/Engines/Extensions/transformFeedback/engine.transformFeedback.base.js.map +1 -0
  231. package/esm/Engines/Extensions/uniformBuffer/uniformBuffer.base.d.ts +48 -0
  232. package/esm/Engines/Extensions/uniformBuffer/uniformBuffer.base.js +2 -0
  233. package/esm/Engines/Extensions/uniformBuffer/uniformBuffer.base.js.map +1 -0
  234. package/esm/Engines/Extensions/videoTexture/videoTexture.base.d.ts +13 -0
  235. package/esm/Engines/Extensions/videoTexture/videoTexture.base.js +2 -0
  236. package/esm/Engines/Extensions/videoTexture/videoTexture.base.js.map +1 -0
  237. package/esm/Engines/Extensions/views/views.base.d.ts +85 -0
  238. package/esm/Engines/Extensions/views/views.base.js +33 -0
  239. package/esm/Engines/Extensions/views/views.base.js.map +1 -0
  240. package/esm/Engines/WebGL/Extensions/alpha/alpha.webgl.d.ts +8 -0
  241. package/esm/Engines/WebGL/Extensions/alpha/alpha.webgl.js +137 -0
  242. package/esm/Engines/WebGL/Extensions/alpha/alpha.webgl.js.map +1 -0
  243. package/esm/Engines/WebGL/Extensions/cubeTexture/cubeTexture.webgl.d.ts +11 -0
  244. package/esm/Engines/WebGL/Extensions/cubeTexture/cubeTexture.webgl.js +251 -0
  245. package/esm/Engines/WebGL/Extensions/cubeTexture/cubeTexture.webgl.js.map +1 -0
  246. package/esm/Engines/WebGL/Extensions/dynamicBuffer/dynamicBuffer.webgl.d.ts +5 -0
  247. package/esm/Engines/WebGL/Extensions/dynamicBuffer/dynamicBuffer.webgl.js +55 -0
  248. package/esm/Engines/WebGL/Extensions/dynamicBuffer/dynamicBuffer.webgl.js.map +1 -0
  249. package/esm/Engines/WebGL/Extensions/dynamicTexture/dynamicTexture.webgl.d.ts +5 -0
  250. package/esm/Engines/WebGL/Extensions/dynamicTexture/dynamicTexture.webgl.js +65 -0
  251. package/esm/Engines/WebGL/Extensions/dynamicTexture/dynamicTexture.webgl.js.map +1 -0
  252. package/esm/Engines/WebGL/Extensions/multiRender/multiRender.webgl.d.ts +10 -0
  253. package/esm/Engines/WebGL/Extensions/multiRender/multiRender.webgl.js +375 -0
  254. package/esm/Engines/WebGL/Extensions/multiRender/multiRender.webgl.js.map +1 -0
  255. package/esm/Engines/WebGL/Extensions/multiview/multiview.webgl.d.ts +6 -0
  256. package/esm/Engines/WebGL/Extensions/multiview/multiview.webgl.js +77 -0
  257. package/esm/Engines/WebGL/Extensions/multiview/multiview.webgl.js.map +1 -0
  258. package/esm/Engines/WebGL/Extensions/query/query.webgl.d.ts +21 -0
  259. package/esm/Engines/WebGL/Extensions/query/query.webgl.js +220 -0
  260. package/esm/Engines/WebGL/Extensions/query/query.webgl.js.map +1 -0
  261. package/esm/Engines/WebGL/Extensions/rawTexture/engine.rawTexture.webgl.d.ts +15 -0
  262. package/esm/Engines/WebGL/Extensions/rawTexture/engine.rawTexture.webgl.js +392 -0
  263. package/esm/Engines/WebGL/Extensions/rawTexture/engine.rawTexture.webgl.js.map +1 -0
  264. package/esm/Engines/WebGL/Extensions/readTexture/readTexture.webgl.d.ts +17 -0
  265. package/esm/Engines/WebGL/Extensions/readTexture/readTexture.webgl.js +133 -0
  266. package/esm/Engines/WebGL/Extensions/readTexture/readTexture.webgl.js.map +1 -0
  267. package/esm/Engines/WebGL/Extensions/renderTarget/renderTarget.webgl.d.ts +8 -0
  268. package/esm/Engines/WebGL/Extensions/renderTarget/renderTarget.webgl.js +199 -0
  269. package/esm/Engines/WebGL/Extensions/renderTarget/renderTarget.webgl.js.map +1 -0
  270. package/esm/Engines/WebGL/Extensions/renderTargetCube/renderTargetCube.webgl.d.ts +2 -0
  271. package/esm/Engines/WebGL/Extensions/renderTargetCube/renderTargetCube.webgl.js +62 -0
  272. package/esm/Engines/WebGL/Extensions/renderTargetCube/renderTargetCube.webgl.js.map +1 -0
  273. package/esm/Engines/WebGL/Extensions/textureSelector/textureSelector.webgl.d.ts +5 -0
  274. package/esm/Engines/WebGL/Extensions/textureSelector/textureSelector.webgl.js +28 -0
  275. package/esm/Engines/WebGL/Extensions/textureSelector/textureSelector.webgl.js.map +1 -0
  276. package/esm/Engines/WebGL/Extensions/transformFeedback/engine.transformFeedback.webgl.d.ts +11 -0
  277. package/esm/Engines/WebGL/Extensions/transformFeedback/engine.transformFeedback.webgl.js +45 -0
  278. package/esm/Engines/WebGL/Extensions/transformFeedback/engine.transformFeedback.webgl.js.map +1 -0
  279. package/esm/Engines/WebGL/Extensions/uniformBuffer/uniformBuffer.webgl.d.ts +9 -0
  280. package/esm/Engines/WebGL/Extensions/uniformBuffer/uniformBuffer.webgl.js +78 -0
  281. package/esm/Engines/WebGL/Extensions/uniformBuffer/uniformBuffer.webgl.js.map +1 -0
  282. package/esm/Engines/WebGL/Extensions/videoTexture/videoTexture.webgl.d.ts +4 -0
  283. package/esm/Engines/WebGL/Extensions/videoTexture/videoTexture.webgl.js +67 -0
  284. package/esm/Engines/WebGL/Extensions/videoTexture/videoTexture.webgl.js.map +1 -0
  285. package/esm/Engines/WebGL/Extensions/views/views.webgl.d.ts +18 -0
  286. package/esm/Engines/WebGL/Extensions/views/views.webgl.js +152 -0
  287. package/esm/Engines/WebGL/Extensions/views/views.webgl.js.map +1 -0
  288. package/esm/Engines/WebGL/engine.adapterHelpers.d.ts +43 -0
  289. package/esm/Engines/WebGL/engine.adapterHelpers.js +107 -0
  290. package/esm/Engines/WebGL/engine.adapterHelpers.js.map +1 -0
  291. package/esm/Engines/WebGL/engine.webgl.d.ts +1030 -0
  292. package/esm/Engines/WebGL/engine.webgl.js +4083 -0
  293. package/esm/Engines/WebGL/engine.webgl.js.map +1 -0
  294. package/esm/Engines/WebGPU/engine.adapterHelpers.d.ts +7 -0
  295. package/esm/Engines/WebGPU/engine.adapterHelpers.js +20 -0
  296. package/esm/Engines/WebGPU/engine.adapterHelpers.js.map +1 -0
  297. package/esm/Engines/WebGPU/engine.webgpu.constants.d.ts +391 -0
  298. package/esm/Engines/WebGPU/engine.webgpu.constants.js +2 -0
  299. package/esm/Engines/WebGPU/engine.webgpu.constants.js.map +1 -0
  300. package/esm/Engines/WebGPU/engine.webgpu.d.ts +277 -0
  301. package/esm/Engines/WebGPU/engine.webgpu.js +1281 -0
  302. package/esm/Engines/WebGPU/engine.webgpu.js.map +1 -0
  303. package/esm/Engines/engine.adapters.d.ts +32 -0
  304. package/esm/Engines/engine.adapters.js +27 -0
  305. package/esm/Engines/engine.adapters.js.map +1 -0
  306. package/esm/Engines/engine.base.d.ts +807 -0
  307. package/esm/Engines/engine.base.js +1235 -0
  308. package/esm/Engines/engine.base.js.map +1 -0
  309. package/esm/Engines/engine.constants.d.ts +735 -0
  310. package/esm/Engines/engine.constants.js +3 -0
  311. package/esm/Engines/engine.constants.js.map +1 -0
  312. package/esm/Engines/engine.extendable.d.ts +180 -0
  313. package/esm/Engines/engine.extendable.js +477 -0
  314. package/esm/Engines/engine.extendable.js.map +1 -0
  315. package/esm/Engines/engine.interfaces.d.ts +16 -0
  316. package/esm/Engines/engine.interfaces.js +9 -0
  317. package/esm/Engines/engine.interfaces.js.map +1 -0
  318. package/esm/Engines/engine.static.d.ts +215 -0
  319. package/esm/Engines/engine.static.js +345 -0
  320. package/esm/Engines/engine.static.js.map +1 -0
  321. package/esm/Engines/engine.tools.d.ts +20 -0
  322. package/esm/Engines/engine.tools.js +33 -0
  323. package/esm/Engines/engine.tools.js.map +1 -0
  324. package/esm/Engines/public.d.ts +1 -0
  325. package/esm/Engines/public.js +2 -0
  326. package/esm/Engines/public.js.map +1 -0
  327. package/esm/Engines/runtimeEnvironment.d.ts +37 -0
  328. package/esm/Engines/runtimeEnvironment.js +56 -0
  329. package/esm/Engines/runtimeEnvironment.js.map +1 -0
  330. package/package.json +2 -1
  331. package/scene.js +1 -1
  332. package/scene.js.map +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cubeTexture.base.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/esm/Engines/Extensions/cubeTexture/cubeTexture.base.ts"],"names":[],"mappings":"","sourcesContent":["import type { RenderTargetWrapper } from \"core/Engines/renderTargetWrapper\";\r\nimport type { InternalTexture } from \"core/Materials/Textures/internalTexture\";\r\nimport type { DepthTextureCreationOptions } from \"core/Materials/Textures/textureCreationOptions\";\r\nimport type { Scene } from \"core/scene\";\r\nimport type { Nullable } from \"core/types\";\r\nimport type { IBaseEnginePublic } from \"../../engine.base\";\r\n\r\nexport interface ICubeTextureEngineExtension {\r\n /**\r\n * Creates a depth stencil cube texture.\r\n * This is only available in WebGL 2.\r\n * @param size The size of face edge in the cube texture.\r\n * @param options The options defining the cube texture.\r\n * @param rtWrapper The render target wrapper for which the depth/stencil texture must be created\r\n * @returns The cube texture\r\n */\r\n _createDepthStencilCubeTexture(engineState: IBaseEnginePublic, size: number, options: DepthTextureCreationOptions, rtWrapper: RenderTargetWrapper): InternalTexture;\r\n\r\n /**\r\n * Creates a cube texture\r\n * @param rootUrl defines the url where the files to load is located\r\n * @param scene defines the current scene\r\n * @param files defines the list of files to load (1 per face)\r\n * @param noMipmap defines a boolean indicating that no mipmaps shall be generated (false by default)\r\n * @param onLoad defines an optional callback raised when the texture is loaded\r\n * @param onError defines an optional callback raised if there is an issue to load the texture\r\n * @param format defines the format of the data\r\n * @param forcedExtension defines the extension to use to pick the right loader\r\n * @param createPolynomials if a polynomial sphere should be created for the cube texture\r\n * @param lodScale defines the scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness\r\n * @param lodOffset defines the offset applied to environment texture. This manages first LOD level used for IBL according to the roughness\r\n * @param fallback defines texture to use while falling back when (compressed) texture file not found.\r\n * @param loaderOptions options to be passed to the loader\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 cube texture as an InternalTexture\r\n */\r\n createCubeTexture(\r\n engineState: IBaseEnginePublic,\r\n rootUrl: string,\r\n scene: Nullable<Scene>,\r\n files: Nullable<string[]>,\r\n noMipmap: boolean | undefined,\r\n onLoad: Nullable<(data?: any) => void>,\r\n onError: Nullable<(message?: string, exception?: any) => void>,\r\n format: number | undefined,\r\n forcedExtension: any,\r\n createPolynomials: boolean,\r\n lodScale: number,\r\n lodOffset: number,\r\n fallback: Nullable<InternalTexture>,\r\n loaderOptions: any,\r\n useSRGBBuffer: boolean\r\n ): InternalTexture;\r\n\r\n /**\r\n * Creates a cube texture\r\n * @param rootUrl defines the url where the files to load is located\r\n * @param scene defines the current scene\r\n * @param files defines the list of files to load (1 per face)\r\n * @param noMipmap defines a boolean indicating that no mipmaps shall be generated (false by default)\r\n * @param onLoad defines an optional callback raised when the texture is loaded\r\n * @param onError defines an optional callback raised if there is an issue to load the texture\r\n * @param format defines the format of the data\r\n * @param forcedExtension defines the extension to use to pick the right loader\r\n * @returns the cube texture as an InternalTexture\r\n */\r\n createCubeTexture(\r\n engineState: IBaseEnginePublic,\r\n rootUrl: string,\r\n scene: Nullable<Scene>,\r\n files: Nullable<string[]>,\r\n noMipmap: boolean,\r\n onLoad: Nullable<(data?: any) => void>,\r\n onError: Nullable<(message?: string, exception?: any) => void>,\r\n format: number | undefined,\r\n forcedExtension: any\r\n ): InternalTexture;\r\n\r\n /**\r\n * Creates a cube texture\r\n * @param rootUrl defines the url where the files to load is located\r\n * @param scene defines the current scene\r\n * @param files defines the list of files to load (1 per face)\r\n * @param noMipmap defines a boolean indicating that no mipmaps shall be generated (false by default)\r\n * @param onLoad defines an optional callback raised when the texture is loaded\r\n * @param onError defines an optional callback raised if there is an issue to load the texture\r\n * @param format defines the format of the data\r\n * @param forcedExtension defines the extension to use to pick the right loader\r\n * @param createPolynomials if a polynomial sphere should be created for the cube texture\r\n * @param lodScale defines the scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness\r\n * @param lodOffset defines the offset applied to environment texture. This manages first LOD level used for IBL according to the roughness\r\n * @returns the cube texture as an InternalTexture\r\n */\r\n createCubeTexture(\r\n engineState: IBaseEnginePublic,\r\n rootUrl: string,\r\n scene: Nullable<Scene>,\r\n files: Nullable<string[]>,\r\n noMipmap: boolean,\r\n onLoad: Nullable<(data?: any) => void>,\r\n onError: Nullable<(message?: string, exception?: any) => void>,\r\n format: number | undefined,\r\n forcedExtension: any,\r\n createPolynomials: boolean,\r\n lodScale: number,\r\n lodOffset: number\r\n ): InternalTexture;\r\n\r\n /** @internal */\r\n createCubeTextureBase(\r\n engineState: IBaseEnginePublic,\r\n rootUrl: string,\r\n scene: Nullable<Scene>,\r\n files: Nullable<string[]>,\r\n noMipmap: boolean | undefined,\r\n onLoad: Nullable<(data?: any) => void>,\r\n onError: Nullable<(message?: string, exception?: any) => void>,\r\n format: number | undefined,\r\n forcedExtension: any,\r\n createPolynomials: boolean,\r\n lodScale: number,\r\n lodOffset: number,\r\n fallback: Nullable<InternalTexture>,\r\n beforeLoadCubeDataCallback: Nullable<(texture: InternalTexture, data: ArrayBufferView | ArrayBufferView[]) => void>,\r\n imageHandler: Nullable<(texture: InternalTexture, imgs: HTMLImageElement[] | ImageBitmap[]) => void>,\r\n useSRGBBuffer: boolean\r\n ): InternalTexture;\r\n\r\n /** @internal */\r\n _partialLoadFile(\r\n engineState: IBaseEnginePublic,\r\n url: string,\r\n index: number,\r\n loadedFiles: ArrayBuffer[],\r\n onfinish: (files: ArrayBuffer[]) => void,\r\n onErrorCallBack: Nullable<(message?: string, exception?: any) => void>\r\n ): void;\r\n\r\n /** @internal */\r\n _cascadeLoadFiles(\r\n engineState: IBaseEnginePublic,\r\n scene: Nullable<Scene>,\r\n onfinish: (images: ArrayBuffer[]) => void,\r\n files: string[],\r\n onError: Nullable<(message?: string, exception?: any) => void>\r\n ): void;\r\n\r\n /** @internal */\r\n _cascadeLoadImgs(\r\n engineState: IBaseEnginePublic,\r\n scene: Nullable<Scene>,\r\n texture: InternalTexture,\r\n onfinish: Nullable<(texture: InternalTexture, images: HTMLImageElement[] | ImageBitmap[]) => void>,\r\n files: string[],\r\n onError: Nullable<(message?: string, exception?: any) => void>,\r\n mimeType?: string\r\n ): void;\r\n\r\n /** @internal */\r\n _partialLoadImg(\r\n engineState: IBaseEnginePublic,\r\n url: string,\r\n index: number,\r\n loadedImages: HTMLImageElement[] | ImageBitmap[],\r\n scene: Nullable<Scene>,\r\n texture: InternalTexture,\r\n onfinish: Nullable<(texture: InternalTexture, images: HTMLImageElement[] | ImageBitmap[]) => void>,\r\n onErrorCallBack: Nullable<(message?: string, exception?: any) => void>,\r\n mimeType?: string\r\n ): void;\r\n\r\n /**\r\n * @internal\r\n */\r\n _setCubeMapTextureParams(engineState: IBaseEnginePublic, texture: InternalTexture, loadMipmap: boolean, maxLevel?: number): void;\r\n}\r\n"]}
@@ -0,0 +1,11 @@
1
+ import type { IBaseEnginePublic } from "../../engine.base";
2
+ export interface IDebuggingEngineExtension {
3
+ /** @internal */
4
+ _debugPushGroup(engineState: IBaseEnginePublic, groupName: string, targetObject?: number): void;
5
+ /** @internal */
6
+ _debugPopGroup(engineState: IBaseEnginePublic, targetObject?: number): void;
7
+ /** @internal */
8
+ _debugInsertMarker(engineState: IBaseEnginePublic, text: string, targetObject?: number): void;
9
+ /** @internal */
10
+ _debugFlushPendingCommands(engineState: IBaseEnginePublic): void;
11
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=debugging.base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debugging.base.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/esm/Engines/Extensions/debugging/debugging.base.ts"],"names":[],"mappings":"","sourcesContent":["import type { IBaseEnginePublic } from \"../../engine.base\";\r\n\r\nexport interface IDebuggingEngineExtension {\r\n /** @internal */\r\n _debugPushGroup(engineState: IBaseEnginePublic, groupName: string, targetObject?: number): void;\r\n\r\n /** @internal */\r\n _debugPopGroup(engineState: IBaseEnginePublic, targetObject?: number): void;\r\n\r\n /** @internal */\r\n _debugInsertMarker(engineState: IBaseEnginePublic, text: string, targetObject?: number): void;\r\n\r\n /** @internal */\r\n _debugFlushPendingCommands(engineState: IBaseEnginePublic): void;\r\n}\r\n"]}
@@ -0,0 +1,20 @@
1
+ import type { DataBuffer } from "../../../../Buffers/dataBuffer.js";
2
+ import type { DataArray, IndicesArray } from "../../../../types.js";
3
+ import type { IBaseEnginePublic } from "../../engine.base";
4
+ export interface IDynamicBufferEngineExtension {
5
+ /**
6
+ * Update a dynamic index buffer
7
+ * @param indexBuffer defines the target index buffer
8
+ * @param indices defines the data to update
9
+ * @param offset defines the offset in the target index buffer where update should start
10
+ */
11
+ updateDynamicIndexBuffer(engineState: IBaseEnginePublic, indexBuffer: DataBuffer, indices: IndicesArray, offset?: number): void;
12
+ /**
13
+ * Updates a dynamic vertex buffer.
14
+ * @param vertexBuffer the vertex buffer to update
15
+ * @param data the data used to update the vertex buffer
16
+ * @param byteOffset the byte offset of the data
17
+ * @param byteLength the byte length of the data
18
+ */
19
+ updateDynamicVertexBuffer(engineState: IBaseEnginePublic, vertexBuffer: DataBuffer, data: DataArray, byteOffset?: number, byteLength?: number): void;
20
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=dynamicBuffer.base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynamicBuffer.base.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/esm/Engines/Extensions/dynamicBuffer/dynamicBuffer.base.ts"],"names":[],"mappings":"","sourcesContent":["import type { DataBuffer } from \"core/Buffers/dataBuffer\";\r\nimport type { DataArray, IndicesArray } from \"core/types\";\r\nimport type { IBaseEnginePublic } from \"../../engine.base\";\r\n\r\nexport interface IDynamicBufferEngineExtension {\r\n /**\r\n * Update a dynamic index buffer\r\n * @param indexBuffer defines the target index buffer\r\n * @param indices defines the data to update\r\n * @param offset defines the offset in the target index buffer where update should start\r\n */\r\n updateDynamicIndexBuffer(engineState: IBaseEnginePublic, indexBuffer: DataBuffer, indices: IndicesArray, offset?: number): void;\r\n\r\n /**\r\n * Updates a dynamic vertex buffer.\r\n * @param vertexBuffer the vertex buffer to update\r\n * @param data the data used to update the vertex buffer\r\n * @param byteOffset the byte offset of the data\r\n * @param byteLength the byte length of the data\r\n */\r\n updateDynamicVertexBuffer(engineState: IBaseEnginePublic, vertexBuffer: DataBuffer, data: DataArray, byteOffset?: number, byteLength?: number): void;\r\n}\r\n"]}
@@ -0,0 +1,26 @@
1
+ import type { InternalTexture } from "../../../../Materials/Textures/internalTexture.js";
2
+ import type { ICanvas } from "../../../../Engines/ICanvas.js";
3
+ import type { Nullable } from "../../../../types.js";
4
+ import type { IBaseEnginePublic } from "../../engine.base";
5
+ export interface IDynamicTextureEngineExtension {
6
+ /**
7
+ * Creates a dynamic texture
8
+ * @param width defines the width of the texture
9
+ * @param height defines the height of the texture
10
+ * @param generateMipMaps defines if the engine should generate the mip levels
11
+ * @param samplingMode defines the required sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
12
+ * @returns the dynamic texture inside an InternalTexture
13
+ */
14
+ createDynamicTexture(engineState: IBaseEnginePublic, width: number, height: number, generateMipMaps: boolean, samplingMode: number): InternalTexture;
15
+ /**
16
+ * Update the content of a dynamic texture
17
+ * @param texture defines the texture to update
18
+ * @param source defines the source containing the data
19
+ * @param invertY defines if data must be stored with Y axis inverted
20
+ * @param premulAlpha defines if alpha is stored as premultiplied
21
+ * @param format defines the format of the data
22
+ * @param forceBindTexture if the texture should be forced to be bound eg. after a graphics context loss (Default: false)
23
+ * @param allowGPUOptimization true to allow some specific GPU optimizations (subject to engine feature "allowGPUOptimizationsForGUI" being true)
24
+ */
25
+ updateDynamicTexture(engineState: IBaseEnginePublic, texture: Nullable<InternalTexture>, source: ImageBitmap | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | OffscreenCanvas | ICanvas, invertY?: boolean, premulAlpha?: boolean, format?: number, forceBindTexture?: boolean, allowGPUOptimization?: boolean): void;
26
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=dynamicTexture.base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynamicTexture.base.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/esm/Engines/Extensions/dynamicTexture/dynamicTexture.base.ts"],"names":[],"mappings":"","sourcesContent":["import type { InternalTexture } from \"core/Materials/Textures/internalTexture\";\r\nimport type { ICanvas } from \"core/Engines/ICanvas\";\r\nimport type { Nullable } from \"core/types\";\r\nimport type { IBaseEnginePublic } from \"../../engine.base\";\r\n\r\nexport interface IDynamicTextureEngineExtension {\r\n /**\r\n * Creates a dynamic texture\r\n * @param width defines the width of the texture\r\n * @param height defines the height of the texture\r\n * @param generateMipMaps defines if the engine should generate the mip levels\r\n * @param samplingMode defines the required sampling mode (Texture.NEAREST_SAMPLINGMODE by default)\r\n * @returns the dynamic texture inside an InternalTexture\r\n */\r\n createDynamicTexture(engineState: IBaseEnginePublic, width: number, height: number, generateMipMaps: boolean, samplingMode: number): InternalTexture;\r\n\r\n /**\r\n * Update the content of a dynamic texture\r\n * @param texture defines the texture to update\r\n * @param source defines the source containing the data\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param premulAlpha defines if alpha is stored as premultiplied\r\n * @param format defines the format of the data\r\n * @param forceBindTexture if the texture should be forced to be bound eg. after a graphics context loss (Default: false)\r\n * @param allowGPUOptimization true to allow some specific GPU optimizations (subject to engine feature \"allowGPUOptimizationsForGUI\" being true)\r\n */\r\n updateDynamicTexture(\r\n engineState: IBaseEnginePublic,\r\n texture: Nullable<InternalTexture>,\r\n source: ImageBitmap | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | OffscreenCanvas | ICanvas,\r\n invertY?: boolean,\r\n premulAlpha?: boolean,\r\n format?: number,\r\n forceBindTexture?: boolean,\r\n allowGPUOptimization?: boolean\r\n ): void;\r\n}\r\n"]}
@@ -0,0 +1,67 @@
1
+ import type { IBaseEnginePublic } from "../engine.base";
2
+ import type { ICubeTextureEngineExtension } from "./cubeTexture/cubeTexture.base";
3
+ import type { IRawTextureEngineExtension } from "./rawTexture/engine.rawTexture.base";
4
+ import type { IMultiRenderEngineExtension } from "./multiRender/multiRender.base";
5
+ import type { IRenderTargetEngineExtension } from "./renderTarget/renderTarget.base";
6
+ import type { ITransformFeedbackEngineExtension } from "./transformFeedback/engine.transformFeedback.base";
7
+ import type { IAlphaEngineExtension } from "./alpha/alpha.base";
8
+ import type { IDynamicBufferEngineExtension } from "./dynamicBuffer/dynamicBuffer.base";
9
+ import type { IQueryEngineExtension } from "./query/query.base";
10
+ import type { IDynamicTextureEngineExtension } from "./dynamicTexture/dynamicTexture.base";
11
+ import type { IViewsEngineExtension } from "./views/views.base";
12
+ import type { IMultiviewEngineExtension } from "./multiview/multiview.base";
13
+ import type { IReadTextureEngineExtension } from "./readTexture/readTexture.base";
14
+ import type { IRenderTargetCubeEngineExtension } from "./renderTargetCube/renderTargetCube.base";
15
+ import type { ITextureSelectorEngineExtension } from "./textureSelector/textureSelector.base";
16
+ import type { IUniformBufferEngineExtension } from "./uniformBuffer/uniformBuffer.base";
17
+ import type { IVideoTextureEngineExtension } from "./videoTexture/videoTexture.base";
18
+ export declare const enum EngineExtensions {
19
+ RAW_TEXTURE = 0,
20
+ TRANSFORM_FEEDBACK = 1,
21
+ RENDER_TARGET = 2,
22
+ MULTI_RENDER = 3,
23
+ CUBE_TEXTURE = 4,
24
+ ALPHA = 5,
25
+ QUERY = 6,
26
+ DYNAMIC_BUFFER = 7,
27
+ DYNAMIC_TEXTURE = 8,
28
+ VIEWS = 9,
29
+ MULTIVIEW = 10,
30
+ READ_TEXTURE = 11,
31
+ RENDER_TARGET_CUBE = 12,
32
+ TEXTURE_SELECTOR = 13,
33
+ UNIFORM_BUFFER = 14,
34
+ VIDEO_TEXTURE = 15
35
+ }
36
+ export interface IBaseEngineExtension {
37
+ extensionState: any;
38
+ initExtension(): void;
39
+ }
40
+ export interface IEngineExtensions {
41
+ [EngineExtensions.RAW_TEXTURE]?: IRawTextureEngineExtension;
42
+ [EngineExtensions.TRANSFORM_FEEDBACK]?: ITransformFeedbackEngineExtension;
43
+ [EngineExtensions.RENDER_TARGET]?: IRenderTargetEngineExtension;
44
+ [EngineExtensions.MULTI_RENDER]?: IMultiRenderEngineExtension;
45
+ [EngineExtensions.CUBE_TEXTURE]?: ICubeTextureEngineExtension;
46
+ [EngineExtensions.ALPHA]?: IAlphaEngineExtension;
47
+ [EngineExtensions.QUERY]?: IQueryEngineExtension;
48
+ [EngineExtensions.DYNAMIC_BUFFER]?: IDynamicBufferEngineExtension;
49
+ [EngineExtensions.DYNAMIC_TEXTURE]?: IDynamicTextureEngineExtension;
50
+ [EngineExtensions.VIEWS]?: IViewsEngineExtension;
51
+ [EngineExtensions.MULTIVIEW]?: IMultiviewEngineExtension;
52
+ [EngineExtensions.READ_TEXTURE]?: IReadTextureEngineExtension;
53
+ [EngineExtensions.RENDER_TARGET_CUBE]?: IRenderTargetCubeEngineExtension;
54
+ [EngineExtensions.TEXTURE_SELECTOR]?: ITextureSelectorEngineExtension;
55
+ [EngineExtensions.UNIFORM_BUFFER]?: IUniformBufferEngineExtension;
56
+ [EngineExtensions.VIDEO_TEXTURE]?: IVideoTextureEngineExtension;
57
+ }
58
+ export type IEngineExtension = IEngineExtensions[EngineExtensions];
59
+ export declare function getEngineExtensions(engineState: IBaseEnginePublic): IEngineExtensions;
60
+ export declare function getEngineExtension<K extends keyof IEngineExtensions>(engineState: IBaseEnginePublic, type: K): IEngineExtensions[K];
61
+ export declare function loadExtension<K extends keyof IEngineExtensions>(type: K, extension: IEngineExtensions[K], engineType?: string): IEngineExtensions[K];
62
+ export declare function setExtension<K extends keyof IEngineExtensions, T extends IBaseEnginePublic>(engineState: T, type: K, extension: IEngineExtensions[K]): void;
63
+ /**
64
+ * Augment an engine state with the extensions tht are already loaded
65
+ * @param engineState the engine state to augment
66
+ */
67
+ export declare function augmentEngineStateWithExtensions(engineState: IBaseEnginePublic): void;
@@ -0,0 +1,49 @@
1
+ /* eslint-disable jsdoc/require-jsdoc */
2
+ import { augmentEngineState } from "../engine.adapters.js";
3
+ const loadedExtensions = {};
4
+ /**
5
+ * this array stores engine extensions base on the engine unique id
6
+ */
7
+ const engineExtensions = [];
8
+ export function getEngineExtensions(engineState) {
9
+ engineExtensions[engineState.uniqueId] = engineExtensions[engineState.uniqueId] || {};
10
+ return engineExtensions[engineState.uniqueId];
11
+ }
12
+ export function getEngineExtension(engineState, type) {
13
+ try {
14
+ return getEngineExtensions(engineState)[type];
15
+ }
16
+ catch (e) {
17
+ throw new Error(`Extension ${type} is not available`);
18
+ }
19
+ }
20
+ export function loadExtension(type, extension, engineType = "WebGL" /* WebGL | WebGPU */) {
21
+ loadedExtensions[engineType] = loadedExtensions[engineType] || {};
22
+ loadedExtensions[engineType][type] = extension;
23
+ return extension;
24
+ }
25
+ export function setExtension(engineState, type, extension) {
26
+ const extensions = getEngineExtensions(engineState);
27
+ // the any cast is required to avoid TS error when setting the extension
28
+ extensions[type] = extension;
29
+ // augment the engine state with these functions
30
+ // casted to any, as this is a legacy solution and is not part of the engine interface
31
+ augmentEngineState(engineState, extension);
32
+ if (!loadedExtensions[type]) {
33
+ loadExtension(type, extension, engineState.name);
34
+ }
35
+ }
36
+ /**
37
+ * Augment an engine state with the extensions tht are already loaded
38
+ * @param engineState the engine state to augment
39
+ */
40
+ export function augmentEngineStateWithExtensions(engineState) {
41
+ const engineType = engineState.name;
42
+ // augment the engine state with these functions
43
+ // casted to any, as this is a legacy solution and is not part of the engine interface
44
+ const extensionsTypeArray = Object.keys(loadedExtensions[engineType]);
45
+ for (const extension of extensionsTypeArray) {
46
+ setExtension(engineState, extension, loadedExtensions[engineType][extension]);
47
+ }
48
+ }
49
+ //# sourceMappingURL=engine.extensions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine.extensions.js","sourceRoot":"","sources":["../../../../../../dev/core/src/esm/Engines/Extensions/engine.extensions.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAgExD,MAAM,gBAAgB,GAAyC,EAAE,CAAC;AAElE;;GAEG;AACH,MAAM,gBAAgB,GAAwB,EAAE,CAAC;AAEjD,MAAM,UAAU,mBAAmB,CAAC,WAA8B;IAC9D,gBAAgB,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,gBAAgB,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAK,EAAwB,CAAC;IAC7G,OAAO,gBAAgB,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAoC,WAA8B,EAAE,IAAO;IACzG,IAAI;QACA,OAAO,mBAAmB,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC;KACjD;IAAC,OAAO,CAAC,EAAE;QACR,MAAM,IAAI,KAAK,CAAC,aAAa,IAAI,mBAAmB,CAAC,CAAC;KACzD;AACL,CAAC;AAED,MAAM,UAAU,aAAa,CACzB,IAAO,EACP,SAA+B,EAC/B,aAAqB,OAAO,CAAC,oBAAoB;IAEjD,gBAAgB,CAAC,UAAU,CAAC,GAAG,gBAAgB,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;IAClE,gBAAgB,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;IAC/C,OAAO,SAAS,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,YAAY,CAAiE,WAAc,EAAE,IAAO,EAAE,SAA+B;IACjJ,MAAM,UAAU,GAAG,mBAAmB,CAAC,WAAW,CAAC,CAAC;IACpD,wEAAwE;IACxE,UAAU,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;IAC7B,gDAAgD;IAChD,sFAAsF;IACtF,kBAAkB,CAAC,WAAkB,EAAE,SAAgB,CAAC,CAAC;IAEzD,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE;QACzB,aAAa,CAAC,IAAI,EAAE,SAAS,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;KACpD;AACL,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gCAAgC,CAAC,WAA8B;IAC3E,MAAM,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC;IACpC,gDAAgD;IAChD,sFAAsF;IACtF,MAAM,mBAAmB,GAAG,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAkC,CAAC;IACvG,KAAK,MAAM,SAAS,IAAI,mBAAmB,EAAE;QACzC,YAAY,CAAC,WAAW,EAAE,SAAS,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;KACjF;AACL,CAAC","sourcesContent":["/* eslint-disable jsdoc/require-jsdoc */\r\nimport { augmentEngineState } from \"../engine.adapters\";\r\nimport type { IBaseEnginePublic } from \"../engine.base\";\r\nimport type { ICubeTextureEngineExtension } from \"./cubeTexture/cubeTexture.base\";\r\nimport type { IRawTextureEngineExtension } from \"./rawTexture/engine.rawTexture.base\";\r\nimport type { IMultiRenderEngineExtension } from \"./multiRender/multiRender.base\";\r\nimport type { IRenderTargetEngineExtension } from \"./renderTarget/renderTarget.base\";\r\nimport type { ITransformFeedbackEngineExtension } from \"./transformFeedback/engine.transformFeedback.base\";\r\nimport type { IAlphaEngineExtension } from \"./alpha/alpha.base\";\r\nimport type { IDynamicBufferEngineExtension } from \"./dynamicBuffer/dynamicBuffer.base\";\r\nimport type { IQueryEngineExtension } from \"./query/query.base\";\r\nimport type { IDynamicTextureEngineExtension } from \"./dynamicTexture/dynamicTexture.base\";\r\nimport type { IViewsEngineExtension } from \"./views/views.base\";\r\nimport type { IMultiviewEngineExtension } from \"./multiview/multiview.base\";\r\nimport type { IReadTextureEngineExtension } from \"./readTexture/readTexture.base\";\r\nimport type { IRenderTargetCubeEngineExtension } from \"./renderTargetCube/renderTargetCube.base\";\r\nimport type { ITextureSelectorEngineExtension } from \"./textureSelector/textureSelector.base\";\r\nimport type { IUniformBufferEngineExtension } from \"./uniformBuffer/uniformBuffer.base\";\r\nimport type { IVideoTextureEngineExtension } from \"./videoTexture/videoTexture.base\";\r\n\r\nexport const enum EngineExtensions {\r\n RAW_TEXTURE = 0,\r\n TRANSFORM_FEEDBACK = 1,\r\n RENDER_TARGET = 2,\r\n MULTI_RENDER = 3,\r\n CUBE_TEXTURE = 4,\r\n ALPHA = 5,\r\n QUERY = 6,\r\n DYNAMIC_BUFFER = 7,\r\n DYNAMIC_TEXTURE = 8,\r\n VIEWS = 9,\r\n MULTIVIEW = 10,\r\n READ_TEXTURE = 11,\r\n RENDER_TARGET_CUBE = 12,\r\n TEXTURE_SELECTOR = 13,\r\n UNIFORM_BUFFER = 14,\r\n VIDEO_TEXTURE = 15,\r\n}\r\n\r\nexport interface IBaseEngineExtension {\r\n extensionState: any;\r\n initExtension(): void;\r\n}\r\n\r\nexport interface IEngineExtensions {\r\n [EngineExtensions.RAW_TEXTURE]?: IRawTextureEngineExtension;\r\n [EngineExtensions.TRANSFORM_FEEDBACK]?: ITransformFeedbackEngineExtension;\r\n [EngineExtensions.RENDER_TARGET]?: IRenderTargetEngineExtension;\r\n [EngineExtensions.MULTI_RENDER]?: IMultiRenderEngineExtension;\r\n [EngineExtensions.CUBE_TEXTURE]?: ICubeTextureEngineExtension;\r\n [EngineExtensions.ALPHA]?: IAlphaEngineExtension;\r\n [EngineExtensions.QUERY]?: IQueryEngineExtension;\r\n [EngineExtensions.DYNAMIC_BUFFER]?: IDynamicBufferEngineExtension;\r\n [EngineExtensions.DYNAMIC_TEXTURE]?: IDynamicTextureEngineExtension;\r\n [EngineExtensions.VIEWS]?: IViewsEngineExtension;\r\n [EngineExtensions.MULTIVIEW]?: IMultiviewEngineExtension;\r\n [EngineExtensions.READ_TEXTURE]?: IReadTextureEngineExtension;\r\n [EngineExtensions.RENDER_TARGET_CUBE]?: IRenderTargetCubeEngineExtension;\r\n [EngineExtensions.TEXTURE_SELECTOR]?: ITextureSelectorEngineExtension;\r\n [EngineExtensions.UNIFORM_BUFFER]?: IUniformBufferEngineExtension;\r\n [EngineExtensions.VIDEO_TEXTURE]?: IVideoTextureEngineExtension;\r\n}\r\n\r\nexport type IEngineExtension = IEngineExtensions[EngineExtensions];\r\n\r\nconst loadedExtensions: { [key: string]: IEngineExtensions } = {};\r\n\r\n/**\r\n * this array stores engine extensions base on the engine unique id\r\n */\r\nconst engineExtensions: IEngineExtensions[] = [];\r\n\r\nexport function getEngineExtensions(engineState: IBaseEnginePublic): IEngineExtensions {\r\n engineExtensions[engineState.uniqueId] = engineExtensions[engineState.uniqueId] || ({} as IEngineExtensions);\r\n return engineExtensions[engineState.uniqueId];\r\n}\r\n\r\nexport function getEngineExtension<K extends keyof IEngineExtensions>(engineState: IBaseEnginePublic, type: K): IEngineExtensions[K] {\r\n try {\r\n return getEngineExtensions(engineState)[type];\r\n } catch (e) {\r\n throw new Error(`Extension ${type} is not available`);\r\n }\r\n}\r\n\r\nexport function loadExtension<K extends keyof IEngineExtensions>(\r\n type: K,\r\n extension: IEngineExtensions[K],\r\n engineType: string = \"WebGL\" /* WebGL | WebGPU */\r\n): IEngineExtensions[K] {\r\n loadedExtensions[engineType] = loadedExtensions[engineType] || {};\r\n loadedExtensions[engineType][type] = extension;\r\n return extension;\r\n}\r\n\r\nexport function setExtension<K extends keyof IEngineExtensions, T extends IBaseEnginePublic>(engineState: T, type: K, extension: IEngineExtensions[K]) {\r\n const extensions = getEngineExtensions(engineState);\r\n // the any cast is required to avoid TS error when setting the extension\r\n extensions[type] = extension;\r\n // augment the engine state with these functions\r\n // casted to any, as this is a legacy solution and is not part of the engine interface\r\n augmentEngineState(engineState as any, extension as any);\r\n\r\n if (!loadedExtensions[type]) {\r\n loadExtension(type, extension, engineState.name);\r\n }\r\n}\r\n\r\n/**\r\n * Augment an engine state with the extensions tht are already loaded\r\n * @param engineState the engine state to augment\r\n */\r\nexport function augmentEngineStateWithExtensions(engineState: IBaseEnginePublic) {\r\n const engineType = engineState.name;\r\n // augment the engine state with these functions\r\n // casted to any, as this is a legacy solution and is not part of the engine interface\r\n const extensionsTypeArray = Object.keys(loadedExtensions[engineType]) as unknown as EngineExtensions[];\r\n for (const extension of extensionsTypeArray) {\r\n setExtension(engineState, extension, loadedExtensions[engineType][extension]);\r\n }\r\n}\r\n"]}
@@ -0,0 +1,16 @@
1
+ import type { ExternalTexture } from "../../../../Materials/Textures/externalTexture.js";
2
+ import type { Nullable } from "../../../../types.js";
3
+ export interface IExternalTextureEngineExtension {
4
+ /**
5
+ * Creates an external texture
6
+ * @param video video element
7
+ * @returns the external texture, or null if external textures are not supported by the engine
8
+ */
9
+ createExternalTexture(video: HTMLVideoElement): Nullable<ExternalTexture>;
10
+ /**
11
+ * Sets an internal texture to the according uniform.
12
+ * @param name The name of the uniform in the effect
13
+ * @param texture The texture to apply
14
+ */
15
+ setExternalTexture(name: string, texture: Nullable<ExternalTexture>): void;
16
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=externalTexture.base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"externalTexture.base.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/esm/Engines/Extensions/externalTexture/externalTexture.base.ts"],"names":[],"mappings":"","sourcesContent":["import type { ExternalTexture } from \"core/Materials/Textures/externalTexture\";\r\nimport type { Nullable } from \"core/types\";\r\n\r\nexport interface IExternalTextureEngineExtension {\r\n /**\r\n * Creates an external texture\r\n * @param video video element\r\n * @returns the external texture, or null if external textures are not supported by the engine\r\n */\r\n createExternalTexture(video: HTMLVideoElement): Nullable<ExternalTexture>;\r\n\r\n /**\r\n * Sets an internal texture to the according uniform.\r\n * @param name The name of the uniform in the effect\r\n * @param texture The texture to apply\r\n */\r\n setExternalTexture(name: string, texture: Nullable<ExternalTexture>): void;\r\n}\r\n"]}
@@ -0,0 +1,54 @@
1
+ import type { RenderTargetWrapper } from "../../../../Engines/renderTargetWrapper.js";
2
+ import type { IMultiRenderTargetOptions } from "../../../../Materials/Textures/multiRenderTarget.js";
3
+ import type { TextureSize } from "../../../../Materials/Textures/textureCreationOptions.js";
4
+ import type { Nullable } from "../../../../types.js";
5
+ import type { IBaseEnginePublic } from "../../engine.base";
6
+ export interface IMultiRenderEngineExtension {
7
+ /**
8
+ * Unbind a list of render target textures from the webGL context
9
+ * This is used only when drawBuffer extension or webGL2 are active
10
+ * @param rtWrapper defines the render target wrapper to unbind
11
+ * @param disableGenerateMipMaps defines a boolean indicating that mipmaps must not be generated
12
+ * @param onBeforeUnbind defines a function which will be called before the effective unbind
13
+ */
14
+ unBindMultiColorAttachmentFramebuffer(engineState: IBaseEnginePublic, rtWrapper: RenderTargetWrapper, disableGenerateMipMaps: boolean, onBeforeUnbind?: () => void): void;
15
+ /**
16
+ * Create a multi render target texture
17
+ * @see https://doc.babylonjs.com/setup/support/webGL2#multiple-render-target
18
+ * @param size defines the size of the texture
19
+ * @param options defines the creation options
20
+ * @param initializeBuffers if set to true, the engine will make an initializing call of drawBuffers
21
+ * @returns a new render target wrapper ready to render textures
22
+ */
23
+ createMultipleRenderTarget(engineState: IBaseEnginePublic, size: TextureSize, options: IMultiRenderTargetOptions, initializeBuffers?: boolean): RenderTargetWrapper;
24
+ /**
25
+ * Update the sample count for a given multiple render target texture
26
+ * @see https://doc.babylonjs.com/setup/support/webGL2#multisample-render-targets
27
+ * @param rtWrapper defines the render target wrapper to update
28
+ * @param samples defines the sample count to set
29
+ * @param initializeBuffers if set to true, the engine will make an initializing call of drawBuffers
30
+ * @returns the effective sample count (could be 0 if multisample render targets are not supported)
31
+ */
32
+ updateMultipleRenderTargetTextureSampleCount(engineState: IBaseEnginePublic, rtWrapper: Nullable<RenderTargetWrapper>, samples: number, initializeBuffers?: boolean): number;
33
+ /**
34
+ * Select a subsets of attachments to draw to.
35
+ * @param attachments gl attachments
36
+ */
37
+ bindAttachments(engineState: IBaseEnginePublic, attachments: number[]): void;
38
+ /**
39
+ * Creates a layout object to draw/clear on specific textures in a MRT
40
+ * @param textureStatus textureStatus[i] indicates if the i-th is active
41
+ * @returns A layout to be fed to the engine, calling `bindAttachments`.
42
+ */
43
+ buildTextureLayout(engineState: IBaseEnginePublic, textureStatus: boolean[]): number[];
44
+ /**
45
+ * Restores the webgl state to only draw on the main color attachment
46
+ * when the frame buffer associated is the canvas frame buffer
47
+ */
48
+ restoreSingleAttachment(engineState: IBaseEnginePublic): void;
49
+ /**
50
+ * Restores the webgl state to only draw on the main color attachment
51
+ * when the frame buffer associated is not the canvas frame buffer
52
+ */
53
+ restoreSingleAttachmentForRenderTarget(engineState: IBaseEnginePublic): void;
54
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=multiRender.base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multiRender.base.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/esm/Engines/Extensions/multiRender/multiRender.base.ts"],"names":[],"mappings":"","sourcesContent":["import type { RenderTargetWrapper } from \"core/Engines/renderTargetWrapper\";\r\nimport type { IMultiRenderTargetOptions } from \"core/Materials/Textures/multiRenderTarget\";\r\nimport type { TextureSize } from \"core/Materials/Textures/textureCreationOptions\";\r\nimport type { Nullable } from \"core/types\";\r\nimport type { IBaseEnginePublic } from \"../../engine.base\";\r\n\r\nexport interface IMultiRenderEngineExtension {\r\n /**\r\n * Unbind a list of render target textures from the webGL context\r\n * This is used only when drawBuffer extension or webGL2 are active\r\n * @param rtWrapper defines the render target wrapper to unbind\r\n * @param disableGenerateMipMaps defines a boolean indicating that mipmaps must not be generated\r\n * @param onBeforeUnbind defines a function which will be called before the effective unbind\r\n */\r\n unBindMultiColorAttachmentFramebuffer(engineState: IBaseEnginePublic, rtWrapper: RenderTargetWrapper, disableGenerateMipMaps: boolean, onBeforeUnbind?: () => void): void;\r\n\r\n /**\r\n * Create a multi render target texture\r\n * @see https://doc.babylonjs.com/setup/support/webGL2#multiple-render-target\r\n * @param size defines the size of the texture\r\n * @param options defines the creation options\r\n * @param initializeBuffers if set to true, the engine will make an initializing call of drawBuffers\r\n * @returns a new render target wrapper ready to render textures\r\n */\r\n createMultipleRenderTarget(engineState: IBaseEnginePublic, size: TextureSize, options: IMultiRenderTargetOptions, initializeBuffers?: boolean): RenderTargetWrapper;\r\n\r\n /**\r\n * Update the sample count for a given multiple render target texture\r\n * @see https://doc.babylonjs.com/setup/support/webGL2#multisample-render-targets\r\n * @param rtWrapper defines the render target wrapper to update\r\n * @param samples defines the sample count to set\r\n * @param initializeBuffers if set to true, the engine will make an initializing call of drawBuffers\r\n * @returns the effective sample count (could be 0 if multisample render targets are not supported)\r\n */\r\n updateMultipleRenderTargetTextureSampleCount(engineState: IBaseEnginePublic, rtWrapper: Nullable<RenderTargetWrapper>, samples: number, initializeBuffers?: boolean): number;\r\n\r\n /**\r\n * Select a subsets of attachments to draw to.\r\n * @param attachments gl attachments\r\n */\r\n bindAttachments(engineState: IBaseEnginePublic, attachments: number[]): void;\r\n\r\n /**\r\n * Creates a layout object to draw/clear on specific textures in a MRT\r\n * @param textureStatus textureStatus[i] indicates if the i-th is active\r\n * @returns A layout to be fed to the engine, calling `bindAttachments`.\r\n */\r\n buildTextureLayout(engineState: IBaseEnginePublic, textureStatus: boolean[]): number[];\r\n\r\n /**\r\n * Restores the webgl state to only draw on the main color attachment\r\n * when the frame buffer associated is the canvas frame buffer\r\n */\r\n restoreSingleAttachment(engineState: IBaseEnginePublic): void;\r\n\r\n /**\r\n * Restores the webgl state to only draw on the main color attachment\r\n * when the frame buffer associated is not the canvas frame buffer\r\n */\r\n restoreSingleAttachmentForRenderTarget(engineState: IBaseEnginePublic): void;\r\n}\r\n"]}
@@ -0,0 +1,67 @@
1
+ import type { RenderTargetWrapper } from "../../../../Engines/renderTargetWrapper.js";
2
+ import type { IBaseEnginePublic } from "../../engine.base";
3
+ import { Camera } from "../../../../Cameras/camera.js";
4
+ import type { RenderTargetTexture } from "../../../../Materials/Textures/renderTargetTexture.js";
5
+ import { UniformBuffer } from "../../../../Materials/uniformBuffer.js";
6
+ import { Matrix } from "../../../../Maths/math.vector.js";
7
+ import type { Nullable } from "../../../../types.js";
8
+ export interface IMultiviewEngineExtension {
9
+ /**
10
+ * Creates a new multiview render target
11
+ * @param width defines the width of the texture
12
+ * @param height defines the height of the texture
13
+ * @returns the created multiview render target wrapper
14
+ */
15
+ createMultiviewRenderTargetTexture(engineState: IBaseEnginePublic, width: number, height: number, colorTexture?: WebGLTexture, depthStencilTexture?: WebGLTexture): RenderTargetWrapper;
16
+ /**
17
+ * Binds a multiview render target wrapper to be drawn to
18
+ * @param multiviewTexture render target wrapper to bind
19
+ */
20
+ bindMultiviewFramebuffer(engineState: IBaseEnginePublic, multiviewTexture: RenderTargetWrapper): void;
21
+ /**
22
+ * Binds a Space Warp render target wrapper to be drawn to
23
+ * @param spaceWarpTexture render target wrapper to bind
24
+ */
25
+ bindSpaceWarpFramebuffer(engineState: IBaseEnginePublic, spaceWarpTexture: RenderTargetWrapper): void;
26
+ }
27
+ declare module "core/Cameras/camera.js" {
28
+ interface Camera {
29
+ /**
30
+ * @internal
31
+ * For cameras that cannot use multiview images to display directly. (e.g. webVR camera will render to multiview texture, then copy to each eye texture and go from there)
32
+ */
33
+ _useMultiviewToSingleView: boolean;
34
+ /**
35
+ * @internal
36
+ * For cameras that cannot use multiview images to display directly. (e.g. webVR camera will render to multiview texture, then copy to each eye texture and go from there)
37
+ */
38
+ _multiviewTexture: Nullable<RenderTargetTexture>;
39
+ /**
40
+ * @internal
41
+ * For WebXR cameras that are rendering to multiview texture arrays.
42
+ */
43
+ _renderingMultiview: boolean;
44
+ /**
45
+ * @internal
46
+ * ensures the multiview texture of the camera exists and has the specified width/height
47
+ * @param width height to set on the multiview texture
48
+ * @param height width to set on the multiview texture
49
+ */
50
+ _resizeOrCreateMultiviewTexture(width: number, height: number): void;
51
+ }
52
+ }
53
+ declare module "core/scene.js" {
54
+ interface Scene {
55
+ /** @internal */
56
+ _transformMatrixR: Matrix;
57
+ /** @internal */
58
+ _multiviewSceneUbo: Nullable<UniformBuffer>;
59
+ /** @internal */
60
+ _createMultiviewUbo(): void;
61
+ /** @internal */
62
+ _updateMultiviewUbo(viewR?: Matrix, projectionR?: Matrix): void;
63
+ /** @internal */
64
+ _renderMultiviewToSingleView(camera: Camera): void;
65
+ }
66
+ }
67
+ export declare const initMultiviewExtension: () => void;
@@ -0,0 +1,79 @@
1
+ import { Camera } from "../../../../Cameras/camera.js";
2
+ import { Scene } from "../../../../scene.js";
3
+ import { UniformBuffer } from "../../../../Materials/uniformBuffer.js";
4
+ import { Frustum } from "../../../../Maths/math.frustum.js";
5
+ import { Matrix, TmpVectors } from "../../../../Maths/math.vector.js";
6
+ import { MultiviewRenderTarget } from "../../../../Materials/Textures/MultiviewRenderTarget.js";
7
+ export const initMultiviewExtension = () => {
8
+ Camera.prototype._useMultiviewToSingleView = false;
9
+ Camera.prototype._multiviewTexture = null;
10
+ Camera.prototype._resizeOrCreateMultiviewTexture = function (width, height) {
11
+ if (!this._multiviewTexture) {
12
+ this._multiviewTexture = new MultiviewRenderTarget(this.getScene(), { width: width, height: height });
13
+ }
14
+ else if (this._multiviewTexture.getRenderWidth() != width || this._multiviewTexture.getRenderHeight() != height) {
15
+ this._multiviewTexture.dispose();
16
+ this._multiviewTexture = new MultiviewRenderTarget(this.getScene(), { width: width, height: height });
17
+ }
18
+ };
19
+ function createMultiviewUbo(engine, name) {
20
+ const ubo = new UniformBuffer(engine, undefined, true, name);
21
+ ubo.addUniform("viewProjection", 16);
22
+ ubo.addUniform("viewProjectionR", 16);
23
+ ubo.addUniform("view", 16);
24
+ ubo.addUniform("projection", 16);
25
+ ubo.addUniform("vEyePosition", 4);
26
+ return ubo;
27
+ }
28
+ const currentCreateSceneUniformBuffer = Scene.prototype.createSceneUniformBuffer;
29
+ Scene.prototype._transformMatrixR = Matrix.Zero();
30
+ Scene.prototype._multiviewSceneUbo = null;
31
+ Scene.prototype._createMultiviewUbo = function () {
32
+ this._multiviewSceneUbo = createMultiviewUbo(this.getEngine(), "scene_multiview");
33
+ };
34
+ Scene.prototype.createSceneUniformBuffer = function (name) {
35
+ if (this._multiviewSceneUbo) {
36
+ return createMultiviewUbo(this.getEngine(), name);
37
+ }
38
+ return currentCreateSceneUniformBuffer.bind(this)(name);
39
+ };
40
+ Scene.prototype._updateMultiviewUbo = function (viewR, projectionR) {
41
+ if (viewR && projectionR) {
42
+ viewR.multiplyToRef(projectionR, this._transformMatrixR);
43
+ }
44
+ if (viewR && projectionR) {
45
+ viewR.multiplyToRef(projectionR, TmpVectors.Matrix[0]);
46
+ Frustum.GetRightPlaneToRef(TmpVectors.Matrix[0], this._frustumPlanes[3]); // Replace right plane by second camera right plane
47
+ }
48
+ if (this._multiviewSceneUbo) {
49
+ this._multiviewSceneUbo.updateMatrix("viewProjection", this.getTransformMatrix());
50
+ this._multiviewSceneUbo.updateMatrix("viewProjectionR", this._transformMatrixR);
51
+ this._multiviewSceneUbo.updateMatrix("view", this._viewMatrix);
52
+ this._multiviewSceneUbo.updateMatrix("projection", this._projectionMatrix);
53
+ }
54
+ };
55
+ Scene.prototype._renderMultiviewToSingleView = function (camera) {
56
+ // Multiview is only able to be displayed directly for API's such as webXR
57
+ // This displays a multiview image by rendering to the multiview image and then
58
+ // copying the result into the sub cameras instead of rendering them and proceeding as normal from there
59
+ // Render to a multiview texture
60
+ camera._resizeOrCreateMultiviewTexture(camera._rigPostProcess && camera._rigPostProcess && camera._rigPostProcess.width > 0 ? camera._rigPostProcess.width : this.getEngine().getRenderWidth(true), camera._rigPostProcess && camera._rigPostProcess && camera._rigPostProcess.height > 0 ? camera._rigPostProcess.height : this.getEngine().getRenderHeight(true));
61
+ if (!this._multiviewSceneUbo) {
62
+ this._createMultiviewUbo();
63
+ }
64
+ camera.outputRenderTarget = camera._multiviewTexture;
65
+ this._renderForCamera(camera);
66
+ camera.outputRenderTarget = null;
67
+ // Consume the multiview texture through a shader for each eye
68
+ for (let index = 0; index < camera._rigCameras.length; index++) {
69
+ const engine = this.getEngine();
70
+ this._activeCamera = camera._rigCameras[index];
71
+ engine.setViewport(this._activeCamera.viewport);
72
+ if (this.postProcessManager) {
73
+ this.postProcessManager._prepareFrame();
74
+ this.postProcessManager._finalizeFrame(this._activeCamera.isIntermediate);
75
+ }
76
+ }
77
+ };
78
+ };
79
+ //# sourceMappingURL=multiview.base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multiview.base.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/esm/Engines/Extensions/multiview/multiview.base.ts"],"names":[],"mappings":"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","sourcesContent":["import type { RenderTargetWrapper } from \"core/Engines/renderTargetWrapper\";\r\nimport type { IBaseEnginePublic } from \"../../engine.base\";\r\nimport { Camera } from \"core/Cameras/camera\";\r\nimport { Scene } from \"core/scene\";\r\nimport type { Engine } from \"core/Engines/engine\";\r\nimport type { RenderTargetTexture } from \"core/Materials/Textures/renderTargetTexture\";\r\nimport { UniformBuffer } from \"core/Materials/uniformBuffer\";\r\nimport { Frustum } from \"core/Maths/math.frustum\";\r\nimport { Matrix, TmpVectors } from \"core/Maths/math.vector\";\r\nimport type { Nullable } from \"core/types\";\r\nimport { MultiviewRenderTarget } from \"core/Materials/Textures/MultiviewRenderTarget\";\r\n\r\nexport interface IMultiviewEngineExtension {\r\n /**\r\n * Creates a new multiview render target\r\n * @param width defines the width of the texture\r\n * @param height defines the height of the texture\r\n * @returns the created multiview render target wrapper\r\n */\r\n createMultiviewRenderTargetTexture(\r\n engineState: IBaseEnginePublic,\r\n width: number,\r\n height: number,\r\n colorTexture?: WebGLTexture,\r\n depthStencilTexture?: WebGLTexture\r\n ): RenderTargetWrapper;\r\n\r\n /**\r\n * Binds a multiview render target wrapper to be drawn to\r\n * @param multiviewTexture render target wrapper to bind\r\n */\r\n bindMultiviewFramebuffer(engineState: IBaseEnginePublic, multiviewTexture: RenderTargetWrapper): void;\r\n\r\n /**\r\n * Binds a Space Warp render target wrapper to be drawn to\r\n * @param spaceWarpTexture render target wrapper to bind\r\n */\r\n bindSpaceWarpFramebuffer(engineState: IBaseEnginePublic, spaceWarpTexture: RenderTargetWrapper): void;\r\n}\r\ndeclare module \"core/Cameras/camera.js\" {\r\n export interface Camera {\r\n /**\r\n * @internal\r\n * For cameras that cannot use multiview images to display directly. (e.g. webVR camera will render to multiview texture, then copy to each eye texture and go from there)\r\n */\r\n _useMultiviewToSingleView: boolean;\r\n /**\r\n * @internal\r\n * For cameras that cannot use multiview images to display directly. (e.g. webVR camera will render to multiview texture, then copy to each eye texture and go from there)\r\n */\r\n _multiviewTexture: Nullable<RenderTargetTexture>;\r\n\r\n /**\r\n * @internal\r\n * For WebXR cameras that are rendering to multiview texture arrays.\r\n */\r\n _renderingMultiview: boolean;\r\n\r\n /**\r\n * @internal\r\n * ensures the multiview texture of the camera exists and has the specified width/height\r\n * @param width height to set on the multiview texture\r\n * @param height width to set on the multiview texture\r\n */\r\n _resizeOrCreateMultiviewTexture(width: number, height: number): void;\r\n }\r\n}\r\n\r\ndeclare module \"core/scene.js\" {\r\n export interface Scene {\r\n /** @internal */\r\n _transformMatrixR: Matrix;\r\n /** @internal */\r\n _multiviewSceneUbo: Nullable<UniformBuffer>;\r\n /** @internal */\r\n _createMultiviewUbo(): void;\r\n /** @internal */\r\n _updateMultiviewUbo(viewR?: Matrix, projectionR?: Matrix): void;\r\n /** @internal */\r\n _renderMultiviewToSingleView(camera: Camera): void;\r\n }\r\n}\r\n\r\nexport const initMultiviewExtension = () => {\r\n Camera.prototype._useMultiviewToSingleView = false;\r\n\r\n Camera.prototype._multiviewTexture = null;\r\n\r\n Camera.prototype._resizeOrCreateMultiviewTexture = function (width: number, height: number) {\r\n if (!this._multiviewTexture) {\r\n this._multiviewTexture = new MultiviewRenderTarget(this.getScene(), { width: width, height: height });\r\n } else if (this._multiviewTexture.getRenderWidth() != width || this._multiviewTexture.getRenderHeight() != height) {\r\n this._multiviewTexture.dispose();\r\n this._multiviewTexture = new MultiviewRenderTarget(this.getScene(), { width: width, height: height });\r\n }\r\n };\r\n\r\n function createMultiviewUbo(engine: Engine, name?: string) {\r\n const ubo = new UniformBuffer(engine, undefined, true, name);\r\n ubo.addUniform(\"viewProjection\", 16);\r\n ubo.addUniform(\"viewProjectionR\", 16);\r\n ubo.addUniform(\"view\", 16);\r\n ubo.addUniform(\"projection\", 16);\r\n ubo.addUniform(\"vEyePosition\", 4);\r\n return ubo;\r\n }\r\n\r\n const currentCreateSceneUniformBuffer = Scene.prototype.createSceneUniformBuffer;\r\n\r\n Scene.prototype._transformMatrixR = Matrix.Zero();\r\n Scene.prototype._multiviewSceneUbo = null;\r\n Scene.prototype._createMultiviewUbo = function () {\r\n this._multiviewSceneUbo = createMultiviewUbo(this.getEngine(), \"scene_multiview\");\r\n };\r\n Scene.prototype.createSceneUniformBuffer = function (name?: string): UniformBuffer {\r\n if (this._multiviewSceneUbo) {\r\n return createMultiviewUbo(this.getEngine(), name);\r\n }\r\n return currentCreateSceneUniformBuffer.bind(this)(name);\r\n };\r\n Scene.prototype._updateMultiviewUbo = function (viewR?: Matrix, projectionR?: Matrix) {\r\n if (viewR && projectionR) {\r\n viewR.multiplyToRef(projectionR, this._transformMatrixR);\r\n }\r\n\r\n if (viewR && projectionR) {\r\n viewR.multiplyToRef(projectionR, TmpVectors.Matrix[0]);\r\n Frustum.GetRightPlaneToRef(TmpVectors.Matrix[0], this._frustumPlanes[3]); // Replace right plane by second camera right plane\r\n }\r\n\r\n if (this._multiviewSceneUbo) {\r\n this._multiviewSceneUbo.updateMatrix(\"viewProjection\", this.getTransformMatrix());\r\n this._multiviewSceneUbo.updateMatrix(\"viewProjectionR\", this._transformMatrixR);\r\n this._multiviewSceneUbo.updateMatrix(\"view\", this._viewMatrix);\r\n this._multiviewSceneUbo.updateMatrix(\"projection\", this._projectionMatrix);\r\n }\r\n };\r\n Scene.prototype._renderMultiviewToSingleView = function (camera: Camera) {\r\n // Multiview is only able to be displayed directly for API's such as webXR\r\n // This displays a multiview image by rendering to the multiview image and then\r\n // copying the result into the sub cameras instead of rendering them and proceeding as normal from there\r\n\r\n // Render to a multiview texture\r\n camera._resizeOrCreateMultiviewTexture(\r\n camera._rigPostProcess && camera._rigPostProcess && camera._rigPostProcess.width > 0 ? camera._rigPostProcess.width : this.getEngine().getRenderWidth(true),\r\n camera._rigPostProcess && camera._rigPostProcess && camera._rigPostProcess.height > 0 ? camera._rigPostProcess.height : this.getEngine().getRenderHeight(true)\r\n );\r\n if (!this._multiviewSceneUbo) {\r\n this._createMultiviewUbo();\r\n }\r\n camera.outputRenderTarget = camera._multiviewTexture;\r\n this._renderForCamera(camera);\r\n camera.outputRenderTarget = null;\r\n\r\n // Consume the multiview texture through a shader for each eye\r\n for (let index = 0; index < camera._rigCameras.length; index++) {\r\n const engine = this.getEngine();\r\n this._activeCamera = camera._rigCameras[index];\r\n engine.setViewport(this._activeCamera.viewport);\r\n if (this.postProcessManager) {\r\n this.postProcessManager._prepareFrame();\r\n this.postProcessManager._finalizeFrame(this._activeCamera.isIntermediate);\r\n }\r\n }\r\n };\r\n};\r\n"]}