@babylonjs/core 7.2.2 → 7.3.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 (620) hide show
  1. package/Animations/runtimeAnimation.d.ts +1 -0
  2. package/Animations/runtimeAnimation.js +12 -3
  3. package/Animations/runtimeAnimation.js.map +1 -1
  4. package/Audio/audioEngine.js +2 -2
  5. package/Audio/audioEngine.js.map +1 -1
  6. package/Bones/boneLookController.js +3 -0
  7. package/Bones/boneLookController.js.map +1 -1
  8. package/Buffers/buffer.d.ts +5 -5
  9. package/Buffers/buffer.js.map +1 -1
  10. package/Buffers/storageBuffer.d.ts +2 -2
  11. package/Buffers/storageBuffer.js.map +1 -1
  12. package/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.js.map +1 -1
  13. package/Cameras/Inputs/flyCameraKeyboardInput.js.map +1 -1
  14. package/Cameras/Inputs/followCameraKeyboardMoveInput.js.map +1 -1
  15. package/Cameras/Inputs/freeCameraKeyboardMoveInput.js.map +1 -1
  16. package/Compute/computeEffect.d.ts +3 -3
  17. package/Compute/computeEffect.js.map +1 -1
  18. package/Compute/computeShader.d.ts +10 -2
  19. package/Compute/computeShader.js +53 -35
  20. package/Compute/computeShader.js.map +1 -1
  21. package/DeviceInput/InputDevices/deviceSourceManager.d.ts +2 -2
  22. package/DeviceInput/InputDevices/deviceSourceManager.js.map +1 -1
  23. package/DeviceInput/internalDeviceSourceManager.d.ts +4 -4
  24. package/DeviceInput/internalDeviceSourceManager.js.map +1 -1
  25. package/DeviceInput/webDeviceInputSystem.d.ts +2 -2
  26. package/DeviceInput/webDeviceInputSystem.js.map +1 -1
  27. package/Engines/AbstractEngine/abstractEngine.alpha.d.ts +10 -0
  28. package/Engines/AbstractEngine/abstractEngine.alpha.js +29 -0
  29. package/Engines/AbstractEngine/abstractEngine.alpha.js.map +1 -0
  30. package/Engines/AbstractEngine/abstractEngine.cubeTexture.d.ts +17 -0
  31. package/Engines/AbstractEngine/abstractEngine.cubeTexture.js +138 -0
  32. package/Engines/AbstractEngine/abstractEngine.cubeTexture.js.map +1 -0
  33. package/Engines/AbstractEngine/abstractEngine.dom.d.ts +61 -0
  34. package/Engines/AbstractEngine/abstractEngine.dom.js +27 -0
  35. package/Engines/AbstractEngine/abstractEngine.dom.js.map +1 -0
  36. package/Engines/AbstractEngine/abstractEngine.loadingScreen.d.ts +30 -0
  37. package/Engines/AbstractEngine/abstractEngine.loadingScreen.js +48 -0
  38. package/Engines/AbstractEngine/abstractEngine.loadingScreen.js.map +1 -0
  39. package/Engines/AbstractEngine/abstractEngine.query.d.ts +122 -0
  40. package/Engines/AbstractEngine/abstractEngine.query.js +175 -0
  41. package/Engines/AbstractEngine/abstractEngine.query.js.map +1 -0
  42. package/Engines/AbstractEngine/abstractEngine.renderPass.d.ts +26 -0
  43. package/Engines/AbstractEngine/abstractEngine.renderPass.js +29 -0
  44. package/Engines/AbstractEngine/abstractEngine.renderPass.js.map +1 -0
  45. package/Engines/AbstractEngine/abstractEngine.states.d.ts +162 -0
  46. package/Engines/AbstractEngine/abstractEngine.states.js +105 -0
  47. package/Engines/AbstractEngine/abstractEngine.states.js.map +1 -0
  48. package/Engines/AbstractEngine/abstractEngine.texture.d.ts +16 -0
  49. package/Engines/AbstractEngine/abstractEngine.texture.js +11 -0
  50. package/Engines/AbstractEngine/abstractEngine.texture.js.map +1 -0
  51. package/Engines/AbstractEngine/index.d.ts +8 -0
  52. package/Engines/AbstractEngine/index.js +10 -0
  53. package/Engines/AbstractEngine/index.js.map +1 -0
  54. package/Engines/Extensions/engine.alpha.d.ts +0 -24
  55. package/Engines/Extensions/engine.alpha.js +0 -35
  56. package/Engines/Extensions/engine.alpha.js.map +1 -1
  57. package/Engines/Extensions/engine.computeShader.d.ts +15 -2
  58. package/Engines/Extensions/engine.computeShader.js +5 -1
  59. package/Engines/Extensions/engine.computeShader.js.map +1 -1
  60. package/Engines/Extensions/engine.cubeTexture.d.ts +0 -8
  61. package/Engines/Extensions/engine.cubeTexture.js +2 -135
  62. package/Engines/Extensions/engine.cubeTexture.js.map +1 -1
  63. package/Engines/Extensions/engine.debugging.d.ts +2 -2
  64. package/Engines/Extensions/engine.debugging.js +5 -5
  65. package/Engines/Extensions/engine.debugging.js.map +1 -1
  66. package/Engines/Extensions/engine.dynamicTexture.js +3 -2
  67. package/Engines/Extensions/engine.dynamicTexture.js.map +1 -1
  68. package/Engines/Extensions/engine.multiview.js.map +1 -1
  69. package/Engines/Extensions/engine.query.d.ts +5 -120
  70. package/Engines/Extensions/engine.query.js +14 -150
  71. package/Engines/Extensions/engine.query.js.map +1 -1
  72. package/Engines/Extensions/engine.renderTarget.js +0 -9
  73. package/Engines/Extensions/engine.renderTarget.js.map +1 -1
  74. package/Engines/Extensions/engine.views.d.ts +3 -2
  75. package/Engines/Extensions/engine.views.js.map +1 -1
  76. package/Engines/Processors/iShaderProcessor.d.ts +2 -2
  77. package/Engines/Processors/iShaderProcessor.js.map +1 -1
  78. package/Engines/Processors/shaderProcessor.d.ts +3 -3
  79. package/Engines/Processors/shaderProcessor.js.map +1 -1
  80. package/Engines/WebGL/webGLRenderTargetWrapper.js +12 -9
  81. package/Engines/WebGL/webGLRenderTargetWrapper.js.map +1 -1
  82. package/Engines/WebGL/webGLShaderProcessors.d.ts +2 -2
  83. package/Engines/WebGL/webGLShaderProcessors.js.map +1 -1
  84. package/Engines/WebGPU/Extensions/engine.alpha.d.ts +35 -0
  85. package/Engines/WebGPU/Extensions/engine.alpha.js +4 -4
  86. package/Engines/WebGPU/Extensions/engine.alpha.js.map +1 -1
  87. package/Engines/WebGPU/Extensions/engine.computeShader.d.ts +9 -0
  88. package/Engines/WebGPU/Extensions/engine.computeShader.js +13 -2
  89. package/Engines/WebGPU/Extensions/engine.computeShader.js.map +1 -1
  90. package/Engines/WebGPU/Extensions/engine.cubeTexture.d.ts +78 -1
  91. package/Engines/WebGPU/Extensions/engine.cubeTexture.js.map +1 -1
  92. package/Engines/WebGPU/Extensions/engine.dynamicTexture.d.ts +27 -1
  93. package/Engines/WebGPU/Extensions/engine.dynamicTexture.js +3 -3
  94. package/Engines/WebGPU/Extensions/engine.dynamicTexture.js.map +1 -1
  95. package/Engines/WebGPU/Extensions/engine.externalTexture.d.ts +16 -0
  96. package/Engines/WebGPU/Extensions/engine.externalTexture.js.map +1 -1
  97. package/Engines/WebGPU/Extensions/engine.multiRender.d.ts +55 -1
  98. package/Engines/WebGPU/Extensions/engine.multiRender.js.map +1 -1
  99. package/Engines/WebGPU/Extensions/engine.query.d.ts +1 -1
  100. package/Engines/WebGPU/Extensions/engine.query.js +1 -0
  101. package/Engines/WebGPU/Extensions/engine.query.js.map +1 -1
  102. package/Engines/WebGPU/Extensions/engine.rawTexture.d.ts +185 -1
  103. package/Engines/WebGPU/Extensions/engine.rawTexture.js.map +1 -1
  104. package/Engines/WebGPU/Extensions/engine.readTexture.d.ts +10 -1
  105. package/Engines/WebGPU/Extensions/engine.readTexture.js.map +1 -1
  106. package/Engines/WebGPU/Extensions/engine.renderTarget.d.ts +38 -1
  107. package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
  108. package/Engines/WebGPU/Extensions/engine.renderTargetCube.d.ts +13 -1
  109. package/Engines/WebGPU/Extensions/engine.renderTargetCube.js.map +1 -1
  110. package/Engines/WebGPU/Extensions/engine.storageBuffer.d.ts +38 -1
  111. package/Engines/WebGPU/Extensions/engine.storageBuffer.js.map +1 -1
  112. package/Engines/WebGPU/Extensions/engine.textureSampler.d.ts +10 -0
  113. package/Engines/WebGPU/Extensions/engine.textureSampler.js.map +1 -1
  114. package/Engines/WebGPU/Extensions/engine.videoTexture.d.ts +14 -1
  115. package/Engines/WebGPU/Extensions/engine.videoTexture.js.map +1 -1
  116. package/Engines/WebGPU/webgpuShaderProcessorsGLSL.d.ts +2 -2
  117. package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js.map +1 -1
  118. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.d.ts +2 -0
  119. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +2 -0
  120. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
  121. package/Engines/abstractEngine.d.ts +1695 -0
  122. package/Engines/abstractEngine.js +1362 -0
  123. package/Engines/abstractEngine.js.map +1 -0
  124. package/Engines/engine.common.d.ts +39 -0
  125. package/Engines/engine.common.js +226 -0
  126. package/Engines/engine.common.js.map +1 -0
  127. package/Engines/engine.d.ts +40 -447
  128. package/Engines/engine.js +64 -810
  129. package/Engines/engine.js.map +1 -1
  130. package/Engines/engineFactory.d.ts +2 -2
  131. package/Engines/engineFactory.js.map +1 -1
  132. package/Engines/engineStore.d.ts +4 -4
  133. package/Engines/engineStore.js.map +1 -1
  134. package/Engines/index.d.ts +3 -0
  135. package/Engines/index.js +3 -0
  136. package/Engines/index.js.map +1 -1
  137. package/Engines/nativeEngine.d.ts +1 -1
  138. package/Engines/nativeEngine.js +2 -1
  139. package/Engines/nativeEngine.js.map +1 -1
  140. package/Engines/nullEngine.d.ts +2 -2
  141. package/Engines/nullEngine.js +2 -3
  142. package/Engines/nullEngine.js.map +1 -1
  143. package/Engines/renderTargetWrapper.d.ts +3 -3
  144. package/Engines/renderTargetWrapper.js.map +1 -1
  145. package/Engines/thinEngine.d.ts +34 -597
  146. package/Engines/thinEngine.js +85 -1143
  147. package/Engines/thinEngine.js.map +1 -1
  148. package/Engines/webgpuEngine.d.ts +147 -109
  149. package/Engines/webgpuEngine.js +249 -162
  150. package/Engines/webgpuEngine.js.map +1 -1
  151. package/Instrumentation/engineInstrumentation.d.ts +5 -4
  152. package/Instrumentation/engineInstrumentation.js.map +1 -1
  153. package/Layers/effectLayer.d.ts +2 -2
  154. package/Layers/effectLayer.js +3 -3
  155. package/Layers/effectLayer.js.map +1 -1
  156. package/Layers/effectLayerSceneComponent.js.map +1 -1
  157. package/Layers/glowLayer.js +3 -3
  158. package/Layers/glowLayer.js.map +1 -1
  159. package/Layers/highlightLayer.js +3 -3
  160. package/Layers/highlightLayer.js.map +1 -1
  161. package/Layers/layerSceneComponent.js.map +1 -1
  162. package/Loading/loadingScreen.js +2 -2
  163. package/Loading/loadingScreen.js.map +1 -1
  164. package/Loading/sceneLoader.d.ts +3 -3
  165. package/Loading/sceneLoader.js +1 -1
  166. package/Loading/sceneLoader.js.map +1 -1
  167. package/Materials/GreasedLine/greasedLinePluginMaterial.js.map +1 -1
  168. package/Materials/Node/Blocks/Dual/clipPlanesBlock.d.ts +1 -1
  169. package/Materials/Node/Blocks/Dual/clipPlanesBlock.js +6 -6
  170. package/Materials/Node/Blocks/Dual/clipPlanesBlock.js.map +1 -1
  171. package/Materials/Node/Blocks/Dual/currentScreenBlock.d.ts +2 -3
  172. package/Materials/Node/Blocks/Dual/currentScreenBlock.js +5 -5
  173. package/Materials/Node/Blocks/Dual/currentScreenBlock.js.map +1 -1
  174. package/Materials/Node/Blocks/Dual/fogBlock.d.ts +1 -1
  175. package/Materials/Node/Blocks/Dual/fogBlock.js +4 -4
  176. package/Materials/Node/Blocks/Dual/fogBlock.js.map +1 -1
  177. package/Materials/Node/Blocks/Dual/lightBlock.js +4 -4
  178. package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
  179. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.d.ts +1 -1
  180. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js +8 -7
  181. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js.map +1 -1
  182. package/Materials/Node/Blocks/Dual/sceneDepthBlock.d.ts +1 -1
  183. package/Materials/Node/Blocks/Dual/sceneDepthBlock.js +9 -5
  184. package/Materials/Node/Blocks/Dual/sceneDepthBlock.js.map +1 -1
  185. package/Materials/Node/Blocks/Dual/textureBlock.d.ts +4 -2
  186. package/Materials/Node/Blocks/Dual/textureBlock.js +43 -21
  187. package/Materials/Node/Blocks/Dual/textureBlock.js.map +1 -1
  188. package/Materials/Node/Blocks/Fragment/TBNBlock.js +3 -3
  189. package/Materials/Node/Blocks/Fragment/TBNBlock.js.map +1 -1
  190. package/Materials/Node/Blocks/Fragment/derivativeBlock.js +9 -2
  191. package/Materials/Node/Blocks/Fragment/derivativeBlock.js.map +1 -1
  192. package/Materials/Node/Blocks/Fragment/fragCoordBlock.js +1 -1
  193. package/Materials/Node/Blocks/Fragment/fragCoordBlock.js.map +1 -1
  194. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.d.ts +1 -1
  195. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js +16 -8
  196. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
  197. package/Materials/Node/Blocks/Fragment/frontFacingBlock.js +1 -1
  198. package/Materials/Node/Blocks/Fragment/frontFacingBlock.js.map +1 -1
  199. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js +2 -2
  200. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js.map +1 -1
  201. package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js +3 -3
  202. package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js.map +1 -1
  203. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.d.ts +1 -1
  204. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js +4 -4
  205. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
  206. package/Materials/Node/Blocks/Fragment/screenSizeBlock.d.ts +1 -1
  207. package/Materials/Node/Blocks/Fragment/screenSizeBlock.js +2 -2
  208. package/Materials/Node/Blocks/Fragment/screenSizeBlock.js.map +1 -1
  209. package/Materials/Node/Blocks/Fragment/screenSpaceBlock.js +3 -3
  210. package/Materials/Node/Blocks/Fragment/screenSpaceBlock.js.map +1 -1
  211. package/Materials/Node/Blocks/Fragment/shadowMapBlock.d.ts +1 -1
  212. package/Materials/Node/Blocks/Fragment/shadowMapBlock.js +4 -4
  213. package/Materials/Node/Blocks/Fragment/shadowMapBlock.js.map +1 -1
  214. package/Materials/Node/Blocks/Fragment/twirlBlock.js +9 -9
  215. package/Materials/Node/Blocks/Fragment/twirlBlock.js.map +1 -1
  216. package/Materials/Node/Blocks/Input/inputBlock.d.ts +6 -1
  217. package/Materials/Node/Blocks/Input/inputBlock.js +36 -12
  218. package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
  219. package/Materials/Node/Blocks/PBR/anisotropyBlock.d.ts +1 -1
  220. package/Materials/Node/Blocks/PBR/anisotropyBlock.js +1 -1
  221. package/Materials/Node/Blocks/PBR/anisotropyBlock.js.map +1 -1
  222. package/Materials/Node/Blocks/PBR/clearCoatBlock.d.ts +1 -1
  223. package/Materials/Node/Blocks/PBR/clearCoatBlock.js +3 -3
  224. package/Materials/Node/Blocks/PBR/clearCoatBlock.js.map +1 -1
  225. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.d.ts +1 -1
  226. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +9 -9
  227. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
  228. package/Materials/Node/Blocks/PBR/reflectionBlock.d.ts +1 -1
  229. package/Materials/Node/Blocks/PBR/reflectionBlock.js +21 -21
  230. package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
  231. package/Materials/Node/Blocks/PBR/refractionBlock.d.ts +1 -1
  232. package/Materials/Node/Blocks/PBR/refractionBlock.js +6 -6
  233. package/Materials/Node/Blocks/PBR/refractionBlock.js.map +1 -1
  234. package/Materials/Node/Blocks/PBR/subSurfaceBlock.js +5 -0
  235. package/Materials/Node/Blocks/PBR/subSurfaceBlock.js.map +1 -1
  236. package/Materials/Node/Blocks/Particle/particleBlendMultiplyBlock.js +2 -2
  237. package/Materials/Node/Blocks/Particle/particleBlendMultiplyBlock.js.map +1 -1
  238. package/Materials/Node/Blocks/Particle/particleRampGradientBlock.js +3 -3
  239. package/Materials/Node/Blocks/Particle/particleRampGradientBlock.js.map +1 -1
  240. package/Materials/Node/Blocks/Particle/particleTextureBlock.js +1 -1
  241. package/Materials/Node/Blocks/Particle/particleTextureBlock.js.map +1 -1
  242. package/Materials/Node/Blocks/Teleport/teleportOutBlock.js +1 -1
  243. package/Materials/Node/Blocks/Teleport/teleportOutBlock.js.map +1 -1
  244. package/Materials/Node/Blocks/Vertex/bonesBlock.js +2 -2
  245. package/Materials/Node/Blocks/Vertex/bonesBlock.js.map +1 -1
  246. package/Materials/Node/Blocks/Vertex/instancesBlock.js +5 -5
  247. package/Materials/Node/Blocks/Vertex/instancesBlock.js.map +1 -1
  248. package/Materials/Node/Blocks/Vertex/lightInformationBlock.d.ts +1 -1
  249. package/Materials/Node/Blocks/Vertex/lightInformationBlock.js +12 -12
  250. package/Materials/Node/Blocks/Vertex/lightInformationBlock.js.map +1 -1
  251. package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js +7 -7
  252. package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js.map +1 -1
  253. package/Materials/Node/Blocks/Vertex/vertexOutputBlock.d.ts +1 -1
  254. package/Materials/Node/Blocks/Vertex/vertexOutputBlock.js +10 -3
  255. package/Materials/Node/Blocks/Vertex/vertexOutputBlock.js.map +1 -1
  256. package/Materials/Node/Blocks/addBlock.js +2 -1
  257. package/Materials/Node/Blocks/addBlock.js.map +1 -1
  258. package/Materials/Node/Blocks/arcTan2Block.js +3 -1
  259. package/Materials/Node/Blocks/arcTan2Block.js.map +1 -1
  260. package/Materials/Node/Blocks/clampBlock.js +1 -1
  261. package/Materials/Node/Blocks/clampBlock.js.map +1 -1
  262. package/Materials/Node/Blocks/cloudBlock.js +1 -1
  263. package/Materials/Node/Blocks/cloudBlock.js.map +1 -1
  264. package/Materials/Node/Blocks/colorMergerBlock.js +9 -7
  265. package/Materials/Node/Blocks/colorMergerBlock.js.map +1 -1
  266. package/Materials/Node/Blocks/colorSplitterBlock.js +5 -5
  267. package/Materials/Node/Blocks/colorSplitterBlock.js.map +1 -1
  268. package/Materials/Node/Blocks/conditionalBlock.js +18 -12
  269. package/Materials/Node/Blocks/conditionalBlock.js.map +1 -1
  270. package/Materials/Node/Blocks/crossBlock.js +1 -1
  271. package/Materials/Node/Blocks/crossBlock.js.map +1 -1
  272. package/Materials/Node/Blocks/curveBlock.js +48 -53
  273. package/Materials/Node/Blocks/curveBlock.js.map +1 -1
  274. package/Materials/Node/Blocks/customBlock.js +1 -1
  275. package/Materials/Node/Blocks/customBlock.js.map +1 -1
  276. package/Materials/Node/Blocks/desaturateBlock.js +5 -4
  277. package/Materials/Node/Blocks/desaturateBlock.js.map +1 -1
  278. package/Materials/Node/Blocks/distanceBlock.js +1 -1
  279. package/Materials/Node/Blocks/distanceBlock.js.map +1 -1
  280. package/Materials/Node/Blocks/divideBlock.js +2 -1
  281. package/Materials/Node/Blocks/divideBlock.js.map +1 -1
  282. package/Materials/Node/Blocks/dotBlock.js +1 -1
  283. package/Materials/Node/Blocks/dotBlock.js.map +1 -1
  284. package/Materials/Node/Blocks/elbowBlock.js +1 -1
  285. package/Materials/Node/Blocks/elbowBlock.js.map +1 -1
  286. package/Materials/Node/Blocks/fresnelBlock.js +1 -1
  287. package/Materials/Node/Blocks/fresnelBlock.js.map +1 -1
  288. package/Materials/Node/Blocks/gradientBlock.js +8 -7
  289. package/Materials/Node/Blocks/gradientBlock.js.map +1 -1
  290. package/Materials/Node/Blocks/lengthBlock.js +1 -1
  291. package/Materials/Node/Blocks/lengthBlock.js.map +1 -1
  292. package/Materials/Node/Blocks/lerpBlock.js +1 -1
  293. package/Materials/Node/Blocks/lerpBlock.js.map +1 -1
  294. package/Materials/Node/Blocks/matrixBuilderBlock.js +1 -1
  295. package/Materials/Node/Blocks/matrixBuilderBlock.js.map +1 -1
  296. package/Materials/Node/Blocks/matrixDeterminantBlock.js +1 -1
  297. package/Materials/Node/Blocks/matrixDeterminantBlock.js.map +1 -1
  298. package/Materials/Node/Blocks/matrixTransposeBlock.js +1 -1
  299. package/Materials/Node/Blocks/matrixTransposeBlock.js.map +1 -1
  300. package/Materials/Node/Blocks/maxBlock.js +1 -1
  301. package/Materials/Node/Blocks/maxBlock.js.map +1 -1
  302. package/Materials/Node/Blocks/meshAttributeExistsBlock.js +1 -1
  303. package/Materials/Node/Blocks/meshAttributeExistsBlock.js.map +1 -1
  304. package/Materials/Node/Blocks/minBlock.js +1 -1
  305. package/Materials/Node/Blocks/minBlock.js.map +1 -1
  306. package/Materials/Node/Blocks/modBlock.js +1 -1
  307. package/Materials/Node/Blocks/modBlock.js.map +1 -1
  308. package/Materials/Node/Blocks/multiplyBlock.js +2 -1
  309. package/Materials/Node/Blocks/multiplyBlock.js.map +1 -1
  310. package/Materials/Node/Blocks/nLerpBlock.js +1 -1
  311. package/Materials/Node/Blocks/nLerpBlock.js.map +1 -1
  312. package/Materials/Node/Blocks/negateBlock.js +1 -1
  313. package/Materials/Node/Blocks/negateBlock.js.map +1 -1
  314. package/Materials/Node/Blocks/normalBlendBlock.js +1 -1
  315. package/Materials/Node/Blocks/normalBlendBlock.js.map +1 -1
  316. package/Materials/Node/Blocks/normalizeBlock.js +1 -1
  317. package/Materials/Node/Blocks/normalizeBlock.js.map +1 -1
  318. package/Materials/Node/Blocks/oneMinusBlock.js +1 -1
  319. package/Materials/Node/Blocks/oneMinusBlock.js.map +1 -1
  320. package/Materials/Node/Blocks/posterizeBlock.js +1 -1
  321. package/Materials/Node/Blocks/posterizeBlock.js.map +1 -1
  322. package/Materials/Node/Blocks/powBlock.js +1 -1
  323. package/Materials/Node/Blocks/powBlock.js.map +1 -1
  324. package/Materials/Node/Blocks/randomNumberBlock.js +1 -1
  325. package/Materials/Node/Blocks/randomNumberBlock.js.map +1 -1
  326. package/Materials/Node/Blocks/reciprocalBlock.js +2 -2
  327. package/Materials/Node/Blocks/reciprocalBlock.js.map +1 -1
  328. package/Materials/Node/Blocks/reflectBlock.js +1 -1
  329. package/Materials/Node/Blocks/reflectBlock.js.map +1 -1
  330. package/Materials/Node/Blocks/refractBlock.js +1 -1
  331. package/Materials/Node/Blocks/refractBlock.js.map +1 -1
  332. package/Materials/Node/Blocks/remapBlock.js +1 -1
  333. package/Materials/Node/Blocks/remapBlock.js.map +1 -1
  334. package/Materials/Node/Blocks/replaceColorBlock.js +1 -1
  335. package/Materials/Node/Blocks/replaceColorBlock.js.map +1 -1
  336. package/Materials/Node/Blocks/rotate2dBlock.js +1 -1
  337. package/Materials/Node/Blocks/rotate2dBlock.js.map +1 -1
  338. package/Materials/Node/Blocks/scaleBlock.js +1 -1
  339. package/Materials/Node/Blocks/scaleBlock.js.map +1 -1
  340. package/Materials/Node/Blocks/simplexPerlin3DBlock.js +1 -1
  341. package/Materials/Node/Blocks/simplexPerlin3DBlock.js.map +1 -1
  342. package/Materials/Node/Blocks/smoothStepBlock.js +3 -2
  343. package/Materials/Node/Blocks/smoothStepBlock.js.map +1 -1
  344. package/Materials/Node/Blocks/stepBlock.js +1 -1
  345. package/Materials/Node/Blocks/stepBlock.js.map +1 -1
  346. package/Materials/Node/Blocks/subtractBlock.js +2 -1
  347. package/Materials/Node/Blocks/subtractBlock.js.map +1 -1
  348. package/Materials/Node/Blocks/transformBlock.js +18 -10
  349. package/Materials/Node/Blocks/transformBlock.js.map +1 -1
  350. package/Materials/Node/Blocks/triPlanarBlock.d.ts +1 -1
  351. package/Materials/Node/Blocks/triPlanarBlock.js +2 -2
  352. package/Materials/Node/Blocks/triPlanarBlock.js.map +1 -1
  353. package/Materials/Node/Blocks/trigonometryBlock.js +1 -1
  354. package/Materials/Node/Blocks/trigonometryBlock.js.map +1 -1
  355. package/Materials/Node/Blocks/vectorMergerBlock.js +30 -27
  356. package/Materials/Node/Blocks/vectorMergerBlock.js.map +1 -1
  357. package/Materials/Node/Blocks/vectorSplitterBlock.js +9 -8
  358. package/Materials/Node/Blocks/vectorSplitterBlock.js.map +1 -1
  359. package/Materials/Node/Blocks/viewDirectionBlock.js +1 -1
  360. package/Materials/Node/Blocks/viewDirectionBlock.js.map +1 -1
  361. package/Materials/Node/Blocks/voronoiNoiseBlock.js +19 -8
  362. package/Materials/Node/Blocks/voronoiNoiseBlock.js.map +1 -1
  363. package/Materials/Node/Blocks/waveBlock.js +3 -3
  364. package/Materials/Node/Blocks/waveBlock.js.map +1 -1
  365. package/Materials/Node/Blocks/worleyNoise3DBlock.js +3 -3
  366. package/Materials/Node/Blocks/worleyNoise3DBlock.js.map +1 -1
  367. package/Materials/Node/nodeMaterial.d.ts +9 -3
  368. package/Materials/Node/nodeMaterial.js +29 -4
  369. package/Materials/Node/nodeMaterial.js.map +1 -1
  370. package/Materials/Node/nodeMaterialBlock.d.ts +0 -1
  371. package/Materials/Node/nodeMaterialBlock.js +6 -6
  372. package/Materials/Node/nodeMaterialBlock.js.map +1 -1
  373. package/Materials/Node/nodeMaterialBlockConnectionPoint.d.ts +4 -0
  374. package/Materials/Node/nodeMaterialBlockConnectionPoint.js +12 -0
  375. package/Materials/Node/nodeMaterialBlockConnectionPoint.js.map +1 -1
  376. package/Materials/Node/nodeMaterialBuildState.d.ts +35 -3
  377. package/Materials/Node/nodeMaterialBuildState.js +169 -16
  378. package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
  379. package/Materials/PBR/pbrSubSurfaceConfiguration.d.ts +18 -4
  380. package/Materials/PBR/pbrSubSurfaceConfiguration.js +60 -9
  381. package/Materials/PBR/pbrSubSurfaceConfiguration.js.map +1 -1
  382. package/Materials/Textures/Filtering/hdrFiltering.d.ts +2 -2
  383. package/Materials/Textures/Filtering/hdrFiltering.js.map +1 -1
  384. package/Materials/Textures/Loaders/basisTextureLoader.js +2 -2
  385. package/Materials/Textures/Loaders/basisTextureLoader.js.map +1 -1
  386. package/Materials/Textures/MultiviewRenderTarget.d.ts +1 -0
  387. package/Materials/Textures/MultiviewRenderTarget.js +1 -0
  388. package/Materials/Textures/MultiviewRenderTarget.js.map +1 -1
  389. package/Materials/Textures/Procedurals/proceduralTexture.js +1 -1
  390. package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
  391. package/Materials/Textures/baseTexture.d.ts +3 -3
  392. package/Materials/Textures/baseTexture.js.map +1 -1
  393. package/Materials/Textures/colorGradingTexture.d.ts +2 -2
  394. package/Materials/Textures/colorGradingTexture.js.map +1 -1
  395. package/Materials/Textures/cubeTexture.d.ts +3 -2
  396. package/Materials/Textures/cubeTexture.js +1 -0
  397. package/Materials/Textures/cubeTexture.js.map +1 -1
  398. package/Materials/Textures/hdrCubeTexture.d.ts +2 -2
  399. package/Materials/Textures/hdrCubeTexture.js.map +1 -1
  400. package/Materials/Textures/htmlElementTexture.d.ts +2 -2
  401. package/Materials/Textures/htmlElementTexture.js.map +1 -1
  402. package/Materials/Textures/internalTexture.d.ts +3 -3
  403. package/Materials/Textures/internalTexture.js.map +1 -1
  404. package/Materials/Textures/rawTexture.d.ts +10 -10
  405. package/Materials/Textures/rawTexture.js.map +1 -1
  406. package/Materials/Textures/renderTargetTexture.d.ts +4 -4
  407. package/Materials/Textures/renderTargetTexture.js +4 -4
  408. package/Materials/Textures/renderTargetTexture.js.map +1 -1
  409. package/Materials/Textures/texture.d.ts +2 -2
  410. package/Materials/Textures/texture.js.map +1 -1
  411. package/Materials/Textures/thinTexture.d.ts +3 -3
  412. package/Materials/Textures/thinTexture.js +1 -1
  413. package/Materials/Textures/thinTexture.js.map +1 -1
  414. package/Materials/drawWrapper.d.ts +2 -3
  415. package/Materials/drawWrapper.functions.d.ts +8 -0
  416. package/Materials/drawWrapper.functions.js +9 -0
  417. package/Materials/drawWrapper.functions.js.map +1 -0
  418. package/Materials/drawWrapper.js +0 -3
  419. package/Materials/drawWrapper.js.map +1 -1
  420. package/Materials/effect.d.ts +4 -5
  421. package/Materials/effect.js.map +1 -1
  422. package/Materials/effectRenderer.d.ts +4 -4
  423. package/Materials/effectRenderer.js.map +1 -1
  424. package/Materials/index.d.ts +1 -0
  425. package/Materials/index.js +1 -0
  426. package/Materials/index.js.map +1 -1
  427. package/Materials/materialFlags.d.ts +6 -0
  428. package/Materials/materialFlags.js +15 -1
  429. package/Materials/materialFlags.js.map +1 -1
  430. package/Materials/materialHelper.functions.d.ts +2 -2
  431. package/Materials/materialHelper.functions.js.map +1 -1
  432. package/Materials/materialPluginBase.d.ts +4 -4
  433. package/Materials/materialPluginBase.js.map +1 -1
  434. package/Materials/materialPluginManager.d.ts +2 -2
  435. package/Materials/materialPluginManager.js.map +1 -1
  436. package/Materials/meshDebugPluginMaterial.js +1 -1
  437. package/Materials/meshDebugPluginMaterial.js.map +1 -1
  438. package/Materials/uniformBuffer.d.ts +2 -2
  439. package/Materials/uniformBuffer.js.map +1 -1
  440. package/Meshes/Builders/greasedLineBuilder.d.ts +6 -0
  441. package/Meshes/Builders/greasedLineBuilder.js +15 -8
  442. package/Meshes/Builders/greasedLineBuilder.js.map +1 -1
  443. package/Meshes/Compression/meshoptCompression.js +4 -3
  444. package/Meshes/Compression/meshoptCompression.js.map +1 -1
  445. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +1 -1
  446. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
  447. package/Meshes/GreasedLine/greasedLineBaseMesh.d.ts +2 -2
  448. package/Meshes/GreasedLine/greasedLineBaseMesh.js.map +1 -1
  449. package/Meshes/GreasedLine/greasedLineMesh.js +1 -1
  450. package/Meshes/GreasedLine/greasedLineMesh.js.map +1 -1
  451. package/Meshes/geometry.d.ts +2 -2
  452. package/Meshes/geometry.js +3 -2
  453. package/Meshes/geometry.js.map +1 -1
  454. package/Meshes/instancedMesh.js.map +1 -1
  455. package/Meshes/mesh.d.ts +3 -3
  456. package/Meshes/mesh.js.map +1 -1
  457. package/Meshes/subMesh.d.ts +2 -2
  458. package/Meshes/subMesh.js.map +1 -1
  459. package/Misc/PerformanceViewer/performanceViewerCollectionStrategies.js.map +1 -1
  460. package/Misc/copyTextureToTexture.d.ts +2 -2
  461. package/Misc/copyTextureToTexture.js.map +1 -1
  462. package/Misc/dds.d.ts +3 -2
  463. package/Misc/dds.js +2 -1
  464. package/Misc/dds.js.map +1 -1
  465. package/Misc/dumpTools.d.ts +2 -2
  466. package/Misc/dumpTools.js.map +1 -1
  467. package/Misc/fileTools.js +3 -3
  468. package/Misc/fileTools.js.map +1 -1
  469. package/Misc/filesInput.d.ts +2 -2
  470. package/Misc/filesInput.js.map +1 -1
  471. package/Misc/khronosTextureContainer2.d.ts +8 -2
  472. package/Misc/khronosTextureContainer2.js +3 -2
  473. package/Misc/khronosTextureContainer2.js.map +1 -1
  474. package/Misc/minMaxReducer.d.ts +2 -2
  475. package/Misc/minMaxReducer.js.map +1 -1
  476. package/Misc/screenshotTools.d.ts +6 -6
  477. package/Misc/screenshotTools.js.map +1 -1
  478. package/Misc/textureTools.js.map +1 -1
  479. package/Misc/tools.d.ts +7 -7
  480. package/Misc/tools.functions.d.ts +26 -0
  481. package/Misc/tools.functions.js +62 -0
  482. package/Misc/tools.functions.js.map +1 -1
  483. package/Misc/tools.js.map +1 -1
  484. package/Misc/videoRecorder.d.ts +3 -3
  485. package/Misc/videoRecorder.js.map +1 -1
  486. package/Particles/baseParticleSystem.d.ts +2 -2
  487. package/Particles/baseParticleSystem.js.map +1 -1
  488. package/Particles/computeShaderParticleSystem.d.ts +2 -2
  489. package/Particles/computeShaderParticleSystem.js.map +1 -1
  490. package/Particles/gpuParticleSystem.d.ts +3 -3
  491. package/Particles/gpuParticleSystem.js +2 -2
  492. package/Particles/gpuParticleSystem.js.map +1 -1
  493. package/Particles/particle.js +1 -1
  494. package/Particles/particle.js.map +1 -1
  495. package/Particles/particleSystem.d.ts +3 -3
  496. package/Particles/particleSystem.js +3 -3
  497. package/Particles/particleSystem.js.map +1 -1
  498. package/Particles/particleSystemComponent.d.ts +2 -2
  499. package/Particles/particleSystemComponent.js +2 -2
  500. package/Particles/particleSystemComponent.js.map +1 -1
  501. package/Particles/subEmitter.d.ts +3 -3
  502. package/Particles/subEmitter.js.map +1 -1
  503. package/Particles/thinParticleSystem.d.ts +2 -2
  504. package/Particles/thinParticleSystem.js.map +1 -1
  505. package/Physics/v2/physicsBody.js +3 -3
  506. package/Physics/v2/physicsBody.js.map +1 -1
  507. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
  508. package/PostProcesses/RenderPipeline/postProcessRenderEffect.d.ts +2 -2
  509. package/PostProcesses/RenderPipeline/postProcessRenderEffect.js.map +1 -1
  510. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.d.ts +2 -2
  511. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js.map +1 -1
  512. package/PostProcesses/blackAndWhitePostProcess.d.ts +2 -2
  513. package/PostProcesses/blackAndWhitePostProcess.js.map +1 -1
  514. package/PostProcesses/bloomMergePostProcess.d.ts +2 -2
  515. package/PostProcesses/bloomMergePostProcess.js.map +1 -1
  516. package/PostProcesses/blurPostProcess.d.ts +2 -2
  517. package/PostProcesses/blurPostProcess.js.map +1 -1
  518. package/PostProcesses/chromaticAberrationPostProcess.d.ts +2 -2
  519. package/PostProcesses/chromaticAberrationPostProcess.js.map +1 -1
  520. package/PostProcesses/circleOfConfusionPostProcess.d.ts +2 -2
  521. package/PostProcesses/circleOfConfusionPostProcess.js.map +1 -1
  522. package/PostProcesses/colorCorrectionPostProcess.d.ts +2 -2
  523. package/PostProcesses/colorCorrectionPostProcess.js.map +1 -1
  524. package/PostProcesses/convolutionPostProcess.d.ts +2 -2
  525. package/PostProcesses/convolutionPostProcess.js.map +1 -1
  526. package/PostProcesses/depthOfFieldBlurPostProcess.d.ts +2 -2
  527. package/PostProcesses/depthOfFieldBlurPostProcess.js.map +1 -1
  528. package/PostProcesses/depthOfFieldEffect.js +1 -1
  529. package/PostProcesses/depthOfFieldEffect.js.map +1 -1
  530. package/PostProcesses/depthOfFieldMergePostProcess.d.ts +2 -2
  531. package/PostProcesses/depthOfFieldMergePostProcess.js.map +1 -1
  532. package/PostProcesses/displayPassPostProcess.d.ts +2 -2
  533. package/PostProcesses/displayPassPostProcess.js.map +1 -1
  534. package/PostProcesses/extractHighlightsPostProcess.d.ts +2 -2
  535. package/PostProcesses/extractHighlightsPostProcess.js.map +1 -1
  536. package/PostProcesses/filterPostProcess.d.ts +2 -2
  537. package/PostProcesses/filterPostProcess.js.map +1 -1
  538. package/PostProcesses/fxaaPostProcess.d.ts +2 -2
  539. package/PostProcesses/fxaaPostProcess.js +2 -2
  540. package/PostProcesses/fxaaPostProcess.js.map +1 -1
  541. package/PostProcesses/grainPostProcess.d.ts +2 -2
  542. package/PostProcesses/grainPostProcess.js.map +1 -1
  543. package/PostProcesses/imageProcessingPostProcess.d.ts +2 -2
  544. package/PostProcesses/imageProcessingPostProcess.js.map +1 -1
  545. package/PostProcesses/motionBlurPostProcess.d.ts +2 -2
  546. package/PostProcesses/motionBlurPostProcess.js.map +1 -1
  547. package/PostProcesses/passPostProcess.d.ts +3 -3
  548. package/PostProcesses/passPostProcess.js +2 -2
  549. package/PostProcesses/passPostProcess.js.map +1 -1
  550. package/PostProcesses/postProcess.d.ts +4 -5
  551. package/PostProcesses/postProcess.js +3 -3
  552. package/PostProcesses/postProcess.js.map +1 -1
  553. package/PostProcesses/refractionPostProcess.d.ts +2 -2
  554. package/PostProcesses/refractionPostProcess.js.map +1 -1
  555. package/PostProcesses/screenSpaceCurvaturePostProcess.d.ts +2 -2
  556. package/PostProcesses/screenSpaceCurvaturePostProcess.js.map +1 -1
  557. package/PostProcesses/screenSpaceReflectionPostProcess.d.ts +2 -2
  558. package/PostProcesses/screenSpaceReflectionPostProcess.js.map +1 -1
  559. package/PostProcesses/sharpenPostProcess.d.ts +2 -2
  560. package/PostProcesses/sharpenPostProcess.js.map +1 -1
  561. package/PostProcesses/subSurfaceScatteringPostProcess.d.ts +2 -2
  562. package/PostProcesses/subSurfaceScatteringPostProcess.js.map +1 -1
  563. package/PostProcesses/volumetricLightScatteringPostProcess.d.ts +2 -2
  564. package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
  565. package/Rendering/GlobalIllumination/giRSMManager.js.map +1 -1
  566. package/Rendering/depthPeelingRenderer.js.map +1 -1
  567. package/Rendering/fluidRenderer/fluidRenderer.js.map +1 -1
  568. package/Rendering/fluidRenderer/fluidRenderingDepthTextureCopy.d.ts +2 -2
  569. package/Rendering/fluidRenderer/fluidRenderingDepthTextureCopy.js.map +1 -1
  570. package/Rendering/fluidRenderer/fluidRenderingObject.d.ts +2 -2
  571. package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
  572. package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.d.ts +2 -2
  573. package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js.map +1 -1
  574. package/Rendering/fluidRenderer/fluidRenderingTextures.d.ts +2 -2
  575. package/Rendering/fluidRenderer/fluidRenderingTextures.js.map +1 -1
  576. package/Rendering/geometryBufferRenderer.js +24 -18
  577. package/Rendering/geometryBufferRenderer.js.map +1 -1
  578. package/Rendering/outlineRenderer.js.map +1 -1
  579. package/Rendering/prePassRenderer.js.map +1 -1
  580. package/Shaders/ShadersInclude/pbrBlockSubSurface.js +19 -3
  581. package/Shaders/ShadersInclude/pbrBlockSubSurface.js.map +1 -1
  582. package/Shaders/ShadersInclude/pbrFragmentDeclaration.js +4 -1
  583. package/Shaders/ShadersInclude/pbrFragmentDeclaration.js.map +1 -1
  584. package/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.js +1 -0
  585. package/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.js.map +1 -1
  586. package/Shaders/ShadersInclude/pbrVertexDeclaration.js +3 -0
  587. package/Shaders/ShadersInclude/pbrVertexDeclaration.js.map +1 -1
  588. package/Shaders/pbr.fragment.js +7 -0
  589. package/Shaders/pbr.fragment.js.map +1 -1
  590. package/Shaders/pbr.vertex.js +2 -0
  591. package/Shaders/pbr.vertex.js.map +1 -1
  592. package/ShadersWGSL/ShadersInclude/fresnelFunction.d.ts +5 -0
  593. package/ShadersWGSL/ShadersInclude/fresnelFunction.js +13 -0
  594. package/ShadersWGSL/ShadersInclude/fresnelFunction.js.map +1 -0
  595. package/ShadersWGSL/ShadersInclude/helperFunctions.d.ts +5 -0
  596. package/ShadersWGSL/ShadersInclude/helperFunctions.js +68 -0
  597. package/ShadersWGSL/ShadersInclude/helperFunctions.js.map +1 -0
  598. package/Sprites/spriteRenderer.d.ts +2 -2
  599. package/Sprites/spriteRenderer.js.map +1 -1
  600. package/XR/features/WebXRDepthSensing.js.map +1 -1
  601. package/XR/features/WebXRImageTracking.js.map +1 -1
  602. package/XR/features/WebXRLayers.d.ts +2 -2
  603. package/XR/features/WebXRLayers.js.map +1 -1
  604. package/XR/features/WebXRLightEstimation.js.map +1 -1
  605. package/XR/features/WebXRRawCameraAccess.d.ts +1 -1
  606. package/XR/features/WebXRRawCameraAccess.js.map +1 -1
  607. package/XR/features/WebXRSpaceWarp.js +1 -3
  608. package/XR/features/WebXRSpaceWarp.js.map +1 -1
  609. package/XR/features/WebXRWalkingLocomotion.js.map +1 -1
  610. package/XR/webXRExperienceHelper.js.map +1 -1
  611. package/XR/webXRManagedOutputCanvas.d.ts +2 -2
  612. package/XR/webXRManagedOutputCanvas.js.map +1 -1
  613. package/XR/webXRRenderTargetTextureProvider.js.map +1 -1
  614. package/XR/webXRSessionManager.js.map +1 -1
  615. package/assetContainer.js.map +1 -1
  616. package/node.d.ts +2 -2
  617. package/node.js.map +1 -1
  618. package/package.json +1 -1
  619. package/scene.d.ts +3 -3
  620. package/scene.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"engine.multiRender.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Engines/WebGPU/Extensions/engine.multiRender.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AAErG,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIlD,YAAY,CAAC,SAAS,CAAC,qCAAqC,GAAG,UAC3D,SAA8B,EAC9B,yBAAkC,KAAK,EACvC,cAA2B;IAE3B,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E,SAAS,CAAC,oBAAoB,CAAC,OAAO,GAAG,OAAO,CAAC;KACpD;IAED,OAAO,OAAO,CAAC;AACnB,CAAC,CAAC;AAEF,YAAY,CAAC,SAAS,CAAC,eAAe,GAAG,UAAU,WAAqB;IACpE,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE;QACxD,OAAO;KACV;IAED,IAAI,CAAC,eAAe,GAAG,WAAW,CAAC;IACnC,IAAI,IAAI,CAAC,kBAAkB,EAAE;QACzB,qHAAqH;QACrH,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;KAC5D;SAAM;QACH,uLAAuL;KAC1L;AACL,CAAC,CAAC;AAEF,YAAY,CAAC,SAAS,CAAC,kBAAkB,GAAG,UAAU,aAAwB;IAC1E,MAAM,MAAM,GAAG,EAAE,CAAC;IAElB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAC3C,IAAI,aAAa,CAAC,CAAC,CAAC,EAAE;YAClB,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;SACtB;aAAM;YACH,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SAClB;KACJ;IAED,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC;AAEF,YAAY,CAAC,SAAS,CAAC,uBAAuB,GAAG;IAC7C,mKAAmK;AACvK,CAAC,CAAC;AAEF,YAAY,CAAC,SAAS,CAAC,sCAAsC,GAAG;IAC5D,oJAAoJ;AACxJ,CAAC,CAAC","sourcesContent":["import { InternalTexture, InternalTextureSource } from \"../../../Materials/Textures/internalTexture\";\r\nimport type { IMultiRenderTargetOptions } from \"../../../Materials/Textures/multiRenderTarget\";\r\nimport { Logger } from \"../../../Misc/logger\";\r\nimport type { Nullable } from \"../../../types\";\r\nimport { Constants } from \"../../constants\";\r\nimport type { TextureSize } from \"../../../Materials/Textures/textureCreationOptions\";\r\nimport type { RenderTargetWrapper } from \"../../renderTargetWrapper\";\r\nimport { WebGPUEngine } from \"../../webgpuEngine\";\r\nimport type { WebGPURenderTargetWrapper } from \"../webgpuRenderTargetWrapper\";\r\nimport type { WebGPUHardwareTexture } from \"../webgpuHardwareTexture\";\r\n\r\nWebGPUEngine.prototype.unBindMultiColorAttachmentFramebuffer = function (\r\n rtWrapper: RenderTargetWrapper,\r\n disableGenerateMipMaps: boolean = false,\r\n onBeforeUnbind?: () => void\r\n): void {\r\n if (onBeforeUnbind) {\r\n onBeforeUnbind();\r\n }\r\n\r\n const attachments = rtWrapper._attachments!;\r\n const count = attachments.length;\r\n\r\n this._endCurrentRenderPass();\r\n\r\n for (let i = 0; i < count; i++) {\r\n const texture = rtWrapper.textures![i];\r\n if (texture.generateMipMaps && !disableGenerateMipMaps && !texture.isCube && !texture.is3D) {\r\n this._generateMipmaps(texture);\r\n }\r\n }\r\n\r\n this._currentRenderTarget = null;\r\n\r\n this._mrtAttachments = [];\r\n this._cacheRenderPipeline.setMRT([]);\r\n this._cacheRenderPipeline.setMRTAttachments(this._mrtAttachments);\r\n};\r\n\r\nWebGPUEngine.prototype.createMultipleRenderTarget = function (size: TextureSize, options: IMultiRenderTargetOptions, initializeBuffers?: boolean): RenderTargetWrapper {\r\n let generateMipMaps = false;\r\n let generateDepthBuffer = true;\r\n let generateStencilBuffer = false;\r\n let generateDepthTexture = false;\r\n let depthTextureFormat = Constants.TEXTUREFORMAT_DEPTH16;\r\n let textureCount = 1;\r\n\r\n const defaultType = Constants.TEXTURETYPE_UNSIGNED_INT;\r\n const defaultSamplingMode = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE;\r\n const defaultUseSRGBBuffer = false;\r\n const defaultFormat = Constants.TEXTUREFORMAT_RGBA;\r\n const defaultTarget = Constants.TEXTURE_2D;\r\n\r\n let types: number[] = [];\r\n let samplingModes: number[] = [];\r\n let useSRGBBuffers: boolean[] = [];\r\n let formats: number[] = [];\r\n let targets: number[] = [];\r\n let faceIndex: number[] = [];\r\n let layerIndex: number[] = [];\r\n let layers: number[] = [];\r\n let labels: string[] = [];\r\n\r\n const rtWrapper = this._createHardwareRenderTargetWrapper(true, false, size) as WebGPURenderTargetWrapper;\r\n\r\n if (options !== undefined) {\r\n generateMipMaps = options.generateMipMaps === undefined ? false : options.generateMipMaps;\r\n generateDepthBuffer = options.generateDepthBuffer === undefined ? true : options.generateDepthBuffer;\r\n generateStencilBuffer = options.generateStencilBuffer === undefined ? false : options.generateStencilBuffer;\r\n generateDepthTexture = options.generateDepthTexture === undefined ? false : options.generateDepthTexture;\r\n textureCount = options.textureCount || 1;\r\n depthTextureFormat = options.depthTextureFormat ?? Constants.TEXTUREFORMAT_DEPTH16;\r\n\r\n if (options.types) {\r\n types = options.types;\r\n }\r\n if (options.samplingModes) {\r\n samplingModes = options.samplingModes;\r\n }\r\n if (options.useSRGBBuffers) {\r\n useSRGBBuffers = options.useSRGBBuffers;\r\n }\r\n if (options.formats) {\r\n formats = options.formats;\r\n }\r\n if (options.targetTypes) {\r\n targets = options.targetTypes;\r\n }\r\n if (options.faceIndex) {\r\n faceIndex = options.faceIndex;\r\n }\r\n if (options.layerIndex) {\r\n layerIndex = options.layerIndex;\r\n }\r\n if (options.layerCounts) {\r\n layers = options.layerCounts;\r\n }\r\n\r\n labels = options.labels ?? labels;\r\n }\r\n\r\n rtWrapper.label = options?.label ?? \"MultiRenderTargetWrapper\";\r\n\r\n const width = (<{ width: number; height: number }>size).width || <number>size;\r\n const height = (<{ width: number; height: number }>size).height || <number>size;\r\n\r\n let depthStencilTexture = null;\r\n if (generateDepthBuffer || generateStencilBuffer || generateDepthTexture) {\r\n if (!generateDepthTexture) {\r\n // The caller doesn't want a depth texture, so we are free to use the depth texture format we want.\r\n // So, we will align with what the WebGL engine does\r\n if (generateDepthBuffer && generateStencilBuffer) {\r\n depthTextureFormat = Constants.TEXTUREFORMAT_DEPTH24_STENCIL8;\r\n } else if (generateDepthBuffer) {\r\n depthTextureFormat = Constants.TEXTUREFORMAT_DEPTH32_FLOAT;\r\n } else {\r\n depthTextureFormat = Constants.TEXTUREFORMAT_STENCIL8;\r\n }\r\n }\r\n depthStencilTexture = rtWrapper.createDepthStencilTexture(0, false, generateStencilBuffer, 1, depthTextureFormat, \"MultipleRenderTargetDepthStencil\");\r\n }\r\n\r\n const textures: InternalTexture[] = [];\r\n const attachments: number[] = [];\r\n const defaultAttachments: number[] = [];\r\n\r\n rtWrapper._generateDepthBuffer = generateDepthBuffer;\r\n rtWrapper._generateStencilBuffer = generateStencilBuffer;\r\n rtWrapper._attachments = attachments;\r\n rtWrapper._defaultAttachments = defaultAttachments;\r\n\r\n for (let i = 0; i < textureCount; i++) {\r\n let samplingMode = samplingModes[i] || defaultSamplingMode;\r\n let type = types[i] || defaultType;\r\n\r\n const format = formats[i] || defaultFormat;\r\n const useSRGBBuffer = (useSRGBBuffers[i] || defaultUseSRGBBuffer) && this._caps.supportSRGBBuffers;\r\n\r\n const target = targets[i] || defaultTarget;\r\n const layerCount = layers[i] ?? 1;\r\n\r\n if (type === Constants.TEXTURETYPE_FLOAT && !this._caps.textureFloatLinearFiltering) {\r\n // if floating point linear (FLOAT) then force to NEAREST_SAMPLINGMODE\r\n samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n } else if (type === Constants.TEXTURETYPE_HALF_FLOAT && !this._caps.textureHalfFloatLinearFiltering) {\r\n // if floating point linear (HALF_FLOAT) then force to NEAREST_SAMPLINGMODE\r\n samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n }\r\n\r\n if (type === Constants.TEXTURETYPE_FLOAT && !this._caps.textureFloat) {\r\n type = Constants.TEXTURETYPE_UNSIGNED_INT;\r\n Logger.Warn(\"Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type\");\r\n }\r\n\r\n attachments.push(i + 1);\r\n defaultAttachments.push(initializeBuffers ? i + 1 : i === 0 ? 1 : 0);\r\n\r\n if (target === -1) {\r\n continue;\r\n }\r\n\r\n const texture = new InternalTexture(this, InternalTextureSource.MultiRenderTarget);\r\n textures[i] = texture;\r\n\r\n switch (target) {\r\n case Constants.TEXTURE_CUBE_MAP:\r\n texture.isCube = true;\r\n break;\r\n case Constants.TEXTURE_3D:\r\n texture.is3D = true;\r\n texture.baseDepth = texture.depth = layerCount;\r\n break;\r\n case Constants.TEXTURE_2D_ARRAY:\r\n texture.is2DArray = true;\r\n texture.baseDepth = texture.depth = layerCount;\r\n break;\r\n }\r\n\r\n texture.baseWidth = width;\r\n texture.baseHeight = height;\r\n texture.width = width;\r\n texture.height = height;\r\n texture.isReady = true;\r\n texture.samples = 1;\r\n texture.generateMipMaps = generateMipMaps;\r\n texture.samplingMode = samplingMode;\r\n texture.type = type;\r\n texture._cachedWrapU = Constants.TEXTURE_CLAMP_ADDRESSMODE;\r\n texture._cachedWrapV = Constants.TEXTURE_CLAMP_ADDRESSMODE;\r\n texture._useSRGBBuffer = useSRGBBuffer;\r\n texture.format = format;\r\n texture.label = labels[i];\r\n\r\n this._internalTexturesCache.push(texture);\r\n\r\n this._textureHelper.createGPUTextureForInternalTexture(texture);\r\n }\r\n\r\n if (depthStencilTexture) {\r\n depthStencilTexture.incrementReferences();\r\n textures[textureCount] = depthStencilTexture;\r\n this._internalTexturesCache.push(depthStencilTexture);\r\n }\r\n\r\n rtWrapper.setTextures(textures);\r\n rtWrapper.setLayerAndFaceIndices(layerIndex, faceIndex);\r\n\r\n return rtWrapper;\r\n};\r\n\r\nWebGPUEngine.prototype.updateMultipleRenderTargetTextureSampleCount = function (rtWrapper: Nullable<RenderTargetWrapper>, samples: number): number {\r\n if (!rtWrapper || !rtWrapper.textures || rtWrapper.textures[0].samples === samples) {\r\n return samples;\r\n }\r\n\r\n const count = rtWrapper.textures.length;\r\n\r\n if (count === 0) {\r\n return 1;\r\n }\r\n\r\n samples = Math.min(samples, this.getCaps().maxMSAASamples);\r\n\r\n for (let i = 0; i < count; ++i) {\r\n const texture = rtWrapper.textures[i];\r\n const gpuTextureWrapper = texture._hardwareTexture as Nullable<WebGPUHardwareTexture>;\r\n\r\n gpuTextureWrapper?.releaseMSAATexture();\r\n }\r\n\r\n // Note that rtWrapper.textures can't have null textures, lastTextureIsDepthTexture can't be true if rtWrapper._depthStencilTexture is null\r\n const lastTextureIsDepthTexture = rtWrapper._depthStencilTexture === rtWrapper.textures[count - 1];\r\n\r\n for (let i = 0; i < count; ++i) {\r\n const texture = rtWrapper.textures[i];\r\n this._textureHelper.createMSAATexture(texture, samples, false, i === count - 1 && lastTextureIsDepthTexture ? 0 : i);\r\n texture.samples = samples;\r\n }\r\n\r\n // Note that the last texture of textures is the depth texture if the depth texture has been generated by the MRT class and so the MSAA texture\r\n // will be recreated for this texture by the loop above: in that case, there's no need to create the MSAA texture for rtWrapper._depthStencilTexture\r\n // because rtWrapper._depthStencilTexture is the same texture than the depth texture\r\n if (rtWrapper._depthStencilTexture && !lastTextureIsDepthTexture) {\r\n this._textureHelper.createMSAATexture(rtWrapper._depthStencilTexture, samples);\r\n rtWrapper._depthStencilTexture.samples = samples;\r\n }\r\n\r\n return samples;\r\n};\r\n\r\nWebGPUEngine.prototype.bindAttachments = function (attachments: number[]): void {\r\n if (attachments.length === 0 || !this._currentRenderTarget) {\r\n return;\r\n }\r\n\r\n this._mrtAttachments = attachments;\r\n if (this._currentRenderPass) {\r\n // the render pass has already been created, we need to call setMRTAttachments to update the state of the attachments\r\n this._cacheRenderPipeline.setMRTAttachments(attachments);\r\n } else {\r\n // the render pass is not created yet so we don't need to call setMRTAttachments: it will be called as part of the render pass creation (see WebGPUEngine._startRenderTargetRenderPass)\r\n }\r\n};\r\n\r\nWebGPUEngine.prototype.buildTextureLayout = function (textureStatus: boolean[]): number[] {\r\n const result = [];\r\n\r\n for (let i = 0; i < textureStatus.length; i++) {\r\n if (textureStatus[i]) {\r\n result.push(i + 1);\r\n } else {\r\n result.push(0);\r\n }\r\n }\r\n\r\n return result;\r\n};\r\n\r\nWebGPUEngine.prototype.restoreSingleAttachment = function (): void {\r\n // not sure what to do, probably nothing... This function and restoreSingleAttachmentForRenderTarget are not called in Babylon.js so it's hard to know the use case\r\n};\r\n\r\nWebGPUEngine.prototype.restoreSingleAttachmentForRenderTarget = function (): void {\r\n // not sure what to do, probably nothing... This function and restoreSingleAttachment are not called in Babylon.js so it's hard to know the use case\r\n};\r\n"]}
1
+ {"version":3,"file":"engine.multiRender.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Engines/WebGPU/Extensions/engine.multiRender.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AAErG,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AA8DlD,YAAY,CAAC,SAAS,CAAC,qCAAqC,GAAG,UAC3D,SAA8B,EAC9B,yBAAkC,KAAK,EACvC,cAA2B;IAE3B,IAAI,cAAc,EAAE;QAChB,cAAc,EAAE,CAAC;KACpB;IAED,MAAM,WAAW,GAAG,SAAS,CAAC,YAAa,CAAC;IAC5C,MAAM,KAAK,GAAG,WAAW,CAAC,MAAM,CAAC;IAEjC,IAAI,CAAC,qBAAqB,EAAE,CAAC;IAE7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE;QAC5B,MAAM,OAAO,GAAG,SAAS,CAAC,QAAS,CAAC,CAAC,CAAC,CAAC;QACvC,IAAI,OAAO,CAAC,eAAe,IAAI,CAAC,sBAAsB,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;YACxF,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;SAClC;KACJ;IAED,IAAI,CAAC,oBAAoB,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AG,EAAE,CAAC;IAElB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAC3C,IAAI,aAAa,CAAC,CAAC,CAAC,EAAE;YAClB,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;SACtB;aAAM;YACH,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SAClB;KACJ;IAED,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC;AAEF,YAAY,CAAC,SAAS,CAAC,uBAAuB,GAAG;IAC7C,mKAAmK;AACvK,CAAC,CAAC;AAEF,YAAY,CAAC,SAAS,CAAC,sCAAsC,GAAG;IAC5D,oJAAoJ;AACxJ,CAAC,CAAC","sourcesContent":["import { InternalTexture, InternalTextureSource } from \"../../../Materials/Textures/internalTexture\";\r\nimport type { IMultiRenderTargetOptions } from \"../../../Materials/Textures/multiRenderTarget\";\r\nimport { Logger } from \"../../../Misc/logger\";\r\nimport type { Nullable } from \"../../../types\";\r\nimport { Constants } from \"../../constants\";\r\nimport type { TextureSize } from \"../../../Materials/Textures/textureCreationOptions\";\r\nimport type { RenderTargetWrapper } from \"../../renderTargetWrapper\";\r\nimport { WebGPUEngine } from \"../../webgpuEngine\";\r\nimport type { WebGPURenderTargetWrapper } from \"../webgpuRenderTargetWrapper\";\r\nimport type { WebGPUHardwareTexture } from \"../webgpuHardwareTexture\";\r\n\r\ndeclare module \"../../webgpuEngine\" {\r\n export interface WebGPUEngine {\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(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(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(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(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(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(): 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(): void;\r\n }\r\n}\r\n\r\nWebGPUEngine.prototype.unBindMultiColorAttachmentFramebuffer = function (\r\n rtWrapper: RenderTargetWrapper,\r\n disableGenerateMipMaps: boolean = false,\r\n onBeforeUnbind?: () => void\r\n): void {\r\n if (onBeforeUnbind) {\r\n onBeforeUnbind();\r\n }\r\n\r\n const attachments = rtWrapper._attachments!;\r\n const count = attachments.length;\r\n\r\n this._endCurrentRenderPass();\r\n\r\n for (let i = 0; i < count; i++) {\r\n const texture = rtWrapper.textures![i];\r\n if (texture.generateMipMaps && !disableGenerateMipMaps && !texture.isCube && !texture.is3D) {\r\n this._generateMipmaps(texture);\r\n }\r\n }\r\n\r\n this._currentRenderTarget = null;\r\n\r\n this._mrtAttachments = [];\r\n this._cacheRenderPipeline.setMRT([]);\r\n this._cacheRenderPipeline.setMRTAttachments(this._mrtAttachments);\r\n};\r\n\r\nWebGPUEngine.prototype.createMultipleRenderTarget = function (size: TextureSize, options: IMultiRenderTargetOptions, initializeBuffers?: boolean): RenderTargetWrapper {\r\n let generateMipMaps = false;\r\n let generateDepthBuffer = true;\r\n let generateStencilBuffer = false;\r\n let generateDepthTexture = false;\r\n let depthTextureFormat = Constants.TEXTUREFORMAT_DEPTH16;\r\n let textureCount = 1;\r\n\r\n const defaultType = Constants.TEXTURETYPE_UNSIGNED_INT;\r\n const defaultSamplingMode = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE;\r\n const defaultUseSRGBBuffer = false;\r\n const defaultFormat = Constants.TEXTUREFORMAT_RGBA;\r\n const defaultTarget = Constants.TEXTURE_2D;\r\n\r\n let types: number[] = [];\r\n let samplingModes: number[] = [];\r\n let useSRGBBuffers: boolean[] = [];\r\n let formats: number[] = [];\r\n let targets: number[] = [];\r\n let faceIndex: number[] = [];\r\n let layerIndex: number[] = [];\r\n let layers: number[] = [];\r\n let labels: string[] = [];\r\n\r\n const rtWrapper = this._createHardwareRenderTargetWrapper(true, false, size) as WebGPURenderTargetWrapper;\r\n\r\n if (options !== undefined) {\r\n generateMipMaps = options.generateMipMaps === undefined ? false : options.generateMipMaps;\r\n generateDepthBuffer = options.generateDepthBuffer === undefined ? true : options.generateDepthBuffer;\r\n generateStencilBuffer = options.generateStencilBuffer === undefined ? false : options.generateStencilBuffer;\r\n generateDepthTexture = options.generateDepthTexture === undefined ? false : options.generateDepthTexture;\r\n textureCount = options.textureCount || 1;\r\n depthTextureFormat = options.depthTextureFormat ?? Constants.TEXTUREFORMAT_DEPTH16;\r\n\r\n if (options.types) {\r\n types = options.types;\r\n }\r\n if (options.samplingModes) {\r\n samplingModes = options.samplingModes;\r\n }\r\n if (options.useSRGBBuffers) {\r\n useSRGBBuffers = options.useSRGBBuffers;\r\n }\r\n if (options.formats) {\r\n formats = options.formats;\r\n }\r\n if (options.targetTypes) {\r\n targets = options.targetTypes;\r\n }\r\n if (options.faceIndex) {\r\n faceIndex = options.faceIndex;\r\n }\r\n if (options.layerIndex) {\r\n layerIndex = options.layerIndex;\r\n }\r\n if (options.layerCounts) {\r\n layers = options.layerCounts;\r\n }\r\n\r\n labels = options.labels ?? labels;\r\n }\r\n\r\n rtWrapper.label = options?.label ?? \"MultiRenderTargetWrapper\";\r\n\r\n const width = (<{ width: number; height: number }>size).width || <number>size;\r\n const height = (<{ width: number; height: number }>size).height || <number>size;\r\n\r\n let depthStencilTexture = null;\r\n if (generateDepthBuffer || generateStencilBuffer || generateDepthTexture) {\r\n if (!generateDepthTexture) {\r\n // The caller doesn't want a depth texture, so we are free to use the depth texture format we want.\r\n // So, we will align with what the WebGL engine does\r\n if (generateDepthBuffer && generateStencilBuffer) {\r\n depthTextureFormat = Constants.TEXTUREFORMAT_DEPTH24_STENCIL8;\r\n } else if (generateDepthBuffer) {\r\n depthTextureFormat = Constants.TEXTUREFORMAT_DEPTH32_FLOAT;\r\n } else {\r\n depthTextureFormat = Constants.TEXTUREFORMAT_STENCIL8;\r\n }\r\n }\r\n depthStencilTexture = rtWrapper.createDepthStencilTexture(0, false, generateStencilBuffer, 1, depthTextureFormat, \"MultipleRenderTargetDepthStencil\");\r\n }\r\n\r\n const textures: InternalTexture[] = [];\r\n const attachments: number[] = [];\r\n const defaultAttachments: number[] = [];\r\n\r\n rtWrapper._generateDepthBuffer = generateDepthBuffer;\r\n rtWrapper._generateStencilBuffer = generateStencilBuffer;\r\n rtWrapper._attachments = attachments;\r\n rtWrapper._defaultAttachments = defaultAttachments;\r\n\r\n for (let i = 0; i < textureCount; i++) {\r\n let samplingMode = samplingModes[i] || defaultSamplingMode;\r\n let type = types[i] || defaultType;\r\n\r\n const format = formats[i] || defaultFormat;\r\n const useSRGBBuffer = (useSRGBBuffers[i] || defaultUseSRGBBuffer) && this._caps.supportSRGBBuffers;\r\n\r\n const target = targets[i] || defaultTarget;\r\n const layerCount = layers[i] ?? 1;\r\n\r\n if (type === Constants.TEXTURETYPE_FLOAT && !this._caps.textureFloatLinearFiltering) {\r\n // if floating point linear (FLOAT) then force to NEAREST_SAMPLINGMODE\r\n samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n } else if (type === Constants.TEXTURETYPE_HALF_FLOAT && !this._caps.textureHalfFloatLinearFiltering) {\r\n // if floating point linear (HALF_FLOAT) then force to NEAREST_SAMPLINGMODE\r\n samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n }\r\n\r\n if (type === Constants.TEXTURETYPE_FLOAT && !this._caps.textureFloat) {\r\n type = Constants.TEXTURETYPE_UNSIGNED_INT;\r\n Logger.Warn(\"Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type\");\r\n }\r\n\r\n attachments.push(i + 1);\r\n defaultAttachments.push(initializeBuffers ? i + 1 : i === 0 ? 1 : 0);\r\n\r\n if (target === -1) {\r\n continue;\r\n }\r\n\r\n const texture = new InternalTexture(this, InternalTextureSource.MultiRenderTarget);\r\n textures[i] = texture;\r\n\r\n switch (target) {\r\n case Constants.TEXTURE_CUBE_MAP:\r\n texture.isCube = true;\r\n break;\r\n case Constants.TEXTURE_3D:\r\n texture.is3D = true;\r\n texture.baseDepth = texture.depth = layerCount;\r\n break;\r\n case Constants.TEXTURE_2D_ARRAY:\r\n texture.is2DArray = true;\r\n texture.baseDepth = texture.depth = layerCount;\r\n break;\r\n }\r\n\r\n texture.baseWidth = width;\r\n texture.baseHeight = height;\r\n texture.width = width;\r\n texture.height = height;\r\n texture.isReady = true;\r\n texture.samples = 1;\r\n texture.generateMipMaps = generateMipMaps;\r\n texture.samplingMode = samplingMode;\r\n texture.type = type;\r\n texture._cachedWrapU = Constants.TEXTURE_CLAMP_ADDRESSMODE;\r\n texture._cachedWrapV = Constants.TEXTURE_CLAMP_ADDRESSMODE;\r\n texture._useSRGBBuffer = useSRGBBuffer;\r\n texture.format = format;\r\n texture.label = labels[i];\r\n\r\n this._internalTexturesCache.push(texture);\r\n\r\n this._textureHelper.createGPUTextureForInternalTexture(texture);\r\n }\r\n\r\n if (depthStencilTexture) {\r\n depthStencilTexture.incrementReferences();\r\n textures[textureCount] = depthStencilTexture;\r\n this._internalTexturesCache.push(depthStencilTexture);\r\n }\r\n\r\n rtWrapper.setTextures(textures);\r\n rtWrapper.setLayerAndFaceIndices(layerIndex, faceIndex);\r\n\r\n return rtWrapper;\r\n};\r\n\r\nWebGPUEngine.prototype.updateMultipleRenderTargetTextureSampleCount = function (rtWrapper: Nullable<RenderTargetWrapper>, samples: number): number {\r\n if (!rtWrapper || !rtWrapper.textures || rtWrapper.textures[0].samples === samples) {\r\n return samples;\r\n }\r\n\r\n const count = rtWrapper.textures.length;\r\n\r\n if (count === 0) {\r\n return 1;\r\n }\r\n\r\n samples = Math.min(samples, this.getCaps().maxMSAASamples);\r\n\r\n for (let i = 0; i < count; ++i) {\r\n const texture = rtWrapper.textures[i];\r\n const gpuTextureWrapper = texture._hardwareTexture as Nullable<WebGPUHardwareTexture>;\r\n\r\n gpuTextureWrapper?.releaseMSAATexture();\r\n }\r\n\r\n // Note that rtWrapper.textures can't have null textures, lastTextureIsDepthTexture can't be true if rtWrapper._depthStencilTexture is null\r\n const lastTextureIsDepthTexture = rtWrapper._depthStencilTexture === rtWrapper.textures[count - 1];\r\n\r\n for (let i = 0; i < count; ++i) {\r\n const texture = rtWrapper.textures[i];\r\n this._textureHelper.createMSAATexture(texture, samples, false, i === count - 1 && lastTextureIsDepthTexture ? 0 : i);\r\n texture.samples = samples;\r\n }\r\n\r\n // Note that the last texture of textures is the depth texture if the depth texture has been generated by the MRT class and so the MSAA texture\r\n // will be recreated for this texture by the loop above: in that case, there's no need to create the MSAA texture for rtWrapper._depthStencilTexture\r\n // because rtWrapper._depthStencilTexture is the same texture than the depth texture\r\n if (rtWrapper._depthStencilTexture && !lastTextureIsDepthTexture) {\r\n this._textureHelper.createMSAATexture(rtWrapper._depthStencilTexture, samples);\r\n rtWrapper._depthStencilTexture.samples = samples;\r\n }\r\n\r\n return samples;\r\n};\r\n\r\nWebGPUEngine.prototype.bindAttachments = function (attachments: number[]): void {\r\n if (attachments.length === 0 || !this._currentRenderTarget) {\r\n return;\r\n }\r\n\r\n this._mrtAttachments = attachments;\r\n if (this._currentRenderPass) {\r\n // the render pass has already been created, we need to call setMRTAttachments to update the state of the attachments\r\n this._cacheRenderPipeline.setMRTAttachments(attachments);\r\n } else {\r\n // the render pass is not created yet so we don't need to call setMRTAttachments: it will be called as part of the render pass creation (see WebGPUEngine._startRenderTargetRenderPass)\r\n }\r\n};\r\n\r\nWebGPUEngine.prototype.buildTextureLayout = function (textureStatus: boolean[]): number[] {\r\n const result = [];\r\n\r\n for (let i = 0; i < textureStatus.length; i++) {\r\n if (textureStatus[i]) {\r\n result.push(i + 1);\r\n } else {\r\n result.push(0);\r\n }\r\n }\r\n\r\n return result;\r\n};\r\n\r\nWebGPUEngine.prototype.restoreSingleAttachment = function (): void {\r\n // not sure what to do, probably nothing... This function and restoreSingleAttachmentForRenderTarget are not called in Babylon.js so it's hard to know the use case\r\n};\r\n\r\nWebGPUEngine.prototype.restoreSingleAttachmentForRenderTarget = function (): void {\r\n // not sure what to do, probably nothing... This function and restoreSingleAttachment are not called in Babylon.js so it's hard to know the use case\r\n};\r\n"]}
@@ -1 +1 @@
1
- export {};
1
+ import "../../../Engines/AbstractEngine/abstractEngine.query";
@@ -1,5 +1,6 @@
1
1
  import { WebGPUEngine } from "../../webgpuEngine.js";
2
2
  import { WebGPURenderItemBeginOcclusionQuery, WebGPURenderItemEndOcclusionQuery } from "../webgpuBundleList.js";
3
+ import "../../../Engines/AbstractEngine/abstractEngine.query.js";
3
4
  WebGPUEngine.prototype.getGPUFrameTimeCounter = function () {
4
5
  return this._timestampQuery.gpuFrameTimeCounter;
5
6
  };
@@ -1 +1 @@
1
- {"version":3,"file":"engine.query.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Engines/WebGPU/Extensions/engine.query.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,mCAAmC,EAAE,iCAAiC,EAAE,MAAM,qBAAqB,CAAC;AAI7G,YAAY,CAAC,SAAS,CAAC,sBAAsB,GAAG;IAC5C,OAAO,IAAI,CAAC,eAAe,CAAC,mBAAmB,CAAC;AACpD,CAAC,CAAC;AAEF,YAAY,CAAC,SAAS,CAAC,mBAAmB,GAAG,UAAU,KAAc;IACjE,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,KAAK,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC;AACnE,CAAC,CAAC;AAEF,YAAY,CAAC,SAAS,CAAC,WAAW,GAAG;IACjC,OAAO,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE,CAAC;AAC9C,CAAC,CAAC;AAEF,YAAY,CAAC,SAAS,CAAC,WAAW,GAAG,UAAU,KAAqB;IAChE,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,KAAe,CAAC,CAAC;IAElD,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC;AAEF,YAAY,CAAC,SAAS,CAAC,sBAAsB,GAAG,UAAU,KAAqB;IAC3E,OAAO,IAAI,CAAC,eAAe,CAAC,sBAAsB,CAAC,KAAe,CAAC,CAAC;AACxE,CAAC,CAAC;AAEF,YAAY,CAAC,SAAS,CAAC,cAAc,GAAG,UAAU,KAAqB;IACnE,OAAO,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,KAAe,CAAC,CAAC;AAChE,CAAC,CAAC;AAEF,YAAY,CAAC,SAAS,CAAC,mBAAmB,GAAG,UAAU,aAAqB,EAAE,KAAqB;IAC/F,IAAI,IAAI,CAAC,iBAAiB,EAAE;QACxB,IAAI,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,KAAe,CAAC,EAAE;YACrD,IAAI,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,KAAe,CAAC,CAAC;YAC9D,OAAO,IAAI,CAAC;SACf;KACJ;SAAM;QACH,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,mCAAmC,CAAC,KAAe,CAAC,CAAC,CAAC;QACnF,OAAO,IAAI,CAAC;KACf;IAED,OAAO,KAAK,CAAC;AACjB,CAAC,CAAC;AAEF,YAAY,CAAC,SAAS,CAAC,iBAAiB,GAAG;IACvC,IAAI,IAAI,CAAC,iBAAiB,EAAE;QACxB,IAAI,CAAC,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;KAChD;SAAM;QACH,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,iCAAiC,EAAE,CAAC,CAAC;KACrE;IACD,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC","sourcesContent":["import type { OcclusionQuery } from \"../../Extensions/engine.query\";\r\nimport { WebGPUEngine } from \"../../webgpuEngine\";\r\nimport { WebGPURenderItemBeginOcclusionQuery, WebGPURenderItemEndOcclusionQuery } from \"../webgpuBundleList\";\r\n\r\nimport type { PerfCounter } from \"../../../Misc/perfCounter\";\r\n\r\nWebGPUEngine.prototype.getGPUFrameTimeCounter = function (): PerfCounter {\r\n return this._timestampQuery.gpuFrameTimeCounter;\r\n};\r\n\r\nWebGPUEngine.prototype.captureGPUFrameTime = function (value: boolean) {\r\n this._timestampQuery.enable = value && !!this._caps.timerQuery;\r\n};\r\n\r\nWebGPUEngine.prototype.createQuery = function (): OcclusionQuery {\r\n return this._occlusionQuery.createQuery();\r\n};\r\n\r\nWebGPUEngine.prototype.deleteQuery = function (query: OcclusionQuery): WebGPUEngine {\r\n this._occlusionQuery.deleteQuery(query as number);\r\n\r\n return this;\r\n};\r\n\r\nWebGPUEngine.prototype.isQueryResultAvailable = function (query: OcclusionQuery): boolean {\r\n return this._occlusionQuery.isQueryResultAvailable(query as number);\r\n};\r\n\r\nWebGPUEngine.prototype.getQueryResult = function (query: OcclusionQuery): number {\r\n return this._occlusionQuery.getQueryResult(query as number);\r\n};\r\n\r\nWebGPUEngine.prototype.beginOcclusionQuery = function (algorithmType: number, query: OcclusionQuery): boolean {\r\n if (this.compatibilityMode) {\r\n if (this._occlusionQuery.canBeginQuery(query as number)) {\r\n this._currentRenderPass?.beginOcclusionQuery(query as number);\r\n return true;\r\n }\r\n } else {\r\n this._bundleList.addItem(new WebGPURenderItemBeginOcclusionQuery(query as number));\r\n return true;\r\n }\r\n\r\n return false;\r\n};\r\n\r\nWebGPUEngine.prototype.endOcclusionQuery = function (): WebGPUEngine {\r\n if (this.compatibilityMode) {\r\n this._currentRenderPass?.endOcclusionQuery();\r\n } else {\r\n this._bundleList.addItem(new WebGPURenderItemEndOcclusionQuery());\r\n }\r\n return this;\r\n};\r\n"]}
1
+ {"version":3,"file":"engine.query.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Engines/WebGPU/Extensions/engine.query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,mCAAmC,EAAE,iCAAiC,EAAE,MAAM,qBAAqB,CAAC;AAK7G,OAAO,sDAAsD,CAAC;AAE9D,YAAY,CAAC,SAAS,CAAC,sBAAsB,GAAG;IAC5C,OAAO,IAAI,CAAC,eAAe,CAAC,mBAAmB,CAAC;AACpD,CAAC,CAAC;AAEF,YAAY,CAAC,SAAS,CAAC,mBAAmB,GAAG,UAAU,KAAc;IACjE,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,KAAK,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC;AACnE,CAAC,CAAC;A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O,IAAI,CAAC;AAChB,CAAC,CAAC","sourcesContent":["import { WebGPUEngine } from \"../../webgpuEngine\";\r\nimport { WebGPURenderItemBeginOcclusionQuery, WebGPURenderItemEndOcclusionQuery } from \"../webgpuBundleList\";\r\n\r\nimport type { PerfCounter } from \"../../../Misc/perfCounter\";\r\nimport type { OcclusionQuery } from \"../../../Engines/AbstractEngine/abstractEngine.query\";\r\n\r\nimport \"../../../Engines/AbstractEngine/abstractEngine.query\";\r\n\r\nWebGPUEngine.prototype.getGPUFrameTimeCounter = function (): PerfCounter {\r\n return this._timestampQuery.gpuFrameTimeCounter;\r\n};\r\n\r\nWebGPUEngine.prototype.captureGPUFrameTime = function (value: boolean) {\r\n this._timestampQuery.enable = value && !!this._caps.timerQuery;\r\n};\r\n\r\nWebGPUEngine.prototype.createQuery = function (): OcclusionQuery {\r\n return this._occlusionQuery.createQuery();\r\n};\r\n\r\nWebGPUEngine.prototype.deleteQuery = function (query: OcclusionQuery): WebGPUEngine {\r\n this._occlusionQuery.deleteQuery(query as number);\r\n\r\n return this;\r\n};\r\n\r\nWebGPUEngine.prototype.isQueryResultAvailable = function (query: OcclusionQuery): boolean {\r\n return this._occlusionQuery.isQueryResultAvailable(query as number);\r\n};\r\n\r\nWebGPUEngine.prototype.getQueryResult = function (query: OcclusionQuery): number {\r\n return this._occlusionQuery.getQueryResult(query as number);\r\n};\r\n\r\nWebGPUEngine.prototype.beginOcclusionQuery = function (algorithmType: number, query: OcclusionQuery): boolean {\r\n if (this.compatibilityMode) {\r\n if (this._occlusionQuery.canBeginQuery(query as number)) {\r\n this._currentRenderPass?.beginOcclusionQuery(query as number);\r\n return true;\r\n }\r\n } else {\r\n this._bundleList.addItem(new WebGPURenderItemBeginOcclusionQuery(query as number));\r\n return true;\r\n }\r\n\r\n return false;\r\n};\r\n\r\nWebGPUEngine.prototype.endOcclusionQuery = function (): WebGPUEngine {\r\n if (this.compatibilityMode) {\r\n this._currentRenderPass?.endOcclusionQuery();\r\n } else {\r\n this._bundleList.addItem(new WebGPURenderItemEndOcclusionQuery());\r\n }\r\n return this;\r\n};\r\n"]}
@@ -1 +1,185 @@
1
- export {};
1
+ import { InternalTexture } from "../../../Materials/Textures/internalTexture";
2
+ import type { Nullable } from "../../../types";
3
+ import type { Scene } from "../../../scene";
4
+ declare module "../../webgpuEngine" {
5
+ interface WebGPUEngine {
6
+ /**
7
+ * Creates a raw texture
8
+ * @param data defines the data to store in the texture
9
+ * @param width defines the width of the texture
10
+ * @param height defines the height of the texture
11
+ * @param format defines the format of the data
12
+ * @param generateMipMaps defines if the engine should generate the mip levels
13
+ * @param invertY defines if data must be stored with Y axis inverted
14
+ * @param samplingMode defines the required sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
15
+ * @param compression defines the compression used (null by default)
16
+ * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
17
+ * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)
18
+ * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
19
+ * @returns the raw texture inside an InternalTexture
20
+ */
21
+ createRawTexture(data: Nullable<ArrayBufferView>, width: number, height: number, format: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression: Nullable<string>, type: number, creationFlags?: number, useSRGBBuffer?: boolean): InternalTexture;
22
+ /**
23
+ * Update a raw texture
24
+ * @param texture defines the texture to update
25
+ * @param data defines the data to store in the texture
26
+ * @param format defines the format of the data
27
+ * @param invertY defines if data must be stored with Y axis inverted
28
+ */
29
+ updateRawTexture(texture: Nullable<InternalTexture>, data: Nullable<ArrayBufferView>, format: number, invertY: boolean): void;
30
+ /**
31
+ * Update a raw texture
32
+ * @param texture defines the texture to update
33
+ * @param data defines the data to store in the texture
34
+ * @param format defines the format of the data
35
+ * @param invertY defines if data must be stored with Y axis inverted
36
+ * @param compression defines the compression used (null by default)
37
+ * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
38
+ * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
39
+ */
40
+ updateRawTexture(texture: Nullable<InternalTexture>, data: Nullable<ArrayBufferView>, format: number, invertY: boolean, compression: Nullable<string>, type: number, useSRGBBuffer: boolean): void;
41
+ /**
42
+ * Creates a new raw cube texture
43
+ * @param data defines the array of data to use to create each face
44
+ * @param size defines the size of the textures
45
+ * @param format defines the format of the data
46
+ * @param type defines the type of the data (like Engine.TEXTURETYPE_UNSIGNED_INT)
47
+ * @param generateMipMaps defines if the engine should generate the mip levels
48
+ * @param invertY defines if data must be stored with Y axis inverted
49
+ * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)
50
+ * @param compression defines the compression used (null by default)
51
+ * @returns the cube texture as an InternalTexture
52
+ */
53
+ createRawCubeTexture(data: Nullable<ArrayBufferView[]>, size: number, format: number, type: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression: Nullable<string>): InternalTexture;
54
+ /**
55
+ * Update a raw cube texture
56
+ * @param texture defines the texture to update
57
+ * @param data defines the data to store
58
+ * @param format defines the data format
59
+ * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
60
+ * @param invertY defines if data must be stored with Y axis inverted
61
+ */
62
+ updateRawCubeTexture(texture: InternalTexture, data: ArrayBufferView[], format: number, type: number, invertY: boolean): void;
63
+ /**
64
+ * Update a raw cube texture
65
+ * @param texture defines the texture to update
66
+ * @param data defines the data to store
67
+ * @param format defines the data format
68
+ * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
69
+ * @param invertY defines if data must be stored with Y axis inverted
70
+ * @param compression defines the compression used (null by default)
71
+ */
72
+ updateRawCubeTexture(texture: InternalTexture, data: ArrayBufferView[], format: number, type: number, invertY: boolean, compression: Nullable<string>): void;
73
+ /**
74
+ * Update a raw cube texture
75
+ * @param texture defines the texture to update
76
+ * @param data defines the data to store
77
+ * @param format defines the data format
78
+ * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
79
+ * @param invertY defines if data must be stored with Y axis inverted
80
+ * @param compression defines the compression used (null by default)
81
+ * @param level defines which level of the texture to update
82
+ */
83
+ updateRawCubeTexture(texture: InternalTexture, data: ArrayBufferView[], format: number, type: number, invertY: boolean, compression: Nullable<string>, level: number): void;
84
+ /**
85
+ * Creates a new raw cube texture from a specified url
86
+ * @param url defines the url where the data is located
87
+ * @param scene defines the current scene
88
+ * @param size defines the size of the textures
89
+ * @param format defines the format of the data
90
+ * @param type defines the type fo the data (like Engine.TEXTURETYPE_UNSIGNED_INT)
91
+ * @param noMipmap defines if the engine should avoid generating the mip levels
92
+ * @param callback defines a callback used to extract texture data from loaded data
93
+ * @param mipmapGenerator defines to provide an optional tool to generate mip levels
94
+ * @param onLoad defines a callback called when texture is loaded
95
+ * @param onError defines a callback called if there is an error
96
+ * @returns the cube texture as an InternalTexture
97
+ */
98
+ createRawCubeTextureFromUrl(url: string, scene: Nullable<Scene>, size: number, format: number, type: number, noMipmap: boolean, callback: (ArrayBuffer: ArrayBuffer) => Nullable<ArrayBufferView[]>, mipmapGenerator: Nullable<(faces: ArrayBufferView[]) => ArrayBufferView[][]>, onLoad: Nullable<() => void>, onError: Nullable<(message?: string, exception?: any) => void>): InternalTexture;
99
+ /**
100
+ * Creates a new raw cube texture from a specified url
101
+ * @param url defines the url where the data is located
102
+ * @param scene defines the current scene
103
+ * @param size defines the size of the textures
104
+ * @param format defines the format of the data
105
+ * @param type defines the type fo the data (like Engine.TEXTURETYPE_UNSIGNED_INT)
106
+ * @param noMipmap defines if the engine should avoid generating the mip levels
107
+ * @param callback defines a callback used to extract texture data from loaded data
108
+ * @param mipmapGenerator defines to provide an optional tool to generate mip levels
109
+ * @param onLoad defines a callback called when texture is loaded
110
+ * @param onError defines a callback called if there is an error
111
+ * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)
112
+ * @param invertY defines if data must be stored with Y axis inverted
113
+ * @returns the cube texture as an InternalTexture
114
+ */
115
+ createRawCubeTextureFromUrl(url: string, scene: Nullable<Scene>, size: number, format: number, type: number, noMipmap: boolean, callback: (ArrayBuffer: ArrayBuffer) => Nullable<ArrayBufferView[]>, mipmapGenerator: Nullable<(faces: ArrayBufferView[]) => ArrayBufferView[][]>, onLoad: Nullable<() => void>, onError: Nullable<(message?: string, exception?: any) => void>, samplingMode: number, invertY: boolean): InternalTexture;
116
+ /**
117
+ * Creates a new raw 3D texture
118
+ * @param data defines the data used to create the texture
119
+ * @param width defines the width of the texture
120
+ * @param height defines the height of the texture
121
+ * @param depth defines the depth of the texture
122
+ * @param format defines the format of the texture
123
+ * @param generateMipMaps defines if the engine must generate mip levels
124
+ * @param invertY defines if data must be stored with Y axis inverted
125
+ * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)
126
+ * @param compression defines the compressed used (can be null)
127
+ * @param textureType defines the compressed used (can be null)
128
+ * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)
129
+ * @returns a new raw 3D texture (stored in an InternalTexture)
130
+ */
131
+ createRawTexture3D(data: Nullable<ArrayBufferView>, width: number, height: number, depth: number, format: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression: Nullable<string>, textureType: number, creationFlags?: number): InternalTexture;
132
+ /**
133
+ * Update a raw 3D texture
134
+ * @param texture defines the texture to update
135
+ * @param data defines the data to store
136
+ * @param format defines the data format
137
+ * @param invertY defines if data must be stored with Y axis inverted
138
+ */
139
+ updateRawTexture3D(texture: InternalTexture, data: Nullable<ArrayBufferView>, format: number, invertY: boolean): void;
140
+ /**
141
+ * Update a raw 3D texture
142
+ * @param texture defines the texture to update
143
+ * @param data defines the data to store
144
+ * @param format defines the data format
145
+ * @param invertY defines if data must be stored with Y axis inverted
146
+ * @param compression defines the used compression (can be null)
147
+ * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_INT, Engine.TEXTURETYPE_FLOAT...)
148
+ */
149
+ updateRawTexture3D(texture: InternalTexture, data: Nullable<ArrayBufferView>, format: number, invertY: boolean, compression: Nullable<string>, textureType: number): void;
150
+ /**
151
+ * Creates a new raw 2D array texture
152
+ * @param data defines the data used to create the texture
153
+ * @param width defines the width of the texture
154
+ * @param height defines the height of the texture
155
+ * @param depth defines the number of layers of the texture
156
+ * @param format defines the format of the texture
157
+ * @param generateMipMaps defines if the engine must generate mip levels
158
+ * @param invertY defines if data must be stored with Y axis inverted
159
+ * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)
160
+ * @param compression defines the compressed used (can be null)
161
+ * @param textureType defines the compressed used (can be null)
162
+ * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)
163
+ * @returns a new raw 2D array texture (stored in an InternalTexture)
164
+ */
165
+ createRawTexture2DArray(data: Nullable<ArrayBufferView>, width: number, height: number, depth: number, format: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression: Nullable<string>, textureType: number, creationFlags?: number): InternalTexture;
166
+ /**
167
+ * Update a raw 2D array texture
168
+ * @param texture defines the texture to update
169
+ * @param data defines the data to store
170
+ * @param format defines the data format
171
+ * @param invertY defines if data must be stored with Y axis inverted
172
+ */
173
+ updateRawTexture2DArray(texture: InternalTexture, data: Nullable<ArrayBufferView>, format: number, invertY: boolean): void;
174
+ /**
175
+ * Update a raw 2D array texture
176
+ * @param texture defines the texture to update
177
+ * @param data defines the data to store
178
+ * @param format defines the data format
179
+ * @param invertY defines if data must be stored with Y axis inverted
180
+ * @param compression defines the used compression (can be null)
181
+ * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_INT, Engine.TEXTURETYPE_FLOAT...)
182
+ */
183
+ updateRawTexture2DArray(texture: InternalTexture, data: Nullable<ArrayBufferView>, format: number, invertY: boolean, compression: Nullable<string>, textureType: number): void;
184
+ }
185
+ }
@@ -1 +1 @@
1
- {"version":3,"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CAAC,CAAC,CAAC;KACjD;IAED,sBAAsB;IACtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE;QAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;YAC7B,MAAM,KAAK,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;YAClC,MAAM,QAAQ,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;YAErC,8BAA8B;YAC9B,QAAQ,CAAC,QAAQ,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;YAC5C,QAAQ,CAAC,QAAQ,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;YAC5C,QAAQ,CAAC,QAAQ,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;YAE5C,kCAAkC;YAClC,QAAQ,CAAC,QAAQ,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;SACjC;KACJ;IAED,OAAO,QAAQ,CAAC;AACpB,CAAC","sourcesContent":["import { InternalTexture, InternalTextureSource } from \"../../../Materials/Textures/internalTexture\";\r\nimport type { IWebRequest } from \"../../../Misc/interfaces/iWebRequest\";\r\nimport type { Nullable } from \"../../../types\";\r\nimport { Constants } from \"../../constants\";\r\nimport { WebGPUEngine } from \"../../webgpuEngine\";\r\nimport type { WebGPUHardwareTexture } from \"../webgpuHardwareTexture\";\r\nimport { Logger } from \"../../../Misc/logger\";\r\n\r\nimport type { Scene } from \"../../../scene\";\r\n\r\nWebGPUEngine.prototype.createRawTexture = function (\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n format: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean,\r\n samplingMode: number,\r\n compression: Nullable<string> = null,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n creationFlags: number = 0,\r\n useSRGBBuffer: boolean = false\r\n): InternalTexture {\r\n const texture = new InternalTexture(this, InternalTextureSource.Raw);\r\n texture.baseWidth = width;\r\n texture.baseHeight = height;\r\n texture.width = width;\r\n texture.height = height;\r\n texture.format = format;\r\n texture.generateMipMaps = generateMipMaps;\r\n texture.samplingMode = samplingMode;\r\n texture.invertY = invertY;\r\n texture._compression = compression;\r\n texture.type = type;\r\n texture._creationFlags = creationFlags;\r\n texture._useSRGBBuffer = useSRGBBuffer;\r\n\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferView = data;\r\n }\r\n\r\n this._textureHelper.createGPUTextureForInternalTexture(texture, width, height, undefined, creationFlags);\r\n\r\n this.updateRawTexture(texture, data, format, invertY, compression, type, useSRGBBuffer);\r\n\r\n this._internalTexturesCache.push(texture);\r\n\r\n return texture;\r\n};\r\n\r\nWebGPUEngine.prototype.updateRawTexture = function (\r\n texture: Nullable<InternalTexture>,\r\n bufferView: Nullable<ArrayBufferView>,\r\n format: number,\r\n invertY: boolean,\r\n compression: Nullable<string> = null,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n useSRGBBuffer: boolean = false\r\n): void {\r\n if (!texture) {\r\n return;\r\n }\r\n\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferView = bufferView;\r\n texture.invertY = invertY;\r\n texture._compression = compression;\r\n texture._useSRGBBuffer = useSRGBBuffer;\r\n }\r\n\r\n if (bufferView) {\r\n const gpuTextureWrapper = texture._hardwareTexture as WebGPUHardwareTexture;\r\n const needConversion = format === Constants.TEXTUREFORMAT_RGB;\r\n\r\n if (needConversion) {\r\n bufferView = _convertRGBtoRGBATextureData(bufferView, texture.width, texture.height, type);\r\n }\r\n\r\n const data = new Uint8Array(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength);\r\n\r\n this._textureHelper.updateTexture(data, texture, texture.width, texture.height, texture.depth, gpuTextureWrapper.format, 0, 0, invertY, false, 0, 0);\r\n if (texture.generateMipMaps) {\r\n this._generateMipmaps(texture, this._uploadEncoder);\r\n }\r\n }\r\n\r\n texture.isReady = true;\r\n};\r\n\r\nWebGPUEngine.prototype.createRawCubeTexture = function (\r\n data: Nullable<ArrayBufferView[]>,\r\n size: number,\r\n format: number,\r\n type: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean,\r\n samplingMode: number,\r\n compression: Nullable<string> = null\r\n): InternalTexture {\r\n const texture = new InternalTexture(this, InternalTextureSource.CubeRaw);\r\n\r\n if (type === Constants.TEXTURETYPE_FLOAT && !this._caps.textureFloatLinearFiltering) {\r\n generateMipMaps = false;\r\n samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n Logger.Warn(\"Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.\");\r\n } else if (type === Constants.TEXTURETYPE_HALF_FLOAT && !this._caps.textureHalfFloatLinearFiltering) {\r\n generateMipMaps = false;\r\n samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n Logger.Warn(\"Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.\");\r\n } else if (type === Constants.TEXTURETYPE_FLOAT && !this._caps.textureFloatRender) {\r\n generateMipMaps = false;\r\n Logger.Warn(\"Render to float textures is not supported. Mipmap generation forced to false.\");\r\n } else if (type === Constants.TEXTURETYPE_HALF_FLOAT && !this._caps.colorBufferFloat) {\r\n generateMipMaps = false;\r\n Logger.Warn(\"Render to half float textures is not supported. Mipmap generation forced to false.\");\r\n }\r\n\r\n texture.isCube = true;\r\n texture._originalFormat = format;\r\n texture.format = format === Constants.TEXTUREFORMAT_RGB ? Constants.TEXTUREFORMAT_RGBA : format;\r\n texture.type = type;\r\n texture.generateMipMaps = generateMipMaps;\r\n texture.width = size;\r\n texture.height = size;\r\n texture.samplingMode = samplingMode;\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferViewArray = data;\r\n }\r\n texture.invertY = invertY;\r\n texture._compression = compression;\r\n texture._cachedWrapU = Constants.TEXTURE_CLAMP_ADDRESSMODE;\r\n texture._cachedWrapV = Constants.TEXTURE_CLAMP_ADDRESSMODE;\r\n\r\n this._textureHelper.createGPUTextureForInternalTexture(texture);\r\n\r\n if (data) {\r\n this.updateRawCubeTexture(texture, data, format, type, invertY, compression);\r\n }\r\n\r\n texture.isReady = true;\r\n\r\n return texture;\r\n};\r\n\r\nWebGPUEngine.prototype.updateRawCubeTexture = function (\r\n texture: InternalTexture,\r\n bufferView: ArrayBufferView[],\r\n format: number,\r\n type: number,\r\n invertY: boolean,\r\n compression: Nullable<string> = null\r\n): void {\r\n texture._bufferViewArray = bufferView;\r\n texture.invertY = invertY;\r\n texture._compression = compression;\r\n\r\n const gpuTextureWrapper = texture._hardwareTexture as WebGPUHardwareTexture;\r\n const needConversion = format === Constants.TEXTUREFORMAT_RGB;\r\n\r\n const data = [];\r\n for (let i = 0; i < bufferView.length; ++i) {\r\n let faceData = bufferView[i];\r\n if (needConversion) {\r\n faceData = _convertRGBtoRGBATextureData(bufferView[i], texture.width, texture.height, type);\r\n }\r\n data.push(new Uint8Array(faceData.buffer, faceData.byteOffset, faceData.byteLength));\r\n }\r\n\r\n this._textureHelper.updateCubeTextures(data, gpuTextureWrapper.underlyingResource!, texture.width, texture.height, gpuTextureWrapper.format, invertY, false, 0, 0);\r\n if (texture.generateMipMaps) {\r\n this._generateMipmaps(texture, this._uploadEncoder);\r\n }\r\n\r\n texture.isReady = true;\r\n};\r\n\r\nWebGPUEngine.prototype.createRawCubeTextureFromUrl = function (\r\n url: string,\r\n scene: Nullable<Scene>,\r\n size: number,\r\n format: number,\r\n type: number,\r\n noMipmap: boolean,\r\n callback: (ArrayBuffer: ArrayBuffer) => Nullable<ArrayBufferView[]>,\r\n mipmapGenerator: Nullable<(faces: ArrayBufferView[]) => ArrayBufferView[][]>,\r\n onLoad: Nullable<() => void> = null,\r\n onError: Nullable<(message?: string, exception?: any) => void> = null,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n invertY: boolean = false\r\n): InternalTexture {\r\n const texture = this.createRawCubeTexture(null, size, format, type, !noMipmap, invertY, samplingMode, null);\r\n scene?.addPendingData(texture);\r\n texture.url = url;\r\n\r\n this._internalTexturesCache.push(texture);\r\n\r\n const onerror = (request?: IWebRequest, exception?: any) => {\r\n scene?.removePendingData(texture);\r\n if (onError && request) {\r\n onError(request.status + \" \" + request.statusText, exception);\r\n }\r\n };\r\n\r\n const internalCallback = (data: any) => {\r\n const width = texture.width;\r\n const faceDataArrays = callback(data);\r\n\r\n if (!faceDataArrays) {\r\n return;\r\n }\r\n\r\n const faces = [0, 2, 4, 1, 3, 5];\r\n\r\n if (mipmapGenerator) {\r\n const needConversion = format === Constants.TEXTUREFORMAT_RGB;\r\n const mipData = mipmapGenerator(faceDataArrays);\r\n const gpuTextureWrapper = texture._hardwareTexture as WebGPUHardwareTexture;\r\n const faces = [0, 1, 2, 3, 4, 5];\r\n for (let level = 0; level < mipData.length; level++) {\r\n const mipSize = width >> level;\r\n const allFaces = [];\r\n for (let faceIndex = 0; faceIndex < 6; faceIndex++) {\r\n let mipFaceData = mipData[level][faces[faceIndex]];\r\n if (needConversion) {\r\n mipFaceData = _convertRGBtoRGBATextureData(mipFaceData, mipSize, mipSize, type);\r\n }\r\n allFaces.push(new Uint8Array(mipFaceData.buffer, mipFaceData.byteOffset, mipFaceData.byteLength));\r\n }\r\n this._textureHelper.updateCubeTextures(allFaces, gpuTextureWrapper.underlyingResource!, mipSize, mipSize, gpuTextureWrapper.format, invertY, false, 0, 0);\r\n }\r\n } else {\r\n const allFaces = [];\r\n for (let faceIndex = 0; faceIndex < 6; faceIndex++) {\r\n allFaces.push(faceDataArrays[faces[faceIndex]]);\r\n }\r\n this.updateRawCubeTexture(texture, allFaces, format, type, invertY);\r\n }\r\n\r\n texture.isReady = true;\r\n scene?.removePendingData(texture);\r\n\r\n if (onLoad) {\r\n onLoad();\r\n }\r\n };\r\n\r\n this._loadFile(\r\n url,\r\n (data) => {\r\n internalCallback(data);\r\n },\r\n undefined,\r\n scene?.offlineProvider,\r\n true,\r\n onerror\r\n );\r\n\r\n return texture;\r\n};\r\n\r\nWebGPUEngine.prototype.createRawTexture3D = function (\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n depth: number,\r\n format: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean,\r\n samplingMode: number,\r\n compression: Nullable<string> = null,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n creationFlags: number = 0\r\n): InternalTexture {\r\n const source = InternalTextureSource.Raw3D;\r\n const texture = new InternalTexture(this, source);\r\n\r\n texture.baseWidth = width;\r\n texture.baseHeight = height;\r\n texture.baseDepth = depth;\r\n texture.width = width;\r\n texture.height = height;\r\n texture.depth = depth;\r\n texture.format = format;\r\n texture.type = textureType;\r\n texture.generateMipMaps = generateMipMaps;\r\n texture.samplingMode = samplingMode;\r\n texture.is3D = true;\r\n texture._creationFlags = creationFlags;\r\n\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferView = data;\r\n }\r\n\r\n this._textureHelper.createGPUTextureForInternalTexture(texture, width, height, undefined, creationFlags);\r\n\r\n this.updateRawTexture3D(texture, data, format, invertY, compression, textureType);\r\n\r\n this._internalTexturesCache.push(texture);\r\n\r\n return texture;\r\n};\r\n\r\nWebGPUEngine.prototype.updateRawTexture3D = function (\r\n texture: InternalTexture,\r\n bufferView: Nullable<ArrayBufferView>,\r\n format: number,\r\n invertY: boolean,\r\n compression: Nullable<string> = null,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_INT\r\n): void {\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferView = bufferView;\r\n texture.format = format;\r\n texture.invertY = invertY;\r\n texture._compression = compression;\r\n }\r\n\r\n if (bufferView) {\r\n const gpuTextureWrapper = texture._hardwareTexture as WebGPUHardwareTexture;\r\n const needConversion = format === Constants.TEXTUREFORMAT_RGB;\r\n\r\n if (needConversion) {\r\n bufferView = _convertRGBtoRGBATextureData(bufferView, texture.width, texture.height, textureType);\r\n }\r\n\r\n const data = new Uint8Array(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength);\r\n\r\n this._textureHelper.updateTexture(data, texture, texture.width, texture.height, texture.depth, gpuTextureWrapper.format, 0, 0, invertY, false, 0, 0);\r\n if (texture.generateMipMaps) {\r\n this._generateMipmaps(texture, this._uploadEncoder);\r\n }\r\n }\r\n\r\n texture.isReady = true;\r\n};\r\n\r\nWebGPUEngine.prototype.createRawTexture2DArray = function (\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n depth: number,\r\n format: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean,\r\n samplingMode: number,\r\n compression: Nullable<string> = null,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n creationFlags: number = 0\r\n): InternalTexture {\r\n const source = InternalTextureSource.Raw2DArray;\r\n const texture = new InternalTexture(this, source);\r\n\r\n texture.baseWidth = width;\r\n texture.baseHeight = height;\r\n texture.baseDepth = depth;\r\n texture.width = width;\r\n texture.height = height;\r\n texture.depth = depth;\r\n texture.format = format;\r\n texture.type = textureType;\r\n texture.generateMipMaps = generateMipMaps;\r\n texture.samplingMode = samplingMode;\r\n texture.is2DArray = true;\r\n texture._creationFlags = creationFlags;\r\n\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferView = data;\r\n }\r\n\r\n this._textureHelper.createGPUTextureForInternalTexture(texture, width, height, depth, creationFlags);\r\n\r\n this.updateRawTexture2DArray(texture, data, format, invertY, compression, textureType);\r\n\r\n this._internalTexturesCache.push(texture);\r\n\r\n return texture;\r\n};\r\n\r\nWebGPUEngine.prototype.updateRawTexture2DArray = function (\r\n texture: InternalTexture,\r\n bufferView: Nullable<ArrayBufferView>,\r\n format: number,\r\n invertY: boolean,\r\n compression: Nullable<string> = null,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_INT\r\n): void {\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferView = bufferView;\r\n texture.format = format;\r\n texture.invertY = invertY;\r\n texture._compression = compression;\r\n }\r\n\r\n if (bufferView) {\r\n const gpuTextureWrapper = texture._hardwareTexture as WebGPUHardwareTexture;\r\n const needConversion = format === Constants.TEXTUREFORMAT_RGB;\r\n\r\n if (needConversion) {\r\n bufferView = _convertRGBtoRGBATextureData(bufferView, texture.width, texture.height, textureType);\r\n }\r\n\r\n const data = new Uint8Array(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength);\r\n\r\n this._textureHelper.updateTexture(data, texture, texture.width, texture.height, texture.depth, gpuTextureWrapper.format, 0, 0, invertY, false, 0, 0);\r\n if (texture.generateMipMaps) {\r\n this._generateMipmaps(texture, this._uploadEncoder);\r\n }\r\n }\r\n\r\n texture.isReady = true;\r\n};\r\n\r\n/**\r\n * @internal\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nfunction _convertRGBtoRGBATextureData(rgbData: any, width: number, height: number, textureType: number): ArrayBufferView {\r\n // Create new RGBA data container.\r\n let rgbaData: any;\r\n let val1 = 1;\r\n if (textureType === Constants.TEXTURETYPE_FLOAT) {\r\n rgbaData = new Float32Array(width * height * 4);\r\n } else if (textureType === Constants.TEXTURETYPE_HALF_FLOAT) {\r\n rgbaData = new Uint16Array(width * height * 4);\r\n val1 = 15360; // 15360 is the encoding of 1 in half float\r\n } else if (textureType === Constants.TEXTURETYPE_UNSIGNED_INTEGER) {\r\n rgbaData = new Uint32Array(width * height * 4);\r\n } else {\r\n rgbaData = new Uint8Array(width * height * 4);\r\n }\r\n\r\n // Convert each pixel.\r\n for (let x = 0; x < width; x++) {\r\n for (let y = 0; y < height; y++) {\r\n const index = (y * width + x) * 3;\r\n const newIndex = (y * width + x) * 4;\r\n\r\n // Map Old Value to new value.\r\n rgbaData[newIndex + 0] = rgbData[index + 0];\r\n rgbaData[newIndex + 1] = rgbData[index + 1];\r\n rgbaData[newIndex + 2] = rgbData[index + 2];\r\n\r\n // Add fully opaque alpha channel.\r\n rgbaData[newIndex + 3] = val1;\r\n }\r\n }\r\n\r\n return rgbaData;\r\n}\r\n"]}
1
+ {"version":3,"file":"engine.rawTexture.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Engines/WebGPU/Extensions/engine.rawTexture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AAGrG,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AA6R9C,YAAY,CAAC,SAAS,CAAC,gBAAgB,GAAG,UACtC,IAA+B,EAC/B,KAAa,EACb,MAAc,EACd,MAAc,EACd,eAAwB,EACxB,OAAgB,EAChB,YAAoB,EACpB,cAAgC,IAAI,EACpC,OAAe,SAAS,CAAC,wBAAwB,EACjD,gBAAwB,CAAC,EACzB,gBAAyB,KAAK;IAE9B,MAAM,OAAO,GAAG,IAAI,eAAe,CAAC,IAAI,EAAE,qBAAqB,CAAC,GAAG,CAAC,CAAC;IACrE,OAAO,CAAC,SAAS,GAAG,KAAK,CAAC;IAC1B,OAAO,CAAC,UAAU,GAAG,MAAM,CAAC;IAC5B,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;IACtB,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;IACxB,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;IACxB,OAAO,CAAC,eAAe,GAAG,eAAe,CAAC;IAC1C,OAAO,CAAC,YAAY,GAAG,YAAY,CAAC;IACpC,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC;IAC1B,OAAO,CAAC,YAAY,GAAG,WAAW,CAAC;IACnC,OAAO,CAAC,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SAAM,IAAI,WAAW,KAAK,SAAS,CAAC,4BAA4B,EAAE;QAC/D,QAAQ,GAAG,IAAI,WAAW,CAAC,KAAK,GAAG,MAAM,GAAG,CAAC,CAAC,CAAC;KAClD;SAAM;QACH,QAAQ,GAAG,IAAI,UAAU,CAAC,KAAK,GAAG,MAAM,GAAG,CAAC,CAAC,CAAC;KACjD;IAED,sBAAsB;IACtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE;QAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;YAC7B,MAAM,KAAK,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;YAClC,MAAM,QAAQ,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;YAErC,8BAA8B;YAC9B,QAAQ,CAAC,QAAQ,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;YAC5C,QAAQ,CAAC,QAAQ,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;YAC5C,QAAQ,CAAC,QAAQ,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;YAE5C,kCAAkC;YAClC,QAAQ,CAAC,QAAQ,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;SACjC;KACJ;IAED,OAAO,QAAQ,CAAC;AACpB,CAAC","sourcesContent":["import { InternalTexture, InternalTextureSource } from \"../../../Materials/Textures/internalTexture\";\r\nimport type { IWebRequest } from \"../../../Misc/interfaces/iWebRequest\";\r\nimport type { Nullable } from \"../../../types\";\r\nimport { Constants } from \"../../constants\";\r\nimport { WebGPUEngine } from \"../../webgpuEngine\";\r\nimport type { WebGPUHardwareTexture } from \"../webgpuHardwareTexture\";\r\nimport { Logger } from \"../../../Misc/logger\";\r\n\r\nimport type { Scene } from \"../../../scene\";\r\n\r\ndeclare module \"../../webgpuEngine\" {\r\n export interface WebGPUEngine {\r\n /**\r\n * Creates a raw texture\r\n * @param data defines the data to store in the texture\r\n * @param width defines the width of the texture\r\n * @param height defines the height of the texture\r\n * @param format defines the format of the data\r\n * @param generateMipMaps defines if the engine should generate the mip levels\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param samplingMode defines the required sampling mode (Texture.NEAREST_SAMPLINGMODE by default)\r\n * @param compression defines the compression used (null by default)\r\n * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).\r\n * @returns the raw texture inside an InternalTexture\r\n */\r\n createRawTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n format: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean,\r\n samplingMode: number,\r\n compression: Nullable<string>,\r\n type: number,\r\n creationFlags?: number,\r\n useSRGBBuffer?: boolean\r\n ): InternalTexture;\r\n\r\n /**\r\n * Update a raw texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store in the texture\r\n * @param format defines the format of the data\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n */\r\n updateRawTexture(texture: Nullable<InternalTexture>, data: Nullable<ArrayBufferView>, format: number, invertY: boolean): void;\r\n\r\n /**\r\n * Update a raw texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store in the texture\r\n * @param format defines the format of the data\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param compression defines the compression used (null by default)\r\n * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)\r\n * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).\r\n */\r\n updateRawTexture(\r\n texture: Nullable<InternalTexture>,\r\n data: Nullable<ArrayBufferView>,\r\n format: number,\r\n invertY: boolean,\r\n compression: Nullable<string>,\r\n type: number,\r\n useSRGBBuffer: boolean\r\n ): void;\r\n\r\n /**\r\n * Creates a new raw cube texture\r\n * @param data defines the array of data to use to create each face\r\n * @param size defines the size of the textures\r\n * @param format defines the format of the data\r\n * @param type defines the type of the data (like Engine.TEXTURETYPE_UNSIGNED_INT)\r\n * @param generateMipMaps defines if the engine should generate the mip levels\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)\r\n * @param compression defines the compression used (null by default)\r\n * @returns the cube texture as an InternalTexture\r\n */\r\n createRawCubeTexture(\r\n data: Nullable<ArrayBufferView[]>,\r\n size: number,\r\n format: number,\r\n type: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean,\r\n samplingMode: number,\r\n compression: Nullable<string>\r\n ): InternalTexture;\r\n\r\n /**\r\n * Update a raw cube texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store\r\n * @param format defines the data format\r\n * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n */\r\n updateRawCubeTexture(texture: InternalTexture, data: ArrayBufferView[], format: number, type: number, invertY: boolean): void;\r\n\r\n /**\r\n * Update a raw cube texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store\r\n * @param format defines the data format\r\n * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param compression defines the compression used (null by default)\r\n */\r\n updateRawCubeTexture(texture: InternalTexture, data: ArrayBufferView[], format: number, type: number, invertY: boolean, compression: Nullable<string>): void;\r\n\r\n /**\r\n * Update a raw cube texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store\r\n * @param format defines the data format\r\n * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param compression defines the compression used (null by default)\r\n * @param level defines which level of the texture to update\r\n */\r\n updateRawCubeTexture(texture: InternalTexture, data: ArrayBufferView[], format: number, type: number, invertY: boolean, compression: Nullable<string>, level: number): void;\r\n\r\n /**\r\n * Creates a new raw cube texture from a specified url\r\n * @param url defines the url where the data is located\r\n * @param scene defines the current scene\r\n * @param size defines the size of the textures\r\n * @param format defines the format of the data\r\n * @param type defines the type fo the data (like Engine.TEXTURETYPE_UNSIGNED_INT)\r\n * @param noMipmap defines if the engine should avoid generating the mip levels\r\n * @param callback defines a callback used to extract texture data from loaded data\r\n * @param mipmapGenerator defines to provide an optional tool to generate mip levels\r\n * @param onLoad defines a callback called when texture is loaded\r\n * @param onError defines a callback called if there is an error\r\n * @returns the cube texture as an InternalTexture\r\n */\r\n createRawCubeTextureFromUrl(\r\n url: string,\r\n scene: Nullable<Scene>,\r\n size: number,\r\n format: number,\r\n type: number,\r\n noMipmap: boolean,\r\n callback: (ArrayBuffer: ArrayBuffer) => Nullable<ArrayBufferView[]>,\r\n mipmapGenerator: Nullable<(faces: ArrayBufferView[]) => ArrayBufferView[][]>,\r\n onLoad: Nullable<() => void>,\r\n onError: Nullable<(message?: string, exception?: any) => void>\r\n ): InternalTexture;\r\n\r\n /**\r\n * Creates a new raw cube texture from a specified url\r\n * @param url defines the url where the data is located\r\n * @param scene defines the current scene\r\n * @param size defines the size of the textures\r\n * @param format defines the format of the data\r\n * @param type defines the type fo the data (like Engine.TEXTURETYPE_UNSIGNED_INT)\r\n * @param noMipmap defines if the engine should avoid generating the mip levels\r\n * @param callback defines a callback used to extract texture data from loaded data\r\n * @param mipmapGenerator defines to provide an optional tool to generate mip levels\r\n * @param onLoad defines a callback called when texture is loaded\r\n * @param onError defines a callback called if there is an error\r\n * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @returns the cube texture as an InternalTexture\r\n */\r\n createRawCubeTextureFromUrl(\r\n url: string,\r\n scene: Nullable<Scene>,\r\n size: number,\r\n format: number,\r\n type: number,\r\n noMipmap: boolean,\r\n callback: (ArrayBuffer: ArrayBuffer) => Nullable<ArrayBufferView[]>,\r\n mipmapGenerator: Nullable<(faces: ArrayBufferView[]) => ArrayBufferView[][]>,\r\n onLoad: Nullable<() => void>,\r\n onError: Nullable<(message?: string, exception?: any) => void>,\r\n samplingMode: number,\r\n invertY: boolean\r\n ): InternalTexture;\r\n\r\n /**\r\n * Creates a new raw 3D texture\r\n * @param data defines the data used to create the texture\r\n * @param width defines the width of the texture\r\n * @param height defines the height of the texture\r\n * @param depth defines the depth of the texture\r\n * @param format defines the format of the texture\r\n * @param generateMipMaps defines if the engine must generate mip levels\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)\r\n * @param compression defines the compressed used (can be null)\r\n * @param textureType defines the compressed used (can be null)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @returns a new raw 3D texture (stored in an InternalTexture)\r\n */\r\n createRawTexture3D(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n depth: number,\r\n format: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean,\r\n samplingMode: number,\r\n compression: Nullable<string>,\r\n textureType: number,\r\n creationFlags?: number\r\n ): InternalTexture;\r\n\r\n /**\r\n * Update a raw 3D texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store\r\n * @param format defines the data format\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n */\r\n updateRawTexture3D(texture: InternalTexture, data: Nullable<ArrayBufferView>, format: number, invertY: boolean): void;\r\n\r\n /**\r\n * Update a raw 3D texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store\r\n * @param format defines the data format\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param compression defines the used compression (can be null)\r\n * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_INT, Engine.TEXTURETYPE_FLOAT...)\r\n */\r\n updateRawTexture3D(texture: InternalTexture, data: Nullable<ArrayBufferView>, format: number, invertY: boolean, compression: Nullable<string>, textureType: number): void;\r\n\r\n /**\r\n * Creates a new raw 2D array texture\r\n * @param data defines the data used to create the texture\r\n * @param width defines the width of the texture\r\n * @param height defines the height of the texture\r\n * @param depth defines the number of layers of the texture\r\n * @param format defines the format of the texture\r\n * @param generateMipMaps defines if the engine must generate mip levels\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)\r\n * @param compression defines the compressed used (can be null)\r\n * @param textureType defines the compressed used (can be null)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @returns a new raw 2D array texture (stored in an InternalTexture)\r\n */\r\n createRawTexture2DArray(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n depth: number,\r\n format: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean,\r\n samplingMode: number,\r\n compression: Nullable<string>,\r\n textureType: number,\r\n creationFlags?: number\r\n ): InternalTexture;\r\n\r\n /**\r\n * Update a raw 2D array texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store\r\n * @param format defines the data format\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n */\r\n updateRawTexture2DArray(texture: InternalTexture, data: Nullable<ArrayBufferView>, format: number, invertY: boolean): void;\r\n\r\n /**\r\n * Update a raw 2D array texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store\r\n * @param format defines the data format\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param compression defines the used compression (can be null)\r\n * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_INT, Engine.TEXTURETYPE_FLOAT...)\r\n */\r\n updateRawTexture2DArray(\r\n texture: InternalTexture,\r\n data: Nullable<ArrayBufferView>,\r\n format: number,\r\n invertY: boolean,\r\n compression: Nullable<string>,\r\n textureType: number\r\n ): void;\r\n }\r\n}\r\n\r\nWebGPUEngine.prototype.createRawTexture = function (\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n format: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean,\r\n samplingMode: number,\r\n compression: Nullable<string> = null,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n creationFlags: number = 0,\r\n useSRGBBuffer: boolean = false\r\n): InternalTexture {\r\n const texture = new InternalTexture(this, InternalTextureSource.Raw);\r\n texture.baseWidth = width;\r\n texture.baseHeight = height;\r\n texture.width = width;\r\n texture.height = height;\r\n texture.format = format;\r\n texture.generateMipMaps = generateMipMaps;\r\n texture.samplingMode = samplingMode;\r\n texture.invertY = invertY;\r\n texture._compression = compression;\r\n texture.type = type;\r\n texture._creationFlags = creationFlags;\r\n texture._useSRGBBuffer = useSRGBBuffer;\r\n\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferView = data;\r\n }\r\n\r\n this._textureHelper.createGPUTextureForInternalTexture(texture, width, height, undefined, creationFlags);\r\n\r\n this.updateRawTexture(texture, data, format, invertY, compression, type, useSRGBBuffer);\r\n\r\n this._internalTexturesCache.push(texture);\r\n\r\n return texture;\r\n};\r\n\r\nWebGPUEngine.prototype.updateRawTexture = function (\r\n texture: Nullable<InternalTexture>,\r\n bufferView: Nullable<ArrayBufferView>,\r\n format: number,\r\n invertY: boolean,\r\n compression: Nullable<string> = null,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n useSRGBBuffer: boolean = false\r\n): void {\r\n if (!texture) {\r\n return;\r\n }\r\n\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferView = bufferView;\r\n texture.invertY = invertY;\r\n texture._compression = compression;\r\n texture._useSRGBBuffer = useSRGBBuffer;\r\n }\r\n\r\n if (bufferView) {\r\n const gpuTextureWrapper = texture._hardwareTexture as WebGPUHardwareTexture;\r\n const needConversion = format === Constants.TEXTUREFORMAT_RGB;\r\n\r\n if (needConversion) {\r\n bufferView = _convertRGBtoRGBATextureData(bufferView, texture.width, texture.height, type);\r\n }\r\n\r\n const data = new Uint8Array(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength);\r\n\r\n this._textureHelper.updateTexture(data, texture, texture.width, texture.height, texture.depth, gpuTextureWrapper.format, 0, 0, invertY, false, 0, 0);\r\n if (texture.generateMipMaps) {\r\n this._generateMipmaps(texture, this._uploadEncoder);\r\n }\r\n }\r\n\r\n texture.isReady = true;\r\n};\r\n\r\nWebGPUEngine.prototype.createRawCubeTexture = function (\r\n data: Nullable<ArrayBufferView[]>,\r\n size: number,\r\n format: number,\r\n type: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean,\r\n samplingMode: number,\r\n compression: Nullable<string> = null\r\n): InternalTexture {\r\n const texture = new InternalTexture(this, InternalTextureSource.CubeRaw);\r\n\r\n if (type === Constants.TEXTURETYPE_FLOAT && !this._caps.textureFloatLinearFiltering) {\r\n generateMipMaps = false;\r\n samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n Logger.Warn(\"Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.\");\r\n } else if (type === Constants.TEXTURETYPE_HALF_FLOAT && !this._caps.textureHalfFloatLinearFiltering) {\r\n generateMipMaps = false;\r\n samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n Logger.Warn(\"Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.\");\r\n } else if (type === Constants.TEXTURETYPE_FLOAT && !this._caps.textureFloatRender) {\r\n generateMipMaps = false;\r\n Logger.Warn(\"Render to float textures is not supported. Mipmap generation forced to false.\");\r\n } else if (type === Constants.TEXTURETYPE_HALF_FLOAT && !this._caps.colorBufferFloat) {\r\n generateMipMaps = false;\r\n Logger.Warn(\"Render to half float textures is not supported. Mipmap generation forced to false.\");\r\n }\r\n\r\n texture.isCube = true;\r\n texture._originalFormat = format;\r\n texture.format = format === Constants.TEXTUREFORMAT_RGB ? Constants.TEXTUREFORMAT_RGBA : format;\r\n texture.type = type;\r\n texture.generateMipMaps = generateMipMaps;\r\n texture.width = size;\r\n texture.height = size;\r\n texture.samplingMode = samplingMode;\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferViewArray = data;\r\n }\r\n texture.invertY = invertY;\r\n texture._compression = compression;\r\n texture._cachedWrapU = Constants.TEXTURE_CLAMP_ADDRESSMODE;\r\n texture._cachedWrapV = Constants.TEXTURE_CLAMP_ADDRESSMODE;\r\n\r\n this._textureHelper.createGPUTextureForInternalTexture(texture);\r\n\r\n if (data) {\r\n this.updateRawCubeTexture(texture, data, format, type, invertY, compression);\r\n }\r\n\r\n texture.isReady = true;\r\n\r\n return texture;\r\n};\r\n\r\nWebGPUEngine.prototype.updateRawCubeTexture = function (\r\n texture: InternalTexture,\r\n bufferView: ArrayBufferView[],\r\n format: number,\r\n type: number,\r\n invertY: boolean,\r\n compression: Nullable<string> = null\r\n): void {\r\n texture._bufferViewArray = bufferView;\r\n texture.invertY = invertY;\r\n texture._compression = compression;\r\n\r\n const gpuTextureWrapper = texture._hardwareTexture as WebGPUHardwareTexture;\r\n const needConversion = format === Constants.TEXTUREFORMAT_RGB;\r\n\r\n const data = [];\r\n for (let i = 0; i < bufferView.length; ++i) {\r\n let faceData = bufferView[i];\r\n if (needConversion) {\r\n faceData = _convertRGBtoRGBATextureData(bufferView[i], texture.width, texture.height, type);\r\n }\r\n data.push(new Uint8Array(faceData.buffer, faceData.byteOffset, faceData.byteLength));\r\n }\r\n\r\n this._textureHelper.updateCubeTextures(data, gpuTextureWrapper.underlyingResource!, texture.width, texture.height, gpuTextureWrapper.format, invertY, false, 0, 0);\r\n if (texture.generateMipMaps) {\r\n this._generateMipmaps(texture, this._uploadEncoder);\r\n }\r\n\r\n texture.isReady = true;\r\n};\r\n\r\nWebGPUEngine.prototype.createRawCubeTextureFromUrl = function (\r\n url: string,\r\n scene: Nullable<Scene>,\r\n size: number,\r\n format: number,\r\n type: number,\r\n noMipmap: boolean,\r\n callback: (ArrayBuffer: ArrayBuffer) => Nullable<ArrayBufferView[]>,\r\n mipmapGenerator: Nullable<(faces: ArrayBufferView[]) => ArrayBufferView[][]>,\r\n onLoad: Nullable<() => void> = null,\r\n onError: Nullable<(message?: string, exception?: any) => void> = null,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n invertY: boolean = false\r\n): InternalTexture {\r\n const texture = this.createRawCubeTexture(null, size, format, type, !noMipmap, invertY, samplingMode, null);\r\n scene?.addPendingData(texture);\r\n texture.url = url;\r\n\r\n this._internalTexturesCache.push(texture);\r\n\r\n const onerror = (request?: IWebRequest, exception?: any) => {\r\n scene?.removePendingData(texture);\r\n if (onError && request) {\r\n onError(request.status + \" \" + request.statusText, exception);\r\n }\r\n };\r\n\r\n const internalCallback = (data: any) => {\r\n const width = texture.width;\r\n const faceDataArrays = callback(data);\r\n\r\n if (!faceDataArrays) {\r\n return;\r\n }\r\n\r\n const faces = [0, 2, 4, 1, 3, 5];\r\n\r\n if (mipmapGenerator) {\r\n const needConversion = format === Constants.TEXTUREFORMAT_RGB;\r\n const mipData = mipmapGenerator(faceDataArrays);\r\n const gpuTextureWrapper = texture._hardwareTexture as WebGPUHardwareTexture;\r\n const faces = [0, 1, 2, 3, 4, 5];\r\n for (let level = 0; level < mipData.length; level++) {\r\n const mipSize = width >> level;\r\n const allFaces = [];\r\n for (let faceIndex = 0; faceIndex < 6; faceIndex++) {\r\n let mipFaceData = mipData[level][faces[faceIndex]];\r\n if (needConversion) {\r\n mipFaceData = _convertRGBtoRGBATextureData(mipFaceData, mipSize, mipSize, type);\r\n }\r\n allFaces.push(new Uint8Array(mipFaceData.buffer, mipFaceData.byteOffset, mipFaceData.byteLength));\r\n }\r\n this._textureHelper.updateCubeTextures(allFaces, gpuTextureWrapper.underlyingResource!, mipSize, mipSize, gpuTextureWrapper.format, invertY, false, 0, 0);\r\n }\r\n } else {\r\n const allFaces = [];\r\n for (let faceIndex = 0; faceIndex < 6; faceIndex++) {\r\n allFaces.push(faceDataArrays[faces[faceIndex]]);\r\n }\r\n this.updateRawCubeTexture(texture, allFaces, format, type, invertY);\r\n }\r\n\r\n texture.isReady = true;\r\n scene?.removePendingData(texture);\r\n\r\n if (onLoad) {\r\n onLoad();\r\n }\r\n };\r\n\r\n this._loadFile(\r\n url,\r\n (data) => {\r\n internalCallback(data);\r\n },\r\n undefined,\r\n scene?.offlineProvider,\r\n true,\r\n onerror\r\n );\r\n\r\n return texture;\r\n};\r\n\r\nWebGPUEngine.prototype.createRawTexture3D = function (\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n depth: number,\r\n format: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean,\r\n samplingMode: number,\r\n compression: Nullable<string> = null,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n creationFlags: number = 0\r\n): InternalTexture {\r\n const source = InternalTextureSource.Raw3D;\r\n const texture = new InternalTexture(this, source);\r\n\r\n texture.baseWidth = width;\r\n texture.baseHeight = height;\r\n texture.baseDepth = depth;\r\n texture.width = width;\r\n texture.height = height;\r\n texture.depth = depth;\r\n texture.format = format;\r\n texture.type = textureType;\r\n texture.generateMipMaps = generateMipMaps;\r\n texture.samplingMode = samplingMode;\r\n texture.is3D = true;\r\n texture._creationFlags = creationFlags;\r\n\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferView = data;\r\n }\r\n\r\n this._textureHelper.createGPUTextureForInternalTexture(texture, width, height, undefined, creationFlags);\r\n\r\n this.updateRawTexture3D(texture, data, format, invertY, compression, textureType);\r\n\r\n this._internalTexturesCache.push(texture);\r\n\r\n return texture;\r\n};\r\n\r\nWebGPUEngine.prototype.updateRawTexture3D = function (\r\n texture: InternalTexture,\r\n bufferView: Nullable<ArrayBufferView>,\r\n format: number,\r\n invertY: boolean,\r\n compression: Nullable<string> = null,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_INT\r\n): void {\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferView = bufferView;\r\n texture.format = format;\r\n texture.invertY = invertY;\r\n texture._compression = compression;\r\n }\r\n\r\n if (bufferView) {\r\n const gpuTextureWrapper = texture._hardwareTexture as WebGPUHardwareTexture;\r\n const needConversion = format === Constants.TEXTUREFORMAT_RGB;\r\n\r\n if (needConversion) {\r\n bufferView = _convertRGBtoRGBATextureData(bufferView, texture.width, texture.height, textureType);\r\n }\r\n\r\n const data = new Uint8Array(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength);\r\n\r\n this._textureHelper.updateTexture(data, texture, texture.width, texture.height, texture.depth, gpuTextureWrapper.format, 0, 0, invertY, false, 0, 0);\r\n if (texture.generateMipMaps) {\r\n this._generateMipmaps(texture, this._uploadEncoder);\r\n }\r\n }\r\n\r\n texture.isReady = true;\r\n};\r\n\r\nWebGPUEngine.prototype.createRawTexture2DArray = function (\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n depth: number,\r\n format: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean,\r\n samplingMode: number,\r\n compression: Nullable<string> = null,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n creationFlags: number = 0\r\n): InternalTexture {\r\n const source = InternalTextureSource.Raw2DArray;\r\n const texture = new InternalTexture(this, source);\r\n\r\n texture.baseWidth = width;\r\n texture.baseHeight = height;\r\n texture.baseDepth = depth;\r\n texture.width = width;\r\n texture.height = height;\r\n texture.depth = depth;\r\n texture.format = format;\r\n texture.type = textureType;\r\n texture.generateMipMaps = generateMipMaps;\r\n texture.samplingMode = samplingMode;\r\n texture.is2DArray = true;\r\n texture._creationFlags = creationFlags;\r\n\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferView = data;\r\n }\r\n\r\n this._textureHelper.createGPUTextureForInternalTexture(texture, width, height, depth, creationFlags);\r\n\r\n this.updateRawTexture2DArray(texture, data, format, invertY, compression, textureType);\r\n\r\n this._internalTexturesCache.push(texture);\r\n\r\n return texture;\r\n};\r\n\r\nWebGPUEngine.prototype.updateRawTexture2DArray = function (\r\n texture: InternalTexture,\r\n bufferView: Nullable<ArrayBufferView>,\r\n format: number,\r\n invertY: boolean,\r\n compression: Nullable<string> = null,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_INT\r\n): void {\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferView = bufferView;\r\n texture.format = format;\r\n texture.invertY = invertY;\r\n texture._compression = compression;\r\n }\r\n\r\n if (bufferView) {\r\n const gpuTextureWrapper = texture._hardwareTexture as WebGPUHardwareTexture;\r\n const needConversion = format === Constants.TEXTUREFORMAT_RGB;\r\n\r\n if (needConversion) {\r\n bufferView = _convertRGBtoRGBATextureData(bufferView, texture.width, texture.height, textureType);\r\n }\r\n\r\n const data = new Uint8Array(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength);\r\n\r\n this._textureHelper.updateTexture(data, texture, texture.width, texture.height, texture.depth, gpuTextureWrapper.format, 0, 0, invertY, false, 0, 0);\r\n if (texture.generateMipMaps) {\r\n this._generateMipmaps(texture, this._uploadEncoder);\r\n }\r\n }\r\n\r\n texture.isReady = true;\r\n};\r\n\r\n/**\r\n * @internal\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nfunction _convertRGBtoRGBATextureData(rgbData: any, width: number, height: number, textureType: number): ArrayBufferView {\r\n // Create new RGBA data container.\r\n let rgbaData: any;\r\n let val1 = 1;\r\n if (textureType === Constants.TEXTURETYPE_FLOAT) {\r\n rgbaData = new Float32Array(width * height * 4);\r\n } else if (textureType === Constants.TEXTURETYPE_HALF_FLOAT) {\r\n rgbaData = new Uint16Array(width * height * 4);\r\n val1 = 15360; // 15360 is the encoding of 1 in half float\r\n } else if (textureType === Constants.TEXTURETYPE_UNSIGNED_INTEGER) {\r\n rgbaData = new Uint32Array(width * height * 4);\r\n } else {\r\n rgbaData = new Uint8Array(width * height * 4);\r\n }\r\n\r\n // Convert each pixel.\r\n for (let x = 0; x < width; x++) {\r\n for (let y = 0; y < height; y++) {\r\n const index = (y * width + x) * 3;\r\n const newIndex = (y * width + x) * 4;\r\n\r\n // Map Old Value to new value.\r\n rgbaData[newIndex + 0] = rgbData[index + 0];\r\n rgbaData[newIndex + 1] = rgbData[index + 1];\r\n rgbaData[newIndex + 2] = rgbData[index + 2];\r\n\r\n // Add fully opaque alpha channel.\r\n rgbaData[newIndex + 3] = val1;\r\n }\r\n }\r\n\r\n return rgbaData;\r\n}\r\n"]}
@@ -1 +1,10 @@
1
- export {};
1
+ import type { InternalTexture } from "../../../Materials/Textures/internalTexture";
2
+ import type { Nullable } from "../../../types";
3
+ declare module "../../webgpuEngine" {
4
+ interface WebGPUEngine {
5
+ /** @internal */
6
+ _readTexturePixels(texture: InternalTexture, width: number, height: number, faceIndex?: number, level?: number, buffer?: Nullable<ArrayBufferView>, flushRenderer?: boolean, noDataConversion?: boolean, x?: number, y?: number): Promise<ArrayBufferView>;
7
+ /** @internal */
8
+ _readTexturePixelsSync(texture: InternalTexture, width: number, height: number, faceIndex?: number, level?: number, buffer?: Nullable<ArrayBufferView>, flushRenderer?: boolean, noDataConversion?: boolean, x?: number, y?: number): ArrayBufferView;
9
+ }
10
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"engine.readTexture.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Engines/WebGPU/Extensions/engine.readTexture.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD,YAAY,CAAC,SAAS,CAAC,kBAAkB,GAAG,UACxC,OAAwB,EACxB,KAAa,EACb,MAAc,EACd,SAAS,GAAG,CAAC,CAAC,EACd,KAAK,GAAG,CAAC,EACT,SAAoC,IAAI,EACxC,aAAa,GAAG,IAAI,EACpB,gBAAgB,GAAG,KAAK,EACxB,CAAC,GAAG,CAAC,EACL,CAAC,GAAG,CAAC;IAEL,MAAM,iBAAiB,GAAG,OAAO,CAAC,gBAAyC,CAAC;IAE5E,IAAI,aAAa,EAAE;QACf,IAAI,CAAC,gBAAgB,EAAE,CAAC;KAC3B;IAED,OAAO,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,iBAAiB,CAAC,kBAAmB,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAC5K,CAAC,CAAC;AAEF,YAAY,CAAC,SAAS,CAAC,sBAAsB,GAAG;IAC5C,4CAA4C;IAC5C,MAAM,kDAAkD,CAAC;AAC7D,CAAC,CAAC","sourcesContent":["import type { InternalTexture } from \"../../../Materials/Textures/internalTexture\";\r\nimport type { Nullable } from \"../../../types\";\r\nimport { WebGPUEngine } from \"../../webgpuEngine\";\r\nimport type { WebGPUHardwareTexture } from \"../webgpuHardwareTexture\";\r\n\r\nWebGPUEngine.prototype._readTexturePixels = function (\r\n texture: InternalTexture,\r\n width: number,\r\n height: number,\r\n faceIndex = -1,\r\n level = 0,\r\n buffer: Nullable<ArrayBufferView> = null,\r\n flushRenderer = true,\r\n noDataConversion = false,\r\n x = 0,\r\n y = 0\r\n): Promise<ArrayBufferView> {\r\n const gpuTextureWrapper = texture._hardwareTexture as WebGPUHardwareTexture;\r\n\r\n if (flushRenderer) {\r\n this.flushFramebuffer();\r\n }\r\n\r\n return this._textureHelper.readPixels(gpuTextureWrapper.underlyingResource!, x, y, width, height, gpuTextureWrapper.format, faceIndex, level, buffer, noDataConversion);\r\n};\r\n\r\nWebGPUEngine.prototype._readTexturePixelsSync = function (): ArrayBufferView {\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"_readTexturePixelsSync is unsupported in WebGPU!\";\r\n};\r\n"]}
1
+ {"version":3,"file":"engine.readTexture.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Engines/WebGPU/Extensions/engine.readTexture.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAmClD,YAAY,CAAC,SAAS,CAAC,kBAAkB,GAAG,UACxC,OAAwB,EACxB,KAAa,EACb,MAAc,EACd,SAAS,GAAG,CAAC,CAAC,EACd,KAAK,GAAG,CAAC,EACT,SAAoC,IAAI,EACxC,aAAa,GAAG,IAAI,EACpB,gBAAgB,GAAG,KAAK,EACxB,CAAC,GAAG,CAAC,EACL,CAAC,GAAG,CAAC;IAEL,MAAM,iBAAiB,GAAG,OAAO,CAAC,gBAAyC,CAAC;IAE5E,IAAI,aAAa,EAAE;QACf,IAAI,CAAC,gBAAgB,EAAE,CAAC;KAC3B;IAED,OAAO,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,iBAAiB,CAAC,kBAAmB,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAC5K,CAAC,CAAC;AAEF,YAAY,CAAC,SAAS,CAAC,sBAAsB,GAAG;IAC5C,4CAA4C;IAC5C,MAAM,kDAAkD,CAAC;AAC7D,CAAC,CAAC","sourcesContent":["import type { InternalTexture } from \"../../../Materials/Textures/internalTexture\";\r\nimport type { Nullable } from \"../../../types\";\r\nimport { WebGPUEngine } from \"../../webgpuEngine\";\r\nimport type { WebGPUHardwareTexture } from \"../webgpuHardwareTexture\";\r\n\r\ndeclare module \"../../webgpuEngine\" {\r\n export interface WebGPUEngine {\r\n /** @internal */\r\n _readTexturePixels(\r\n texture: InternalTexture,\r\n width: number,\r\n height: number,\r\n faceIndex?: number,\r\n level?: number,\r\n buffer?: Nullable<ArrayBufferView>,\r\n flushRenderer?: boolean,\r\n noDataConversion?: boolean,\r\n x?: number,\r\n y?: number\r\n ): Promise<ArrayBufferView>;\r\n\r\n /** @internal */\r\n _readTexturePixelsSync(\r\n texture: InternalTexture,\r\n width: number,\r\n height: number,\r\n faceIndex?: number,\r\n level?: number,\r\n buffer?: Nullable<ArrayBufferView>,\r\n flushRenderer?: boolean,\r\n noDataConversion?: boolean,\r\n x?: number,\r\n y?: number\r\n ): ArrayBufferView;\r\n }\r\n}\r\n\r\nWebGPUEngine.prototype._readTexturePixels = function (\r\n texture: InternalTexture,\r\n width: number,\r\n height: number,\r\n faceIndex = -1,\r\n level = 0,\r\n buffer: Nullable<ArrayBufferView> = null,\r\n flushRenderer = true,\r\n noDataConversion = false,\r\n x = 0,\r\n y = 0\r\n): Promise<ArrayBufferView> {\r\n const gpuTextureWrapper = texture._hardwareTexture as WebGPUHardwareTexture;\r\n\r\n if (flushRenderer) {\r\n this.flushFramebuffer();\r\n }\r\n\r\n return this._textureHelper.readPixels(gpuTextureWrapper.underlyingResource!, x, y, width, height, gpuTextureWrapper.format, faceIndex, level, buffer, noDataConversion);\r\n};\r\n\r\nWebGPUEngine.prototype._readTexturePixelsSync = function (): ArrayBufferView {\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"_readTexturePixelsSync is unsupported in WebGPU!\";\r\n};\r\n"]}
@@ -1 +1,38 @@
1
- export {};
1
+ import { InternalTexture } from "../../../Materials/Textures/internalTexture";
2
+ import type { RenderTargetCreationOptions, DepthTextureCreationOptions, TextureSize } from "../../../Materials/Textures/textureCreationOptions";
3
+ import type { Nullable } from "../../../types";
4
+ import type { RenderTargetWrapper } from "../../renderTargetWrapper";
5
+ declare module "../../webgpuEngine" {
6
+ interface WebGPUEngine {
7
+ /**
8
+ * Creates a new render target texture
9
+ * @param size defines the size of the texture
10
+ * @param options defines the options used to create the texture
11
+ * @returns a new render target wrapper ready to render texture
12
+ */
13
+ createRenderTargetTexture(size: TextureSize, options: boolean | RenderTargetCreationOptions): RenderTargetWrapper;
14
+ /**
15
+ * Creates a depth stencil texture.
16
+ * This is only available in WebGL 2 or with the depth texture extension available.
17
+ * @param size The size of face edge in the texture.
18
+ * @param options The options defining the texture.
19
+ * @param rtWrapper The render target wrapper for which the depth/stencil texture must be created
20
+ * @returns The texture
21
+ */
22
+ createDepthStencilTexture(size: TextureSize, options: DepthTextureCreationOptions, rtWrapper: RenderTargetWrapper): InternalTexture;
23
+ /**
24
+ * Updates the sample count of a render target texture
25
+ * @see https://doc.babylonjs.com/setup/support/webGL2#multisample-render-targets
26
+ * @param rtWrapper defines the render target wrapper to update
27
+ * @param samples defines the sample count to set
28
+ * @returns the effective sample count (could be 0 if multisample render targets are not supported)
29
+ */
30
+ updateRenderTargetTextureSampleCount(rtWrapper: Nullable<RenderTargetWrapper>, samples: number): number;
31
+ /** @internal */
32
+ _createDepthStencilTexture(size: TextureSize, options: DepthTextureCreationOptions, rtWrapper: RenderTargetWrapper): InternalTexture;
33
+ /** @internal */
34
+ _createHardwareRenderTargetWrapper(isMulti: boolean, isCube: boolean, size: TextureSize): RenderTargetWrapper;
35
+ /** @internal */
36
+ _setupDepthStencilTexture(internalTexture: InternalTexture, size: TextureSize, generateStencil: boolean, bilinearFiltering: boolean, comparisonFunction: number, samples?: number): void;
37
+ }
38
+ }