@babylonjs/core 9.10.1 → 9.12.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 (1065) hide show
  1. package/Actions/actionManager.d.ts +1 -1
  2. package/Actions/actionManager.js +8 -5
  3. package/Actions/actionManager.js.map +1 -1
  4. package/Animations/animatable.core.d.ts +1 -1
  5. package/Animations/animatable.core.js +2 -2
  6. package/Animations/animatable.core.js.map +1 -1
  7. package/Animations/animationPropertiesOverride.js +1 -1
  8. package/Animations/animationPropertiesOverride.js.map +1 -1
  9. package/Animations/animatorAvatar.d.ts +2 -2
  10. package/Animations/animatorAvatar.js +3 -3
  11. package/Animations/animatorAvatar.js.map +1 -1
  12. package/Animations/pathCursor.d.ts +1 -1
  13. package/Animations/pathCursor.js +1 -1
  14. package/Animations/pathCursor.js.map +1 -1
  15. package/Animations/runtimeAnimation.d.ts +1 -1
  16. package/Animations/runtimeAnimation.js +2 -2
  17. package/Animations/runtimeAnimation.js.map +1 -1
  18. package/Audio/analyser.js +1 -1
  19. package/Audio/analyser.js.map +1 -1
  20. package/AudioV2/abstractAudio/components/spatialAudioAttacherComponent.js +1 -1
  21. package/AudioV2/abstractAudio/components/spatialAudioAttacherComponent.js.map +1 -1
  22. package/AudioV2/abstractAudio/subNodes/audioAnalyzerSubNode.d.ts +2 -0
  23. package/AudioV2/abstractAudio/subNodes/audioAnalyzerSubNode.js.map +1 -1
  24. package/AudioV2/abstractAudio/subProperties/abstractAudioAnalyzer.d.ts +13 -3
  25. package/AudioV2/abstractAudio/subProperties/abstractAudioAnalyzer.js +16 -0
  26. package/AudioV2/abstractAudio/subProperties/abstractAudioAnalyzer.js.map +1 -1
  27. package/AudioV2/abstractAudio/subProperties/abstractSpatialAudio.d.ts +1 -1
  28. package/AudioV2/abstractAudio/subProperties/abstractSpatialAudio.js +1 -1
  29. package/AudioV2/abstractAudio/subProperties/abstractSpatialAudio.js.map +1 -1
  30. package/AudioV2/abstractAudio/subProperties/abstractSpatialAudioListener.d.ts +1 -1
  31. package/AudioV2/abstractAudio/subProperties/abstractSpatialAudioListener.js +1 -1
  32. package/AudioV2/abstractAudio/subProperties/abstractSpatialAudioListener.js.map +1 -1
  33. package/AudioV2/abstractAudio/subProperties/audioAnalyzer.d.ts +4 -0
  34. package/AudioV2/abstractAudio/subProperties/audioAnalyzer.js +22 -0
  35. package/AudioV2/abstractAudio/subProperties/audioAnalyzer.js.map +1 -1
  36. package/AudioV2/webAudio/subNodes/spatialWebAudioSubNode.d.ts +1 -1
  37. package/AudioV2/webAudio/subNodes/spatialWebAudioSubNode.js +1 -1
  38. package/AudioV2/webAudio/subNodes/spatialWebAudioSubNode.js.map +1 -1
  39. package/AudioV2/webAudio/subNodes/webAudioAnalyzerSubNode.d.ts +6 -0
  40. package/AudioV2/webAudio/subNodes/webAudioAnalyzerSubNode.js +22 -5
  41. package/AudioV2/webAudio/subNodes/webAudioAnalyzerSubNode.js.map +1 -1
  42. package/AudioV2/webAudio/subProperties/spatialWebAudioListener.js +1 -1
  43. package/AudioV2/webAudio/subProperties/spatialWebAudioListener.js.map +1 -1
  44. package/AudioV2/webAudio/webAudioStreamingSound.js +1 -1
  45. package/AudioV2/webAudio/webAudioStreamingSound.js.map +1 -1
  46. package/BakedVertexAnimation/bakedVertexAnimationManager.d.ts +1 -1
  47. package/BakedVertexAnimation/bakedVertexAnimationManager.js +1 -1
  48. package/BakedVertexAnimation/bakedVertexAnimationManager.js.map +1 -1
  49. package/BakedVertexAnimation/vertexAnimationBaker.js +1 -1
  50. package/BakedVertexAnimation/vertexAnimationBaker.js.map +1 -1
  51. package/Behaviors/Cameras/bouncingBehavior.js +1 -1
  52. package/Behaviors/Cameras/bouncingBehavior.js.map +1 -1
  53. package/Behaviors/Cameras/framingBehavior.d.ts +1 -1
  54. package/Behaviors/Cameras/framingBehavior.js +2 -2
  55. package/Behaviors/Cameras/framingBehavior.js.map +1 -1
  56. package/Behaviors/Cameras/interpolatingBehavior.d.ts +13 -1
  57. package/Behaviors/Cameras/interpolatingBehavior.js +13 -1
  58. package/Behaviors/Cameras/interpolatingBehavior.js.map +1 -1
  59. package/Behaviors/Meshes/attachToBoxBehavior.js +1 -1
  60. package/Behaviors/Meshes/attachToBoxBehavior.js.map +1 -1
  61. package/Behaviors/Meshes/baseSixDofDragBehavior.d.ts +3 -3
  62. package/Behaviors/Meshes/baseSixDofDragBehavior.js +4 -4
  63. package/Behaviors/Meshes/baseSixDofDragBehavior.js.map +1 -1
  64. package/Behaviors/Meshes/followBehavior.js +1 -1
  65. package/Behaviors/Meshes/followBehavior.js.map +1 -1
  66. package/Behaviors/Meshes/handConstraintBehavior.js +2 -2
  67. package/Behaviors/Meshes/handConstraintBehavior.js.map +1 -1
  68. package/Behaviors/Meshes/multiPointerScaleBehavior.js +1 -1
  69. package/Behaviors/Meshes/multiPointerScaleBehavior.js.map +1 -1
  70. package/Behaviors/Meshes/pointerDragBehavior.d.ts +3 -3
  71. package/Behaviors/Meshes/pointerDragBehavior.js +5 -5
  72. package/Behaviors/Meshes/pointerDragBehavior.js.map +1 -1
  73. package/Behaviors/Meshes/sixDofDragBehavior.d.ts +1 -1
  74. package/Behaviors/Meshes/sixDofDragBehavior.js +2 -2
  75. package/Behaviors/Meshes/sixDofDragBehavior.js.map +1 -1
  76. package/Behaviors/Meshes/surfaceMagnetismBehavior.js +1 -1
  77. package/Behaviors/Meshes/surfaceMagnetismBehavior.js.map +1 -1
  78. package/Bones/boneIKController.d.ts +1 -1
  79. package/Bones/boneIKController.js +1 -1
  80. package/Bones/boneIKController.js.map +1 -1
  81. package/Bones/boneLookController.d.ts +1 -1
  82. package/Bones/boneLookController.js +1 -1
  83. package/Bones/boneLookController.js.map +1 -1
  84. package/Bones/skeleton.d.ts +2 -2
  85. package/Bones/skeleton.functions.d.ts +1 -1
  86. package/Bones/skeleton.functions.js +3 -3
  87. package/Bones/skeleton.functions.js.map +1 -1
  88. package/Bones/skeleton.js +3 -4
  89. package/Bones/skeleton.js.map +1 -1
  90. package/Buffers/buffer.align.pure.js +6 -0
  91. package/Buffers/buffer.align.pure.js.map +1 -1
  92. package/Buffers/buffer.nonFloatVertexBuffers.js +2 -1
  93. package/Buffers/buffer.nonFloatVertexBuffers.js.map +1 -1
  94. package/Buffers/buffer.pure.d.ts +8 -0
  95. package/Buffers/buffer.pure.js +31 -2
  96. package/Buffers/buffer.pure.js.map +1 -1
  97. package/Buffers/bufferUtils.js +17 -5
  98. package/Buffers/bufferUtils.js.map +1 -1
  99. package/Cameras/Inputs/BaseCameraMouseWheelInput.js +1 -1
  100. package/Cameras/Inputs/BaseCameraMouseWheelInput.js.map +1 -1
  101. package/Cameras/Inputs/BaseCameraPointersInput.js +1 -1
  102. package/Cameras/Inputs/BaseCameraPointersInput.js.map +1 -1
  103. package/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.js +1 -1
  104. package/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.js.map +1 -1
  105. package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js +2 -2
  106. package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js.map +1 -1
  107. package/Cameras/Inputs/flyCameraKeyboardInput.js +2 -2
  108. package/Cameras/Inputs/flyCameraKeyboardInput.js.map +1 -1
  109. package/Cameras/Inputs/flyCameraMouseInput.js +2 -2
  110. package/Cameras/Inputs/flyCameraMouseInput.js.map +1 -1
  111. package/Cameras/Inputs/followCameraKeyboardMoveInput.js +1 -1
  112. package/Cameras/Inputs/followCameraKeyboardMoveInput.js.map +1 -1
  113. package/Cameras/Inputs/followCameraMouseWheelInput.js +1 -1
  114. package/Cameras/Inputs/followCameraMouseWheelInput.js.map +1 -1
  115. package/Cameras/Inputs/freeCameraGamepadInput.js +1 -1
  116. package/Cameras/Inputs/freeCameraGamepadInput.js.map +1 -1
  117. package/Cameras/Inputs/freeCameraKeyboardMoveInput.js +2 -2
  118. package/Cameras/Inputs/freeCameraKeyboardMoveInput.js.map +1 -1
  119. package/Cameras/Inputs/freeCameraMouseInput.js +1 -1
  120. package/Cameras/Inputs/freeCameraMouseInput.js.map +1 -1
  121. package/Cameras/Inputs/freeCameraMouseWheelInput.js +1 -1
  122. package/Cameras/Inputs/freeCameraMouseWheelInput.js.map +1 -1
  123. package/Cameras/Inputs/freeCameraTouchInput.js +2 -2
  124. package/Cameras/Inputs/freeCameraTouchInput.js.map +1 -1
  125. package/Cameras/Inputs/geospatialCameraKeyboardInput.js +1 -1
  126. package/Cameras/Inputs/geospatialCameraKeyboardInput.js.map +1 -1
  127. package/Cameras/Limits/geospatialLimits.d.ts +1 -1
  128. package/Cameras/Limits/geospatialLimits.js +1 -1
  129. package/Cameras/Limits/geospatialLimits.js.map +1 -1
  130. package/Cameras/RigModes/stereoscopicAnaglyphRigMode.js +2 -2
  131. package/Cameras/RigModes/stereoscopicAnaglyphRigMode.js.map +1 -1
  132. package/Cameras/RigModes/stereoscopicRigMode.d.ts +1 -1
  133. package/Cameras/RigModes/stereoscopicRigMode.js +3 -3
  134. package/Cameras/RigModes/stereoscopicRigMode.js.map +1 -1
  135. package/Cameras/RigModes/vrRigMode.js +2 -2
  136. package/Cameras/RigModes/vrRigMode.js.map +1 -1
  137. package/Cameras/Stereoscopic/stereoscopicScreenUniversalCamera.d.ts +3 -3
  138. package/Cameras/Stereoscopic/stereoscopicScreenUniversalCamera.js +5 -5
  139. package/Cameras/Stereoscopic/stereoscopicScreenUniversalCamera.js.map +1 -1
  140. package/Cameras/VR/vrCameraMetrics.d.ts +1 -1
  141. package/Cameras/VR/vrCameraMetrics.js +1 -1
  142. package/Cameras/VR/vrCameraMetrics.js.map +1 -1
  143. package/Cameras/cameraInputsManager.d.ts +1 -1
  144. package/Cameras/cameraInputsManager.js +1 -1
  145. package/Cameras/cameraInputsManager.js.map +1 -1
  146. package/Collisions/collider.d.ts +1 -1
  147. package/Collisions/collider.js +1 -1
  148. package/Collisions/collider.js.map +1 -1
  149. package/Collisions/gpuPicker.d.ts +1 -1
  150. package/Collisions/gpuPicker.js +5 -5
  151. package/Collisions/gpuPicker.js.map +1 -1
  152. package/Collisions/meshCollisionData.d.ts +1 -1
  153. package/Collisions/meshCollisionData.js +1 -1
  154. package/Collisions/meshCollisionData.js.map +1 -1
  155. package/Collisions/pickingInfo.d.ts +1 -1
  156. package/Collisions/pickingInfo.js +2 -2
  157. package/Collisions/pickingInfo.js.map +1 -1
  158. package/Compute/computeEffect.d.ts +6 -0
  159. package/Compute/computeEffect.js +3 -0
  160. package/Compute/computeEffect.js.map +1 -1
  161. package/Compute/computeShader.pure.d.ts +4 -0
  162. package/Compute/computeShader.pure.js +1 -0
  163. package/Compute/computeShader.pure.js.map +1 -1
  164. package/Culling/Octrees/octreeBlock.d.ts +1 -1
  165. package/Culling/Octrees/octreeBlock.js +1 -1
  166. package/Culling/Octrees/octreeBlock.js.map +1 -1
  167. package/Culling/boundingBox.d.ts +1 -1
  168. package/Culling/boundingBox.js +1 -1
  169. package/Culling/boundingBox.js.map +1 -1
  170. package/Culling/boundingInfo.d.ts +1 -1
  171. package/Culling/boundingInfo.js +1 -1
  172. package/Culling/boundingInfo.js.map +1 -1
  173. package/Culling/boundingSphere.d.ts +1 -1
  174. package/Culling/boundingSphere.js +1 -1
  175. package/Culling/boundingSphere.js.map +1 -1
  176. package/Culling/ray.core.d.ts +1 -1
  177. package/Culling/ray.core.js +1 -1
  178. package/Culling/ray.core.js.map +1 -1
  179. package/Debug/axesViewer.d.ts +1 -1
  180. package/Debug/axesViewer.js +3 -3
  181. package/Debug/axesViewer.js.map +1 -1
  182. package/Debug/boneAxesViewer.d.ts +1 -1
  183. package/Debug/boneAxesViewer.js +1 -1
  184. package/Debug/boneAxesViewer.js.map +1 -1
  185. package/Debug/directionalLightFrustumViewer.d.ts +1 -1
  186. package/Debug/directionalLightFrustumViewer.js +6 -6
  187. package/Debug/directionalLightFrustumViewer.js.map +1 -1
  188. package/Debug/rayHelper.d.ts +1 -1
  189. package/Debug/rayHelper.js +2 -2
  190. package/Debug/rayHelper.js.map +1 -1
  191. package/Debug/skeletonViewer.d.ts +2 -2
  192. package/Debug/skeletonViewer.js +10 -10
  193. package/Debug/skeletonViewer.js.map +1 -1
  194. package/DeviceInput/internalDeviceSourceManager.d.ts +1 -1
  195. package/DeviceInput/internalDeviceSourceManager.js +0 -1
  196. package/DeviceInput/internalDeviceSourceManager.js.map +1 -1
  197. package/DeviceInput/webDeviceInputSystem.js +1 -1
  198. package/DeviceInput/webDeviceInputSystem.js.map +1 -1
  199. package/Engines/Extensions/engine.views.d.ts +1 -1
  200. package/Engines/Extensions/engine.views.js +1 -1
  201. package/Engines/Extensions/engine.views.js.map +1 -1
  202. package/Engines/Native/nativeHelpers.js +4 -1
  203. package/Engines/Native/nativeHelpers.js.map +1 -1
  204. package/Engines/Native/nativeInterfaces.d.ts +10 -1
  205. package/Engines/Native/nativeInterfaces.js.map +1 -1
  206. package/Engines/WebGPU/Extensions/engine.computeShader.pure.js +154 -2
  207. package/Engines/WebGPU/Extensions/engine.computeShader.pure.js.map +1 -1
  208. package/Engines/WebGPU/webgpuCacheRenderPipeline.d.ts +1 -1
  209. package/Engines/WebGPU/webgpuCacheRenderPipeline.js +11 -1
  210. package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
  211. package/Engines/WebGPU/webgpuComputeContext.d.ts +1 -1
  212. package/Engines/WebGPU/webgpuComputeContext.js.map +1 -1
  213. package/Engines/WebGPU/webgpuTintWASM.js +1 -1
  214. package/Engines/WebGPU/webgpuTintWASM.js.map +1 -1
  215. package/Engines/abstractEngine.pure.d.ts +7 -1
  216. package/Engines/abstractEngine.pure.js +34 -4
  217. package/Engines/abstractEngine.pure.js.map +1 -1
  218. package/Engines/constants.d.ts +4 -0
  219. package/Engines/constants.js +4 -0
  220. package/Engines/constants.js.map +1 -1
  221. package/Engines/engine.pure.d.ts +0 -7
  222. package/Engines/engine.pure.js +0 -34
  223. package/Engines/engine.pure.js.map +1 -1
  224. package/Engines/engineFactory.d.ts +2 -2
  225. package/Engines/engineFactory.js +3 -3
  226. package/Engines/engineFactory.js.map +1 -1
  227. package/Engines/thinNativeEngine.pure.js +15 -8
  228. package/Engines/thinNativeEngine.pure.js.map +1 -1
  229. package/Events/pointerEvents.d.ts +1 -1
  230. package/Events/pointerEvents.js +1 -1
  231. package/Events/pointerEvents.js.map +1 -1
  232. package/FlowGraph/Blocks/Data/Utils/flowGraphCodeExecutionBlock.js +1 -1
  233. package/FlowGraph/Blocks/Data/Utils/flowGraphCodeExecutionBlock.js.map +1 -1
  234. package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.d.ts +1 -1
  235. package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js +1 -1
  236. package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js.map +1 -1
  237. package/FlowGraph/Blocks/Event/flowGraphKeyboardEventBlock.js +1 -1
  238. package/FlowGraph/Blocks/Event/flowGraphKeyboardEventBlock.js.map +1 -1
  239. package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.pure.d.ts +1 -1
  240. package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.pure.js +3 -3
  241. package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.pure.js.map +1 -1
  242. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.pure.js +1 -1
  243. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.pure.js.map +1 -1
  244. package/FlowGraph/CustomTypes/flowGraphMatrix.d.ts +1 -1
  245. package/FlowGraph/CustomTypes/flowGraphMatrix.js +1 -1
  246. package/FlowGraph/CustomTypes/flowGraphMatrix.js.map +1 -1
  247. package/FlowGraph/flowGraphBlock.d.ts +1 -1
  248. package/FlowGraph/flowGraphBlock.js +1 -1
  249. package/FlowGraph/flowGraphBlock.js.map +1 -1
  250. package/FlowGraph/flowGraphExecutionBlock.d.ts +1 -1
  251. package/FlowGraph/flowGraphExecutionBlock.js +1 -1
  252. package/FlowGraph/flowGraphExecutionBlock.js.map +1 -1
  253. package/FlowGraph/flowGraphMath.d.ts +1 -1
  254. package/FlowGraph/flowGraphMath.js +1 -1
  255. package/FlowGraph/flowGraphMath.js.map +1 -1
  256. package/FlowGraph/flowGraphParser.js +1 -1
  257. package/FlowGraph/flowGraphParser.js.map +1 -1
  258. package/FlowGraph/flowGraphPathConverterComponent.d.ts +1 -1
  259. package/FlowGraph/flowGraphPathConverterComponent.js +2 -2
  260. package/FlowGraph/flowGraphPathConverterComponent.js.map +1 -1
  261. package/FlowGraph/flowGraphValidator.js.map +1 -1
  262. package/FlowGraph/serialization.js +4 -4
  263. package/FlowGraph/serialization.js.map +1 -1
  264. package/FlowGraph/utils.js.map +1 -1
  265. package/FrameGraph/Node/nodeRenderGraph.d.ts +2 -2
  266. package/FrameGraph/Node/nodeRenderGraph.js +7 -7
  267. package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
  268. package/FrameGraph/Tasks/Layers/baseLayerTask.d.ts +30 -0
  269. package/FrameGraph/Tasks/Layers/baseLayerTask.js +28 -1
  270. package/FrameGraph/Tasks/Layers/baseLayerTask.js.map +1 -1
  271. package/FrameGraph/Tasks/Misc/computeShaderTask.d.ts +2 -2
  272. package/FrameGraph/Tasks/Misc/computeShaderTask.js +2 -2
  273. package/FrameGraph/Tasks/Misc/computeShaderTask.js.map +1 -1
  274. package/FrameGraph/Tasks/Misc/lightingVolumeTask.d.ts +1 -1
  275. package/FrameGraph/Tasks/Misc/lightingVolumeTask.js +2 -2
  276. package/FrameGraph/Tasks/Misc/lightingVolumeTask.js.map +1 -1
  277. package/FrameGraph/Tasks/PostProcesses/blurTask.d.ts +7 -0
  278. package/FrameGraph/Tasks/PostProcesses/blurTask.js +8 -1
  279. package/FrameGraph/Tasks/PostProcesses/blurTask.js.map +1 -1
  280. package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js +1 -1
  281. package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js.map +1 -1
  282. package/FrameGraph/Tasks/PostProcesses/ssrBlurTask.js +1 -1
  283. package/FrameGraph/Tasks/PostProcesses/ssrBlurTask.js.map +1 -1
  284. package/FrameGraph/Tasks/PostProcesses/volumetricLightingBlendVolumeTask.d.ts +1 -1
  285. package/FrameGraph/Tasks/PostProcesses/volumetricLightingBlendVolumeTask.js +1 -1
  286. package/FrameGraph/Tasks/PostProcesses/volumetricLightingBlendVolumeTask.js.map +1 -1
  287. package/FrameGraph/Tasks/PostProcesses/volumetricLightingTask.d.ts +2 -2
  288. package/FrameGraph/Tasks/PostProcesses/volumetricLightingTask.js +3 -3
  289. package/FrameGraph/Tasks/PostProcesses/volumetricLightingTask.js.map +1 -1
  290. package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.d.ts +1 -1
  291. package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.js +2 -2
  292. package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.js.map +1 -1
  293. package/FrameGraph/Tasks/Rendering/geometryRendererTask.d.ts +6 -0
  294. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +14 -5
  295. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
  296. package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsAccumulationTask.d.ts +1 -1
  297. package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsAccumulationTask.js +1 -1
  298. package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsAccumulationTask.js.map +1 -1
  299. package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsSpatialBlurTask.d.ts +1 -1
  300. package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsSpatialBlurTask.js +1 -1
  301. package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsSpatialBlurTask.js.map +1 -1
  302. package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsTracingTask.d.ts +1 -1
  303. package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsTracingTask.js +2 -2
  304. package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsTracingTask.js.map +1 -1
  305. package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsVoxelizationTask.d.ts +1 -1
  306. package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsVoxelizationTask.js +2 -2
  307. package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsVoxelizationTask.js.map +1 -1
  308. package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +7 -1
  309. package/FrameGraph/Tasks/Rendering/objectRendererTask.js +7 -1
  310. package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
  311. package/FrameGraph/Tasks/Texture/clearTextureTask.d.ts +1 -1
  312. package/FrameGraph/Tasks/Texture/clearTextureTask.js +1 -1
  313. package/FrameGraph/Tasks/Texture/clearTextureTask.js.map +1 -1
  314. package/FrameGraph/frameGraphRenderContext.js +1 -1
  315. package/FrameGraph/frameGraphRenderContext.js.map +1 -1
  316. package/FrameGraph/frameGraphTextureManager.d.ts +1 -1
  317. package/FrameGraph/frameGraphTextureManager.js +1 -1
  318. package/FrameGraph/frameGraphTextureManager.js.map +1 -1
  319. package/Gamepads/gamepadManager.js +1 -1
  320. package/Gamepads/gamepadManager.js.map +1 -1
  321. package/Gizmos/axisDragGizmo.d.ts +5 -5
  322. package/Gizmos/axisDragGizmo.js +6 -6
  323. package/Gizmos/axisDragGizmo.js.map +1 -1
  324. package/Gizmos/axisScaleGizmo.d.ts +4 -4
  325. package/Gizmos/axisScaleGizmo.js +6 -6
  326. package/Gizmos/axisScaleGizmo.js.map +1 -1
  327. package/Gizmos/boundingBoxGizmo.d.ts +5 -5
  328. package/Gizmos/boundingBoxGizmo.js +7 -7
  329. package/Gizmos/boundingBoxGizmo.js.map +1 -1
  330. package/Gizmos/cameraGizmo.d.ts +3 -3
  331. package/Gizmos/cameraGizmo.js +7 -7
  332. package/Gizmos/cameraGizmo.js.map +1 -1
  333. package/Gizmos/gizmo.d.ts +2 -2
  334. package/Gizmos/gizmo.js +3 -3
  335. package/Gizmos/gizmo.js.map +1 -1
  336. package/Gizmos/gizmoManager.d.ts +2 -2
  337. package/Gizmos/gizmoManager.js +2 -2
  338. package/Gizmos/gizmoManager.js.map +1 -1
  339. package/Gizmos/lightGizmo.d.ts +4 -4
  340. package/Gizmos/lightGizmo.js +11 -11
  341. package/Gizmos/lightGizmo.js.map +1 -1
  342. package/Gizmos/planeDragGizmo.d.ts +4 -4
  343. package/Gizmos/planeDragGizmo.js +5 -5
  344. package/Gizmos/planeDragGizmo.js.map +1 -1
  345. package/Gizmos/positionGizmo.d.ts +1 -1
  346. package/Gizmos/positionGizmo.js +2 -2
  347. package/Gizmos/positionGizmo.js.map +1 -1
  348. package/Gizmos/rotationGizmo.d.ts +3 -3
  349. package/Gizmos/rotationGizmo.js +3 -3
  350. package/Gizmos/rotationGizmo.js.map +1 -1
  351. package/Gizmos/scaleGizmo.d.ts +2 -2
  352. package/Gizmos/scaleGizmo.js +4 -4
  353. package/Gizmos/scaleGizmo.js.map +1 -1
  354. package/Gizmos/spatialAudioGizmo.d.ts +2 -2
  355. package/Gizmos/spatialAudioGizmo.js +6 -6
  356. package/Gizmos/spatialAudioGizmo.js.map +1 -1
  357. package/Helpers/environmentHelper.d.ts +6 -6
  358. package/Helpers/environmentHelper.js +12 -12
  359. package/Helpers/environmentHelper.js.map +1 -1
  360. package/Helpers/materialConversionHelper.d.ts +1 -1
  361. package/Helpers/materialConversionHelper.js +1 -1
  362. package/Helpers/materialConversionHelper.js.map +1 -1
  363. package/Helpers/photoDome.d.ts +1 -1
  364. package/Helpers/photoDome.js +1 -1
  365. package/Helpers/photoDome.js.map +1 -1
  366. package/Helpers/textureDome.d.ts +4 -4
  367. package/Helpers/textureDome.js +6 -6
  368. package/Helpers/textureDome.js.map +1 -1
  369. package/Helpers/videoDome.d.ts +1 -1
  370. package/Helpers/videoDome.js +2 -2
  371. package/Helpers/videoDome.js.map +1 -1
  372. package/Inputs/scene.inputManager.d.ts +1 -1
  373. package/Inputs/scene.inputManager.js +1 -1
  374. package/Inputs/scene.inputManager.js.map +1 -1
  375. package/Instrumentation/sceneInstrumentation.js +1 -1
  376. package/Instrumentation/sceneInstrumentation.js.map +1 -1
  377. package/Layers/effectLayer.d.ts +1 -1
  378. package/Layers/effectLayer.js +3 -3
  379. package/Layers/effectLayer.js.map +1 -1
  380. package/Layers/layer.d.ts +2 -2
  381. package/Layers/layer.js +4 -4
  382. package/Layers/layer.js.map +1 -1
  383. package/Layers/thinEffectLayer.d.ts +2 -2
  384. package/Layers/thinEffectLayer.js +3 -3
  385. package/Layers/thinEffectLayer.js.map +1 -1
  386. package/Layers/thinGlowLayer.d.ts +1 -1
  387. package/Layers/thinGlowLayer.js +3 -3
  388. package/Layers/thinGlowLayer.js.map +1 -1
  389. package/Layers/thinHighlightLayer.d.ts +1 -1
  390. package/Layers/thinHighlightLayer.js +3 -3
  391. package/Layers/thinHighlightLayer.js.map +1 -1
  392. package/Layers/thinSelectionOutlineLayer.d.ts +1 -1
  393. package/Layers/thinSelectionOutlineLayer.js +3 -3
  394. package/Layers/thinSelectionOutlineLayer.js.map +1 -1
  395. package/Legacy/legacy.js +12 -1
  396. package/Legacy/legacy.js.map +1 -1
  397. package/LensFlares/lensFlare.d.ts +2 -2
  398. package/LensFlares/lensFlare.js +3 -3
  399. package/LensFlares/lensFlare.js.map +1 -1
  400. package/LensFlares/lensFlareSystem.d.ts +1 -1
  401. package/LensFlares/lensFlareSystem.js +6 -6
  402. package/LensFlares/lensFlareSystem.js.map +1 -1
  403. package/Lights/LTC/ltcTextureTool.js +1 -1
  404. package/Lights/LTC/ltcTextureTool.js.map +1 -1
  405. package/Lights/Shadows/cascadedShadowGenerator.d.ts +1 -285
  406. package/Lights/Shadows/cascadedShadowGenerator.js +3 -857
  407. package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
  408. package/Lights/Shadows/cascadedShadowGenerator.pure.d.ts +290 -0
  409. package/Lights/Shadows/cascadedShadowGenerator.pure.js +868 -0
  410. package/Lights/Shadows/cascadedShadowGenerator.pure.js.map +1 -0
  411. package/Lights/Shadows/pure.d.ts +1 -0
  412. package/Lights/Shadows/pure.js +1 -0
  413. package/Lights/Shadows/pure.js.map +1 -1
  414. package/Lights/Shadows/shadowGenerator.d.ts +3 -3
  415. package/Lights/Shadows/shadowGenerator.js +7 -7
  416. package/Lights/Shadows/shadowGenerator.js.map +1 -1
  417. package/Lights/areaLight.d.ts +1 -1
  418. package/Lights/areaLight.js +0 -1
  419. package/Lights/areaLight.js.map +1 -1
  420. package/Lights/light.d.ts +2 -2
  421. package/Lights/light.js +2 -2
  422. package/Lights/light.js.map +1 -1
  423. package/Lights/shadowLight.d.ts +1 -1
  424. package/Lights/shadowLight.js +1 -1
  425. package/Lights/shadowLight.js.map +1 -1
  426. package/Loading/sceneLoader.d.ts +2 -2
  427. package/Loading/sceneLoader.js +3 -3
  428. package/Loading/sceneLoader.js.map +1 -1
  429. package/Materials/GreasedLine/greasedLineMaterialDefaults.d.ts +1 -1
  430. package/Materials/GreasedLine/greasedLineMaterialDefaults.js +1 -1
  431. package/Materials/GreasedLine/greasedLineMaterialDefaults.js.map +1 -1
  432. package/Materials/GreasedLine/greasedLineSimpleMaterial.d.ts +3 -3
  433. package/Materials/GreasedLine/greasedLineSimpleMaterial.js +3 -3
  434. package/Materials/GreasedLine/greasedLineSimpleMaterial.js.map +1 -1
  435. package/Materials/Node/Blocks/Fragment/prePassOutputBlock.pure.js +6 -6
  436. package/Materials/Node/Blocks/Fragment/prePassOutputBlock.pure.js.map +1 -1
  437. package/Materials/Node/nodeMaterial.pure.d.ts +12 -0
  438. package/Materials/Node/nodeMaterial.pure.js +68 -13
  439. package/Materials/Node/nodeMaterial.pure.js.map +1 -1
  440. package/Materials/Node/nodeMaterialDefault.js +14 -14
  441. package/Materials/Node/nodeMaterialDefault.js.map +1 -1
  442. package/Materials/PBR/openpbrMaterial.pure.js +19 -4
  443. package/Materials/PBR/openpbrMaterial.pure.js.map +1 -1
  444. package/Materials/PBR/pbrAnisotropicConfiguration.d.ts +40 -2
  445. package/Materials/PBR/pbrAnisotropicConfiguration.js +41 -3
  446. package/Materials/PBR/pbrAnisotropicConfiguration.js.map +1 -1
  447. package/Materials/PBR/pbrBRDFConfiguration.d.ts +5 -1
  448. package/Materials/PBR/pbrBRDFConfiguration.js +5 -1
  449. package/Materials/PBR/pbrBRDFConfiguration.js.map +1 -1
  450. package/Materials/PBR/pbrBaseSimpleMaterial.d.ts +2 -2
  451. package/Materials/PBR/pbrBaseSimpleMaterial.js +2 -2
  452. package/Materials/PBR/pbrBaseSimpleMaterial.js.map +1 -1
  453. package/Materials/PBR/pbrClearCoatConfiguration.d.ts +42 -2
  454. package/Materials/PBR/pbrClearCoatConfiguration.js +42 -2
  455. package/Materials/PBR/pbrClearCoatConfiguration.js.map +1 -1
  456. package/Materials/PBR/pbrIridescenceConfiguration.d.ts +38 -1
  457. package/Materials/PBR/pbrIridescenceConfiguration.js +38 -1
  458. package/Materials/PBR/pbrIridescenceConfiguration.js.map +1 -1
  459. package/Materials/PBR/pbrMaterial.pure.d.ts +6 -0
  460. package/Materials/PBR/pbrMaterial.pure.js +8 -0
  461. package/Materials/PBR/pbrMaterial.pure.js.map +1 -1
  462. package/Materials/PBR/pbrSheenConfiguration.d.ts +41 -2
  463. package/Materials/PBR/pbrSheenConfiguration.js +41 -2
  464. package/Materials/PBR/pbrSheenConfiguration.js.map +1 -1
  465. package/Materials/PBR/pbrSubSurfaceConfiguration.d.ts +41 -2
  466. package/Materials/PBR/pbrSubSurfaceConfiguration.js +42 -3
  467. package/Materials/PBR/pbrSubSurfaceConfiguration.js.map +1 -1
  468. package/Materials/Textures/Filtering/hdrFiltering.js +1 -1
  469. package/Materials/Textures/Filtering/hdrFiltering.js.map +1 -1
  470. package/Materials/Textures/Filtering/hdrIrradianceFiltering.d.ts +1 -1
  471. package/Materials/Textures/Filtering/hdrIrradianceFiltering.js +2 -2
  472. package/Materials/Textures/Filtering/hdrIrradianceFiltering.js.map +1 -1
  473. package/Materials/Textures/Loaders/EXR/exrLoader.core.d.ts +1 -1
  474. package/Materials/Textures/Loaders/EXR/exrLoader.core.js +5 -109
  475. package/Materials/Textures/Loaders/EXR/exrLoader.core.js.map +1 -1
  476. package/Materials/Textures/Loaders/EXR/exrLoader.decoder.js +1 -1
  477. package/Materials/Textures/Loaders/EXR/exrLoader.decoder.js.map +1 -1
  478. package/Materials/Textures/Loaders/basisTextureLoader.js +2 -2
  479. package/Materials/Textures/Loaders/basisTextureLoader.js.map +1 -1
  480. package/Materials/Textures/Loaders/ddsTextureLoader.js +1 -1
  481. package/Materials/Textures/Loaders/ddsTextureLoader.js.map +1 -1
  482. package/Materials/Textures/Loaders/envTextureLoader.js +3 -1
  483. package/Materials/Textures/Loaders/envTextureLoader.js.map +1 -1
  484. package/Materials/Textures/Loaders/ktxTextureLoader.js +11 -2
  485. package/Materials/Textures/Loaders/ktxTextureLoader.js.map +1 -1
  486. package/Materials/Textures/MultiviewRenderTarget.d.ts +1 -1
  487. package/Materials/Textures/MultiviewRenderTarget.js +1 -1
  488. package/Materials/Textures/MultiviewRenderTarget.js.map +1 -1
  489. package/Materials/Textures/Packer/packer.d.ts +1 -1
  490. package/Materials/Textures/Packer/packer.js +6 -6
  491. package/Materials/Textures/Packer/packer.js.map +1 -1
  492. package/Materials/Textures/Procedurals/customProceduralTexture.d.ts +2 -2
  493. package/Materials/Textures/Procedurals/customProceduralTexture.js +4 -4
  494. package/Materials/Textures/Procedurals/customProceduralTexture.js.map +1 -1
  495. package/Materials/Textures/Procedurals/noiseProceduralTexture.pure.js +17 -5
  496. package/Materials/Textures/Procedurals/noiseProceduralTexture.pure.js.map +1 -1
  497. package/Materials/Textures/Procedurals/proceduralTexture.pure.js +4 -1
  498. package/Materials/Textures/Procedurals/proceduralTexture.pure.js.map +1 -1
  499. package/Materials/Textures/Procedurals/proceduralTextureSceneComponent.js +1 -1
  500. package/Materials/Textures/Procedurals/proceduralTextureSceneComponent.js.map +1 -1
  501. package/Materials/Textures/prePassRenderTarget.d.ts +1 -1
  502. package/Materials/Textures/prePassRenderTarget.js +1 -1
  503. package/Materials/Textures/prePassRenderTarget.js.map +1 -1
  504. package/Materials/Textures/rawCubeTexture.d.ts +1 -1
  505. package/Materials/Textures/rawCubeTexture.js +2 -2
  506. package/Materials/Textures/rawCubeTexture.js.map +1 -1
  507. package/Materials/Textures/rawTexture.d.ts +1 -1
  508. package/Materials/Textures/rawTexture.js +1 -1
  509. package/Materials/Textures/rawTexture.js.map +1 -1
  510. package/Materials/Textures/rawTexture2DArray.d.ts +1 -1
  511. package/Materials/Textures/rawTexture2DArray.js +1 -1
  512. package/Materials/Textures/rawTexture2DArray.js.map +1 -1
  513. package/Materials/Textures/rawTexture3D.d.ts +1 -1
  514. package/Materials/Textures/rawTexture3D.js +1 -1
  515. package/Materials/Textures/rawTexture3D.js.map +1 -1
  516. package/Materials/Textures/refractionTexture.d.ts +1 -1
  517. package/Materials/Textures/refractionTexture.js +1 -1
  518. package/Materials/Textures/refractionTexture.js.map +1 -1
  519. package/Materials/Textures/textureMerger.d.ts +1 -1
  520. package/Materials/Textures/textureMerger.js +1 -1
  521. package/Materials/Textures/textureMerger.js.map +1 -1
  522. package/Materials/Textures/textureProcessor.d.ts +1 -1
  523. package/Materials/Textures/textureProcessor.js +2 -2
  524. package/Materials/Textures/textureProcessor.js.map +1 -1
  525. package/Materials/Textures/thinRenderTargetTexture.d.ts +4 -4
  526. package/Materials/Textures/thinRenderTargetTexture.js +2 -2
  527. package/Materials/Textures/thinRenderTargetTexture.js.map +1 -1
  528. package/Materials/clipPlaneMaterialHelper.js +1 -1
  529. package/Materials/clipPlaneMaterialHelper.js.map +1 -1
  530. package/Materials/effect.pure.d.ts +2 -2
  531. package/Materials/effect.pure.js +12 -6
  532. package/Materials/effect.pure.js.map +1 -1
  533. package/Materials/effectRenderer.pure.js +4 -2
  534. package/Materials/effectRenderer.pure.js.map +1 -1
  535. package/Materials/floatingOriginMatrixOverrides.d.ts +1 -1
  536. package/Materials/floatingOriginMatrixOverrides.js +1 -1
  537. package/Materials/floatingOriginMatrixOverrides.js.map +1 -1
  538. package/Materials/material.detailMapConfiguration.d.ts +39 -1
  539. package/Materials/material.detailMapConfiguration.js +39 -1
  540. package/Materials/material.detailMapConfiguration.js.map +1 -1
  541. package/Materials/materialHelper.functions.js +45 -1
  542. package/Materials/materialHelper.functions.js.map +1 -1
  543. package/Materials/materialHelper.geometryrendering.d.ts +1 -1
  544. package/Materials/materialHelper.geometryrendering.js +1 -1
  545. package/Materials/materialHelper.geometryrendering.js.map +1 -1
  546. package/Materials/materialPluginFactoryExport.js +2 -2
  547. package/Materials/materialPluginFactoryExport.js.map +1 -1
  548. package/Materials/meshDebugPluginMaterial.pure.js +15 -13
  549. package/Materials/meshDebugPluginMaterial.pure.js.map +1 -1
  550. package/Materials/pushMaterial.d.ts +7 -1
  551. package/Materials/pushMaterial.js +7 -1
  552. package/Materials/pushMaterial.js.map +1 -1
  553. package/Materials/uniformBuffer.js +1 -1
  554. package/Materials/uniformBuffer.js.map +1 -1
  555. package/Maths/math.axis.d.ts +1 -1
  556. package/Maths/math.axis.js +1 -1
  557. package/Maths/math.axis.js.map +1 -1
  558. package/Maths/math.d.ts +2 -2
  559. package/Maths/math.functions.d.ts +1 -1
  560. package/Maths/math.functions.js +1 -1
  561. package/Maths/math.functions.js.map +1 -1
  562. package/Maths/math.isovector.d.ts +1 -1
  563. package/Maths/math.isovector.js +1 -1
  564. package/Maths/math.isovector.js.map +1 -1
  565. package/Maths/math.js +2 -2
  566. package/Maths/math.js.map +1 -1
  567. package/Maths/math.path.d.ts +1 -1
  568. package/Maths/math.path.js +1 -1
  569. package/Maths/math.path.js.map +1 -1
  570. package/Maths/math.plane.d.ts +1 -1
  571. package/Maths/math.plane.js +1 -1
  572. package/Maths/math.plane.js.map +1 -1
  573. package/Maths/math.polar.d.ts +1 -1
  574. package/Maths/math.polar.js +1 -1
  575. package/Maths/math.polar.js.map +1 -1
  576. package/Maths/math.vertexFormat.d.ts +1 -1
  577. package/Maths/math.vertexFormat.js +1 -1
  578. package/Maths/math.vertexFormat.js.map +1 -1
  579. package/Maths/pure.d.ts +1 -0
  580. package/Maths/pure.js +1 -0
  581. package/Maths/pure.js.map +1 -1
  582. package/Meshes/Builders/geodesicBuilder.js +1 -1
  583. package/Meshes/Builders/geodesicBuilder.js.map +1 -1
  584. package/Meshes/Builders/goldbergBuilder.d.ts +1 -1
  585. package/Meshes/Builders/goldbergBuilder.js +4 -4
  586. package/Meshes/Builders/goldbergBuilder.js.map +1 -1
  587. package/Meshes/Builders/greasedLineBuilder.d.ts +4 -4
  588. package/Meshes/Builders/greasedLineBuilder.js +5 -5
  589. package/Meshes/Builders/greasedLineBuilder.js.map +1 -1
  590. package/Meshes/Builders/textBuilder.d.ts +2 -2
  591. package/Meshes/Builders/textBuilder.js +4 -4
  592. package/Meshes/Builders/textBuilder.js.map +1 -1
  593. package/Meshes/Builders/tiledBoxBuilder.d.ts +3 -3
  594. package/Meshes/Builders/tiledBoxBuilder.js +3 -3
  595. package/Meshes/Builders/tiledBoxBuilder.js.map +1 -1
  596. package/Meshes/Builders/tiledPlaneBuilder.d.ts +1 -1
  597. package/Meshes/Builders/tiledPlaneBuilder.js +1 -1
  598. package/Meshes/Builders/tiledPlaneBuilder.js.map +1 -1
  599. package/Meshes/Compression/dracoCodec.js +1 -1
  600. package/Meshes/Compression/dracoCodec.js.map +1 -1
  601. package/Meshes/Compression/dracoDecoder.js +1 -1
  602. package/Meshes/Compression/dracoDecoder.js.map +1 -1
  603. package/Meshes/Compression/dracoEncoder.d.ts +1 -1
  604. package/Meshes/Compression/dracoEncoder.js +2 -2
  605. package/Meshes/Compression/dracoEncoder.js.map +1 -1
  606. package/Meshes/Compression/meshoptCompression.js +1 -1
  607. package/Meshes/Compression/meshoptCompression.js.map +1 -1
  608. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +64 -3
  609. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
  610. package/Meshes/GreasedLine/greasedLineBaseMesh.d.ts +2 -2
  611. package/Meshes/GreasedLine/greasedLineBaseMesh.js +3 -3
  612. package/Meshes/GreasedLine/greasedLineBaseMesh.js.map +1 -1
  613. package/Meshes/Node/nodeGeometry.d.ts +2 -2
  614. package/Meshes/Node/nodeGeometry.js +4 -4
  615. package/Meshes/Node/nodeGeometry.js.map +1 -1
  616. package/Meshes/Node/nodeGeometryBuildState.d.ts +1 -1
  617. package/Meshes/Node/nodeGeometryBuildState.js +1 -1
  618. package/Meshes/Node/nodeGeometryBuildState.js.map +1 -1
  619. package/Meshes/abstractMesh.hotSpot.d.ts +1 -1
  620. package/Meshes/abstractMesh.hotSpot.js +2 -2
  621. package/Meshes/abstractMesh.hotSpot.js.map +1 -1
  622. package/Meshes/abstractMesh.pure.js +2 -13
  623. package/Meshes/abstractMesh.pure.js.map +1 -1
  624. package/Meshes/buffer.d.ts +1 -1
  625. package/Meshes/buffer.js +1 -1
  626. package/Meshes/buffer.js.map +1 -1
  627. package/Meshes/csg.d.ts +3 -3
  628. package/Meshes/csg.js +4 -4
  629. package/Meshes/csg.js.map +1 -1
  630. package/Meshes/csg2.d.ts +1 -1
  631. package/Meshes/csg2.js +38 -11
  632. package/Meshes/csg2.js.map +1 -1
  633. package/Meshes/geodesicMesh.d.ts +1 -1
  634. package/Meshes/geodesicMesh.js +1 -1
  635. package/Meshes/geodesicMesh.js.map +1 -1
  636. package/Meshes/geometry.d.ts +2 -2
  637. package/Meshes/geometry.js +4 -4
  638. package/Meshes/geometry.js.map +1 -1
  639. package/Meshes/lattice.d.ts +1 -1
  640. package/Meshes/lattice.js +1 -1
  641. package/Meshes/lattice.js.map +1 -1
  642. package/Meshes/lattice.material.d.ts +1 -1
  643. package/Meshes/lattice.material.js +1 -1
  644. package/Meshes/lattice.material.js.map +1 -1
  645. package/Meshes/mesh.vertexData.d.ts +2 -2
  646. package/Meshes/mesh.vertexData.js +3 -4
  647. package/Meshes/mesh.vertexData.js.map +1 -1
  648. package/Meshes/mesh.vertexData.subdivide.js +1 -1
  649. package/Meshes/mesh.vertexData.subdivide.js.map +1 -1
  650. package/Meshes/meshBuilder.d.ts +18 -18
  651. package/Meshes/meshBuilder.js +18 -18
  652. package/Meshes/meshBuilder.js.map +1 -1
  653. package/Meshes/meshSimplification.d.ts +1 -1
  654. package/Meshes/meshSimplification.js +4 -4
  655. package/Meshes/meshSimplification.js.map +1 -1
  656. package/Meshes/meshUVSpaceRenderer.d.ts +1 -1
  657. package/Meshes/meshUVSpaceRenderer.js +0 -1
  658. package/Meshes/meshUVSpaceRenderer.js.map +1 -1
  659. package/Meshes/meshUtils.d.ts +1 -1
  660. package/Meshes/meshUtils.js +2 -2
  661. package/Meshes/meshUtils.js.map +1 -1
  662. package/Meshes/polygonMesh.d.ts +2 -2
  663. package/Meshes/polygonMesh.js +3 -3
  664. package/Meshes/polygonMesh.js.map +1 -1
  665. package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js +2 -2
  666. package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js.map +1 -1
  667. package/Misc/HighDynamicRange/panoramaToCubemap.js +1 -1
  668. package/Misc/HighDynamicRange/panoramaToCubemap.js.map +1 -1
  669. package/Misc/PerformanceViewer/performanceViewerCollector.js +1 -1
  670. package/Misc/PerformanceViewer/performanceViewerCollector.js.map +1 -1
  671. package/Misc/areaLightsTextureTools.d.ts +1 -1
  672. package/Misc/areaLightsTextureTools.js +3 -3
  673. package/Misc/areaLightsTextureTools.js.map +1 -1
  674. package/Misc/assetsManager.d.ts +4 -4
  675. package/Misc/assetsManager.js +5 -5
  676. package/Misc/assetsManager.js.map +1 -1
  677. package/Misc/basisWorker.js +1 -1
  678. package/Misc/basisWorker.js.map +1 -1
  679. package/Misc/brdfTextureTools.js +1 -1
  680. package/Misc/brdfTextureTools.js.map +1 -1
  681. package/Misc/copyTextureToTexture.d.ts +1 -1
  682. package/Misc/copyTextureToTexture.js +1 -1
  683. package/Misc/copyTextureToTexture.js.map +1 -1
  684. package/Misc/decorators.serialization.js +2 -2
  685. package/Misc/decorators.serialization.js.map +1 -1
  686. package/Misc/depthReducer.d.ts +2 -2
  687. package/Misc/depthReducer.js +2 -2
  688. package/Misc/depthReducer.js.map +1 -1
  689. package/Misc/gradients.d.ts +1 -1
  690. package/Misc/gradients.js +1 -1
  691. package/Misc/gradients.js.map +1 -1
  692. package/Misc/greasedLineTools.d.ts +1 -1
  693. package/Misc/greasedLineTools.js +3 -3
  694. package/Misc/greasedLineTools.js.map +1 -1
  695. package/Misc/halfFloat.d.ts +17 -0
  696. package/Misc/halfFloat.js +131 -0
  697. package/Misc/halfFloat.js.map +1 -0
  698. package/Misc/khronosTextureContainer2.js +1 -1
  699. package/Misc/khronosTextureContainer2.js.map +1 -1
  700. package/Misc/meshExploder.js +1 -1
  701. package/Misc/meshExploder.js.map +1 -1
  702. package/Misc/pivotTools.js +1 -1
  703. package/Misc/pivotTools.js.map +1 -1
  704. package/Misc/rgbdTextureTools.js +1 -1
  705. package/Misc/rgbdTextureTools.js.map +1 -1
  706. package/Misc/sceneOptimizer.js +1 -1
  707. package/Misc/sceneOptimizer.js.map +1 -1
  708. package/Misc/sceneRecorder.js +7 -7
  709. package/Misc/sceneRecorder.js.map +1 -1
  710. package/Misc/sceneSerializer.js +3 -3
  711. package/Misc/sceneSerializer.js.map +1 -1
  712. package/Misc/snapshotRenderingHelper.js +1 -1
  713. package/Misc/snapshotRenderingHelper.js.map +1 -1
  714. package/Misc/textureTools.d.ts +3 -13
  715. package/Misc/textureTools.js +6 -64
  716. package/Misc/textureTools.js.map +1 -1
  717. package/Misc/thinMinMaxReducer.d.ts +1 -1
  718. package/Misc/thinMinMaxReducer.js +1 -1
  719. package/Misc/thinMinMaxReducer.js.map +1 -1
  720. package/Misc/tools.internals.js +1 -1
  721. package/Misc/tools.internals.js.map +1 -1
  722. package/Misc/tools.pure.js +11 -4
  723. package/Misc/tools.pure.js.map +1 -1
  724. package/Misc/trajectoryClassifier.d.ts +1 -1
  725. package/Misc/trajectoryClassifier.js +1 -1
  726. package/Misc/trajectoryClassifier.js.map +1 -1
  727. package/Misc/videoRecorder.js +1 -1
  728. package/Misc/videoRecorder.js.map +1 -1
  729. package/Misc/virtualJoystick.d.ts +1 -1
  730. package/Misc/virtualJoystick.js +1 -1
  731. package/Misc/virtualJoystick.js.map +1 -1
  732. package/Morph/morphTarget.js +1 -1
  733. package/Morph/morphTarget.js.map +1 -1
  734. package/Navigation/Plugins/recastJSPlugin.d.ts +1 -1
  735. package/Navigation/Plugins/recastJSPlugin.js +2 -2
  736. package/Navigation/Plugins/recastJSPlugin.js.map +1 -1
  737. package/Particles/EmitterTypes/boxParticleEmitter.d.ts +1 -1
  738. package/Particles/EmitterTypes/boxParticleEmitter.js +1 -1
  739. package/Particles/EmitterTypes/boxParticleEmitter.js.map +1 -1
  740. package/Particles/EmitterTypes/coneParticleEmitter.d.ts +1 -1
  741. package/Particles/EmitterTypes/coneParticleEmitter.js +1 -1
  742. package/Particles/EmitterTypes/coneParticleEmitter.js.map +1 -1
  743. package/Particles/EmitterTypes/customParticleEmitter.d.ts +1 -1
  744. package/Particles/EmitterTypes/customParticleEmitter.js +1 -1
  745. package/Particles/EmitterTypes/customParticleEmitter.js.map +1 -1
  746. package/Particles/EmitterTypes/cylinderParticleEmitter.d.ts +1 -1
  747. package/Particles/EmitterTypes/cylinderParticleEmitter.js +1 -1
  748. package/Particles/EmitterTypes/cylinderParticleEmitter.js.map +1 -1
  749. package/Particles/EmitterTypes/hemisphericParticleEmitter.d.ts +1 -1
  750. package/Particles/EmitterTypes/hemisphericParticleEmitter.js +1 -1
  751. package/Particles/EmitterTypes/hemisphericParticleEmitter.js.map +1 -1
  752. package/Particles/EmitterTypes/meshParticleEmitter.d.ts +1 -1
  753. package/Particles/EmitterTypes/meshParticleEmitter.js +2 -2
  754. package/Particles/EmitterTypes/meshParticleEmitter.js.map +1 -1
  755. package/Particles/EmitterTypes/pointParticleEmitter.d.ts +1 -1
  756. package/Particles/EmitterTypes/pointParticleEmitter.js +1 -1
  757. package/Particles/EmitterTypes/pointParticleEmitter.js.map +1 -1
  758. package/Particles/EmitterTypes/sphereParticleEmitter.d.ts +1 -1
  759. package/Particles/EmitterTypes/sphereParticleEmitter.js +1 -1
  760. package/Particles/EmitterTypes/sphereParticleEmitter.js.map +1 -1
  761. package/Particles/Node/nodeParticleBuildState.d.ts +4 -4
  762. package/Particles/Node/nodeParticleBuildState.js +2 -2
  763. package/Particles/Node/nodeParticleBuildState.js.map +1 -1
  764. package/Particles/Node/nodeParticleSystemSet.d.ts +2 -2
  765. package/Particles/Node/nodeParticleSystemSet.helper.js +31 -31
  766. package/Particles/Node/nodeParticleSystemSet.helper.js.map +1 -1
  767. package/Particles/Node/nodeParticleSystemSet.js +8 -8
  768. package/Particles/Node/nodeParticleSystemSet.js.map +1 -1
  769. package/Particles/attractor.d.ts +1 -1
  770. package/Particles/attractor.js +1 -1
  771. package/Particles/attractor.js.map +1 -1
  772. package/Particles/computeShaderParticleSystem.pure.js +5 -1
  773. package/Particles/computeShaderParticleSystem.pure.js.map +1 -1
  774. package/Particles/flowMap.d.ts +7 -1
  775. package/Particles/flowMap.js +7 -1
  776. package/Particles/flowMap.js.map +1 -1
  777. package/Particles/gpuParticleSystem.pure.d.ts +1 -0
  778. package/Particles/gpuParticleSystem.pure.js +17 -1
  779. package/Particles/gpuParticleSystem.pure.js.map +1 -1
  780. package/Particles/particle.d.ts +2 -2
  781. package/Particles/particle.js +2 -2
  782. package/Particles/particle.js.map +1 -1
  783. package/Particles/particleHelper.js +5 -5
  784. package/Particles/particleHelper.js.map +1 -1
  785. package/Particles/particleSystem.functions.d.ts +1 -1
  786. package/Particles/particleSystem.functions.js +1 -1
  787. package/Particles/particleSystem.functions.js.map +1 -1
  788. package/Particles/particleSystemSet.d.ts +1 -1
  789. package/Particles/particleSystemSet.js +5 -5
  790. package/Particles/particleSystemSet.js.map +1 -1
  791. package/Particles/pointsCloudSystem.d.ts +1 -1
  792. package/Particles/pointsCloudSystem.js +6 -6
  793. package/Particles/pointsCloudSystem.js.map +1 -1
  794. package/Particles/solidParticle.d.ts +2 -2
  795. package/Particles/solidParticle.js +3 -3
  796. package/Particles/solidParticle.js.map +1 -1
  797. package/Particles/solidParticleSystem.d.ts +4 -4
  798. package/Particles/solidParticleSystem.js +7 -7
  799. package/Particles/solidParticleSystem.js.map +1 -1
  800. package/Particles/subEmitter.js +1 -1
  801. package/Particles/subEmitter.js.map +1 -1
  802. package/Particles/thinParticleSystem.function.js +2 -2
  803. package/Particles/thinParticleSystem.function.js.map +1 -1
  804. package/Physics/Plugins/cannonJSPlugin.d.ts +1 -1
  805. package/Physics/Plugins/cannonJSPlugin.js +1 -1
  806. package/Physics/Plugins/cannonJSPlugin.js.map +1 -1
  807. package/Physics/castingResult.d.ts +1 -1
  808. package/Physics/castingResult.js +1 -1
  809. package/Physics/castingResult.js.map +1 -1
  810. package/Physics/physicsHelper.d.ts +1 -1
  811. package/Physics/physicsHelper.js +4 -4
  812. package/Physics/physicsHelper.js.map +1 -1
  813. package/Physics/physicsImpostor.d.ts +1 -1
  814. package/Physics/physicsImpostor.js +1 -1
  815. package/Physics/physicsImpostor.js.map +1 -1
  816. package/Physics/physicsRaycastResult.d.ts +1 -1
  817. package/Physics/physicsRaycastResult.js +1 -1
  818. package/Physics/physicsRaycastResult.js.map +1 -1
  819. package/Physics/v1/Plugins/ammoJSPlugin.d.ts +2 -2
  820. package/Physics/v1/Plugins/ammoJSPlugin.js +5 -5
  821. package/Physics/v1/Plugins/ammoJSPlugin.js.map +1 -1
  822. package/Physics/v1/Plugins/oimoJSPlugin.d.ts +2 -2
  823. package/Physics/v1/Plugins/oimoJSPlugin.js +2 -2
  824. package/Physics/v1/Plugins/oimoJSPlugin.js.map +1 -1
  825. package/Physics/v1/physicsEngine.d.ts +1 -1
  826. package/Physics/v1/physicsEngine.js +1 -1
  827. package/Physics/v1/physicsEngine.js.map +1 -1
  828. package/Physics/v2/Plugins/havokPlugin.d.ts +14 -2
  829. package/Physics/v2/Plugins/havokPlugin.js +45 -7
  830. package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
  831. package/Physics/v2/characterController.d.ts +1 -1
  832. package/Physics/v2/characterController.js +2 -2
  833. package/Physics/v2/characterController.js.map +1 -1
  834. package/Physics/v2/physicsAggregate.d.ts +3 -3
  835. package/Physics/v2/physicsAggregate.js +10 -6
  836. package/Physics/v2/physicsAggregate.js.map +1 -1
  837. package/Physics/v2/physicsBody.d.ts +1 -1
  838. package/Physics/v2/physicsBody.js +1 -1
  839. package/Physics/v2/physicsBody.js.map +1 -1
  840. package/Physics/v2/physicsEngine.d.ts +1 -1
  841. package/Physics/v2/physicsEngine.js +1 -1
  842. package/Physics/v2/physicsEngine.js.map +1 -1
  843. package/Physics/v2/physicsShape.d.ts +1 -1
  844. package/Physics/v2/physicsShape.js +1 -1
  845. package/Physics/v2/physicsShape.js.map +1 -1
  846. package/Physics/v2/ragdoll.d.ts +2 -2
  847. package/Physics/v2/ragdoll.js +2 -2
  848. package/Physics/v2/ragdoll.js.map +1 -1
  849. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.pure.d.ts +1 -0
  850. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.pure.js +8 -6
  851. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.pure.js.map +1 -1
  852. package/PostProcesses/RenderPipeline/Pipelines/thinSSRRenderingPipeline.js +1 -1
  853. package/PostProcesses/RenderPipeline/Pipelines/thinSSRRenderingPipeline.js.map +1 -1
  854. package/PostProcesses/RenderPipeline/postProcessRenderEffect.js +1 -1
  855. package/PostProcesses/RenderPipeline/postProcessRenderEffect.js.map +1 -1
  856. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js +3 -2
  857. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js.map +1 -1
  858. package/PostProcesses/bloomEffect.d.ts +1 -1
  859. package/PostProcesses/bloomEffect.js +4 -4
  860. package/PostProcesses/bloomEffect.js.map +1 -1
  861. package/PostProcesses/depthOfFieldEffect.d.ts +1 -1
  862. package/PostProcesses/depthOfFieldEffect.js +3 -3
  863. package/PostProcesses/depthOfFieldEffect.js.map +1 -1
  864. package/PostProcesses/depthOfFieldMergePostProcess.d.ts +1 -1
  865. package/PostProcesses/depthOfFieldMergePostProcess.js +1 -1
  866. package/PostProcesses/depthOfFieldMergePostProcess.js.map +1 -1
  867. package/PostProcesses/highlightsPostProcess.d.ts +1 -1
  868. package/PostProcesses/highlightsPostProcess.js +1 -1
  869. package/PostProcesses/highlightsPostProcess.js.map +1 -1
  870. package/PostProcesses/imageProcessingPostProcess.d.ts +1 -1
  871. package/PostProcesses/imageProcessingPostProcess.js +1 -1
  872. package/PostProcesses/imageProcessingPostProcess.js.map +1 -1
  873. package/PostProcesses/postProcessManager.d.ts +3 -0
  874. package/PostProcesses/postProcessManager.js +4 -1
  875. package/PostProcesses/postProcessManager.js.map +1 -1
  876. package/PostProcesses/subSurfaceScatteringPostProcess.pure.d.ts +1 -0
  877. package/PostProcesses/subSurfaceScatteringPostProcess.pure.js +10 -0
  878. package/PostProcesses/subSurfaceScatteringPostProcess.pure.js.map +1 -1
  879. package/PostProcesses/thinAnaglyphPostProcess.d.ts +1 -1
  880. package/PostProcesses/thinAnaglyphPostProcess.js +1 -1
  881. package/PostProcesses/thinAnaglyphPostProcess.js.map +1 -1
  882. package/PostProcesses/thinBlackAndWhitePostProcess.d.ts +1 -1
  883. package/PostProcesses/thinBlackAndWhitePostProcess.js +1 -1
  884. package/PostProcesses/thinBlackAndWhitePostProcess.js.map +1 -1
  885. package/PostProcesses/thinBloomEffect.js +1 -1
  886. package/PostProcesses/thinBloomEffect.js.map +1 -1
  887. package/PostProcesses/thinBloomMergePostProcess.d.ts +1 -1
  888. package/PostProcesses/thinBloomMergePostProcess.js +1 -1
  889. package/PostProcesses/thinBloomMergePostProcess.js.map +1 -1
  890. package/PostProcesses/thinBlurPostProcess.d.ts +1 -1
  891. package/PostProcesses/thinBlurPostProcess.js +1 -1
  892. package/PostProcesses/thinBlurPostProcess.js.map +1 -1
  893. package/PostProcesses/thinChromaticAberrationPostProcess.d.ts +2 -2
  894. package/PostProcesses/thinChromaticAberrationPostProcess.js +2 -2
  895. package/PostProcesses/thinChromaticAberrationPostProcess.js.map +1 -1
  896. package/PostProcesses/thinCircleOfConfusionPostProcess.d.ts +1 -1
  897. package/PostProcesses/thinCircleOfConfusionPostProcess.js +1 -1
  898. package/PostProcesses/thinCircleOfConfusionPostProcess.js.map +1 -1
  899. package/PostProcesses/thinColorCorrectionPostProcess.d.ts +1 -1
  900. package/PostProcesses/thinColorCorrectionPostProcess.js +2 -2
  901. package/PostProcesses/thinColorCorrectionPostProcess.js.map +1 -1
  902. package/PostProcesses/thinConvolutionPostProcess.d.ts +1 -1
  903. package/PostProcesses/thinConvolutionPostProcess.js +1 -1
  904. package/PostProcesses/thinConvolutionPostProcess.js.map +1 -1
  905. package/PostProcesses/thinCustomPostProcess.d.ts +1 -1
  906. package/PostProcesses/thinCustomPostProcess.js +1 -1
  907. package/PostProcesses/thinCustomPostProcess.js.map +1 -1
  908. package/PostProcesses/thinDepthOfFieldEffect.d.ts +3 -0
  909. package/PostProcesses/thinDepthOfFieldEffect.js +4 -1
  910. package/PostProcesses/thinDepthOfFieldEffect.js.map +1 -1
  911. package/PostProcesses/thinDepthOfFieldMergePostProcess.d.ts +1 -1
  912. package/PostProcesses/thinDepthOfFieldMergePostProcess.js +1 -1
  913. package/PostProcesses/thinDepthOfFieldMergePostProcess.js.map +1 -1
  914. package/PostProcesses/thinExtractHighlightsPostProcess.d.ts +1 -1
  915. package/PostProcesses/thinExtractHighlightsPostProcess.js +1 -1
  916. package/PostProcesses/thinExtractHighlightsPostProcess.js.map +1 -1
  917. package/PostProcesses/thinFXAAPostProcess.d.ts +2 -2
  918. package/PostProcesses/thinFXAAPostProcess.js +2 -2
  919. package/PostProcesses/thinFXAAPostProcess.js.map +1 -1
  920. package/PostProcesses/thinFilterPostProcess.d.ts +2 -2
  921. package/PostProcesses/thinFilterPostProcess.js +2 -2
  922. package/PostProcesses/thinFilterPostProcess.js.map +1 -1
  923. package/PostProcesses/thinGrainPostProcess.d.ts +1 -1
  924. package/PostProcesses/thinGrainPostProcess.js +1 -1
  925. package/PostProcesses/thinGrainPostProcess.js.map +1 -1
  926. package/PostProcesses/thinImageProcessingPostProcess.d.ts +2 -2
  927. package/PostProcesses/thinImageProcessingPostProcess.js +2 -2
  928. package/PostProcesses/thinImageProcessingPostProcess.js.map +1 -1
  929. package/PostProcesses/thinMotionBlurPostProcess.d.ts +1 -1
  930. package/PostProcesses/thinMotionBlurPostProcess.js +2 -2
  931. package/PostProcesses/thinMotionBlurPostProcess.js.map +1 -1
  932. package/PostProcesses/thinPassPostProcess.d.ts +1 -1
  933. package/PostProcesses/thinPassPostProcess.js +1 -1
  934. package/PostProcesses/thinPassPostProcess.js.map +1 -1
  935. package/PostProcesses/thinSSAO2BlurPostProcess.d.ts +1 -1
  936. package/PostProcesses/thinSSAO2BlurPostProcess.js +1 -1
  937. package/PostProcesses/thinSSAO2BlurPostProcess.js.map +1 -1
  938. package/PostProcesses/thinSSAO2CombinePostProcess.d.ts +1 -1
  939. package/PostProcesses/thinSSAO2CombinePostProcess.js +2 -2
  940. package/PostProcesses/thinSSAO2CombinePostProcess.js.map +1 -1
  941. package/PostProcesses/thinSSAO2PostProcess.d.ts +7 -2
  942. package/PostProcesses/thinSSAO2PostProcess.js +36 -4
  943. package/PostProcesses/thinSSAO2PostProcess.js.map +1 -1
  944. package/PostProcesses/thinSSRBlurCombinerPostProcess.d.ts +1 -1
  945. package/PostProcesses/thinSSRBlurCombinerPostProcess.js +2 -2
  946. package/PostProcesses/thinSSRBlurCombinerPostProcess.js.map +1 -1
  947. package/PostProcesses/thinSSRBlurPostProcess.d.ts +2 -2
  948. package/PostProcesses/thinSSRBlurPostProcess.js +2 -2
  949. package/PostProcesses/thinSSRBlurPostProcess.js.map +1 -1
  950. package/PostProcesses/thinSSRPostProcess.d.ts +1 -1
  951. package/PostProcesses/thinSSRPostProcess.js +2 -2
  952. package/PostProcesses/thinSSRPostProcess.js.map +1 -1
  953. package/PostProcesses/thinScreenSpaceCurvaturePostProcess.d.ts +1 -1
  954. package/PostProcesses/thinScreenSpaceCurvaturePostProcess.js +1 -1
  955. package/PostProcesses/thinScreenSpaceCurvaturePostProcess.js.map +1 -1
  956. package/PostProcesses/thinSharpenPostProcess.d.ts +1 -1
  957. package/PostProcesses/thinSharpenPostProcess.js +1 -1
  958. package/PostProcesses/thinSharpenPostProcess.js.map +1 -1
  959. package/PostProcesses/thinTAAPostProcess.d.ts +3 -3
  960. package/PostProcesses/thinTAAPostProcess.js +4 -4
  961. package/PostProcesses/thinTAAPostProcess.js.map +1 -1
  962. package/PostProcesses/thinTonemapPostProcess.d.ts +1 -1
  963. package/PostProcesses/thinTonemapPostProcess.js +1 -1
  964. package/PostProcesses/thinTonemapPostProcess.js.map +1 -1
  965. package/PostProcesses/vrDistortionCorrectionPostProcess.d.ts +1 -1
  966. package/PostProcesses/vrDistortionCorrectionPostProcess.js +3 -3
  967. package/PostProcesses/vrDistortionCorrectionPostProcess.js.map +1 -1
  968. package/Rendering/IBLShadows/iblShadowsAccumulationPass.d.ts +2 -2
  969. package/Rendering/IBLShadows/iblShadowsAccumulationPass.js +4 -4
  970. package/Rendering/IBLShadows/iblShadowsAccumulationPass.js.map +1 -1
  971. package/Rendering/IBLShadows/iblShadowsSpatialBlurPass.d.ts +2 -2
  972. package/Rendering/IBLShadows/iblShadowsSpatialBlurPass.js +4 -4
  973. package/Rendering/IBLShadows/iblShadowsSpatialBlurPass.js.map +1 -1
  974. package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.d.ts +3 -3
  975. package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js +4 -4
  976. package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js.map +1 -1
  977. package/Rendering/depthPeelingRenderer.d.ts +1 -1
  978. package/Rendering/depthPeelingRenderer.js +2 -2
  979. package/Rendering/depthPeelingRenderer.js.map +1 -1
  980. package/Rendering/fluidRenderer/fluidRenderingObject.d.ts +1 -1
  981. package/Rendering/fluidRenderer/fluidRenderingObject.js +1 -1
  982. package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
  983. package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.d.ts +1 -1
  984. package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js +2 -2
  985. package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js.map +1 -1
  986. package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.d.ts +3 -3
  987. package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js +3 -3
  988. package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js.map +1 -1
  989. package/Rendering/fluidRenderer/fluidRenderingTextures.d.ts +2 -2
  990. package/Rendering/fluidRenderer/fluidRenderingTextures.js +3 -3
  991. package/Rendering/fluidRenderer/fluidRenderingTextures.js.map +1 -1
  992. package/Rendering/iblCdfGenerator.d.ts +3 -3
  993. package/Rendering/iblCdfGenerator.js +5 -5
  994. package/Rendering/iblCdfGenerator.js.map +1 -1
  995. package/Rendering/renderingGroup.js +1 -1
  996. package/Rendering/renderingGroup.js.map +1 -1
  997. package/Rendering/subSurfaceConfiguration.d.ts +2 -2
  998. package/Rendering/subSurfaceConfiguration.js +2 -2
  999. package/Rendering/subSurfaceConfiguration.js.map +1 -1
  1000. package/Rendering/utilityLayerRenderer.d.ts +2 -2
  1001. package/Rendering/utilityLayerRenderer.js +4 -4
  1002. package/Rendering/utilityLayerRenderer.js.map +1 -1
  1003. package/Shaders/ssao2.fragment.js +10 -2
  1004. package/Shaders/ssao2.fragment.js.map +1 -1
  1005. package/ShadersWGSL/gpuRenderParticles.fragment.d.ts +5 -0
  1006. package/ShadersWGSL/gpuRenderParticles.fragment.js +50 -0
  1007. package/ShadersWGSL/gpuRenderParticles.fragment.js.map +1 -0
  1008. package/ShadersWGSL/gpuRenderParticles.vertex.d.ts +5 -0
  1009. package/ShadersWGSL/gpuRenderParticles.vertex.js +120 -0
  1010. package/ShadersWGSL/gpuRenderParticles.vertex.js.map +1 -0
  1011. package/ShadersWGSL/noise.fragment.d.ts +5 -0
  1012. package/ShadersWGSL/noise.fragment.js +18 -0
  1013. package/ShadersWGSL/noise.fragment.js.map +1 -0
  1014. package/ShadersWGSL/ssao2.fragment.js +10 -2
  1015. package/ShadersWGSL/ssao2.fragment.js.map +1 -1
  1016. package/SmartAssets/smartAssetSerializer.js +1 -1
  1017. package/SmartAssets/smartAssetSerializer.js.map +1 -1
  1018. package/Sprites/sprite.d.ts +2 -2
  1019. package/Sprites/sprite.js +2 -2
  1020. package/Sprites/sprite.js.map +1 -1
  1021. package/Sprites/spriteManager.d.ts +2 -2
  1022. package/Sprites/spriteManager.js +4 -5
  1023. package/Sprites/spriteManager.js.map +1 -1
  1024. package/Sprites/spritePackedManager.js +1 -1
  1025. package/Sprites/spritePackedManager.js.map +1 -1
  1026. package/Sprites/spriteRenderer.js +2 -2
  1027. package/Sprites/spriteRenderer.js.map +1 -1
  1028. package/XR/features/WebXRHitTestLegacy.d.ts +1 -1
  1029. package/XR/features/WebXRHitTestLegacy.js +2 -2
  1030. package/XR/features/WebXRHitTestLegacy.js.map +1 -1
  1031. package/XR/motionController/webXRAbstractMotionController.js +2 -2
  1032. package/XR/motionController/webXRAbstractMotionController.js.map +1 -1
  1033. package/XR/motionController/webXRGenericMotionController.js +2 -2
  1034. package/XR/motionController/webXRGenericMotionController.js.map +1 -1
  1035. package/XR/motionController/webXRProfiledMotionController.js +4 -4
  1036. package/XR/motionController/webXRProfiledMotionController.js.map +1 -1
  1037. package/XR/webXRCamera.d.ts +3 -3
  1038. package/XR/webXRCamera.js +4 -4
  1039. package/XR/webXRCamera.js.map +1 -1
  1040. package/XR/webXRDefaultExperience.d.ts +4 -4
  1041. package/XR/webXRDefaultExperience.js +4 -4
  1042. package/XR/webXRDefaultExperience.js.map +1 -1
  1043. package/XR/webXREnterExitUI.js +1 -1
  1044. package/XR/webXREnterExitUI.js.map +1 -1
  1045. package/XR/webXRExperienceHelper.js +2 -2
  1046. package/XR/webXRExperienceHelper.js.map +1 -1
  1047. package/XR/webXRFeaturesManager.d.ts +47 -0
  1048. package/XR/webXRFeaturesManager.js +1 -1
  1049. package/XR/webXRFeaturesManager.js.map +1 -1
  1050. package/XR/webXRInput.js +1 -1
  1051. package/XR/webXRInput.js.map +1 -1
  1052. package/XR/webXRInputSource.js +4 -4
  1053. package/XR/webXRInputSource.js.map +1 -1
  1054. package/XR/webXRManagedOutputCanvas.js +1 -1
  1055. package/XR/webXRManagedOutputCanvas.js.map +1 -1
  1056. package/XR/webXRRenderTargetTextureProvider.d.ts +1 -1
  1057. package/XR/webXRRenderTargetTextureProvider.js +1 -1
  1058. package/XR/webXRRenderTargetTextureProvider.js.map +1 -1
  1059. package/assetContainer.d.ts +4 -4
  1060. package/assetContainer.js +6 -6
  1061. package/assetContainer.js.map +1 -1
  1062. package/node.d.ts +1 -1
  1063. package/node.js +6 -2
  1064. package/node.js.map +1 -1
  1065. package/package.json +44 -174
@@ -1,4 +1,4 @@
1
- import { Texture } from "./texture.js";
1
+ import { Texture } from "./texture.pure.js";
2
2
 
3
3
  /**
4
4
  * Class used to store 2D array textures containing user data
@@ -1 +1 @@
1
- {"version":3,"file":"rawTexture2DArray.js","sourceRoot":"","sources":["../../../../../dev/core/src/Materials/Textures/rawTexture2DArray.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAKpD;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,OAAO;IAG1C;;OAEG;IACH,IAAW,KAAK;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,YACI,IAA+B,EAC/B,KAA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Y,EACZ,kBAA2B,IAAI,EAC/B,UAAmB,KAAK,EACxB,eAAuB,SAAS,CAAC,8BAA8B,EAC/D,OAAe,SAAS,CAAC,yBAAyB;QAElD,OAAO,IAAI,iBAAiB,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,kBAAkB,EAAE,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;IAChJ,CAAC;CACJ","sourcesContent":["import { Texture } from \"./texture\";\r\nimport { Constants } from \"../../Engines/constants\";\r\nimport { type Nullable } from \"../../types\";\r\n\r\nimport { type Scene } from \"../../scene\";\r\n\r\n/**\r\n * Class used to store 2D array textures containing user data\r\n */\r\nexport class RawTexture2DArray extends Texture {\r\n private _depth: number;\r\n\r\n /**\r\n * Gets the number of layers of the texture\r\n */\r\n public get depth() {\r\n return this._depth;\r\n }\r\n\r\n /**\r\n * Create a new RawTexture2DArray\r\n * @param data defines the data of 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 texture format to use\r\n * @param scene defines the hosting scene\r\n * @param generateMipMaps defines a boolean indicating if mip levels should be generated (true by default)\r\n * @param invertY defines if texture must be stored with Y axis inverted\r\n * @param samplingMode defines the sampling mode to use (Texture.TRILINEAR_SAMPLINGMODE by default)\r\n * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_BYTE, Engine.TEXTURETYPE_FLOAT...)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @param mipLevelCount defines the number of mip levels to allocate for the texture\r\n */\r\n constructor(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n depth: number,\r\n /** Gets or sets the texture format to use */\r\n public format: number,\r\n scene: Scene,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE,\r\n textureType = Constants.TEXTURETYPE_UNSIGNED_BYTE,\r\n creationFlags?: number,\r\n mipLevelCount?: number\r\n ) {\r\n super(null, scene, !generateMipMaps, invertY);\r\n\r\n this._texture = scene\r\n .getEngine()\r\n .createRawTexture2DArray(data, width, height, depth, format, generateMipMaps, invertY, samplingMode, null, textureType, creationFlags ?? 0, mipLevelCount);\r\n\r\n this._depth = depth;\r\n this.is2DArray = true;\r\n }\r\n\r\n /**\r\n * Update the texture with new data\r\n * @param data defines the data to store in the texture\r\n */\r\n public update(data: ArrayBufferView): void {\r\n this.updateMipLevel(data, 0);\r\n }\r\n\r\n /**\r\n * Updates a specific mip level of the texture.\r\n * @param data The new data for the mip level\r\n * @param mipLevel The mip level to update (0 is the base level)\r\n */\r\n public updateMipLevel(data: ArrayBufferView, mipLevel: number): void {\r\n if (!this._texture) {\r\n return;\r\n }\r\n this._getEngine()!.updateRawTexture2DArray(this._texture, data, this._texture.format, this._texture.invertY, null, this._texture.type, mipLevel);\r\n }\r\n\r\n /**\r\n * Creates a RGBA texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param depth defines the number of layers of the texture\r\n * @param scene defines the scene the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @returns the RGBA texture\r\n */\r\n public static CreateRGBATexture(\r\n data: ArrayBufferView,\r\n width: number,\r\n height: number,\r\n depth: number,\r\n scene: Scene,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_BYTE\r\n ): RawTexture2DArray {\r\n return new RawTexture2DArray(data, width, height, depth, Constants.TEXTUREFORMAT_RGBA, scene, generateMipMaps, invertY, samplingMode, type);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"rawTexture2DArray.js","sourceRoot":"","sources":["../../../../../dev/core/src/Materials/Textures/rawTexture2DArray.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAKpD;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,OAAO;IAG1C;;OAEG;IACH,IAAW,KAAK;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,YACI,IAA+B,EAC/B,KAAa,EACb,MAAc,EACd,KAAa;IACb,6CAA6C;IACtC,MAAc,EACrB,KAAY,EACZ,kBAA2B,IAAI,EAC/B,UAAmB,KAAK,EACxB,eAAuB,OAAO,CAAC,sBAAsB,EACrD,WAAW,GAAG,SAAS,CAAC,yBAAyB,EACjD,aAAsB,EACtB,aAAsB;QAEtB,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;QATvC,WAAM,GAAN,MAAM,CAAQ;QAWrB,IAAI,CAAC,QAAQ,GAAG,KAAK;aAChB,SAAS,EAAE;aACX,uBAAuB,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,WAAW,EAAE,aAAa,IAAI,CAAC,EAAE,aAAa,CAAC,CAAC;QAE/J,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,IAAqB;QAC/B,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACjC,CAAC;IAED;;;;OAIG;IACI,cAAc,CAAC,IAAqB,EAAE,QAAgB;QACzD,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACjB,OAAO;QACX,CAAC;QACD,IAAI,CAAC,UAAU,EAAG,CAAC,uBAAuB,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACrJ,CAAC;IAED;;;;;;;;;;;;OAYG;IACI,MAAM,CAAC,iBAAiB,CAC3B,IAAqB,EACrB,KAAa,EACb,MAAc,EACd,KAAa,EACb,KAAY,EACZ,kBAA2B,IAAI,EAC/B,UAAmB,KAAK,EACxB,eAAuB,SAAS,CAAC,8BAA8B,EAC/D,OAAe,SAAS,CAAC,yBAAyB;QAElD,OAAO,IAAI,iBAAiB,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,kBAAkB,EAAE,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;IAChJ,CAAC;CACJ","sourcesContent":["import { Texture } from \"./texture.pure\";\r\nimport { Constants } from \"../../Engines/constants\";\r\nimport { type Nullable } from \"../../types\";\r\n\r\nimport { type Scene } from \"../../scene\";\r\n\r\n/**\r\n * Class used to store 2D array textures containing user data\r\n */\r\nexport class RawTexture2DArray extends Texture {\r\n private _depth: number;\r\n\r\n /**\r\n * Gets the number of layers of the texture\r\n */\r\n public get depth() {\r\n return this._depth;\r\n }\r\n\r\n /**\r\n * Create a new RawTexture2DArray\r\n * @param data defines the data of 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 texture format to use\r\n * @param scene defines the hosting scene\r\n * @param generateMipMaps defines a boolean indicating if mip levels should be generated (true by default)\r\n * @param invertY defines if texture must be stored with Y axis inverted\r\n * @param samplingMode defines the sampling mode to use (Texture.TRILINEAR_SAMPLINGMODE by default)\r\n * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_BYTE, Engine.TEXTURETYPE_FLOAT...)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @param mipLevelCount defines the number of mip levels to allocate for the texture\r\n */\r\n constructor(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n depth: number,\r\n /** Gets or sets the texture format to use */\r\n public format: number,\r\n scene: Scene,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE,\r\n textureType = Constants.TEXTURETYPE_UNSIGNED_BYTE,\r\n creationFlags?: number,\r\n mipLevelCount?: number\r\n ) {\r\n super(null, scene, !generateMipMaps, invertY);\r\n\r\n this._texture = scene\r\n .getEngine()\r\n .createRawTexture2DArray(data, width, height, depth, format, generateMipMaps, invertY, samplingMode, null, textureType, creationFlags ?? 0, mipLevelCount);\r\n\r\n this._depth = depth;\r\n this.is2DArray = true;\r\n }\r\n\r\n /**\r\n * Update the texture with new data\r\n * @param data defines the data to store in the texture\r\n */\r\n public update(data: ArrayBufferView): void {\r\n this.updateMipLevel(data, 0);\r\n }\r\n\r\n /**\r\n * Updates a specific mip level of the texture.\r\n * @param data The new data for the mip level\r\n * @param mipLevel The mip level to update (0 is the base level)\r\n */\r\n public updateMipLevel(data: ArrayBufferView, mipLevel: number): void {\r\n if (!this._texture) {\r\n return;\r\n }\r\n this._getEngine()!.updateRawTexture2DArray(this._texture, data, this._texture.format, this._texture.invertY, null, this._texture.type, mipLevel);\r\n }\r\n\r\n /**\r\n * Creates a RGBA texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param depth defines the number of layers of the texture\r\n * @param scene defines the scene the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @returns the RGBA texture\r\n */\r\n public static CreateRGBATexture(\r\n data: ArrayBufferView,\r\n width: number,\r\n height: number,\r\n depth: number,\r\n scene: Scene,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_BYTE\r\n ): RawTexture2DArray {\r\n return new RawTexture2DArray(data, width, height, depth, Constants.TEXTUREFORMAT_RGBA, scene, generateMipMaps, invertY, samplingMode, type);\r\n }\r\n}\r\n"]}
@@ -1,5 +1,5 @@
1
1
  import { type Scene } from "../../scene.js";
2
- import { Texture } from "./texture.js";
2
+ import { Texture } from "./texture.pure.js";
3
3
  import { type Nullable } from "../../types.js";
4
4
  /**
5
5
  * Class used to store 3D textures containing user data
@@ -1,4 +1,4 @@
1
- import { Texture } from "./texture.js";
1
+ import { Texture } from "./texture.pure.js";
2
2
 
3
3
  /**
4
4
  * Class used to store 3D textures containing user data
@@ -1 +1 @@
1
- {"version":3,"file":"rawTexture3D.js","sourceRoot":"","sources":["../../../../../dev/core/src/Materials/Textures/rawTexture3D.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,OAAO;IACrC;;OAEG;IACH,IAAW,KAAK;QACZ,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACnD,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,O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","sourcesContent":["import { type Scene } from \"../../scene\";\r\nimport { Texture } from \"./texture\";\r\nimport { Constants } from \"../../Engines/constants\";\r\nimport { type Nullable } from \"../../types\";\r\n/**\r\n * Class used to store 3D textures containing user data\r\n */\r\nexport class RawTexture3D extends Texture {\r\n /**\r\n * Gets the width of the texture\r\n */\r\n public get width(): number {\r\n return this._texture ? this._texture.width : 0;\r\n }\r\n\r\n /**\r\n * Gets the height of the texture\r\n */\r\n public get height(): number {\r\n return this._texture ? this._texture.height : 0;\r\n }\r\n\r\n /**\r\n * Gets the depth of the texture\r\n */\r\n public get depth(): number {\r\n return this._texture ? this._texture.depth : 0;\r\n }\r\n\r\n /**\r\n * Create a new RawTexture3D\r\n * @param data defines the data of 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 texture format to use\r\n * @param scene defines the hosting scene\r\n * @param generateMipMaps defines a boolean indicating if mip levels should be generated (true by default)\r\n * @param invertY defines if texture must be stored with Y axis inverted\r\n * @param samplingMode defines the sampling mode to use (Texture.TRILINEAR_SAMPLINGMODE by default)\r\n * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_BYTE, Engine.TEXTURETYPE_FLOAT...)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n */\r\n constructor(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n depth: number,\r\n /** Gets or sets the texture format to use */\r\n public format: number,\r\n scene: Scene,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE,\r\n textureType = Constants.TEXTURETYPE_UNSIGNED_BYTE,\r\n creationFlags?: number\r\n ) {\r\n super(null, scene, !generateMipMaps, invertY);\r\n\r\n this._texture = scene.getEngine().createRawTexture3D(data, width, height, depth, format, generateMipMaps, invertY, samplingMode, null, textureType, creationFlags);\r\n\r\n this.is3D = true;\r\n }\r\n\r\n /**\r\n * Update the texture with new data\r\n * @param data defines the data to store in the texture\r\n */\r\n public update(data: ArrayBufferView): void {\r\n if (!this._texture) {\r\n return;\r\n }\r\n this._getEngine()!.updateRawTexture3D(this._texture, data, this._texture.format, this._texture.invertY, null, this._texture.type);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"rawTexture3D.js","sourceRoot":"","sources":["../../../../../dev/core/src/Materials/Textures/rawTexture3D.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,OAAO;IACrC;;OAEG;IACH,IAAW,KAAK;QACZ,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACnD,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IACpD,CAAC;IAED;;OAEG;IACH,IAAW,KAAK;QACZ,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACnD,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,YACI,IAA+B,EAC/B,KAAa,EACb,MAAc,EACd,KAAa;IACb,6CAA6C;IACtC,MAAc,EACrB,KAAY,EACZ,kBAA2B,IAAI,EAC/B,UAAmB,KAAK,EACxB,eAAuB,OAAO,CAAC,sBAAsB,EACrD,WAAW,GAAG,SAAS,CAAC,yBAAyB,EACjD,aAAsB;QAEtB,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;QARvC,WAAM,GAAN,MAAM,CAAQ;QAUrB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC,kBAAkB,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC;QAEnK,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACrB,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,IAAqB;QAC/B,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACjB,OAAO;QACX,CAAC;QACD,IAAI,CAAC,UAAU,EAAG,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACtI,CAAC;CACJ","sourcesContent":["import { type Scene } from \"../../scene\";\r\nimport { Texture } from \"./texture.pure\";\r\nimport { Constants } from \"../../Engines/constants\";\r\nimport { type Nullable } from \"../../types\";\r\n/**\r\n * Class used to store 3D textures containing user data\r\n */\r\nexport class RawTexture3D extends Texture {\r\n /**\r\n * Gets the width of the texture\r\n */\r\n public get width(): number {\r\n return this._texture ? this._texture.width : 0;\r\n }\r\n\r\n /**\r\n * Gets the height of the texture\r\n */\r\n public get height(): number {\r\n return this._texture ? this._texture.height : 0;\r\n }\r\n\r\n /**\r\n * Gets the depth of the texture\r\n */\r\n public get depth(): number {\r\n return this._texture ? this._texture.depth : 0;\r\n }\r\n\r\n /**\r\n * Create a new RawTexture3D\r\n * @param data defines the data of 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 texture format to use\r\n * @param scene defines the hosting scene\r\n * @param generateMipMaps defines a boolean indicating if mip levels should be generated (true by default)\r\n * @param invertY defines if texture must be stored with Y axis inverted\r\n * @param samplingMode defines the sampling mode to use (Texture.TRILINEAR_SAMPLINGMODE by default)\r\n * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_BYTE, Engine.TEXTURETYPE_FLOAT...)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n */\r\n constructor(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n depth: number,\r\n /** Gets or sets the texture format to use */\r\n public format: number,\r\n scene: Scene,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE,\r\n textureType = Constants.TEXTURETYPE_UNSIGNED_BYTE,\r\n creationFlags?: number\r\n ) {\r\n super(null, scene, !generateMipMaps, invertY);\r\n\r\n this._texture = scene.getEngine().createRawTexture3D(data, width, height, depth, format, generateMipMaps, invertY, samplingMode, null, textureType, creationFlags);\r\n\r\n this.is3D = true;\r\n }\r\n\r\n /**\r\n * Update the texture with new data\r\n * @param data defines the data to store in the texture\r\n */\r\n public update(data: ArrayBufferView): void {\r\n if (!this._texture) {\r\n return;\r\n }\r\n this._getEngine()!.updateRawTexture3D(this._texture, data, this._texture.format, this._texture.invertY, null, this._texture.type);\r\n }\r\n}\r\n"]}
@@ -1,6 +1,6 @@
1
1
  import { type Scene } from "../../scene.js";
2
2
  import { Plane } from "../../Maths/math.plane.js";
3
- import { RenderTargetTexture } from "../../Materials/Textures/renderTargetTexture.js";
3
+ import { RenderTargetTexture } from "../../Materials/Textures/renderTargetTexture.pure.js";
4
4
  /**
5
5
  * Creates a refraction texture used by refraction channel of the standard material.
6
6
  * It is like a mirror but to see through a material.
@@ -1,5 +1,5 @@
1
1
  import { Plane } from "../../Maths/math.plane.js";
2
- import { RenderTargetTexture } from "../../Materials/Textures/renderTargetTexture.js";
2
+ import { RenderTargetTexture } from "../../Materials/Textures/renderTargetTexture.pure.js";
3
3
  /**
4
4
  * Creates a refraction texture used by refraction channel of the standard material.
5
5
  * It is like a mirror but to see through a material.
@@ -1 +1 @@
1
- {"version":3,"file":"refractionTexture.js","sourceRoot":"","sources":["../../../../../dev/core/src/Materials/Textures/refractionTexture.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACnF;;;;GAIG;AACH,MAAM,OAAO,iBAAkB,SAAQ,mBAAmB;IAatD;;;;;;;;OAQG;IACH,YAAY,IAAY,EAAE,IAAY,EAAE,KAAa,EAAE,eAAyB;QAC5E,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,eAAe,EAAE,IAAI,CAAC,CAAC;QAtBpD;;;;WAIG;QACI,oBAAe,GAAG,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAE/C;;WAEG;QACI,UAAK,GAAG,GAAG,CAAC;QAcf,IAAI,CAAC,wBAAwB,CAAC,GAAG,CAAC,GAAG,EAAE;YACnC,IAAI,CAAC,QAAQ,EAAG,CAAC,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC;QACtD,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,GAAG,EAAE;YAClC,IAAI,CAAC,QAAQ,EAAG,CAAC,SAAS,GAAG,IAAI,CAAC;QACtC,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;;OAGG;IACa,KAAK;QACjB,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;QAE9B,IAAI,CAAC,KAAK,EAAE,CAAC;YACT,OAAO,IAAI,CAAC;QAChB,CAAC;QAED,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QACnC,MAAM,UAAU,GAAG,IAAI,iBAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAErG,eAAe;QACf,UAAU,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QACpC,UAAU,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QAE9B,qBAAqB;QACrB,UAAU,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;QAC1D,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YAClB,UAAU,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACrD,CAAC;QACD,UAAU,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QAE9B,OAAO,UAAU,CAAC;IACtB,CAAC;IAED;;;OAGG;IACa,SAAS;QACrB,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YACb,OAAO,IAAI,CAAC;QAChB,CAAC;QAED,MAAM,mBAAmB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAE9C,mBAAmB,CAAC,WAAW,GAAG,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,CAAC;QACjE,mBAAmB,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QAEvC,OAAO,mBAAmB,CAAC;IAC/B,CAAC;CACJ","sourcesContent":["import { type Scene } from \"../../scene\";\r\nimport { Plane } from \"../../Maths/math.plane\";\r\nimport { RenderTargetTexture } from \"../../Materials/Textures/renderTargetTexture\";\r\n/**\r\n * Creates a refraction texture used by refraction channel of the standard material.\r\n * It is like a mirror but to see through a material.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/reflectionTexture#refractiontexture\r\n */\r\nexport class RefractionTexture extends RenderTargetTexture {\r\n /**\r\n * Define the reflection plane we want to use. The refractionPlane is usually set to the constructed refractor.\r\n * It is possible to directly set the refractionPlane by directly using a Plane(a, b, c, d) where a, b and c give the plane normal vector (a, b, c) and d is a scalar displacement from the refractionPlane to the origin. However in all but the very simplest of situations it is more straight forward to set it to the refractor as stated in the doc.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/reflectionTexture#refraction\r\n */\r\n public refractionPlane = new Plane(0, 1, 0, 1);\r\n\r\n /**\r\n * Define how deep under the surface we should see.\r\n */\r\n public depth = 2.0;\r\n\r\n /**\r\n * Creates a refraction texture used by refraction channel of the standard material.\r\n * It is like a mirror but to see through a material.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/reflectionTexture#refraction\r\n * @param name Define the texture name\r\n * @param size Define the size of the underlying texture\r\n * @param scene Define the scene the refraction belongs to\r\n * @param generateMipMaps Define if we need to generate mips level for the refraction\r\n */\r\n constructor(name: string, size: number, scene?: Scene, generateMipMaps?: boolean) {\r\n super(name, size, scene, generateMipMaps, true);\r\n\r\n this.onBeforeRenderObservable.add(() => {\r\n this.getScene()!.clipPlane = this.refractionPlane;\r\n });\r\n\r\n this.onAfterRenderObservable.add(() => {\r\n this.getScene()!.clipPlane = null;\r\n });\r\n }\r\n\r\n /**\r\n * Clone the refraction texture.\r\n * @returns the cloned texture\r\n */\r\n public override clone(): RefractionTexture {\r\n const scene = this.getScene();\r\n\r\n if (!scene) {\r\n return this;\r\n }\r\n\r\n const textureSize = this.getSize();\r\n const newTexture = new RefractionTexture(this.name, textureSize.width, scene, this._generateMipMaps);\r\n\r\n // Base texture\r\n newTexture.hasAlpha = this.hasAlpha;\r\n newTexture.level = this.level;\r\n\r\n // Refraction Texture\r\n newTexture.refractionPlane = this.refractionPlane.clone();\r\n if (this.renderList) {\r\n newTexture.renderList = this.renderList.slice(0);\r\n }\r\n newTexture.depth = this.depth;\r\n\r\n return newTexture;\r\n }\r\n\r\n /**\r\n * Serialize the texture to a JSON representation you could use in Parse later on\r\n * @returns the serialized JSON representation\r\n */\r\n public override serialize(): any {\r\n if (!this.name) {\r\n return null;\r\n }\r\n\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.mirrorPlane = this.refractionPlane.asArray();\r\n serializationObject.depth = this.depth;\r\n\r\n return serializationObject;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"refractionTexture.js","sourceRoot":"","sources":["../../../../../dev/core/src/Materials/Textures/refractionTexture.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAC;AACxF;;;;GAIG;AACH,MAAM,OAAO,iBAAkB,SAAQ,mBAAmB;IAatD;;;;;;;;OAQG;IACH,YAAY,IAAY,EAAE,IAAY,EAAE,KAAa,EAAE,eAAyB;QAC5E,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,eAAe,EAAE,IAAI,CAAC,CAAC;QAtBpD;;;;WAIG;QACI,oBAAe,GAAG,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAE/C;;WAEG;QACI,UAAK,GAAG,GAAG,CAAC;QAcf,IAAI,CAAC,wBAAwB,CAAC,GAAG,CAAC,GAAG,EAAE;YACnC,IAAI,CAAC,QAAQ,EAAG,CAAC,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC;QACtD,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,GAAG,EAAE;YAClC,IAAI,CAAC,QAAQ,EAAG,CAAC,SAAS,GAAG,IAAI,CAAC;QACtC,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;;OAGG;IACa,KAAK;QACjB,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;QAE9B,IAAI,CAAC,KAAK,EAAE,CAAC;YACT,OAAO,IAAI,CAAC;QAChB,CAAC;QAED,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QACnC,MAAM,UAAU,GAAG,IAAI,iBAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAErG,eAAe;QACf,UAAU,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QACpC,UAAU,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QAE9B,qBAAqB;QACrB,UAAU,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;QAC1D,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YAClB,UAAU,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACrD,CAAC;QACD,UAAU,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QAE9B,OAAO,UAAU,CAAC;IACtB,CAAC;IAED;;;OAGG;IACa,SAAS;QACrB,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YACb,OAAO,IAAI,CAAC;QAChB,CAAC;QAED,MAAM,mBAAmB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAE9C,mBAAmB,CAAC,WAAW,GAAG,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,CAAC;QACjE,mBAAmB,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QAEvC,OAAO,mBAAmB,CAAC;IAC/B,CAAC;CACJ","sourcesContent":["import { type Scene } from \"../../scene\";\r\nimport { Plane } from \"../../Maths/math.plane\";\r\nimport { RenderTargetTexture } from \"../../Materials/Textures/renderTargetTexture.pure\";\r\n/**\r\n * Creates a refraction texture used by refraction channel of the standard material.\r\n * It is like a mirror but to see through a material.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/reflectionTexture#refractiontexture\r\n */\r\nexport class RefractionTexture extends RenderTargetTexture {\r\n /**\r\n * Define the reflection plane we want to use. The refractionPlane is usually set to the constructed refractor.\r\n * It is possible to directly set the refractionPlane by directly using a Plane(a, b, c, d) where a, b and c give the plane normal vector (a, b, c) and d is a scalar displacement from the refractionPlane to the origin. However in all but the very simplest of situations it is more straight forward to set it to the refractor as stated in the doc.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/reflectionTexture#refraction\r\n */\r\n public refractionPlane = new Plane(0, 1, 0, 1);\r\n\r\n /**\r\n * Define how deep under the surface we should see.\r\n */\r\n public depth = 2.0;\r\n\r\n /**\r\n * Creates a refraction texture used by refraction channel of the standard material.\r\n * It is like a mirror but to see through a material.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/reflectionTexture#refraction\r\n * @param name Define the texture name\r\n * @param size Define the size of the underlying texture\r\n * @param scene Define the scene the refraction belongs to\r\n * @param generateMipMaps Define if we need to generate mips level for the refraction\r\n */\r\n constructor(name: string, size: number, scene?: Scene, generateMipMaps?: boolean) {\r\n super(name, size, scene, generateMipMaps, true);\r\n\r\n this.onBeforeRenderObservable.add(() => {\r\n this.getScene()!.clipPlane = this.refractionPlane;\r\n });\r\n\r\n this.onAfterRenderObservable.add(() => {\r\n this.getScene()!.clipPlane = null;\r\n });\r\n }\r\n\r\n /**\r\n * Clone the refraction texture.\r\n * @returns the cloned texture\r\n */\r\n public override clone(): RefractionTexture {\r\n const scene = this.getScene();\r\n\r\n if (!scene) {\r\n return this;\r\n }\r\n\r\n const textureSize = this.getSize();\r\n const newTexture = new RefractionTexture(this.name, textureSize.width, scene, this._generateMipMaps);\r\n\r\n // Base texture\r\n newTexture.hasAlpha = this.hasAlpha;\r\n newTexture.level = this.level;\r\n\r\n // Refraction Texture\r\n newTexture.refractionPlane = this.refractionPlane.clone();\r\n if (this.renderList) {\r\n newTexture.renderList = this.renderList.slice(0);\r\n }\r\n newTexture.depth = this.depth;\r\n\r\n return newTexture;\r\n }\r\n\r\n /**\r\n * Serialize the texture to a JSON representation you could use in Parse later on\r\n * @returns the serialized JSON representation\r\n */\r\n public override serialize(): any {\r\n if (!this.name) {\r\n return null;\r\n }\r\n\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.mirrorPlane = this.refractionPlane.asArray();\r\n serializationObject.depth = this.depth;\r\n\r\n return serializationObject;\r\n }\r\n}\r\n"]}
@@ -1,5 +1,5 @@
1
1
  import { type Scene } from "../../scene.js";
2
- import { ProceduralTexture } from "./Procedurals/proceduralTexture.js";
2
+ import { ProceduralTexture } from "./Procedurals/proceduralTexture.pure.js";
3
3
  import { type BaseTexture } from "./baseTexture.js";
4
4
  import { type TextureSize } from "./textureCreationOptions.js";
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { ProceduralTexture } from "./Procedurals/proceduralTexture.js";
1
+ import { ProceduralTexture } from "./Procedurals/proceduralTexture.pure.js";
2
2
 
3
3
  const _ShaderName = "textureMerger";
4
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"textureMerger.js","sourceRoot":"","sources":["../../../../../dev/core/src/Materials/Textures/textureMerger.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAIpE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AA4CpD,MAAM,WAAW,GAAG,eAAe,CAAC;AAEpC;;;;;GAKG;AACH,SAAS,cAAc,CAAC,KAAmB;IACvC,OAAO,SAAS,IAAI,KAAK,CAAC;AAC9B,CAAC;AAED;;;;;GAKG;AACH,SAAS,eAAe,CAAC,KAAmB;IACxC,OAAO,OAAO,IAAI,KAAK,CAAC;AAC5B,CAAC;AAED;;;;;GAKG;AACH,SAAS,oBAAoB,CAAC,MAAe,EAAE,WAAoB;IAC/D,WAAW,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;IACrC,WAAW,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;IACrC,WAAW,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IACnC,WAAW,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IACnC,WAAW,CAAC,IAAI,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O,EAAE,KAAK,EAAE,CAAC;AACrB,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,uBAAuB,CAAC,GAAiB,EAAE,KAAoB,EAAE,IAAmB,EAAE,KAAoB;IACtH,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AACvC,CAAC","sourcesContent":["import { type Scene } from \"../../scene\";\nimport { type IProceduralTextureCreationOptions } from \"core/Materials/Textures/Procedurals/proceduralTexture\";\nimport { ProceduralTexture } from \"./Procedurals/proceduralTexture\";\nimport { type BaseTexture } from \"./baseTexture\";\nimport { type TextureSize } from \"./textureCreationOptions\";\nimport { ShaderLanguage } from \"core/Materials/shaderLanguage\";\nimport { Constants } from \"../../Engines/constants\";\nimport { type Texture } from \"./texture\";\n\n/**\n * Configuration for a texture input source\n */\nexport interface ITextureChannelInput {\n /** The texture to use as input */\n texture: BaseTexture;\n /** Source channel to read from (0=R, 1=G, 2=B, 3=A) */\n sourceChannel: number;\n}\n\n/**\n * Configuration for a constant value input source\n */\nexport interface IConstantChannelInput {\n /** Constant value between 0.0 and 1.0 */\n value: number;\n}\n\n/**\n * Union type for channel input sources\n */\nexport type ChannelInput = ITextureChannelInput | IConstantChannelInput;\n\n/**\n * Configuration for texture merging operation\n */\nexport interface ITextureMergeConfiguration {\n /** Configuration for red output channel */\n red: ChannelInput;\n /** Configuration for green output channel (optional, defaults to 0) */\n green?: ChannelInput;\n /** Configuration for blue output channel (optional, defaults to 0) */\n blue?: ChannelInput;\n /** Configuration for alpha output channel (optional, defaults to 1) */\n alpha?: ChannelInput;\n /** Output texture size. If not specified, uses the largest input texture size */\n outputSize?: TextureSize;\n /** Whether to generate mipmaps for the output texture */\n generateMipMaps?: boolean;\n}\n\nconst _ShaderName = \"textureMerger\";\n\n/**\n * @internal\n * Check if a channel input is a texture input\n * @param input The channel input to check\n * @returns True if the input is a texture input, false otherwise\n */\nfunction IsTextureInput(input: ChannelInput): input is ITextureChannelInput {\n return \"texture\" in input;\n}\n\n/**\n * @internal\n * Check if a channel input is a constant input\n * @param input The channel input to check\n * @returns True if the input is a constant input, false otherwise\n */\nfunction IsConstantInput(input: ChannelInput): input is IConstantChannelInput {\n return \"value\" in input;\n}\n\n/**\n * @internal\n * Copy texture transformation properties from one texture to another\n * @param source The source texture\n * @param destination The destination texture\n */\nfunction CopyTextureTransform(source: Texture, destination: Texture) {\n destination.uOffset = source.uOffset;\n destination.vOffset = source.vOffset;\n destination.uScale = source.uScale;\n destination.vScale = source.vScale;\n destination.uAng = source.uAng;\n destination.vAng = source.vAng;\n destination.wAng = source.wAng;\n destination.uRotationCenter = source.uRotationCenter;\n destination.vRotationCenter = source.vRotationCenter;\n}\n\n/**\n * @internal\n * Merge multiple texture channels into a single texture\n * @param name Name for the resulting texture\n * @param config Merge configuration\n * @param scene Scene to create the texture in\n * @returns The merged texture\n */\nexport async function MergeTexturesAsync(name: string, config: ITextureMergeConfiguration, scene: Scene): Promise<ProceduralTexture> {\n const channels = [config.red, config.green, config.blue, config.alpha];\n const textureInputs: BaseTexture[] = [];\n const textureInputMap: number[] = []; // Maps channel index to texture input index (-1 for constants)\n\n // Collect unique textures and validate inputs\n for (let channelIndex = 0; channelIndex < 4; channelIndex++) {\n const channel = channels[channelIndex];\n if (channel) {\n if (IsTextureInput(channel)) {\n // Validate source channel\n if (channel.sourceChannel < 0 || channel.sourceChannel > 3) {\n throw new Error(\"Source channel must be between 0 and 3 (R, G, B, A)\");\n }\n\n // Find or add texture to inputs\n let textureIndex = textureInputs.indexOf(channel.texture);\n if (textureIndex === -1) {\n textureIndex = textureInputs.length;\n textureInputs.push(channel.texture);\n }\n textureInputMap[channelIndex] = textureIndex;\n } else if (IsConstantInput(channel)) {\n // Validate constant value\n if (channel.value < 0 || channel.value > 1) {\n throw new Error(\"Constant value must be between 0.0 and 1.0\");\n }\n textureInputMap[channelIndex] = -1;\n } else {\n throw new Error(\"Invalid channel input configuration\");\n }\n } else {\n textureInputMap[channelIndex] = -1;\n }\n }\n\n // Determine output size\n let outputSize = config.outputSize;\n if (!outputSize && textureInputs.length > 0) {\n // Use the largest texture size\n let maxSize = 0;\n for (const texture of textureInputs) {\n const size = texture.getSize();\n const currentSize = Math.max(size.width, size.height);\n if (currentSize > maxSize) {\n maxSize = currentSize;\n outputSize = size.width === size.height ? maxSize : size;\n }\n }\n }\n outputSize = outputSize || 512; // Fallback size\n\n // Generate shader defines\n const defines: string[] = [];\n const usedTextures = new Set<number>();\n\n for (let channelIndex = 0; channelIndex < 4; channelIndex++) {\n const channel = channels[channelIndex];\n const channelName = [\"RED\", \"GREEN\", \"BLUE\", \"ALPHA\"][channelIndex];\n\n if (channel && IsTextureInput(channel)) {\n defines.push(`${channelName}_FROM_TEXTURE`);\n const textureIndex = textureInputMap[channelIndex];\n usedTextures.add(textureIndex);\n }\n }\n\n // Add texture defines for used textures\n usedTextures.forEach((textureIndex) => {\n defines.push(`USE_TEXTURE${textureIndex}`);\n });\n\n // Create the procedural texture\n const outputTextureOptions: IProceduralTextureCreationOptions = {\n type: Constants.TEXTURETYPE_HALF_FLOAT,\n format: Constants.TEXTUREFORMAT_RGBA,\n samplingMode: Constants.TEXTURE_NEAREST_SAMPLINGMODE,\n generateDepthBuffer: false,\n generateMipMaps: false,\n shaderLanguage: scene.getEngine().isWebGPU ? ShaderLanguage.WGSL : ShaderLanguage.GLSL,\n extraInitializationsAsync: async () => {\n if (scene.getEngine().isWebGPU) {\n await Promise.all([import(\"../../ShadersWGSL/textureMerger.fragment\")]);\n } else {\n await Promise.all([import(\"../../Shaders/textureMerger.fragment\")]);\n }\n },\n skipSceneRegistration: true,\n };\n const proceduralTexture = new ProceduralTexture(name, outputSize, _ShaderName, scene, outputTextureOptions);\n proceduralTexture.refreshRate = -1; // Do not auto-refresh\n\n // Set the defines\n proceduralTexture.defines = defines.length > 0 ? \"#define \" + defines.join(\"\\n#define \") + \"\\n\" : \"\";\n\n // Set up texture inputs\n for (let i = 0; i < textureInputs.length; i++) {\n CopyTextureTransform(textureInputs[i] as Texture, proceduralTexture);\n proceduralTexture.setTexture(`inputTexture${i}`, textureInputs[i]);\n }\n\n // Set up channel configuration\n for (let channelIndex = 0; channelIndex < 4; channelIndex++) {\n const channel = channels[channelIndex];\n const channelName = [\"red\", \"green\", \"blue\", \"alpha\"][channelIndex];\n\n if (channel && IsTextureInput(channel)) {\n const textureIndex = textureInputMap[channelIndex];\n proceduralTexture.setInt(`${channelName}TextureIndex`, textureIndex);\n proceduralTexture.setInt(`${channelName}SourceChannel`, channel.sourceChannel);\n } else {\n // Use constant value (either provided or default)\n let constantValue: number;\n if (channel && IsConstantInput(channel)) {\n constantValue = channel.value;\n } else {\n // Use default values: 0 for RGB, 1 for alpha\n constantValue = channelIndex === 3 ? 1.0 : 0.0;\n }\n proceduralTexture.setFloat(`${channelName}ConstantValue`, constantValue);\n }\n }\n\n return await new Promise<ProceduralTexture>((resolve, reject) => {\n // Compile and render\n proceduralTexture.executeWhenReady(() => {\n try {\n proceduralTexture.render();\n resolve(proceduralTexture);\n } catch (error) {\n reject(error instanceof Error ? error : new Error(String(error)));\n }\n });\n });\n}\n\n/**\n * @internal\n * Create a texture input configuration\n * @param texture The texture to read from\n * @param sourceChannel The channel to read (0=R, 1=G, 2=B, 3=A)\n * @returns Texture channel input configuration\n */\nexport function CreateTextureInput(texture: BaseTexture, sourceChannel: number): ITextureChannelInput {\n return { texture, sourceChannel };\n}\n\n/**\n * @internal\n * Create a constant value input configuration\n * @param value The constant value (0.0-1.0)\n * @returns Constant channel input configuration\n */\nexport function CreateConstantInput(value: number): IConstantChannelInput {\n return { value };\n}\n\n/**\n * @internal\n * Create a simple RGBA channel packing configuration\n * @param red Input for red channel\n * @param green Input for green channel (optional, defaults to 0)\n * @param blue Input for blue channel (optional, defaults to 0)\n * @param alpha Input for alpha channel (optional, defaults to 1)\n * @returns Texture merge configuration\n */\nexport function CreateRGBAConfiguration(red: ChannelInput, green?: ChannelInput, blue?: ChannelInput, alpha?: ChannelInput): ITextureMergeConfiguration {\n return { red, green, blue, alpha };\n}\n"]}
1
+ {"version":3,"file":"textureMerger.js","sourceRoot":"","sources":["../../../../../dev/core/src/Materials/Textures/textureMerger.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAIzE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AA4CpD,MAAM,WAAW,GAAG,eAAe,CAAC;AAEpC;;;;;GAKG;AACH,SAAS,cAAc,CAAC,KAAmB;IACvC,OAAO,SAAS,IAAI,KAAK,CAAC;AAC9B,CAAC;AAED;;;;;GAKG;AACH,SAAS,eAAe,CAAC,KAAmB;IACxC,OAAO,OAAO,IAAI,KAAK,CAAC;AAC5B,CAAC;AAED;;;;;GAKG;AACH,SAAS,oBAAoB,CAAC,MAAe,EAAE,WAAoB;IAC/D,WAAW,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;IACrC,WAAW,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;IACrC,WAAW,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IACnC,WAAW,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IACnC,WAAW,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IAC/B,WAAW,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IAC/B,WAAW,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IAC/B,WAAW,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC;IACrD,WAAW,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC;AACzD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,IAAY,EAAE,MAAkC,EAAE,KAAY;IACnG,MAAM,QAAQ,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,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ACD,iBAAiB,CAAC,QAAQ,CAAC,GAAG,WAAW,eAAe,EAAE,aAAa,CAAC,CAAC;QAC7E,CAAC;IACL,CAAC;IAED,OAAO,MAAM,IAAI,OAAO,CAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC5D,qBAAqB;QACrB,iBAAiB,CAAC,gBAAgB,CAAC,GAAG,EAAE;YACpC,IAAI,CAAC;gBACD,iBAAiB,CAAC,MAAM,EAAE,CAAC;gBAC3B,OAAO,CAAC,iBAAiB,CAAC,CAAC;YAC/B,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACb,MAAM,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACtE,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAoB,EAAE,aAAqB;IAC1E,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;AACtC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAa;IAC7C,OAAO,EAAE,KAAK,EAAE,CAAC;AACrB,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,uBAAuB,CAAC,GAAiB,EAAE,KAAoB,EAAE,IAAmB,EAAE,KAAoB;IACtH,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AACvC,CAAC","sourcesContent":["import { type Scene } from \"../../scene\";\nimport { type IProceduralTextureCreationOptions } from \"core/Materials/Textures/Procedurals/proceduralTexture\";\nimport { ProceduralTexture } from \"./Procedurals/proceduralTexture.pure\";\nimport { type BaseTexture } from \"./baseTexture\";\nimport { type TextureSize } from \"./textureCreationOptions\";\nimport { ShaderLanguage } from \"core/Materials/shaderLanguage\";\nimport { Constants } from \"../../Engines/constants\";\nimport { type Texture } from \"./texture\";\n\n/**\n * Configuration for a texture input source\n */\nexport interface ITextureChannelInput {\n /** The texture to use as input */\n texture: BaseTexture;\n /** Source channel to read from (0=R, 1=G, 2=B, 3=A) */\n sourceChannel: number;\n}\n\n/**\n * Configuration for a constant value input source\n */\nexport interface IConstantChannelInput {\n /** Constant value between 0.0 and 1.0 */\n value: number;\n}\n\n/**\n * Union type for channel input sources\n */\nexport type ChannelInput = ITextureChannelInput | IConstantChannelInput;\n\n/**\n * Configuration for texture merging operation\n */\nexport interface ITextureMergeConfiguration {\n /** Configuration for red output channel */\n red: ChannelInput;\n /** Configuration for green output channel (optional, defaults to 0) */\n green?: ChannelInput;\n /** Configuration for blue output channel (optional, defaults to 0) */\n blue?: ChannelInput;\n /** Configuration for alpha output channel (optional, defaults to 1) */\n alpha?: ChannelInput;\n /** Output texture size. If not specified, uses the largest input texture size */\n outputSize?: TextureSize;\n /** Whether to generate mipmaps for the output texture */\n generateMipMaps?: boolean;\n}\n\nconst _ShaderName = \"textureMerger\";\n\n/**\n * @internal\n * Check if a channel input is a texture input\n * @param input The channel input to check\n * @returns True if the input is a texture input, false otherwise\n */\nfunction IsTextureInput(input: ChannelInput): input is ITextureChannelInput {\n return \"texture\" in input;\n}\n\n/**\n * @internal\n * Check if a channel input is a constant input\n * @param input The channel input to check\n * @returns True if the input is a constant input, false otherwise\n */\nfunction IsConstantInput(input: ChannelInput): input is IConstantChannelInput {\n return \"value\" in input;\n}\n\n/**\n * @internal\n * Copy texture transformation properties from one texture to another\n * @param source The source texture\n * @param destination The destination texture\n */\nfunction CopyTextureTransform(source: Texture, destination: Texture) {\n destination.uOffset = source.uOffset;\n destination.vOffset = source.vOffset;\n destination.uScale = source.uScale;\n destination.vScale = source.vScale;\n destination.uAng = source.uAng;\n destination.vAng = source.vAng;\n destination.wAng = source.wAng;\n destination.uRotationCenter = source.uRotationCenter;\n destination.vRotationCenter = source.vRotationCenter;\n}\n\n/**\n * @internal\n * Merge multiple texture channels into a single texture\n * @param name Name for the resulting texture\n * @param config Merge configuration\n * @param scene Scene to create the texture in\n * @returns The merged texture\n */\nexport async function MergeTexturesAsync(name: string, config: ITextureMergeConfiguration, scene: Scene): Promise<ProceduralTexture> {\n const channels = [config.red, config.green, config.blue, config.alpha];\n const textureInputs: BaseTexture[] = [];\n const textureInputMap: number[] = []; // Maps channel index to texture input index (-1 for constants)\n\n // Collect unique textures and validate inputs\n for (let channelIndex = 0; channelIndex < 4; channelIndex++) {\n const channel = channels[channelIndex];\n if (channel) {\n if (IsTextureInput(channel)) {\n // Validate source channel\n if (channel.sourceChannel < 0 || channel.sourceChannel > 3) {\n throw new Error(\"Source channel must be between 0 and 3 (R, G, B, A)\");\n }\n\n // Find or add texture to inputs\n let textureIndex = textureInputs.indexOf(channel.texture);\n if (textureIndex === -1) {\n textureIndex = textureInputs.length;\n textureInputs.push(channel.texture);\n }\n textureInputMap[channelIndex] = textureIndex;\n } else if (IsConstantInput(channel)) {\n // Validate constant value\n if (channel.value < 0 || channel.value > 1) {\n throw new Error(\"Constant value must be between 0.0 and 1.0\");\n }\n textureInputMap[channelIndex] = -1;\n } else {\n throw new Error(\"Invalid channel input configuration\");\n }\n } else {\n textureInputMap[channelIndex] = -1;\n }\n }\n\n // Determine output size\n let outputSize = config.outputSize;\n if (!outputSize && textureInputs.length > 0) {\n // Use the largest texture size\n let maxSize = 0;\n for (const texture of textureInputs) {\n const size = texture.getSize();\n const currentSize = Math.max(size.width, size.height);\n if (currentSize > maxSize) {\n maxSize = currentSize;\n outputSize = size.width === size.height ? maxSize : size;\n }\n }\n }\n outputSize = outputSize || 512; // Fallback size\n\n // Generate shader defines\n const defines: string[] = [];\n const usedTextures = new Set<number>();\n\n for (let channelIndex = 0; channelIndex < 4; channelIndex++) {\n const channel = channels[channelIndex];\n const channelName = [\"RED\", \"GREEN\", \"BLUE\", \"ALPHA\"][channelIndex];\n\n if (channel && IsTextureInput(channel)) {\n defines.push(`${channelName}_FROM_TEXTURE`);\n const textureIndex = textureInputMap[channelIndex];\n usedTextures.add(textureIndex);\n }\n }\n\n // Add texture defines for used textures\n usedTextures.forEach((textureIndex) => {\n defines.push(`USE_TEXTURE${textureIndex}`);\n });\n\n // Create the procedural texture\n const outputTextureOptions: IProceduralTextureCreationOptions = {\n type: Constants.TEXTURETYPE_HALF_FLOAT,\n format: Constants.TEXTUREFORMAT_RGBA,\n samplingMode: Constants.TEXTURE_NEAREST_SAMPLINGMODE,\n generateDepthBuffer: false,\n generateMipMaps: false,\n shaderLanguage: scene.getEngine().isWebGPU ? ShaderLanguage.WGSL : ShaderLanguage.GLSL,\n extraInitializationsAsync: async () => {\n if (scene.getEngine().isWebGPU) {\n await Promise.all([import(\"../../ShadersWGSL/textureMerger.fragment\")]);\n } else {\n await Promise.all([import(\"../../Shaders/textureMerger.fragment\")]);\n }\n },\n skipSceneRegistration: true,\n };\n const proceduralTexture = new ProceduralTexture(name, outputSize, _ShaderName, scene, outputTextureOptions);\n proceduralTexture.refreshRate = -1; // Do not auto-refresh\n\n // Set the defines\n proceduralTexture.defines = defines.length > 0 ? \"#define \" + defines.join(\"\\n#define \") + \"\\n\" : \"\";\n\n // Set up texture inputs\n for (let i = 0; i < textureInputs.length; i++) {\n CopyTextureTransform(textureInputs[i] as Texture, proceduralTexture);\n proceduralTexture.setTexture(`inputTexture${i}`, textureInputs[i]);\n }\n\n // Set up channel configuration\n for (let channelIndex = 0; channelIndex < 4; channelIndex++) {\n const channel = channels[channelIndex];\n const channelName = [\"red\", \"green\", \"blue\", \"alpha\"][channelIndex];\n\n if (channel && IsTextureInput(channel)) {\n const textureIndex = textureInputMap[channelIndex];\n proceduralTexture.setInt(`${channelName}TextureIndex`, textureIndex);\n proceduralTexture.setInt(`${channelName}SourceChannel`, channel.sourceChannel);\n } else {\n // Use constant value (either provided or default)\n let constantValue: number;\n if (channel && IsConstantInput(channel)) {\n constantValue = channel.value;\n } else {\n // Use default values: 0 for RGB, 1 for alpha\n constantValue = channelIndex === 3 ? 1.0 : 0.0;\n }\n proceduralTexture.setFloat(`${channelName}ConstantValue`, constantValue);\n }\n }\n\n return await new Promise<ProceduralTexture>((resolve, reject) => {\n // Compile and render\n proceduralTexture.executeWhenReady(() => {\n try {\n proceduralTexture.render();\n resolve(proceduralTexture);\n } catch (error) {\n reject(error instanceof Error ? error : new Error(String(error)));\n }\n });\n });\n}\n\n/**\n * @internal\n * Create a texture input configuration\n * @param texture The texture to read from\n * @param sourceChannel The channel to read (0=R, 1=G, 2=B, 3=A)\n * @returns Texture channel input configuration\n */\nexport function CreateTextureInput(texture: BaseTexture, sourceChannel: number): ITextureChannelInput {\n return { texture, sourceChannel };\n}\n\n/**\n * @internal\n * Create a constant value input configuration\n * @param value The constant value (0.0-1.0)\n * @returns Constant channel input configuration\n */\nexport function CreateConstantInput(value: number): IConstantChannelInput {\n return { value };\n}\n\n/**\n * @internal\n * Create a simple RGBA channel packing configuration\n * @param red Input for red channel\n * @param green Input for green channel (optional, defaults to 0)\n * @param blue Input for blue channel (optional, defaults to 0)\n * @param alpha Input for alpha channel (optional, defaults to 1)\n * @returns Texture merge configuration\n */\nexport function CreateRGBAConfiguration(red: ChannelInput, green?: ChannelInput, blue?: ChannelInput, alpha?: ChannelInput): ITextureMergeConfiguration {\n return { red, green, blue, alpha };\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  import { type Scene } from "../../scene.js";
2
2
  import { type BaseTexture } from "./baseTexture.js";
3
3
  import { type Nullable } from "../../types.js";
4
- import { Color4 } from "../../Maths/math.color.js";
4
+ import { Color4 } from "../../Maths/math.color.pure.js";
5
5
  /**
6
6
  * Specifies the color space of a texture operand.
7
7
  * When `sRGB` is set the sampled RGB values are converted to linear space before any channel
@@ -1,6 +1,6 @@
1
- import { ProceduralTexture } from "./Procedurals/proceduralTexture.js";
1
+ import { ProceduralTexture } from "./Procedurals/proceduralTexture.pure.js";
2
2
 
3
- import { Color4 } from "../../Maths/math.color.js";
3
+ import { Color4 } from "../../Maths/math.color.pure.js";
4
4
  const _ShaderName = "textureProcessor";
5
5
  /**
6
6
  * Specifies the color space of a texture operand.
@@ -1 +1 @@
1
- {"version":3,"file":"textureProcessor.js","sourceRoot":"","sources":["../../../../../dev/core/src/Materials/Textures/textureProcessor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAMpE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,WAAW,GAAG,kBAAkB,CAAC;AAEvC;;;;GAIG;AACH,MAAM,CAAN,IAAY,iBAKX;AALD,WAAY,iBAAiB;IACzB,gFAAgF;IAChF,6DAAU,CAAA;IACV,qGAAqG;IACrG,yDAAQ,CAAA;AACZ,CAAC,EALW,iBAAiB,KAAjB,iBAAiB,QAK5B;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAN,IAAY,WAaX;AAbD,WAAY,WAAW;IACnB,gDAAgD;IAChD,uCAAO,CAAA;IACP,kDAAkD;IAClD,uCAAO,CAAA;IACP,iDAAiD;IACjD,uCAAO,CAAA;IACP,kDAAkD;IAClD,uCAAO,CAAA;IACP,yDAAyD;IACzD,2CAAS,CAAA;IACT,+DAA+D;IAC/D,8CAAU,CAAA;AACd,CAAC,EAbW,WAAW,KAAX,WAAW,QAatB;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,CAAN,IAAY,cAWX;AAXD,WAAY,cAAc;IACtB,kDAAkD;IAClD,mDAAQ,CAAA;IACR,8DAA8D;IAC9D,6CAAK,CAAA;IACL,gEAAgE;IAChE,6CAAK,CAAA;IACL,+DAA+D;IAC/D,6CAAK,CAAA;IACL,gEAAgE;IAChE,6CAAK,CAAA;AACT,CAAC,EAXW,cAAc,KAAd,cAAc,QAWzB;AA0DD;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAA8B,EAAE,OAAwB,EAAE,UA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AAK,EAAE,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;AAC7J,CAAC","sourcesContent":["import { type Scene } from \"../../scene\";\nimport { type IProceduralTextureCreationOptions } from \"core/Materials/Textures/Procedurals/proceduralTexture\";\nimport { ProceduralTexture } from \"./Procedurals/proceduralTexture\";\nimport { type BaseTexture } from \"./baseTexture\";\nimport { type Nullable } from \"../../types\";\nimport { type Texture } from \"./texture\";\nimport { type TextureSize } from \"./textureCreationOptions\";\nimport { ShaderLanguage } from \"core/Materials/shaderLanguage\";\nimport { Constants } from \"../../Engines/constants\";\nimport { Color4 } from \"core/Maths/math.color\";\n\nconst _ShaderName = \"textureProcessor\";\n\n/**\n * Specifies the color space of a texture operand.\n * When `sRGB` is set the sampled RGB values are converted to linear space before any channel\n * swizzle, factor multiplication, or arithmetic operation. Alpha is always treated as linear.\n */\nexport enum TextureColorSpace {\n /** Texture data is already in linear space (default). No conversion applied. */\n Linear = 0,\n /** Texture data is in sRGB (gamma) space. RGB channels are linearized (IEC 61966-2-1) before use. */\n SRGB = 1,\n}\n\n/**\n * Bitmask controlling which channels are written to the output texture by a processing operation.\n * Channels excluded from the mask receive a sensible default: `0.0` for RGB channels, `1.0` for alpha.\n * Use `ChannelMask.RGBA` (or omit the parameter) to pass all channels through unchanged.\n *\n * | Flag | Channels written | Excluded channels |\n * |------|-----------------|-------------------|\n * | R | red | G=0, B=0, A=1 |\n * | G | green | R=0, B=0, A=1 |\n * | B | blue | R=0, G=0, A=1 |\n * | A | alpha | R=0, G=0, B=0 |\n * | RGB | red, green, blue | A=1 |\n * | RGBA | all four | (none) |\n */\nexport enum ChannelMask {\n /** Pass only the red channel; G=0, B=0, A=1. */\n R = 0x1,\n /** Pass only the green channel; R=0, B=0, A=1. */\n G = 0x2,\n /** Pass only the blue channel; R=0, G=0, A=1. */\n B = 0x4,\n /** Pass only the alpha channel; R=0, G=0, B=0. */\n A = 0x8,\n /** Pass red, green, and blue; alpha is forced to 1.0. */\n RGB = 0x7,\n /** Pass all four channels unchanged (default — no masking). */\n RGBA = 0xf,\n}\n\n/**\n * Specifies which channel of a texture to read for an operation.\n * When a single channel is selected its scalar value is broadcast to RGB; alpha\n * is either preserved from the original sample or replicated when `A` is chosen.\n *\n * | Value | Swizzle |\n * |-------|---------|\n * | RGBA | (r, g, b, a) — no swizzle (default) |\n * | R | (r, r, r, a) |\n * | G | (g, g, g, a) |\n * | B | (b, b, b, a) |\n * | A | (a, a, a, a) |\n */\nexport enum TextureChannel {\n /** Use all four channels as sampled (default). */\n RGBA = 0,\n /** Broadcast the red channel to RGB; preserve alpha: RRRA. */\n R = 1,\n /** Broadcast the green channel to RGB; preserve alpha: GGGA. */\n G = 2,\n /** Broadcast the blue channel to RGB; preserve alpha: BBBA. */\n B = 3,\n /** Broadcast the alpha channel to all four components: AAAA. */\n A = 4,\n}\n\n/**\n * Represents an operand for a texture processing operation, or the result of one.\n *\n * As an operand, the value evaluates to a vec4 per texel:\n * - `texture` only → `sample(texture)`\n * - `factor` only → `factor` (constant)\n * - both → `sample(texture) * factor`\n *\n * As a result returned by a processing function:\n * - `texture` holds the GPU-processed output; `dispose()` releases it when no longer needed.\n * - `factor` holds a CPU-folded constant when all inputs were texture-free; no `dispose` is set.\n *\n * Results are directly usable as operands to subsequent operations. When a result with a\n * `dispose` function is passed as an operand, the next operation automatically calls `dispose`\n * after consuming it, so intermediate textures are cleaned up without manual tracking.\n *\n * At least one of `texture` or `factor` must be provided when used as an operand.\n */\nexport interface ITextureProcessOperand {\n /**\n * Texture to sample. When combined with `factor`, the sampled value is multiplied\n * component-wise by the factor. Null when the operand or result is a constant.\n */\n texture: Nullable<BaseTexture>;\n /**\n * Optional constant RGBA factor. If `texture` is also set, the sampled value is\n * multiplied by this factor. If `texture` is not set, this becomes the constant output.\n * When omitted and `texture` is set, defaults to (1, 1, 1, 1) — no scaling.\n */\n factor?: Color4;\n /**\n * Optional channel selection applied to the sampled texture value before any factor\n * multiplication. When omitted or set to `TextureChannel.RGBA`, the sample is used\n * as-is. When set to a single channel, that channel's scalar is broadcast to RGB\n * (or all four components for `TextureChannel.A`). Only meaningful when `texture` is set.\n */\n channel?: TextureChannel;\n\n /**\n * Color space of the texture data. When set to `TextureColorSpace.SRGB`, the sampled\n * RGB channels are converted from sRGB to linear space (IEC 61966-2-1) before the channel\n * swizzle, factor multiplication, and any arithmetic operation. Alpha is always linear.\n * Defaults to `TextureColorSpace.Linear` (no conversion). Only meaningful when `texture` is set.\n */\n colorSpace?: TextureColorSpace;\n\n /**\n * Disposes the texture produced by a processing operation. Only present on results\n * returned by the texture processing functions. When a result is passed as an operand\n * to the next operation in a chain, its `dispose` is called automatically after the\n * GPU pass completes. Call `dispose` explicitly on the final result when the texture\n * is no longer needed (or skip it if transferring ownership to a material).\n */\n dispose?: () => void;\n}\n\n/**\n * Create an operand from a texture alone (no constant factor scaling).\n * @param texture - The texture to sample, or null to produce an identity (1,1,1,1) constant operand\n * @param channel - Optional channel selection. When set, the sampled value is swizzled before use\n * (e.g. `TextureChannel.R` → RRRA). Defaults to `TextureChannel.RGBA` (no swizzle).\n * @param colorSpace - Optional color space. When `TextureColorSpace.SRGB`, the sampled RGB channels\n * are linearized before use. Defaults to `TextureColorSpace.Linear`.\n * @returns An operand that evaluates to the sampled texture value\n */\nexport function CreateTextureOperand(texture: Nullable<BaseTexture>, channel?: TextureChannel, colorSpace?: TextureColorSpace): ITextureProcessOperand {\n const op: ITextureProcessOperand = { texture };\n if (channel) {\n op.channel = channel;\n }\n if (colorSpace) {\n op.colorSpace = colorSpace;\n }\n return op;\n}\n\n/**\n * Create an operand from a constant RGBA factor with no texture.\n * @param factor - The constant RGBA value\n * @returns An operand that evaluates to the constant factor\n */\nexport function CreateFactorOperand(factor: Color4): ITextureProcessOperand {\n return { texture: null, factor };\n}\n\n/**\n * Create an operand from a texture multiplied by a constant RGBA factor.\n * This is the standard glTF pattern (e.g. baseColorTexture * baseColorFactor).\n * If `texture` is null, returns a factor-only operand.\n * @param texture - The texture to sample, or null to use the factor alone\n * @param factor - The constant factor to multiply by\n * @param channel - Optional channel selection. When set, the sampled value is swizzled before\n * factor multiplication (e.g. `TextureChannel.G` → GGGA, then multiplied by factor).\n * Defaults to `TextureChannel.RGBA` (no swizzle).\n * @param colorSpace - Optional color space. When `TextureColorSpace.SRGB`, the sampled RGB channels\n * are linearized before factor multiplication. Defaults to `TextureColorSpace.Linear`.\n * @returns An operand that evaluates to `sample(texture) * factor`, or `factor` if texture is null\n */\nexport function CreateTextureWithFactorOperand(texture: Nullable<BaseTexture>, factor: Color4, channel?: TextureChannel, colorSpace?: TextureColorSpace): ITextureProcessOperand {\n const op: ITextureProcessOperand = { texture, factor };\n if (channel) {\n op.channel = channel;\n }\n if (colorSpace) {\n op.colorSpace = colorSpace;\n }\n return op;\n}\n\n/**\n * @internal\n * Evaluate the effective constant Color4 of an operand.\n * When a texture-only operand omits factor, the implicit value is (1, 1, 1, 1).\n */\nfunction _EvalConstant(op: ITextureProcessOperand): Color4 {\n return op.factor ?? new Color4(1, 1, 1, 1);\n}\n\n/** @internal */\nfunction _MultiplyConstants(a: Color4, b: Color4): Color4 {\n return new Color4(a.r * b.r, a.g * b.g, a.b * b.b, a.a * b.a);\n}\n\n/** @internal */\nfunction _MaxConstants(a: Color4, b: Color4): Color4 {\n return new Color4(Math.max(a.r, b.r), Math.max(a.g, b.g), Math.max(a.b, b.b), Math.max(a.a, b.a));\n}\n\n/** @internal */\nfunction _LerpConstants(a: Color4, b: Color4, t: Color4): Color4 {\n return new Color4(a.r + (b.r - a.r) * t.r, a.g + (b.g - a.g) * t.g, a.b + (b.b - a.b) * t.b, a.a + (b.a - a.a) * t.a);\n}\n\n/**\n * @internal\n * Determine the output texture size from a list of operands, using the largest input texture.\n */\nfunction _ResolveOutputSize(operands: ITextureProcessOperand[]): TextureSize {\n let maxDim = 0;\n let result: TextureSize = 512;\n for (const op of operands) {\n if (op.texture) {\n const size = op.texture.getSize();\n const dim = Math.max(size.width, size.height);\n if (dim > maxDim) {\n maxDim = dim;\n result = size.width === size.height ? dim : size;\n }\n }\n }\n return result;\n}\n\n/**\n * @internal\n * Returns true when the texture has a non-identity UV transform (offset, scale, or rotation).\n */\nfunction _HasNonIdentityTransform(texture: BaseTexture): boolean {\n return !texture.getTextureMatrix().isIdentity();\n}\n\n/**\n * @internal\n * Returns true when every texture in the list shares the same UV transform matrix.\n * A single texture (or empty list) trivially satisfies this.\n */\nfunction _AllTransformsMatch(textures: BaseTexture[]): boolean {\n if (textures.length <= 1) {\n return true;\n }\n const ref = textures[0].getTextureMatrix();\n for (let i = 1; i < textures.length; i++) {\n if (!ref.equals(textures[i].getTextureMatrix())) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * @internal\n * Copy sampling metadata from a source texture onto the output ProceduralTexture.\n * `coordinatesIndex` and wrap modes are always copied.\n * When `includeTransform` is true the UV offset/scale/rotation are also copied\n * (used when all inputs share the same transform and it is propagated rather than baked).\n */\nfunction _CopyTextureMetadata(from: BaseTexture, to: ProceduralTexture, includeTransform: boolean): void {\n to.coordinatesIndex = from.coordinatesIndex;\n to.wrapU = from.wrapU;\n to.wrapV = from.wrapV;\n if (includeTransform) {\n const src = from as Texture;\n to.uOffset = src.uOffset ?? 0;\n to.vOffset = src.vOffset ?? 0;\n to.uScale = src.uScale ?? 1;\n to.vScale = src.vScale ?? 1;\n to.wAng = src.wAng ?? 0;\n }\n}\n\n/**\n * @internal\n * Return the shader define suffix for a TextureChannel (e.g. TextureChannel.R → \"R\").\n * Returns an empty string for RGBA (no swizzle needed).\n */\nfunction _ChannelDefine(channel: TextureChannel): string {\n switch (channel) {\n case TextureChannel.R:\n return \"R\";\n case TextureChannel.G:\n return \"G\";\n case TextureChannel.B:\n return \"B\";\n case TextureChannel.A:\n return \"A\";\n default:\n return \"\";\n }\n}\n\n/**\n * @internal\n * Apply a channel swizzle to a constant Color4, matching the GPU behaviour for TextureChannel.\n */\nfunction _ApplyChannelSwizzle(c: Color4, channel: TextureChannel): Color4 {\n switch (channel) {\n case TextureChannel.R:\n return new Color4(c.r, c.r, c.r, c.a);\n case TextureChannel.G:\n return new Color4(c.g, c.g, c.g, c.a);\n case TextureChannel.B:\n return new Color4(c.b, c.b, c.b, c.a);\n case TextureChannel.A:\n return new Color4(c.a, c.a, c.a, c.a);\n default:\n return c;\n }\n}\n\n/**\n * @internal\n * Build the OP_INVERT define plus per-channel INVERT_R/G/B/A defines from an ChannelMask bitmask.\n */\nfunction _BuildInvertDefines(channels: ChannelMask): string[] {\n const defines: string[] = [\"OP_INVERT\"];\n if (channels & ChannelMask.R) {\n defines.push(\"INVERT_R\");\n }\n if (channels & ChannelMask.G) {\n defines.push(\"INVERT_G\");\n }\n if (channels & ChannelMask.B) {\n defines.push(\"INVERT_B\");\n }\n if (channels & ChannelMask.A) {\n defines.push(\"INVERT_A\");\n }\n return defines;\n}\n\n/**\n * @internal\n * Build OUTPUT_MASK_X_ZERO / OUTPUT_MASK_A_ONE defines for excluded channels.\n * Channels present in the mask pass through; excluded channels get defaults (0.0 for RGB, 1.0 for A).\n * Returns an empty array for ChannelMask.RGBA (no masking needed).\n */\nfunction _BuildOutputChannelMaskDefines(mask: ChannelMask): string[] {\n const defines: string[] = [];\n if (!(mask & ChannelMask.R)) {\n defines.push(\"OUTPUT_MASK_R_ZERO\");\n }\n if (!(mask & ChannelMask.G)) {\n defines.push(\"OUTPUT_MASK_G_ZERO\");\n }\n if (!(mask & ChannelMask.B)) {\n defines.push(\"OUTPUT_MASK_B_ZERO\");\n }\n if (!(mask & ChannelMask.A)) {\n defines.push(\"OUTPUT_MASK_A_ONE\");\n }\n return defines;\n}\n\n/**\n * @internal\n * Apply a ChannelMask to a constant Color4: included channels pass through,\n * excluded color channels become 0, excluded alpha becomes 1.\n */\nfunction _ApplyOutputChannelMask(c: Color4, mask: ChannelMask): Color4 {\n return new Color4(mask & ChannelMask.R ? c.r : 0, mask & ChannelMask.G ? c.g : 0, mask & ChannelMask.B ? c.b : 0, mask & ChannelMask.A ? c.a : 1);\n}\n\n/**\n * @internal\n * Build shader defines for a standard A/B operand.\n * When `bakeTransform` is true and the texture has a non-identity UV transform,\n * the OPERAND_X_MATRIX define is emitted so the shader applies the matrix when sampling.\n */\nfunction _BuildOperandDefines(operand: ITextureProcessOperand, prefix: \"A\" | \"B\", bakeTransform: boolean): string[] {\n const defines: string[] = [];\n if (operand.texture) {\n defines.push(`OPERAND_${prefix}_TEXTURE`);\n if (bakeTransform && _HasNonIdentityTransform(operand.texture)) {\n defines.push(`OPERAND_${prefix}_MATRIX`);\n }\n if (operand.colorSpace) {\n defines.push(`OPERAND_${prefix}_SRGB`);\n }\n if (operand.channel) {\n defines.push(`OPERAND_${prefix}_CHANNEL_${_ChannelDefine(operand.channel)}`);\n }\n }\n if (operand.factor !== undefined || !operand.texture) {\n defines.push(`OPERAND_${prefix}_FACTOR`);\n }\n return defines;\n}\n\n/**\n * @internal\n * Build shader defines for the lerp blend operand.\n * When `bakeTransform` is true and the texture has a non-identity UV transform,\n * the LERP_T_MATRIX define is emitted.\n */\nfunction _BuildLerpBlendDefines(t: ITextureProcessOperand, bakeTransform: boolean): string[] {\n const defines: string[] = [];\n if (t.texture) {\n defines.push(\"LERP_T_TEXTURE\");\n if (bakeTransform && _HasNonIdentityTransform(t.texture)) {\n defines.push(\"LERP_T_MATRIX\");\n }\n if (t.factor !== undefined) {\n defines.push(\"LERP_T_FACTOR\");\n }\n if (t.colorSpace) {\n defines.push(\"LERP_T_SRGB\");\n }\n if (t.channel) {\n defines.push(`LERP_T_CHANNEL_${_ChannelDefine(t.channel)}`);\n }\n }\n // factor-only: no additional defines needed; the shader uses factorT when LERP_T_TEXTURE is absent.\n return defines;\n}\n\n/**\n * @internal\n * Set uniforms and textures for a standard A/B operand on a procedural texture.\n * When `bakeTransform` is true and the texture has a non-identity UV matrix,\n * that matrix is uploaded as `<textureName>Matrix` for the shader to apply when sampling.\n */\nfunction _SetOperandUniforms(pt: ProceduralTexture, operand: ITextureProcessOperand, textureName: string, factorName: string, bakeTransform: boolean): void {\n if (operand.texture) {\n pt.setTexture(textureName, operand.texture as Texture);\n if (bakeTransform && _HasNonIdentityTransform(operand.texture)) {\n pt.setMatrix(`${textureName}Matrix`, operand.texture.getTextureMatrix());\n }\n }\n const needsFactor = operand.factor !== undefined || !operand.texture;\n if (needsFactor) {\n pt.setColor4(factorName, _EvalConstant(operand));\n }\n}\n\n/**\n * @internal\n * Set uniforms and textures for the lerp blend operand.\n * When `bakeTransform` is true and the texture has a non-identity UV matrix,\n * that matrix is uploaded as `textureTMatrix`.\n */\nfunction _SetLerpBlendUniforms(pt: ProceduralTexture, t: ITextureProcessOperand, bakeTransform: boolean): void {\n if (t.texture) {\n pt.setTexture(\"textureT\", t.texture as Texture);\n if (bakeTransform && _HasNonIdentityTransform(t.texture)) {\n pt.setMatrix(\"textureTMatrix\", t.texture.getTextureMatrix());\n }\n if (t.factor !== undefined) {\n pt.setColor4(\"factorT\", t.factor);\n }\n } else {\n pt.setColor4(\"factorT\", _EvalConstant(t));\n }\n}\n\n/**\n * @internal\n * Create a textureProcessor procedural texture with the given defines. The returned texture\n * is not yet rendered — uniforms must be set on it before calling _RenderAsync.\n */\nfunction _CreateProcessorTexture(\n name: string,\n defines: string[],\n outputSize: TextureSize,\n scene: Scene,\n outputColorSpace: TextureColorSpace = TextureColorSpace.Linear\n): ProceduralTexture {\n const options: IProceduralTextureCreationOptions = {\n type: Constants.TEXTURETYPE_UNSIGNED_BYTE,\n format: Constants.TEXTUREFORMAT_RGBA,\n samplingMode: Constants.TEXTURE_BILINEAR_SAMPLINGMODE,\n generateDepthBuffer: false,\n generateMipMaps: false,\n gammaSpace: outputColorSpace === TextureColorSpace.SRGB,\n shaderLanguage: scene.getEngine().isWebGPU ? ShaderLanguage.WGSL : ShaderLanguage.GLSL,\n extraInitializationsAsync: async () => {\n if (scene.getEngine().isWebGPU) {\n await Promise.all([import(\"../../ShadersWGSL/textureProcessor.fragment\")]);\n } else {\n await Promise.all([import(\"../../Shaders/textureProcessor.fragment\")]);\n }\n },\n // Opt out of scene-managed rendering. _shouldRender() would re-render the texture\n // on the first scene frame regardless of refreshRate (because _currentRefreshId starts\n // at -1 and is only advanced by _shouldRender() itself, not by a direct render() call).\n // That re-render would sample already-disposed input textures, producing blank output.\n skipSceneRegistration: true,\n };\n\n const pt = new ProceduralTexture(name, outputSize, _ShaderName, scene, options);\n pt.refreshRate = -1; // render on demand only\n pt.defines = defines.length > 0 ? \"#define \" + defines.join(\"\\n#define \") + \"\\n\" : \"\";\n return pt;\n}\n\n/**\n * @internal\n * Wait for a procedural texture's shader to compile then render it. Uniforms must be set\n * on the texture before calling this.\n */\nasync function _RenderAsync(pt: ProceduralTexture): Promise<void> {\n return await new Promise<void>((resolve, reject) => {\n pt.executeWhenReady(() => {\n try {\n pt.render();\n resolve();\n } catch (error) {\n reject(error instanceof Error ? error : new Error(String(error)));\n }\n });\n });\n}\n\n/**\n * Multiply two texture operands together, component-wise: `result = a * b`.\n *\n * Each operand can be a texture, a constant factor, or a texture scaled by a factor.\n * This is useful for applying glTF-style factors to textures (e.g. `baseColorTexture * baseColorFactor`),\n * or for modulating one texture by another.\n *\n * If both operands are constant (no textures), the multiplication is performed on the CPU and\n * the result is returned as a factor-only operand with no texture allocated.\n *\n * When operands are results of previous operations (i.e. they carry a `dispose` function),\n * their intermediate textures are automatically released after the GPU pass completes.\n *\n * @param name - Name for the resulting procedural texture (used only when a GPU pass is needed)\n * @param a - First operand\n * @param b - Second operand\n * @param scene - Scene to create the texture in (used only when a GPU pass is needed)\n * @param outputColorSpace - Optional output color space. When `TextureColorSpace.SRGB`, the linear\n * result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to `TextureColorSpace.Linear`.\n * @param outputChannelMask - Optional bitmask of channels to write. Excluded color channels are set to\n * `0.0`; excluded alpha is set to `1.0`. Defaults to `ChannelMask.RGBA` (all channels written).\n * @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant\n */\nexport async function MultiplyTexturesAsync(\n name: string,\n a: ITextureProcessOperand,\n b: ITextureProcessOperand,\n scene: Scene,\n outputColorSpace?: TextureColorSpace,\n outputChannelMask?: ChannelMask\n): Promise<ITextureProcessOperand> {\n if (!a.texture && !b.texture) {\n const factor = _MultiplyConstants(_EvalConstant(a), _EvalConstant(b));\n return { texture: null, factor: outputChannelMask ? _ApplyOutputChannelMask(factor, outputChannelMask) : factor };\n }\n\n const allTextures: BaseTexture[] = [];\n if (a.texture) {\n allTextures.push(a.texture);\n }\n if (b.texture) {\n allTextures.push(b.texture);\n }\n const canPropagate = _AllTransformsMatch(allTextures);\n const bakeTransform = !canPropagate;\n\n const defines = [\n ..._BuildOperandDefines(a, \"A\", bakeTransform),\n ..._BuildOperandDefines(b, \"B\", bakeTransform),\n ...(outputChannelMask ? _BuildOutputChannelMaskDefines(outputChannelMask) : []),\n ];\n if (outputColorSpace) {\n defines.push(\"OUTPUT_SRGB\");\n }\n const pt = _CreateProcessorTexture(name, defines, _ResolveOutputSize([a, b]), scene, outputColorSpace);\n _SetOperandUniforms(pt, a, \"textureA\", \"factorA\", bakeTransform);\n _SetOperandUniforms(pt, b, \"textureB\", \"factorB\", bakeTransform);\n try {\n await _RenderAsync(pt);\n } catch (error) {\n a.dispose?.();\n b.dispose?.();\n throw error;\n }\n\n a.dispose?.();\n b.dispose?.();\n\n _CopyTextureMetadata(allTextures[0], pt, canPropagate);\n const result: ITextureProcessOperand = { texture: pt, dispose: () => pt.dispose() };\n if (outputColorSpace) {\n result.colorSpace = outputColorSpace;\n }\n return result;\n}\n\n/**\n * Take the component-wise maximum of two texture operands: `result = max(a, b)`.\n *\n * Each operand can be a texture, a constant factor, or a texture scaled by a factor.\n * Useful for operations such as combining ambient occlusion maps or taking the\n * brightest contribution from two sources.\n *\n * If both operands are constant (no textures), the operation is performed on the CPU and\n * the result is returned as a factor-only operand with no texture allocated.\n *\n * When operands are results of previous operations (i.e. they carry a `dispose` function),\n * their intermediate textures are automatically released after the GPU pass completes.\n *\n * @param name - Name for the resulting procedural texture (used only when a GPU pass is needed)\n * @param a - First operand\n * @param b - Second operand\n * @param scene - Scene to create the texture in (used only when a GPU pass is needed)\n * @param outputColorSpace - Optional output color space. When `TextureColorSpace.SRGB`, the linear\n * result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to `TextureColorSpace.Linear`.\n * @param outputChannelMask - Optional bitmask of channels to write. Excluded color channels are set to\n * `0.0`; excluded alpha is set to `1.0`. Defaults to `ChannelMask.RGBA` (all channels written).\n * @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant\n */\nexport async function MaxTexturesAsync(\n name: string,\n a: ITextureProcessOperand,\n b: ITextureProcessOperand,\n scene: Scene,\n outputColorSpace?: TextureColorSpace,\n outputChannelMask?: ChannelMask\n): Promise<ITextureProcessOperand> {\n if (!a.texture && !b.texture) {\n const factor = _MaxConstants(_EvalConstant(a), _EvalConstant(b));\n return { texture: null, factor: outputChannelMask ? _ApplyOutputChannelMask(factor, outputChannelMask) : factor };\n }\n\n const allTextures: BaseTexture[] = [];\n if (a.texture) {\n allTextures.push(a.texture);\n }\n if (b.texture) {\n allTextures.push(b.texture);\n }\n const canPropagate = _AllTransformsMatch(allTextures);\n const bakeTransform = !canPropagate;\n\n const defines = [\n \"OP_MAX\",\n ..._BuildOperandDefines(a, \"A\", bakeTransform),\n ..._BuildOperandDefines(b, \"B\", bakeTransform),\n ...(outputChannelMask ? _BuildOutputChannelMaskDefines(outputChannelMask) : []),\n ];\n if (outputColorSpace) {\n defines.push(\"OUTPUT_SRGB\");\n }\n const pt = _CreateProcessorTexture(name, defines, _ResolveOutputSize([a, b]), scene, outputColorSpace);\n _SetOperandUniforms(pt, a, \"textureA\", \"factorA\", bakeTransform);\n _SetOperandUniforms(pt, b, \"textureB\", \"factorB\", bakeTransform);\n try {\n await _RenderAsync(pt);\n } catch (error) {\n a.dispose?.();\n b.dispose?.();\n throw error;\n }\n\n a.dispose?.();\n b.dispose?.();\n\n _CopyTextureMetadata(allTextures[0], pt, canPropagate);\n const result: ITextureProcessOperand = { texture: pt, dispose: () => pt.dispose() };\n if (outputColorSpace) {\n result.colorSpace = outputColorSpace;\n }\n return result;\n}\n\n/**\n * Linearly interpolate between two texture operands: `result = mix(a, b, t)`.\n *\n * Each operand can be a texture, a constant factor, or a texture scaled by a factor.\n * The `t` operand controls the blend weight per texel, per channel — a value of 0 returns `a`,\n * a value of 1 returns `b`. Use a grayscale texture or a scalar `Color4(v, v, v, v)` for\n * uniform blending across all channels.\n *\n * If all three operands are constant (no textures), the interpolation is performed on the CPU and\n * the result is returned as a factor-only operand with no texture allocated.\n *\n * When operands are results of previous operations (i.e. they carry a `dispose` function),\n * their intermediate textures are automatically released after the GPU pass completes.\n *\n * @param name - Name for the resulting procedural texture (used only when a GPU pass is needed)\n * @param a - Start value operand (returned when t = 0)\n * @param b - End value operand (returned when t = 1)\n * @param t - Blend weight operand. Each channel independently controls the blend for the corresponding output channel.\n * @param scene - Scene to create the texture in (used only when a GPU pass is needed)\n * @param outputColorSpace - Optional output color space. When `TextureColorSpace.SRGB`, the linear\n * result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to `TextureColorSpace.Linear`.\n * @param outputChannelMask - Optional bitmask of channels to write. Excluded color channels are set to\n * `0.0`; excluded alpha is set to `1.0`. Defaults to `ChannelMask.RGBA` (all channels written).\n * @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant\n */\nexport async function LerpTexturesAsync(\n name: string,\n a: ITextureProcessOperand,\n b: ITextureProcessOperand,\n t: ITextureProcessOperand,\n scene: Scene,\n outputColorSpace?: TextureColorSpace,\n outputChannelMask?: ChannelMask\n): Promise<ITextureProcessOperand> {\n if (!a.texture && !b.texture && !t.texture) {\n const factor = _LerpConstants(_EvalConstant(a), _EvalConstant(b), _EvalConstant(t));\n return { texture: null, factor: outputChannelMask ? _ApplyOutputChannelMask(factor, outputChannelMask) : factor };\n }\n\n const allTextures: BaseTexture[] = [];\n if (a.texture) {\n allTextures.push(a.texture);\n }\n if (b.texture) {\n allTextures.push(b.texture);\n }\n if (t.texture) {\n allTextures.push(t.texture);\n }\n const canPropagate = _AllTransformsMatch(allTextures);\n const bakeTransform = !canPropagate;\n\n const defines = [\n \"OP_LERP\",\n ..._BuildOperandDefines(a, \"A\", bakeTransform),\n ..._BuildOperandDefines(b, \"B\", bakeTransform),\n ..._BuildLerpBlendDefines(t, bakeTransform),\n ...(outputChannelMask ? _BuildOutputChannelMaskDefines(outputChannelMask) : []),\n ];\n if (outputColorSpace) {\n defines.push(\"OUTPUT_SRGB\");\n }\n const pt = _CreateProcessorTexture(name, defines, _ResolveOutputSize([a, b, t]), scene, outputColorSpace);\n _SetOperandUniforms(pt, a, \"textureA\", \"factorA\", bakeTransform);\n _SetOperandUniforms(pt, b, \"textureB\", \"factorB\", bakeTransform);\n _SetLerpBlendUniforms(pt, t, bakeTransform);\n try {\n await _RenderAsync(pt);\n } catch (error) {\n a.dispose?.();\n b.dispose?.();\n t.dispose?.();\n throw error;\n }\n\n a.dispose?.();\n b.dispose?.();\n t.dispose?.();\n\n _CopyTextureMetadata(allTextures[0], pt, canPropagate);\n const result: ITextureProcessOperand = { texture: pt, dispose: () => pt.dispose() };\n if (outputColorSpace) {\n result.colorSpace = outputColorSpace;\n }\n return result;\n}\n\n/**\n * Invert selected channels of a texture operand: `result[ch] = 1 - input[ch]`.\n *\n * The `channels` bitmask selects which channels are inverted; unselected channels pass through\n * unchanged. Use `ChannelMask.RGB` for the common roughness↔smoothness conversion, or\n * `ChannelMask.RGBA` (the default) to invert the entire texture.\n *\n * This is a unary operation — only operand A is used. Any `colorSpace` or `channel` properties\n * on the input operand are honoured (sRGB linearization and channel swizzle applied before\n * the invert).\n *\n * If the input is constant (no texture), the invert is performed on the CPU.\n *\n * When the input is the result of a previous operation (i.e. it carries a `dispose` function),\n * its intermediate texture is automatically released after the GPU pass completes.\n *\n * @param name - Name for the resulting procedural texture (used only when a GPU pass is needed)\n * @param input - Operand to invert\n * @param scene - Scene to create the texture in (used only when a GPU pass is needed)\n * @param channels - Bitmask of channels to invert. Defaults to `ChannelMask.RGBA`.\n * @param outputColorSpace - Optional output color space. When `TextureColorSpace.SRGB`, the linear\n * result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to `TextureColorSpace.Linear`.\n * @param outputChannelMask - Optional bitmask of channels to write. Excluded color channels are set to\n * `0.0`; excluded alpha is set to `1.0`. Defaults to `ChannelMask.RGBA` (all channels written).\n * @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant\n */\nexport async function InvertTextureAsync(\n name: string,\n input: ITextureProcessOperand,\n scene: Scene,\n channels: ChannelMask = ChannelMask.RGBA,\n outputColorSpace?: TextureColorSpace,\n outputChannelMask?: ChannelMask\n): Promise<ITextureProcessOperand> {\n if (!input.texture) {\n const c = _EvalConstant(input);\n const factor = new Color4(\n channels & ChannelMask.R ? 1 - c.r : c.r,\n channels & ChannelMask.G ? 1 - c.g : c.g,\n channels & ChannelMask.B ? 1 - c.b : c.b,\n channels & ChannelMask.A ? 1 - c.a : c.a\n );\n return { texture: null, factor: outputChannelMask ? _ApplyOutputChannelMask(factor, outputChannelMask) : factor };\n }\n\n // Single input: UV transform is always propagated (no bake needed).\n const defines = [..._BuildOperandDefines(input, \"A\", false), ..._BuildInvertDefines(channels), ...(outputChannelMask ? _BuildOutputChannelMaskDefines(outputChannelMask) : [])];\n if (outputColorSpace) {\n defines.push(\"OUTPUT_SRGB\");\n }\n const pt = _CreateProcessorTexture(name, defines, _ResolveOutputSize([input]), scene, outputColorSpace);\n _SetOperandUniforms(pt, input, \"textureA\", \"factorA\", false);\n try {\n await _RenderAsync(pt);\n } catch (error) {\n input.dispose?.();\n throw error;\n }\n\n input.dispose?.();\n\n _CopyTextureMetadata(input.texture, pt, true);\n const result: ITextureProcessOperand = { texture: pt, dispose: () => pt.dispose() };\n if (outputColorSpace) {\n result.colorSpace = outputColorSpace;\n }\n return result;\n}\n\n/**\n * Extract the per-texel maximum channel value from a texture and broadcast it to all output\n * channels, producing a single-value (greyscale) texture in a single GPU pass.\n *\n * For each texel, computes `max(r, g, b)` — or `max(r, g, b, a)` when `includeAlpha` is true —\n * and writes that scalar to the output:\n * - `includeAlpha = false` (default): output is `(m, m, m, a)` where `m = max(r, g, b)`\n * - `includeAlpha = true`: output is `(m, m, m, m)` where `m = max(r, g, b, a)`\n *\n * This is more efficient than chaining `ExtractChannelAsync` calls through `MaxTexturesAsync`,\n * which would require multiple intermediate textures and GPU passes.\n *\n * Any `colorSpace` or `channel` properties on the input operand are honoured (sRGB linearization\n * and channel swizzle applied before the max reduction).\n *\n * If the input is constant (no texture), the reduction is performed on the CPU.\n *\n * When the input is the result of a previous operation (i.e. it carries a `dispose` function),\n * its intermediate texture is automatically released after the GPU pass completes.\n *\n * @param name - Name for the resulting procedural texture (used only when a GPU pass is needed)\n * @param input - Operand to reduce\n * @param scene - Scene to create the texture in (used only when a GPU pass is needed)\n * @param includeAlpha - When true, alpha participates in the max and is also set to the result.\n * Defaults to false (alpha is preserved from the input).\n * @param outputColorSpace - Optional output color space. When `TextureColorSpace.SRGB`, the linear\n * result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to `TextureColorSpace.Linear`.\n * @param outputChannelMask - Optional bitmask of channels to write. Excluded color channels are set to\n * `0.0`; excluded alpha is set to `1.0`. Defaults to `ChannelMask.RGBA` (all channels written).\n * @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant\n */\nexport async function ExtractMaxChannelAsync(\n name: string,\n input: ITextureProcessOperand,\n scene: Scene,\n includeAlpha: boolean = false,\n outputColorSpace?: TextureColorSpace,\n outputChannelMask?: ChannelMask\n): Promise<ITextureProcessOperand> {\n if (!input.texture) {\n const c = _EvalConstant(input);\n const m = includeAlpha ? Math.max(c.r, c.g, c.b, c.a) : Math.max(c.r, c.g, c.b);\n const factor = new Color4(m, m, m, includeAlpha ? m : c.a);\n return { texture: null, factor: outputChannelMask ? _ApplyOutputChannelMask(factor, outputChannelMask) : factor };\n }\n\n // Single input: UV transform is always propagated (no bake needed).\n const defines = [..._BuildOperandDefines(input, \"A\", false), \"OP_CHANNEL_MAX\", ...(outputChannelMask ? _BuildOutputChannelMaskDefines(outputChannelMask) : [])];\n if (includeAlpha) {\n defines.push(\"CHANNEL_MAX_INCLUDE_ALPHA\");\n }\n if (outputColorSpace) {\n defines.push(\"OUTPUT_SRGB\");\n }\n const pt = _CreateProcessorTexture(name, defines, _ResolveOutputSize([input]), scene, outputColorSpace);\n _SetOperandUniforms(pt, input, \"textureA\", \"factorA\", false);\n try {\n await _RenderAsync(pt);\n } catch (error) {\n input.dispose?.();\n throw error;\n }\n\n input.dispose?.();\n\n _CopyTextureMetadata(input.texture, pt, true);\n const result: ITextureProcessOperand = { texture: pt, dispose: () => pt.dispose() };\n if (outputColorSpace) {\n result.colorSpace = outputColorSpace;\n }\n return result;\n}\n\n/**\n * Extract a single channel from a texture and broadcast it to RGB (or all four components for\n * `TextureChannel.A`), producing a new texture. This is a convenience wrapper over\n * `MultiplyTexturesAsync` with a `(1,1,1,1)` factor and the requested channel swizzle applied\n * to the input.\n *\n * Swizzle results per channel:\n * - `TextureChannel.R` → (r, r, r, a)\n * - `TextureChannel.G` → (g, g, g, a)\n * - `TextureChannel.B` → (b, b, b, a)\n * - `TextureChannel.A` → (a, a, a, a)\n *\n * If the input is constant (no texture), the swizzle is applied on the CPU.\n *\n * Any `colorSpace` property on the input operand is honoured (sRGB linearization applied before\n * the swizzle). Any existing `channel` on the input is replaced by the `channel` argument.\n *\n * When the input is the result of a previous operation (i.e. it carries a `dispose` function),\n * its intermediate texture is automatically released after the GPU pass completes.\n *\n * @param name - Name for the resulting procedural texture (used only when a GPU pass is needed)\n * @param input - Operand to extract the channel from\n * @param channel - The channel to extract and broadcast\n * @param scene - Scene to create the texture in (used only when a GPU pass is needed)\n * @param outputColorSpace - Optional output color space. When `TextureColorSpace.SRGB`, the linear\n * result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to `TextureColorSpace.Linear`.\n * @param outputChannelMask - Optional bitmask of channels to write. Excluded color channels are set to\n * `0.0`; excluded alpha is set to `1.0`. Defaults to `ChannelMask.RGBA` (all channels written).\n * @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant\n */\nexport async function ExtractChannelAsync(\n name: string,\n input: ITextureProcessOperand,\n channel: TextureChannel,\n scene: Scene,\n outputColorSpace?: TextureColorSpace,\n outputChannelMask?: ChannelMask\n): Promise<ITextureProcessOperand> {\n if (!input.texture) {\n const swizzled = _ApplyChannelSwizzle(_EvalConstant(input), channel);\n return { texture: null, factor: outputChannelMask ? _ApplyOutputChannelMask(swizzled, outputChannelMask) : swizzled };\n }\n return await MultiplyTexturesAsync(name, { ...input, channel }, CreateFactorOperand(new Color4(1, 1, 1, 1)), scene, outputColorSpace, outputChannelMask);\n}\n"]}
1
+ {"version":3,"file":"textureProcessor.js","sourceRoot":"","sources":["../../../../../dev/core/src/Materials/Textures/textureProcessor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAMzE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD,MAAM,WAAW,GAAG,kBAAkB,CAAC;AAEvC;;;;GAIG;AACH,MAAM,CAAN,IAAY,iBAKX;AALD,WAAY,iBAAiB;IACzB,gFAAgF;IAChF,6DAAU,CAAA;IACV,qGAAqG;IACrG,yDAAQ,CAAA;AACZ,CAAC,EALW,iBAAiB,KAAjB,iBAAiB,QAK5B;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAN,IAAY,WAaX;AAbD,WAAY,WAAW;IACnB,gDAAgD;IAChD,uCAAO,CAAA;IACP,kDAAkD;IAClD,uCAAO,CAAA;IACP,iDAAiD;IACjD,uCAAO,CAAA;IACP,kDAAkD;IAClD,uCAAO,CAAA;IACP,yDAAyD;IACzD,2CAAS,CAAA;IACT,+DAA+D;IAC/D,8C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BAAoB,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;QACrE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC,uBAAuB,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC1H,CAAC;IACD,OAAO,MAAM,qBAAqB,CAAC,IAAI,EAAE,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,EAAE,mBAAmB,CAAC,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;AAC7J,CAAC","sourcesContent":["import { type Scene } from \"../../scene\";\nimport { type IProceduralTextureCreationOptions } from \"core/Materials/Textures/Procedurals/proceduralTexture\";\nimport { ProceduralTexture } from \"./Procedurals/proceduralTexture.pure\";\nimport { type BaseTexture } from \"./baseTexture\";\nimport { type Nullable } from \"../../types\";\nimport { type Texture } from \"./texture\";\nimport { type TextureSize } from \"./textureCreationOptions\";\nimport { ShaderLanguage } from \"core/Materials/shaderLanguage\";\nimport { Constants } from \"../../Engines/constants\";\nimport { Color4 } from \"core/Maths/math.color.pure\";\n\nconst _ShaderName = \"textureProcessor\";\n\n/**\n * Specifies the color space of a texture operand.\n * When `sRGB` is set the sampled RGB values are converted to linear space before any channel\n * swizzle, factor multiplication, or arithmetic operation. Alpha is always treated as linear.\n */\nexport enum TextureColorSpace {\n /** Texture data is already in linear space (default). No conversion applied. */\n Linear = 0,\n /** Texture data is in sRGB (gamma) space. RGB channels are linearized (IEC 61966-2-1) before use. */\n SRGB = 1,\n}\n\n/**\n * Bitmask controlling which channels are written to the output texture by a processing operation.\n * Channels excluded from the mask receive a sensible default: `0.0` for RGB channels, `1.0` for alpha.\n * Use `ChannelMask.RGBA` (or omit the parameter) to pass all channels through unchanged.\n *\n * | Flag | Channels written | Excluded channels |\n * |------|-----------------|-------------------|\n * | R | red | G=0, B=0, A=1 |\n * | G | green | R=0, B=0, A=1 |\n * | B | blue | R=0, G=0, A=1 |\n * | A | alpha | R=0, G=0, B=0 |\n * | RGB | red, green, blue | A=1 |\n * | RGBA | all four | (none) |\n */\nexport enum ChannelMask {\n /** Pass only the red channel; G=0, B=0, A=1. */\n R = 0x1,\n /** Pass only the green channel; R=0, B=0, A=1. */\n G = 0x2,\n /** Pass only the blue channel; R=0, G=0, A=1. */\n B = 0x4,\n /** Pass only the alpha channel; R=0, G=0, B=0. */\n A = 0x8,\n /** Pass red, green, and blue; alpha is forced to 1.0. */\n RGB = 0x7,\n /** Pass all four channels unchanged (default — no masking). */\n RGBA = 0xf,\n}\n\n/**\n * Specifies which channel of a texture to read for an operation.\n * When a single channel is selected its scalar value is broadcast to RGB; alpha\n * is either preserved from the original sample or replicated when `A` is chosen.\n *\n * | Value | Swizzle |\n * |-------|---------|\n * | RGBA | (r, g, b, a) — no swizzle (default) |\n * | R | (r, r, r, a) |\n * | G | (g, g, g, a) |\n * | B | (b, b, b, a) |\n * | A | (a, a, a, a) |\n */\nexport enum TextureChannel {\n /** Use all four channels as sampled (default). */\n RGBA = 0,\n /** Broadcast the red channel to RGB; preserve alpha: RRRA. */\n R = 1,\n /** Broadcast the green channel to RGB; preserve alpha: GGGA. */\n G = 2,\n /** Broadcast the blue channel to RGB; preserve alpha: BBBA. */\n B = 3,\n /** Broadcast the alpha channel to all four components: AAAA. */\n A = 4,\n}\n\n/**\n * Represents an operand for a texture processing operation, or the result of one.\n *\n * As an operand, the value evaluates to a vec4 per texel:\n * - `texture` only → `sample(texture)`\n * - `factor` only → `factor` (constant)\n * - both → `sample(texture) * factor`\n *\n * As a result returned by a processing function:\n * - `texture` holds the GPU-processed output; `dispose()` releases it when no longer needed.\n * - `factor` holds a CPU-folded constant when all inputs were texture-free; no `dispose` is set.\n *\n * Results are directly usable as operands to subsequent operations. When a result with a\n * `dispose` function is passed as an operand, the next operation automatically calls `dispose`\n * after consuming it, so intermediate textures are cleaned up without manual tracking.\n *\n * At least one of `texture` or `factor` must be provided when used as an operand.\n */\nexport interface ITextureProcessOperand {\n /**\n * Texture to sample. When combined with `factor`, the sampled value is multiplied\n * component-wise by the factor. Null when the operand or result is a constant.\n */\n texture: Nullable<BaseTexture>;\n /**\n * Optional constant RGBA factor. If `texture` is also set, the sampled value is\n * multiplied by this factor. If `texture` is not set, this becomes the constant output.\n * When omitted and `texture` is set, defaults to (1, 1, 1, 1) — no scaling.\n */\n factor?: Color4;\n /**\n * Optional channel selection applied to the sampled texture value before any factor\n * multiplication. When omitted or set to `TextureChannel.RGBA`, the sample is used\n * as-is. When set to a single channel, that channel's scalar is broadcast to RGB\n * (or all four components for `TextureChannel.A`). Only meaningful when `texture` is set.\n */\n channel?: TextureChannel;\n\n /**\n * Color space of the texture data. When set to `TextureColorSpace.SRGB`, the sampled\n * RGB channels are converted from sRGB to linear space (IEC 61966-2-1) before the channel\n * swizzle, factor multiplication, and any arithmetic operation. Alpha is always linear.\n * Defaults to `TextureColorSpace.Linear` (no conversion). Only meaningful when `texture` is set.\n */\n colorSpace?: TextureColorSpace;\n\n /**\n * Disposes the texture produced by a processing operation. Only present on results\n * returned by the texture processing functions. When a result is passed as an operand\n * to the next operation in a chain, its `dispose` is called automatically after the\n * GPU pass completes. Call `dispose` explicitly on the final result when the texture\n * is no longer needed (or skip it if transferring ownership to a material).\n */\n dispose?: () => void;\n}\n\n/**\n * Create an operand from a texture alone (no constant factor scaling).\n * @param texture - The texture to sample, or null to produce an identity (1,1,1,1) constant operand\n * @param channel - Optional channel selection. When set, the sampled value is swizzled before use\n * (e.g. `TextureChannel.R` → RRRA). Defaults to `TextureChannel.RGBA` (no swizzle).\n * @param colorSpace - Optional color space. When `TextureColorSpace.SRGB`, the sampled RGB channels\n * are linearized before use. Defaults to `TextureColorSpace.Linear`.\n * @returns An operand that evaluates to the sampled texture value\n */\nexport function CreateTextureOperand(texture: Nullable<BaseTexture>, channel?: TextureChannel, colorSpace?: TextureColorSpace): ITextureProcessOperand {\n const op: ITextureProcessOperand = { texture };\n if (channel) {\n op.channel = channel;\n }\n if (colorSpace) {\n op.colorSpace = colorSpace;\n }\n return op;\n}\n\n/**\n * Create an operand from a constant RGBA factor with no texture.\n * @param factor - The constant RGBA value\n * @returns An operand that evaluates to the constant factor\n */\nexport function CreateFactorOperand(factor: Color4): ITextureProcessOperand {\n return { texture: null, factor };\n}\n\n/**\n * Create an operand from a texture multiplied by a constant RGBA factor.\n * This is the standard glTF pattern (e.g. baseColorTexture * baseColorFactor).\n * If `texture` is null, returns a factor-only operand.\n * @param texture - The texture to sample, or null to use the factor alone\n * @param factor - The constant factor to multiply by\n * @param channel - Optional channel selection. When set, the sampled value is swizzled before\n * factor multiplication (e.g. `TextureChannel.G` → GGGA, then multiplied by factor).\n * Defaults to `TextureChannel.RGBA` (no swizzle).\n * @param colorSpace - Optional color space. When `TextureColorSpace.SRGB`, the sampled RGB channels\n * are linearized before factor multiplication. Defaults to `TextureColorSpace.Linear`.\n * @returns An operand that evaluates to `sample(texture) * factor`, or `factor` if texture is null\n */\nexport function CreateTextureWithFactorOperand(texture: Nullable<BaseTexture>, factor: Color4, channel?: TextureChannel, colorSpace?: TextureColorSpace): ITextureProcessOperand {\n const op: ITextureProcessOperand = { texture, factor };\n if (channel) {\n op.channel = channel;\n }\n if (colorSpace) {\n op.colorSpace = colorSpace;\n }\n return op;\n}\n\n/**\n * @internal\n * Evaluate the effective constant Color4 of an operand.\n * When a texture-only operand omits factor, the implicit value is (1, 1, 1, 1).\n */\nfunction _EvalConstant(op: ITextureProcessOperand): Color4 {\n return op.factor ?? new Color4(1, 1, 1, 1);\n}\n\n/** @internal */\nfunction _MultiplyConstants(a: Color4, b: Color4): Color4 {\n return new Color4(a.r * b.r, a.g * b.g, a.b * b.b, a.a * b.a);\n}\n\n/** @internal */\nfunction _MaxConstants(a: Color4, b: Color4): Color4 {\n return new Color4(Math.max(a.r, b.r), Math.max(a.g, b.g), Math.max(a.b, b.b), Math.max(a.a, b.a));\n}\n\n/** @internal */\nfunction _LerpConstants(a: Color4, b: Color4, t: Color4): Color4 {\n return new Color4(a.r + (b.r - a.r) * t.r, a.g + (b.g - a.g) * t.g, a.b + (b.b - a.b) * t.b, a.a + (b.a - a.a) * t.a);\n}\n\n/**\n * @internal\n * Determine the output texture size from a list of operands, using the largest input texture.\n */\nfunction _ResolveOutputSize(operands: ITextureProcessOperand[]): TextureSize {\n let maxDim = 0;\n let result: TextureSize = 512;\n for (const op of operands) {\n if (op.texture) {\n const size = op.texture.getSize();\n const dim = Math.max(size.width, size.height);\n if (dim > maxDim) {\n maxDim = dim;\n result = size.width === size.height ? dim : size;\n }\n }\n }\n return result;\n}\n\n/**\n * @internal\n * Returns true when the texture has a non-identity UV transform (offset, scale, or rotation).\n */\nfunction _HasNonIdentityTransform(texture: BaseTexture): boolean {\n return !texture.getTextureMatrix().isIdentity();\n}\n\n/**\n * @internal\n * Returns true when every texture in the list shares the same UV transform matrix.\n * A single texture (or empty list) trivially satisfies this.\n */\nfunction _AllTransformsMatch(textures: BaseTexture[]): boolean {\n if (textures.length <= 1) {\n return true;\n }\n const ref = textures[0].getTextureMatrix();\n for (let i = 1; i < textures.length; i++) {\n if (!ref.equals(textures[i].getTextureMatrix())) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * @internal\n * Copy sampling metadata from a source texture onto the output ProceduralTexture.\n * `coordinatesIndex` and wrap modes are always copied.\n * When `includeTransform` is true the UV offset/scale/rotation are also copied\n * (used when all inputs share the same transform and it is propagated rather than baked).\n */\nfunction _CopyTextureMetadata(from: BaseTexture, to: ProceduralTexture, includeTransform: boolean): void {\n to.coordinatesIndex = from.coordinatesIndex;\n to.wrapU = from.wrapU;\n to.wrapV = from.wrapV;\n if (includeTransform) {\n const src = from as Texture;\n to.uOffset = src.uOffset ?? 0;\n to.vOffset = src.vOffset ?? 0;\n to.uScale = src.uScale ?? 1;\n to.vScale = src.vScale ?? 1;\n to.wAng = src.wAng ?? 0;\n }\n}\n\n/**\n * @internal\n * Return the shader define suffix for a TextureChannel (e.g. TextureChannel.R → \"R\").\n * Returns an empty string for RGBA (no swizzle needed).\n */\nfunction _ChannelDefine(channel: TextureChannel): string {\n switch (channel) {\n case TextureChannel.R:\n return \"R\";\n case TextureChannel.G:\n return \"G\";\n case TextureChannel.B:\n return \"B\";\n case TextureChannel.A:\n return \"A\";\n default:\n return \"\";\n }\n}\n\n/**\n * @internal\n * Apply a channel swizzle to a constant Color4, matching the GPU behaviour for TextureChannel.\n */\nfunction _ApplyChannelSwizzle(c: Color4, channel: TextureChannel): Color4 {\n switch (channel) {\n case TextureChannel.R:\n return new Color4(c.r, c.r, c.r, c.a);\n case TextureChannel.G:\n return new Color4(c.g, c.g, c.g, c.a);\n case TextureChannel.B:\n return new Color4(c.b, c.b, c.b, c.a);\n case TextureChannel.A:\n return new Color4(c.a, c.a, c.a, c.a);\n default:\n return c;\n }\n}\n\n/**\n * @internal\n * Build the OP_INVERT define plus per-channel INVERT_R/G/B/A defines from an ChannelMask bitmask.\n */\nfunction _BuildInvertDefines(channels: ChannelMask): string[] {\n const defines: string[] = [\"OP_INVERT\"];\n if (channels & ChannelMask.R) {\n defines.push(\"INVERT_R\");\n }\n if (channels & ChannelMask.G) {\n defines.push(\"INVERT_G\");\n }\n if (channels & ChannelMask.B) {\n defines.push(\"INVERT_B\");\n }\n if (channels & ChannelMask.A) {\n defines.push(\"INVERT_A\");\n }\n return defines;\n}\n\n/**\n * @internal\n * Build OUTPUT_MASK_X_ZERO / OUTPUT_MASK_A_ONE defines for excluded channels.\n * Channels present in the mask pass through; excluded channels get defaults (0.0 for RGB, 1.0 for A).\n * Returns an empty array for ChannelMask.RGBA (no masking needed).\n */\nfunction _BuildOutputChannelMaskDefines(mask: ChannelMask): string[] {\n const defines: string[] = [];\n if (!(mask & ChannelMask.R)) {\n defines.push(\"OUTPUT_MASK_R_ZERO\");\n }\n if (!(mask & ChannelMask.G)) {\n defines.push(\"OUTPUT_MASK_G_ZERO\");\n }\n if (!(mask & ChannelMask.B)) {\n defines.push(\"OUTPUT_MASK_B_ZERO\");\n }\n if (!(mask & ChannelMask.A)) {\n defines.push(\"OUTPUT_MASK_A_ONE\");\n }\n return defines;\n}\n\n/**\n * @internal\n * Apply a ChannelMask to a constant Color4: included channels pass through,\n * excluded color channels become 0, excluded alpha becomes 1.\n */\nfunction _ApplyOutputChannelMask(c: Color4, mask: ChannelMask): Color4 {\n return new Color4(mask & ChannelMask.R ? c.r : 0, mask & ChannelMask.G ? c.g : 0, mask & ChannelMask.B ? c.b : 0, mask & ChannelMask.A ? c.a : 1);\n}\n\n/**\n * @internal\n * Build shader defines for a standard A/B operand.\n * When `bakeTransform` is true and the texture has a non-identity UV transform,\n * the OPERAND_X_MATRIX define is emitted so the shader applies the matrix when sampling.\n */\nfunction _BuildOperandDefines(operand: ITextureProcessOperand, prefix: \"A\" | \"B\", bakeTransform: boolean): string[] {\n const defines: string[] = [];\n if (operand.texture) {\n defines.push(`OPERAND_${prefix}_TEXTURE`);\n if (bakeTransform && _HasNonIdentityTransform(operand.texture)) {\n defines.push(`OPERAND_${prefix}_MATRIX`);\n }\n if (operand.colorSpace) {\n defines.push(`OPERAND_${prefix}_SRGB`);\n }\n if (operand.channel) {\n defines.push(`OPERAND_${prefix}_CHANNEL_${_ChannelDefine(operand.channel)}`);\n }\n }\n if (operand.factor !== undefined || !operand.texture) {\n defines.push(`OPERAND_${prefix}_FACTOR`);\n }\n return defines;\n}\n\n/**\n * @internal\n * Build shader defines for the lerp blend operand.\n * When `bakeTransform` is true and the texture has a non-identity UV transform,\n * the LERP_T_MATRIX define is emitted.\n */\nfunction _BuildLerpBlendDefines(t: ITextureProcessOperand, bakeTransform: boolean): string[] {\n const defines: string[] = [];\n if (t.texture) {\n defines.push(\"LERP_T_TEXTURE\");\n if (bakeTransform && _HasNonIdentityTransform(t.texture)) {\n defines.push(\"LERP_T_MATRIX\");\n }\n if (t.factor !== undefined) {\n defines.push(\"LERP_T_FACTOR\");\n }\n if (t.colorSpace) {\n defines.push(\"LERP_T_SRGB\");\n }\n if (t.channel) {\n defines.push(`LERP_T_CHANNEL_${_ChannelDefine(t.channel)}`);\n }\n }\n // factor-only: no additional defines needed; the shader uses factorT when LERP_T_TEXTURE is absent.\n return defines;\n}\n\n/**\n * @internal\n * Set uniforms and textures for a standard A/B operand on a procedural texture.\n * When `bakeTransform` is true and the texture has a non-identity UV matrix,\n * that matrix is uploaded as `<textureName>Matrix` for the shader to apply when sampling.\n */\nfunction _SetOperandUniforms(pt: ProceduralTexture, operand: ITextureProcessOperand, textureName: string, factorName: string, bakeTransform: boolean): void {\n if (operand.texture) {\n pt.setTexture(textureName, operand.texture as Texture);\n if (bakeTransform && _HasNonIdentityTransform(operand.texture)) {\n pt.setMatrix(`${textureName}Matrix`, operand.texture.getTextureMatrix());\n }\n }\n const needsFactor = operand.factor !== undefined || !operand.texture;\n if (needsFactor) {\n pt.setColor4(factorName, _EvalConstant(operand));\n }\n}\n\n/**\n * @internal\n * Set uniforms and textures for the lerp blend operand.\n * When `bakeTransform` is true and the texture has a non-identity UV matrix,\n * that matrix is uploaded as `textureTMatrix`.\n */\nfunction _SetLerpBlendUniforms(pt: ProceduralTexture, t: ITextureProcessOperand, bakeTransform: boolean): void {\n if (t.texture) {\n pt.setTexture(\"textureT\", t.texture as Texture);\n if (bakeTransform && _HasNonIdentityTransform(t.texture)) {\n pt.setMatrix(\"textureTMatrix\", t.texture.getTextureMatrix());\n }\n if (t.factor !== undefined) {\n pt.setColor4(\"factorT\", t.factor);\n }\n } else {\n pt.setColor4(\"factorT\", _EvalConstant(t));\n }\n}\n\n/**\n * @internal\n * Create a textureProcessor procedural texture with the given defines. The returned texture\n * is not yet rendered — uniforms must be set on it before calling _RenderAsync.\n */\nfunction _CreateProcessorTexture(\n name: string,\n defines: string[],\n outputSize: TextureSize,\n scene: Scene,\n outputColorSpace: TextureColorSpace = TextureColorSpace.Linear\n): ProceduralTexture {\n const options: IProceduralTextureCreationOptions = {\n type: Constants.TEXTURETYPE_UNSIGNED_BYTE,\n format: Constants.TEXTUREFORMAT_RGBA,\n samplingMode: Constants.TEXTURE_BILINEAR_SAMPLINGMODE,\n generateDepthBuffer: false,\n generateMipMaps: false,\n gammaSpace: outputColorSpace === TextureColorSpace.SRGB,\n shaderLanguage: scene.getEngine().isWebGPU ? ShaderLanguage.WGSL : ShaderLanguage.GLSL,\n extraInitializationsAsync: async () => {\n if (scene.getEngine().isWebGPU) {\n await Promise.all([import(\"../../ShadersWGSL/textureProcessor.fragment\")]);\n } else {\n await Promise.all([import(\"../../Shaders/textureProcessor.fragment\")]);\n }\n },\n // Opt out of scene-managed rendering. _shouldRender() would re-render the texture\n // on the first scene frame regardless of refreshRate (because _currentRefreshId starts\n // at -1 and is only advanced by _shouldRender() itself, not by a direct render() call).\n // That re-render would sample already-disposed input textures, producing blank output.\n skipSceneRegistration: true,\n };\n\n const pt = new ProceduralTexture(name, outputSize, _ShaderName, scene, options);\n pt.refreshRate = -1; // render on demand only\n pt.defines = defines.length > 0 ? \"#define \" + defines.join(\"\\n#define \") + \"\\n\" : \"\";\n return pt;\n}\n\n/**\n * @internal\n * Wait for a procedural texture's shader to compile then render it. Uniforms must be set\n * on the texture before calling this.\n */\nasync function _RenderAsync(pt: ProceduralTexture): Promise<void> {\n return await new Promise<void>((resolve, reject) => {\n pt.executeWhenReady(() => {\n try {\n pt.render();\n resolve();\n } catch (error) {\n reject(error instanceof Error ? error : new Error(String(error)));\n }\n });\n });\n}\n\n/**\n * Multiply two texture operands together, component-wise: `result = a * b`.\n *\n * Each operand can be a texture, a constant factor, or a texture scaled by a factor.\n * This is useful for applying glTF-style factors to textures (e.g. `baseColorTexture * baseColorFactor`),\n * or for modulating one texture by another.\n *\n * If both operands are constant (no textures), the multiplication is performed on the CPU and\n * the result is returned as a factor-only operand with no texture allocated.\n *\n * When operands are results of previous operations (i.e. they carry a `dispose` function),\n * their intermediate textures are automatically released after the GPU pass completes.\n *\n * @param name - Name for the resulting procedural texture (used only when a GPU pass is needed)\n * @param a - First operand\n * @param b - Second operand\n * @param scene - Scene to create the texture in (used only when a GPU pass is needed)\n * @param outputColorSpace - Optional output color space. When `TextureColorSpace.SRGB`, the linear\n * result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to `TextureColorSpace.Linear`.\n * @param outputChannelMask - Optional bitmask of channels to write. Excluded color channels are set to\n * `0.0`; excluded alpha is set to `1.0`. Defaults to `ChannelMask.RGBA` (all channels written).\n * @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant\n */\nexport async function MultiplyTexturesAsync(\n name: string,\n a: ITextureProcessOperand,\n b: ITextureProcessOperand,\n scene: Scene,\n outputColorSpace?: TextureColorSpace,\n outputChannelMask?: ChannelMask\n): Promise<ITextureProcessOperand> {\n if (!a.texture && !b.texture) {\n const factor = _MultiplyConstants(_EvalConstant(a), _EvalConstant(b));\n return { texture: null, factor: outputChannelMask ? _ApplyOutputChannelMask(factor, outputChannelMask) : factor };\n }\n\n const allTextures: BaseTexture[] = [];\n if (a.texture) {\n allTextures.push(a.texture);\n }\n if (b.texture) {\n allTextures.push(b.texture);\n }\n const canPropagate = _AllTransformsMatch(allTextures);\n const bakeTransform = !canPropagate;\n\n const defines = [\n ..._BuildOperandDefines(a, \"A\", bakeTransform),\n ..._BuildOperandDefines(b, \"B\", bakeTransform),\n ...(outputChannelMask ? _BuildOutputChannelMaskDefines(outputChannelMask) : []),\n ];\n if (outputColorSpace) {\n defines.push(\"OUTPUT_SRGB\");\n }\n const pt = _CreateProcessorTexture(name, defines, _ResolveOutputSize([a, b]), scene, outputColorSpace);\n _SetOperandUniforms(pt, a, \"textureA\", \"factorA\", bakeTransform);\n _SetOperandUniforms(pt, b, \"textureB\", \"factorB\", bakeTransform);\n try {\n await _RenderAsync(pt);\n } catch (error) {\n a.dispose?.();\n b.dispose?.();\n throw error;\n }\n\n a.dispose?.();\n b.dispose?.();\n\n _CopyTextureMetadata(allTextures[0], pt, canPropagate);\n const result: ITextureProcessOperand = { texture: pt, dispose: () => pt.dispose() };\n if (outputColorSpace) {\n result.colorSpace = outputColorSpace;\n }\n return result;\n}\n\n/**\n * Take the component-wise maximum of two texture operands: `result = max(a, b)`.\n *\n * Each operand can be a texture, a constant factor, or a texture scaled by a factor.\n * Useful for operations such as combining ambient occlusion maps or taking the\n * brightest contribution from two sources.\n *\n * If both operands are constant (no textures), the operation is performed on the CPU and\n * the result is returned as a factor-only operand with no texture allocated.\n *\n * When operands are results of previous operations (i.e. they carry a `dispose` function),\n * their intermediate textures are automatically released after the GPU pass completes.\n *\n * @param name - Name for the resulting procedural texture (used only when a GPU pass is needed)\n * @param a - First operand\n * @param b - Second operand\n * @param scene - Scene to create the texture in (used only when a GPU pass is needed)\n * @param outputColorSpace - Optional output color space. When `TextureColorSpace.SRGB`, the linear\n * result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to `TextureColorSpace.Linear`.\n * @param outputChannelMask - Optional bitmask of channels to write. Excluded color channels are set to\n * `0.0`; excluded alpha is set to `1.0`. Defaults to `ChannelMask.RGBA` (all channels written).\n * @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant\n */\nexport async function MaxTexturesAsync(\n name: string,\n a: ITextureProcessOperand,\n b: ITextureProcessOperand,\n scene: Scene,\n outputColorSpace?: TextureColorSpace,\n outputChannelMask?: ChannelMask\n): Promise<ITextureProcessOperand> {\n if (!a.texture && !b.texture) {\n const factor = _MaxConstants(_EvalConstant(a), _EvalConstant(b));\n return { texture: null, factor: outputChannelMask ? _ApplyOutputChannelMask(factor, outputChannelMask) : factor };\n }\n\n const allTextures: BaseTexture[] = [];\n if (a.texture) {\n allTextures.push(a.texture);\n }\n if (b.texture) {\n allTextures.push(b.texture);\n }\n const canPropagate = _AllTransformsMatch(allTextures);\n const bakeTransform = !canPropagate;\n\n const defines = [\n \"OP_MAX\",\n ..._BuildOperandDefines(a, \"A\", bakeTransform),\n ..._BuildOperandDefines(b, \"B\", bakeTransform),\n ...(outputChannelMask ? _BuildOutputChannelMaskDefines(outputChannelMask) : []),\n ];\n if (outputColorSpace) {\n defines.push(\"OUTPUT_SRGB\");\n }\n const pt = _CreateProcessorTexture(name, defines, _ResolveOutputSize([a, b]), scene, outputColorSpace);\n _SetOperandUniforms(pt, a, \"textureA\", \"factorA\", bakeTransform);\n _SetOperandUniforms(pt, b, \"textureB\", \"factorB\", bakeTransform);\n try {\n await _RenderAsync(pt);\n } catch (error) {\n a.dispose?.();\n b.dispose?.();\n throw error;\n }\n\n a.dispose?.();\n b.dispose?.();\n\n _CopyTextureMetadata(allTextures[0], pt, canPropagate);\n const result: ITextureProcessOperand = { texture: pt, dispose: () => pt.dispose() };\n if (outputColorSpace) {\n result.colorSpace = outputColorSpace;\n }\n return result;\n}\n\n/**\n * Linearly interpolate between two texture operands: `result = mix(a, b, t)`.\n *\n * Each operand can be a texture, a constant factor, or a texture scaled by a factor.\n * The `t` operand controls the blend weight per texel, per channel — a value of 0 returns `a`,\n * a value of 1 returns `b`. Use a grayscale texture or a scalar `Color4(v, v, v, v)` for\n * uniform blending across all channels.\n *\n * If all three operands are constant (no textures), the interpolation is performed on the CPU and\n * the result is returned as a factor-only operand with no texture allocated.\n *\n * When operands are results of previous operations (i.e. they carry a `dispose` function),\n * their intermediate textures are automatically released after the GPU pass completes.\n *\n * @param name - Name for the resulting procedural texture (used only when a GPU pass is needed)\n * @param a - Start value operand (returned when t = 0)\n * @param b - End value operand (returned when t = 1)\n * @param t - Blend weight operand. Each channel independently controls the blend for the corresponding output channel.\n * @param scene - Scene to create the texture in (used only when a GPU pass is needed)\n * @param outputColorSpace - Optional output color space. When `TextureColorSpace.SRGB`, the linear\n * result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to `TextureColorSpace.Linear`.\n * @param outputChannelMask - Optional bitmask of channels to write. Excluded color channels are set to\n * `0.0`; excluded alpha is set to `1.0`. Defaults to `ChannelMask.RGBA` (all channels written).\n * @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant\n */\nexport async function LerpTexturesAsync(\n name: string,\n a: ITextureProcessOperand,\n b: ITextureProcessOperand,\n t: ITextureProcessOperand,\n scene: Scene,\n outputColorSpace?: TextureColorSpace,\n outputChannelMask?: ChannelMask\n): Promise<ITextureProcessOperand> {\n if (!a.texture && !b.texture && !t.texture) {\n const factor = _LerpConstants(_EvalConstant(a), _EvalConstant(b), _EvalConstant(t));\n return { texture: null, factor: outputChannelMask ? _ApplyOutputChannelMask(factor, outputChannelMask) : factor };\n }\n\n const allTextures: BaseTexture[] = [];\n if (a.texture) {\n allTextures.push(a.texture);\n }\n if (b.texture) {\n allTextures.push(b.texture);\n }\n if (t.texture) {\n allTextures.push(t.texture);\n }\n const canPropagate = _AllTransformsMatch(allTextures);\n const bakeTransform = !canPropagate;\n\n const defines = [\n \"OP_LERP\",\n ..._BuildOperandDefines(a, \"A\", bakeTransform),\n ..._BuildOperandDefines(b, \"B\", bakeTransform),\n ..._BuildLerpBlendDefines(t, bakeTransform),\n ...(outputChannelMask ? _BuildOutputChannelMaskDefines(outputChannelMask) : []),\n ];\n if (outputColorSpace) {\n defines.push(\"OUTPUT_SRGB\");\n }\n const pt = _CreateProcessorTexture(name, defines, _ResolveOutputSize([a, b, t]), scene, outputColorSpace);\n _SetOperandUniforms(pt, a, \"textureA\", \"factorA\", bakeTransform);\n _SetOperandUniforms(pt, b, \"textureB\", \"factorB\", bakeTransform);\n _SetLerpBlendUniforms(pt, t, bakeTransform);\n try {\n await _RenderAsync(pt);\n } catch (error) {\n a.dispose?.();\n b.dispose?.();\n t.dispose?.();\n throw error;\n }\n\n a.dispose?.();\n b.dispose?.();\n t.dispose?.();\n\n _CopyTextureMetadata(allTextures[0], pt, canPropagate);\n const result: ITextureProcessOperand = { texture: pt, dispose: () => pt.dispose() };\n if (outputColorSpace) {\n result.colorSpace = outputColorSpace;\n }\n return result;\n}\n\n/**\n * Invert selected channels of a texture operand: `result[ch] = 1 - input[ch]`.\n *\n * The `channels` bitmask selects which channels are inverted; unselected channels pass through\n * unchanged. Use `ChannelMask.RGB` for the common roughness↔smoothness conversion, or\n * `ChannelMask.RGBA` (the default) to invert the entire texture.\n *\n * This is a unary operation — only operand A is used. Any `colorSpace` or `channel` properties\n * on the input operand are honoured (sRGB linearization and channel swizzle applied before\n * the invert).\n *\n * If the input is constant (no texture), the invert is performed on the CPU.\n *\n * When the input is the result of a previous operation (i.e. it carries a `dispose` function),\n * its intermediate texture is automatically released after the GPU pass completes.\n *\n * @param name - Name for the resulting procedural texture (used only when a GPU pass is needed)\n * @param input - Operand to invert\n * @param scene - Scene to create the texture in (used only when a GPU pass is needed)\n * @param channels - Bitmask of channels to invert. Defaults to `ChannelMask.RGBA`.\n * @param outputColorSpace - Optional output color space. When `TextureColorSpace.SRGB`, the linear\n * result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to `TextureColorSpace.Linear`.\n * @param outputChannelMask - Optional bitmask of channels to write. Excluded color channels are set to\n * `0.0`; excluded alpha is set to `1.0`. Defaults to `ChannelMask.RGBA` (all channels written).\n * @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant\n */\nexport async function InvertTextureAsync(\n name: string,\n input: ITextureProcessOperand,\n scene: Scene,\n channels: ChannelMask = ChannelMask.RGBA,\n outputColorSpace?: TextureColorSpace,\n outputChannelMask?: ChannelMask\n): Promise<ITextureProcessOperand> {\n if (!input.texture) {\n const c = _EvalConstant(input);\n const factor = new Color4(\n channels & ChannelMask.R ? 1 - c.r : c.r,\n channels & ChannelMask.G ? 1 - c.g : c.g,\n channels & ChannelMask.B ? 1 - c.b : c.b,\n channels & ChannelMask.A ? 1 - c.a : c.a\n );\n return { texture: null, factor: outputChannelMask ? _ApplyOutputChannelMask(factor, outputChannelMask) : factor };\n }\n\n // Single input: UV transform is always propagated (no bake needed).\n const defines = [..._BuildOperandDefines(input, \"A\", false), ..._BuildInvertDefines(channels), ...(outputChannelMask ? _BuildOutputChannelMaskDefines(outputChannelMask) : [])];\n if (outputColorSpace) {\n defines.push(\"OUTPUT_SRGB\");\n }\n const pt = _CreateProcessorTexture(name, defines, _ResolveOutputSize([input]), scene, outputColorSpace);\n _SetOperandUniforms(pt, input, \"textureA\", \"factorA\", false);\n try {\n await _RenderAsync(pt);\n } catch (error) {\n input.dispose?.();\n throw error;\n }\n\n input.dispose?.();\n\n _CopyTextureMetadata(input.texture, pt, true);\n const result: ITextureProcessOperand = { texture: pt, dispose: () => pt.dispose() };\n if (outputColorSpace) {\n result.colorSpace = outputColorSpace;\n }\n return result;\n}\n\n/**\n * Extract the per-texel maximum channel value from a texture and broadcast it to all output\n * channels, producing a single-value (greyscale) texture in a single GPU pass.\n *\n * For each texel, computes `max(r, g, b)` — or `max(r, g, b, a)` when `includeAlpha` is true —\n * and writes that scalar to the output:\n * - `includeAlpha = false` (default): output is `(m, m, m, a)` where `m = max(r, g, b)`\n * - `includeAlpha = true`: output is `(m, m, m, m)` where `m = max(r, g, b, a)`\n *\n * This is more efficient than chaining `ExtractChannelAsync` calls through `MaxTexturesAsync`,\n * which would require multiple intermediate textures and GPU passes.\n *\n * Any `colorSpace` or `channel` properties on the input operand are honoured (sRGB linearization\n * and channel swizzle applied before the max reduction).\n *\n * If the input is constant (no texture), the reduction is performed on the CPU.\n *\n * When the input is the result of a previous operation (i.e. it carries a `dispose` function),\n * its intermediate texture is automatically released after the GPU pass completes.\n *\n * @param name - Name for the resulting procedural texture (used only when a GPU pass is needed)\n * @param input - Operand to reduce\n * @param scene - Scene to create the texture in (used only when a GPU pass is needed)\n * @param includeAlpha - When true, alpha participates in the max and is also set to the result.\n * Defaults to false (alpha is preserved from the input).\n * @param outputColorSpace - Optional output color space. When `TextureColorSpace.SRGB`, the linear\n * result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to `TextureColorSpace.Linear`.\n * @param outputChannelMask - Optional bitmask of channels to write. Excluded color channels are set to\n * `0.0`; excluded alpha is set to `1.0`. Defaults to `ChannelMask.RGBA` (all channels written).\n * @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant\n */\nexport async function ExtractMaxChannelAsync(\n name: string,\n input: ITextureProcessOperand,\n scene: Scene,\n includeAlpha: boolean = false,\n outputColorSpace?: TextureColorSpace,\n outputChannelMask?: ChannelMask\n): Promise<ITextureProcessOperand> {\n if (!input.texture) {\n const c = _EvalConstant(input);\n const m = includeAlpha ? Math.max(c.r, c.g, c.b, c.a) : Math.max(c.r, c.g, c.b);\n const factor = new Color4(m, m, m, includeAlpha ? m : c.a);\n return { texture: null, factor: outputChannelMask ? _ApplyOutputChannelMask(factor, outputChannelMask) : factor };\n }\n\n // Single input: UV transform is always propagated (no bake needed).\n const defines = [..._BuildOperandDefines(input, \"A\", false), \"OP_CHANNEL_MAX\", ...(outputChannelMask ? _BuildOutputChannelMaskDefines(outputChannelMask) : [])];\n if (includeAlpha) {\n defines.push(\"CHANNEL_MAX_INCLUDE_ALPHA\");\n }\n if (outputColorSpace) {\n defines.push(\"OUTPUT_SRGB\");\n }\n const pt = _CreateProcessorTexture(name, defines, _ResolveOutputSize([input]), scene, outputColorSpace);\n _SetOperandUniforms(pt, input, \"textureA\", \"factorA\", false);\n try {\n await _RenderAsync(pt);\n } catch (error) {\n input.dispose?.();\n throw error;\n }\n\n input.dispose?.();\n\n _CopyTextureMetadata(input.texture, pt, true);\n const result: ITextureProcessOperand = { texture: pt, dispose: () => pt.dispose() };\n if (outputColorSpace) {\n result.colorSpace = outputColorSpace;\n }\n return result;\n}\n\n/**\n * Extract a single channel from a texture and broadcast it to RGB (or all four components for\n * `TextureChannel.A`), producing a new texture. This is a convenience wrapper over\n * `MultiplyTexturesAsync` with a `(1,1,1,1)` factor and the requested channel swizzle applied\n * to the input.\n *\n * Swizzle results per channel:\n * - `TextureChannel.R` → (r, r, r, a)\n * - `TextureChannel.G` → (g, g, g, a)\n * - `TextureChannel.B` → (b, b, b, a)\n * - `TextureChannel.A` → (a, a, a, a)\n *\n * If the input is constant (no texture), the swizzle is applied on the CPU.\n *\n * Any `colorSpace` property on the input operand is honoured (sRGB linearization applied before\n * the swizzle). Any existing `channel` on the input is replaced by the `channel` argument.\n *\n * When the input is the result of a previous operation (i.e. it carries a `dispose` function),\n * its intermediate texture is automatically released after the GPU pass completes.\n *\n * @param name - Name for the resulting procedural texture (used only when a GPU pass is needed)\n * @param input - Operand to extract the channel from\n * @param channel - The channel to extract and broadcast\n * @param scene - Scene to create the texture in (used only when a GPU pass is needed)\n * @param outputColorSpace - Optional output color space. When `TextureColorSpace.SRGB`, the linear\n * result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to `TextureColorSpace.Linear`.\n * @param outputChannelMask - Optional bitmask of channels to write. Excluded color channels are set to\n * `0.0`; excluded alpha is set to `1.0`. Defaults to `ChannelMask.RGBA` (all channels written).\n * @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant\n */\nexport async function ExtractChannelAsync(\n name: string,\n input: ITextureProcessOperand,\n channel: TextureChannel,\n scene: Scene,\n outputColorSpace?: TextureColorSpace,\n outputChannelMask?: ChannelMask\n): Promise<ITextureProcessOperand> {\n if (!input.texture) {\n const swizzled = _ApplyChannelSwizzle(_EvalConstant(input), channel);\n return { texture: null, factor: outputChannelMask ? _ApplyOutputChannelMask(swizzled, outputChannelMask) : swizzled };\n }\n return await MultiplyTexturesAsync(name, { ...input, channel }, CreateFactorOperand(new Color4(1, 1, 1, 1)), scene, outputColorSpace, outputChannelMask);\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { type Nullable } from "../../types.js";
2
2
  import { type InternalTexture } from "../../Materials/Textures/internalTexture.js";
3
- import { type ThinEngine } from "../../Engines/thinEngine.js";
3
+ import { type AbstractEngine } from "../../Engines/abstractEngine.js";
4
4
  import { type IRenderTargetTexture, type RenderTargetWrapper } from "../../Engines/renderTargetWrapper.js";
5
5
  import { ThinTexture } from "./thinTexture.js";
6
6
  import { type TextureSize, type RenderTargetCreationOptions } from "./textureCreationOptions.js";
@@ -19,12 +19,12 @@ export declare class ThinRenderTargetTexture extends ThinTexture implements IRen
19
19
  /**
20
20
  * Instantiates a new ThinRenderTargetTexture.
21
21
  * Tiny helper class to wrap a RenderTargetWrapper in a texture.
22
- * This can be used as an internal texture wrapper in ThinEngine to benefit from the cache and to hold on the associated RTT
23
- * @param engine Define the internalTexture to wrap
22
+ * This can be used as an internal texture wrapper to benefit from the cache and to hold on the associated RTT
23
+ * @param engine Define the engine used to create and host the render target
24
24
  * @param size Define the size of the RTT to create
25
25
  * @param options Define rendertarget options
26
26
  */
27
- constructor(engine: ThinEngine, size: TextureSize, options: RenderTargetCreationOptions);
27
+ constructor(engine: AbstractEngine, size: TextureSize, options: RenderTargetCreationOptions);
28
28
  /**
29
29
  * Resize the texture to a new desired size.
30
30
  * Be careful as it will recreate all the data in the new texture.
@@ -13,8 +13,8 @@ export class ThinRenderTargetTexture extends ThinTexture {
13
13
  /**
14
14
  * Instantiates a new ThinRenderTargetTexture.
15
15
  * Tiny helper class to wrap a RenderTargetWrapper in a texture.
16
- * This can be used as an internal texture wrapper in ThinEngine to benefit from the cache and to hold on the associated RTT
17
- * @param engine Define the internalTexture to wrap
16
+ * This can be used as an internal texture wrapper to benefit from the cache and to hold on the associated RTT
17
+ * @param engine Define the engine used to create and host the render target
18
18
  * @param size Define the size of the RTT to create
19
19
  * @param options Define rendertarget options
20
20
  */