@babylonjs/core 6.33.1 → 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 (488) hide show
  1. package/Animations/animation.js +1 -1
  2. package/Animations/animation.js.map +1 -1
  3. package/Animations/animationGroup.js +2 -2
  4. package/Animations/animationGroup.js.map +1 -1
  5. package/Animations/animationGroupMask.d.ts +4 -0
  6. package/Animations/animationGroupMask.js +4 -0
  7. package/Animations/animationGroupMask.js.map +1 -1
  8. package/Buffers/storageBuffer.d.ts +2 -1
  9. package/Buffers/storageBuffer.js +3 -2
  10. package/Buffers/storageBuffer.js.map +1 -1
  11. package/Cameras/Inputs/followCameraMouseWheelInput.js +12 -9
  12. package/Cameras/Inputs/followCameraMouseWheelInput.js.map +1 -1
  13. package/Cameras/Inputs/followCameraPointersInput.js +28 -9
  14. package/Cameras/Inputs/followCameraPointersInput.js.map +1 -1
  15. package/Cameras/arcRotateCamera.js +1 -1
  16. package/Cameras/arcRotateCamera.js.map +1 -1
  17. package/Cameras/followCameraInputsManager.js +2 -1
  18. package/Cameras/followCameraInputsManager.js.map +1 -1
  19. package/Compute/computeShader.d.ts +5 -0
  20. package/Compute/computeShader.js +42 -32
  21. package/Compute/computeShader.js.map +1 -1
  22. package/Debug/skeletonViewer.js +2 -1
  23. package/Debug/skeletonViewer.js.map +1 -1
  24. package/Engines/Extensions/engine.alpha.js +8 -116
  25. package/Engines/Extensions/engine.alpha.js.map +1 -1
  26. package/Engines/Extensions/engine.cubeTexture.d.ts +1 -1
  27. package/Engines/Extensions/engine.cubeTexture.js +11 -213
  28. package/Engines/Extensions/engine.cubeTexture.js.map +1 -1
  29. package/Engines/Extensions/engine.dynamicBuffer.js +5 -42
  30. package/Engines/Extensions/engine.dynamicBuffer.js.map +1 -1
  31. package/Engines/Extensions/engine.dynamicTexture.d.ts +1 -1
  32. package/Engines/Extensions/engine.dynamicTexture.js +5 -47
  33. package/Engines/Extensions/engine.dynamicTexture.js.map +1 -1
  34. package/Engines/Extensions/engine.multiRender.js +11 -341
  35. package/Engines/Extensions/engine.multiRender.js.map +1 -1
  36. package/Engines/Extensions/engine.multiview.js +6 -57
  37. package/Engines/Extensions/engine.multiview.js.map +1 -1
  38. package/Engines/Extensions/engine.query.d.ts +8 -2
  39. package/Engines/Extensions/engine.query.js +44 -152
  40. package/Engines/Extensions/engine.query.js.map +1 -1
  41. package/Engines/Extensions/engine.rawTexture.d.ts +1 -1
  42. package/Engines/Extensions/engine.rawTexture.js +20 -361
  43. package/Engines/Extensions/engine.rawTexture.js.map +1 -1
  44. package/Engines/Extensions/engine.readTexture.js +6 -112
  45. package/Engines/Extensions/engine.readTexture.js.map +1 -1
  46. package/Engines/Extensions/engine.renderTarget.d.ts +1 -1
  47. package/Engines/Extensions/engine.renderTarget.js +8 -173
  48. package/Engines/Extensions/engine.renderTarget.js.map +1 -1
  49. package/Engines/Extensions/engine.renderTargetCube.js +4 -55
  50. package/Engines/Extensions/engine.renderTargetCube.js.map +1 -1
  51. package/Engines/Extensions/engine.storageBuffer.d.ts +2 -1
  52. package/Engines/Extensions/engine.storageBuffer.js.map +1 -1
  53. package/Engines/Extensions/engine.textureSelector.js +11 -52
  54. package/Engines/Extensions/engine.textureSelector.js.map +1 -1
  55. package/Engines/Extensions/engine.transformFeedback.js +10 -11
  56. package/Engines/Extensions/engine.transformFeedback.js.map +1 -1
  57. package/Engines/Extensions/engine.uniformBuffer.js +9 -59
  58. package/Engines/Extensions/engine.uniformBuffer.js.map +1 -1
  59. package/Engines/Extensions/engine.videoTexture.js +4 -54
  60. package/Engines/Extensions/engine.videoTexture.js.map +1 -1
  61. package/Engines/Extensions/engine.views.d.ts +2 -24
  62. package/Engines/Extensions/engine.views.js +17 -136
  63. package/Engines/Extensions/engine.views.js.map +1 -1
  64. package/Engines/Processors/shaderCodeInliner.js +15 -14
  65. package/Engines/Processors/shaderCodeInliner.js.map +1 -1
  66. package/Engines/WebGPU/Extensions/engine.computeShader.js +7 -4
  67. package/Engines/WebGPU/Extensions/engine.computeShader.js.map +1 -1
  68. package/Engines/WebGPU/Extensions/engine.storageBuffer.js +14 -5
  69. package/Engines/WebGPU/Extensions/engine.storageBuffer.js.map +1 -1
  70. package/Engines/WebGPU/webgpuShaderProcessor.js +2 -1
  71. package/Engines/WebGPU/webgpuShaderProcessor.js.map +1 -1
  72. package/Engines/WebGPU/webgpuTintWASM.js +3 -2
  73. package/Engines/WebGPU/webgpuTintWASM.js.map +1 -1
  74. package/Engines/engine.d.ts +31 -74
  75. package/Engines/engine.js +322 -773
  76. package/Engines/engine.js.map +1 -1
  77. package/Engines/nativeEngine.d.ts +1 -1
  78. package/Engines/nativeEngine.js.map +1 -1
  79. package/Engines/nullEngine.d.ts +1 -1
  80. package/Engines/nullEngine.js.map +1 -1
  81. package/Engines/thinEngine.d.ts +160 -151
  82. package/Engines/thinEngine.js +712 -3280
  83. package/Engines/thinEngine.js.map +1 -1
  84. package/Engines/webgpuEngine.d.ts +5 -8
  85. package/Engines/webgpuEngine.js +143 -112
  86. package/Engines/webgpuEngine.js.map +1 -1
  87. package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.d.ts +296 -0
  88. package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js +758 -0
  89. package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js.map +1 -0
  90. package/FlowGraph/Blocks/Data/Math/index.d.ts +1 -5
  91. package/FlowGraph/Blocks/Data/Math/index.js +1 -5
  92. package/FlowGraph/Blocks/Data/Math/index.js.map +1 -1
  93. package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.d.ts +2 -2
  94. package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js +3 -3
  95. package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js.map +1 -1
  96. package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.d.ts +1 -1
  97. package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js +3 -3
  98. package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js.map +1 -1
  99. package/FlowGraph/Blocks/Data/flowGraphConstantBlock.d.ts +1 -0
  100. package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js +5 -0
  101. package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js.map +1 -1
  102. package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.d.ts +25 -0
  103. package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js +22 -0
  104. package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js.map +1 -0
  105. package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.d.ts +11 -5
  106. package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js +12 -6
  107. package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js.map +1 -1
  108. package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.d.ts +19 -0
  109. package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.js +22 -0
  110. package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.js.map +1 -0
  111. package/FlowGraph/Blocks/Data/index.d.ts +1 -0
  112. package/FlowGraph/Blocks/Data/index.js +1 -0
  113. package/FlowGraph/Blocks/Data/index.js.map +1 -1
  114. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.d.ts +10 -5
  115. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js +15 -5
  116. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js.map +1 -1
  117. package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.d.ts +1 -0
  118. package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.js +2 -1
  119. package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.js.map +1 -1
  120. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.d.ts +1 -0
  121. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.js +3 -2
  122. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.js.map +1 -1
  123. package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.d.ts +2 -2
  124. package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js +3 -3
  125. package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js.map +1 -1
  126. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.d.ts +0 -5
  127. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js +2 -3
  128. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js.map +1 -1
  129. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.d.ts +2 -2
  130. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js +3 -3
  131. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js.map +1 -1
  132. package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.d.ts +2 -2
  133. package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js +3 -3
  134. package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js.map +1 -1
  135. package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.d.ts +2 -2
  136. package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js +2 -2
  137. package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js.map +1 -1
  138. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.d.ts +2 -2
  139. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js +3 -3
  140. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js.map +1 -1
  141. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.d.ts +2 -2
  142. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js +3 -3
  143. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js.map +1 -1
  144. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.d.ts +13 -5
  145. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js +14 -12
  146. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js.map +1 -1
  147. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.d.ts +2 -6
  148. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js +3 -4
  149. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js.map +1 -1
  150. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.d.ts +16 -0
  151. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.js +26 -0
  152. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.js.map +1 -0
  153. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.d.ts +2 -2
  154. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js +3 -3
  155. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js.map +1 -1
  156. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.d.ts +1 -6
  157. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js +4 -4
  158. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js.map +1 -1
  159. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.d.ts +2 -2
  160. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js +4 -4
  161. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js.map +1 -1
  162. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.d.ts +3 -2
  163. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js +6 -5
  164. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js.map +1 -1
  165. package/FlowGraph/Blocks/Execution/ControlFlow/index.d.ts +1 -0
  166. package/FlowGraph/Blocks/Execution/ControlFlow/index.js +1 -0
  167. package/FlowGraph/Blocks/Execution/ControlFlow/index.js.map +1 -1
  168. package/FlowGraph/Blocks/Execution/{flowGraphLogBlock.d.ts → flowGraphConsoleLogBlock.d.ts} +3 -2
  169. package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js +29 -0
  170. package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js.map +1 -0
  171. package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.d.ts +16 -8
  172. package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js +17 -10
  173. package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js.map +1 -1
  174. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.d.ts +4 -3
  175. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js +7 -6
  176. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js.map +1 -1
  177. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.d.ts +12 -7
  178. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js +10 -9
  179. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js.map +1 -1
  180. package/FlowGraph/Blocks/Execution/index.d.ts +1 -2
  181. package/FlowGraph/Blocks/Execution/index.js +1 -3
  182. package/FlowGraph/Blocks/Execution/index.js.map +1 -1
  183. package/FlowGraph/flowGraph.d.ts +3 -1
  184. package/FlowGraph/flowGraph.js +6 -2
  185. package/FlowGraph/flowGraph.js.map +1 -1
  186. package/FlowGraph/flowGraphAsyncExecutionBlock.d.ts +6 -2
  187. package/FlowGraph/flowGraphAsyncExecutionBlock.js +2 -1
  188. package/FlowGraph/flowGraphAsyncExecutionBlock.js.map +1 -1
  189. package/FlowGraph/flowGraphBlock.d.ts +7 -2
  190. package/FlowGraph/flowGraphBlock.js +21 -19
  191. package/FlowGraph/flowGraphBlock.js.map +1 -1
  192. package/FlowGraph/flowGraphContext.d.ts +9 -5
  193. package/FlowGraph/flowGraphContext.js +7 -2
  194. package/FlowGraph/flowGraphContext.js.map +1 -1
  195. package/FlowGraph/flowGraphCoordinator.d.ts +4 -5
  196. package/FlowGraph/flowGraphCoordinator.js +12 -7
  197. package/FlowGraph/flowGraphCoordinator.js.map +1 -1
  198. package/FlowGraph/flowGraphEventBlock.js +1 -1
  199. package/FlowGraph/flowGraphEventBlock.js.map +1 -1
  200. package/FlowGraph/flowGraphExecutionBlock.d.ts +4 -2
  201. package/FlowGraph/flowGraphExecutionBlock.js +25 -9
  202. package/FlowGraph/flowGraphExecutionBlock.js.map +1 -1
  203. package/FlowGraph/flowGraphPath.d.ts +20 -2
  204. package/FlowGraph/flowGraphPath.js +27 -7
  205. package/FlowGraph/flowGraphPath.js.map +1 -1
  206. package/FlowGraph/flowGraphWithOnDoneExecutionBlock.d.ts +3 -3
  207. package/FlowGraph/flowGraphWithOnDoneExecutionBlock.js +3 -3
  208. package/FlowGraph/flowGraphWithOnDoneExecutionBlock.js.map +1 -1
  209. package/FlowGraph/index.d.ts +3 -0
  210. package/FlowGraph/index.js +3 -0
  211. package/FlowGraph/index.js.map +1 -1
  212. package/FlowGraph/serialization.js +20 -6
  213. package/FlowGraph/serialization.js.map +1 -1
  214. package/FlowGraph/typeDefinitions.d.ts +33 -0
  215. package/FlowGraph/typeDefinitions.js +2 -0
  216. package/FlowGraph/typeDefinitions.js.map +1 -0
  217. package/Gizmos/axisScaleGizmo.d.ts +1 -0
  218. package/Gizmos/axisScaleGizmo.js +12 -0
  219. package/Gizmos/axisScaleGizmo.js.map +1 -1
  220. package/Gizmos/lightGizmo.js +2 -1
  221. package/Gizmos/lightGizmo.js.map +1 -1
  222. package/Gizmos/rotationGizmo.js +1 -1
  223. package/Gizmos/rotationGizmo.js.map +1 -1
  224. package/Lights/Shadows/cascadedShadowGenerator.js +1 -1
  225. package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
  226. package/Lights/light.d.ts +15 -0
  227. package/Lights/light.js +18 -0
  228. package/Lights/light.js.map +1 -1
  229. package/Lights/shadowLight.d.ts +18 -1
  230. package/Lights/shadowLight.js +34 -1
  231. package/Lights/shadowLight.js.map +1 -1
  232. package/Materials/Node/Blocks/Dual/lightBlock.js +2 -1
  233. package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
  234. package/Materials/Node/Blocks/Dual/reflectionTextureBlock.js +3 -2
  235. package/Materials/Node/Blocks/Dual/reflectionTextureBlock.js.map +1 -1
  236. package/Materials/Node/Blocks/Fragment/fragDepthBlock.js +2 -1
  237. package/Materials/Node/Blocks/Fragment/fragDepthBlock.js.map +1 -1
  238. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js +2 -1
  239. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js.map +1 -1
  240. package/Materials/Node/Blocks/PBR/anisotropyBlock.js +2 -1
  241. package/Materials/Node/Blocks/PBR/anisotropyBlock.js.map +1 -1
  242. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +3 -2
  243. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
  244. package/Materials/Node/Blocks/PBR/reflectionBlock.js +2 -1
  245. package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
  246. package/Materials/Node/nodeMaterial.js +9 -8
  247. package/Materials/Node/nodeMaterial.js.map +1 -1
  248. package/Materials/Node/nodeMaterialBlock.js +2 -1
  249. package/Materials/Node/nodeMaterialBlock.js.map +1 -1
  250. package/Materials/drawWrapper.js +3 -2
  251. package/Materials/drawWrapper.js.map +1 -1
  252. package/Materials/effect.js +2 -1
  253. package/Materials/effect.js.map +1 -1
  254. package/Materials/material.js +2 -1
  255. package/Materials/material.js.map +1 -1
  256. package/Materials/uniformBuffer.d.ts +4 -1
  257. package/Materials/uniformBuffer.js +5 -2
  258. package/Materials/uniformBuffer.js.map +1 -1
  259. package/Meshes/Node/nodeGeometryBlock.js +11 -2
  260. package/Meshes/Node/nodeGeometryBlock.js.map +1 -1
  261. package/Meshes/abstractMesh.js +3 -1
  262. package/Meshes/abstractMesh.js.map +1 -1
  263. package/Misc/assetsManager.js +2 -2
  264. package/Misc/assetsManager.js.map +1 -1
  265. package/Misc/dds.d.ts +2 -0
  266. package/Misc/dds.js +27 -23
  267. package/Misc/dds.js.map +1 -1
  268. package/Misc/logger.d.ts +3 -3
  269. package/Misc/logger.js +8 -4
  270. package/Misc/logger.js.map +1 -1
  271. package/Misc/sceneSerializer.js +2 -1
  272. package/Misc/sceneSerializer.js.map +1 -1
  273. package/Navigation/Plugins/recastJSPlugin.js +2 -2
  274. package/Navigation/Plugins/recastJSPlugin.js.map +1 -1
  275. package/Physics/v2/Plugins/havokPlugin.js +1 -1
  276. package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
  277. package/Physics/v2/index.d.ts +1 -0
  278. package/Physics/v2/index.js +1 -0
  279. package/Physics/v2/index.js.map +1 -1
  280. package/Physics/v2/ragdoll.d.ts +107 -0
  281. package/Physics/v2/ragdoll.js +228 -0
  282. package/Physics/v2/ragdoll.js.map +1 -0
  283. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js +2 -2
  284. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js.map +1 -1
  285. package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js +3 -2
  286. package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js.map +1 -1
  287. package/PostProcesses/index.d.ts +1 -1
  288. package/PostProcesses/index.js +1 -1
  289. package/PostProcesses/index.js.map +1 -1
  290. package/PostProcesses/passPostProcess.d.ts +1 -0
  291. package/PostProcesses/passPostProcess.js +6 -2
  292. package/PostProcesses/passPostProcess.js.map +1 -1
  293. package/PostProcesses/screenSpaceCurvaturePostProcess.js +1 -1
  294. package/PostProcesses/screenSpaceCurvaturePostProcess.js.map +1 -1
  295. package/PostProcesses/screenSpaceReflectionPostProcess.js +3 -2
  296. package/PostProcesses/screenSpaceReflectionPostProcess.js.map +1 -1
  297. package/Rendering/depthPeelingRenderer.js +2 -1
  298. package/Rendering/depthPeelingRenderer.js.map +1 -1
  299. package/Shaders/ShadersInclude/pbrBlockSubSurface.js +3 -2
  300. package/Shaders/ShadersInclude/pbrBlockSubSurface.js.map +1 -1
  301. package/XR/features/WebXRControllerPhysics.js +2 -2
  302. package/XR/features/WebXRControllerPhysics.js.map +1 -1
  303. package/XR/features/WebXRMeshDetector.d.ts +14 -2
  304. package/XR/features/WebXRMeshDetector.js +45 -9
  305. package/XR/features/WebXRMeshDetector.js.map +1 -1
  306. package/XR/features/WebXRWalkingLocomotion.js +1 -1
  307. package/XR/features/WebXRWalkingLocomotion.js.map +1 -1
  308. package/XR/webXRExperienceHelper.js +2 -2
  309. package/XR/webXRExperienceHelper.js.map +1 -1
  310. package/assetContainer.js +2 -2
  311. package/assetContainer.js.map +1 -1
  312. package/esm/Engines/Extensions/alpha/alpha.base.d.ts +34 -0
  313. package/esm/Engines/Extensions/alpha/alpha.base.js +2 -0
  314. package/esm/Engines/Extensions/alpha/alpha.base.js.map +1 -0
  315. package/esm/Engines/Extensions/computeShaders/computeShaders.base.d.ts +87 -0
  316. package/esm/Engines/Extensions/computeShaders/computeShaders.base.js +12 -0
  317. package/esm/Engines/Extensions/computeShaders/computeShaders.base.js.map +1 -0
  318. package/esm/Engines/Extensions/cubeTexture/cubeTexture.base.d.ts +79 -0
  319. package/esm/Engines/Extensions/cubeTexture/cubeTexture.base.js +2 -0
  320. package/esm/Engines/Extensions/cubeTexture/cubeTexture.base.js.map +1 -0
  321. package/esm/Engines/Extensions/debugging/debugging.base.d.ts +11 -0
  322. package/esm/Engines/Extensions/debugging/debugging.base.js +2 -0
  323. package/esm/Engines/Extensions/debugging/debugging.base.js.map +1 -0
  324. package/esm/Engines/Extensions/dynamicBuffer/dynamicBuffer.base.d.ts +20 -0
  325. package/esm/Engines/Extensions/dynamicBuffer/dynamicBuffer.base.js +2 -0
  326. package/esm/Engines/Extensions/dynamicBuffer/dynamicBuffer.base.js.map +1 -0
  327. package/esm/Engines/Extensions/dynamicTexture/dynamicTexture.base.d.ts +26 -0
  328. package/esm/Engines/Extensions/dynamicTexture/dynamicTexture.base.js +2 -0
  329. package/esm/Engines/Extensions/dynamicTexture/dynamicTexture.base.js.map +1 -0
  330. package/esm/Engines/Extensions/engine.extensions.d.ts +67 -0
  331. package/esm/Engines/Extensions/engine.extensions.js +49 -0
  332. package/esm/Engines/Extensions/engine.extensions.js.map +1 -0
  333. package/esm/Engines/Extensions/externalTexture/externalTexture.base.d.ts +16 -0
  334. package/esm/Engines/Extensions/externalTexture/externalTexture.base.js +2 -0
  335. package/esm/Engines/Extensions/externalTexture/externalTexture.base.js.map +1 -0
  336. package/esm/Engines/Extensions/multiRender/multiRender.base.d.ts +54 -0
  337. package/esm/Engines/Extensions/multiRender/multiRender.base.js +2 -0
  338. package/esm/Engines/Extensions/multiRender/multiRender.base.js.map +1 -0
  339. package/esm/Engines/Extensions/multiview/multiview.base.d.ts +67 -0
  340. package/esm/Engines/Extensions/multiview/multiview.base.js +79 -0
  341. package/esm/Engines/Extensions/multiview/multiview.base.js.map +1 -0
  342. package/esm/Engines/Extensions/query/query.base.d.ts +164 -0
  343. package/esm/Engines/Extensions/query/query.base.js +168 -0
  344. package/esm/Engines/Extensions/query/query.base.js.map +1 -0
  345. package/esm/Engines/Extensions/rawTexture/engine.rawTexture.base.d.ts +187 -0
  346. package/esm/Engines/Extensions/rawTexture/engine.rawTexture.base.js +2 -0
  347. package/esm/Engines/Extensions/rawTexture/engine.rawTexture.base.js.map +1 -0
  348. package/esm/Engines/Extensions/readTexture/readTexture.base.d.ts +9 -0
  349. package/esm/Engines/Extensions/readTexture/readTexture.base.js +2 -0
  350. package/esm/Engines/Extensions/readTexture/readTexture.base.js.map +1 -0
  351. package/esm/Engines/Extensions/renderTarget/renderTarget.base.d.ts +35 -0
  352. package/esm/Engines/Extensions/renderTarget/renderTarget.base.js +2 -0
  353. package/esm/Engines/Extensions/renderTarget/renderTarget.base.js.map +1 -0
  354. package/esm/Engines/Extensions/renderTargetCube/renderTargetCube.base.d.ts +12 -0
  355. package/esm/Engines/Extensions/renderTargetCube/renderTargetCube.base.js +2 -0
  356. package/esm/Engines/Extensions/renderTargetCube/renderTargetCube.base.js.map +1 -0
  357. package/esm/Engines/Extensions/storageBuffer/storageBuffer.base.d.ts +36 -0
  358. package/esm/Engines/Extensions/storageBuffer/storageBuffer.base.js +2 -0
  359. package/esm/Engines/Extensions/storageBuffer/storageBuffer.base.js.map +1 -0
  360. package/esm/Engines/Extensions/textureSampler/textureSampler.base.d.ts +11 -0
  361. package/esm/Engines/Extensions/textureSampler/textureSampler.base.js +2 -0
  362. package/esm/Engines/Extensions/textureSampler/textureSampler.base.js.map +1 -0
  363. package/esm/Engines/Extensions/textureSelector/textureSelector.base.d.ts +50 -0
  364. package/esm/Engines/Extensions/textureSelector/textureSelector.base.js +53 -0
  365. package/esm/Engines/Extensions/textureSelector/textureSelector.base.js.map +1 -0
  366. package/esm/Engines/Extensions/transformFeedback/engine.transformFeedback.base.d.ts +42 -0
  367. package/esm/Engines/Extensions/transformFeedback/engine.transformFeedback.base.js +2 -0
  368. package/esm/Engines/Extensions/transformFeedback/engine.transformFeedback.base.js.map +1 -0
  369. package/esm/Engines/Extensions/uniformBuffer/uniformBuffer.base.d.ts +48 -0
  370. package/esm/Engines/Extensions/uniformBuffer/uniformBuffer.base.js +2 -0
  371. package/esm/Engines/Extensions/uniformBuffer/uniformBuffer.base.js.map +1 -0
  372. package/esm/Engines/Extensions/videoTexture/videoTexture.base.d.ts +13 -0
  373. package/esm/Engines/Extensions/videoTexture/videoTexture.base.js +2 -0
  374. package/esm/Engines/Extensions/videoTexture/videoTexture.base.js.map +1 -0
  375. package/esm/Engines/Extensions/views/views.base.d.ts +85 -0
  376. package/esm/Engines/Extensions/views/views.base.js +33 -0
  377. package/esm/Engines/Extensions/views/views.base.js.map +1 -0
  378. package/esm/Engines/WebGL/Extensions/alpha/alpha.webgl.d.ts +8 -0
  379. package/esm/Engines/WebGL/Extensions/alpha/alpha.webgl.js +137 -0
  380. package/esm/Engines/WebGL/Extensions/alpha/alpha.webgl.js.map +1 -0
  381. package/esm/Engines/WebGL/Extensions/cubeTexture/cubeTexture.webgl.d.ts +11 -0
  382. package/esm/Engines/WebGL/Extensions/cubeTexture/cubeTexture.webgl.js +251 -0
  383. package/esm/Engines/WebGL/Extensions/cubeTexture/cubeTexture.webgl.js.map +1 -0
  384. package/esm/Engines/WebGL/Extensions/dynamicBuffer/dynamicBuffer.webgl.d.ts +5 -0
  385. package/esm/Engines/WebGL/Extensions/dynamicBuffer/dynamicBuffer.webgl.js +55 -0
  386. package/esm/Engines/WebGL/Extensions/dynamicBuffer/dynamicBuffer.webgl.js.map +1 -0
  387. package/esm/Engines/WebGL/Extensions/dynamicTexture/dynamicTexture.webgl.d.ts +5 -0
  388. package/esm/Engines/WebGL/Extensions/dynamicTexture/dynamicTexture.webgl.js +65 -0
  389. package/esm/Engines/WebGL/Extensions/dynamicTexture/dynamicTexture.webgl.js.map +1 -0
  390. package/esm/Engines/WebGL/Extensions/multiRender/multiRender.webgl.d.ts +10 -0
  391. package/esm/Engines/WebGL/Extensions/multiRender/multiRender.webgl.js +375 -0
  392. package/esm/Engines/WebGL/Extensions/multiRender/multiRender.webgl.js.map +1 -0
  393. package/esm/Engines/WebGL/Extensions/multiview/multiview.webgl.d.ts +6 -0
  394. package/esm/Engines/WebGL/Extensions/multiview/multiview.webgl.js +77 -0
  395. package/esm/Engines/WebGL/Extensions/multiview/multiview.webgl.js.map +1 -0
  396. package/esm/Engines/WebGL/Extensions/query/query.webgl.d.ts +21 -0
  397. package/esm/Engines/WebGL/Extensions/query/query.webgl.js +220 -0
  398. package/esm/Engines/WebGL/Extensions/query/query.webgl.js.map +1 -0
  399. package/esm/Engines/WebGL/Extensions/rawTexture/engine.rawTexture.webgl.d.ts +15 -0
  400. package/esm/Engines/WebGL/Extensions/rawTexture/engine.rawTexture.webgl.js +392 -0
  401. package/esm/Engines/WebGL/Extensions/rawTexture/engine.rawTexture.webgl.js.map +1 -0
  402. package/esm/Engines/WebGL/Extensions/readTexture/readTexture.webgl.d.ts +17 -0
  403. package/esm/Engines/WebGL/Extensions/readTexture/readTexture.webgl.js +133 -0
  404. package/esm/Engines/WebGL/Extensions/readTexture/readTexture.webgl.js.map +1 -0
  405. package/esm/Engines/WebGL/Extensions/renderTarget/renderTarget.webgl.d.ts +8 -0
  406. package/esm/Engines/WebGL/Extensions/renderTarget/renderTarget.webgl.js +199 -0
  407. package/esm/Engines/WebGL/Extensions/renderTarget/renderTarget.webgl.js.map +1 -0
  408. package/esm/Engines/WebGL/Extensions/renderTargetCube/renderTargetCube.webgl.d.ts +2 -0
  409. package/esm/Engines/WebGL/Extensions/renderTargetCube/renderTargetCube.webgl.js +62 -0
  410. package/esm/Engines/WebGL/Extensions/renderTargetCube/renderTargetCube.webgl.js.map +1 -0
  411. package/esm/Engines/WebGL/Extensions/textureSelector/textureSelector.webgl.d.ts +5 -0
  412. package/esm/Engines/WebGL/Extensions/textureSelector/textureSelector.webgl.js +28 -0
  413. package/esm/Engines/WebGL/Extensions/textureSelector/textureSelector.webgl.js.map +1 -0
  414. package/esm/Engines/WebGL/Extensions/transformFeedback/engine.transformFeedback.webgl.d.ts +11 -0
  415. package/esm/Engines/WebGL/Extensions/transformFeedback/engine.transformFeedback.webgl.js +45 -0
  416. package/esm/Engines/WebGL/Extensions/transformFeedback/engine.transformFeedback.webgl.js.map +1 -0
  417. package/esm/Engines/WebGL/Extensions/uniformBuffer/uniformBuffer.webgl.d.ts +9 -0
  418. package/esm/Engines/WebGL/Extensions/uniformBuffer/uniformBuffer.webgl.js +78 -0
  419. package/esm/Engines/WebGL/Extensions/uniformBuffer/uniformBuffer.webgl.js.map +1 -0
  420. package/esm/Engines/WebGL/Extensions/videoTexture/videoTexture.webgl.d.ts +4 -0
  421. package/esm/Engines/WebGL/Extensions/videoTexture/videoTexture.webgl.js +67 -0
  422. package/esm/Engines/WebGL/Extensions/videoTexture/videoTexture.webgl.js.map +1 -0
  423. package/esm/Engines/WebGL/Extensions/views/views.webgl.d.ts +18 -0
  424. package/esm/Engines/WebGL/Extensions/views/views.webgl.js +152 -0
  425. package/esm/Engines/WebGL/Extensions/views/views.webgl.js.map +1 -0
  426. package/esm/Engines/WebGL/engine.adapterHelpers.d.ts +43 -0
  427. package/esm/Engines/WebGL/engine.adapterHelpers.js +107 -0
  428. package/esm/Engines/WebGL/engine.adapterHelpers.js.map +1 -0
  429. package/esm/Engines/WebGL/engine.webgl.d.ts +1030 -0
  430. package/esm/Engines/WebGL/engine.webgl.js +4083 -0
  431. package/esm/Engines/WebGL/engine.webgl.js.map +1 -0
  432. package/esm/Engines/WebGPU/engine.adapterHelpers.d.ts +7 -0
  433. package/esm/Engines/WebGPU/engine.adapterHelpers.js +20 -0
  434. package/esm/Engines/WebGPU/engine.adapterHelpers.js.map +1 -0
  435. package/esm/Engines/WebGPU/engine.webgpu.constants.d.ts +391 -0
  436. package/esm/Engines/WebGPU/engine.webgpu.constants.js +2 -0
  437. package/esm/Engines/WebGPU/engine.webgpu.constants.js.map +1 -0
  438. package/esm/Engines/WebGPU/engine.webgpu.d.ts +277 -0
  439. package/esm/Engines/WebGPU/engine.webgpu.js +1281 -0
  440. package/esm/Engines/WebGPU/engine.webgpu.js.map +1 -0
  441. package/esm/Engines/engine.adapters.d.ts +32 -0
  442. package/esm/Engines/engine.adapters.js +27 -0
  443. package/esm/Engines/engine.adapters.js.map +1 -0
  444. package/esm/Engines/engine.base.d.ts +807 -0
  445. package/esm/Engines/engine.base.js +1235 -0
  446. package/esm/Engines/engine.base.js.map +1 -0
  447. package/esm/Engines/engine.constants.d.ts +735 -0
  448. package/esm/Engines/engine.constants.js +3 -0
  449. package/esm/Engines/engine.constants.js.map +1 -0
  450. package/esm/Engines/engine.extendable.d.ts +180 -0
  451. package/esm/Engines/engine.extendable.js +477 -0
  452. package/esm/Engines/engine.extendable.js.map +1 -0
  453. package/esm/Engines/engine.interfaces.d.ts +16 -0
  454. package/esm/Engines/engine.interfaces.js +9 -0
  455. package/esm/Engines/engine.interfaces.js.map +1 -0
  456. package/esm/Engines/engine.static.d.ts +215 -0
  457. package/esm/Engines/engine.static.js +345 -0
  458. package/esm/Engines/engine.static.js.map +1 -0
  459. package/esm/Engines/engine.tools.d.ts +20 -0
  460. package/esm/Engines/engine.tools.js +33 -0
  461. package/esm/Engines/engine.tools.js.map +1 -0
  462. package/esm/Engines/public.d.ts +1 -0
  463. package/esm/Engines/public.js +2 -0
  464. package/esm/Engines/public.js.map +1 -0
  465. package/esm/Engines/runtimeEnvironment.d.ts +37 -0
  466. package/esm/Engines/runtimeEnvironment.js +56 -0
  467. package/esm/Engines/runtimeEnvironment.js.map +1 -0
  468. package/package.json +2 -1
  469. package/scene.d.ts +1 -2
  470. package/scene.js +1 -1
  471. package/scene.js.map +1 -1
  472. package/FlowGraph/Blocks/Data/Math/flowGraphMatrixBlocks.d.ts +0 -172
  473. package/FlowGraph/Blocks/Data/Math/flowGraphMatrixBlocks.js +0 -235
  474. package/FlowGraph/Blocks/Data/Math/flowGraphMatrixBlocks.js.map +0 -1
  475. package/FlowGraph/Blocks/Data/Math/flowGraphNumberMathBlocks.d.ts +0 -269
  476. package/FlowGraph/Blocks/Data/Math/flowGraphNumberMathBlocks.js +0 -429
  477. package/FlowGraph/Blocks/Data/Math/flowGraphNumberMathBlocks.js.map +0 -1
  478. package/FlowGraph/Blocks/Data/Math/flowGraphVector2MathBlocks.d.ts +0 -115
  479. package/FlowGraph/Blocks/Data/Math/flowGraphVector2MathBlocks.js +0 -146
  480. package/FlowGraph/Blocks/Data/Math/flowGraphVector2MathBlocks.js.map +0 -1
  481. package/FlowGraph/Blocks/Data/Math/flowGraphVector3MathBlocks.d.ts +0 -155
  482. package/FlowGraph/Blocks/Data/Math/flowGraphVector3MathBlocks.js +0 -190
  483. package/FlowGraph/Blocks/Data/Math/flowGraphVector3MathBlocks.js.map +0 -1
  484. package/FlowGraph/Blocks/Data/Math/flowGraphVector4MathBlocks.d.ts +0 -116
  485. package/FlowGraph/Blocks/Data/Math/flowGraphVector4MathBlocks.js +0 -144
  486. package/FlowGraph/Blocks/Data/Math/flowGraphVector4MathBlocks.js.map +0 -1
  487. package/FlowGraph/Blocks/Execution/flowGraphLogBlock.js +0 -27
  488. package/FlowGraph/Blocks/Execution/flowGraphLogBlock.js.map +0 -1
@@ -11,7 +11,7 @@ import type { BaseTexture } from "../Materials/Textures/baseTexture";
11
11
  import type { IShaderProcessor } from "./Processors/iShaderProcessor";
12
12
  import type { ShaderProcessingContext } from "./Processors/shaderProcessingOptions";
13
13
  import { WebGPUTextureHelper } from "./WebGPU/webgpuTextureHelper";
14
- import type { ISceneLike, ThinEngineOptions } from "./thinEngine";
14
+ import type { ThinEngineOptions } from "./thinEngine";
15
15
  import { WebGPUBufferManager } from "./WebGPU/webgpuBufferManager";
16
16
  import type { HardwareTextureWrapper } from "../Materials/Textures/hardwareTextureWrapper";
17
17
  import { WebGPUHardwareTexture } from "./WebGPU/webgpuHardwareTexture";
@@ -34,6 +34,7 @@ import type { WebGPUDataBuffer } from "../Meshes/WebGPU/webgpuDataBuffer";
34
34
  import "../Buffers/buffer.align";
35
35
  import "../ShadersWGSL/postprocess.vertex";
36
36
  import type { RenderTargetWrapper } from "./renderTargetWrapper";
37
+ import type { ISceneLike } from "../esm/Engines/engine.interfaces.js";
37
38
  /** @internal */
38
39
  interface IWebGPURenderPassWrapper {
39
40
  renderPassDescriptor: Nullable<GPURenderPassDescriptor>;
@@ -311,11 +312,11 @@ export declare class WebGPUEngine extends Engine {
311
312
  /**
312
313
  * Indicates if the z range in NDC space is 0..1 (value: true) or -1..1 (value: false)
313
314
  */
314
- readonly isNDCHalfZRange: boolean;
315
+ get isNDCHalfZRange(): boolean;
315
316
  /**
316
317
  * Indicates that the origin of the texture/framebuffer space is the bottom left corner. If false, the origin is top left
317
318
  */
318
- readonly hasOriginBottomLeft: boolean;
319
+ get hasOriginBottomLeft(): boolean;
319
320
  /**
320
321
  * Create a new instance of the gpu engine.
321
322
  * @param canvas Defines the canvas to use to display the result
@@ -698,14 +699,10 @@ export declare class WebGPUEngine extends Engine {
698
699
  * @returns a ArrayBufferView promise (Uint8Array) containing RGBA colors
699
700
  */
700
701
  readPixels(x: number, y: number, width: number, height: number, hasAlpha?: boolean, flushRenderer?: boolean): Promise<ArrayBufferView>;
701
- /**
702
- * Begin a new frame
703
- */
704
- beginFrame(): void;
705
702
  /**
706
703
  * End the current frame
707
704
  */
708
- endFrame(): void;
705
+ endFrame: () => void;
709
706
  /**
710
707
  * Force a WebGPU flush (ie. a flush of all waiting commands)
711
708
  */
@@ -204,6 +204,18 @@ export class WebGPUEngine extends Engine {
204
204
  engine.initAsync(options.glslangOptions, options.twgslOptions).then(() => resolve(engine));
205
205
  });
206
206
  }
207
+ /**
208
+ * Indicates if the z range in NDC space is 0..1 (value: true) or -1..1 (value: false)
209
+ */
210
+ get isNDCHalfZRange() {
211
+ return true;
212
+ }
213
+ /**
214
+ * Indicates that the origin of the texture/framebuffer space is the bottom left corner. If false, the origin is top left
215
+ */
216
+ get hasOriginBottomLeft() {
217
+ return false;
218
+ }
207
219
  /**
208
220
  * Create a new instance of the gpu engine.
209
221
  * @param canvas Defines the canvas to use to display the result
@@ -289,14 +301,6 @@ export class WebGPUEngine extends Engine {
289
301
  this.dbgLogIfNotDrawWrapper = true;
290
302
  /** @internal */
291
303
  this.dbgShowEmptyEnableEffectCalls = true;
292
- /**
293
- * Indicates if the z range in NDC space is 0..1 (value: true) or -1..1 (value: false)
294
- */
295
- this.isNDCHalfZRange = true;
296
- /**
297
- * Indicates that the origin of the texture/framebuffer space is the bottom left corner. If false, the origin is top left
298
- */
299
- this.hasOriginBottomLeft = false;
300
304
  //------------------------------------------------------------------------------
301
305
  // Dynamic WebGPU States
302
306
  //------------------------------------------------------------------------------
@@ -306,6 +310,61 @@ export class WebGPUEngine extends Engine {
306
310
  this._scissorCached = { x: 0, y: 0, z: 0, w: 0 };
307
311
  this._stencilRefsCurrent = -1;
308
312
  this._blendColorsCurrent = [null, null, null, null];
313
+ //------------------------------------------------------------------------------
314
+ // Frame management
315
+ //------------------------------------------------------------------------------
316
+ /**
317
+ * End the current frame
318
+ */
319
+ this.endFrame = () => {
320
+ this._endCurrentRenderPass();
321
+ this._snapshotRendering.endFrame();
322
+ this._timestampQuery.endFrame(this._renderEncoder);
323
+ this.flushFramebuffer();
324
+ this._textureHelper.destroyDeferredTextures();
325
+ this._bufferManager.destroyDeferredBuffers();
326
+ if (this._features._collectUbosUpdatedInFrame) {
327
+ if (this.dbgVerboseLogsForFirstFrames) {
328
+ if (this._count === undefined) {
329
+ this._count = 0;
330
+ }
331
+ if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {
332
+ const list = [];
333
+ for (const name in UniformBuffer._UpdatedUbosInFrame) {
334
+ list.push(name + ":" + UniformBuffer._UpdatedUbosInFrame[name]);
335
+ }
336
+ Logger.Log(["frame #" + this._count + " - updated ubos -", list.join(", ")]);
337
+ }
338
+ }
339
+ UniformBuffer._UpdatedUbosInFrame = {};
340
+ }
341
+ this.countersLastFrame.numEnableEffects = this._counters.numEnableEffects;
342
+ this.countersLastFrame.numEnableDrawWrapper = this._counters.numEnableDrawWrapper;
343
+ this.countersLastFrame.numBundleCreationNonCompatMode = this._counters.numBundleCreationNonCompatMode;
344
+ this.countersLastFrame.numBundleReuseNonCompatMode = this._counters.numBundleReuseNonCompatMode;
345
+ this._counters.numEnableEffects = 0;
346
+ this._counters.numEnableDrawWrapper = 0;
347
+ this._counters.numBundleCreationNonCompatMode = 0;
348
+ this._counters.numBundleReuseNonCompatMode = 0;
349
+ this._cacheRenderPipeline.endFrame();
350
+ this._cacheBindGroups.endFrame();
351
+ this._pendingDebugCommands.length = 0;
352
+ this._engineState._frameId++; // Was a call to super
353
+ if (this.dbgVerboseLogsForFirstFrames) {
354
+ if (this._count === undefined) {
355
+ this._count = 0;
356
+ }
357
+ if (this._count < this.dbgVerboseLogsNumFrames) {
358
+ Logger.Log(["%c frame #" + this._count + " - end", "background: #ffff00"]);
359
+ }
360
+ if (this._count < this.dbgVerboseLogsNumFrames) {
361
+ this._count++;
362
+ if (this._count !== this.dbgVerboseLogsNumFrames) {
363
+ Logger.Log(["%c frame #" + this._count + " - begin", "background: #ffff00"]);
364
+ }
365
+ }
366
+ }
367
+ };
309
368
  this._name = "WebGPU";
310
369
  options.deviceDescriptor = options.deviceDescriptor || {};
311
370
  options.enableGPUDebugMarkers = (_b = options.enableGPUDebugMarkers) !== null && _b !== void 0 ? _b : false;
@@ -433,7 +492,7 @@ export class WebGPUEngine extends Engine {
433
492
  if (this.dbgVerboseLogsForFirstFrames) {
434
493
  if (this._count === undefined) {
435
494
  this._count = 0;
436
- console.log("%c frame #" + this._count + " - begin", "background: #ffff00");
495
+ Logger.Log(["%c frame #" + this._count + " - begin", "background: #ffff00"]);
437
496
  }
438
497
  }
439
498
  this._uploadEncoder = this._device.createCommandEncoder(this._uploadEncoderDescriptor);
@@ -458,11 +517,11 @@ export class WebGPUEngine extends Engine {
458
517
  this.resize();
459
518
  })
460
519
  .catch((e) => {
520
+ var _a;
461
521
  Logger.Error("Can not create WebGPU Device and/or context.");
462
522
  Logger.Error(e);
463
- if (console.trace) {
464
- console.trace();
465
- }
523
+ // eslint-disable-next-line no-console
524
+ (_a = console === null || console === void 0 ? void 0 : console.trace) === null || _a === void 0 ? void 0 : _a.call(console);
466
525
  });
467
526
  }
468
527
  _initGlslang(glslangOptions) {
@@ -692,7 +751,7 @@ export class WebGPUEngine extends Engine {
692
751
  this._count = 0;
693
752
  }
694
753
  if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {
695
- console.log("frame #" + this._count + " - setSize -", width, height);
754
+ Logger.Log(["frame #" + this._count + " - setSize -", width, height]);
696
755
  }
697
756
  }
698
757
  this._initializeMainAttachments();
@@ -817,7 +876,14 @@ export class WebGPUEngine extends Engine {
817
876
  this._count = 0;
818
877
  }
819
878
  if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {
820
- console.log("frame #" + this._count + " - viewport applied - (", this._viewportCached.x, this._viewportCached.y, this._viewportCached.z, this._viewportCached.w, ") current pass is main pass=" + this._currentPassIsMainPass());
879
+ Logger.Log([
880
+ "frame #" + this._count + " - viewport applied - (",
881
+ this._viewportCached.x,
882
+ this._viewportCached.y,
883
+ this._viewportCached.z,
884
+ this._viewportCached.w,
885
+ ") current pass is main pass=" + this._currentPassIsMainPass(),
886
+ ]);
821
887
  }
822
888
  }
823
889
  }
@@ -854,7 +920,14 @@ export class WebGPUEngine extends Engine {
854
920
  this._count = 0;
855
921
  }
856
922
  if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {
857
- console.log("frame #" + this._count + " - scissor applied - (", this._scissorCached.x, this._scissorCached.y, this._scissorCached.z, this._scissorCached.w, ") current pass is main pass=" + this._currentPassIsMainPass());
923
+ Logger.Log([
924
+ "frame #" + this._count + " - scissor applied - (",
925
+ this._scissorCached.x,
926
+ this._scissorCached.y,
927
+ this._scissorCached.z,
928
+ this._scissorCached.w,
929
+ ") current pass is main pass=" + this._currentPassIsMainPass(),
930
+ ]);
858
931
  }
859
932
  }
860
933
  }
@@ -933,7 +1006,7 @@ export class WebGPUEngine extends Engine {
933
1006
  this._count = 0;
934
1007
  }
935
1008
  if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {
936
- console.log("frame #" + this._count + " - clear - backBuffer=", backBuffer, " depth=", depth, " stencil=", stencil, " scissor is active=", hasScissor);
1009
+ Logger.Log(["frame #" + this._count + " - clear - backBuffer=", backBuffer, " depth=", depth, " stencil=", stencil, " scissor is active=", hasScissor]);
937
1010
  }
938
1011
  }
939
1012
  // We need to recreate the render pass so that the new parameters for clear color / depth / stencil are taken into account
@@ -1257,10 +1330,10 @@ export class WebGPUEngine extends Engine {
1257
1330
  const webGpuContext = pipelineContext;
1258
1331
  const shaderLanguage = webGpuContext.shaderProcessingContext.shaderLanguage;
1259
1332
  if (this.dbgShowShaderCode) {
1260
- console.log(defines);
1261
- console.log(vertexSourceCode);
1262
- console.log(fragmentSourceCode);
1263
- console.log("***********************************************");
1333
+ Logger.Log(["defines", defines]);
1334
+ Logger.Log(vertexSourceCode);
1335
+ Logger.Log(fragmentSourceCode);
1336
+ Logger.Log("***********************************************");
1264
1337
  }
1265
1338
  webGpuContext.sources = {
1266
1339
  fragment: fragmentSourceCode,
@@ -1319,7 +1392,7 @@ export class WebGPUEngine extends Engine {
1319
1392
  effect.drawContext === this._currentDrawContext &&
1320
1393
  !this._forceEnableEffect)) {
1321
1394
  if (!effect.effect && this.dbgShowEmptyEnableEffectCalls) {
1322
- console.error("drawWrapper=", effect);
1395
+ Logger.Log(["drawWrapper=", effect]);
1323
1396
  throw "Invalid call to enableEffect: the effect property is empty!";
1324
1397
  }
1325
1398
  return;
@@ -1331,7 +1404,7 @@ export class WebGPUEngine extends Engine {
1331
1404
  this._currentDrawContext = effect.drawContext;
1332
1405
  this._counters.numEnableDrawWrapper++;
1333
1406
  if (!this._currentMaterialContext) {
1334
- console.error("drawWrapper=", effect);
1407
+ Logger.Log(["drawWrapper=", effect]);
1335
1408
  throw `Invalid call to enableEffect: the materialContext property is empty!`;
1336
1409
  }
1337
1410
  }
@@ -1708,7 +1781,7 @@ export class WebGPUEngine extends Engine {
1708
1781
  this._count = 0;
1709
1782
  }
1710
1783
  if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {
1711
- console.log("frame #" + this._count + " - _setTexture called with a null _currentEffect! texture=", texture);
1784
+ Logger.Log(["frame #" + this._count + " - _setTexture called with a null _currentEffect! texture=", texture]);
1712
1785
  }
1713
1786
  }
1714
1787
  }
@@ -1758,7 +1831,7 @@ export class WebGPUEngine extends Engine {
1758
1831
  this._count = 0;
1759
1832
  }
1760
1833
  if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {
1761
- console.log("frame #" +
1834
+ Logger.Log("frame #" +
1762
1835
  this._count +
1763
1836
  " - generate mipmaps - width=" +
1764
1837
  texture.width +
@@ -1882,67 +1955,6 @@ export class WebGPUEngine extends Engine {
1882
1955
  }
1883
1956
  return this._textureHelper.readPixels(gpuTexture, x, y, width, height, gpuTextureFormat);
1884
1957
  }
1885
- //------------------------------------------------------------------------------
1886
- // Frame management
1887
- //------------------------------------------------------------------------------
1888
- /**
1889
- * Begin a new frame
1890
- */
1891
- beginFrame() {
1892
- super.beginFrame();
1893
- }
1894
- /**
1895
- * End the current frame
1896
- */
1897
- endFrame() {
1898
- this._endCurrentRenderPass();
1899
- this._snapshotRendering.endFrame();
1900
- this._timestampQuery.endFrame(this._renderEncoder);
1901
- this.flushFramebuffer();
1902
- this._textureHelper.destroyDeferredTextures();
1903
- this._bufferManager.destroyDeferredBuffers();
1904
- if (this._features._collectUbosUpdatedInFrame) {
1905
- if (this.dbgVerboseLogsForFirstFrames) {
1906
- if (this._count === undefined) {
1907
- this._count = 0;
1908
- }
1909
- if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {
1910
- const list = [];
1911
- for (const name in UniformBuffer._UpdatedUbosInFrame) {
1912
- list.push(name + ":" + UniformBuffer._UpdatedUbosInFrame[name]);
1913
- }
1914
- console.log("frame #" + this._count + " - updated ubos -", list.join(", "));
1915
- }
1916
- }
1917
- UniformBuffer._UpdatedUbosInFrame = {};
1918
- }
1919
- this.countersLastFrame.numEnableEffects = this._counters.numEnableEffects;
1920
- this.countersLastFrame.numEnableDrawWrapper = this._counters.numEnableDrawWrapper;
1921
- this.countersLastFrame.numBundleCreationNonCompatMode = this._counters.numBundleCreationNonCompatMode;
1922
- this.countersLastFrame.numBundleReuseNonCompatMode = this._counters.numBundleReuseNonCompatMode;
1923
- this._counters.numEnableEffects = 0;
1924
- this._counters.numEnableDrawWrapper = 0;
1925
- this._counters.numBundleCreationNonCompatMode = 0;
1926
- this._counters.numBundleReuseNonCompatMode = 0;
1927
- this._cacheRenderPipeline.endFrame();
1928
- this._cacheBindGroups.endFrame();
1929
- this._pendingDebugCommands.length = 0;
1930
- super.endFrame();
1931
- if (this.dbgVerboseLogsForFirstFrames) {
1932
- if (this._count === undefined) {
1933
- this._count = 0;
1934
- }
1935
- if (this._count < this.dbgVerboseLogsNumFrames) {
1936
- console.log("%c frame #" + this._count + " - end", "background: #ffff00");
1937
- }
1938
- if (this._count < this.dbgVerboseLogsNumFrames) {
1939
- this._count++;
1940
- if (this._count !== this.dbgVerboseLogsNumFrames) {
1941
- console.log("%c frame #" + this._count + " - begin", "background: #ffff00");
1942
- }
1943
- }
1944
- }
1945
- }
1946
1958
  /**
1947
1959
  * Force a WebGPU flush (ie. a flush of all waiting commands)
1948
1960
  */
@@ -1952,6 +1964,10 @@ export class WebGPUEngine extends Engine {
1952
1964
  this._commandBuffers[0] = this._uploadEncoder.finish();
1953
1965
  this._commandBuffers[1] = this._renderEncoder.finish();
1954
1966
  this._device.queue.submit(this._commandBuffers);
1967
+ // Now that the command buffers have been submitted, we can reset the ubo as we can reuse the same GPU buffer(s)
1968
+ for (let i = 0; i < this._uniformBuffers.length; ++i) {
1969
+ this._uniformBuffers[i]._checkNewFrame(true);
1970
+ }
1955
1971
  this._uploadEncoder = this._device.createCommandEncoder(this._uploadEncoderDescriptor);
1956
1972
  this._renderEncoder = this._device.createCommandEncoder(this._renderEncoderDescriptor);
1957
1973
  this._timestampQuery.startFrame(this._uploadEncoder);
@@ -2071,18 +2087,22 @@ export class WebGPUEngine extends Engine {
2071
2087
  }
2072
2088
  if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {
2073
2089
  const internalTexture = rtWrapper.texture;
2074
- console.log("frame #" +
2075
- this._count +
2076
- " - render target begin pass - rtt name=" +
2077
- renderTargetWrapper.label +
2078
- ", internalTexture.uniqueId=" +
2079
- internalTexture.uniqueId +
2080
- ", width=" +
2081
- internalTexture.width +
2082
- ", height=" +
2083
- internalTexture.height +
2084
- ", setClearStates=" +
2085
- setClearStates, "renderPassDescriptor=", this._rttRenderPassWrapper.renderPassDescriptor);
2090
+ Logger.Log([
2091
+ "frame #" +
2092
+ this._count +
2093
+ " - render target begin pass - rtt name=" +
2094
+ renderTargetWrapper.label +
2095
+ ", internalTexture.uniqueId=" +
2096
+ internalTexture.uniqueId +
2097
+ ", width=" +
2098
+ internalTexture.width +
2099
+ ", height=" +
2100
+ internalTexture.height +
2101
+ ", setClearStates=" +
2102
+ setClearStates,
2103
+ "renderPassDescriptor=",
2104
+ this._rttRenderPassWrapper.renderPassDescriptor,
2105
+ ]);
2086
2106
  }
2087
2107
  }
2088
2108
  (_h = this._debugFlushPendingCommands) === null || _h === void 0 ? void 0 : _h.call(this);
@@ -2131,7 +2151,12 @@ export class WebGPUEngine extends Engine {
2131
2151
  this._count = 0;
2132
2152
  }
2133
2153
  if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {
2134
- console.log("frame #" + this._count + " - main begin pass - texture width=" + this._mainTextureExtends.width, " height=" + this._mainTextureExtends.height + ", setClearStates=" + setClearStates, "renderPassDescriptor=", this._mainRenderPassWrapper.renderPassDescriptor);
2154
+ Logger.Log([
2155
+ "frame #" + this._count + " - main begin pass - texture width=" + this._mainTextureExtends.width,
2156
+ " height=" + this._mainTextureExtends.height + ", setClearStates=" + setClearStates,
2157
+ "renderPassDescriptor=",
2158
+ this._mainRenderPassWrapper.renderPassDescriptor,
2159
+ ]);
2135
2160
  }
2136
2161
  }
2137
2162
  (_b = this._debugPushGroup) === null || _b === void 0 ? void 0 : _b.call(this, "main pass", 0);
@@ -2161,7 +2186,7 @@ export class WebGPUEngine extends Engine {
2161
2186
  this._count = 0;
2162
2187
  }
2163
2188
  if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {
2164
- console.log("frame #" +
2189
+ Logger.Log("frame #" +
2165
2190
  this._count +
2166
2191
  " - " +
2167
2192
  (currentPassIndex === 2 ? "main" : "render target") +
@@ -2222,18 +2247,24 @@ export class WebGPUEngine extends Engine {
2222
2247
  this._count = 0;
2223
2248
  }
2224
2249
  if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {
2225
- console.log("frame #" +
2226
- this._count +
2227
- " - bindFramebuffer - rtt name=" +
2228
- texture.label +
2229
- ", internalTexture.uniqueId=" +
2230
- ((_b = texture.texture) === null || _b === void 0 ? void 0 : _b.uniqueId) +
2231
- ", face=" +
2232
- faceIndex +
2233
- ", lodLevel=" +
2234
- lodLevel +
2235
- ", layer=" +
2236
- layer, "colorAttachmentViewDescriptor=", this._rttRenderPassWrapper.colorAttachmentViewDescriptor, "depthAttachmentViewDescriptor=", this._rttRenderPassWrapper.depthAttachmentViewDescriptor);
2250
+ Logger.Log([
2251
+ "frame #" +
2252
+ this._count +
2253
+ " - bindFramebuffer - rtt name=" +
2254
+ texture.label +
2255
+ ", internalTexture.uniqueId=" +
2256
+ ((_b = texture.texture) === null || _b === void 0 ? void 0 : _b.uniqueId) +
2257
+ ", face=" +
2258
+ faceIndex +
2259
+ ", lodLevel=" +
2260
+ lodLevel +
2261
+ ", layer=" +
2262
+ layer,
2263
+ "colorAttachmentViewDescriptor=",
2264
+ this._rttRenderPassWrapper.colorAttachmentViewDescriptor,
2265
+ "depthAttachmentViewDescriptor=",
2266
+ this._rttRenderPassWrapper.depthAttachmentViewDescriptor,
2267
+ ]);
2237
2268
  }
2238
2269
  }
2239
2270
  // We don't create the render pass just now, we do a lazy creation of the render pass, hoping the render pass will be created by a call to clear()...
@@ -2281,7 +2312,7 @@ export class WebGPUEngine extends Engine {
2281
2312
  this._count = 0;
2282
2313
  }
2283
2314
  if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {
2284
- console.log("frame #" + this._count + " - unBindFramebuffer - rtt name=" + texture.label + ", internalTexture.uniqueId=", (_b = texture.texture) === null || _b === void 0 ? void 0 : _b.uniqueId);
2315
+ Logger.Log("frame #" + this._count + " - unBindFramebuffer - rtt name=" + texture.label + ", internalTexture.uniqueId=", (_b = texture.texture) === null || _b === void 0 ? void 0 : _b.uniqueId);
2285
2316
  }
2286
2317
  }
2287
2318
  this._mrtAttachments = [];