@onerjs/core 8.55.9 → 8.56.2

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 (265) hide show
  1. package/AudioV2/webAudio/webAudioEngine.d.ts +7 -0
  2. package/AudioV2/webAudio/webAudioEngine.js +6 -5
  3. package/AudioV2/webAudio/webAudioEngine.js.map +1 -1
  4. package/Cameras/arcRotateCamera.pure.js +24 -0
  5. package/Cameras/arcRotateCamera.pure.js.map +1 -1
  6. package/Culling/Helper/boundingInfoHelper.js +8 -4
  7. package/Culling/Helper/boundingInfoHelper.js.map +1 -1
  8. package/Engines/AbstractEngine/abstractEngine.textureLoaders.d.ts +5 -1
  9. package/Engines/AbstractEngine/abstractEngine.textureLoaders.js +7 -3
  10. package/Engines/AbstractEngine/abstractEngine.textureLoaders.js.map +1 -1
  11. package/Engines/AbstractEngine/abstractEngine.textureLoaders.pure.d.ts +6 -0
  12. package/Engines/AbstractEngine/abstractEngine.textureLoaders.pure.js +16 -0
  13. package/Engines/AbstractEngine/abstractEngine.textureLoaders.pure.js.map +1 -0
  14. package/Engines/AbstractEngine/pure.d.ts +1 -0
  15. package/Engines/AbstractEngine/pure.js +1 -0
  16. package/Engines/AbstractEngine/pure.js.map +1 -1
  17. package/Engines/IDrawContext.d.ts +2 -0
  18. package/Engines/IDrawContext.js.map +1 -1
  19. package/Engines/WebGPU/webgpuDrawContext.d.ts +8 -0
  20. package/Engines/WebGPU/webgpuDrawContext.js +15 -0
  21. package/Engines/WebGPU/webgpuDrawContext.js.map +1 -1
  22. package/Engines/abstractEngine.pure.js +2 -2
  23. package/Engines/abstractEngine.pure.js.map +1 -1
  24. package/Engines/constants.d.ts +5 -0
  25. package/Engines/constants.js +5 -0
  26. package/Engines/constants.js.map +1 -1
  27. package/Engines/engine.d.ts +11 -3
  28. package/Engines/webgpuEngine.d.ts +1 -0
  29. package/Engines/webgpuEngine.js +1 -0
  30. package/Engines/webgpuEngine.js.map +1 -1
  31. package/Engines/webgpuEngine.pure.d.ts +10 -0
  32. package/Engines/webgpuEngine.pure.js +15 -1
  33. package/Engines/webgpuEngine.pure.js.map +1 -1
  34. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.d.ts +4 -0
  35. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.js +12 -0
  36. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.js.map +1 -1
  37. package/FrameGraph/Node/Blocks/inputBlock.pure.js +2 -1
  38. package/FrameGraph/Node/Blocks/inputBlock.pure.js.map +1 -1
  39. package/FrameGraph/Node/Types/nodeRenderGraphTypes.d.ts +2 -0
  40. package/FrameGraph/Node/Types/nodeRenderGraphTypes.js +2 -0
  41. package/FrameGraph/Node/Types/nodeRenderGraphTypes.js.map +1 -1
  42. package/FrameGraph/Tasks/Rendering/geometryRendererTask.d.ts +21 -0
  43. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +45 -0
  44. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
  45. package/FrameGraph/Tasks/Rendering/iblShadowsRendererTask.pure.js +2 -5
  46. package/FrameGraph/Tasks/Rendering/iblShadowsRendererTask.pure.js.map +1 -1
  47. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.pure.d.ts +1 -0
  48. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.pure.js +18 -3
  49. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.pure.js.map +1 -1
  50. package/Materials/Node/Blocks/Fragment/imageProcessingBlock.pure.js +2 -0
  51. package/Materials/Node/Blocks/Fragment/imageProcessingBlock.pure.js.map +1 -1
  52. package/Materials/Node/Blocks/Fragment/prePassOutputBlock.pure.js +5 -21
  53. package/Materials/Node/Blocks/Fragment/prePassOutputBlock.pure.js.map +1 -1
  54. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.pure.js +1 -0
  55. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.pure.js.map +1 -1
  56. package/Materials/Node/Blocks/powBlock.pure.js +2 -1
  57. package/Materials/Node/Blocks/powBlock.pure.js.map +1 -1
  58. package/Materials/Node/Blocks/triPlanarBlock.pure.js +14 -12
  59. package/Materials/Node/Blocks/triPlanarBlock.pure.js.map +1 -1
  60. package/Materials/Node/nodeMaterial.pure.d.ts +11 -0
  61. package/Materials/Node/nodeMaterial.pure.js +11 -0
  62. package/Materials/Node/nodeMaterial.pure.js.map +1 -1
  63. package/Materials/Node/nodeMaterialBuildState.d.ts +4 -3
  64. package/Materials/Node/nodeMaterialBuildState.js +7 -1
  65. package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
  66. package/Materials/PBR/openpbrMaterial.pure.d.ts +4 -0
  67. package/Materials/PBR/pbrBaseMaterial.pure.d.ts +4 -0
  68. package/Materials/Textures/index.d.ts +1 -0
  69. package/Materials/Textures/index.js +1 -0
  70. package/Materials/Textures/index.js.map +1 -1
  71. package/Materials/Textures/textureProcessor.d.ts +29 -6
  72. package/Materials/Textures/textureProcessor.js +22 -16
  73. package/Materials/Textures/textureProcessor.js.map +1 -1
  74. package/Materials/drawWrapper.js +3 -0
  75. package/Materials/drawWrapper.js.map +1 -1
  76. package/Materials/imageProcessingConfiguration.defines.d.ts +3 -0
  77. package/Materials/imageProcessingConfiguration.defines.js +2 -0
  78. package/Materials/imageProcessingConfiguration.defines.js.map +1 -1
  79. package/Materials/imageProcessingConfiguration.functions.js +3 -0
  80. package/Materials/imageProcessingConfiguration.functions.js.map +1 -1
  81. package/Materials/imageProcessingConfiguration.pure.d.ts +58 -0
  82. package/Materials/imageProcessingConfiguration.pure.js +123 -2
  83. package/Materials/imageProcessingConfiguration.pure.js.map +1 -1
  84. package/Materials/materialHelper.geometryrendering.d.ts +19 -0
  85. package/Materials/materialHelper.geometryrendering.js +29 -1
  86. package/Materials/materialHelper.geometryrendering.js.map +1 -1
  87. package/Materials/prepass.defines.d.ts +3 -0
  88. package/Materials/prepass.defines.js +3 -0
  89. package/Materials/prepass.defines.js.map +1 -1
  90. package/Materials/standardMaterial.pure.d.ts +4 -0
  91. package/Materials/uniformBuffer.d.ts +29 -0
  92. package/Materials/uniformBuffer.js +146 -0
  93. package/Materials/uniformBuffer.js.map +1 -1
  94. package/Maths/colorTemperature.functions.d.ts +29 -0
  95. package/Maths/colorTemperature.functions.js +196 -0
  96. package/Maths/colorTemperature.functions.js.map +1 -0
  97. package/Maths/index.d.ts +1 -0
  98. package/Maths/index.js +1 -0
  99. package/Maths/index.js.map +1 -1
  100. package/Maths/math.vector.pure.d.ts +1 -5
  101. package/Maths/math.vector.pure.js.map +1 -1
  102. package/Maths/pure.d.ts +1 -0
  103. package/Maths/pure.js +1 -0
  104. package/Maths/pure.js.map +1 -1
  105. package/Misc/filesInput.d.ts +15 -0
  106. package/Misc/filesInput.js +156 -74
  107. package/Misc/filesInput.js.map +1 -1
  108. package/Misc/observable.pure.js +1 -3
  109. package/Misc/observable.pure.js.map +1 -1
  110. package/Misc/tools.pure.js +1 -1
  111. package/Misc/tools.pure.js.map +1 -1
  112. package/PostProcesses/imageProcessingPostProcess.d.ts +41 -1
  113. package/PostProcesses/imageProcessingPostProcess.js +41 -1
  114. package/PostProcesses/imageProcessingPostProcess.js.map +1 -1
  115. package/PostProcesses/thinImageProcessingPostProcess.d.ts +50 -0
  116. package/PostProcesses/thinImageProcessingPostProcess.js +65 -0
  117. package/PostProcesses/thinImageProcessingPostProcess.js.map +1 -1
  118. package/Rendering/IBLShadows/iblShadowsMaterialCompatibility.pure.d.ts +12 -0
  119. package/Rendering/IBLShadows/iblShadowsMaterialCompatibility.pure.js +22 -0
  120. package/Rendering/IBLShadows/iblShadowsMaterialCompatibility.pure.js.map +1 -0
  121. package/Rendering/IBLShadows/iblShadowsPluginMaterial.pure.d.ts +1 -0
  122. package/Rendering/IBLShadows/iblShadowsPluginMaterial.pure.js +39 -0
  123. package/Rendering/IBLShadows/iblShadowsPluginMaterial.pure.js.map +1 -1
  124. package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js +2 -4
  125. package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js.map +1 -1
  126. package/Rendering/IBLShadows/pure.d.ts +1 -0
  127. package/Rendering/IBLShadows/pure.js +1 -0
  128. package/Rendering/IBLShadows/pure.js.map +1 -1
  129. package/Rendering/fluidRenderer/fluidRenderingObject.d.ts +11 -0
  130. package/Rendering/fluidRenderer/fluidRenderingObject.js +36 -14
  131. package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
  132. package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.d.ts +5 -0
  133. package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js +16 -3
  134. package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js.map +1 -1
  135. package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.d.ts +5 -0
  136. package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js +12 -0
  137. package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js.map +1 -1
  138. package/Rendering/geometryBufferRenderer.pure.d.ts +30 -0
  139. package/Rendering/geometryBufferRenderer.pure.js +84 -0
  140. package/Rendering/geometryBufferRenderer.pure.js.map +1 -1
  141. package/Rendering/iblCdfGenerator.js +10 -1
  142. package/Rendering/iblCdfGenerator.js.map +1 -1
  143. package/Shaders/ShadersInclude/hdrFilteringFunctions.js +1 -1
  144. package/Shaders/ShadersInclude/hdrFilteringFunctions.js.map +1 -1
  145. package/Shaders/ShadersInclude/helperFunctions.js +2 -2
  146. package/Shaders/ShadersInclude/helperFunctions.js.map +1 -1
  147. package/Shaders/ShadersInclude/imageProcessingDeclaration.js +3 -0
  148. package/Shaders/ShadersInclude/imageProcessingDeclaration.js.map +1 -1
  149. package/Shaders/ShadersInclude/imageProcessingFunctions.js +3 -0
  150. package/Shaders/ShadersInclude/imageProcessingFunctions.js.map +1 -1
  151. package/Shaders/ShadersInclude/objectIdFunctions.d.ts +5 -0
  152. package/Shaders/ShadersInclude/objectIdFunctions.js +22 -0
  153. package/Shaders/ShadersInclude/objectIdFunctions.js.map +1 -0
  154. package/Shaders/ShadersInclude/openpbrBlockPrePass.js +3 -0
  155. package/Shaders/ShadersInclude/openpbrBlockPrePass.js.map +1 -1
  156. package/Shaders/ShadersInclude/openpbrDirectLighting.js +34 -4
  157. package/Shaders/ShadersInclude/openpbrDirectLighting.js.map +1 -1
  158. package/Shaders/ShadersInclude/openpbrIblFunctions.js +8 -2
  159. package/Shaders/ShadersInclude/openpbrIblFunctions.js.map +1 -1
  160. package/Shaders/ShadersInclude/pbrBlockPrePass.js +3 -0
  161. package/Shaders/ShadersInclude/pbrBlockPrePass.js.map +1 -1
  162. package/Shaders/ShadersInclude/pbrDirectLightingFunctions.js +5 -0
  163. package/Shaders/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
  164. package/Shaders/ShadersInclude/prePassDeclaration.d.ts +1 -0
  165. package/Shaders/ShadersInclude/prePassDeclaration.js +5 -0
  166. package/Shaders/ShadersInclude/prePassDeclaration.js.map +1 -1
  167. package/Shaders/default.fragment.js +5 -1
  168. package/Shaders/default.fragment.js.map +1 -1
  169. package/Shaders/fluidRenderingParticleDepth.vertex.js +7 -1
  170. package/Shaders/fluidRenderingParticleDepth.vertex.js.map +1 -1
  171. package/Shaders/fluidRenderingParticleDiffuse.vertex.js +7 -1
  172. package/Shaders/fluidRenderingParticleDiffuse.vertex.js.map +1 -1
  173. package/Shaders/fluidRenderingParticleThickness.vertex.js +7 -1
  174. package/Shaders/fluidRenderingParticleThickness.vertex.js.map +1 -1
  175. package/Shaders/geometry.fragment.js +9 -1
  176. package/Shaders/geometry.fragment.js.map +1 -1
  177. package/Shaders/openpbr.fragment.js +2 -1
  178. package/Shaders/openpbr.fragment.js.map +1 -1
  179. package/Shaders/pbr.fragment.js +2 -1
  180. package/Shaders/pbr.fragment.js.map +1 -1
  181. package/ShadersWGSL/ShadersInclude/imageProcessingDeclaration.js +3 -0
  182. package/ShadersWGSL/ShadersInclude/imageProcessingDeclaration.js.map +1 -1
  183. package/ShadersWGSL/ShadersInclude/imageProcessingFunctions.js +3 -0
  184. package/ShadersWGSL/ShadersInclude/imageProcessingFunctions.js.map +1 -1
  185. package/ShadersWGSL/ShadersInclude/objectIdFunctions.d.ts +5 -0
  186. package/ShadersWGSL/ShadersInclude/objectIdFunctions.js +22 -0
  187. package/ShadersWGSL/ShadersInclude/objectIdFunctions.js.map +1 -0
  188. package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.js +3 -0
  189. package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.js.map +1 -1
  190. package/ShadersWGSL/ShadersInclude/openpbrDirectLighting.js +35 -5
  191. package/ShadersWGSL/ShadersInclude/openpbrDirectLighting.js.map +1 -1
  192. package/ShadersWGSL/ShadersInclude/openpbrDirectLightingInit.js +1 -1
  193. package/ShadersWGSL/ShadersInclude/openpbrDirectLightingInit.js.map +1 -1
  194. package/ShadersWGSL/ShadersInclude/openpbrIblFunctions.js +8 -2
  195. package/ShadersWGSL/ShadersInclude/openpbrIblFunctions.js.map +1 -1
  196. package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js +3 -0
  197. package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js.map +1 -1
  198. package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js +5 -0
  199. package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
  200. package/ShadersWGSL/ShadersInclude/prePassDeclaration.d.ts +1 -0
  201. package/ShadersWGSL/ShadersInclude/prePassDeclaration.js +5 -0
  202. package/ShadersWGSL/ShadersInclude/prePassDeclaration.js.map +1 -1
  203. package/ShadersWGSL/default.fragment.js +5 -1
  204. package/ShadersWGSL/default.fragment.js.map +1 -1
  205. package/ShadersWGSL/fluidRenderingParticleDepth.vertex.js +16 -4
  206. package/ShadersWGSL/fluidRenderingParticleDepth.vertex.js.map +1 -1
  207. package/ShadersWGSL/fluidRenderingParticleDiffuse.vertex.js +15 -3
  208. package/ShadersWGSL/fluidRenderingParticleDiffuse.vertex.js.map +1 -1
  209. package/ShadersWGSL/fluidRenderingParticleThickness.vertex.js +15 -3
  210. package/ShadersWGSL/fluidRenderingParticleThickness.vertex.js.map +1 -1
  211. package/ShadersWGSL/geometry.fragment.js +9 -1
  212. package/ShadersWGSL/geometry.fragment.js.map +1 -1
  213. package/ShadersWGSL/openpbr.fragment.js +2 -1
  214. package/ShadersWGSL/openpbr.fragment.js.map +1 -1
  215. package/ShadersWGSL/pbr.fragment.js +2 -1
  216. package/ShadersWGSL/pbr.fragment.js.map +1 -1
  217. package/XR/features/Layers/WebXRCompositionLayer.d.ts +52 -0
  218. package/XR/features/Layers/WebXRCompositionLayer.js +80 -0
  219. package/XR/features/Layers/WebXRCompositionLayer.js.map +1 -1
  220. package/XR/features/WebXRControllerPointerSelection.pure.js +2 -1
  221. package/XR/features/WebXRControllerPointerSelection.pure.js.map +1 -1
  222. package/XR/features/WebXRControllerTeleportation.pure.js +2 -1
  223. package/XR/features/WebXRControllerTeleportation.pure.js.map +1 -1
  224. package/XR/features/WebXRDepthSensing.pure.d.ts +21 -0
  225. package/XR/features/WebXRDepthSensing.pure.js +42 -0
  226. package/XR/features/WebXRDepthSensing.pure.js.map +1 -1
  227. package/XR/features/WebXRHandTracking.pure.js +2 -0
  228. package/XR/features/WebXRHandTracking.pure.js.map +1 -1
  229. package/XR/features/WebXRLayers.pure.d.ts +12 -0
  230. package/XR/features/WebXRLayers.pure.js +31 -1
  231. package/XR/features/WebXRLayers.pure.js.map +1 -1
  232. package/XR/features/WebXRTrackedSources.d.ts +5 -0
  233. package/XR/features/WebXRTrackedSources.js +8 -0
  234. package/XR/features/WebXRTrackedSources.js.map +1 -0
  235. package/XR/features/WebXRTrackedSources.pure.d.ts +70 -0
  236. package/XR/features/WebXRTrackedSources.pure.js +153 -0
  237. package/XR/features/WebXRTrackedSources.pure.js.map +1 -0
  238. package/XR/features/index.d.ts +1 -0
  239. package/XR/features/index.js +1 -0
  240. package/XR/features/index.js.map +1 -1
  241. package/XR/features/pure.d.ts +1 -0
  242. package/XR/features/pure.js +1 -0
  243. package/XR/features/pure.js.map +1 -1
  244. package/XR/motionController/webXRAbstractMotionController.d.ts +53 -1
  245. package/XR/motionController/webXRAbstractMotionController.js +61 -0
  246. package/XR/motionController/webXRAbstractMotionController.js.map +1 -1
  247. package/XR/webXRDefaultExperience.js +8 -4
  248. package/XR/webXRDefaultExperience.js.map +1 -1
  249. package/XR/webXRExperienceHelper.js +86 -44
  250. package/XR/webXRExperienceHelper.js.map +1 -1
  251. package/XR/webXRFeaturesManager.d.ts +9 -0
  252. package/XR/webXRFeaturesManager.js +4 -0
  253. package/XR/webXRFeaturesManager.js.map +1 -1
  254. package/XR/webXRGraphicsBinding.d.ts +29 -0
  255. package/XR/webXRGraphicsBinding.js +40 -0
  256. package/XR/webXRGraphicsBinding.js.map +1 -1
  257. package/XR/webXRInputSource.js +1 -1
  258. package/XR/webXRInputSource.js.map +1 -1
  259. package/XR/webXRLayerWrapper.d.ts +7 -5
  260. package/XR/webXRLayerWrapper.js +10 -7
  261. package/XR/webXRLayerWrapper.js.map +1 -1
  262. package/XR/webXRSessionManager.d.ts +45 -0
  263. package/XR/webXRSessionManager.js +174 -29
  264. package/XR/webXRSessionManager.js.map +1 -1
  265. package/package.json +1 -1
@@ -383,13 +383,13 @@ function _SetLerpBlendUniforms(pt, t, bakeTransform) {
383
383
  * Create a textureProcessor procedural texture with the given defines. The returned texture
384
384
  * is not yet rendered — uniforms must be set on it before calling _RenderAsync.
385
385
  */
386
- function _CreateProcessorTexture(name, defines, outputSize, scene, outputColorSpace = TextureColorSpace.Linear) {
386
+ function _CreateProcessorTexture(name, defines, outputSize, scene, outputColorSpace = TextureColorSpace.Linear, outputOptions) {
387
387
  const options = {
388
- type: 0,
388
+ type: outputOptions?.textureType ?? 0,
389
389
  format: 5,
390
- samplingMode: 2,
390
+ samplingMode: outputOptions?.samplingMode ?? 2,
391
391
  generateDepthBuffer: false,
392
- generateMipMaps: false,
392
+ generateMipMaps: outputOptions?.generateMipMaps ?? false,
393
393
  gammaSpace: outputColorSpace === TextureColorSpace.SRGB,
394
394
  shaderLanguage: scene.getEngine().isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */,
395
395
  extraInitializationsAsync: async () => {
@@ -450,9 +450,10 @@ async function _RenderAsync(pt) {
450
450
  * result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to `TextureColorSpace.Linear`.
451
451
  * @param outputChannelMask - Optional bitmask of channels to write. Excluded color channels are set to
452
452
  * `0.0`; excluded alpha is set to `1.0`. Defaults to `ChannelMask.RGBA` (all channels written).
453
+ * @param outputOptions - Optional render-target type, sampling, and mipmap settings.
453
454
  * @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant
454
455
  */
455
- export async function MultiplyTexturesAsync(name, a, b, scene, outputColorSpace, outputChannelMask) {
456
+ export async function MultiplyTexturesAsync(name, a, b, scene, outputColorSpace, outputChannelMask, outputOptions) {
456
457
  if (!a.texture && !b.texture) {
457
458
  const factor = _MultiplyConstants(_EvalConstant(a), _EvalConstant(b));
458
459
  return { texture: null, factor: outputChannelMask ? _ApplyOutputChannelMask(factor, outputChannelMask) : factor };
@@ -474,7 +475,7 @@ export async function MultiplyTexturesAsync(name, a, b, scene, outputColorSpace,
474
475
  if (outputColorSpace) {
475
476
  defines.push("OUTPUT_SRGB");
476
477
  }
477
- const pt = _CreateProcessorTexture(name, defines, _ResolveOutputSize([a, b]), scene, outputColorSpace);
478
+ const pt = _CreateProcessorTexture(name, defines, _ResolveOutputSize([a, b]), scene, outputColorSpace, outputOptions);
478
479
  _SetOperandUniforms(pt, a, "textureA", "factorA", bakeTransform);
479
480
  _SetOperandUniforms(pt, b, "textureB", "factorB", bakeTransform);
480
481
  try {
@@ -515,9 +516,10 @@ export async function MultiplyTexturesAsync(name, a, b, scene, outputColorSpace,
515
516
  * result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to `TextureColorSpace.Linear`.
516
517
  * @param outputChannelMask - Optional bitmask of channels to write. Excluded color channels are set to
517
518
  * `0.0`; excluded alpha is set to `1.0`. Defaults to `ChannelMask.RGBA` (all channels written).
519
+ * @param outputOptions - Optional render-target type, sampling, and mipmap settings.
518
520
  * @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant
519
521
  */
520
- export async function MaxTexturesAsync(name, a, b, scene, outputColorSpace, outputChannelMask) {
522
+ export async function MaxTexturesAsync(name, a, b, scene, outputColorSpace, outputChannelMask, outputOptions) {
521
523
  if (!a.texture && !b.texture) {
522
524
  const factor = _MaxConstants(_EvalConstant(a), _EvalConstant(b));
523
525
  return { texture: null, factor: outputChannelMask ? _ApplyOutputChannelMask(factor, outputChannelMask) : factor };
@@ -540,7 +542,7 @@ export async function MaxTexturesAsync(name, a, b, scene, outputColorSpace, outp
540
542
  if (outputColorSpace) {
541
543
  defines.push("OUTPUT_SRGB");
542
544
  }
543
- const pt = _CreateProcessorTexture(name, defines, _ResolveOutputSize([a, b]), scene, outputColorSpace);
545
+ const pt = _CreateProcessorTexture(name, defines, _ResolveOutputSize([a, b]), scene, outputColorSpace, outputOptions);
544
546
  _SetOperandUniforms(pt, a, "textureA", "factorA", bakeTransform);
545
547
  _SetOperandUniforms(pt, b, "textureB", "factorB", bakeTransform);
546
548
  try {
@@ -583,9 +585,10 @@ export async function MaxTexturesAsync(name, a, b, scene, outputColorSpace, outp
583
585
  * result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to `TextureColorSpace.Linear`.
584
586
  * @param outputChannelMask - Optional bitmask of channels to write. Excluded color channels are set to
585
587
  * `0.0`; excluded alpha is set to `1.0`. Defaults to `ChannelMask.RGBA` (all channels written).
588
+ * @param outputOptions - Optional render-target type, sampling, and mipmap settings.
586
589
  * @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant
587
590
  */
588
- export async function LerpTexturesAsync(name, a, b, t, scene, outputColorSpace, outputChannelMask) {
591
+ export async function LerpTexturesAsync(name, a, b, t, scene, outputColorSpace, outputChannelMask, outputOptions) {
589
592
  if (!a.texture && !b.texture && !t.texture) {
590
593
  const factor = _LerpConstants(_EvalConstant(a), _EvalConstant(b), _EvalConstant(t));
591
594
  return { texture: null, factor: outputChannelMask ? _ApplyOutputChannelMask(factor, outputChannelMask) : factor };
@@ -612,7 +615,7 @@ export async function LerpTexturesAsync(name, a, b, t, scene, outputColorSpace,
612
615
  if (outputColorSpace) {
613
616
  defines.push("OUTPUT_SRGB");
614
617
  }
615
- const pt = _CreateProcessorTexture(name, defines, _ResolveOutputSize([a, b, t]), scene, outputColorSpace);
618
+ const pt = _CreateProcessorTexture(name, defines, _ResolveOutputSize([a, b, t]), scene, outputColorSpace, outputOptions);
616
619
  _SetOperandUniforms(pt, a, "textureA", "factorA", bakeTransform);
617
620
  _SetOperandUniforms(pt, b, "textureB", "factorB", bakeTransform);
618
621
  _SetLerpBlendUniforms(pt, t, bakeTransform);
@@ -659,9 +662,10 @@ export async function LerpTexturesAsync(name, a, b, t, scene, outputColorSpace,
659
662
  * result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to `TextureColorSpace.Linear`.
660
663
  * @param outputChannelMask - Optional bitmask of channels to write. Excluded color channels are set to
661
664
  * `0.0`; excluded alpha is set to `1.0`. Defaults to `ChannelMask.RGBA` (all channels written).
665
+ * @param outputOptions - Optional render-target type, sampling, and mipmap settings.
662
666
  * @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant
663
667
  */
664
- export async function InvertTextureAsync(name, input, scene, channels = ChannelMask.RGBA, outputColorSpace, outputChannelMask) {
668
+ export async function InvertTextureAsync(name, input, scene, channels = ChannelMask.RGBA, outputColorSpace, outputChannelMask, outputOptions) {
665
669
  if (!input.texture) {
666
670
  const c = _EvalConstant(input);
667
671
  const factor = new Color4(channels & ChannelMask.R ? 1 - c.r : c.r, channels & ChannelMask.G ? 1 - c.g : c.g, channels & ChannelMask.B ? 1 - c.b : c.b, channels & ChannelMask.A ? 1 - c.a : c.a);
@@ -672,7 +676,7 @@ export async function InvertTextureAsync(name, input, scene, channels = ChannelM
672
676
  if (outputColorSpace) {
673
677
  defines.push("OUTPUT_SRGB");
674
678
  }
675
- const pt = _CreateProcessorTexture(name, defines, _ResolveOutputSize([input]), scene, outputColorSpace);
679
+ const pt = _CreateProcessorTexture(name, defines, _ResolveOutputSize([input]), scene, outputColorSpace, outputOptions);
676
680
  _SetOperandUniforms(pt, input, "textureA", "factorA", false);
677
681
  try {
678
682
  await _RenderAsync(pt);
@@ -718,9 +722,10 @@ export async function InvertTextureAsync(name, input, scene, channels = ChannelM
718
722
  * result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to `TextureColorSpace.Linear`.
719
723
  * @param outputChannelMask - Optional bitmask of channels to write. Excluded color channels are set to
720
724
  * `0.0`; excluded alpha is set to `1.0`. Defaults to `ChannelMask.RGBA` (all channels written).
725
+ * @param outputOptions - Optional render-target type, sampling, and mipmap settings.
721
726
  * @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant
722
727
  */
723
- export async function ExtractMaxChannelAsync(name, input, scene, includeAlpha = false, outputColorSpace, outputChannelMask) {
728
+ export async function ExtractMaxChannelAsync(name, input, scene, includeAlpha = false, outputColorSpace, outputChannelMask, outputOptions) {
724
729
  if (!input.texture) {
725
730
  const c = _EvalConstant(input);
726
731
  const m = includeAlpha ? Math.max(c.r, c.g, c.b, c.a) : Math.max(c.r, c.g, c.b);
@@ -735,7 +740,7 @@ export async function ExtractMaxChannelAsync(name, input, scene, includeAlpha =
735
740
  if (outputColorSpace) {
736
741
  defines.push("OUTPUT_SRGB");
737
742
  }
738
- const pt = _CreateProcessorTexture(name, defines, _ResolveOutputSize([input]), scene, outputColorSpace);
743
+ const pt = _CreateProcessorTexture(name, defines, _ResolveOutputSize([input]), scene, outputColorSpace, outputOptions);
739
744
  _SetOperandUniforms(pt, input, "textureA", "factorA", false);
740
745
  try {
741
746
  await _RenderAsync(pt);
@@ -780,13 +785,14 @@ export async function ExtractMaxChannelAsync(name, input, scene, includeAlpha =
780
785
  * result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to `TextureColorSpace.Linear`.
781
786
  * @param outputChannelMask - Optional bitmask of channels to write. Excluded color channels are set to
782
787
  * `0.0`; excluded alpha is set to `1.0`. Defaults to `ChannelMask.RGBA` (all channels written).
788
+ * @param outputOptions - Optional render-target type, sampling, and mipmap settings.
783
789
  * @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant
784
790
  */
785
- export async function ExtractChannelAsync(name, input, channel, scene, outputColorSpace, outputChannelMask) {
791
+ export async function ExtractChannelAsync(name, input, channel, scene, outputColorSpace, outputChannelMask, outputOptions) {
786
792
  if (!input.texture) {
787
793
  const swizzled = _ApplyChannelSwizzle(_EvalConstant(input), channel);
788
794
  return { texture: null, factor: outputChannelMask ? _ApplyOutputChannelMask(swizzled, outputChannelMask) : swizzled };
789
795
  }
790
- return await MultiplyTexturesAsync(name, { ...input, channel }, CreateFactorOperand(new Color4(1, 1, 1, 1)), scene, outputColorSpace, outputChannelMask);
796
+ return await MultiplyTexturesAsync(name, { ...input, channel }, CreateFactorOperand(new Color4(1, 1, 1, 1)), scene, outputColorSpace, outputChannelMask, outputOptions);
791
797
  }
792
798
  //# sourceMappingURL=textureProcessor.js.map
@@ -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,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,C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B,EAAE,CAAC;QACnB,MAAM,CAAC,UAAU,GAAG,gBAAgB,CAAC;IACzC,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACrC,IAAY,EACZ,KAA6B,EAC7B,OAAuB,EACvB,KAAY,EACZ,gBAAoC,EACpC,iBAA+B;IAE/B,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QACjB,MAAM,QAAQ,GAAG,oBAAoB,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
+ {"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,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;AA4ED;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAA8B,EAAE,OAAwB,EAAE,UAA8B;IACzH,MAAM,EAAE,GAA2B,EAAE,OAAO,EAAE,CAA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H,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,EAAE,aAAa,CAAC,CAAC;AAC5K,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 * Controls the GPU texture created by a texture processing operation.\n */\nexport interface ITextureProcessorOutputOptions {\n /**\n * Texture type used by the render target. Defaults to `Constants.TEXTURETYPE_UNSIGNED_BYTE`.\n */\n textureType?: number;\n /**\n * Sampling mode used by the output texture. Defaults to `Constants.TEXTURE_BILINEAR_SAMPLINGMODE`.\n */\n samplingMode?: number;\n /**\n * Whether mipmaps are generated for the output texture. Defaults to `false`.\n */\n generateMipMaps?: boolean;\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 outputOptions?: ITextureProcessorOutputOptions\n): ProceduralTexture {\n const options: IProceduralTextureCreationOptions = {\n type: outputOptions?.textureType ?? Constants.TEXTURETYPE_UNSIGNED_BYTE,\n format: Constants.TEXTUREFORMAT_RGBA,\n samplingMode: outputOptions?.samplingMode ?? Constants.TEXTURE_BILINEAR_SAMPLINGMODE,\n generateDepthBuffer: false,\n generateMipMaps: outputOptions?.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 * @param outputOptions - Optional render-target type, sampling, and mipmap settings.\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 outputOptions?: ITextureProcessorOutputOptions\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, outputOptions);\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 * @param outputOptions - Optional render-target type, sampling, and mipmap settings.\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 outputOptions?: ITextureProcessorOutputOptions\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, outputOptions);\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 * @param outputOptions - Optional render-target type, sampling, and mipmap settings.\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 outputOptions?: ITextureProcessorOutputOptions\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, outputOptions);\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 * @param outputOptions - Optional render-target type, sampling, and mipmap settings.\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 outputOptions?: ITextureProcessorOutputOptions\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, outputOptions);\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 * @param outputOptions - Optional render-target type, sampling, and mipmap settings.\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 outputOptions?: ITextureProcessorOutputOptions\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, outputOptions);\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 * @param outputOptions - Optional render-target type, sampling, and mipmap settings.\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 outputOptions?: ITextureProcessorOutputOptions\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, outputOptions);\n}\n"]}
@@ -48,6 +48,9 @@ export class DrawWrapper {
48
48
  * @param resetContext If true, resets the draw context (default is true).
49
49
  */
50
50
  setEffect(effect, defines, resetContext = true) {
51
+ if (!resetContext && this.effect !== effect) {
52
+ this.drawContext?._releaseUniformBufferSlots?.();
53
+ }
51
54
  this.effect = effect;
52
55
  if (defines !== undefined) {
53
56
  this.defines = defines;
@@ -1 +1 @@
1
- {"version":3,"file":"drawWrapper.js","sourceRoot":"","sources":["../../../../dev/core/src/Materials/drawWrapper.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD;;;GAGG;AACH,MAAM,OAAO,WAAW;IAoCpB;;;;OAIG;IACI,MAAM,CAAC,SAAS,CAAC,MAA4B;QAChD,OAAQ,MAAiB,CAAC,kBAAkB,KAAK,SAAS,CAAC,CAAC,CAAE,MAAsB,CAAC,MAAM,CAAC,CAAC,CAAE,MAAiB,CAAC;IACrH,CAAC;IAED;;;;;OAKG;IACH,YAAY,MAAsB,EAAE,qBAAqB,GAAG,IAAI;QAjChE;;;WAGG;QACI,wBAAmB,GAAG,KAAK,CAAC;QAEnC;;;WAGG;QACI,2BAAsB,GAAG,IAAI,CAAC;QAErC;;;WAGG;QACI,iCAA4B,GAAsB,IAAI,CAAC;QAkB1D,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,iBAAiB,EAAE,CAAC;QAC9C,IAAI,qBAAqB,EAAE,CAAC;YACxB,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,qBAAqB,EAAE,CAAC;QAC1D,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACI,SAAS,CAAC,MAAwB,EAAE,OAA4C,EAAE,YAAY,GAAG,IAAI;QACxG,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YACxB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAC3B,CAAC;QACD,IAAI,YAAY,EAAE,CAAC;YACf,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,CAAC;QAC9B,CAAC;IACL,CAAC;IAED;;;;OAIG;IACI,OAAO,CAAC,SAAS,GAAG,KAAK;QAC5B,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YACd,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;YAC3B,IAAI,SAAS,EAAE,CAAC;gBACZ,MAAM,CAAC,OAAO,EAAE,CAAC;YACrB,CAAC;iBAAM,CAAC;gBACJ,WAAW,CAAC,YAAY,CAAC,GAAG,EAAE;oBAC1B,MAAM,CAAC,SAAS,EAAE,CAAC,oBAAoB,CAAC,OAAO,CAAC,GAAG,EAAE;wBACjD,MAAM,CAAC,OAAO,EAAE,CAAC;oBACrB,CAAC,CAAC,CAAC;gBACP,CAAC,CAAC,CAAC;YACP,CAAC;YACD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACvB,CAAC;QACD,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,CAAC;IAChC,CAAC;CACJ","sourcesContent":["import { type IDrawContext } from \"../Engines/IDrawContext\";\r\nimport { type IMaterialContext } from \"../Engines/IMaterialContext\";\r\nimport { type Nullable } from \"../types\";\r\n\r\nimport { type AbstractEngine } from \"../Engines/abstractEngine\";\r\nimport { type Effect } from \"./effect\";\r\nimport { type MaterialDefines } from \"./materialDefines\";\r\nimport { TimingTools } from \"core/Misc/timingTools\";\r\n\r\n/**\r\n * Wrapper for an effect and its associated material context and draw context.\r\n * This class is meant to encapsulate the effect and its related contexts, allowing for easier management of rendering states.\r\n */\r\nexport class DrawWrapper {\r\n /**\r\n * The effect associated with this wrapper.\r\n */\r\n public effect: Nullable<Effect>;\r\n /**\r\n * The defines associated with this wrapper.\r\n */\r\n public defines: Nullable<string | MaterialDefines>;\r\n /**\r\n * The material context associated with this wrapper.\r\n */\r\n public materialContext?: IMaterialContext;\r\n /**\r\n * The draw context associated with this wrapper.\r\n */\r\n public drawContext?: IDrawContext;\r\n\r\n /**\r\n * @internal\r\n * Specifies if the effect was previously ready\r\n */\r\n public _wasPreviouslyReady = false;\r\n\r\n /**\r\n * @internal\r\n * Forces the code from bindForSubMesh to be fully run the next time it is called\r\n */\r\n public _forceRebindOnNextCall = true;\r\n\r\n /**\r\n * @internal\r\n * Specifies if the effect was previously using instances\r\n */\r\n public _wasPreviouslyUsingInstances: Nullable<boolean> = null;\r\n\r\n /**\r\n * Retrieves the effect from a DrawWrapper or Effect instance.\r\n * @param effect The effect or DrawWrapper instance to retrieve the effect from.\r\n * @returns The effect associated with the given instance, or null if not found.\r\n */\r\n public static GetEffect(effect: Effect | DrawWrapper): Nullable<Effect> {\r\n return (effect as Effect).getPipelineContext === undefined ? (effect as DrawWrapper).effect : (effect as Effect);\r\n }\r\n\r\n /**\r\n * Creates a new DrawWrapper instance.\r\n * Note that drawContext is always created (but may end up being undefined if the engine doesn't need draw contexts), but materialContext is optional.\r\n * @param engine The engine to create the draw wrapper for.\r\n * @param createMaterialContext If true, creates a material context for this wrapper (default is true).\r\n */\r\n constructor(engine: AbstractEngine, createMaterialContext = true) {\r\n this.effect = null;\r\n this.defines = null;\r\n this.drawContext = engine.createDrawContext();\r\n if (createMaterialContext) {\r\n this.materialContext = engine.createMaterialContext();\r\n }\r\n }\r\n\r\n /**\r\n * Sets the effect and its associated defines for this wrapper.\r\n * @param effect The effect to associate with this wrapper.\r\n * @param defines The defines to associate with this wrapper.\r\n * @param resetContext If true, resets the draw context (default is true).\r\n */\r\n public setEffect(effect: Nullable<Effect>, defines?: Nullable<string | MaterialDefines>, resetContext = true): void {\r\n this.effect = effect;\r\n if (defines !== undefined) {\r\n this.defines = defines;\r\n }\r\n if (resetContext) {\r\n this.drawContext?.reset();\r\n }\r\n }\r\n\r\n /**\r\n * Disposes the effect wrapper and its resources\r\n * @param immediate if the effect should be disposed immediately or on the next frame.\r\n * If dispose() is not called during a scene or engine dispose, we want to delay the dispose of the underlying effect. Mostly to give a chance to user code to reuse the effect in some way.\r\n */\r\n public dispose(immediate = false): void {\r\n if (this.effect) {\r\n const effect = this.effect;\r\n if (immediate) {\r\n effect.dispose();\r\n } else {\r\n TimingTools.SetImmediate(() => {\r\n effect.getEngine().onEndFrameObservable.addOnce(() => {\r\n effect.dispose();\r\n });\r\n });\r\n }\r\n this.effect = null;\r\n }\r\n this.drawContext?.dispose();\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"drawWrapper.js","sourceRoot":"","sources":["../../../../dev/core/src/Materials/drawWrapper.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD;;;GAGG;AACH,MAAM,OAAO,WAAW;IAoCpB;;;;OAIG;IACI,MAAM,CAAC,SAAS,CAAC,MAA4B;QAChD,OAAQ,MAAiB,CAAC,kBAAkB,KAAK,SAAS,CAAC,CAAC,CAAE,MAAsB,CAAC,MAAM,CAAC,CAAC,CAAE,MAAiB,CAAC;IACrH,CAAC;IAED;;;;;OAKG;IACH,YAAY,MAAsB,EAAE,qBAAqB,GAAG,IAAI;QAjChE;;;WAGG;QACI,wBAAmB,GAAG,KAAK,CAAC;QAEnC;;;WAGG;QACI,2BAAsB,GAAG,IAAI,CAAC;QAErC;;;WAGG;QACI,iCAA4B,GAAsB,IAAI,CAAC;QAkB1D,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,CAAC,OAAO,G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ent":["import { type IDrawContext } from \"../Engines/IDrawContext\";\r\nimport { type IMaterialContext } from \"../Engines/IMaterialContext\";\r\nimport { type Nullable } from \"../types\";\r\n\r\nimport { type AbstractEngine } from \"../Engines/abstractEngine\";\r\nimport { type Effect } from \"./effect\";\r\nimport { type MaterialDefines } from \"./materialDefines\";\r\nimport { TimingTools } from \"core/Misc/timingTools\";\r\n\r\n/**\r\n * Wrapper for an effect and its associated material context and draw context.\r\n * This class is meant to encapsulate the effect and its related contexts, allowing for easier management of rendering states.\r\n */\r\nexport class DrawWrapper {\r\n /**\r\n * The effect associated with this wrapper.\r\n */\r\n public effect: Nullable<Effect>;\r\n /**\r\n * The defines associated with this wrapper.\r\n */\r\n public defines: Nullable<string | MaterialDefines>;\r\n /**\r\n * The material context associated with this wrapper.\r\n */\r\n public materialContext?: IMaterialContext;\r\n /**\r\n * The draw context associated with this wrapper.\r\n */\r\n public drawContext?: IDrawContext;\r\n\r\n /**\r\n * @internal\r\n * Specifies if the effect was previously ready\r\n */\r\n public _wasPreviouslyReady = false;\r\n\r\n /**\r\n * @internal\r\n * Forces the code from bindForSubMesh to be fully run the next time it is called\r\n */\r\n public _forceRebindOnNextCall = true;\r\n\r\n /**\r\n * @internal\r\n * Specifies if the effect was previously using instances\r\n */\r\n public _wasPreviouslyUsingInstances: Nullable<boolean> = null;\r\n\r\n /**\r\n * Retrieves the effect from a DrawWrapper or Effect instance.\r\n * @param effect The effect or DrawWrapper instance to retrieve the effect from.\r\n * @returns The effect associated with the given instance, or null if not found.\r\n */\r\n public static GetEffect(effect: Effect | DrawWrapper): Nullable<Effect> {\r\n return (effect as Effect).getPipelineContext === undefined ? (effect as DrawWrapper).effect : (effect as Effect);\r\n }\r\n\r\n /**\r\n * Creates a new DrawWrapper instance.\r\n * Note that drawContext is always created (but may end up being undefined if the engine doesn't need draw contexts), but materialContext is optional.\r\n * @param engine The engine to create the draw wrapper for.\r\n * @param createMaterialContext If true, creates a material context for this wrapper (default is true).\r\n */\r\n constructor(engine: AbstractEngine, createMaterialContext = true) {\r\n this.effect = null;\r\n this.defines = null;\r\n this.drawContext = engine.createDrawContext();\r\n if (createMaterialContext) {\r\n this.materialContext = engine.createMaterialContext();\r\n }\r\n }\r\n\r\n /**\r\n * Sets the effect and its associated defines for this wrapper.\r\n * @param effect The effect to associate with this wrapper.\r\n * @param defines The defines to associate with this wrapper.\r\n * @param resetContext If true, resets the draw context (default is true).\r\n */\r\n public setEffect(effect: Nullable<Effect>, defines?: Nullable<string | MaterialDefines>, resetContext = true): void {\r\n if (!resetContext && this.effect !== effect) {\r\n this.drawContext?._releaseUniformBufferSlots?.();\r\n }\r\n this.effect = effect;\r\n if (defines !== undefined) {\r\n this.defines = defines;\r\n }\r\n if (resetContext) {\r\n this.drawContext?.reset();\r\n }\r\n }\r\n\r\n /**\r\n * Disposes the effect wrapper and its resources\r\n * @param immediate if the effect should be disposed immediately or on the next frame.\r\n * If dispose() is not called during a scene or engine dispose, we want to delay the dispose of the underlying effect. Mostly to give a chance to user code to reuse the effect in some way.\r\n */\r\n public dispose(immediate = false): void {\r\n if (this.effect) {\r\n const effect = this.effect;\r\n if (immediate) {\r\n effect.dispose();\r\n } else {\r\n TimingTools.SetImmediate(() => {\r\n effect.getEngine().onEndFrameObservable.addOnce(() => {\r\n effect.dispose();\r\n });\r\n });\r\n }\r\n this.effect = null;\r\n }\r\n this.drawContext?.dispose();\r\n }\r\n}\r\n"]}
@@ -6,6 +6,7 @@ import { MaterialDefines } from "./materialDefines.js";
6
6
  */
7
7
  export interface IImageProcessingConfigurationDefines {
8
8
  IMAGEPROCESSING: boolean;
9
+ WHITEBALANCE: boolean;
9
10
  VIGNETTE: boolean;
10
11
  VIGNETTEBLENDMODEMULTIPLY: boolean;
11
12
  VIGNETTEBLENDMODEOPAQUE: boolean;
@@ -29,6 +30,7 @@ type ImageProcessingDefinesMixinConstructor<T = {}> = new (...args: any[]) => T;
29
30
  export declare function ImageProcessingDefinesMixin<Tbase extends ImageProcessingDefinesMixinConstructor>(base: Tbase): {
30
31
  new (...args: any[]): {
31
32
  IMAGEPROCESSING: boolean;
33
+ WHITEBALANCE: boolean;
32
34
  VIGNETTE: boolean;
33
35
  VIGNETTEBLENDMODEMULTIPLY: boolean;
34
36
  VIGNETTEBLENDMODEOPAQUE: boolean;
@@ -50,6 +52,7 @@ export declare function ImageProcessingDefinesMixin<Tbase extends ImageProcessin
50
52
  */
51
53
  export declare class ImageProcessingConfigurationDefines extends MaterialDefines implements IImageProcessingConfigurationDefines {
52
54
  IMAGEPROCESSING: boolean;
55
+ WHITEBALANCE: boolean;
53
56
  VIGNETTE: boolean;
54
57
  VIGNETTEBLENDMODEMULTIPLY: boolean;
55
58
  VIGNETTEBLENDMODEOPAQUE: boolean;
@@ -9,6 +9,7 @@ export function ImageProcessingDefinesMixin(base) {
9
9
  super(...arguments);
10
10
  // Implement all members of IImageProcessingConfigurationDefines here
11
11
  this.IMAGEPROCESSING = false;
12
+ this.WHITEBALANCE = false;
12
13
  this.VIGNETTE = false;
13
14
  this.VIGNETTEBLENDMODEMULTIPLY = false;
14
15
  this.VIGNETTEBLENDMODEOPAQUE = false;
@@ -33,6 +34,7 @@ export class ImageProcessingConfigurationDefines extends MaterialDefines {
33
34
  constructor() {
34
35
  super();
35
36
  this.IMAGEPROCESSING = false;
37
+ this.WHITEBALANCE = false;
36
38
  this.VIGNETTE = false;
37
39
  this.VIGNETTEBLENDMODEMULTIPLY = false;
38
40
  this.VIGNETTEBLENDMODEOPAQUE = false;
@@ -1 +1 @@
1
- {"version":3,"file":"imageProcessingConfiguration.defines.js","sourceRoot":"","sources":["../../../../dev/core/src/Materials/imageProcessingConfiguration.defines.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AA0BpD;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CAAuD,IAAW;IACzG,OAAO,KAAM,SAAQ,IAAI;QAAlB;;YACH,qEAAqE;YAC9D,oBAAe,GAAG,KAAK,CAAC;YACxB,aAAQ,GAAG,KAAK,CAAC;YACjB,8BAAyB,GAAG,KAAK,CAAC;YAClC,4BAAuB,GAAG,KAAK,CAAC;YAChC,gBAAW,GAAG,CAAC,CAAC;YAChB,aAAQ,GAAG,KAAK,CAAC;YACjB,gBAAW,GAAG,KAAK,CAAC;YACpB,iBAAY,GAAG,KAAK,CAAC;YACrB,mBAAc,GAAG,KAAK,CAAC;YACvB,wBAAmB,GAAG,KAAK,CAAC;YAC5B,oBAAe,GAAG,KAAK,CAAC;YACxB,WAAM,GAAG,KAAK,CAAC;YACf,+BAA0B,GAAG,KAAK,CAAC;YACnC,wBAAmB,GAAG,KAAK,CAAC;YAC5B,aAAQ,GAAG,KAAK,CAAC;QAC5B,CAAC;KAAA,CAAC;AACN,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,mCAAoC,SAAQ,eAAe;IAiBpE;QACI,KAAK,EAAE,CAAC;QAjBL,oBAAe,GAAG,KAAK,CAAC;QACxB,aAAQ,GAAG,KAAK,CAAC;QACjB,8BAAyB,GAAG,KAAK,CAAC;QAClC,4BAAuB,GAAG,KAAK,CAAC;QAChC,gBAAW,GAAG,CAAC,CAAC;QAChB,aAAQ,GAAG,KAAK,CAAC;QACjB,gBAAW,GAAG,KAAK,CAAC;QACpB,iBAAY,GAAG,KAAK,CAAC;QACrB,mBAAc,GAAG,KAAK,CAAC;QACvB,wBAAmB,GAAG,KAAK,CAAC;QAC5B,oBAAe,GAAG,KAAK,CAAC;QACxB,WAAM,GAAG,KAAK,CAAC;QACf,+BAA0B,GAAG,KAAK,CAAC;QACnC,aAAQ,GAAG,KAAK,CAAC;QACjB,wBAAmB,GAAG,KAAK,CAAC;QAI/B,IAAI,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;CACJ","sourcesContent":["import { MaterialDefines } from \"./materialDefines\";\r\n/**\r\n * Interface to follow in your material defines to integrate easily the\r\n * Image processing functions.\r\n * @internal\r\n */\r\nexport interface IImageProcessingConfigurationDefines {\r\n IMAGEPROCESSING: boolean;\r\n VIGNETTE: boolean;\r\n VIGNETTEBLENDMODEMULTIPLY: boolean;\r\n VIGNETTEBLENDMODEOPAQUE: boolean;\r\n TONEMAPPING: number;\r\n CONTRAST: boolean;\r\n EXPOSURE: boolean;\r\n COLORCURVES: boolean;\r\n COLORGRADING: boolean;\r\n COLORGRADING3D: boolean;\r\n SAMPLER3DGREENDEPTH: boolean;\r\n SAMPLER3DBGRMAP: boolean;\r\n DITHER: boolean;\r\n IMAGEPROCESSINGPOSTPROCESS: boolean;\r\n SKIPFINALCOLORCLAMP: boolean;\r\n}\r\n\r\ntype ImageProcessingDefinesMixinConstructor<T = {}> = new (...args: any[]) => T;\r\n\r\n/**\r\n * Mixin to add Image processing defines to your material defines\r\n * @internal\r\n */\r\nexport function ImageProcessingDefinesMixin<Tbase extends ImageProcessingDefinesMixinConstructor>(base: Tbase) {\r\n return class extends base implements IImageProcessingConfigurationDefines {\r\n // Implement all members of IImageProcessingConfigurationDefines here\r\n public IMAGEPROCESSING = false;\r\n public VIGNETTE = false;\r\n public VIGNETTEBLENDMODEMULTIPLY = false;\r\n public VIGNETTEBLENDMODEOPAQUE = false;\r\n public TONEMAPPING = 0;\r\n public CONTRAST = false;\r\n public COLORCURVES = false;\r\n public COLORGRADING = false;\r\n public COLORGRADING3D = false;\r\n public SAMPLER3DGREENDEPTH = false;\r\n public SAMPLER3DBGRMAP = false;\r\n public DITHER = false;\r\n public IMAGEPROCESSINGPOSTPROCESS = false;\r\n public SKIPFINALCOLORCLAMP = false;\r\n public EXPOSURE = false;\r\n };\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class ImageProcessingConfigurationDefines extends MaterialDefines implements IImageProcessingConfigurationDefines {\r\n public IMAGEPROCESSING = false;\r\n public VIGNETTE = false;\r\n public VIGNETTEBLENDMODEMULTIPLY = false;\r\n public VIGNETTEBLENDMODEOPAQUE = false;\r\n public TONEMAPPING = 0;\r\n public CONTRAST = false;\r\n public COLORCURVES = false;\r\n public COLORGRADING = false;\r\n public COLORGRADING3D = false;\r\n public SAMPLER3DGREENDEPTH = false;\r\n public SAMPLER3DBGRMAP = false;\r\n public DITHER = false;\r\n public IMAGEPROCESSINGPOSTPROCESS = false;\r\n public EXPOSURE = false;\r\n public SKIPFINALCOLORCLAMP = false;\r\n\r\n constructor() {\r\n super();\r\n this.rebuild();\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"imageProcessingConfiguration.defines.js","sourceRoot":"","sources":["../../../../dev/core/src/Materials/imageProcessingConfiguration.defines.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AA2BpD;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CAAuD,IAAW;IACzG,OAAO,KAAM,SAAQ,IAAI;QAAlB;;YACH,qEAAqE;YAC9D,oBAAe,GAAG,KAAK,CAAC;YACxB,iBAAY,GAAG,KAAK,CAAC;YACrB,aAAQ,GAAG,KAAK,CAAC;YACjB,8BAAyB,GAAG,KAAK,CAAC;YAClC,4BAAuB,GAAG,KAAK,CAAC;YAChC,gBAAW,GAAG,CAAC,CAAC;YAChB,aAAQ,GAAG,KAAK,CAAC;YACjB,gBAAW,GAAG,KAAK,CAAC;YACpB,iBAAY,GAAG,KAAK,CAAC;YACrB,mBAAc,GAAG,KAAK,CAAC;YACvB,wBAAmB,GAAG,KAAK,CAAC;YAC5B,oBAAe,GAAG,KAAK,CAAC;YACxB,WAAM,GAAG,KAAK,CAAC;YACf,+BAA0B,GAAG,KAAK,CAAC;YACnC,wBAAmB,GAAG,KAAK,CAAC;YAC5B,aAAQ,GAAG,KAAK,CAAC;QAC5B,CAAC;KAAA,CAAC;AACN,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,mCAAoC,SAAQ,eAAe;IAkBpE;QACI,KAAK,EAAE,CAAC;QAlBL,oBAAe,GAAG,KAAK,CAAC;QACxB,iBAAY,GAAG,KAAK,CAAC;QACrB,aAAQ,GAAG,KAAK,CAAC;QACjB,8BAAyB,GAAG,KAAK,CAAC;QAClC,4BAAuB,GAAG,KAAK,CAAC;QAChC,gBAAW,GAAG,CAAC,CAAC;QAChB,aAAQ,GAAG,KAAK,CAAC;QACjB,gBAAW,GAAG,KAAK,CAAC;QACpB,iBAAY,GAAG,KAAK,CAAC;QACrB,mBAAc,GAAG,KAAK,CAAC;QACvB,wBAAmB,GAAG,KAAK,CAAC;QAC5B,oBAAe,GAAG,KAAK,CAAC;QACxB,WAAM,GAAG,KAAK,CAAC;QACf,+BAA0B,GAAG,KAAK,CAAC;QACnC,aAAQ,GAAG,KAAK,CAAC;QACjB,wBAAmB,GAAG,KAAK,CAAC;QAI/B,IAAI,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;CACJ","sourcesContent":["import { MaterialDefines } from \"./materialDefines\";\r\n/**\r\n * Interface to follow in your material defines to integrate easily the\r\n * Image processing functions.\r\n * @internal\r\n */\r\nexport interface IImageProcessingConfigurationDefines {\r\n IMAGEPROCESSING: boolean;\r\n WHITEBALANCE: boolean;\r\n VIGNETTE: boolean;\r\n VIGNETTEBLENDMODEMULTIPLY: boolean;\r\n VIGNETTEBLENDMODEOPAQUE: boolean;\r\n TONEMAPPING: number;\r\n CONTRAST: boolean;\r\n EXPOSURE: boolean;\r\n COLORCURVES: boolean;\r\n COLORGRADING: boolean;\r\n COLORGRADING3D: boolean;\r\n SAMPLER3DGREENDEPTH: boolean;\r\n SAMPLER3DBGRMAP: boolean;\r\n DITHER: boolean;\r\n IMAGEPROCESSINGPOSTPROCESS: boolean;\r\n SKIPFINALCOLORCLAMP: boolean;\r\n}\r\n\r\ntype ImageProcessingDefinesMixinConstructor<T = {}> = new (...args: any[]) => T;\r\n\r\n/**\r\n * Mixin to add Image processing defines to your material defines\r\n * @internal\r\n */\r\nexport function ImageProcessingDefinesMixin<Tbase extends ImageProcessingDefinesMixinConstructor>(base: Tbase) {\r\n return class extends base implements IImageProcessingConfigurationDefines {\r\n // Implement all members of IImageProcessingConfigurationDefines here\r\n public IMAGEPROCESSING = false;\r\n public WHITEBALANCE = false;\r\n public VIGNETTE = false;\r\n public VIGNETTEBLENDMODEMULTIPLY = false;\r\n public VIGNETTEBLENDMODEOPAQUE = false;\r\n public TONEMAPPING = 0;\r\n public CONTRAST = false;\r\n public COLORCURVES = false;\r\n public COLORGRADING = false;\r\n public COLORGRADING3D = false;\r\n public SAMPLER3DGREENDEPTH = false;\r\n public SAMPLER3DBGRMAP = false;\r\n public DITHER = false;\r\n public IMAGEPROCESSINGPOSTPROCESS = false;\r\n public SKIPFINALCOLORCLAMP = false;\r\n public EXPOSURE = false;\r\n };\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class ImageProcessingConfigurationDefines extends MaterialDefines implements IImageProcessingConfigurationDefines {\r\n public IMAGEPROCESSING = false;\r\n public WHITEBALANCE = false;\r\n public VIGNETTE = false;\r\n public VIGNETTEBLENDMODEMULTIPLY = false;\r\n public VIGNETTEBLENDMODEOPAQUE = false;\r\n public TONEMAPPING = 0;\r\n public CONTRAST = false;\r\n public COLORCURVES = false;\r\n public COLORGRADING = false;\r\n public COLORGRADING3D = false;\r\n public SAMPLER3DGREENDEPTH = false;\r\n public SAMPLER3DBGRMAP = false;\r\n public DITHER = false;\r\n public IMAGEPROCESSINGPOSTPROCESS = false;\r\n public EXPOSURE = false;\r\n public SKIPFINALCOLORCLAMP = false;\r\n\r\n constructor() {\r\n super();\r\n this.rebuild();\r\n }\r\n}\r\n"]}
@@ -5,6 +5,9 @@ import { PrepareUniformsForColorCurves } from "./colorCurves.functions.js";
5
5
  * @param defines the list of defines currently in use
6
6
  */
7
7
  export function PrepareUniformsForImageProcessing(uniforms, defines) {
8
+ if (defines.WHITEBALANCE) {
9
+ uniforms.push("whiteBalanceMatrix");
10
+ }
8
11
  if (defines.EXPOSURE) {
9
12
  uniforms.push("exposureLinear");
10
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"imageProcessingConfiguration.functions.js","sourceRoot":"","sources":["../../../../dev/core/src/Materials/imageProcessingConfiguration.functions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAGxE;;;;GAIG;AACH,MAAM,UAAU,iCAAiC,CAAC,QAAkB,EAAE,OAA6C;IAC/G,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;QACnB,QAAQ,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACpC,CAAC;IACD,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;QACnB,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC9B,CAAC;IACD,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;QACvB,QAAQ,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;IAC5C,CAAC;IACD,IAAI,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACrC,QAAQ,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;IACxC,CAAC;IACD,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;QACnB,QAAQ,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QACnC,QAAQ,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IACvC,CAAC;IACD,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;QACtB,6BAA6B,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACjB,QAAQ,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IACrC,CAAC;AACL,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iCAAiC,CAAC,YAAsB,EAAE,OAA6C;IACnH,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;QACvB,YAAY,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IAC1C,CAAC;AACL,CAAC","sourcesContent":["import { PrepareUniformsForColorCurves } from \"./colorCurves.functions\";\r\nimport { type IImageProcessingConfigurationDefines } from \"./imageProcessingConfiguration.defines\";\r\n\r\n/**\r\n * Prepare the list of uniforms associated with the Image Processing effects.\r\n * @param uniforms The list of uniforms used in the effect\r\n * @param defines the list of defines currently in use\r\n */\r\nexport function PrepareUniformsForImageProcessing(uniforms: string[], defines: IImageProcessingConfigurationDefines): void {\r\n if (defines.EXPOSURE) {\r\n uniforms.push(\"exposureLinear\");\r\n }\r\n if (defines.CONTRAST) {\r\n uniforms.push(\"contrast\");\r\n }\r\n if (defines.COLORGRADING) {\r\n uniforms.push(\"colorTransformSettings\");\r\n }\r\n if (defines.VIGNETTE || defines.DITHER) {\r\n uniforms.push(\"vInverseScreenSize\");\r\n }\r\n if (defines.VIGNETTE) {\r\n uniforms.push(\"vignetteSettings1\");\r\n uniforms.push(\"vignetteSettings2\");\r\n }\r\n if (defines.COLORCURVES) {\r\n PrepareUniformsForColorCurves(uniforms);\r\n }\r\n if (defines.DITHER) {\r\n uniforms.push(\"ditherIntensity\");\r\n }\r\n}\r\n\r\n/**\r\n * Prepare the list of samplers associated with the Image Processing effects.\r\n * @param samplersList The list of uniforms used in the effect\r\n * @param defines the list of defines currently in use\r\n */\r\nexport function PrepareSamplersForImageProcessing(samplersList: string[], defines: IImageProcessingConfigurationDefines): void {\r\n if (defines.COLORGRADING) {\r\n samplersList.push(\"txColorTransform\");\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"imageProcessingConfiguration.functions.js","sourceRoot":"","sources":["../../../../dev/core/src/Materials/imageProcessingConfiguration.functions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAGxE;;;;GAIG;AACH,MAAM,UAAU,iCAAiC,CAAC,QAAkB,EAAE,OAA6C;IAC/G,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;QACvB,QAAQ,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;IACxC,CAAC;IACD,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;QACnB,QAAQ,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACpC,CAAC;IACD,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;QACnB,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC9B,CAAC;IACD,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;QACvB,QAAQ,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;IAC5C,CAAC;IACD,IAAI,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACrC,QAAQ,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;IACxC,CAAC;IACD,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;QACnB,QAAQ,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QACnC,QAAQ,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IACvC,CAAC;IACD,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;QACtB,6BAA6B,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACjB,QAAQ,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IACrC,CAAC;AACL,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iCAAiC,CAAC,YAAsB,EAAE,OAA6C;IACnH,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;QACvB,YAAY,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IAC1C,CAAC;AACL,CAAC","sourcesContent":["import { PrepareUniformsForColorCurves } from \"./colorCurves.functions\";\r\nimport { type IImageProcessingConfigurationDefines } from \"./imageProcessingConfiguration.defines\";\r\n\r\n/**\r\n * Prepare the list of uniforms associated with the Image Processing effects.\r\n * @param uniforms The list of uniforms used in the effect\r\n * @param defines the list of defines currently in use\r\n */\r\nexport function PrepareUniformsForImageProcessing(uniforms: string[], defines: IImageProcessingConfigurationDefines): void {\r\n if (defines.WHITEBALANCE) {\r\n uniforms.push(\"whiteBalanceMatrix\");\r\n }\r\n if (defines.EXPOSURE) {\r\n uniforms.push(\"exposureLinear\");\r\n }\r\n if (defines.CONTRAST) {\r\n uniforms.push(\"contrast\");\r\n }\r\n if (defines.COLORGRADING) {\r\n uniforms.push(\"colorTransformSettings\");\r\n }\r\n if (defines.VIGNETTE || defines.DITHER) {\r\n uniforms.push(\"vInverseScreenSize\");\r\n }\r\n if (defines.VIGNETTE) {\r\n uniforms.push(\"vignetteSettings1\");\r\n uniforms.push(\"vignetteSettings2\");\r\n }\r\n if (defines.COLORCURVES) {\r\n PrepareUniformsForColorCurves(uniforms);\r\n }\r\n if (defines.DITHER) {\r\n uniforms.push(\"ditherIntensity\");\r\n }\r\n}\r\n\r\n/**\r\n * Prepare the list of samplers associated with the Image Processing effects.\r\n * @param samplersList The list of uniforms used in the effect\r\n * @param defines the list of defines currently in use\r\n */\r\nexport function PrepareSamplersForImageProcessing(samplersList: string[], defines: IImageProcessingConfigurationDefines): void {\r\n if (defines.COLORGRADING) {\r\n samplersList.push(\"txColorTransform\");\r\n }\r\n}\r\n"]}