@onerjs/core 9.0.1 → 9.0.3

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 (476) hide show
  1. package/Animations/animationGroup.pure.js.map +1 -1
  2. package/Buffers/buffer.pure.js +4 -0
  3. package/Buffers/buffer.pure.js.map +1 -1
  4. package/Cameras/camera.pure.d.ts +14 -0
  5. package/Cameras/camera.pure.js +15 -0
  6. package/Cameras/camera.pure.js.map +1 -1
  7. package/Compute/computeShader.pure.d.ts +2 -1
  8. package/Compute/computeShader.pure.js +29 -10
  9. package/Compute/computeShader.pure.js.map +1 -1
  10. package/Culling/ray.core.js +22 -9
  11. package/Culling/ray.core.js.map +1 -1
  12. package/Engines/IDrawContext.d.ts +2 -0
  13. package/Engines/IDrawContext.js.map +1 -1
  14. package/Engines/Native/nativeInterfaces.d.ts +55 -4
  15. package/Engines/Native/nativeInterfaces.js.map +1 -1
  16. package/Engines/Native/nativeRenderTargetWrapper.d.ts +1 -0
  17. package/Engines/Native/nativeRenderTargetWrapper.js +5 -1
  18. package/Engines/Native/nativeRenderTargetWrapper.js.map +1 -1
  19. package/Engines/Processors/shaderCodeInliner.d.ts +2 -0
  20. package/Engines/Processors/shaderCodeInliner.js +251 -6
  21. package/Engines/Processors/shaderCodeInliner.js.map +1 -1
  22. package/Engines/Processors/shaderProcessor.js +10 -1
  23. package/Engines/Processors/shaderProcessor.js.map +1 -1
  24. package/Engines/WebGPU/Extensions/engine.debugging.pure.js +12 -0
  25. package/Engines/WebGPU/Extensions/engine.debugging.pure.js.map +1 -1
  26. package/Engines/WebGPU/Extensions/engine.multiRender.pure.js +0 -1
  27. package/Engines/WebGPU/Extensions/engine.multiRender.pure.js.map +1 -1
  28. package/Engines/WebGPU/Extensions/engine.query.pure.js +5 -0
  29. package/Engines/WebGPU/Extensions/engine.query.pure.js.map +1 -1
  30. package/Engines/WebGPU/webgpuBufferManager.js +7 -0
  31. package/Engines/WebGPU/webgpuBufferManager.js.map +1 -1
  32. package/Engines/WebGPU/webgpuCacheTextureView.d.ts +1 -1
  33. package/Engines/WebGPU/webgpuCacheTextureView.js +20 -8
  34. package/Engines/WebGPU/webgpuCacheTextureView.js.map +1 -1
  35. package/Engines/WebGPU/webgpuDrawContext.d.ts +2 -0
  36. package/Engines/WebGPU/webgpuDrawContext.js +6 -0
  37. package/Engines/WebGPU/webgpuDrawContext.js.map +1 -1
  38. package/Engines/WebGPU/webgpuQuerySet.d.ts +3 -3
  39. package/Engines/WebGPU/webgpuQuerySet.js +23 -9
  40. package/Engines/WebGPU/webgpuQuerySet.js.map +1 -1
  41. package/Engines/WebGPU/webgpuRenderPassCommandStream.d.ts +156 -0
  42. package/Engines/WebGPU/webgpuRenderPassCommandStream.js +323 -0
  43. package/Engines/WebGPU/webgpuRenderPassCommandStream.js.map +1 -0
  44. package/Engines/WebGPU/webgpuTextureManager.d.ts +1 -1
  45. package/Engines/WebGPU/webgpuTextureManager.js +4 -3
  46. package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
  47. package/Engines/WebGPU/webgpuTimestampQuery.d.ts +3 -1
  48. package/Engines/WebGPU/webgpuTimestampQuery.js +9 -6
  49. package/Engines/WebGPU/webgpuTimestampQuery.js.map +1 -1
  50. package/Engines/abstractEngine.pure.d.ts +2 -0
  51. package/Engines/abstractEngine.pure.js +14 -5
  52. package/Engines/abstractEngine.pure.js.map +1 -1
  53. package/Engines/constants.d.ts +6 -0
  54. package/Engines/constants.js +6 -0
  55. package/Engines/constants.js.map +1 -1
  56. package/Engines/engine.d.ts +198 -24
  57. package/Engines/pure.d.ts +1 -0
  58. package/Engines/pure.js +1 -0
  59. package/Engines/pure.js.map +1 -1
  60. package/Engines/renderCommandBatcher.pure.d.ts +16 -0
  61. package/Engines/renderCommandBatcher.pure.js +24 -0
  62. package/Engines/renderCommandBatcher.pure.js.map +1 -0
  63. package/Engines/thinEngine.functions.js +3 -2
  64. package/Engines/thinEngine.functions.js.map +1 -1
  65. package/Engines/thinEngine.pure.js +18 -2
  66. package/Engines/thinEngine.pure.js.map +1 -1
  67. package/Engines/thinNativeEngine.pure.d.ts +10 -7
  68. package/Engines/thinNativeEngine.pure.js +117 -46
  69. package/Engines/thinNativeEngine.pure.js.map +1 -1
  70. package/Engines/thinWebGPUEngine.d.ts +8 -0
  71. package/Engines/thinWebGPUEngine.js +11 -0
  72. package/Engines/thinWebGPUEngine.js.map +1 -1
  73. package/Engines/webgpuEngine.pure.d.ts +60 -1
  74. package/Engines/webgpuEngine.pure.js +238 -42
  75. package/Engines/webgpuEngine.pure.js.map +1 -1
  76. package/FlowGraph/Blocks/Data/Audio/flowGraphGetSoundVolumeBlock.pure.d.ts +3 -3
  77. package/FlowGraph/Blocks/Data/Audio/flowGraphGetSoundVolumeBlock.pure.js +2 -1
  78. package/FlowGraph/Blocks/Data/Audio/flowGraphGetSoundVolumeBlock.pure.js.map +1 -1
  79. package/FlowGraph/Blocks/Data/Audio/flowGraphIsSoundPlayingBlock.pure.d.ts +3 -3
  80. package/FlowGraph/Blocks/Data/Audio/flowGraphIsSoundPlayingBlock.pure.js +2 -1
  81. package/FlowGraph/Blocks/Data/Audio/flowGraphIsSoundPlayingBlock.pure.js.map +1 -1
  82. package/FlowGraph/Blocks/Event/flowGraphMeshIntersectionEventBlock.d.ts +5 -0
  83. package/FlowGraph/Blocks/Event/flowGraphMeshIntersectionEventBlock.js +8 -0
  84. package/FlowGraph/Blocks/Event/flowGraphMeshIntersectionEventBlock.js.map +1 -0
  85. package/FlowGraph/Blocks/Event/flowGraphMeshIntersectionEventBlock.pure.d.ts +77 -0
  86. package/FlowGraph/Blocks/Event/flowGraphMeshIntersectionEventBlock.pure.js +141 -0
  87. package/FlowGraph/Blocks/Event/flowGraphMeshIntersectionEventBlock.pure.js.map +1 -0
  88. package/FlowGraph/Blocks/Event/flowGraphSoundEndedEventBlock.pure.d.ts +5 -3
  89. package/FlowGraph/Blocks/Event/flowGraphSoundEndedEventBlock.pure.js +38 -7
  90. package/FlowGraph/Blocks/Event/flowGraphSoundEndedEventBlock.pure.js.map +1 -1
  91. package/FlowGraph/Blocks/Event/index.d.ts +1 -0
  92. package/FlowGraph/Blocks/Event/index.js +1 -0
  93. package/FlowGraph/Blocks/Event/index.js.map +1 -1
  94. package/FlowGraph/Blocks/Event/pure.d.ts +1 -0
  95. package/FlowGraph/Blocks/Event/pure.js +1 -0
  96. package/FlowGraph/Blocks/Event/pure.js.map +1 -1
  97. package/FlowGraph/Blocks/Execution/Audio/flowGraphPauseSoundBlock.pure.d.ts +3 -3
  98. package/FlowGraph/Blocks/Execution/Audio/flowGraphPauseSoundBlock.pure.js +2 -1
  99. package/FlowGraph/Blocks/Execution/Audio/flowGraphPauseSoundBlock.pure.js.map +1 -1
  100. package/FlowGraph/Blocks/Execution/Audio/flowGraphPlaySoundBlock.pure.d.ts +3 -3
  101. package/FlowGraph/Blocks/Execution/Audio/flowGraphPlaySoundBlock.pure.js +2 -1
  102. package/FlowGraph/Blocks/Execution/Audio/flowGraphPlaySoundBlock.pure.js.map +1 -1
  103. package/FlowGraph/Blocks/Execution/Audio/flowGraphSetSoundVolumeBlock.pure.d.ts +3 -3
  104. package/FlowGraph/Blocks/Execution/Audio/flowGraphSetSoundVolumeBlock.pure.js +2 -1
  105. package/FlowGraph/Blocks/Execution/Audio/flowGraphSetSoundVolumeBlock.pure.js.map +1 -1
  106. package/FlowGraph/Blocks/Execution/Audio/flowGraphStopSoundBlock.pure.d.ts +3 -3
  107. package/FlowGraph/Blocks/Execution/Audio/flowGraphStopSoundBlock.pure.js +2 -1
  108. package/FlowGraph/Blocks/Execution/Audio/flowGraphStopSoundBlock.pure.js.map +1 -1
  109. package/FlowGraph/Blocks/allBlocks.pure.js +2 -0
  110. package/FlowGraph/Blocks/allBlocks.pure.js.map +1 -1
  111. package/FlowGraph/Blocks/flowGraphBlockFactory.js +2 -0
  112. package/FlowGraph/Blocks/flowGraphBlockFactory.js.map +1 -1
  113. package/FlowGraph/Blocks/flowGraphBlockNames.d.ts +1 -0
  114. package/FlowGraph/Blocks/flowGraphBlockNames.js +1 -0
  115. package/FlowGraph/Blocks/flowGraphBlockNames.js.map +1 -1
  116. package/FlowGraph/flowGraph.d.ts +12 -1
  117. package/FlowGraph/flowGraph.js +38 -0
  118. package/FlowGraph/flowGraph.js.map +1 -1
  119. package/FlowGraph/flowGraphCoordinator.d.ts +44 -0
  120. package/FlowGraph/flowGraphCoordinator.js +141 -0
  121. package/FlowGraph/flowGraphCoordinator.js.map +1 -1
  122. package/FlowGraph/flowGraphDataConnection.pure.js +41 -14
  123. package/FlowGraph/flowGraphDataConnection.pure.js.map +1 -1
  124. package/FlowGraph/flowGraphParser.js +105 -5
  125. package/FlowGraph/flowGraphParser.js.map +1 -1
  126. package/FlowGraph/flowGraphSoundAssets.d.ts +40 -0
  127. package/FlowGraph/flowGraphSoundAssets.js +33 -0
  128. package/FlowGraph/flowGraphSoundAssets.js.map +1 -0
  129. package/FlowGraph/index.d.ts +1 -0
  130. package/FlowGraph/index.js +1 -0
  131. package/FlowGraph/index.js.map +1 -1
  132. package/FlowGraph/pure.d.ts +1 -0
  133. package/FlowGraph/pure.js +1 -0
  134. package/FlowGraph/pure.js.map +1 -1
  135. package/FlowGraph/serialization.d.ts +8 -0
  136. package/FlowGraph/serialization.js +31 -12
  137. package/FlowGraph/serialization.js.map +1 -1
  138. package/FlowGraph/typeDefinitions.d.ts +25 -0
  139. package/FlowGraph/typeDefinitions.js.map +1 -1
  140. package/FrameGraph/Tasks/PostProcesses/taaTask.js +2 -0
  141. package/FrameGraph/Tasks/PostProcesses/taaTask.js.map +1 -1
  142. package/Instrumentation/engineInstrumentation.d.ts +1 -0
  143. package/Instrumentation/engineInstrumentation.js +25 -6
  144. package/Instrumentation/engineInstrumentation.js.map +1 -1
  145. package/Lights/Clustered/clusteredLightContainer.pure.js +2 -0
  146. package/Lights/Clustered/clusteredLightContainer.pure.js.map +1 -1
  147. package/Lights/Shadows/cascadedShadowGenerator.pure.d.ts +36 -1
  148. package/Lights/Shadows/cascadedShadowGenerator.pure.js +202 -27
  149. package/Lights/Shadows/cascadedShadowGenerator.pure.js.map +1 -1
  150. package/Lights/directionalLight.pure.d.ts +24 -10
  151. package/Lights/directionalLight.pure.js +29 -11
  152. package/Lights/directionalLight.pure.js.map +1 -1
  153. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js +4 -4
  154. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js.map +1 -1
  155. package/Materials/Node/Blocks/Dual/lightBlock.pure.js +1 -1
  156. package/Materials/Node/Blocks/Dual/lightBlock.pure.js.map +1 -1
  157. package/Materials/Node/Blocks/Input/inputBlock.pure.js +4 -0
  158. package/Materials/Node/Blocks/Input/inputBlock.pure.js.map +1 -1
  159. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.pure.d.ts +9 -0
  160. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.pure.js +23 -3
  161. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.pure.js.map +1 -1
  162. package/Materials/PBR/openpbrMaterial.pure.js +1 -1
  163. package/Materials/PBR/openpbrMaterial.pure.js.map +1 -1
  164. package/Materials/PBR/pbrBaseMaterial.pure.d.ts +9 -0
  165. package/Materials/PBR/pbrBaseMaterial.pure.js +60 -1
  166. package/Materials/PBR/pbrBaseMaterial.pure.js.map +1 -1
  167. package/Materials/PBR/pbrBaseSimpleMaterial.d.ts +11 -0
  168. package/Materials/PBR/pbrBaseSimpleMaterial.js +21 -2
  169. package/Materials/PBR/pbrBaseSimpleMaterial.js.map +1 -1
  170. package/Materials/PBR/pbrMaterial.pure.d.ts +12 -0
  171. package/Materials/PBR/pbrMaterial.pure.js +23 -3
  172. package/Materials/PBR/pbrMaterial.pure.js.map +1 -1
  173. package/Materials/Textures/Filtering/hdrIrradianceFiltering.d.ts +1 -0
  174. package/Materials/Textures/Filtering/hdrIrradianceFiltering.js +10 -0
  175. package/Materials/Textures/Filtering/hdrIrradianceFiltering.js.map +1 -1
  176. package/Materials/Textures/HTML/htmlInCanvasPolyfill.d.ts +5 -0
  177. package/Materials/Textures/HTML/htmlInCanvasPolyfill.js +7 -0
  178. package/Materials/Textures/HTML/htmlInCanvasPolyfill.js.map +1 -1
  179. package/Materials/Textures/HTML/htmlInteractionManager.d.ts +9 -3
  180. package/Materials/Textures/HTML/htmlInteractionManager.js +64 -5
  181. package/Materials/Textures/HTML/htmlInteractionManager.js.map +1 -1
  182. package/Materials/Textures/HTML/htmlTexture.d.ts +11 -11
  183. package/Materials/Textures/HTML/htmlTexture.js +106 -65
  184. package/Materials/Textures/HTML/htmlTexture.js.map +1 -1
  185. package/Materials/Textures/Loaders/internalTextureLoader.d.ts +2 -1
  186. package/Materials/Textures/Loaders/internalTextureLoader.js.map +1 -1
  187. package/Materials/Textures/Loaders/ktxTextureLoader.d.ts +2 -1
  188. package/Materials/Textures/Loaders/ktxTextureLoader.js +4 -50
  189. package/Materials/Textures/Loaders/ktxTextureLoader.js.map +1 -1
  190. package/Materials/Textures/Procedurals/proceduralTexture.pure.js +10 -0
  191. package/Materials/Textures/Procedurals/proceduralTexture.pure.js.map +1 -1
  192. package/Materials/Textures/dynamicTexture.pure.js +6 -0
  193. package/Materials/Textures/dynamicTexture.pure.js.map +1 -1
  194. package/Materials/Textures/ktx2encoderTypes.d.ts +51 -0
  195. package/Materials/Textures/ktx2encoderTypes.js +2 -0
  196. package/Materials/Textures/ktx2encoderTypes.js.map +1 -0
  197. package/Materials/Textures/renderTargetTexture.pure.js +10 -2
  198. package/Materials/Textures/renderTargetTexture.pure.js.map +1 -1
  199. package/Materials/Textures/texture.pure.js +7 -1
  200. package/Materials/Textures/texture.pure.js.map +1 -1
  201. package/Materials/Textures/textureMerger.d.ts +11 -0
  202. package/Materials/Textures/textureMerger.js +34 -19
  203. package/Materials/Textures/textureMerger.js.map +1 -1
  204. package/Materials/Textures/textureProcessor.d.ts +145 -0
  205. package/Materials/Textures/textureProcessor.js +445 -45
  206. package/Materials/Textures/textureProcessor.js.map +1 -1
  207. package/Materials/Textures/textureSampling.functions.d.ts +41 -0
  208. package/Materials/Textures/textureSampling.functions.js +82 -0
  209. package/Materials/Textures/textureSampling.functions.js.map +1 -0
  210. package/Materials/drawWrapper.d.ts +8 -0
  211. package/Materials/drawWrapper.js +19 -0
  212. package/Materials/drawWrapper.js.map +1 -1
  213. package/Materials/effect.pure.d.ts +6 -0
  214. package/Materials/effect.pure.js +28 -6
  215. package/Materials/effect.pure.js.map +1 -1
  216. package/Materials/effect.webgl.functions.pure.js +1 -1
  217. package/Materials/effect.webgl.functions.pure.js.map +1 -1
  218. package/Materials/material.pure.d.ts +5 -0
  219. package/Materials/material.pure.js +9 -2
  220. package/Materials/material.pure.js.map +1 -1
  221. package/Materials/materialFlags.d.ts +6 -0
  222. package/Materials/materialFlags.js +14 -0
  223. package/Materials/materialFlags.js.map +1 -1
  224. package/Materials/materialHelper.functions.d.ts +2 -1
  225. package/Materials/materialHelper.functions.js +36 -2
  226. package/Materials/materialHelper.functions.js.map +1 -1
  227. package/Materials/materialHelper.geometryrendering.js +19 -16
  228. package/Materials/materialHelper.geometryrendering.js.map +1 -1
  229. package/Materials/materialPluginManager.pure.js +12 -8
  230. package/Materials/materialPluginManager.pure.js.map +1 -1
  231. package/Materials/prePassConfiguration.js +19 -16
  232. package/Materials/prePassConfiguration.js.map +1 -1
  233. package/Materials/shaderMaterial.pure.js +19 -6
  234. package/Materials/shaderMaterial.pure.js.map +1 -1
  235. package/Materials/shadowDepthWrapper.d.ts +6 -0
  236. package/Materials/shadowDepthWrapper.js +17 -0
  237. package/Materials/shadowDepthWrapper.js.map +1 -1
  238. package/Meshes/Compression/dracoCodec.d.ts +14 -0
  239. package/Meshes/Compression/dracoCodec.js +22 -0
  240. package/Meshes/Compression/dracoCodec.js.map +1 -1
  241. package/Meshes/Compression/dracoDecoder.d.ts +1 -0
  242. package/Meshes/Compression/dracoDecoder.js +27 -0
  243. package/Meshes/Compression/dracoDecoder.js.map +1 -1
  244. package/Meshes/Compression/dracoEncoder.d.ts +1 -0
  245. package/Meshes/Compression/dracoEncoder.js +8 -0
  246. package/Meshes/Compression/dracoEncoder.js.map +1 -1
  247. package/Meshes/Compression/meshoptCompression.d.ts +1 -0
  248. package/Meshes/Compression/meshoptCompression.js +9 -0
  249. package/Meshes/Compression/meshoptCompression.js.map +1 -1
  250. package/Meshes/GaussianSplatting/gaussianSplattingGpuSorter.d.ts +415 -0
  251. package/Meshes/GaussianSplatting/gaussianSplattingGpuSorter.js +912 -0
  252. package/Meshes/GaussianSplatting/gaussianSplattingGpuSorter.js.map +1 -0
  253. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.d.ts +3 -0
  254. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js +40 -9
  255. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js.map +1 -1
  256. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.d.ts +112 -8
  257. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +696 -74
  258. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
  259. package/Meshes/abstractMesh.pure.js +12 -4
  260. package/Meshes/abstractMesh.pure.js.map +1 -1
  261. package/Meshes/geometry.d.ts +5 -0
  262. package/Meshes/geometry.js +25 -0
  263. package/Meshes/geometry.js.map +1 -1
  264. package/Meshes/index.d.ts +1 -0
  265. package/Meshes/index.js +1 -0
  266. package/Meshes/index.js.map +1 -1
  267. package/Meshes/mesh.pure.d.ts +7 -0
  268. package/Meshes/mesh.pure.js +18 -13
  269. package/Meshes/mesh.pure.js.map +1 -1
  270. package/Meshes/pure.d.ts +1 -0
  271. package/Meshes/pure.js +1 -0
  272. package/Meshes/pure.js.map +1 -1
  273. package/Meshes/subMesh.pure.d.ts +3 -0
  274. package/Meshes/subMesh.pure.js +26 -0
  275. package/Meshes/subMesh.pure.js.map +1 -1
  276. package/Meshes/thinInstanceMesh.pure.js +5 -3
  277. package/Meshes/thinInstanceMesh.pure.js.map +1 -1
  278. package/Misc/index.d.ts +1 -0
  279. package/Misc/index.js +1 -0
  280. package/Misc/index.js.map +1 -1
  281. package/Misc/khronosTextureContainer2.d.ts +3 -2
  282. package/Misc/khronosTextureContainer2.js +24 -6
  283. package/Misc/khronosTextureContainer2.js.map +1 -1
  284. package/Misc/khronosTextureContainer2Encoder.d.ts +166 -0
  285. package/Misc/khronosTextureContainer2Encoder.js +556 -0
  286. package/Misc/khronosTextureContainer2Encoder.js.map +1 -0
  287. package/Misc/khronosTextureContainer2EncoderWorker.d.ts +61 -0
  288. package/Misc/khronosTextureContainer2EncoderWorker.js +55 -0
  289. package/Misc/khronosTextureContainer2EncoderWorker.js.map +1 -0
  290. package/Misc/pure.d.ts +1 -0
  291. package/Misc/pure.js +1 -0
  292. package/Misc/pure.js.map +1 -1
  293. package/Misc/textureFormat.functions.d.ts +6 -0
  294. package/Misc/textureFormat.functions.js +54 -0
  295. package/Misc/textureFormat.functions.js.map +1 -0
  296. package/Misc/textureTools.d.ts +6 -2
  297. package/Misc/textureTools.js +100 -42
  298. package/Misc/textureTools.js.map +1 -1
  299. package/Misc/tools.pure.js +1 -1
  300. package/Misc/tools.pure.js.map +1 -1
  301. package/Particles/Node/Blocks/systemBlock.pure.d.ts +1 -1
  302. package/Particles/Node/Blocks/systemBlock.pure.js +6 -3
  303. package/Particles/Node/Blocks/systemBlock.pure.js.map +1 -1
  304. package/Particles/computeShaderParticleSystem.pure.js +5 -0
  305. package/Particles/computeShaderParticleSystem.pure.js.map +1 -1
  306. package/Particles/gpuParticleSystem.pure.d.ts +2 -0
  307. package/Particles/gpuParticleSystem.pure.js +25 -1
  308. package/Particles/gpuParticleSystem.pure.js.map +1 -1
  309. package/Particles/solidParticle.d.ts +5 -0
  310. package/Particles/solidParticle.js +5 -0
  311. package/Particles/solidParticle.js.map +1 -1
  312. package/Particles/solidParticleSystem.d.ts +10 -0
  313. package/Particles/solidParticleSystem.js +72 -13
  314. package/Particles/solidParticleSystem.js.map +1 -1
  315. package/Particles/thinParticleSystem.pure.js +4 -0
  316. package/Particles/thinParticleSystem.pure.js.map +1 -1
  317. package/PostProcesses/RenderPipeline/Pipelines/taaMaterialManager.pure.d.ts +27 -6
  318. package/PostProcesses/RenderPipeline/Pipelines/taaMaterialManager.pure.js +60 -5
  319. package/PostProcesses/RenderPipeline/Pipelines/taaMaterialManager.pure.js.map +1 -1
  320. package/PostProcesses/thinTAAPostProcess.d.ts +1 -0
  321. package/PostProcesses/thinTAAPostProcess.js +17 -1
  322. package/PostProcesses/thinTAAPostProcess.js.map +1 -1
  323. package/PostProcesses/volumetricLightScatteringPostProcess.pure.d.ts +2 -1
  324. package/PostProcesses/volumetricLightScatteringPostProcess.pure.js +6 -5
  325. package/PostProcesses/volumetricLightScatteringPostProcess.pure.js.map +1 -1
  326. package/Rendering/boundingBoxRenderer.pure.js +2 -3
  327. package/Rendering/boundingBoxRenderer.pure.js.map +1 -1
  328. package/Rendering/geometryBufferRenderer.pure.js +8 -2
  329. package/Rendering/geometryBufferRenderer.pure.js.map +1 -1
  330. package/Rendering/objectRenderer.d.ts +1 -0
  331. package/Rendering/objectRenderer.js +14 -0
  332. package/Rendering/objectRenderer.js.map +1 -1
  333. package/Shaders/ShadersInclude/bumpFragmentMainFunctions.js +2 -2
  334. package/Shaders/ShadersInclude/bumpFragmentMainFunctions.js.map +1 -1
  335. package/Shaders/ShadersInclude/bumpVertex.js +1 -1
  336. package/Shaders/ShadersInclude/bumpVertex.js.map +1 -1
  337. package/Shaders/ShadersInclude/bumpVertexDeclaration.js +1 -1
  338. package/Shaders/ShadersInclude/bumpVertexDeclaration.js.map +1 -1
  339. package/Shaders/ShadersInclude/hdrFilteringFunctions.js +5 -1
  340. package/Shaders/ShadersInclude/hdrFilteringFunctions.js.map +1 -1
  341. package/Shaders/ShadersInclude/helperFunctions.js +2 -2
  342. package/Shaders/ShadersInclude/helperFunctions.js.map +1 -1
  343. package/Shaders/ShadersInclude/openpbrBackgroundTransmission.js +1 -1
  344. package/Shaders/ShadersInclude/openpbrBackgroundTransmission.js.map +1 -1
  345. package/Shaders/ShadersInclude/openpbrVertexDeclaration.js +6 -0
  346. package/Shaders/ShadersInclude/openpbrVertexDeclaration.js.map +1 -1
  347. package/Shaders/ShadersInclude/pbrBlockFinalLitComponents.js +11 -1
  348. package/Shaders/ShadersInclude/pbrBlockFinalLitComponents.js.map +1 -1
  349. package/Shaders/ShadersInclude/pbrBlockNormalFinal.js +9 -0
  350. package/Shaders/ShadersInclude/pbrBlockNormalFinal.js.map +1 -1
  351. package/Shaders/ShadersInclude/pbrBlockReflectance.js +1 -1
  352. package/Shaders/ShadersInclude/pbrBlockReflectance.js.map +1 -1
  353. package/Shaders/ShadersInclude/pbrClusteredLightingFunctions.js +1 -1
  354. package/Shaders/ShadersInclude/pbrClusteredLightingFunctions.js.map +1 -1
  355. package/Shaders/ShadersInclude/pbrFragmentDeclaration.js +7 -1
  356. package/Shaders/ShadersInclude/pbrFragmentDeclaration.js.map +1 -1
  357. package/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.js +1 -0
  358. package/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.js.map +1 -1
  359. package/Shaders/ShadersInclude/pbrIBLFunctions.js +12 -0
  360. package/Shaders/ShadersInclude/pbrIBLFunctions.js.map +1 -1
  361. package/Shaders/ShadersInclude/pbrUboDeclaration.js +1 -1
  362. package/Shaders/ShadersInclude/pbrUboDeclaration.js.map +1 -1
  363. package/Shaders/ShadersInclude/pbrVertexDeclaration.js +3 -0
  364. package/Shaders/ShadersInclude/pbrVertexDeclaration.js.map +1 -1
  365. package/Shaders/geometry.vertex.js +6 -6
  366. package/Shaders/geometry.vertex.js.map +1 -1
  367. package/Shaders/gpuUpdateParticles.vertex.js +1 -1
  368. package/Shaders/gpuUpdateParticles.vertex.js.map +1 -1
  369. package/Shaders/lod.fragment.js +15 -2
  370. package/Shaders/lod.fragment.js.map +1 -1
  371. package/Shaders/lod3D.fragment.js +15 -2
  372. package/Shaders/lod3D.fragment.js.map +1 -1
  373. package/Shaders/lodCube.fragment.js +15 -2
  374. package/Shaders/lodCube.fragment.js.map +1 -1
  375. package/Shaders/openpbr.vertex.js +2 -0
  376. package/Shaders/openpbr.vertex.js.map +1 -1
  377. package/Shaders/pbr.fragment.js +12 -1
  378. package/Shaders/pbr.fragment.js.map +1 -1
  379. package/Shaders/pbr.vertex.js +2 -0
  380. package/Shaders/pbr.vertex.js.map +1 -1
  381. package/Shaders/textureMerger.fragment.js +28 -0
  382. package/Shaders/textureMerger.fragment.js.map +1 -1
  383. package/Shaders/textureProcessor.fragment.js +26 -4
  384. package/Shaders/textureProcessor.fragment.js.map +1 -1
  385. package/Shaders/volumetricLightScattering.fragment.js +1 -1
  386. package/Shaders/volumetricLightScattering.fragment.js.map +1 -1
  387. package/ShadersWGSL/ShadersInclude/bumpFragmentMainFunctions.js +2 -2
  388. package/ShadersWGSL/ShadersInclude/bumpFragmentMainFunctions.js.map +1 -1
  389. package/ShadersWGSL/ShadersInclude/bumpVertex.js +1 -1
  390. package/ShadersWGSL/ShadersInclude/bumpVertex.js.map +1 -1
  391. package/ShadersWGSL/ShadersInclude/bumpVertexDeclaration.js +1 -1
  392. package/ShadersWGSL/ShadersInclude/bumpVertexDeclaration.js.map +1 -1
  393. package/ShadersWGSL/ShadersInclude/hdrFilteringFunctions.js +1 -1
  394. package/ShadersWGSL/ShadersInclude/hdrFilteringFunctions.js.map +1 -1
  395. package/ShadersWGSL/ShadersInclude/helperFunctions.js +2 -2
  396. package/ShadersWGSL/ShadersInclude/helperFunctions.js.map +1 -1
  397. package/ShadersWGSL/ShadersInclude/lightFragment.js +44 -2
  398. package/ShadersWGSL/ShadersInclude/lightFragment.js.map +1 -1
  399. package/ShadersWGSL/ShadersInclude/lightUboDeclaration.js +17 -3
  400. package/ShadersWGSL/ShadersInclude/lightUboDeclaration.js.map +1 -1
  401. package/ShadersWGSL/ShadersInclude/lightVxUboDeclaration.js +12 -1
  402. package/ShadersWGSL/ShadersInclude/lightVxUboDeclaration.js.map +1 -1
  403. package/ShadersWGSL/ShadersInclude/openpbrBackgroundTransmission.js +1 -1
  404. package/ShadersWGSL/ShadersInclude/openpbrBackgroundTransmission.js.map +1 -1
  405. package/ShadersWGSL/ShadersInclude/pbrBlockFinalLitComponents.js +11 -1
  406. package/ShadersWGSL/ShadersInclude/pbrBlockFinalLitComponents.js.map +1 -1
  407. package/ShadersWGSL/ShadersInclude/pbrBlockNormalFinal.js +9 -0
  408. package/ShadersWGSL/ShadersInclude/pbrBlockNormalFinal.js.map +1 -1
  409. package/ShadersWGSL/ShadersInclude/pbrBlockReflectance.js +1 -1
  410. package/ShadersWGSL/ShadersInclude/pbrBlockReflectance.js.map +1 -1
  411. package/ShadersWGSL/ShadersInclude/pbrClusteredLightingFunctions.js +1 -1
  412. package/ShadersWGSL/ShadersInclude/pbrClusteredLightingFunctions.js.map +1 -1
  413. package/ShadersWGSL/ShadersInclude/pbrDirectLightingSetupFunctions.js +1 -1
  414. package/ShadersWGSL/ShadersInclude/pbrDirectLightingSetupFunctions.js.map +1 -1
  415. package/ShadersWGSL/ShadersInclude/pbrFragmentSamplersDeclaration.js +1 -0
  416. package/ShadersWGSL/ShadersInclude/pbrFragmentSamplersDeclaration.js.map +1 -1
  417. package/ShadersWGSL/ShadersInclude/pbrIBLFunctions.js +8 -0
  418. package/ShadersWGSL/ShadersInclude/pbrIBLFunctions.js.map +1 -1
  419. package/ShadersWGSL/ShadersInclude/pbrUboDeclaration.js +1 -1
  420. package/ShadersWGSL/ShadersInclude/pbrUboDeclaration.js.map +1 -1
  421. package/ShadersWGSL/ShadersInclude/prePassVertex.js +2 -2
  422. package/ShadersWGSL/ShadersInclude/prePassVertex.js.map +1 -1
  423. package/ShadersWGSL/ShadersInclude/prePassVertexDeclaration.js +1 -1
  424. package/ShadersWGSL/ShadersInclude/prePassVertexDeclaration.js.map +1 -1
  425. package/ShadersWGSL/ShadersInclude/sceneUboDeclaration.js +3 -1
  426. package/ShadersWGSL/ShadersInclude/sceneUboDeclaration.js.map +1 -1
  427. package/ShadersWGSL/ShadersInclude/shadowsVertex.js +16 -0
  428. package/ShadersWGSL/ShadersInclude/shadowsVertex.js.map +1 -1
  429. package/ShadersWGSL/default.fragment.js +4 -4
  430. package/ShadersWGSL/default.fragment.js.map +1 -1
  431. package/ShadersWGSL/default.vertex.js +1 -1
  432. package/ShadersWGSL/default.vertex.js.map +1 -1
  433. package/ShadersWGSL/gaussianSplatting.vertex.js +3 -3
  434. package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
  435. package/ShadersWGSL/gpuUpdateParticles.compute.js +1 -1
  436. package/ShadersWGSL/gpuUpdateParticles.compute.js.map +1 -1
  437. package/ShadersWGSL/gsSortCount.compute.d.ts +5 -0
  438. package/ShadersWGSL/gsSortCount.compute.js +19 -0
  439. package/ShadersWGSL/gsSortCount.compute.js.map +1 -0
  440. package/ShadersWGSL/gsSortKeys.compute.d.ts +5 -0
  441. package/ShadersWGSL/gsSortKeys.compute.js +49 -0
  442. package/ShadersWGSL/gsSortKeys.compute.js.map +1 -0
  443. package/ShadersWGSL/gsSortOutput.compute.d.ts +5 -0
  444. package/ShadersWGSL/gsSortOutput.compute.js +28 -0
  445. package/ShadersWGSL/gsSortOutput.compute.js.map +1 -0
  446. package/ShadersWGSL/gsSortScanLocal.compute.d.ts +5 -0
  447. package/ShadersWGSL/gsSortScanLocal.compute.js +23 -0
  448. package/ShadersWGSL/gsSortScanLocal.compute.js.map +1 -0
  449. package/ShadersWGSL/gsSortScanSums.compute.d.ts +5 -0
  450. package/ShadersWGSL/gsSortScanSums.compute.js +19 -0
  451. package/ShadersWGSL/gsSortScanSums.compute.js.map +1 -0
  452. package/ShadersWGSL/gsSortScatter.compute.d.ts +5 -0
  453. package/ShadersWGSL/gsSortScatter.compute.js +33 -0
  454. package/ShadersWGSL/gsSortScatter.compute.js.map +1 -0
  455. package/ShadersWGSL/lod.fragment.js +14 -2
  456. package/ShadersWGSL/lod.fragment.js.map +1 -1
  457. package/ShadersWGSL/lod3D.fragment.js +14 -2
  458. package/ShadersWGSL/lod3D.fragment.js.map +1 -1
  459. package/ShadersWGSL/lodCube.fragment.js +14 -2
  460. package/ShadersWGSL/lodCube.fragment.js.map +1 -1
  461. package/ShadersWGSL/openpbr.vertex.js +3 -1
  462. package/ShadersWGSL/openpbr.vertex.js.map +1 -1
  463. package/ShadersWGSL/pbr.fragment.js +11 -0
  464. package/ShadersWGSL/pbr.fragment.js.map +1 -1
  465. package/ShadersWGSL/pbr.vertex.js +3 -1
  466. package/ShadersWGSL/pbr.vertex.js.map +1 -1
  467. package/ShadersWGSL/textureMerger.fragment.js +40 -4
  468. package/ShadersWGSL/textureMerger.fragment.js.map +1 -1
  469. package/ShadersWGSL/textureProcessor.fragment.js +26 -4
  470. package/ShadersWGSL/textureProcessor.fragment.js.map +1 -1
  471. package/Sprites/spriteRenderer.js +15 -5
  472. package/Sprites/spriteRenderer.js.map +1 -1
  473. package/package.json +1 -1
  474. package/scene.pure.d.ts +23 -1
  475. package/scene.pure.js +83 -1
  476. package/scene.pure.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"textureMerger.js","sourceRoot":"","sources":["../../../../../dev/core/src/Materials/Textures/textureMerger.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAIzE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AA4CpD,MAAM,WAAW,GAAG,eAAe,CAAC;AAEpC;;;;;GAKG;AACH,SAAS,cAAc,CAAC,KAAmB;IACvC,OAAO,SAAS,IAAI,KAAK,CAAC;AAC9B,CAAC;AAED;;;;;GAKG;AACH,SAAS,eAAe,CAAC,KAAmB;IACxC,OAAO,OAAO,IAAI,KAAK,CAAC;AAC5B,CAAC;AAED;;;;;GAKG;AACH,SAAS,oBAAoB,CAAC,MAAe,EAAE,WAAoB;IAC/D,WAAW,CAAC,OAAO,GAAG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,CAAC;AACP,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAoB,EAAE,aAAqB;IAC1E,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;AACtC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAa;IAC7C,OAAO,EAAE,KAAK,EAAE,CAAC;AACrB,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,uBAAuB,CAAC,GAAiB,EAAE,KAAoB,EAAE,IAAmB,EAAE,KAAoB;IACtH,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AACvC,CAAC","sourcesContent":["import { type Scene } from \"../../scene\";\nimport { type IProceduralTextureCreationOptions } from \"core/Materials/Textures/Procedurals/proceduralTexture\";\nimport { ProceduralTexture } from \"./Procedurals/proceduralTexture.pure\";\nimport { type BaseTexture } from \"./baseTexture\";\nimport { type TextureSize } from \"./textureCreationOptions\";\nimport { ShaderLanguage } from \"core/Materials/shaderLanguage\";\nimport { Constants } from \"../../Engines/constants\";\nimport { type Texture } from \"./texture\";\n\n/**\n * Configuration for a texture input source\n */\nexport interface ITextureChannelInput {\n /** The texture to use as input */\n texture: BaseTexture;\n /** Source channel to read from (0=R, 1=G, 2=B, 3=A) */\n sourceChannel: number;\n}\n\n/**\n * Configuration for a constant value input source\n */\nexport interface IConstantChannelInput {\n /** Constant value between 0.0 and 1.0 */\n value: number;\n}\n\n/**\n * Union type for channel input sources\n */\nexport type ChannelInput = ITextureChannelInput | IConstantChannelInput;\n\n/**\n * Configuration for texture merging operation\n */\nexport interface ITextureMergeConfiguration {\n /** Configuration for red output channel */\n red: ChannelInput;\n /** Configuration for green output channel (optional, defaults to 0) */\n green?: ChannelInput;\n /** Configuration for blue output channel (optional, defaults to 0) */\n blue?: ChannelInput;\n /** Configuration for alpha output channel (optional, defaults to 1) */\n alpha?: ChannelInput;\n /** Output texture size. If not specified, uses the largest input texture size */\n outputSize?: TextureSize;\n /** Whether to generate mipmaps for the output texture */\n generateMipMaps?: boolean;\n}\n\nconst _ShaderName = \"textureMerger\";\n\n/**\n * @internal\n * Check if a channel input is a texture input\n * @param input The channel input to check\n * @returns True if the input is a texture input, false otherwise\n */\nfunction IsTextureInput(input: ChannelInput): input is ITextureChannelInput {\n return \"texture\" in input;\n}\n\n/**\n * @internal\n * Check if a channel input is a constant input\n * @param input The channel input to check\n * @returns True if the input is a constant input, false otherwise\n */\nfunction IsConstantInput(input: ChannelInput): input is IConstantChannelInput {\n return \"value\" in input;\n}\n\n/**\n * @internal\n * Copy texture transformation properties from one texture to another\n * @param source The source texture\n * @param destination The destination texture\n */\nfunction CopyTextureTransform(source: Texture, destination: Texture) {\n destination.uOffset = source.uOffset;\n destination.vOffset = source.vOffset;\n destination.uScale = source.uScale;\n destination.vScale = source.vScale;\n destination.uAng = source.uAng;\n destination.vAng = source.vAng;\n destination.wAng = source.wAng;\n destination.uRotationCenter = source.uRotationCenter;\n destination.vRotationCenter = source.vRotationCenter;\n}\n\n/**\n * @internal\n * Merge multiple texture channels into a single texture\n * @param name Name for the resulting texture\n * @param config Merge configuration\n * @param scene Scene to create the texture in\n * @returns The merged texture\n */\nexport async function MergeTexturesAsync(name: string, config: ITextureMergeConfiguration, scene: Scene): Promise<ProceduralTexture> {\n const channels = [config.red, config.green, config.blue, config.alpha];\n const textureInputs: BaseTexture[] = [];\n const textureInputMap: number[] = []; // Maps channel index to texture input index (-1 for constants)\n\n // Collect unique textures and validate inputs\n for (let channelIndex = 0; channelIndex < 4; channelIndex++) {\n const channel = channels[channelIndex];\n if (channel) {\n if (IsTextureInput(channel)) {\n // Validate source channel\n if (channel.sourceChannel < 0 || channel.sourceChannel > 3) {\n throw new Error(\"Source channel must be between 0 and 3 (R, G, B, A)\");\n }\n\n // Find or add texture to inputs\n let textureIndex = textureInputs.indexOf(channel.texture);\n if (textureIndex === -1) {\n textureIndex = textureInputs.length;\n textureInputs.push(channel.texture);\n }\n textureInputMap[channelIndex] = textureIndex;\n } else if (IsConstantInput(channel)) {\n // Validate constant value\n if (channel.value < 0 || channel.value > 1) {\n throw new Error(\"Constant value must be between 0.0 and 1.0\");\n }\n textureInputMap[channelIndex] = -1;\n } else {\n throw new Error(\"Invalid channel input configuration\");\n }\n } else {\n textureInputMap[channelIndex] = -1;\n }\n }\n\n // Determine output size\n let outputSize = config.outputSize;\n if (!outputSize && textureInputs.length > 0) {\n // Use the largest texture size\n let maxSize = 0;\n for (const texture of textureInputs) {\n const size = texture.getSize();\n const currentSize = Math.max(size.width, size.height);\n if (currentSize > maxSize) {\n maxSize = currentSize;\n outputSize = size.width === size.height ? maxSize : size;\n }\n }\n }\n outputSize = outputSize || 512; // Fallback size\n\n // Generate shader defines\n const defines: string[] = [];\n const usedTextures = new Set<number>();\n\n for (let channelIndex = 0; channelIndex < 4; channelIndex++) {\n const channel = channels[channelIndex];\n const channelName = [\"RED\", \"GREEN\", \"BLUE\", \"ALPHA\"][channelIndex];\n\n if (channel && IsTextureInput(channel)) {\n defines.push(`${channelName}_FROM_TEXTURE`);\n const textureIndex = textureInputMap[channelIndex];\n usedTextures.add(textureIndex);\n }\n }\n\n // Add texture defines for used textures\n usedTextures.forEach((textureIndex) => {\n defines.push(`USE_TEXTURE${textureIndex}`);\n });\n\n // Create the procedural texture\n const outputTextureOptions: IProceduralTextureCreationOptions = {\n type: Constants.TEXTURETYPE_HALF_FLOAT,\n format: Constants.TEXTUREFORMAT_RGBA,\n samplingMode: Constants.TEXTURE_NEAREST_SAMPLINGMODE,\n generateDepthBuffer: false,\n generateMipMaps: false,\n shaderLanguage: scene.getEngine().isWebGPU ? ShaderLanguage.WGSL : ShaderLanguage.GLSL,\n extraInitializationsAsync: async () => {\n if (scene.getEngine().isWebGPU) {\n await Promise.all([import(\"../../ShadersWGSL/textureMerger.fragment\")]);\n } else {\n await Promise.all([import(\"../../Shaders/textureMerger.fragment\")]);\n }\n },\n skipSceneRegistration: true,\n };\n const proceduralTexture = new ProceduralTexture(name, outputSize, _ShaderName, scene, outputTextureOptions);\n proceduralTexture.refreshRate = -1; // Do not auto-refresh\n\n // Set the defines\n proceduralTexture.defines = defines.length > 0 ? \"#define \" + defines.join(\"\\n#define \") + \"\\n\" : \"\";\n\n // Set up texture inputs\n for (let i = 0; i < textureInputs.length; i++) {\n CopyTextureTransform(textureInputs[i] as Texture, proceduralTexture);\n proceduralTexture.setTexture(`inputTexture${i}`, textureInputs[i]);\n }\n\n // Set up channel configuration\n for (let channelIndex = 0; channelIndex < 4; channelIndex++) {\n const channel = channels[channelIndex];\n const channelName = [\"red\", \"green\", \"blue\", \"alpha\"][channelIndex];\n\n if (channel && IsTextureInput(channel)) {\n const textureIndex = textureInputMap[channelIndex];\n proceduralTexture.setInt(`${channelName}TextureIndex`, textureIndex);\n proceduralTexture.setInt(`${channelName}SourceChannel`, channel.sourceChannel);\n } else {\n // Use constant value (either provided or default)\n let constantValue: number;\n if (channel && IsConstantInput(channel)) {\n constantValue = channel.value;\n } else {\n // Use default values: 0 for RGB, 1 for alpha\n constantValue = channelIndex === 3 ? 1.0 : 0.0;\n }\n proceduralTexture.setFloat(`${channelName}ConstantValue`, constantValue);\n }\n }\n\n return await new Promise<ProceduralTexture>((resolve, reject) => {\n // Compile and render\n proceduralTexture.executeWhenReady(() => {\n try {\n proceduralTexture.render();\n resolve(proceduralTexture);\n } catch (error) {\n reject(error instanceof Error ? error : new Error(String(error)));\n }\n });\n });\n}\n\n/**\n * @internal\n * Create a texture input configuration\n * @param texture The texture to read from\n * @param sourceChannel The channel to read (0=R, 1=G, 2=B, 3=A)\n * @returns Texture channel input configuration\n */\nexport function CreateTextureInput(texture: BaseTexture, sourceChannel: number): ITextureChannelInput {\n return { texture, sourceChannel };\n}\n\n/**\n * @internal\n * Create a constant value input configuration\n * @param value The constant value (0.0-1.0)\n * @returns Constant channel input configuration\n */\nexport function CreateConstantInput(value: number): IConstantChannelInput {\n return { value };\n}\n\n/**\n * @internal\n * Create a simple RGBA channel packing configuration\n * @param red Input for red channel\n * @param green Input for green channel (optional, defaults to 0)\n * @param blue Input for blue channel (optional, defaults to 0)\n * @param alpha Input for alpha channel (optional, defaults to 1)\n * @returns Texture merge configuration\n */\nexport function CreateRGBAConfiguration(red: ChannelInput, green?: ChannelInput, blue?: ChannelInput, alpha?: ChannelInput): ITextureMergeConfiguration {\n return { red, green, blue, alpha };\n}\n"]}
1
+ {"version":3,"file":"textureMerger.js","sourceRoot":"","sources":["../../../../../dev/core/src/Materials/Textures/textureMerger.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAIzE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAsD5I,MAAM,WAAW,GAAG,eAAe,CAAC;AAEpC;;;;;GAKG;AACH,SAAS,cAAc,CAAC,KAAmB;IACvC,OAAO,SAAS,IAAI,KAAK,CAAC;AAC9B,CAAC;AAED;;;;;GAKG;AACH,SAAS,eAAe,CAAC,KAAmB;IACxC,OAAO,OAAO,IAAI,KAAK,CAAC;AAC5B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,IAAY,EAAE,MAAkC,EAAE,KAAY;IACnG,IAAI,QAAQ,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IACrE,IAAI,MAAM,CAAC,cAAc,EAAE,CAAC;QACxB,QAAQ,GAAG,wBAAwB,CAC/B,mBAAmB,IAAI,GAAG,EAC1B,QAAQ,EACR,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,IAAI,cAAc,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,EAAE,KAAoB;IACtH,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AACvC,CAAC","sourcesContent":["import { type Scene } from \"../../scene\";\nimport { type IProceduralTextureCreationOptions } from \"core/Materials/Textures/Procedurals/proceduralTexture\";\nimport { ProceduralTexture } from \"./Procedurals/proceduralTexture.pure\";\nimport { type BaseTexture } from \"./baseTexture\";\nimport { type TextureSize } from \"./textureCreationOptions\";\nimport { ShaderLanguage } from \"core/Materials/shaderLanguage\";\nimport { Constants } from \"../../Engines/constants\";\nimport { Logger } from \"../../Misc/logger\";\nimport { _AllTransformsMatch, _CopyTextureMetadata, _HasNonIdentityTransform, _KeepMatchingCoordinates } from \"./textureSampling.functions\";\n\n/**\n * Configuration for a texture input source\n */\nexport interface ITextureChannelInput {\n /** The texture to use as input */\n texture: BaseTexture;\n /** Source channel to read from (0=R, 1=G, 2=B, 3=A) */\n sourceChannel: number;\n}\n\n/**\n * Configuration for a constant value input source\n */\nexport interface IConstantChannelInput {\n /** Constant value between 0.0 and 1.0 */\n value: number;\n}\n\n/**\n * Union type for channel input sources\n */\nexport type ChannelInput = ITextureChannelInput | IConstantChannelInput;\n\n/**\n * Configuration for texture merging operation\n */\nexport interface ITextureMergeConfiguration {\n /** Configuration for red output channel */\n red: ChannelInput;\n /** Configuration for green output channel (optional, defaults to 0) */\n green?: ChannelInput;\n /** Configuration for blue output channel (optional, defaults to 0) */\n blue?: ChannelInput;\n /** Configuration for alpha output channel (optional, defaults to 1) */\n alpha?: ChannelInput;\n /** Output texture size. If not specified, uses the largest input texture size */\n outputSize?: TextureSize;\n /** Whether to generate mipmaps for the output texture */\n generateMipMaps?: boolean;\n /**\n * Whether the output texture is sampled as a single texture with one set of sampling parameters.\n * When true, every input texture must use the same UV set as the first input texture (inputs on other\n * UV sets are replaced by a constant 1.0 and a warning is logged), the output takes its UV set and wrap\n * modes from the first input texture, and input UV transforms are either propagated (when they all match)\n * or baked into the output.\n * When false (default), each output channel is a raw copy of its input texels, so channels can be referenced\n * separately with their own sampling parameters. The output copies the UV set, wrap modes and UV transform\n * of the input textures only when they all agree; otherwise it keeps default sampling parameters.\n */\n sharedSampling?: boolean;\n}\n\nconst _ShaderName = \"textureMerger\";\n\n/**\n * @internal\n * Check if a channel input is a texture input\n * @param input The channel input to check\n * @returns True if the input is a texture input, false otherwise\n */\nfunction IsTextureInput(input: ChannelInput): input is ITextureChannelInput {\n return \"texture\" in input;\n}\n\n/**\n * @internal\n * Check if a channel input is a constant input\n * @param input The channel input to check\n * @returns True if the input is a constant input, false otherwise\n */\nfunction IsConstantInput(input: ChannelInput): input is IConstantChannelInput {\n return \"value\" in input;\n}\n\n/**\n * @internal\n * Merge multiple texture channels into a single texture\n * @param name Name for the resulting texture\n * @param config Merge configuration\n * @param scene Scene to create the texture in\n * @returns The merged texture\n */\nexport async function MergeTexturesAsync(name: string, config: ITextureMergeConfiguration, scene: Scene): Promise<ProceduralTexture> {\n let channels = [config.red, config.green, config.blue, config.alpha];\n if (config.sharedSampling) {\n channels = _KeepMatchingCoordinates(\n `Texture merger '${name}'`,\n channels,\n (channel) => (channel && IsTextureInput(channel) ? channel.texture : null),\n () => ({ value: 1.0 })\n );\n }\n const textureInputs: BaseTexture[] = [];\n const textureInputMap: number[] = []; // Maps channel index to texture input index (-1 for constants)\n\n // Collect unique textures and validate inputs\n for (let channelIndex = 0; channelIndex < 4; channelIndex++) {\n const channel = channels[channelIndex];\n if (channel) {\n if (IsTextureInput(channel)) {\n // Validate source channel\n if (channel.sourceChannel < 0 || channel.sourceChannel > 3) {\n throw new Error(\"Source channel must be between 0 and 3 (R, G, B, A)\");\n }\n\n // Find or add texture to inputs\n let textureIndex = textureInputs.indexOf(channel.texture);\n if (textureIndex === -1) {\n textureIndex = textureInputs.length;\n textureInputs.push(channel.texture);\n }\n textureInputMap[channelIndex] = textureIndex;\n } else if (IsConstantInput(channel)) {\n // Validate constant value\n if (channel.value < 0 || channel.value > 1) {\n throw new Error(\"Constant value must be between 0.0 and 1.0\");\n }\n textureInputMap[channelIndex] = -1;\n } else {\n throw new Error(\"Invalid channel input configuration\");\n }\n } else {\n textureInputMap[channelIndex] = -1;\n }\n }\n\n // Determine output size\n let outputSize = config.outputSize;\n if (!outputSize && textureInputs.length > 0) {\n // Use the largest texture size\n let maxSize = 0;\n for (const texture of textureInputs) {\n const size = texture.getSize();\n const currentSize = Math.max(size.width, size.height);\n if (currentSize > maxSize) {\n maxSize = currentSize;\n outputSize = size.width === size.height ? maxSize : size;\n }\n }\n }\n outputSize = outputSize || 512; // Fallback size\n\n // Generate shader defines\n const defines: string[] = [];\n const usedTextures = new Set<number>();\n\n for (let channelIndex = 0; channelIndex < 4; channelIndex++) {\n const channel = channels[channelIndex];\n const channelName = [\"RED\", \"GREEN\", \"BLUE\", \"ALPHA\"][channelIndex];\n\n if (channel && IsTextureInput(channel)) {\n defines.push(`${channelName}_FROM_TEXTURE`);\n const textureIndex = textureInputMap[channelIndex];\n usedTextures.add(textureIndex);\n }\n }\n\n // Add texture defines for used textures\n usedTextures.forEach((textureIndex) => {\n defines.push(`USE_TEXTURE${textureIndex}`);\n });\n\n // With shared sampling, propagate the UV transform when all inputs agree; otherwise bake each one\n const transformsMatch = _AllTransformsMatch(textureInputs);\n const propagateTransform = !config.sharedSampling || transformsMatch;\n const bakedTransforms = new Set<number>();\n if (!propagateTransform) {\n for (let i = 0; i < textureInputs.length; i++) {\n if (_HasNonIdentityTransform(textureInputs[i])) {\n bakedTransforms.add(i);\n defines.push(`TEXTURE${i}_MATRIX`);\n }\n }\n }\n\n // Create the procedural texture\n const outputTextureOptions: IProceduralTextureCreationOptions = {\n type: Constants.TEXTURETYPE_HALF_FLOAT,\n format: Constants.TEXTUREFORMAT_RGBA,\n samplingMode: Constants.TEXTURE_NEAREST_SAMPLINGMODE,\n generateDepthBuffer: false,\n generateMipMaps: false,\n shaderLanguage: scene.getEngine().isWebGPU ? ShaderLanguage.WGSL : ShaderLanguage.GLSL,\n extraInitializationsAsync: async () => {\n if (scene.getEngine().isWebGPU) {\n await Promise.all([import(\"../../ShadersWGSL/textureMerger.fragment\")]);\n } else {\n await Promise.all([import(\"../../Shaders/textureMerger.fragment\")]);\n }\n },\n skipSceneRegistration: true,\n };\n const proceduralTexture = new ProceduralTexture(name, outputSize, _ShaderName, scene, outputTextureOptions);\n proceduralTexture.refreshRate = -1; // Do not auto-refresh\n\n // Set the defines\n proceduralTexture.defines = defines.length > 0 ? \"#define \" + defines.join(\"\\n#define \") + \"\\n\" : \"\";\n\n // Set up texture inputs\n for (let i = 0; i < textureInputs.length; i++) {\n proceduralTexture.setTexture(`inputTexture${i}`, textureInputs[i]);\n if (bakedTransforms.has(i)) {\n proceduralTexture.setMatrix(`inputTexture${i}Matrix`, textureInputs[i].getTextureMatrix());\n }\n }\n\n if (textureInputs.length > 0) {\n const reference = textureInputs[0];\n const wrapModesMatch = textureInputs.every((texture) => texture.wrapU === reference.wrapU && texture.wrapV === reference.wrapV);\n if (config.sharedSampling) {\n if (!wrapModesMatch) {\n Logger.Warn(`Texture merger '${name}': input textures use different wrap modes; using the wrap modes of the first input texture.`);\n }\n _CopyTextureMetadata(reference, proceduralTexture, transformsMatch);\n } else if (wrapModesMatch && transformsMatch && textureInputs.every((texture) => texture.coordinatesIndex === reference.coordinatesIndex)) {\n _CopyTextureMetadata(reference, proceduralTexture, true);\n }\n }\n\n // Set up channel configuration\n for (let channelIndex = 0; channelIndex < 4; channelIndex++) {\n const channel = channels[channelIndex];\n const channelName = [\"red\", \"green\", \"blue\", \"alpha\"][channelIndex];\n\n if (channel && IsTextureInput(channel)) {\n const textureIndex = textureInputMap[channelIndex];\n proceduralTexture.setInt(`${channelName}TextureIndex`, textureIndex);\n proceduralTexture.setInt(`${channelName}SourceChannel`, channel.sourceChannel);\n } else {\n // Use constant value (either provided or default)\n let constantValue: number;\n if (channel && IsConstantInput(channel)) {\n constantValue = channel.value;\n } else {\n // Use default values: 0 for RGB, 1 for alpha\n constantValue = channelIndex === 3 ? 1.0 : 0.0;\n }\n proceduralTexture.setFloat(`${channelName}ConstantValue`, constantValue);\n }\n }\n\n return await new Promise<ProceduralTexture>((resolve, reject) => {\n // Compile and render\n proceduralTexture.executeWhenReady(() => {\n try {\n proceduralTexture.render();\n resolve(proceduralTexture);\n } catch (error) {\n reject(error instanceof Error ? error : new Error(String(error)));\n }\n });\n });\n}\n\n/**\n * @internal\n * Create a texture input configuration\n * @param texture The texture to read from\n * @param sourceChannel The channel to read (0=R, 1=G, 2=B, 3=A)\n * @returns Texture channel input configuration\n */\nexport function CreateTextureInput(texture: BaseTexture, sourceChannel: number): ITextureChannelInput {\n return { texture, sourceChannel };\n}\n\n/**\n * @internal\n * Create a constant value input configuration\n * @param value The constant value (0.0-1.0)\n * @returns Constant channel input configuration\n */\nexport function CreateConstantInput(value: number): IConstantChannelInput {\n return { value };\n}\n\n/**\n * @internal\n * Create a simple RGBA channel packing configuration\n * @param red Input for red channel\n * @param green Input for green channel (optional, defaults to 0)\n * @param blue Input for blue channel (optional, defaults to 0)\n * @param alpha Input for alpha channel (optional, defaults to 1)\n * @returns Texture merge configuration\n */\nexport function CreateRGBAConfiguration(red: ChannelInput, green?: ChannelInput, blue?: ChannelInput, alpha?: ChannelInput): ITextureMergeConfiguration {\n return { red, green, blue, alpha };\n}\n"]}
@@ -216,6 +216,76 @@ export declare function MultiplyTexturesAsync(name: string, a: ITextureProcessOp
216
216
  * @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant
217
217
  */
218
218
  export declare function MaxTexturesAsync(name: string, a: ITextureProcessOperand, b: ITextureProcessOperand, scene: Scene, outputColorSpace?: TextureColorSpace, outputChannelMask?: ChannelMask, outputOptions?: ITextureProcessorOutputOptions): Promise<ITextureProcessOperand>;
219
+ /**
220
+ * Component-wise safe division of two texture operands: `result = a / max(b, 0.00001)`.
221
+ *
222
+ * Each operand can be a texture, a constant factor, or a texture scaled by a factor.
223
+ * Division by zero is guarded with a small epsilon so the result is always finite.
224
+ *
225
+ * If both operands are constant (no textures), the operation is performed on the CPU and
226
+ * the result is returned as a factor-only operand with no texture allocated.
227
+ *
228
+ * When operands are results of previous operations (i.e. they carry a `dispose` function),
229
+ * their intermediate textures are automatically released after the GPU pass completes.
230
+ *
231
+ * @param name - Name for the resulting procedural texture (used only when a GPU pass is needed)
232
+ * @param a - Numerator operand
233
+ * @param b - Denominator operand
234
+ * @param scene - Scene to create the texture in (used only when a GPU pass is needed)
235
+ * @param outputColorSpace - Optional output color space.
236
+ * @param outputChannelMask - Optional bitmask of channels to write.
237
+ * @param outputOptions - Optional render-target type, sampling, and mipmap settings.
238
+ * @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant
239
+ */
240
+ export declare function DivideTexturesAsync(name: string, a: ITextureProcessOperand, b: ITextureProcessOperand, scene: Scene, outputColorSpace?: TextureColorSpace, outputChannelMask?: ChannelMask, outputOptions?: ITextureProcessorOutputOptions): Promise<ITextureProcessOperand>;
241
+ /**
242
+ * Compute the component-wise fraction `result = a / (a + b * (1 - a))` in a single GPU pass.
243
+ *
244
+ * For OpenPBR this is the transmission fraction of the dielectric's transmitted light, where `a` is
245
+ * the transmission weight T and `b` the subsurface weight S (subsurface covers only the remaining
246
+ * `1 - T`). The subsurface fraction is `1 - result`. The denominator `T + S(1 - T)` equals
247
+ * `1 - (1 - T)(1 - S)` but avoids subtracting values near one, and fusing the whole expression into
248
+ * one pass means no intermediate is quantized; only the final output is. The denominator is guarded
249
+ * with `max(..., 0.00001)`, so the result is 0 where both inputs are 0.
250
+ *
251
+ * If both operands are constant (no textures), the operation is performed on the CPU and
252
+ * the result is returned as a factor-only operand with no texture allocated.
253
+ *
254
+ * When operands are results of previous operations (i.e. they carry a `dispose` function),
255
+ * their intermediate textures are automatically released after the GPU pass completes.
256
+ *
257
+ * @param name - Name for the resulting procedural texture (used only when a GPU pass is needed)
258
+ * @param a - Transmission weight operand (T)
259
+ * @param b - Subsurface weight operand (S)
260
+ * @param scene - Scene to create the texture in (used only when a GPU pass is needed)
261
+ * @param outputColorSpace - Optional output color space.
262
+ * @param outputChannelMask - Optional bitmask of channels to write.
263
+ * @param outputOptions - Optional render-target type, sampling, and mipmap settings.
264
+ * @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant
265
+ */
266
+ export declare function TransmissionFractionAsync(name: string, a: ITextureProcessOperand, b: ITextureProcessOperand, scene: Scene, outputColorSpace?: TextureColorSpace, outputChannelMask?: ChannelMask, outputOptions?: ITextureProcessorOutputOptions): Promise<ITextureProcessOperand>;
267
+ /**
268
+ * Recover the single-scatter albedo of an OpenPBR 1.1 transmission volume, `scatter / extinction`, using the
269
+ * renderer's extinction: the absorption `-log(transmissionColor) - transmissionScatter` is shifted so its
270
+ * smallest channel is non-negative, and the extinction is recomputed from it. The transmission depth cancels
271
+ * out of the ratio, so both operands are given per unit depth. The result alpha is taken from the scatter operand.
272
+ *
273
+ * If both operands are constant (no textures), the operation is performed on the CPU and
274
+ * the result is returned as a factor-only operand with no texture allocated.
275
+ *
276
+ * When operands are results of previous operations (i.e. they carry a `dispose` function),
277
+ * their intermediate textures are automatically released after the GPU pass completes.
278
+ *
279
+ * @param name - Name for the resulting procedural texture (used only when a GPU pass is needed)
280
+ * @param transmissionColor - Linear transmission color operand
281
+ * @param transmissionScatter - Transmission scatter operand
282
+ * @param scene - Scene to create the texture in (used only when a GPU pass is needed)
283
+ * @param outputColorSpace - Optional output color space.
284
+ * @param outputChannelMask - Optional bitmask of channels to write.
285
+ * @param outputOptions - Optional render-target type, sampling, and mipmap settings.
286
+ * @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant
287
+ */
288
+ export declare function TransmissionScatterToSingleScatterAlbedoAsync(name: string, transmissionColor: ITextureProcessOperand, transmissionScatter: ITextureProcessOperand, scene: Scene, outputColorSpace?: TextureColorSpace, outputChannelMask?: ChannelMask, outputOptions?: ITextureProcessorOutputOptions): Promise<ITextureProcessOperand>;
219
289
  /**
220
290
  * Linearly interpolate between two texture operands: `result = mix(a, b, t)`.
221
291
  *
@@ -336,3 +406,78 @@ export declare function ExtractMaxChannelAsync(name: string, input: ITextureProc
336
406
  * @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant
337
407
  */
338
408
  export declare function ExtractChannelAsync(name: string, input: ITextureProcessOperand, channel: TextureChannel, scene: Scene, outputColorSpace?: TextureColorSpace, outputChannelMask?: ChannelMask, outputOptions?: ITextureProcessorOutputOptions): Promise<ITextureProcessOperand>;
409
+ /**
410
+ * Convert a multi-scatter albedo operand to single-scatter albedo using the OpenPBR/KHR
411
+ * approximation. RGB is clamped to `[0, 1]` before conversion and alpha is preserved.
412
+ *
413
+ * If the operand is constant, the conversion is performed on the CPU. Otherwise it is baked
414
+ * into a linear procedural texture. Input color-space conversion, channel selection, factors,
415
+ * UV transforms, metadata propagation, and intermediate disposal follow the other unary texture
416
+ * processor operations.
417
+ *
418
+ * @param name - Name for the resulting procedural texture (used only when a GPU pass is needed)
419
+ * @param input - Multi-scatter albedo operand to convert
420
+ * @param scene - Scene to create the texture in (used only when a GPU pass is needed)
421
+ * @param aniso - Scattering anisotropy in `[-1, 1]`. `0` (default) is isotropic; positive values are
422
+ * forward-scattering. Matches `multiScatterToSingleScatterAlbedo(rho_ms, aniso)` in helperFunctions.
423
+ * Clamped to `[-0.9999, 0.9999]`, as in the renderer.
424
+ * @param scale - Optional operand multiplied into `input` (RGBA) before conversion, in the same pass. Use it
425
+ * instead of a separate {@link MultiplyTexturesAsync} so that the product (e.g. scatter strength times
426
+ * multi-scatter color) isn't quantized before the nonlinear conversion.
427
+ * @returns An operand containing the converted single-scatter albedo
428
+ */
429
+ export declare function MultiScatterToSingleScatterAlbedoAsync(name: string, input: ITextureProcessOperand, scene: Scene, aniso?: number, scale?: ITextureProcessOperand): Promise<ITextureProcessOperand>;
430
+ /**
431
+ * Convert a single-scatter albedo operand to multi-scatter albedo using the OpenPBR/KHR
432
+ * approximation. This is the inverse of {@link MultiScatterToSingleScatterAlbedoAsync}.
433
+ * RGB is clamped to `[0, 1]` before conversion and alpha is preserved.
434
+ *
435
+ * If the operand is constant, the conversion is performed on the CPU. Otherwise it is baked
436
+ * into a linear procedural texture. Input color-space conversion, channel selection, factors,
437
+ * UV transforms, metadata propagation, and intermediate disposal follow the other unary texture
438
+ * processor operations.
439
+ *
440
+ * @param name - Name for the resulting procedural texture (used only when a GPU pass is needed)
441
+ * @param input - Single-scatter albedo operand to convert
442
+ * @param scene - Scene to create the texture in (used only when a GPU pass is needed)
443
+ * @param aniso - Scattering anisotropy in `[-1, 1]`. `0` (default) is isotropic; positive values are
444
+ * forward-scattering. This inverts the anisotropic multi→single mapping: `s^2 = (1 - rho_ss) /
445
+ * (1 - aniso * rho_ss)`, then `rho_ms = (1 - s)(1 - 0.139 s)/(1 + 1.17 s)`. Clamped to
446
+ * `[-0.9999, 0.9999]`, as in the renderer.
447
+ * @param outputOptions - Optional render-target type, sampling, and mipmap settings.
448
+ * @returns An operand containing the converted multi-scatter albedo
449
+ */
450
+ export declare function SingleScatterToMultiScatterAlbedoAsync(name: string, input: ITextureProcessOperand, scene: Scene, aniso?: number, outputOptions?: ITextureProcessorOutputOptions): Promise<ITextureProcessOperand>;
451
+ /**
452
+ * Compute the OpenPBR thin-walled scatter weights from a transmission operand (T) and a
453
+ * scatter-strength operand (S). Both operands are read from their R channel (after the operand's
454
+ * channel swizzle and factor), and each weight is broadcast to all four output channels.
455
+ *
456
+ * For each texel:
457
+ * ```
458
+ * transmission_weight = T * (1 - S)
459
+ * subsurface_weight = T * S / (1 - T*(1-S))
460
+ * ```
461
+ *
462
+ * These are the OpenPBR weight values when a thin-walled glTF material combines
463
+ * KHR_materials_transmission (T = transmissionFactor * transmissionTexture) and
464
+ * KHR_materials_scatter (S = scatterStrengthFactor * scatterStrengthTexture):
465
+ * `scatterStrengthFactor` converts a fraction of the coherent transmission budget into
466
+ * scattered (subsurface) transmission while keeping the total translucency constant.
467
+ *
468
+ * When both operands are constants the computation is performed entirely on the CPU.
469
+ * When either operand has a texture, each weight is computed from T and S in a single GPU pass, so
470
+ * only the two outputs are quantized. Near T = 1 the subsurface weight divides two small values, and
471
+ * quantizing intermediates (e.g. T * S or 1 - S to 8 bits) would change it drastically.
472
+ *
473
+ * @param name - Base name for any procedural textures created
474
+ * @param transmission - T operand (transmissionFactor × optional transmissionTexture, R channel)
475
+ * @param scatter - S operand (scatterStrengthFactor × optional scatterStrengthTexture, R channel)
476
+ * @param scene - Scene used for GPU passes when textures are involved
477
+ * @returns `{ transmission, subsurface }` – two operands ready to assign to
478
+ * `transmissionWeightTexture` / `subsurfaceWeightTexture` (and the corresponding scalar factors)
479
+ */
480
+ export declare function ThinWalledScatterWeightsAsync(name: string, transmission: ITextureProcessOperand, scatter: ITextureProcessOperand, scene: Scene): Promise<{
481
+ transmission: ITextureProcessOperand;
482
+ subsurface: ITextureProcessOperand;
483
+ }>;