@aura3d/rendering 3.0.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1877) hide show
  1. package/dist/BlendModes.d.ts +34 -0
  2. package/dist/BlendModes.d.ts.map +1 -0
  3. package/dist/BlendModes.js +42 -0
  4. package/dist/BlendModes.js.map +1 -0
  5. package/dist/CascadedShadowMaps.d.ts.map +1 -1
  6. package/dist/CascadedShadowMaps.js +3 -1
  7. package/dist/CascadedShadowMaps.js.map +1 -1
  8. package/dist/DepthPass.d.ts +18 -0
  9. package/dist/DepthPass.d.ts.map +1 -1
  10. package/dist/DepthPass.js +103 -20
  11. package/dist/DepthPass.js.map +1 -1
  12. package/dist/EnvironmentBackgroundPass.d.ts +7 -0
  13. package/dist/EnvironmentBackgroundPass.d.ts.map +1 -1
  14. package/dist/EnvironmentBackgroundPass.js +39 -14
  15. package/dist/EnvironmentBackgroundPass.js.map +1 -1
  16. package/dist/EnvironmentMapResources.d.ts +1 -1
  17. package/dist/EnvironmentMapResources.d.ts.map +1 -1
  18. package/dist/EnvironmentMapResources.js +19 -8
  19. package/dist/EnvironmentMapResources.js.map +1 -1
  20. package/dist/EnvironmentPlatform.d.ts +6 -0
  21. package/dist/EnvironmentPlatform.d.ts.map +1 -1
  22. package/dist/EnvironmentPlatform.js +3 -1
  23. package/dist/EnvironmentPlatform.js.map +1 -1
  24. package/dist/EnvironmentPreset.d.ts +7 -0
  25. package/dist/EnvironmentPreset.d.ts.map +1 -1
  26. package/dist/EnvironmentPreset.js +11 -11
  27. package/dist/EnvironmentPreset.js.map +1 -1
  28. package/dist/EnvironmentPresetPack.d.ts +16 -0
  29. package/dist/EnvironmentPresetPack.d.ts.map +1 -1
  30. package/dist/EnvironmentPresetPack.js +28 -0
  31. package/dist/EnvironmentPresetPack.js.map +1 -1
  32. package/dist/ExtensionScalarAtlas.d.ts +18 -0
  33. package/dist/ExtensionScalarAtlas.d.ts.map +1 -0
  34. package/dist/ExtensionScalarAtlas.js +107 -0
  35. package/dist/ExtensionScalarAtlas.js.map +1 -0
  36. package/dist/ExternalParityRenderPreset.d.ts +15 -1
  37. package/dist/ExternalParityRenderPreset.d.ts.map +1 -1
  38. package/dist/ExternalParityRenderPreset.js +52 -7
  39. package/dist/ExternalParityRenderPreset.js.map +1 -1
  40. package/dist/ForwardPass.d.ts +240 -50
  41. package/dist/ForwardPass.d.ts.map +1 -1
  42. package/dist/ForwardPass.js +845 -866
  43. package/dist/ForwardPass.js.map +1 -1
  44. package/dist/Geometry.d.ts +44 -1
  45. package/dist/Geometry.d.ts.map +1 -1
  46. package/dist/Geometry.js +174 -24
  47. package/dist/Geometry.js.map +1 -1
  48. package/dist/InstancedPBRMaterial.d.ts +5 -0
  49. package/dist/InstancedPBRMaterial.d.ts.map +1 -1
  50. package/dist/InstancedPBRMaterial.js +7 -0
  51. package/dist/InstancedPBRMaterial.js.map +1 -1
  52. package/dist/LeanWebGL2Device.d.ts +265 -0
  53. package/dist/LeanWebGL2Device.d.ts.map +1 -0
  54. package/dist/LeanWebGL2Device.js +4001 -0
  55. package/dist/LeanWebGL2Device.js.map +1 -0
  56. package/dist/LightCollector.d.ts +8 -0
  57. package/dist/LightCollector.d.ts.map +1 -1
  58. package/dist/LightCollector.js +1 -1
  59. package/dist/LightCollector.js.map +1 -1
  60. package/dist/LightUniforms.d.ts +78 -0
  61. package/dist/LightUniforms.d.ts.map +1 -1
  62. package/dist/LightUniforms.js +100 -0
  63. package/dist/LightUniforms.js.map +1 -1
  64. package/dist/Material.d.ts +15 -0
  65. package/dist/Material.d.ts.map +1 -1
  66. package/dist/Material.js +19 -2
  67. package/dist/Material.js.map +1 -1
  68. package/dist/MaterialBinding.d.ts +10 -0
  69. package/dist/MaterialBinding.d.ts.map +1 -1
  70. package/dist/MaterialBinding.js +92 -2
  71. package/dist/MaterialBinding.js.map +1 -1
  72. package/dist/MaterialPresets.d.ts +60 -0
  73. package/dist/MaterialPresets.d.ts.map +1 -1
  74. package/dist/MaterialPresets.js +212 -0
  75. package/dist/MaterialPresets.js.map +1 -1
  76. package/dist/NormalMappedPBRMaterial.d.ts +5 -0
  77. package/dist/NormalMappedPBRMaterial.d.ts.map +1 -1
  78. package/dist/NormalMappedPBRMaterial.js +7 -0
  79. package/dist/NormalMappedPBRMaterial.js.map +1 -1
  80. package/dist/OceanSurface.d.ts +8 -0
  81. package/dist/OceanSurface.d.ts.map +1 -1
  82. package/dist/OceanSurface.js +10 -79
  83. package/dist/OceanSurface.js.map +1 -1
  84. package/dist/PBRLightingDefaults.d.ts +8 -0
  85. package/dist/PBRLightingDefaults.d.ts.map +1 -1
  86. package/dist/PBRLightingDefaults.js +8 -0
  87. package/dist/PBRLightingDefaults.js.map +1 -1
  88. package/dist/PBRMaterial.d.ts +5 -0
  89. package/dist/PBRMaterial.d.ts.map +1 -1
  90. package/dist/PBRMaterial.js +7 -0
  91. package/dist/PBRMaterial.js.map +1 -1
  92. package/dist/PlanarReflection.d.ts +2 -2
  93. package/dist/PlanarReflection.js +3 -3
  94. package/dist/PlanarReflection.js.map +1 -1
  95. package/dist/PostProcessPass.d.ts +8 -473
  96. package/dist/PostProcessPass.d.ts.map +1 -1
  97. package/dist/PostProcessPass.js +6 -1984
  98. package/dist/PostProcessPass.js.map +1 -1
  99. package/dist/ProceduralMaterialTextures.d.ts +28 -0
  100. package/dist/ProceduralMaterialTextures.d.ts.map +1 -0
  101. package/dist/ProceduralMaterialTextures.js +217 -0
  102. package/dist/ProceduralMaterialTextures.js.map +1 -0
  103. package/dist/ProjectionMath.d.ts +3 -0
  104. package/dist/ProjectionMath.d.ts.map +1 -0
  105. package/dist/ProjectionMath.js +26 -0
  106. package/dist/ProjectionMath.js.map +1 -0
  107. package/dist/ReflectionProbe.d.ts.map +1 -1
  108. package/dist/ReflectionProbe.js +4 -1
  109. package/dist/ReflectionProbe.js.map +1 -1
  110. package/dist/ReflectionSurfaces.d.ts +4 -1
  111. package/dist/ReflectionSurfaces.d.ts.map +1 -1
  112. package/dist/ReflectionSurfaces.js +10 -1
  113. package/dist/ReflectionSurfaces.js.map +1 -1
  114. package/dist/RenderBackend.d.ts +2 -0
  115. package/dist/RenderBackend.d.ts.map +1 -1
  116. package/dist/RenderBackend.js +3 -0
  117. package/dist/RenderBackend.js.map +1 -1
  118. package/dist/RenderDevice.d.ts +97 -5
  119. package/dist/RenderDevice.d.ts.map +1 -1
  120. package/dist/RenderDevice.js +166 -9
  121. package/dist/RenderDevice.js.map +1 -1
  122. package/dist/RenderGraph.d.ts.map +1 -1
  123. package/dist/RenderGraph.js +17 -0
  124. package/dist/RenderGraph.js.map +1 -1
  125. package/dist/RenderPass.d.ts +7 -0
  126. package/dist/RenderPass.d.ts.map +1 -1
  127. package/dist/RenderPass.js.map +1 -1
  128. package/dist/RenderPipeline.d.ts +5 -0
  129. package/dist/RenderPipeline.d.ts.map +1 -1
  130. package/dist/RenderPipeline.js +6 -0
  131. package/dist/RenderPipeline.js.map +1 -1
  132. package/dist/Renderer.d.ts +270 -66
  133. package/dist/Renderer.d.ts.map +1 -1
  134. package/dist/Renderer.js +970 -1249
  135. package/dist/Renderer.js.map +1 -1
  136. package/dist/RendererPostprocessPlan.d.ts +20 -3
  137. package/dist/RendererPostprocessPlan.d.ts.map +1 -1
  138. package/dist/RendererPostprocessPlan.js +32 -4
  139. package/dist/RendererPostprocessPlan.js.map +1 -1
  140. package/dist/RendererTiming.d.ts +27 -0
  141. package/dist/RendererTiming.d.ts.map +1 -1
  142. package/dist/RendererTiming.js +179 -12
  143. package/dist/RendererTiming.js.map +1 -1
  144. package/dist/ResolutionGovernor.d.ts +56 -0
  145. package/dist/ResolutionGovernor.d.ts.map +1 -0
  146. package/dist/ResolutionGovernor.js +87 -0
  147. package/dist/ResolutionGovernor.js.map +1 -0
  148. package/dist/Sampler.d.ts +34 -1
  149. package/dist/Sampler.d.ts.map +1 -1
  150. package/dist/Sampler.js +55 -2
  151. package/dist/Sampler.js.map +1 -1
  152. package/dist/ScreenSpaceReflectionPass.d.ts +43 -0
  153. package/dist/ScreenSpaceReflectionPass.d.ts.map +1 -0
  154. package/dist/ScreenSpaceReflectionPass.js +58 -0
  155. package/dist/ScreenSpaceReflectionPass.js.map +1 -0
  156. package/dist/ShaderLibrary.d.ts.map +1 -1
  157. package/dist/ShaderLibrary.js +183 -207
  158. package/dist/ShaderLibrary.js.map +1 -1
  159. package/dist/ShaderLibraryCore.d.ts +3 -0
  160. package/dist/ShaderLibraryCore.d.ts.map +1 -1
  161. package/dist/ShaderLibraryCore.js +6 -2
  162. package/dist/ShaderLibraryCore.js.map +1 -1
  163. package/dist/ShaderModule.d.ts +7 -1
  164. package/dist/ShaderModule.d.ts.map +1 -1
  165. package/dist/ShaderModule.js +20 -5
  166. package/dist/ShaderModule.js.map +1 -1
  167. package/dist/ShadowPass.d.ts.map +1 -1
  168. package/dist/ShadowPass.js +14 -7
  169. package/dist/ShadowPass.js.map +1 -1
  170. package/dist/SkinnedLitMaterial.d.ts +5 -0
  171. package/dist/SkinnedLitMaterial.d.ts.map +1 -1
  172. package/dist/SkinnedLitMaterial.js +13 -0
  173. package/dist/SkinnedLitMaterial.js.map +1 -1
  174. package/dist/SkinningBounds.d.ts +18 -0
  175. package/dist/SkinningBounds.d.ts.map +1 -1
  176. package/dist/SkinningBounds.js +78 -0
  177. package/dist/SkinningBounds.js.map +1 -1
  178. package/dist/SkinningPaletteTextureCache.d.ts +117 -0
  179. package/dist/SkinningPaletteTextureCache.d.ts.map +1 -0
  180. package/dist/SkinningPaletteTextureCache.js +205 -0
  181. package/dist/SkinningPaletteTextureCache.js.map +1 -0
  182. package/dist/SkinningUniforms.d.ts +56 -0
  183. package/dist/SkinningUniforms.d.ts.map +1 -0
  184. package/dist/SkinningUniforms.js +262 -0
  185. package/dist/SkinningUniforms.js.map +1 -0
  186. package/dist/TemporalHistory.d.ts +70 -0
  187. package/dist/TemporalHistory.d.ts.map +1 -0
  188. package/dist/TemporalHistory.js +218 -0
  189. package/dist/TemporalHistory.js.map +1 -0
  190. package/dist/TemporalMath.d.ts +3 -0
  191. package/dist/TemporalMath.d.ts.map +1 -0
  192. package/dist/TemporalMath.js +9 -0
  193. package/dist/TemporalMath.js.map +1 -0
  194. package/dist/TerrainHeightfield.d.ts +12 -0
  195. package/dist/TerrainHeightfield.d.ts.map +1 -1
  196. package/dist/TerrainHeightfield.js +29 -6
  197. package/dist/TerrainHeightfield.js.map +1 -1
  198. package/dist/TerrainTiles.d.ts +40 -10
  199. package/dist/TerrainTiles.d.ts.map +1 -1
  200. package/dist/TerrainTiles.js +18 -57
  201. package/dist/TerrainTiles.js.map +1 -1
  202. package/dist/Texture.d.ts +47 -2
  203. package/dist/Texture.d.ts.map +1 -1
  204. package/dist/Texture.js +119 -3
  205. package/dist/Texture.js.map +1 -1
  206. package/dist/TexturedPBRMaterial.d.ts +27 -0
  207. package/dist/TexturedPBRMaterial.d.ts.map +1 -1
  208. package/dist/TexturedPBRMaterial.js +137 -23
  209. package/dist/TexturedPBRMaterial.js.map +1 -1
  210. package/dist/TransmissionRenderTarget.d.ts +33 -0
  211. package/dist/TransmissionRenderTarget.d.ts.map +1 -0
  212. package/dist/TransmissionRenderTarget.js +61 -0
  213. package/dist/TransmissionRenderTarget.js.map +1 -0
  214. package/dist/VegetationScatter.js +1 -1
  215. package/dist/VegetationScatter.js.map +1 -1
  216. package/dist/VolumetricFog.d.ts +42 -0
  217. package/dist/VolumetricFog.d.ts.map +1 -1
  218. package/dist/VolumetricFog.js +52 -1
  219. package/dist/VolumetricFog.js.map +1 -1
  220. package/dist/WaterSurface.d.ts +5 -0
  221. package/dist/WaterSurface.d.ts.map +1 -1
  222. package/dist/WaterSurface.js +5 -0
  223. package/dist/WaterSurface.js.map +1 -1
  224. package/dist/WebGL2Device.d.ts +159 -198
  225. package/dist/WebGL2Device.d.ts.map +1 -1
  226. package/dist/WebGL2Device.js +797 -3443
  227. package/dist/WebGL2Device.js.map +1 -1
  228. package/dist/WebGL2StateCache.d.ts +15 -1
  229. package/dist/WebGL2StateCache.d.ts.map +1 -1
  230. package/dist/WebGL2StateCache.js +31 -2
  231. package/dist/WebGL2StateCache.js.map +1 -1
  232. package/dist/WebGPUDevice.d.ts +16 -9
  233. package/dist/WebGPUDevice.d.ts.map +1 -1
  234. package/dist/WebGPUDevice.js +343 -618
  235. package/dist/WebGPUDevice.js.map +1 -1
  236. package/dist/WebGPUExtensionAtlas.d.ts +6 -0
  237. package/dist/WebGPUExtensionAtlas.d.ts.map +1 -0
  238. package/dist/WebGPUExtensionAtlas.js +225 -0
  239. package/dist/WebGPUExtensionAtlas.js.map +1 -0
  240. package/dist/WebGPUSkinningLimits.d.ts +10 -1
  241. package/dist/WebGPUSkinningLimits.d.ts.map +1 -1
  242. package/dist/WebGPUSkinningLimits.js +15 -1
  243. package/dist/WebGPUSkinningLimits.js.map +1 -1
  244. package/dist/advanced-runtime/index.d.ts +6 -2
  245. package/dist/advanced-runtime/index.d.ts.map +1 -1
  246. package/dist/advanced-runtime/index.js +0 -1
  247. package/dist/advanced-runtime/index.js.map +1 -1
  248. package/dist/animation/AnimationRenderPreset.d.ts +1 -1
  249. package/dist/animation/AnimationRenderPreset.d.ts.map +1 -1
  250. package/dist/animation/AnimationRenderPreset.js +1 -1
  251. package/dist/animation/AnimationRenderPreset.js.map +1 -1
  252. package/dist/animation/applyAnimationRenderPreset.d.ts +1 -1
  253. package/dist/animation/applyAnimationRenderPreset.d.ts.map +1 -1
  254. package/dist/animation/index.d.ts +2 -1
  255. package/dist/animation/index.d.ts.map +1 -1
  256. package/dist/animation/index.js +1 -1
  257. package/dist/animation/index.js.map +1 -1
  258. package/dist/atmosphere/CloudLayer.d.ts +24 -0
  259. package/dist/atmosphere/CloudLayer.d.ts.map +1 -0
  260. package/dist/atmosphere/CloudLayer.js +30 -0
  261. package/dist/atmosphere/CloudLayer.js.map +1 -0
  262. package/dist/atmosphere/FogVolumes.d.ts +30 -0
  263. package/dist/atmosphere/FogVolumes.d.ts.map +1 -0
  264. package/dist/atmosphere/FogVolumes.js +96 -0
  265. package/dist/atmosphere/FogVolumes.js.map +1 -0
  266. package/dist/atmosphere/GradientSky.d.ts +40 -0
  267. package/dist/atmosphere/GradientSky.d.ts.map +1 -0
  268. package/dist/atmosphere/GradientSky.js +75 -0
  269. package/dist/atmosphere/GradientSky.js.map +1 -0
  270. package/dist/atmosphere/HeightFog.d.ts +154 -0
  271. package/dist/atmosphere/HeightFog.d.ts.map +1 -0
  272. package/dist/atmosphere/HeightFog.js +379 -0
  273. package/dist/atmosphere/HeightFog.js.map +1 -0
  274. package/dist/atmosphere/PreethamSky.d.ts +38 -0
  275. package/dist/atmosphere/PreethamSky.d.ts.map +1 -0
  276. package/dist/atmosphere/PreethamSky.js +150 -0
  277. package/dist/atmosphere/PreethamSky.js.map +1 -0
  278. package/dist/atmosphere/SkyBackgroundPass.d.ts +63 -0
  279. package/dist/atmosphere/SkyBackgroundPass.d.ts.map +1 -0
  280. package/dist/atmosphere/SkyBackgroundPass.js +233 -0
  281. package/dist/atmosphere/SkyBackgroundPass.js.map +1 -0
  282. package/dist/atmosphere/SkyCaptureAdapter.d.ts +45 -0
  283. package/dist/atmosphere/SkyCaptureAdapter.d.ts.map +1 -0
  284. package/dist/atmosphere/SkyCaptureAdapter.js +65 -0
  285. package/dist/atmosphere/SkyCaptureAdapter.js.map +1 -0
  286. package/dist/atmosphere/SkyEval.d.ts +56 -0
  287. package/dist/atmosphere/SkyEval.d.ts.map +1 -0
  288. package/dist/atmosphere/SkyEval.js +99 -0
  289. package/dist/atmosphere/SkyEval.js.map +1 -0
  290. package/dist/atmosphere/StarField.d.ts +26 -0
  291. package/dist/atmosphere/StarField.d.ts.map +1 -0
  292. package/dist/atmosphere/StarField.js +31 -0
  293. package/dist/atmosphere/StarField.js.map +1 -0
  294. package/dist/atmosphere/VolumetricFogPass.d.ts +69 -0
  295. package/dist/atmosphere/VolumetricFogPass.d.ts.map +1 -0
  296. package/dist/atmosphere/VolumetricFogPass.js +265 -0
  297. package/dist/atmosphere/VolumetricFogPass.js.map +1 -0
  298. package/dist/atmosphere/fogChunks.d.ts +8 -0
  299. package/dist/atmosphere/fogChunks.d.ts.map +1 -0
  300. package/dist/atmosphere/fogChunks.js +39 -0
  301. package/dist/atmosphere/fogChunks.js.map +1 -0
  302. package/dist/atmosphere/fogUniformStore.d.ts +20 -0
  303. package/dist/atmosphere/fogUniformStore.d.ts.map +1 -0
  304. package/dist/atmosphere/fogUniformStore.js +45 -0
  305. package/dist/atmosphere/fogUniformStore.js.map +1 -0
  306. package/dist/atmosphere/shaders/fog.glsl.d.ts +10 -0
  307. package/dist/atmosphere/shaders/fog.glsl.d.ts.map +1 -0
  308. package/dist/atmosphere/shaders/fog.glsl.js +161 -0
  309. package/dist/atmosphere/shaders/fog.glsl.js.map +1 -0
  310. package/dist/atmosphere/shaders/volumetric-apply.glsl.d.ts +3 -0
  311. package/dist/atmosphere/shaders/volumetric-apply.glsl.d.ts.map +1 -0
  312. package/dist/atmosphere/shaders/volumetric-apply.glsl.js +61 -0
  313. package/dist/atmosphere/shaders/volumetric-apply.glsl.js.map +1 -0
  314. package/dist/atmosphere/shaders/volumetric-inject.glsl.d.ts +4 -0
  315. package/dist/atmosphere/shaders/volumetric-inject.glsl.d.ts.map +1 -0
  316. package/dist/atmosphere/shaders/volumetric-inject.glsl.js +129 -0
  317. package/dist/atmosphere/shaders/volumetric-inject.glsl.js.map +1 -0
  318. package/dist/atmosphere/shaders/volumetric-integrate.glsl.d.ts +3 -0
  319. package/dist/atmosphere/shaders/volumetric-integrate.glsl.d.ts.map +1 -0
  320. package/dist/atmosphere/shaders/volumetric-integrate.glsl.js +55 -0
  321. package/dist/atmosphere/shaders/volumetric-integrate.glsl.js.map +1 -0
  322. package/dist/atmosphere/shaders/wetness.glsl.d.ts +34 -0
  323. package/dist/atmosphere/shaders/wetness.glsl.d.ts.map +1 -0
  324. package/dist/atmosphere/shaders/wetness.glsl.js +101 -0
  325. package/dist/atmosphere/shaders/wetness.glsl.js.map +1 -0
  326. package/dist/atmosphere/sky.glsl.d.ts +8 -0
  327. package/dist/atmosphere/sky.glsl.d.ts.map +1 -0
  328. package/dist/atmosphere/sky.glsl.js +249 -0
  329. package/dist/atmosphere/sky.glsl.js.map +1 -0
  330. package/dist/batching/BatchedGeometryPool.d.ts +72 -0
  331. package/dist/batching/BatchedGeometryPool.d.ts.map +1 -0
  332. package/dist/batching/BatchedGeometryPool.js +138 -0
  333. package/dist/batching/BatchedGeometryPool.js.map +1 -0
  334. package/dist/batching/ContentKeys.d.ts +29 -0
  335. package/dist/batching/ContentKeys.d.ts.map +1 -0
  336. package/dist/batching/ContentKeys.js +220 -0
  337. package/dist/batching/ContentKeys.js.map +1 -0
  338. package/dist/batching/DrawDataTexture.d.ts +51 -0
  339. package/dist/batching/DrawDataTexture.d.ts.map +1 -0
  340. package/dist/batching/DrawDataTexture.js +99 -0
  341. package/dist/batching/DrawDataTexture.js.map +1 -0
  342. package/dist/batching/MultiDrawBatch.d.ts +64 -0
  343. package/dist/batching/MultiDrawBatch.d.ts.map +1 -0
  344. package/dist/batching/MultiDrawBatch.js +103 -0
  345. package/dist/batching/MultiDrawBatch.js.map +1 -0
  346. package/dist/batching/StaticMergePlanner.d.ts +80 -0
  347. package/dist/batching/StaticMergePlanner.d.ts.map +1 -0
  348. package/dist/batching/StaticMergePlanner.js +323 -0
  349. package/dist/batching/StaticMergePlanner.js.map +1 -0
  350. package/dist/batching/index.d.ts +8 -0
  351. package/dist/batching/index.d.ts.map +1 -0
  352. package/dist/batching/index.js +8 -0
  353. package/dist/batching/index.js.map +1 -0
  354. package/dist/batching/shaders/drawId.glsl.d.ts +29 -0
  355. package/dist/batching/shaders/drawId.glsl.d.ts.map +1 -0
  356. package/dist/batching/shaders/drawId.glsl.js +93 -0
  357. package/dist/batching/shaders/drawId.glsl.js.map +1 -0
  358. package/dist/batching/shaders/instanceEmissive.glsl.d.ts +16 -0
  359. package/dist/batching/shaders/instanceEmissive.glsl.d.ts.map +1 -0
  360. package/dist/batching/shaders/instanceEmissive.glsl.js +63 -0
  361. package/dist/batching/shaders/instanceEmissive.glsl.js.map +1 -0
  362. package/dist/cinematic/BloomPass.d.ts +5 -9
  363. package/dist/cinematic/BloomPass.d.ts.map +1 -1
  364. package/dist/cinematic/BloomPass.js +5 -17
  365. package/dist/cinematic/BloomPass.js.map +1 -1
  366. package/dist/cinematic/DepthHazePass.d.ts +5 -11
  367. package/dist/cinematic/DepthHazePass.d.ts.map +1 -1
  368. package/dist/cinematic/DepthHazePass.js +5 -19
  369. package/dist/cinematic/DepthHazePass.js.map +1 -1
  370. package/dist/cinematic/FilmGrainPass.d.ts +5 -8
  371. package/dist/cinematic/FilmGrainPass.d.ts.map +1 -1
  372. package/dist/cinematic/FilmGrainPass.js +5 -16
  373. package/dist/cinematic/FilmGrainPass.js.map +1 -1
  374. package/dist/cinematic/VignettePass.d.ts +5 -9
  375. package/dist/cinematic/VignettePass.d.ts.map +1 -1
  376. package/dist/cinematic/VignettePass.js +5 -16
  377. package/dist/cinematic/VignettePass.js.map +1 -1
  378. package/dist/cinematic/index.d.ts +2 -1
  379. package/dist/cinematic/index.d.ts.map +1 -1
  380. package/dist/cinematic/index.js +1 -1
  381. package/dist/cinematic/index.js.map +1 -1
  382. package/dist/contracts/atmosphere.d.ts +30 -0
  383. package/dist/contracts/atmosphere.d.ts.map +1 -0
  384. package/dist/contracts/atmosphere.js +42 -0
  385. package/dist/contracts/atmosphere.js.map +1 -0
  386. package/dist/contracts/blend.d.ts +28 -0
  387. package/dist/contracts/blend.d.ts.map +1 -0
  388. package/dist/contracts/blend.js +73 -0
  389. package/dist/contracts/blend.js.map +1 -0
  390. package/dist/contracts/core.d.ts +47 -0
  391. package/dist/contracts/core.d.ts.map +1 -0
  392. package/dist/contracts/core.js +70 -0
  393. package/dist/contracts/core.js.map +1 -0
  394. package/dist/contracts/deform.d.ts +38 -0
  395. package/dist/contracts/deform.d.ts.map +1 -0
  396. package/dist/contracts/deform.js +14 -0
  397. package/dist/contracts/deform.js.map +1 -0
  398. package/dist/contracts/device.d.ts +71 -0
  399. package/dist/contracts/device.d.ts.map +1 -0
  400. package/dist/contracts/device.js +97 -0
  401. package/dist/contracts/device.js.map +1 -0
  402. package/dist/contracts/environment.d.ts +55 -0
  403. package/dist/contracts/environment.d.ts.map +1 -0
  404. package/dist/contracts/environment.js +115 -0
  405. package/dist/contracts/environment.js.map +1 -0
  406. package/dist/contracts/flags.state.d.ts +15 -0
  407. package/dist/contracts/flags.state.d.ts.map +1 -0
  408. package/dist/contracts/flags.state.js +45 -0
  409. package/dist/contracts/flags.state.js.map +1 -0
  410. package/dist/contracts/frameGraph.d.ts +78 -0
  411. package/dist/contracts/frameGraph.d.ts.map +1 -0
  412. package/dist/contracts/frameGraph.js +32 -0
  413. package/dist/contracts/frameGraph.js.map +1 -0
  414. package/dist/contracts/frameUniforms.d.ts +43 -0
  415. package/dist/contracts/frameUniforms.d.ts.map +1 -0
  416. package/dist/contracts/frameUniforms.js +35 -0
  417. package/dist/contracts/frameUniforms.js.map +1 -0
  418. package/dist/contracts/geometry.d.ts +33 -0
  419. package/dist/contracts/geometry.d.ts.map +1 -0
  420. package/dist/contracts/geometry.js +59 -0
  421. package/dist/contracts/geometry.js.map +1 -0
  422. package/dist/contracts/index.d.ts +27 -0
  423. package/dist/contracts/index.d.ts.map +1 -0
  424. package/dist/contracts/index.js +27 -0
  425. package/dist/contracts/index.js.map +1 -0
  426. package/dist/contracts/materialLobes.d.ts +41 -0
  427. package/dist/contracts/materialLobes.d.ts.map +1 -0
  428. package/dist/contracts/materialLobes.js +14 -0
  429. package/dist/contracts/materialLobes.js.map +1 -0
  430. package/dist/contracts/output.d.ts +35 -0
  431. package/dist/contracts/output.d.ts.map +1 -0
  432. package/dist/contracts/output.js +18 -0
  433. package/dist/contracts/output.js.map +1 -0
  434. package/dist/contracts/particles.d.ts +41 -0
  435. package/dist/contracts/particles.d.ts.map +1 -0
  436. package/dist/contracts/particles.js +15 -0
  437. package/dist/contracts/particles.js.map +1 -0
  438. package/dist/contracts/post.d.ts +71 -0
  439. package/dist/contracts/post.d.ts.map +1 -0
  440. package/dist/contracts/post.js +28 -0
  441. package/dist/contracts/post.js.map +1 -0
  442. package/dist/contracts/program.d.ts +158 -0
  443. package/dist/contracts/program.d.ts.map +1 -0
  444. package/dist/contracts/program.js +128 -0
  445. package/dist/contracts/program.js.map +1 -0
  446. package/dist/contracts/quality.d.ts +93 -0
  447. package/dist/contracts/quality.d.ts.map +1 -0
  448. package/dist/contracts/quality.js +149 -0
  449. package/dist/contracts/quality.js.map +1 -0
  450. package/dist/contracts/renderItem.d.ts +58 -0
  451. package/dist/contracts/renderItem.d.ts.map +1 -0
  452. package/dist/contracts/renderItem.js +8 -0
  453. package/dist/contracts/renderItem.js.map +1 -0
  454. package/dist/contracts/renderSource.d.ts +63 -0
  455. package/dist/contracts/renderSource.d.ts.map +1 -0
  456. package/dist/contracts/renderSource.js +7 -0
  457. package/dist/contracts/renderSource.js.map +1 -0
  458. package/dist/contracts/rendererFactory.d.ts +42 -0
  459. package/dist/contracts/rendererFactory.d.ts.map +1 -0
  460. package/dist/contracts/rendererFactory.js +32 -0
  461. package/dist/contracts/rendererFactory.js.map +1 -0
  462. package/dist/contracts/sampling.d.ts +23 -0
  463. package/dist/contracts/sampling.d.ts.map +1 -0
  464. package/dist/contracts/sampling.js +17 -0
  465. package/dist/contracts/sampling.js.map +1 -0
  466. package/dist/contracts/shadows.d.ts +53 -0
  467. package/dist/contracts/shadows.d.ts.map +1 -0
  468. package/dist/contracts/shadows.js +66 -0
  469. package/dist/contracts/shadows.js.map +1 -0
  470. package/dist/contracts/testing/ChunkHarness.d.ts +18 -0
  471. package/dist/contracts/testing/ChunkHarness.d.ts.map +1 -0
  472. package/dist/contracts/testing/ChunkHarness.js +68 -0
  473. package/dist/contracts/testing/ChunkHarness.js.map +1 -0
  474. package/dist/contracts/textureFormats.d.ts +18 -0
  475. package/dist/contracts/textureFormats.d.ts.map +1 -0
  476. package/dist/contracts/textureFormats.js +13 -0
  477. package/dist/contracts/textureFormats.js.map +1 -0
  478. package/dist/contracts/velocity.d.ts +37 -0
  479. package/dist/contracts/velocity.d.ts.map +1 -0
  480. package/dist/contracts/velocity.js +22 -0
  481. package/dist/contracts/velocity.js.map +1 -0
  482. package/dist/effects/GPUParticleBackend.d.ts +4 -2
  483. package/dist/effects/GPUParticleBackend.d.ts.map +1 -1
  484. package/dist/effects/GPUParticleBackend.js +20 -2
  485. package/dist/effects/GPUParticleBackend.js.map +1 -1
  486. package/dist/effects/ResidentGPUParticleRenderer.d.ts +158 -0
  487. package/dist/effects/ResidentGPUParticleRenderer.d.ts.map +1 -0
  488. package/dist/effects/ResidentGPUParticleRenderer.js +576 -0
  489. package/dist/effects/ResidentGPUParticleRenderer.js.map +1 -0
  490. package/dist/environment/EnvUniforms.d.ts +42 -0
  491. package/dist/environment/EnvUniforms.d.ts.map +1 -0
  492. package/dist/environment/EnvUniforms.js +54 -0
  493. package/dist/environment/EnvUniforms.js.map +1 -0
  494. package/dist/environment/EnvironmentCache.d.ts +83 -0
  495. package/dist/environment/EnvironmentCache.d.ts.map +1 -0
  496. package/dist/environment/EnvironmentCache.js +205 -0
  497. package/dist/environment/EnvironmentCache.js.map +1 -0
  498. package/dist/environment/EnvironmentProbeFactory.d.ts +41 -0
  499. package/dist/environment/EnvironmentProbeFactory.d.ts.map +1 -0
  500. package/dist/environment/EnvironmentProbeFactory.js +52 -0
  501. package/dist/environment/EnvironmentProbeFactory.js.map +1 -0
  502. package/dist/environment/GPUPMREMGenerator.d.ts +44 -0
  503. package/dist/environment/GPUPMREMGenerator.d.ts.map +1 -0
  504. package/dist/environment/GPUPMREMGenerator.js +98 -0
  505. package/dist/environment/GPUPMREMGenerator.js.map +1 -0
  506. package/dist/environment/HdrEquirect.d.ts +28 -0
  507. package/dist/environment/HdrEquirect.d.ts.map +1 -0
  508. package/dist/environment/HdrEquirect.js +205 -0
  509. package/dist/environment/HdrEquirect.js.map +1 -0
  510. package/dist/environment/LightingSamplerBudget.d.ts +20 -0
  511. package/dist/environment/LightingSamplerBudget.d.ts.map +1 -0
  512. package/dist/environment/LightingSamplerBudget.js +94 -0
  513. package/dist/environment/LightingSamplerBudget.js.map +1 -0
  514. package/dist/environment/Prd02BackgroundShaderLibrary.d.ts +10 -0
  515. package/dist/environment/Prd02BackgroundShaderLibrary.d.ts.map +1 -0
  516. package/dist/environment/Prd02BackgroundShaderLibrary.js +100 -0
  517. package/dist/environment/Prd02BackgroundShaderLibrary.js.map +1 -0
  518. package/dist/environment/Rgb9e5Cube.d.ts +25 -0
  519. package/dist/environment/Rgb9e5Cube.d.ts.map +1 -0
  520. package/dist/environment/Rgb9e5Cube.js +103 -0
  521. package/dist/environment/Rgb9e5Cube.js.map +1 -0
  522. package/dist/environment/RoomEnvironmentScene.d.ts +57 -0
  523. package/dist/environment/RoomEnvironmentScene.d.ts.map +1 -0
  524. package/dist/environment/RoomEnvironmentScene.js +165 -0
  525. package/dist/environment/RoomEnvironmentScene.js.map +1 -0
  526. package/dist/environment/SphericalHarmonics.d.ts +32 -0
  527. package/dist/environment/SphericalHarmonics.d.ts.map +1 -0
  528. package/dist/environment/SphericalHarmonics.js +155 -0
  529. package/dist/environment/SphericalHarmonics.js.map +1 -0
  530. package/dist/environment/probeBuild.d.ts +97 -0
  531. package/dist/environment/probeBuild.d.ts.map +1 -0
  532. package/dist/environment/probeBuild.js +406 -0
  533. package/dist/environment/probeBuild.js.map +1 -0
  534. package/dist/environment/workers/cpuPrefilter.d.ts +58 -0
  535. package/dist/environment/workers/cpuPrefilter.d.ts.map +1 -0
  536. package/dist/environment/workers/cpuPrefilter.js +288 -0
  537. package/dist/environment/workers/cpuPrefilter.js.map +1 -0
  538. package/dist/extension-scalar-atlas.d.ts +3 -0
  539. package/dist/extension-scalar-atlas.d.ts.map +1 -0
  540. package/dist/extension-scalar-atlas.js +2 -0
  541. package/dist/extension-scalar-atlas.js.map +1 -0
  542. package/dist/forward/Deform.d.ts +56 -0
  543. package/dist/forward/Deform.d.ts.map +1 -0
  544. package/dist/forward/Deform.js +517 -0
  545. package/dist/forward/Deform.js.map +1 -0
  546. package/dist/forward/DrawSubmit.d.ts +32 -0
  547. package/dist/forward/DrawSubmit.d.ts.map +1 -0
  548. package/dist/forward/DrawSubmit.js +75 -0
  549. package/dist/forward/DrawSubmit.js.map +1 -0
  550. package/dist/forward/Lighting.d.ts +35 -0
  551. package/dist/forward/Lighting.d.ts.map +1 -0
  552. package/dist/forward/Lighting.js +477 -0
  553. package/dist/forward/Lighting.js.map +1 -0
  554. package/dist/forward/Transmission.d.ts +62 -0
  555. package/dist/forward/Transmission.d.ts.map +1 -0
  556. package/dist/forward/Transmission.js +299 -0
  557. package/dist/forward/Transmission.js.map +1 -0
  558. package/dist/forward/Velocity.d.ts +47 -0
  559. package/dist/forward/Velocity.d.ts.map +1 -0
  560. package/dist/forward/Velocity.js +153 -0
  561. package/dist/forward/Velocity.js.map +1 -0
  562. package/dist/forward/transmissionTargetStore.d.ts +21 -0
  563. package/dist/forward/transmissionTargetStore.d.ts.map +1 -0
  564. package/dist/forward/transmissionTargetStore.js +8 -0
  565. package/dist/forward/transmissionTargetStore.js.map +1 -0
  566. package/dist/geometry/Primitives.d.ts +28 -0
  567. package/dist/geometry/Primitives.d.ts.map +1 -0
  568. package/dist/geometry/Primitives.js +110 -0
  569. package/dist/geometry/Primitives.js.map +1 -0
  570. package/dist/index.d.ts +140 -57
  571. package/dist/index.d.ts.map +1 -1
  572. package/dist/index.js +102 -51
  573. package/dist/index.js.map +1 -1
  574. package/dist/lanes/index.d.ts +17 -0
  575. package/dist/lanes/index.d.ts.map +1 -0
  576. package/dist/lanes/index.js +17 -0
  577. package/dist/lanes/index.js.map +1 -0
  578. package/dist/lanes/prd01.d.ts +6 -0
  579. package/dist/lanes/prd01.d.ts.map +1 -0
  580. package/dist/lanes/prd01.js +19 -0
  581. package/dist/lanes/prd01.js.map +1 -0
  582. package/dist/lanes/prd02.d.ts +62 -0
  583. package/dist/lanes/prd02.d.ts.map +1 -0
  584. package/dist/lanes/prd02.js +117 -0
  585. package/dist/lanes/prd02.js.map +1 -0
  586. package/dist/lanes/prd03.d.ts +19 -0
  587. package/dist/lanes/prd03.d.ts.map +1 -0
  588. package/dist/lanes/prd03.js +55 -0
  589. package/dist/lanes/prd03.js.map +1 -0
  590. package/dist/lanes/prd04.d.ts +22 -0
  591. package/dist/lanes/prd04.d.ts.map +1 -0
  592. package/dist/lanes/prd04.js +35 -0
  593. package/dist/lanes/prd04.js.map +1 -0
  594. package/dist/lanes/prd05.d.ts +4 -0
  595. package/dist/lanes/prd05.d.ts.map +1 -0
  596. package/dist/lanes/prd05.js +31 -0
  597. package/dist/lanes/prd05.js.map +1 -0
  598. package/dist/lanes/prd06.d.ts +33 -0
  599. package/dist/lanes/prd06.d.ts.map +1 -0
  600. package/dist/lanes/prd06.js +217 -0
  601. package/dist/lanes/prd06.js.map +1 -0
  602. package/dist/lanes/prd07.d.ts +49 -0
  603. package/dist/lanes/prd07.d.ts.map +1 -0
  604. package/dist/lanes/prd07.js +112 -0
  605. package/dist/lanes/prd07.js.map +1 -0
  606. package/dist/lanes/prd08.d.ts +2 -0
  607. package/dist/lanes/prd08.d.ts.map +1 -0
  608. package/dist/lanes/prd08.js +17 -0
  609. package/dist/lanes/prd08.js.map +1 -0
  610. package/dist/lanes/prd09.d.ts +6 -0
  611. package/dist/lanes/prd09.d.ts.map +1 -0
  612. package/dist/lanes/prd09.js +6 -0
  613. package/dist/lanes/prd09.js.map +1 -0
  614. package/dist/lanes/prd10.d.ts +2 -0
  615. package/dist/lanes/prd10.d.ts.map +1 -0
  616. package/dist/lanes/prd10.js +10 -0
  617. package/dist/lanes/prd10.js.map +1 -0
  618. package/dist/lanes/prd11.d.ts +61 -0
  619. package/dist/lanes/prd11.d.ts.map +1 -0
  620. package/dist/lanes/prd11.js +244 -0
  621. package/dist/lanes/prd11.js.map +1 -0
  622. package/dist/lanes/prd12.d.ts +6 -0
  623. package/dist/lanes/prd12.d.ts.map +1 -0
  624. package/dist/lanes/prd12.js +6 -0
  625. package/dist/lanes/prd12.js.map +1 -0
  626. package/dist/lanes/prd13.d.ts +6 -0
  627. package/dist/lanes/prd13.d.ts.map +1 -0
  628. package/dist/lanes/prd13.js +6 -0
  629. package/dist/lanes/prd13.js.map +1 -0
  630. package/dist/lanes/prd14.d.ts +6 -0
  631. package/dist/lanes/prd14.d.ts.map +1 -0
  632. package/dist/lanes/prd14.js +6 -0
  633. package/dist/lanes/prd14.js.map +1 -0
  634. package/dist/lanes/prd15.d.ts +6 -0
  635. package/dist/lanes/prd15.d.ts.map +1 -0
  636. package/dist/lanes/prd15.js +6 -0
  637. package/dist/lanes/prd15.js.map +1 -0
  638. package/dist/lean/LeanProductionRenderer.d.ts.map +1 -1
  639. package/dist/lean/LeanProductionRenderer.js +2 -2
  640. package/dist/lean/LeanProductionRenderer.js.map +1 -1
  641. package/dist/lean-core-runtime.d.ts +13 -0
  642. package/dist/lean-core-runtime.d.ts.map +1 -0
  643. package/dist/lean-core-runtime.js +10 -0
  644. package/dist/lean-core-runtime.js.map +1 -0
  645. package/dist/materials/PhysicalFeatures.d.ts +71 -0
  646. package/dist/materials/PhysicalFeatures.d.ts.map +1 -0
  647. package/dist/materials/PhysicalFeatures.js +255 -0
  648. package/dist/materials/PhysicalFeatures.js.map +1 -0
  649. package/dist/materials/PhysicalMaterial.d.ts +85 -0
  650. package/dist/materials/PhysicalMaterial.d.ts.map +1 -1
  651. package/dist/materials/PhysicalMaterial.js +21 -0
  652. package/dist/materials/PhysicalMaterial.js.map +1 -1
  653. package/dist/materials/features.d.ts +47 -0
  654. package/dist/materials/features.d.ts.map +1 -0
  655. package/dist/materials/features.js +282 -0
  656. package/dist/materials/features.js.map +1 -0
  657. package/dist/materials/lobes.d.ts +3 -0
  658. package/dist/materials/lobes.d.ts.map +1 -0
  659. package/dist/materials/lobes.js +225 -0
  660. package/dist/materials/lobes.js.map +1 -0
  661. package/dist/output/HdrTarget.d.ts +27 -0
  662. package/dist/output/HdrTarget.d.ts.map +1 -0
  663. package/dist/output/HdrTarget.js +48 -0
  664. package/dist/output/HdrTarget.js.map +1 -0
  665. package/dist/output/OutputPass.d.ts +28 -0
  666. package/dist/output/OutputPass.d.ts.map +1 -0
  667. package/dist/output/OutputPass.js +142 -0
  668. package/dist/output/OutputPass.js.map +1 -0
  669. package/dist/output/ToneMappingOperators.glsl.d.ts +22 -0
  670. package/dist/output/ToneMappingOperators.glsl.d.ts.map +1 -0
  671. package/dist/output/ToneMappingOperators.glsl.js +217 -0
  672. package/dist/output/ToneMappingOperators.glsl.js.map +1 -0
  673. package/dist/passes/ContactShadowPass.d.ts +57 -0
  674. package/dist/passes/ContactShadowPass.d.ts.map +1 -0
  675. package/dist/passes/ContactShadowPass.js +151 -0
  676. package/dist/passes/ContactShadowPass.js.map +1 -0
  677. package/dist/passes/Prd02ContactShadowsContributor.d.ts +16 -0
  678. package/dist/passes/Prd02ContactShadowsContributor.d.ts.map +1 -0
  679. package/dist/passes/Prd02ContactShadowsContributor.js +133 -0
  680. package/dist/passes/Prd02ContactShadowsContributor.js.map +1 -0
  681. package/dist/passes/Prd02SubFlags.d.ts +22 -0
  682. package/dist/passes/Prd02SubFlags.d.ts.map +1 -0
  683. package/dist/passes/Prd02SubFlags.js +32 -0
  684. package/dist/passes/Prd02SubFlags.js.map +1 -0
  685. package/dist/performance/BVH.d.ts +46 -0
  686. package/dist/performance/BVH.d.ts.map +1 -1
  687. package/dist/performance/BVH.js +212 -0
  688. package/dist/performance/BVH.js.map +1 -1
  689. package/dist/performance/Batcher.d.ts +11 -0
  690. package/dist/performance/Batcher.d.ts.map +1 -1
  691. package/dist/performance/Batcher.js +10 -0
  692. package/dist/performance/Batcher.js.map +1 -1
  693. package/dist/performance/FrustumCuller.d.ts +29 -0
  694. package/dist/performance/FrustumCuller.d.ts.map +1 -1
  695. package/dist/performance/FrustumCuller.js +78 -1
  696. package/dist/performance/FrustumCuller.js.map +1 -1
  697. package/dist/performance/LOD.d.ts +6 -0
  698. package/dist/performance/LOD.d.ts.map +1 -1
  699. package/dist/performance/LOD.js +12 -0
  700. package/dist/performance/LOD.js.map +1 -1
  701. package/dist/performance/RenderItemSorting.d.ts +2 -0
  702. package/dist/performance/RenderItemSorting.d.ts.map +1 -1
  703. package/dist/performance/RenderItemSorting.js +5 -1
  704. package/dist/performance/RenderItemSorting.js.map +1 -1
  705. package/dist/post/CubeLut.d.ts +15 -0
  706. package/dist/post/CubeLut.d.ts.map +1 -0
  707. package/dist/post/CubeLut.js +86 -0
  708. package/dist/post/CubeLut.js.map +1 -0
  709. package/dist/post/DisplayLutCache.d.ts +31 -0
  710. package/dist/post/DisplayLutCache.d.ts.map +1 -0
  711. package/dist/post/DisplayLutCache.js +44 -0
  712. package/dist/post/DisplayLutCache.js.map +1 -0
  713. package/dist/post/PostAntiAlias.d.ts +49 -0
  714. package/dist/post/PostAntiAlias.d.ts.map +1 -0
  715. package/dist/post/PostAntiAlias.js +75 -0
  716. package/dist/post/PostAntiAlias.js.map +1 -0
  717. package/dist/post/PostGraph.d.ts +206 -0
  718. package/dist/post/PostGraph.d.ts.map +1 -0
  719. package/dist/post/PostGraph.js +234 -0
  720. package/dist/post/PostGraph.js.map +1 -0
  721. package/dist/post/PostQualityTiers.d.ts +95 -0
  722. package/dist/post/PostQualityTiers.d.ts.map +1 -0
  723. package/dist/post/PostQualityTiers.js +62 -0
  724. package/dist/post/PostQualityTiers.js.map +1 -0
  725. package/dist/post/PostResources.d.ts +49 -0
  726. package/dist/post/PostResources.d.ts.map +1 -0
  727. package/dist/post/PostResources.js +119 -0
  728. package/dist/post/PostResources.js.map +1 -0
  729. package/dist/post/PostTimer.d.ts +37 -0
  730. package/dist/post/PostTimer.d.ts.map +1 -0
  731. package/dist/post/PostTimer.js +88 -0
  732. package/dist/post/PostTimer.js.map +1 -0
  733. package/dist/post/ScreenFeelPass.d.ts +83 -0
  734. package/dist/post/ScreenFeelPass.d.ts.map +1 -0
  735. package/dist/post/ScreenFeelPass.js +197 -0
  736. package/dist/post/ScreenFeelPass.js.map +1 -0
  737. package/dist/post/ToneOperators.d.ts +42 -0
  738. package/dist/post/ToneOperators.d.ts.map +1 -0
  739. package/dist/post/ToneOperators.js +179 -0
  740. package/dist/post/ToneOperators.js.map +1 -0
  741. package/dist/post/chunks/indirectFraction.glsl.d.ts +50 -0
  742. package/dist/post/chunks/indirectFraction.glsl.d.ts.map +1 -0
  743. package/dist/post/chunks/indirectFraction.glsl.js +82 -0
  744. package/dist/post/chunks/indirectFraction.glsl.js.map +1 -0
  745. package/dist/post/chunks/velocity.glsl.d.ts +35 -0
  746. package/dist/post/chunks/velocity.glsl.d.ts.map +1 -0
  747. package/dist/post/chunks/velocity.glsl.js +86 -0
  748. package/dist/post/chunks/velocity.glsl.js.map +1 -0
  749. package/dist/post/shaders/bloom.glsl.d.ts +21 -0
  750. package/dist/post/shaders/bloom.glsl.d.ts.map +1 -0
  751. package/dist/post/shaders/bloom.glsl.js +120 -0
  752. package/dist/post/shaders/bloom.glsl.js.map +1 -0
  753. package/dist/post/shaders/bloom.wgsl.d.ts +10 -0
  754. package/dist/post/shaders/bloom.wgsl.d.ts.map +1 -0
  755. package/dist/post/shaders/bloom.wgsl.js +121 -0
  756. package/dist/post/shaders/bloom.wgsl.js.map +1 -0
  757. package/dist/post/shaders/common.glsl.d.ts +11 -0
  758. package/dist/post/shaders/common.glsl.d.ts.map +1 -0
  759. package/dist/post/shaders/common.glsl.js +34 -0
  760. package/dist/post/shaders/common.glsl.js.map +1 -0
  761. package/dist/post/shaders/common.wgsl.d.ts +25 -0
  762. package/dist/post/shaders/common.wgsl.d.ts.map +1 -0
  763. package/dist/post/shaders/common.wgsl.js +48 -0
  764. package/dist/post/shaders/common.wgsl.js.map +1 -0
  765. package/dist/post/shaders/composite.glsl.d.ts +25 -0
  766. package/dist/post/shaders/composite.glsl.d.ts.map +1 -0
  767. package/dist/post/shaders/composite.glsl.js +96 -0
  768. package/dist/post/shaders/composite.glsl.js.map +1 -0
  769. package/dist/post/shaders/composite.wgsl.d.ts +10 -0
  770. package/dist/post/shaders/composite.wgsl.d.ts.map +1 -0
  771. package/dist/post/shaders/composite.wgsl.js +92 -0
  772. package/dist/post/shaders/composite.wgsl.js.map +1 -0
  773. package/dist/post/shaders/depthDownsample.glsl.d.ts +20 -0
  774. package/dist/post/shaders/depthDownsample.glsl.d.ts.map +1 -0
  775. package/dist/post/shaders/depthDownsample.glsl.js +78 -0
  776. package/dist/post/shaders/depthDownsample.glsl.js.map +1 -0
  777. package/dist/post/shaders/depthDownsample.wgsl.d.ts +17 -0
  778. package/dist/post/shaders/depthDownsample.wgsl.d.ts.map +1 -0
  779. package/dist/post/shaders/depthDownsample.wgsl.js +87 -0
  780. package/dist/post/shaders/depthDownsample.wgsl.js.map +1 -0
  781. package/dist/post/shaders/displayGrade.glsl.d.ts +18 -0
  782. package/dist/post/shaders/displayGrade.glsl.d.ts.map +1 -0
  783. package/dist/post/shaders/displayGrade.glsl.js +80 -0
  784. package/dist/post/shaders/displayGrade.glsl.js.map +1 -0
  785. package/dist/post/shaders/displayGrade.wgsl.d.ts +9 -0
  786. package/dist/post/shaders/displayGrade.wgsl.d.ts.map +1 -0
  787. package/dist/post/shaders/displayGrade.wgsl.js +75 -0
  788. package/dist/post/shaders/displayGrade.wgsl.js.map +1 -0
  789. package/dist/post/shaders/dof.glsl.d.ts +25 -0
  790. package/dist/post/shaders/dof.glsl.d.ts.map +1 -0
  791. package/dist/post/shaders/dof.glsl.js +129 -0
  792. package/dist/post/shaders/dof.glsl.js.map +1 -0
  793. package/dist/post/shaders/dof.wgsl.d.ts +11 -0
  794. package/dist/post/shaders/dof.wgsl.d.ts.map +1 -0
  795. package/dist/post/shaders/dof.wgsl.js +119 -0
  796. package/dist/post/shaders/dof.wgsl.js.map +1 -0
  797. package/dist/post/shaders/exposure.glsl.d.ts +43 -0
  798. package/dist/post/shaders/exposure.glsl.d.ts.map +1 -0
  799. package/dist/post/shaders/exposure.glsl.js +115 -0
  800. package/dist/post/shaders/exposure.glsl.js.map +1 -0
  801. package/dist/post/shaders/exposure.wgsl.d.ts +16 -0
  802. package/dist/post/shaders/exposure.wgsl.d.ts.map +1 -0
  803. package/dist/post/shaders/exposure.wgsl.js +97 -0
  804. package/dist/post/shaders/exposure.wgsl.js.map +1 -0
  805. package/dist/post/shaders/finalize.glsl.d.ts +17 -0
  806. package/dist/post/shaders/finalize.glsl.d.ts.map +1 -0
  807. package/dist/post/shaders/finalize.glsl.js +120 -0
  808. package/dist/post/shaders/finalize.glsl.js.map +1 -0
  809. package/dist/post/shaders/finalize.wgsl.d.ts +13 -0
  810. package/dist/post/shaders/finalize.wgsl.d.ts.map +1 -0
  811. package/dist/post/shaders/finalize.wgsl.js +124 -0
  812. package/dist/post/shaders/finalize.wgsl.js.map +1 -0
  813. package/dist/post/shaders/fxaa.glsl.d.ts +26 -0
  814. package/dist/post/shaders/fxaa.glsl.d.ts.map +1 -0
  815. package/dist/post/shaders/fxaa.glsl.js +246 -0
  816. package/dist/post/shaders/fxaa.glsl.js.map +1 -0
  817. package/dist/post/shaders/fxaa.wgsl.d.ts +17 -0
  818. package/dist/post/shaders/fxaa.wgsl.d.ts.map +1 -0
  819. package/dist/post/shaders/fxaa.wgsl.js +268 -0
  820. package/dist/post/shaders/fxaa.wgsl.js.map +1 -0
  821. package/dist/post/shaders/godrays.glsl.d.ts +16 -0
  822. package/dist/post/shaders/godrays.glsl.d.ts.map +1 -0
  823. package/dist/post/shaders/godrays.glsl.js +70 -0
  824. package/dist/post/shaders/godrays.glsl.js.map +1 -0
  825. package/dist/post/shaders/godrays.wgsl.d.ts +8 -0
  826. package/dist/post/shaders/godrays.wgsl.d.ts.map +1 -0
  827. package/dist/post/shaders/godrays.wgsl.js +60 -0
  828. package/dist/post/shaders/godrays.wgsl.js.map +1 -0
  829. package/dist/post/shaders/gtao.glsl.d.ts +29 -0
  830. package/dist/post/shaders/gtao.glsl.d.ts.map +1 -0
  831. package/dist/post/shaders/gtao.glsl.js +190 -0
  832. package/dist/post/shaders/gtao.glsl.js.map +1 -0
  833. package/dist/post/shaders/gtao.wgsl.d.ts +13 -0
  834. package/dist/post/shaders/gtao.wgsl.d.ts.map +1 -0
  835. package/dist/post/shaders/gtao.wgsl.js +163 -0
  836. package/dist/post/shaders/gtao.wgsl.js.map +1 -0
  837. package/dist/post/shaders/gtaoDenoise.glsl.d.ts +22 -0
  838. package/dist/post/shaders/gtaoDenoise.glsl.d.ts.map +1 -0
  839. package/dist/post/shaders/gtaoDenoise.glsl.js +121 -0
  840. package/dist/post/shaders/gtaoDenoise.glsl.js.map +1 -0
  841. package/dist/post/shaders/gtaoDenoise.wgsl.d.ts +11 -0
  842. package/dist/post/shaders/gtaoDenoise.wgsl.d.ts.map +1 -0
  843. package/dist/post/shaders/gtaoDenoise.wgsl.js +117 -0
  844. package/dist/post/shaders/gtaoDenoise.wgsl.js.map +1 -0
  845. package/dist/post/shaders/motionBlur.glsl.d.ts +21 -0
  846. package/dist/post/shaders/motionBlur.glsl.d.ts.map +1 -0
  847. package/dist/post/shaders/motionBlur.glsl.js +110 -0
  848. package/dist/post/shaders/motionBlur.glsl.js.map +1 -0
  849. package/dist/post/shaders/motionBlur.wgsl.d.ts +10 -0
  850. package/dist/post/shaders/motionBlur.wgsl.d.ts.map +1 -0
  851. package/dist/post/shaders/motionBlur.wgsl.js +102 -0
  852. package/dist/post/shaders/motionBlur.wgsl.js.map +1 -0
  853. package/dist/post/shaders/smaa.glsl.d.ts +28 -0
  854. package/dist/post/shaders/smaa.glsl.d.ts.map +1 -0
  855. package/dist/post/shaders/smaa.glsl.js +354 -0
  856. package/dist/post/shaders/smaa.glsl.js.map +1 -0
  857. package/dist/post/shaders/smaa.wgsl.d.ts +20 -0
  858. package/dist/post/shaders/smaa.wgsl.d.ts.map +1 -0
  859. package/dist/post/shaders/smaa.wgsl.js +375 -0
  860. package/dist/post/shaders/smaa.wgsl.js.map +1 -0
  861. package/dist/post/shaders/taa.glsl.d.ts +23 -0
  862. package/dist/post/shaders/taa.glsl.d.ts.map +1 -0
  863. package/dist/post/shaders/taa.glsl.js +169 -0
  864. package/dist/post/shaders/taa.glsl.js.map +1 -0
  865. package/dist/post/shaders/taa.wgsl.d.ts +10 -0
  866. package/dist/post/shaders/taa.wgsl.d.ts.map +1 -0
  867. package/dist/post/shaders/taa.wgsl.js +185 -0
  868. package/dist/post/shaders/taa.wgsl.js.map +1 -0
  869. package/dist/post/shaders/velocityDilate.glsl.d.ts +16 -0
  870. package/dist/post/shaders/velocityDilate.glsl.d.ts.map +1 -0
  871. package/dist/post/shaders/velocityDilate.glsl.js +45 -0
  872. package/dist/post/shaders/velocityDilate.glsl.js.map +1 -0
  873. package/dist/post/shaders/velocityDilate.wgsl.d.ts +8 -0
  874. package/dist/post/shaders/velocityDilate.wgsl.d.ts.map +1 -0
  875. package/dist/post/shaders/velocityDilate.wgsl.js +30 -0
  876. package/dist/post/shaders/velocityDilate.wgsl.js.map +1 -0
  877. package/dist/post/smaa/textures.d.ts +17 -0
  878. package/dist/post/smaa/textures.d.ts.map +1 -0
  879. package/dist/post/smaa/textures.js +17 -0
  880. package/dist/post/smaa/textures.js.map +1 -0
  881. package/dist/post/v2Entry.d.ts +25 -0
  882. package/dist/post/v2Entry.d.ts.map +1 -0
  883. package/dist/post/v2Entry.js +28 -0
  884. package/dist/post/v2Entry.js.map +1 -0
  885. package/dist/post/v2Stages.d.ts +156 -0
  886. package/dist/post/v2Stages.d.ts.map +1 -0
  887. package/dist/post/v2Stages.js +1189 -0
  888. package/dist/post/v2Stages.js.map +1 -0
  889. package/dist/postprocess/EffectComposer.d.ts +6 -109
  890. package/dist/postprocess/EffectComposer.d.ts.map +1 -1
  891. package/dist/postprocess/EffectComposer.js +6 -246
  892. package/dist/postprocess/EffectComposer.js.map +1 -1
  893. package/dist/postprocess/NativeBloomPyramid.d.ts +51 -1
  894. package/dist/postprocess/NativeBloomPyramid.d.ts.map +1 -1
  895. package/dist/postprocess/NativeBloomPyramid.js +88 -1
  896. package/dist/postprocess/NativeBloomPyramid.js.map +1 -1
  897. package/dist/postprocess/SSAOPass.d.ts +5 -5
  898. package/dist/postprocess/SSAOPass.d.ts.map +1 -1
  899. package/dist/postprocess/SSAOPass.js +5 -17
  900. package/dist/postprocess/SSAOPass.js.map +1 -1
  901. package/dist/probes/IrradianceVolume.d.ts +45 -0
  902. package/dist/probes/IrradianceVolume.d.ts.map +1 -0
  903. package/dist/probes/IrradianceVolume.js +230 -0
  904. package/dist/probes/IrradianceVolume.js.map +1 -0
  905. package/dist/probes/LtcLuts.d.ts +30 -0
  906. package/dist/probes/LtcLuts.d.ts.map +1 -0
  907. package/dist/probes/LtcLuts.js +120 -0
  908. package/dist/probes/LtcLuts.js.map +1 -0
  909. package/dist/probes/Prd02ProbesContributor.d.ts +53 -0
  910. package/dist/probes/Prd02ProbesContributor.d.ts.map +1 -0
  911. package/dist/probes/Prd02ProbesContributor.js +241 -0
  912. package/dist/probes/Prd02ProbesContributor.js.map +1 -0
  913. package/dist/probes/ProbeBoxProjection.d.ts +53 -0
  914. package/dist/probes/ProbeBoxProjection.d.ts.map +1 -0
  915. package/dist/probes/ProbeBoxProjection.js +99 -0
  916. package/dist/probes/ProbeBoxProjection.js.map +1 -0
  917. package/dist/probes/ReflectionProbeSystem.d.ts +64 -0
  918. package/dist/probes/ReflectionProbeSystem.d.ts.map +1 -0
  919. package/dist/probes/ReflectionProbeSystem.js +157 -0
  920. package/dist/probes/ReflectionProbeSystem.js.map +1 -0
  921. package/dist/production-runtime/PBRHDRPipeline.d.ts.map +1 -1
  922. package/dist/production-runtime/PBRHDRPipeline.js +23 -9
  923. package/dist/production-runtime/PBRHDRPipeline.js.map +1 -1
  924. package/dist/production-runtime/ProductionRendererTypes.d.ts +17 -6
  925. package/dist/production-runtime/ProductionRendererTypes.d.ts.map +1 -1
  926. package/dist/production-runtime/ProductionRendererTypes.js.map +1 -1
  927. package/dist/production-runtime/ProductionRuntimeRenderer.d.ts +3 -0
  928. package/dist/production-runtime/ProductionRuntimeRenderer.d.ts.map +1 -1
  929. package/dist/production-runtime/ProductionRuntimeRenderer.js +8 -1
  930. package/dist/production-runtime/ProductionRuntimeRenderer.js.map +1 -1
  931. package/dist/production-runtime/ProductionWebGL2Renderer.d.ts +4 -0
  932. package/dist/production-runtime/ProductionWebGL2Renderer.d.ts.map +1 -1
  933. package/dist/production-runtime/ProductionWebGL2Renderer.js +15 -0
  934. package/dist/production-runtime/ProductionWebGL2Renderer.js.map +1 -1
  935. package/dist/production-runtime/ProductionWebGPURenderer.d.ts +11 -5
  936. package/dist/production-runtime/ProductionWebGPURenderer.d.ts.map +1 -1
  937. package/dist/production-runtime/ProductionWebGPURenderer.js +38 -47
  938. package/dist/production-runtime/ProductionWebGPURenderer.js.map +1 -1
  939. package/dist/production-runtime/backendSelection.d.ts +26 -0
  940. package/dist/production-runtime/backendSelection.d.ts.map +1 -0
  941. package/dist/production-runtime/backendSelection.js +46 -0
  942. package/dist/production-runtime/backendSelection.js.map +1 -0
  943. package/dist/production-runtime/backends/WebGL2RendererBackend.d.ts +1 -1
  944. package/dist/production-runtime/backends/WebGL2RendererBackend.d.ts.map +1 -1
  945. package/dist/production-runtime/backends/WebGL2RendererBackend.js +8 -4
  946. package/dist/production-runtime/backends/WebGL2RendererBackend.js.map +1 -1
  947. package/dist/production-runtime/backends/WebGPURendererBackend.d.ts +2 -19
  948. package/dist/production-runtime/backends/WebGPURendererBackend.d.ts.map +1 -1
  949. package/dist/production-runtime/backends/WebGPURendererBackend.js +2 -18
  950. package/dist/production-runtime/backends/WebGPURendererBackend.js.map +1 -1
  951. package/dist/production-runtime/backends/webgl2/WebGL2Buffer.d.ts +2 -10
  952. package/dist/production-runtime/backends/webgl2/WebGL2Buffer.d.ts.map +1 -1
  953. package/dist/production-runtime/backends/webgl2/WebGL2Buffer.js +2 -7
  954. package/dist/production-runtime/backends/webgl2/WebGL2Buffer.js.map +1 -1
  955. package/dist/production-runtime/backends/webgl2/WebGL2Capabilities.d.ts +2 -10
  956. package/dist/production-runtime/backends/webgl2/WebGL2Capabilities.d.ts.map +1 -1
  957. package/dist/production-runtime/backends/webgl2/WebGL2Capabilities.js +2 -7
  958. package/dist/production-runtime/backends/webgl2/WebGL2Capabilities.js.map +1 -1
  959. package/dist/production-runtime/backends/webgl2/WebGL2RenderTarget.d.ts +2 -10
  960. package/dist/production-runtime/backends/webgl2/WebGL2RenderTarget.d.ts.map +1 -1
  961. package/dist/production-runtime/backends/webgl2/WebGL2RenderTarget.js +2 -7
  962. package/dist/production-runtime/backends/webgl2/WebGL2RenderTarget.js.map +1 -1
  963. package/dist/production-runtime/backends/webgl2/WebGL2Shader.d.ts +2 -10
  964. package/dist/production-runtime/backends/webgl2/WebGL2Shader.d.ts.map +1 -1
  965. package/dist/production-runtime/backends/webgl2/WebGL2Shader.js +2 -7
  966. package/dist/production-runtime/backends/webgl2/WebGL2Shader.js.map +1 -1
  967. package/dist/production-runtime/backends/webgl2/WebGL2StateCache.d.ts +1 -0
  968. package/dist/production-runtime/backends/webgl2/WebGL2StateCache.d.ts.map +1 -1
  969. package/dist/production-runtime/backends/webgl2/WebGL2StateCache.js +1 -0
  970. package/dist/production-runtime/backends/webgl2/WebGL2StateCache.js.map +1 -1
  971. package/dist/production-runtime/backends/webgl2/WebGL2Texture.d.ts +2 -10
  972. package/dist/production-runtime/backends/webgl2/WebGL2Texture.d.ts.map +1 -1
  973. package/dist/production-runtime/backends/webgl2/WebGL2Texture.js +2 -7
  974. package/dist/production-runtime/backends/webgl2/WebGL2Texture.js.map +1 -1
  975. package/dist/production-runtime/backends/webgpu/WebGPUBuffer.d.ts +2 -10
  976. package/dist/production-runtime/backends/webgpu/WebGPUBuffer.d.ts.map +1 -1
  977. package/dist/production-runtime/backends/webgpu/WebGPUBuffer.js +2 -7
  978. package/dist/production-runtime/backends/webgpu/WebGPUBuffer.js.map +1 -1
  979. package/dist/production-runtime/backends/webgpu/WebGPUCapabilities.d.ts +2 -10
  980. package/dist/production-runtime/backends/webgpu/WebGPUCapabilities.d.ts.map +1 -1
  981. package/dist/production-runtime/backends/webgpu/WebGPUCapabilities.js +2 -7
  982. package/dist/production-runtime/backends/webgpu/WebGPUCapabilities.js.map +1 -1
  983. package/dist/production-runtime/backends/webgpu/WebGPURenderTarget.d.ts +2 -10
  984. package/dist/production-runtime/backends/webgpu/WebGPURenderTarget.d.ts.map +1 -1
  985. package/dist/production-runtime/backends/webgpu/WebGPURenderTarget.js +2 -7
  986. package/dist/production-runtime/backends/webgpu/WebGPURenderTarget.js.map +1 -1
  987. package/dist/production-runtime/backends/webgpu/WebGPUShader.d.ts +2 -10
  988. package/dist/production-runtime/backends/webgpu/WebGPUShader.d.ts.map +1 -1
  989. package/dist/production-runtime/backends/webgpu/WebGPUShader.js +2 -7
  990. package/dist/production-runtime/backends/webgpu/WebGPUShader.js.map +1 -1
  991. package/dist/production-runtime/backends/webgpu/WebGPUTexture.d.ts +2 -10
  992. package/dist/production-runtime/backends/webgpu/WebGPUTexture.d.ts.map +1 -1
  993. package/dist/production-runtime/backends/webgpu/WebGPUTexture.js +2 -7
  994. package/dist/production-runtime/backends/webgpu/WebGPUTexture.js.map +1 -1
  995. package/dist/production-runtime/framegraph/FrameGraph.d.ts +4 -2
  996. package/dist/production-runtime/framegraph/FrameGraph.d.ts.map +1 -1
  997. package/dist/production-runtime/framegraph/FrameGraph.js +62 -4
  998. package/dist/production-runtime/framegraph/FrameGraph.js.map +1 -1
  999. package/dist/production-runtime/framegraph/NativeFrameGraphBindings.d.ts +32 -0
  1000. package/dist/production-runtime/framegraph/NativeFrameGraphBindings.d.ts.map +1 -0
  1001. package/dist/production-runtime/framegraph/NativeFrameGraphBindings.js +111 -0
  1002. package/dist/production-runtime/framegraph/NativeFrameGraphBindings.js.map +1 -0
  1003. package/dist/production-runtime/framegraph/RenderPass.d.ts +23 -0
  1004. package/dist/production-runtime/framegraph/RenderPass.d.ts.map +1 -1
  1005. package/dist/production-runtime/framegraph/RenderPass.js +87 -1
  1006. package/dist/production-runtime/framegraph/RenderPass.js.map +1 -1
  1007. package/dist/production-runtime/index.d.ts +8 -6
  1008. package/dist/production-runtime/index.d.ts.map +1 -1
  1009. package/dist/production-runtime/index.js +10 -3
  1010. package/dist/production-runtime/index.js.map +1 -1
  1011. package/dist/production-runtime/materials/GLTFMaterialAdapter.d.ts +12 -13
  1012. package/dist/production-runtime/materials/GLTFMaterialAdapter.d.ts.map +1 -1
  1013. package/dist/production-runtime/materials/GLTFMaterialAdapter.js +10 -4
  1014. package/dist/production-runtime/materials/GLTFMaterialAdapter.js.map +1 -1
  1015. package/dist/production-runtime/materials/GLTFPBRMaterialAdapter.d.ts +9 -2
  1016. package/dist/production-runtime/materials/GLTFPBRMaterialAdapter.d.ts.map +1 -1
  1017. package/dist/production-runtime/materials/GLTFPBRMaterialAdapter.js +7 -1
  1018. package/dist/production-runtime/materials/GLTFPBRMaterialAdapter.js.map +1 -1
  1019. package/dist/production-runtime/materials/MaterialCompiler.d.ts +10 -8
  1020. package/dist/production-runtime/materials/MaterialCompiler.d.ts.map +1 -1
  1021. package/dist/production-runtime/materials/MaterialCompiler.js +9 -4
  1022. package/dist/production-runtime/materials/MaterialCompiler.js.map +1 -1
  1023. package/dist/production-runtime/materials/PBRShaderFeatures.d.ts.map +1 -1
  1024. package/dist/production-runtime/materials/PBRShaderFeatures.js +30 -1
  1025. package/dist/production-runtime/materials/PBRShaderFeatures.js.map +1 -1
  1026. package/dist/production-runtime/passes/DepthPrepass.d.ts +4 -12
  1027. package/dist/production-runtime/passes/DepthPrepass.d.ts.map +1 -1
  1028. package/dist/production-runtime/passes/DepthPrepass.js +3 -11
  1029. package/dist/production-runtime/passes/DepthPrepass.js.map +1 -1
  1030. package/dist/production-runtime/passes/FramegraphTopology.js +1 -1
  1031. package/dist/production-runtime/passes/FramegraphTopology.js.map +1 -1
  1032. package/dist/production-runtime/passes/OpaquePass.d.ts +3 -8
  1033. package/dist/production-runtime/passes/OpaquePass.d.ts.map +1 -1
  1034. package/dist/production-runtime/passes/OpaquePass.js +3 -1
  1035. package/dist/production-runtime/passes/OpaquePass.js.map +1 -1
  1036. package/dist/production-runtime/passes/ShadowPass.d.ts +3 -8
  1037. package/dist/production-runtime/passes/ShadowPass.d.ts.map +1 -1
  1038. package/dist/production-runtime/passes/ShadowPass.js +2 -0
  1039. package/dist/production-runtime/passes/ShadowPass.js.map +1 -1
  1040. package/dist/production-runtime/passes/SkyboxPass.d.ts +3 -7
  1041. package/dist/production-runtime/passes/SkyboxPass.d.ts.map +1 -1
  1042. package/dist/production-runtime/passes/SkyboxPass.js +2 -0
  1043. package/dist/production-runtime/passes/SkyboxPass.js.map +1 -1
  1044. package/dist/production-runtime/passes/ToneMappingPass.d.ts +7 -10
  1045. package/dist/production-runtime/passes/ToneMappingPass.d.ts.map +1 -1
  1046. package/dist/production-runtime/passes/ToneMappingPass.js +9 -0
  1047. package/dist/production-runtime/passes/ToneMappingPass.js.map +1 -1
  1048. package/dist/production-runtime/passes/TransparentPass.d.ts +4 -9
  1049. package/dist/production-runtime/passes/TransparentPass.d.ts.map +1 -1
  1050. package/dist/production-runtime/passes/TransparentPass.js +6 -1
  1051. package/dist/production-runtime/passes/TransparentPass.js.map +1 -1
  1052. package/dist/production-runtime/renderProofs.d.ts +54 -0
  1053. package/dist/production-runtime/renderProofs.d.ts.map +1 -0
  1054. package/dist/production-runtime/renderProofs.js +245 -0
  1055. package/dist/production-runtime/renderProofs.js.map +1 -0
  1056. package/dist/program/DFGLut.d.ts +23 -0
  1057. package/dist/program/DFGLut.d.ts.map +1 -0
  1058. package/dist/program/DFGLut.js +58 -0
  1059. package/dist/program/DFGLut.js.map +1 -0
  1060. package/dist/program/DFGLutData.d.ts +35 -0
  1061. package/dist/program/DFGLutData.d.ts.map +1 -0
  1062. package/dist/program/DFGLutData.js +52 -0
  1063. package/dist/program/DFGLutData.js.map +1 -0
  1064. package/dist/program/FeatureSelect.d.ts +35 -0
  1065. package/dist/program/FeatureSelect.d.ts.map +1 -0
  1066. package/dist/program/FeatureSelect.js +88 -0
  1067. package/dist/program/FeatureSelect.js.map +1 -0
  1068. package/dist/program/MaterialFeatures.d.ts +66 -0
  1069. package/dist/program/MaterialFeatures.d.ts.map +1 -0
  1070. package/dist/program/MaterialFeatures.js +242 -0
  1071. package/dist/program/MaterialFeatures.js.map +1 -0
  1072. package/dist/program/ProgramCache.d.ts +83 -0
  1073. package/dist/program/ProgramCache.d.ts.map +1 -0
  1074. package/dist/program/ProgramCache.js +194 -0
  1075. package/dist/program/ProgramCache.js.map +1 -0
  1076. package/dist/program/ProgramFeatures.d.ts +21 -0
  1077. package/dist/program/ProgramFeatures.d.ts.map +1 -0
  1078. package/dist/program/ProgramFeatures.js +95 -0
  1079. package/dist/program/ProgramFeatures.js.map +1 -0
  1080. package/dist/program/ProgramGenerator.d.ts +60 -0
  1081. package/dist/program/ProgramGenerator.d.ts.map +1 -0
  1082. package/dist/program/ProgramGenerator.js +760 -0
  1083. package/dist/program/ProgramGenerator.js.map +1 -0
  1084. package/dist/program/ProgramKey.d.ts +10 -0
  1085. package/dist/program/ProgramKey.d.ts.map +1 -0
  1086. package/dist/program/ProgramKey.js +13 -0
  1087. package/dist/program/ProgramKey.js.map +1 -0
  1088. package/dist/program/ProgramWarmup.d.ts +37 -0
  1089. package/dist/program/ProgramWarmup.d.ts.map +1 -0
  1090. package/dist/program/ProgramWarmup.js +68 -0
  1091. package/dist/program/ProgramWarmup.js.map +1 -0
  1092. package/dist/program/UniformLayout.d.ts +40 -0
  1093. package/dist/program/UniformLayout.d.ts.map +1 -0
  1094. package/dist/program/UniformLayout.js +105 -0
  1095. package/dist/program/UniformLayout.js.map +1 -0
  1096. package/dist/program/chunks/alpha.glsl.d.ts +7 -0
  1097. package/dist/program/chunks/alpha.glsl.d.ts.map +1 -0
  1098. package/dist/program/chunks/alpha.glsl.js +17 -0
  1099. package/dist/program/chunks/alpha.glsl.js.map +1 -0
  1100. package/dist/program/chunks/brdf.glsl.d.ts +12 -0
  1101. package/dist/program/chunks/brdf.glsl.d.ts.map +1 -0
  1102. package/dist/program/chunks/brdf.glsl.js +144 -0
  1103. package/dist/program/chunks/brdf.glsl.js.map +1 -0
  1104. package/dist/program/chunks/colorspace.glsl.d.ts +8 -0
  1105. package/dist/program/chunks/colorspace.glsl.d.ts.map +1 -0
  1106. package/dist/program/chunks/colorspace.glsl.js +16 -0
  1107. package/dist/program/chunks/colorspace.glsl.js.map +1 -0
  1108. package/dist/program/chunks/common.glsl.d.ts +7 -0
  1109. package/dist/program/chunks/common.glsl.d.ts.map +1 -0
  1110. package/dist/program/chunks/common.glsl.js +25 -0
  1111. package/dist/program/chunks/common.glsl.js.map +1 -0
  1112. package/dist/program/chunks/depth.glsl.d.ts +9 -0
  1113. package/dist/program/chunks/depth.glsl.d.ts.map +1 -0
  1114. package/dist/program/chunks/depth.glsl.js +18 -0
  1115. package/dist/program/chunks/depth.glsl.js.map +1 -0
  1116. package/dist/program/chunks/drawId.wgsl.d.ts +9 -0
  1117. package/dist/program/chunks/drawId.wgsl.d.ts.map +1 -0
  1118. package/dist/program/chunks/drawId.wgsl.js +29 -0
  1119. package/dist/program/chunks/drawId.wgsl.js.map +1 -0
  1120. package/dist/program/chunks/fog_default.glsl.d.ts +8 -0
  1121. package/dist/program/chunks/fog_default.glsl.d.ts.map +1 -0
  1122. package/dist/program/chunks/fog_default.glsl.js +31 -0
  1123. package/dist/program/chunks/fog_default.glsl.js.map +1 -0
  1124. package/dist/program/chunks/indirect_default.glsl.d.ts +29 -0
  1125. package/dist/program/chunks/indirect_default.glsl.d.ts.map +1 -0
  1126. package/dist/program/chunks/indirect_default.glsl.js +113 -0
  1127. package/dist/program/chunks/indirect_default.glsl.js.map +1 -0
  1128. package/dist/program/chunks/instanceEmissive.wgsl.d.ts +10 -0
  1129. package/dist/program/chunks/instanceEmissive.wgsl.d.ts.map +1 -0
  1130. package/dist/program/chunks/instanceEmissive.wgsl.js +21 -0
  1131. package/dist/program/chunks/instanceEmissive.wgsl.js.map +1 -0
  1132. package/dist/program/chunks/instancing.glsl.d.ts +8 -0
  1133. package/dist/program/chunks/instancing.glsl.d.ts.map +1 -0
  1134. package/dist/program/chunks/instancing.glsl.js +25 -0
  1135. package/dist/program/chunks/instancing.glsl.js.map +1 -0
  1136. package/dist/program/chunks/lights_legacy.glsl.d.ts +15 -0
  1137. package/dist/program/chunks/lights_legacy.glsl.d.ts.map +1 -0
  1138. package/dist/program/chunks/lights_legacy.glsl.js +95 -0
  1139. package/dist/program/chunks/lights_legacy.glsl.js.map +1 -0
  1140. package/dist/program/chunks/manifest.d.ts +42 -0
  1141. package/dist/program/chunks/manifest.d.ts.map +1 -0
  1142. package/dist/program/chunks/manifest.js +48 -0
  1143. package/dist/program/chunks/manifest.js.map +1 -0
  1144. package/dist/program/chunks/normal.glsl.d.ts +8 -0
  1145. package/dist/program/chunks/normal.glsl.d.ts.map +1 -0
  1146. package/dist/program/chunks/normal.glsl.js +34 -0
  1147. package/dist/program/chunks/normal.glsl.js.map +1 -0
  1148. package/dist/program/chunks/shadow_forward.glsl.d.ts +23 -0
  1149. package/dist/program/chunks/shadow_forward.glsl.d.ts.map +1 -0
  1150. package/dist/program/chunks/shadow_forward.glsl.js +73 -0
  1151. package/dist/program/chunks/shadow_forward.glsl.js.map +1 -0
  1152. package/dist/quality/DeviceClasses.d.ts +31 -0
  1153. package/dist/quality/DeviceClasses.d.ts.map +1 -0
  1154. package/dist/quality/DeviceClasses.js +83 -0
  1155. package/dist/quality/DeviceClasses.js.map +1 -0
  1156. package/dist/quality/DeviceProbe.d.ts +42 -0
  1157. package/dist/quality/DeviceProbe.d.ts.map +1 -0
  1158. package/dist/quality/DeviceProbe.js +83 -0
  1159. package/dist/quality/DeviceProbe.js.map +1 -0
  1160. package/dist/quality/FrameStats.d.ts +62 -0
  1161. package/dist/quality/FrameStats.d.ts.map +1 -0
  1162. package/dist/quality/FrameStats.js +220 -0
  1163. package/dist/quality/FrameStats.js.map +1 -0
  1164. package/dist/quality/PostprocessGuard.d.ts +49 -0
  1165. package/dist/quality/PostprocessGuard.d.ts.map +1 -0
  1166. package/dist/quality/PostprocessGuard.js +92 -0
  1167. package/dist/quality/PostprocessGuard.js.map +1 -0
  1168. package/dist/quality/QualityController.d.ts +93 -0
  1169. package/dist/quality/QualityController.d.ts.map +1 -0
  1170. package/dist/quality/QualityController.js +248 -0
  1171. package/dist/quality/QualityController.js.map +1 -0
  1172. package/dist/quality/QualityGovernor.d.ts +78 -0
  1173. package/dist/quality/QualityGovernor.d.ts.map +1 -0
  1174. package/dist/quality/QualityGovernor.js +170 -0
  1175. package/dist/quality/QualityGovernor.js.map +1 -0
  1176. package/dist/quality/QualityTier.d.ts +17 -0
  1177. package/dist/quality/QualityTier.d.ts.map +1 -0
  1178. package/dist/quality/QualityTier.js +23 -0
  1179. package/dist/quality/QualityTier.js.map +1 -0
  1180. package/dist/quality/RenderScaleController.d.ts +35 -0
  1181. package/dist/quality/RenderScaleController.d.ts.map +1 -0
  1182. package/dist/quality/RenderScaleController.js +57 -0
  1183. package/dist/quality/RenderScaleController.js.map +1 -0
  1184. package/dist/quality/RetentionPolicy.d.ts +11 -0
  1185. package/dist/quality/RetentionPolicy.d.ts.map +1 -0
  1186. package/dist/quality/RetentionPolicy.js +12 -0
  1187. package/dist/quality/RetentionPolicy.js.map +1 -0
  1188. package/dist/quality/TierResolver.d.ts +52 -0
  1189. package/dist/quality/TierResolver.d.ts.map +1 -0
  1190. package/dist/quality/TierResolver.js +155 -0
  1191. package/dist/quality/TierResolver.js.map +1 -0
  1192. package/dist/quality/liveTier.d.ts +23 -0
  1193. package/dist/quality/liveTier.d.ts.map +1 -0
  1194. package/dist/quality/liveTier.js +16 -0
  1195. package/dist/quality/liveTier.js.map +1 -0
  1196. package/dist/reference/BloomPass.d.ts +10 -0
  1197. package/dist/reference/BloomPass.d.ts.map +1 -0
  1198. package/dist/reference/BloomPass.js +18 -0
  1199. package/dist/reference/BloomPass.js.map +1 -0
  1200. package/dist/reference/DepthHazePass.d.ts +12 -0
  1201. package/dist/reference/DepthHazePass.d.ts.map +1 -0
  1202. package/dist/reference/DepthHazePass.js +20 -0
  1203. package/dist/reference/DepthHazePass.js.map +1 -0
  1204. package/dist/reference/EffectComposer.d.ts +110 -0
  1205. package/dist/reference/EffectComposer.d.ts.map +1 -0
  1206. package/dist/reference/EffectComposer.js +247 -0
  1207. package/dist/reference/EffectComposer.js.map +1 -0
  1208. package/dist/reference/FilmGrainPass.d.ts +9 -0
  1209. package/dist/reference/FilmGrainPass.d.ts.map +1 -0
  1210. package/dist/reference/FilmGrainPass.js +17 -0
  1211. package/dist/reference/FilmGrainPass.js.map +1 -0
  1212. package/dist/reference/PostProcessPass.d.ts +511 -0
  1213. package/dist/reference/PostProcessPass.d.ts.map +1 -0
  1214. package/dist/reference/PostProcessPass.js +2020 -0
  1215. package/dist/reference/PostProcessPass.js.map +1 -0
  1216. package/dist/reference/SSAOPass.d.ts +6 -0
  1217. package/dist/reference/SSAOPass.d.ts.map +1 -0
  1218. package/dist/reference/SSAOPass.js +18 -0
  1219. package/dist/reference/SSAOPass.js.map +1 -0
  1220. package/dist/reference/VignettePass.d.ts +10 -0
  1221. package/dist/reference/VignettePass.d.ts.map +1 -0
  1222. package/dist/reference/VignettePass.js +17 -0
  1223. package/dist/reference/VignettePass.js.map +1 -0
  1224. package/dist/reference/index.d.ts +15 -0
  1225. package/dist/reference/index.d.ts.map +1 -0
  1226. package/dist/reference/index.js +15 -0
  1227. package/dist/reference/index.js.map +1 -0
  1228. package/dist/reflection-surfaces.d.ts +5 -0
  1229. package/dist/reflection-surfaces.d.ts.map +1 -0
  1230. package/dist/reflection-surfaces.js +3 -0
  1231. package/dist/reflection-surfaces.js.map +1 -0
  1232. package/dist/renderer/Background.d.ts +49 -0
  1233. package/dist/renderer/Background.d.ts.map +1 -0
  1234. package/dist/renderer/Background.js +259 -0
  1235. package/dist/renderer/Background.js.map +1 -0
  1236. package/dist/renderer/CullingBatching.d.ts +55 -0
  1237. package/dist/renderer/CullingBatching.d.ts.map +1 -0
  1238. package/dist/renderer/CullingBatching.js +362 -0
  1239. package/dist/renderer/CullingBatching.js.map +1 -0
  1240. package/dist/renderer/DeviceLifecycle.d.ts +29 -0
  1241. package/dist/renderer/DeviceLifecycle.d.ts.map +1 -0
  1242. package/dist/renderer/DeviceLifecycle.js +48 -0
  1243. package/dist/renderer/DeviceLifecycle.js.map +1 -0
  1244. package/dist/renderer/FrameGraph.d.ts +96 -0
  1245. package/dist/renderer/FrameGraph.d.ts.map +1 -0
  1246. package/dist/renderer/FrameGraph.js +301 -0
  1247. package/dist/renderer/FrameGraph.js.map +1 -0
  1248. package/dist/renderer/InterleavedTransparentPass.d.ts +31 -0
  1249. package/dist/renderer/InterleavedTransparentPass.d.ts.map +1 -0
  1250. package/dist/renderer/InterleavedTransparentPass.js +65 -0
  1251. package/dist/renderer/InterleavedTransparentPass.js.map +1 -0
  1252. package/dist/renderer/PixelRatio.d.ts +64 -0
  1253. package/dist/renderer/PixelRatio.d.ts.map +1 -0
  1254. package/dist/renderer/PixelRatio.js +81 -0
  1255. package/dist/renderer/PixelRatio.js.map +1 -0
  1256. package/dist/renderer/PostprocessExecution.d.ts +82 -0
  1257. package/dist/renderer/PostprocessExecution.d.ts.map +1 -0
  1258. package/dist/renderer/PostprocessExecution.js +741 -0
  1259. package/dist/renderer/PostprocessExecution.js.map +1 -0
  1260. package/dist/renderer/Prd06ShaderWarmup.d.ts +32 -0
  1261. package/dist/renderer/Prd06ShaderWarmup.d.ts.map +1 -0
  1262. package/dist/renderer/Prd06ShaderWarmup.js +45 -0
  1263. package/dist/renderer/Prd06ShaderWarmup.js.map +1 -0
  1264. package/dist/renderer/RenderShared.d.ts +11 -0
  1265. package/dist/renderer/RenderShared.d.ts.map +1 -0
  1266. package/dist/renderer/RenderShared.js +47 -0
  1267. package/dist/renderer/RenderShared.js.map +1 -0
  1268. package/dist/renderer/RendererFactory.d.ts +3 -0
  1269. package/dist/renderer/RendererFactory.d.ts.map +1 -0
  1270. package/dist/renderer/RendererFactory.js +19 -0
  1271. package/dist/renderer/RendererFactory.js.map +1 -0
  1272. package/dist/renderer/RendererHost.d.ts +25 -0
  1273. package/dist/renderer/RendererHost.d.ts.map +1 -0
  1274. package/dist/renderer/RendererHost.js +4 -0
  1275. package/dist/renderer/RendererHost.js.map +1 -0
  1276. package/dist/renderer/SceneDepthCopyPass.d.ts +50 -0
  1277. package/dist/renderer/SceneDepthCopyPass.d.ts.map +1 -0
  1278. package/dist/renderer/SceneDepthCopyPass.js +124 -0
  1279. package/dist/renderer/SceneDepthCopyPass.js.map +1 -0
  1280. package/dist/renderer/ShadowOrchestration.d.ts +32 -0
  1281. package/dist/renderer/ShadowOrchestration.d.ts.map +1 -0
  1282. package/dist/renderer/ShadowOrchestration.js +491 -0
  1283. package/dist/renderer/ShadowOrchestration.js.map +1 -0
  1284. package/dist/renderer/SkinnedBounds.d.ts +6 -0
  1285. package/dist/renderer/SkinnedBounds.d.ts.map +1 -0
  1286. package/dist/renderer/SkinnedBounds.js +74 -0
  1287. package/dist/renderer/SkinnedBounds.js.map +1 -0
  1288. package/dist/renderer/coreOutputPostRoute.d.ts +40 -0
  1289. package/dist/renderer/coreOutputPostRoute.d.ts.map +1 -0
  1290. package/dist/renderer/coreOutputPostRoute.js +46 -0
  1291. package/dist/renderer/coreOutputPostRoute.js.map +1 -0
  1292. package/dist/renderer/postSkipped.d.ts +12 -0
  1293. package/dist/renderer/postSkipped.d.ts.map +1 -0
  1294. package/dist/renderer/postSkipped.js +54 -0
  1295. package/dist/renderer/postSkipped.js.map +1 -0
  1296. package/dist/renderer/qrSubFlags.d.ts +45 -0
  1297. package/dist/renderer/qrSubFlags.d.ts.map +1 -0
  1298. package/dist/renderer/qrSubFlags.js +130 -0
  1299. package/dist/renderer/qrSubFlags.js.map +1 -0
  1300. package/dist/resources/InstanceBuffer.d.ts +34 -0
  1301. package/dist/resources/InstanceBuffer.d.ts.map +1 -0
  1302. package/dist/resources/InstanceBuffer.js +96 -0
  1303. package/dist/resources/InstanceBuffer.js.map +1 -0
  1304. package/dist/resources/MorphTargetTexture.d.ts +53 -0
  1305. package/dist/resources/MorphTargetTexture.d.ts.map +1 -0
  1306. package/dist/resources/MorphTargetTexture.js +135 -0
  1307. package/dist/resources/MorphTargetTexture.js.map +1 -0
  1308. package/dist/resources/RenderTargetPool.d.ts +47 -0
  1309. package/dist/resources/RenderTargetPool.d.ts.map +1 -0
  1310. package/dist/resources/RenderTargetPool.js +113 -0
  1311. package/dist/resources/RenderTargetPool.js.map +1 -0
  1312. package/dist/resources/ResourceRegistry.d.ts +48 -0
  1313. package/dist/resources/ResourceRegistry.d.ts.map +1 -0
  1314. package/dist/resources/ResourceRegistry.js +95 -0
  1315. package/dist/resources/ResourceRegistry.js.map +1 -0
  1316. package/dist/resources/UniformBlock.d.ts +90 -0
  1317. package/dist/resources/UniformBlock.d.ts.map +1 -0
  1318. package/dist/resources/UniformBlock.js +184 -0
  1319. package/dist/resources/UniformBlock.js.map +1 -0
  1320. package/dist/shaders/camera-fade.glsl.d.ts +26 -0
  1321. package/dist/shaders/camera-fade.glsl.d.ts.map +1 -0
  1322. package/dist/shaders/camera-fade.glsl.js +109 -0
  1323. package/dist/shaders/camera-fade.glsl.js.map +1 -0
  1324. package/dist/shaders/chunks/contact_shadow.glsl.d.ts +12 -0
  1325. package/dist/shaders/chunks/contact_shadow.glsl.d.ts.map +1 -0
  1326. package/dist/shaders/chunks/contact_shadow.glsl.js +53 -0
  1327. package/dist/shaders/chunks/contact_shadow.glsl.js.map +1 -0
  1328. package/dist/shaders/chunks/lighting_ibl.glsl.d.ts +29 -0
  1329. package/dist/shaders/chunks/lighting_ibl.glsl.d.ts.map +1 -0
  1330. package/dist/shaders/chunks/lighting_ibl.glsl.js +122 -0
  1331. package/dist/shaders/chunks/lighting_ibl.glsl.js.map +1 -0
  1332. package/dist/shaders/chunks/lighting_mirrors.d.ts +18 -0
  1333. package/dist/shaders/chunks/lighting_mirrors.d.ts.map +1 -0
  1334. package/dist/shaders/chunks/lighting_mirrors.js +35 -0
  1335. package/dist/shaders/chunks/lighting_mirrors.js.map +1 -0
  1336. package/dist/shaders/chunks/lighting_punctual.glsl.d.ts +17 -0
  1337. package/dist/shaders/chunks/lighting_punctual.glsl.d.ts.map +1 -0
  1338. package/dist/shaders/chunks/lighting_punctual.glsl.js +197 -0
  1339. package/dist/shaders/chunks/lighting_punctual.glsl.js.map +1 -0
  1340. package/dist/shaders/chunks/sh9.glsl.d.ts +9 -0
  1341. package/dist/shaders/chunks/sh9.glsl.d.ts.map +1 -0
  1342. package/dist/shaders/chunks/sh9.glsl.js +41 -0
  1343. package/dist/shaders/chunks/sh9.glsl.js.map +1 -0
  1344. package/dist/shaders/chunks/shadow_caster.glsl.d.ts +10 -0
  1345. package/dist/shaders/chunks/shadow_caster.glsl.d.ts.map +1 -0
  1346. package/dist/shaders/chunks/shadow_caster.glsl.js +32 -0
  1347. package/dist/shaders/chunks/shadow_caster.glsl.js.map +1 -0
  1348. package/dist/shaders/chunks/shadow_receive.glsl.d.ts +13 -0
  1349. package/dist/shaders/chunks/shadow_receive.glsl.d.ts.map +1 -0
  1350. package/dist/shaders/chunks/shadow_receive.glsl.js +136 -0
  1351. package/dist/shaders/chunks/shadow_receive.glsl.js.map +1 -0
  1352. package/dist/shaders/debug-view.glsl.d.ts +18 -0
  1353. package/dist/shaders/debug-view.glsl.d.ts.map +1 -0
  1354. package/dist/shaders/debug-view.glsl.js +153 -0
  1355. package/dist/shaders/debug-view.glsl.js.map +1 -0
  1356. package/dist/shaders/deform/deform.glsl.d.ts +17 -0
  1357. package/dist/shaders/deform/deform.glsl.d.ts.map +1 -0
  1358. package/dist/shaders/deform/deform.glsl.js +99 -0
  1359. package/dist/shaders/deform/deform.glsl.js.map +1 -0
  1360. package/dist/shaders/deform/deform.wgsl.d.ts +15 -0
  1361. package/dist/shaders/deform/deform.wgsl.d.ts.map +1 -0
  1362. package/dist/shaders/deform/deform.wgsl.js +89 -0
  1363. package/dist/shaders/deform/deform.wgsl.js.map +1 -0
  1364. package/dist/shaders/deform/depthFeature.d.ts +22 -0
  1365. package/dist/shaders/deform/depthFeature.d.ts.map +1 -0
  1366. package/dist/shaders/deform/depthFeature.js +44 -0
  1367. package/dist/shaders/deform/depthFeature.js.map +1 -0
  1368. package/dist/shaders/deform/forwardFeature.d.ts +114 -0
  1369. package/dist/shaders/deform/forwardFeature.d.ts.map +1 -0
  1370. package/dist/shaders/deform/forwardFeature.js +300 -0
  1371. package/dist/shaders/deform/forwardFeature.js.map +1 -0
  1372. package/dist/shaders/deform/morph.glsl.d.ts +14 -0
  1373. package/dist/shaders/deform/morph.glsl.d.ts.map +1 -0
  1374. package/dist/shaders/deform/morph.glsl.js +45 -0
  1375. package/dist/shaders/deform/morph.glsl.js.map +1 -0
  1376. package/dist/shaders/deform/morph.wgsl.d.ts +21 -0
  1377. package/dist/shaders/deform/morph.wgsl.d.ts.map +1 -0
  1378. package/dist/shaders/deform/morph.wgsl.js +73 -0
  1379. package/dist/shaders/deform/morph.wgsl.js.map +1 -0
  1380. package/dist/shaders/deform/skinning.glsl.d.ts +8 -0
  1381. package/dist/shaders/deform/skinning.glsl.d.ts.map +1 -0
  1382. package/dist/shaders/deform/skinning.glsl.js +37 -0
  1383. package/dist/shaders/deform/skinning.glsl.js.map +1 -0
  1384. package/dist/shaders/deform/skinning.wgsl.d.ts +26 -0
  1385. package/dist/shaders/deform/skinning.wgsl.d.ts.map +1 -0
  1386. package/dist/shaders/deform/skinning.wgsl.js +58 -0
  1387. package/dist/shaders/deform/skinning.wgsl.js.map +1 -0
  1388. package/dist/shaders/deform/twins.d.ts +8 -0
  1389. package/dist/shaders/deform/twins.d.ts.map +1 -0
  1390. package/dist/shaders/deform/twins.js +20 -0
  1391. package/dist/shaders/deform/twins.js.map +1 -0
  1392. package/dist/shaders/lod-dither.glsl.d.ts +12 -0
  1393. package/dist/shaders/lod-dither.glsl.d.ts.map +1 -0
  1394. package/dist/shaders/lod-dither.glsl.js +101 -0
  1395. package/dist/shaders/lod-dither.glsl.js.map +1 -0
  1396. package/dist/shaders/physical/alpha_a2c.glsl.d.ts +19 -0
  1397. package/dist/shaders/physical/alpha_a2c.glsl.d.ts.map +1 -0
  1398. package/dist/shaders/physical/alpha_a2c.glsl.js +29 -0
  1399. package/dist/shaders/physical/alpha_a2c.glsl.js.map +1 -0
  1400. package/dist/shaders/physical/anisotropy.glsl.d.ts +23 -0
  1401. package/dist/shaders/physical/anisotropy.glsl.d.ts.map +1 -0
  1402. package/dist/shaders/physical/anisotropy.glsl.js +116 -0
  1403. package/dist/shaders/physical/anisotropy.glsl.js.map +1 -0
  1404. package/dist/shaders/physical/bsdf_lobes_common.glsl.d.ts +25 -0
  1405. package/dist/shaders/physical/bsdf_lobes_common.glsl.d.ts.map +1 -0
  1406. package/dist/shaders/physical/bsdf_lobes_common.glsl.js +95 -0
  1407. package/dist/shaders/physical/bsdf_lobes_common.glsl.js.map +1 -0
  1408. package/dist/shaders/physical/clearcoat.glsl.d.ts +23 -0
  1409. package/dist/shaders/physical/clearcoat.glsl.d.ts.map +1 -0
  1410. package/dist/shaders/physical/clearcoat.glsl.js +70 -0
  1411. package/dist/shaders/physical/clearcoat.glsl.js.map +1 -0
  1412. package/dist/shaders/physical/debug_view.glsl.d.ts +19 -0
  1413. package/dist/shaders/physical/debug_view.glsl.d.ts.map +1 -0
  1414. package/dist/shaders/physical/debug_view.glsl.js +76 -0
  1415. package/dist/shaders/physical/debug_view.glsl.js.map +1 -0
  1416. package/dist/shaders/physical/dispersion.glsl.d.ts +18 -0
  1417. package/dist/shaders/physical/dispersion.glsl.d.ts.map +1 -0
  1418. package/dist/shaders/physical/dispersion.glsl.js +67 -0
  1419. package/dist/shaders/physical/dispersion.glsl.js.map +1 -0
  1420. package/dist/shaders/physical/emissive_strength.glsl.d.ts +18 -0
  1421. package/dist/shaders/physical/emissive_strength.glsl.d.ts.map +1 -0
  1422. package/dist/shaders/physical/emissive_strength.glsl.js +20 -0
  1423. package/dist/shaders/physical/emissive_strength.glsl.js.map +1 -0
  1424. package/dist/shaders/physical/index.d.ts +27 -0
  1425. package/dist/shaders/physical/index.d.ts.map +1 -0
  1426. package/dist/shaders/physical/index.js +69 -0
  1427. package/dist/shaders/physical/index.js.map +1 -0
  1428. package/dist/shaders/physical/iridescence.glsl.d.ts +25 -0
  1429. package/dist/shaders/physical/iridescence.glsl.d.ts.map +1 -0
  1430. package/dist/shaders/physical/iridescence.glsl.js +186 -0
  1431. package/dist/shaders/physical/iridescence.glsl.js.map +1 -0
  1432. package/dist/shaders/physical/lobe_calls.glsl.d.ts +83 -0
  1433. package/dist/shaders/physical/lobe_calls.glsl.d.ts.map +1 -0
  1434. package/dist/shaders/physical/lobe_calls.glsl.js +397 -0
  1435. package/dist/shaders/physical/lobe_calls.glsl.js.map +1 -0
  1436. package/dist/shaders/physical/sheen.glsl.d.ts +24 -0
  1437. package/dist/shaders/physical/sheen.glsl.d.ts.map +1 -0
  1438. package/dist/shaders/physical/sheen.glsl.js +108 -0
  1439. package/dist/shaders/physical/sheen.glsl.js.map +1 -0
  1440. package/dist/shaders/physical/specular_ior.glsl.d.ts +20 -0
  1441. package/dist/shaders/physical/specular_ior.glsl.d.ts.map +1 -0
  1442. package/dist/shaders/physical/specular_ior.glsl.js +64 -0
  1443. package/dist/shaders/physical/specular_ior.glsl.js.map +1 -0
  1444. package/dist/shaders/physical/tangent_frame.glsl.d.ts +27 -0
  1445. package/dist/shaders/physical/tangent_frame.glsl.d.ts.map +1 -0
  1446. package/dist/shaders/physical/tangent_frame.glsl.js +71 -0
  1447. package/dist/shaders/physical/tangent_frame.glsl.js.map +1 -0
  1448. package/dist/shaders/physical/transmission.glsl.d.ts +25 -0
  1449. package/dist/shaders/physical/transmission.glsl.d.ts.map +1 -0
  1450. package/dist/shaders/physical/transmission.glsl.js +204 -0
  1451. package/dist/shaders/physical/transmission.glsl.js.map +1 -0
  1452. package/dist/shaders/physical/transmission_copy.glsl.d.ts +15 -0
  1453. package/dist/shaders/physical/transmission_copy.glsl.d.ts.map +1 -0
  1454. package/dist/shaders/physical/transmission_copy.glsl.js +33 -0
  1455. package/dist/shaders/physical/transmission_copy.glsl.js.map +1 -0
  1456. package/dist/shaders/physical/unlit.glsl.d.ts +17 -0
  1457. package/dist/shaders/physical/unlit.glsl.d.ts.map +1 -0
  1458. package/dist/shaders/physical/unlit.glsl.js +19 -0
  1459. package/dist/shaders/physical/unlit.glsl.js.map +1 -0
  1460. package/dist/shaders/physical/uv_transform.glsl.d.ts +18 -0
  1461. package/dist/shaders/physical/uv_transform.glsl.d.ts.map +1 -0
  1462. package/dist/shaders/physical/uv_transform.glsl.js +30 -0
  1463. package/dist/shaders/physical/uv_transform.glsl.js.map +1 -0
  1464. package/dist/shaders/physical/volume.glsl.d.ts +19 -0
  1465. package/dist/shaders/physical/volume.glsl.d.ts.map +1 -0
  1466. package/dist/shaders/physical/volume.glsl.js +47 -0
  1467. package/dist/shaders/physical/volume.glsl.js.map +1 -0
  1468. package/dist/shaders/physical-wgsl/alpha_a2c.wgsl.d.ts +8 -0
  1469. package/dist/shaders/physical-wgsl/alpha_a2c.wgsl.d.ts.map +1 -0
  1470. package/dist/shaders/physical-wgsl/alpha_a2c.wgsl.js +26 -0
  1471. package/dist/shaders/physical-wgsl/alpha_a2c.wgsl.js.map +1 -0
  1472. package/dist/shaders/physical-wgsl/anisotropy.wgsl.d.ts +10 -0
  1473. package/dist/shaders/physical-wgsl/anisotropy.wgsl.d.ts.map +1 -0
  1474. package/dist/shaders/physical-wgsl/anisotropy.wgsl.js +97 -0
  1475. package/dist/shaders/physical-wgsl/anisotropy.wgsl.js.map +1 -0
  1476. package/dist/shaders/physical-wgsl/bsdf_lobes_common.wgsl.d.ts +11 -0
  1477. package/dist/shaders/physical-wgsl/bsdf_lobes_common.wgsl.d.ts.map +1 -0
  1478. package/dist/shaders/physical-wgsl/bsdf_lobes_common.wgsl.js +76 -0
  1479. package/dist/shaders/physical-wgsl/bsdf_lobes_common.wgsl.js.map +1 -0
  1480. package/dist/shaders/physical-wgsl/clearcoat.wgsl.d.ts +9 -0
  1481. package/dist/shaders/physical-wgsl/clearcoat.wgsl.d.ts.map +1 -0
  1482. package/dist/shaders/physical-wgsl/clearcoat.wgsl.js +56 -0
  1483. package/dist/shaders/physical-wgsl/clearcoat.wgsl.js.map +1 -0
  1484. package/dist/shaders/physical-wgsl/debug_view.wgsl.d.ts +10 -0
  1485. package/dist/shaders/physical-wgsl/debug_view.wgsl.d.ts.map +1 -0
  1486. package/dist/shaders/physical-wgsl/debug_view.wgsl.js +71 -0
  1487. package/dist/shaders/physical-wgsl/debug_view.wgsl.js.map +1 -0
  1488. package/dist/shaders/physical-wgsl/dispersion.wgsl.d.ts +10 -0
  1489. package/dist/shaders/physical-wgsl/dispersion.wgsl.d.ts.map +1 -0
  1490. package/dist/shaders/physical-wgsl/dispersion.wgsl.js +51 -0
  1491. package/dist/shaders/physical-wgsl/dispersion.wgsl.js.map +1 -0
  1492. package/dist/shaders/physical-wgsl/emissive_strength.wgsl.d.ts +9 -0
  1493. package/dist/shaders/physical-wgsl/emissive_strength.wgsl.d.ts.map +1 -0
  1494. package/dist/shaders/physical-wgsl/emissive_strength.wgsl.js +15 -0
  1495. package/dist/shaders/physical-wgsl/emissive_strength.wgsl.js.map +1 -0
  1496. package/dist/shaders/physical-wgsl/index.d.ts +35 -0
  1497. package/dist/shaders/physical-wgsl/index.d.ts.map +1 -0
  1498. package/dist/shaders/physical-wgsl/index.js +51 -0
  1499. package/dist/shaders/physical-wgsl/index.js.map +1 -0
  1500. package/dist/shaders/physical-wgsl/iridescence.wgsl.d.ts +9 -0
  1501. package/dist/shaders/physical-wgsl/iridescence.wgsl.d.ts.map +1 -0
  1502. package/dist/shaders/physical-wgsl/iridescence.wgsl.js +162 -0
  1503. package/dist/shaders/physical-wgsl/iridescence.wgsl.js.map +1 -0
  1504. package/dist/shaders/physical-wgsl/sheen.wgsl.d.ts +9 -0
  1505. package/dist/shaders/physical-wgsl/sheen.wgsl.d.ts.map +1 -0
  1506. package/dist/shaders/physical-wgsl/sheen.wgsl.js +85 -0
  1507. package/dist/shaders/physical-wgsl/sheen.wgsl.js.map +1 -0
  1508. package/dist/shaders/physical-wgsl/specular_ior.wgsl.d.ts +10 -0
  1509. package/dist/shaders/physical-wgsl/specular_ior.wgsl.d.ts.map +1 -0
  1510. package/dist/shaders/physical-wgsl/specular_ior.wgsl.js +47 -0
  1511. package/dist/shaders/physical-wgsl/specular_ior.wgsl.js.map +1 -0
  1512. package/dist/shaders/physical-wgsl/tangent_frame.wgsl.d.ts +11 -0
  1513. package/dist/shaders/physical-wgsl/tangent_frame.wgsl.d.ts.map +1 -0
  1514. package/dist/shaders/physical-wgsl/tangent_frame.wgsl.js +57 -0
  1515. package/dist/shaders/physical-wgsl/tangent_frame.wgsl.js.map +1 -0
  1516. package/dist/shaders/physical-wgsl/transmission.wgsl.d.ts +14 -0
  1517. package/dist/shaders/physical-wgsl/transmission.wgsl.d.ts.map +1 -0
  1518. package/dist/shaders/physical-wgsl/transmission.wgsl.js +159 -0
  1519. package/dist/shaders/physical-wgsl/transmission.wgsl.js.map +1 -0
  1520. package/dist/shaders/physical-wgsl/unlit.wgsl.d.ts +8 -0
  1521. package/dist/shaders/physical-wgsl/unlit.wgsl.d.ts.map +1 -0
  1522. package/dist/shaders/physical-wgsl/unlit.wgsl.js +13 -0
  1523. package/dist/shaders/physical-wgsl/unlit.wgsl.js.map +1 -0
  1524. package/dist/shaders/physical-wgsl/uv_transform.wgsl.d.ts +10 -0
  1525. package/dist/shaders/physical-wgsl/uv_transform.wgsl.d.ts.map +1 -0
  1526. package/dist/shaders/physical-wgsl/uv_transform.wgsl.js +24 -0
  1527. package/dist/shaders/physical-wgsl/uv_transform.wgsl.js.map +1 -0
  1528. package/dist/shaders/physical-wgsl/volume.wgsl.d.ts +10 -0
  1529. package/dist/shaders/physical-wgsl/volume.wgsl.d.ts.map +1 -0
  1530. package/dist/shaders/physical-wgsl/volume.wgsl.js +35 -0
  1531. package/dist/shaders/physical-wgsl/volume.wgsl.js.map +1 -0
  1532. package/dist/shadows/DirectionalCascadeFitter.d.ts +97 -0
  1533. package/dist/shadows/DirectionalCascadeFitter.d.ts.map +1 -0
  1534. package/dist/shadows/DirectionalCascadeFitter.js +372 -0
  1535. package/dist/shadows/DirectionalCascadeFitter.js.map +1 -0
  1536. package/dist/shadows/Prd02DepthShaderLibrary.d.ts +77 -0
  1537. package/dist/shadows/Prd02DepthShaderLibrary.d.ts.map +1 -0
  1538. package/dist/shadows/Prd02DepthShaderLibrary.js +381 -0
  1539. package/dist/shadows/Prd02DepthShaderLibrary.js.map +1 -0
  1540. package/dist/shadows/Prd02ReceiveShadowContributor.d.ts +20 -0
  1541. package/dist/shadows/Prd02ReceiveShadowContributor.d.ts.map +1 -0
  1542. package/dist/shadows/Prd02ReceiveShadowContributor.js +20 -0
  1543. package/dist/shadows/Prd02ReceiveShadowContributor.js.map +1 -0
  1544. package/dist/shadows/Prd02ShadowBridge.d.ts +111 -0
  1545. package/dist/shadows/Prd02ShadowBridge.d.ts.map +1 -0
  1546. package/dist/shadows/Prd02ShadowBridge.js +267 -0
  1547. package/dist/shadows/Prd02ShadowBridge.js.map +1 -0
  1548. package/dist/shadows/Prd02ShadowFilter.d.ts +29 -0
  1549. package/dist/shadows/Prd02ShadowFilter.d.ts.map +1 -0
  1550. package/dist/shadows/Prd02ShadowFilter.js +35 -0
  1551. package/dist/shadows/Prd02ShadowFilter.js.map +1 -0
  1552. package/dist/shadows/Prd02ShadowsContributor.d.ts +44 -0
  1553. package/dist/shadows/Prd02ShadowsContributor.d.ts.map +1 -0
  1554. package/dist/shadows/Prd02ShadowsContributor.js +197 -0
  1555. package/dist/shadows/Prd02ShadowsContributor.js.map +1 -0
  1556. package/dist/shadows/ShadowAtlas.d.ts +59 -0
  1557. package/dist/shadows/ShadowAtlas.d.ts.map +1 -0
  1558. package/dist/shadows/ShadowAtlas.js +137 -0
  1559. package/dist/shadows/ShadowAtlas.js.map +1 -0
  1560. package/dist/shadows/ShadowDebugViews.d.ts +5 -0
  1561. package/dist/shadows/ShadowDebugViews.d.ts.map +1 -1
  1562. package/dist/shadows/ShadowDebugViews.js +15 -10
  1563. package/dist/shadows/ShadowDebugViews.js.map +1 -1
  1564. package/dist/shadows/ShadowFrameBinding.d.ts +18 -0
  1565. package/dist/shadows/ShadowFrameBinding.d.ts.map +1 -0
  1566. package/dist/shadows/ShadowFrameBinding.js +52 -0
  1567. package/dist/shadows/ShadowFrameBinding.js.map +1 -0
  1568. package/dist/shadows/ShadowSystem.d.ts +125 -0
  1569. package/dist/shadows/ShadowSystem.d.ts.map +1 -0
  1570. package/dist/shadows/ShadowSystem.js +293 -0
  1571. package/dist/shadows/ShadowSystem.js.map +1 -0
  1572. package/dist/textures/TextureBudget.d.ts +42 -0
  1573. package/dist/textures/TextureBudget.d.ts.map +1 -0
  1574. package/dist/textures/TextureBudget.js +180 -0
  1575. package/dist/textures/TextureBudget.js.map +1 -0
  1576. package/dist/vfx/BeamPass.d.ts +42 -0
  1577. package/dist/vfx/BeamPass.d.ts.map +1 -0
  1578. package/dist/vfx/BeamPass.js +249 -0
  1579. package/dist/vfx/BeamPass.js.map +1 -0
  1580. package/dist/vfx/BlendFallback.d.ts +19 -0
  1581. package/dist/vfx/BlendFallback.d.ts.map +1 -0
  1582. package/dist/vfx/BlendFallback.js +73 -0
  1583. package/dist/vfx/BlendFallback.js.map +1 -0
  1584. package/dist/vfx/DecalBatch.d.ts +120 -0
  1585. package/dist/vfx/DecalBatch.d.ts.map +1 -0
  1586. package/dist/vfx/DecalBatch.js +234 -0
  1587. package/dist/vfx/DecalBatch.js.map +1 -0
  1588. package/dist/vfx/DecalPass.d.ts +63 -0
  1589. package/dist/vfx/DecalPass.d.ts.map +1 -0
  1590. package/dist/vfx/DecalPass.js +159 -0
  1591. package/dist/vfx/DecalPass.js.map +1 -0
  1592. package/dist/vfx/LowResParticles.d.ts +31 -0
  1593. package/dist/vfx/LowResParticles.d.ts.map +1 -0
  1594. package/dist/vfx/LowResParticles.js +151 -0
  1595. package/dist/vfx/LowResParticles.js.map +1 -0
  1596. package/dist/vfx/MeshParticleBatch.d.ts +49 -0
  1597. package/dist/vfx/MeshParticleBatch.d.ts.map +1 -0
  1598. package/dist/vfx/MeshParticleBatch.js +184 -0
  1599. package/dist/vfx/MeshParticleBatch.js.map +1 -0
  1600. package/dist/vfx/MeshParticlePass.d.ts +28 -0
  1601. package/dist/vfx/MeshParticlePass.d.ts.map +1 -0
  1602. package/dist/vfx/MeshParticlePass.js +150 -0
  1603. package/dist/vfx/MeshParticlePass.js.map +1 -0
  1604. package/dist/vfx/ParticleBatchPass.d.ts +61 -0
  1605. package/dist/vfx/ParticleBatchPass.d.ts.map +1 -0
  1606. package/dist/vfx/ParticleBatchPass.js +320 -0
  1607. package/dist/vfx/ParticleBatchPass.js.map +1 -0
  1608. package/dist/vfx/ParticleGpuSim.d.ts +85 -0
  1609. package/dist/vfx/ParticleGpuSim.d.ts.map +1 -0
  1610. package/dist/vfx/ParticleGpuSim.js +301 -0
  1611. package/dist/vfx/ParticleGpuSim.js.map +1 -0
  1612. package/dist/vfx/ParticleInstanceLayout.d.ts +38 -0
  1613. package/dist/vfx/ParticleInstanceLayout.d.ts.map +1 -0
  1614. package/dist/vfx/ParticleInstanceLayout.js +105 -0
  1615. package/dist/vfx/ParticleInstanceLayout.js.map +1 -0
  1616. package/dist/vfx/ParticleSort.d.ts +21 -0
  1617. package/dist/vfx/ParticleSort.d.ts.map +1 -0
  1618. package/dist/vfx/ParticleSort.js +80 -0
  1619. package/dist/vfx/ParticleSort.js.map +1 -0
  1620. package/dist/vfx/ProceduralVolumeEmitter.d.ts +90 -0
  1621. package/dist/vfx/ProceduralVolumeEmitter.d.ts.map +1 -0
  1622. package/dist/vfx/ProceduralVolumeEmitter.js +155 -0
  1623. package/dist/vfx/ProceduralVolumeEmitter.js.map +1 -0
  1624. package/dist/vfx/RibbonBatch.d.ts +71 -0
  1625. package/dist/vfx/RibbonBatch.d.ts.map +1 -0
  1626. package/dist/vfx/RibbonBatch.js +234 -0
  1627. package/dist/vfx/RibbonBatch.js.map +1 -0
  1628. package/dist/vfx/RibbonPass.d.ts +21 -0
  1629. package/dist/vfx/RibbonPass.d.ts.map +1 -0
  1630. package/dist/vfx/RibbonPass.js +108 -0
  1631. package/dist/vfx/RibbonPass.js.map +1 -0
  1632. package/dist/vfx/SceneDepthAdapter.d.ts +28 -0
  1633. package/dist/vfx/SceneDepthAdapter.d.ts.map +1 -0
  1634. package/dist/vfx/SceneDepthAdapter.js +70 -0
  1635. package/dist/vfx/SceneDepthAdapter.js.map +1 -0
  1636. package/dist/vfx/VfxAtlas.d.ts +68 -0
  1637. package/dist/vfx/VfxAtlas.d.ts.map +1 -0
  1638. package/dist/vfx/VfxAtlas.js +106 -0
  1639. package/dist/vfx/VfxAtlas.js.map +1 -0
  1640. package/dist/vfx/contributors.d.ts +73 -0
  1641. package/dist/vfx/contributors.d.ts.map +1 -0
  1642. package/dist/vfx/contributors.js +615 -0
  1643. package/dist/vfx/contributors.js.map +1 -0
  1644. package/dist/vfx/decalLighting.d.ts +8 -0
  1645. package/dist/vfx/decalLighting.d.ts.map +1 -0
  1646. package/dist/vfx/decalLighting.js +53 -0
  1647. package/dist/vfx/decalLighting.js.map +1 -0
  1648. package/dist/vfx/depthSampler.d.ts +3 -0
  1649. package/dist/vfx/depthSampler.d.ts.map +1 -0
  1650. package/dist/vfx/depthSampler.js +10 -0
  1651. package/dist/vfx/depthSampler.js.map +1 -0
  1652. package/dist/vfx/prd07FeaturePars.d.ts +12 -0
  1653. package/dist/vfx/prd07FeaturePars.d.ts.map +1 -0
  1654. package/dist/vfx/prd07FeaturePars.js +54 -0
  1655. package/dist/vfx/prd07FeaturePars.js.map +1 -0
  1656. package/dist/vfx/shaders/beam.glsl.d.ts +11 -0
  1657. package/dist/vfx/shaders/beam.glsl.d.ts.map +1 -0
  1658. package/dist/vfx/shaders/beam.glsl.js +89 -0
  1659. package/dist/vfx/shaders/beam.glsl.js.map +1 -0
  1660. package/dist/vfx/shaders/decal.glsl.d.ts +14 -0
  1661. package/dist/vfx/shaders/decal.glsl.d.ts.map +1 -0
  1662. package/dist/vfx/shaders/decal.glsl.js +157 -0
  1663. package/dist/vfx/shaders/decal.glsl.js.map +1 -0
  1664. package/dist/vfx/shaders/gpu-sim.glsl.d.ts +5 -0
  1665. package/dist/vfx/shaders/gpu-sim.glsl.d.ts.map +1 -0
  1666. package/dist/vfx/shaders/gpu-sim.glsl.js +177 -0
  1667. package/dist/vfx/shaders/gpu-sim.glsl.js.map +1 -0
  1668. package/dist/vfx/shaders/lowresComposite.glsl.d.ts +9 -0
  1669. package/dist/vfx/shaders/lowresComposite.glsl.d.ts.map +1 -0
  1670. package/dist/vfx/shaders/lowresComposite.glsl.js +64 -0
  1671. package/dist/vfx/shaders/lowresComposite.glsl.js.map +1 -0
  1672. package/dist/vfx/shaders/mesh-particle.glsl.d.ts +4 -0
  1673. package/dist/vfx/shaders/mesh-particle.glsl.d.ts.map +1 -0
  1674. package/dist/vfx/shaders/mesh-particle.glsl.js +55 -0
  1675. package/dist/vfx/shaders/mesh-particle.glsl.js.map +1 -0
  1676. package/dist/vfx/shaders/particle.glsl.d.ts +24 -0
  1677. package/dist/vfx/shaders/particle.glsl.d.ts.map +1 -0
  1678. package/dist/vfx/shaders/particle.glsl.js +215 -0
  1679. package/dist/vfx/shaders/particle.glsl.js.map +1 -0
  1680. package/dist/vfx/shaders/ribbon.glsl.d.ts +9 -0
  1681. package/dist/vfx/shaders/ribbon.glsl.d.ts.map +1 -0
  1682. package/dist/vfx/shaders/ribbon.glsl.js +60 -0
  1683. package/dist/vfx/shaders/ribbon.glsl.js.map +1 -0
  1684. package/dist/vfx/shaders/volume.glsl.d.ts +5 -0
  1685. package/dist/vfx/shaders/volume.glsl.d.ts.map +1 -0
  1686. package/dist/vfx/shaders/volume.glsl.js +52 -0
  1687. package/dist/vfx/shaders/volume.glsl.js.map +1 -0
  1688. package/dist/webgl2/ContextLifecycle.d.ts +43 -0
  1689. package/dist/webgl2/ContextLifecycle.d.ts.map +1 -0
  1690. package/dist/webgl2/ContextLifecycle.js +189 -0
  1691. package/dist/webgl2/ContextLifecycle.js.map +1 -0
  1692. package/dist/webgl2/Counters.d.ts +58 -0
  1693. package/dist/webgl2/Counters.d.ts.map +1 -0
  1694. package/dist/webgl2/Counters.js +207 -0
  1695. package/dist/webgl2/Counters.js.map +1 -0
  1696. package/dist/webgl2/DeviceHost.d.ts +41 -0
  1697. package/dist/webgl2/DeviceHost.d.ts.map +1 -0
  1698. package/dist/webgl2/DeviceHost.js +3 -0
  1699. package/dist/webgl2/DeviceHost.js.map +1 -0
  1700. package/dist/webgl2/LegacyPost.d.ts +279 -0
  1701. package/dist/webgl2/LegacyPost.d.ts.map +1 -0
  1702. package/dist/webgl2/LegacyPost.js +2477 -0
  1703. package/dist/webgl2/LegacyPost.js.map +1 -0
  1704. package/dist/webgl2/MultiDraw.d.ts +96 -0
  1705. package/dist/webgl2/MultiDraw.d.ts.map +1 -0
  1706. package/dist/webgl2/MultiDraw.js +716 -0
  1707. package/dist/webgl2/MultiDraw.js.map +1 -0
  1708. package/dist/webgl2/Probe.d.ts +27 -0
  1709. package/dist/webgl2/Probe.d.ts.map +1 -0
  1710. package/dist/webgl2/Probe.js +303 -0
  1711. package/dist/webgl2/Probe.js.map +1 -0
  1712. package/dist/webgl2/Samplers.d.ts +20 -0
  1713. package/dist/webgl2/Samplers.d.ts.map +1 -0
  1714. package/dist/webgl2/Samplers.js +179 -0
  1715. package/dist/webgl2/Samplers.js.map +1 -0
  1716. package/dist/webgl2/TextureFormats.d.ts +48 -0
  1717. package/dist/webgl2/TextureFormats.d.ts.map +1 -0
  1718. package/dist/webgl2/TextureFormats.js +185 -0
  1719. package/dist/webgl2/TextureFormats.js.map +1 -0
  1720. package/dist/webgl2/TextureUpload.d.ts +38 -0
  1721. package/dist/webgl2/TextureUpload.d.ts.map +1 -0
  1722. package/dist/webgl2/TextureUpload.js +346 -0
  1723. package/dist/webgl2/TextureUpload.js.map +1 -0
  1724. package/dist/webgpu/WebGPUBuffer.d.ts +1 -0
  1725. package/dist/webgpu/WebGPUBuffer.d.ts.map +1 -1
  1726. package/dist/webgpu/WebGPUCompute.d.ts +1 -0
  1727. package/dist/webgpu/WebGPUCompute.d.ts.map +1 -1
  1728. package/dist/webgpu/WebGPUCompute.js +1 -0
  1729. package/dist/webgpu/WebGPUCompute.js.map +1 -1
  1730. package/dist/webgpu/WebGPUPipelineCache.d.ts +4 -0
  1731. package/dist/webgpu/WebGPUPipelineCache.d.ts.map +1 -1
  1732. package/dist/webgpu/WebGPUPipelineCache.js +4 -0
  1733. package/dist/webgpu/WebGPUPipelineCache.js.map +1 -1
  1734. package/dist/webgpu/WebGPUPostShaders.d.ts +2 -3
  1735. package/dist/webgpu/WebGPUPostShaders.d.ts.map +1 -1
  1736. package/dist/webgpu/WebGPUPostShaders.js +35 -5
  1737. package/dist/webgpu/WebGPUPostShaders.js.map +1 -1
  1738. package/dist/webgpu/WebGPUTemporal.d.ts +17 -0
  1739. package/dist/webgpu/WebGPUTemporal.d.ts.map +1 -0
  1740. package/dist/webgpu/WebGPUTemporal.js +64 -0
  1741. package/dist/webgpu/WebGPUTemporal.js.map +1 -0
  1742. package/dist/webgpu/WebGPUTexture.d.ts +1 -0
  1743. package/dist/webgpu/WebGPUTexture.d.ts.map +1 -1
  1744. package/dist/webgpu/WebGPUTexture.js.map +1 -1
  1745. package/dist/webgpu.d.ts +6 -0
  1746. package/dist/webgpu.d.ts.map +1 -1
  1747. package/dist/webgpu.js +4 -0
  1748. package/dist/webgpu.js.map +1 -1
  1749. package/dist/world/chunks.d.ts +15 -0
  1750. package/dist/world/chunks.d.ts.map +1 -0
  1751. package/dist/world/chunks.js +56 -0
  1752. package/dist/world/chunks.js.map +1 -0
  1753. package/dist/world/index.d.ts +38 -0
  1754. package/dist/world/index.d.ts.map +1 -0
  1755. package/dist/world/index.js +39 -0
  1756. package/dist/world/index.js.map +1 -0
  1757. package/dist/world/shared/shaders/worldLightFallback.d.ts +12 -0
  1758. package/dist/world/shared/shaders/worldLightFallback.d.ts.map +1 -0
  1759. package/dist/world/shared/shaders/worldLightFallback.js +82 -0
  1760. package/dist/world/shared/shaders/worldLightFallback.js.map +1 -0
  1761. package/dist/world/space/PlanetMaterial.d.ts +24 -0
  1762. package/dist/world/space/PlanetMaterial.d.ts.map +1 -0
  1763. package/dist/world/space/PlanetMaterial.js +82 -0
  1764. package/dist/world/space/PlanetMaterial.js.map +1 -0
  1765. package/dist/world/space/SpaceSkyBake.d.ts +46 -0
  1766. package/dist/world/space/SpaceSkyBake.d.ts.map +1 -0
  1767. package/dist/world/space/SpaceSkyBake.js +145 -0
  1768. package/dist/world/space/SpaceSkyBake.js.map +1 -0
  1769. package/dist/world/space/shaders/planet.d.ts +8 -0
  1770. package/dist/world/space/shaders/planet.d.ts.map +1 -0
  1771. package/dist/world/space/shaders/planet.js +55 -0
  1772. package/dist/world/space/shaders/planet.js.map +1 -0
  1773. package/dist/world/space/shaders/spaceBake.d.ts +9 -0
  1774. package/dist/world/space/shaders/spaceBake.d.ts.map +1 -0
  1775. package/dist/world/space/shaders/spaceBake.js +102 -0
  1776. package/dist/world/space/shaders/spaceBake.js.map +1 -0
  1777. package/dist/world/terrain/SplatBake.d.ts +76 -0
  1778. package/dist/world/terrain/SplatBake.d.ts.map +1 -0
  1779. package/dist/world/terrain/SplatBake.js +308 -0
  1780. package/dist/world/terrain/SplatBake.js.map +1 -0
  1781. package/dist/world/terrain/TerrainCdlod.d.ts +67 -0
  1782. package/dist/world/terrain/TerrainCdlod.d.ts.map +1 -0
  1783. package/dist/world/terrain/TerrainCdlod.js +115 -0
  1784. package/dist/world/terrain/TerrainCdlod.js.map +1 -0
  1785. package/dist/world/terrain/TerrainHeightTexture.d.ts +44 -0
  1786. package/dist/world/terrain/TerrainHeightTexture.d.ts.map +1 -0
  1787. package/dist/world/terrain/TerrainHeightTexture.js +173 -0
  1788. package/dist/world/terrain/TerrainHeightTexture.js.map +1 -0
  1789. package/dist/world/terrain/TerrainPatchGeometry.d.ts +18 -0
  1790. package/dist/world/terrain/TerrainPatchGeometry.d.ts.map +1 -0
  1791. package/dist/world/terrain/TerrainPatchGeometry.js +40 -0
  1792. package/dist/world/terrain/TerrainPatchGeometry.js.map +1 -0
  1793. package/dist/world/terrain/shaders/terrain.vert.glsl.d.ts +19 -0
  1794. package/dist/world/terrain/shaders/terrain.vert.glsl.d.ts.map +1 -0
  1795. package/dist/world/terrain/shaders/terrain.vert.glsl.js +162 -0
  1796. package/dist/world/terrain/shaders/terrain.vert.glsl.js.map +1 -0
  1797. package/dist/world/terrain/shaders/terrainCdlod.d.ts +23 -0
  1798. package/dist/world/terrain/shaders/terrainCdlod.d.ts.map +1 -0
  1799. package/dist/world/terrain/shaders/terrainCdlod.js +110 -0
  1800. package/dist/world/terrain/shaders/terrainCdlod.js.map +1 -0
  1801. package/dist/world/terrain/shaders/terrainSplat.d.ts +26 -0
  1802. package/dist/world/terrain/shaders/terrainSplat.d.ts.map +1 -0
  1803. package/dist/world/terrain/shaders/terrainSplat.js +181 -0
  1804. package/dist/world/terrain/shaders/terrainSplat.js.map +1 -0
  1805. package/dist/world/vegetation/FoliageMaterial.d.ts +14 -0
  1806. package/dist/world/vegetation/FoliageMaterial.d.ts.map +1 -0
  1807. package/dist/world/vegetation/FoliageMaterial.js +107 -0
  1808. package/dist/world/vegetation/FoliageMaterial.js.map +1 -0
  1809. package/dist/world/vegetation/GrassField.d.ts +43 -0
  1810. package/dist/world/vegetation/GrassField.d.ts.map +1 -0
  1811. package/dist/world/vegetation/GrassField.js +68 -0
  1812. package/dist/world/vegetation/GrassField.js.map +1 -0
  1813. package/dist/world/vegetation/ImpostorMaterial.d.ts +20 -0
  1814. package/dist/world/vegetation/ImpostorMaterial.d.ts.map +1 -0
  1815. package/dist/world/vegetation/ImpostorMaterial.js +80 -0
  1816. package/dist/world/vegetation/ImpostorMaterial.js.map +1 -0
  1817. package/dist/world/vegetation/InstanceChunkGrid.d.ts +67 -0
  1818. package/dist/world/vegetation/InstanceChunkGrid.d.ts.map +1 -0
  1819. package/dist/world/vegetation/InstanceChunkGrid.js +150 -0
  1820. package/dist/world/vegetation/InstanceChunkGrid.js.map +1 -0
  1821. package/dist/world/vegetation/WindCpu.d.ts +19 -0
  1822. package/dist/world/vegetation/WindCpu.d.ts.map +1 -0
  1823. package/dist/world/vegetation/WindCpu.js +43 -0
  1824. package/dist/world/vegetation/WindCpu.js.map +1 -0
  1825. package/dist/world/vegetation/WindField.d.ts +42 -0
  1826. package/dist/world/vegetation/WindField.d.ts.map +1 -0
  1827. package/dist/world/vegetation/WindField.js +154 -0
  1828. package/dist/world/vegetation/WindField.js.map +1 -0
  1829. package/dist/world/vegetation/shaders/foliage.d.ts +8 -0
  1830. package/dist/world/vegetation/shaders/foliage.d.ts.map +1 -0
  1831. package/dist/world/vegetation/shaders/foliage.js +104 -0
  1832. package/dist/world/vegetation/shaders/foliage.js.map +1 -0
  1833. package/dist/world/vegetation/shaders/grass.d.ts +10 -0
  1834. package/dist/world/vegetation/shaders/grass.d.ts.map +1 -0
  1835. package/dist/world/vegetation/shaders/grass.js +79 -0
  1836. package/dist/world/vegetation/shaders/grass.js.map +1 -0
  1837. package/dist/world/vegetation/shaders/impostor.d.ts +9 -0
  1838. package/dist/world/vegetation/shaders/impostor.d.ts.map +1 -0
  1839. package/dist/world/vegetation/shaders/impostor.js +97 -0
  1840. package/dist/world/vegetation/shaders/impostor.js.map +1 -0
  1841. package/dist/world/vegetation/shaders/wind.d.ts +9 -0
  1842. package/dist/world/vegetation/shaders/wind.d.ts.map +1 -0
  1843. package/dist/world/vegetation/shaders/wind.js +103 -0
  1844. package/dist/world/vegetation/shaders/wind.js.map +1 -0
  1845. package/dist/world/water/GerstnerWaves.d.ts +65 -0
  1846. package/dist/world/water/GerstnerWaves.d.ts.map +1 -0
  1847. package/dist/world/water/GerstnerWaves.js +182 -0
  1848. package/dist/world/water/GerstnerWaves.js.map +1 -0
  1849. package/dist/world/water/ReflectionViewPass.d.ts +46 -0
  1850. package/dist/world/water/ReflectionViewPass.d.ts.map +1 -0
  1851. package/dist/world/water/ReflectionViewPass.js +85 -0
  1852. package/dist/world/water/ReflectionViewPass.js.map +1 -0
  1853. package/dist/world/water/SceneCopyFallback.d.ts +21 -0
  1854. package/dist/world/water/SceneCopyFallback.d.ts.map +1 -0
  1855. package/dist/world/water/SceneCopyFallback.js +150 -0
  1856. package/dist/world/water/SceneCopyFallback.js.map +1 -0
  1857. package/dist/world/water/UnderwaterState.d.ts +25 -0
  1858. package/dist/world/water/UnderwaterState.d.ts.map +1 -0
  1859. package/dist/world/water/UnderwaterState.js +134 -0
  1860. package/dist/world/water/UnderwaterState.js.map +1 -0
  1861. package/dist/world/water/WaterMaterial.d.ts +23 -0
  1862. package/dist/world/water/WaterMaterial.d.ts.map +1 -0
  1863. package/dist/world/water/WaterMaterial.js +129 -0
  1864. package/dist/world/water/WaterMaterial.js.map +1 -0
  1865. package/dist/world/water/shaders/caustics.d.ts +13 -0
  1866. package/dist/world/water/shaders/caustics.d.ts.map +1 -0
  1867. package/dist/world/water/shaders/caustics.js +103 -0
  1868. package/dist/world/water/shaders/caustics.js.map +1 -0
  1869. package/dist/world/water/shaders/gerstner.d.ts +9 -0
  1870. package/dist/world/water/shaders/gerstner.d.ts.map +1 -0
  1871. package/dist/world/water/shaders/gerstner.js +100 -0
  1872. package/dist/world/water/shaders/gerstner.js.map +1 -0
  1873. package/dist/world/water/shaders/water.d.ts +12 -0
  1874. package/dist/world/water/shaders/water.d.ts.map +1 -0
  1875. package/dist/world/water/shaders/water.js +112 -0
  1876. package/dist/world/water/shaders/water.js.map +1 -0
  1877. package/package.json +40 -7
@@ -1,1987 +1,9 @@
1
- import { BaseRenderPass } from "./RenderPass.js";
2
- import { RenderDeviceError } from "./RenderDevice.js";
3
- import { OUTLINE_LUMA_SCALE, createOutlineGradientBound } from "./postprocess/NativeLdrEffectLuts.js";
4
- export class ToneMappingPass extends BaseRenderPass {
5
- options;
6
- exposure;
7
- whitePoint;
8
- gamma;
9
- operator;
10
- inputColorSpace;
11
- outputColorSpace;
12
- lastResult = null;
13
- constructor(options) {
14
- super(options.name ?? "tone-mapping", [options.readResource ?? options.source.label], [options.writeResource ?? options.target?.label ?? "backbuffer"]);
15
- this.options = options;
16
- this.exposure = options.exposure ?? 1;
17
- this.whitePoint = options.whitePoint ?? 1;
18
- this.gamma = options.gamma ?? 2.2;
19
- this.operator = options.operator ?? "reinhard";
20
- this.inputColorSpace = options.inputColorSpace ?? "linear";
21
- this.outputColorSpace = options.outputColorSpace ?? "linear";
22
- if (!Number.isFinite(this.exposure) || this.exposure < 0) {
23
- throw new Error("ToneMappingPass exposure must be finite and non-negative.");
24
- }
25
- if (!Number.isFinite(this.whitePoint) || this.whitePoint <= 0) {
26
- throw new Error("ToneMappingPass whitePoint must be finite and positive.");
27
- }
28
- if (!Number.isFinite(this.gamma) || this.gamma <= 0) {
29
- throw new Error("ToneMappingPass gamma must be finite and positive.");
30
- }
31
- }
32
- execute(context) {
33
- context.device.setRenderTarget(this.options.source);
34
- const mapped = this.options.source.colorTexture.format === "rgba16f" || this.options.source.colorTexture.format === "rgba32f"
35
- ? toneMapFloatPixels(context.device.readFloatPixels(0, 0, this.options.source.width, this.options.source.height), this.options.source.width, this.options.source.height, {
36
- exposure: this.exposure,
37
- whitePoint: this.whitePoint,
38
- gamma: this.gamma,
39
- operator: this.operator,
40
- outputColorSpace: this.outputColorSpace
41
- })
42
- : toneMapPixels(context.device.readPixels(0, 0, this.options.source.width, this.options.source.height), this.options.source.width, this.options.source.height, {
43
- exposure: this.exposure,
44
- whitePoint: this.whitePoint,
45
- gamma: this.gamma,
46
- operator: this.operator,
47
- inputColorSpace: this.inputColorSpace,
48
- outputColorSpace: this.outputColorSpace
49
- });
50
- writeRenderTarget(context.device, this.options.source, this.options.target, mapped.pixels);
51
- this.lastResult = mapped;
52
- }
53
- getLastResult() {
54
- return this.lastResult ? { ...this.lastResult, pixels: new Uint8Array(this.lastResult.pixels) } : null;
55
- }
56
- }
57
- export class DepthVisualizationPass extends BaseRenderPass {
58
- options;
59
- edgeThreshold;
60
- lastResult = null;
61
- constructor(options) {
62
- super(options.name ?? "depth-visualization", [options.readResource ?? options.source.label], [options.writeResource ?? options.target?.label ?? "depth-visualization-output"]);
63
- this.options = options;
64
- this.edgeThreshold = options.edgeThreshold ?? 0.08;
65
- if (!Number.isFinite(this.edgeThreshold) || this.edgeThreshold < 0 || this.edgeThreshold > 1) {
66
- throw new Error("DepthVisualizationPass edgeThreshold must be finite and in [0, 1].");
67
- }
68
- }
69
- execute(context) {
70
- const visualized = visualizeDepthTexture(this.options.source, { edgeThreshold: this.edgeThreshold });
71
- writeDepthTarget(this.options.target, this.options.source.width, this.options.source.height, visualized.pixels);
72
- context.device.setRenderTarget(this.options.target ?? null);
73
- this.lastResult = visualized;
74
- }
75
- getLastResult() {
76
- return this.lastResult
77
- ? {
78
- ...this.lastResult,
79
- pixels: new Uint8Array(this.lastResult.pixels),
80
- stats: { ...this.lastResult.stats }
81
- }
82
- : null;
83
- }
84
- }
85
- export class BloomPass extends BaseRenderPass {
86
- options;
87
- threshold;
88
- intensity;
89
- radius;
90
- lastResult = null;
91
- constructor(options) {
92
- super(options.name ?? "bloom", [options.readResource ?? options.source.label], [options.writeResource ?? options.target?.label ?? "bloom-output"]);
93
- this.options = options;
94
- this.threshold = options.threshold ?? 0.75;
95
- this.intensity = options.intensity ?? 0.35;
96
- this.radius = options.radius ?? 1;
97
- validateBloomOptions(this.threshold, this.intensity, this.radius);
98
- }
99
- execute(context) {
100
- context.device.setRenderTarget(this.options.source);
101
- const pixels = context.device.readPixels(0, 0, this.options.source.width, this.options.source.height);
102
- const bloomed = bloomPixels(pixels, this.options.source.width, this.options.source.height, {
103
- threshold: this.threshold,
104
- intensity: this.intensity,
105
- radius: this.radius
106
- });
107
- writeRenderTarget(context.device, this.options.source, this.options.target, bloomed.pixels);
108
- this.lastResult = bloomed;
109
- }
110
- getLastResult() {
111
- return this.lastResult
112
- ? {
113
- ...this.lastResult,
114
- pixels: new Uint8Array(this.lastResult.pixels),
115
- brightPixels: new Uint8Array(this.lastResult.brightPixels),
116
- horizontalBlurPixels: new Uint8Array(this.lastResult.horizontalBlurPixels),
117
- verticalBlurPixels: new Uint8Array(this.lastResult.verticalBlurPixels)
118
- }
119
- : null;
120
- }
121
- }
122
- export class FXAAPass extends BaseRenderPass {
123
- options;
124
- edgeThreshold;
125
- subpixelBlend;
126
- lastResult = null;
127
- constructor(options) {
128
- super(options.name ?? "fxaa", [options.readResource ?? options.source.label], [options.writeResource ?? options.target?.label ?? "fxaa-output"]);
129
- this.options = options;
130
- this.edgeThreshold = options.edgeThreshold ?? 0.125;
131
- this.subpixelBlend = options.subpixelBlend ?? 0.75;
132
- validateFXAAOptions(this.edgeThreshold, this.subpixelBlend);
133
- }
134
- execute(context) {
135
- context.device.setRenderTarget(this.options.source);
136
- const pixels = context.device.readPixels(0, 0, this.options.source.width, this.options.source.height);
137
- const smoothed = fxaaPixels(pixels, this.options.source.width, this.options.source.height, {
138
- edgeThreshold: this.edgeThreshold,
139
- subpixelBlend: this.subpixelBlend
140
- });
141
- writeRenderTarget(context.device, this.options.source, this.options.target, smoothed.pixels);
142
- this.lastResult = smoothed;
143
- }
144
- getLastResult() {
145
- return this.lastResult
146
- ? {
147
- ...this.lastResult,
148
- pixels: new Uint8Array(this.lastResult.pixels),
149
- edgeMask: new Uint8Array(this.lastResult.edgeMask)
150
- }
151
- : null;
152
- }
153
- }
154
- export function toneMapPixels(pixels, width, height, options = {}) {
155
- if (!Number.isInteger(width) || width <= 0 || !Number.isInteger(height) || height <= 0) {
156
- throw new Error("Tone mapping dimensions must be positive integers.");
157
- }
158
- if (pixels.byteLength !== width * height * 4) {
159
- throw new Error("Tone mapping input must contain width * height * 4 RGBA bytes.");
160
- }
161
- const exposure = options.exposure ?? 1;
162
- const whitePoint = options.whitePoint ?? 1;
163
- const gamma = options.gamma ?? 2.2;
164
- const operator = options.operator ?? "reinhard";
165
- const inputColorSpace = options.inputColorSpace ?? "linear";
166
- const outputColorSpace = options.outputColorSpace ?? "linear";
167
- if (!Number.isFinite(exposure) || exposure < 0) {
168
- throw new Error("Tone mapping exposure must be finite and non-negative.");
169
- }
170
- if (!Number.isFinite(whitePoint) || whitePoint <= 0) {
171
- throw new Error("Tone mapping whitePoint must be finite and positive.");
172
- }
173
- if (!Number.isFinite(gamma) || gamma <= 0) {
174
- throw new Error("Tone mapping gamma must be finite and positive.");
175
- }
176
- const output = new Uint8Array(pixels.byteLength);
177
- for (let index = 0; index < pixels.length; index += 4) {
178
- const decoded = [
179
- decodeColorByte(pixels[index], inputColorSpace),
180
- decodeColorByte(pixels[index + 1], inputColorSpace),
181
- decodeColorByte(pixels[index + 2], inputColorSpace)
182
- ];
183
- const mapped = operator === "aces" ? acesFilmicRgb(decoded, exposure, whitePoint) : undefined;
184
- output[index] = mapped ? encodeColorByte(mapped[0], gamma, outputColorSpace) : encodeToneMappedChannel(decoded[0], exposure, whitePoint, gamma, operator, outputColorSpace);
185
- output[index + 1] = mapped ? encodeColorByte(mapped[1], gamma, outputColorSpace) : encodeToneMappedChannel(decoded[1], exposure, whitePoint, gamma, operator, outputColorSpace);
186
- output[index + 2] = mapped ? encodeColorByte(mapped[2], gamma, outputColorSpace) : encodeToneMappedChannel(decoded[2], exposure, whitePoint, gamma, operator, outputColorSpace);
187
- output[index + 3] = pixels[index + 3];
188
- }
189
- return {
190
- width,
191
- height,
192
- pixels: output,
193
- colorSpace: outputColorSpace,
194
- calibration: createToneMappingCalibration({ exposure, whitePoint, gamma, operator, inputColorSpace, outputColorSpace })
195
- };
196
- }
197
- export function toneMapFloatPixels(pixels, width, height, options = {}) {
198
- if (!Number.isInteger(width) || width <= 0 || !Number.isInteger(height) || height <= 0) {
199
- throw new Error("HDR tone mapping dimensions must be positive integers.");
200
- }
201
- if (pixels.length !== width * height * 4) {
202
- throw new Error("HDR tone mapping input must contain width * height * 4 RGBA float values.");
203
- }
204
- const exposure = options.exposure ?? 1;
205
- const whitePoint = options.whitePoint ?? 1;
206
- const gamma = options.gamma ?? 2.2;
207
- const operator = options.operator ?? "reinhard";
208
- const outputColorSpace = options.outputColorSpace ?? "linear";
209
- if (!Number.isFinite(exposure) || exposure < 0) {
210
- throw new Error("HDR tone mapping exposure must be finite and non-negative.");
211
- }
212
- if (!Number.isFinite(whitePoint) || whitePoint <= 0) {
213
- throw new Error("HDR tone mapping whitePoint must be finite and positive.");
214
- }
215
- if (!Number.isFinite(gamma) || gamma <= 0) {
216
- throw new Error("HDR tone mapping gamma must be finite and positive.");
217
- }
218
- const output = new Uint8Array(pixels.length);
219
- let inputOverbrightPixels = 0;
220
- let maxInputValue = 0;
221
- for (let index = 0; index < pixels.length; index += 4) {
222
- const r = finiteHdrChannel(pixels[index], index);
223
- const g = finiteHdrChannel(pixels[index + 1], index + 1);
224
- const b = finiteHdrChannel(pixels[index + 2], index + 2);
225
- const a = finiteHdrChannel(pixels[index + 3], index + 3);
226
- if (r > 1 || g > 1 || b > 1)
227
- inputOverbrightPixels += 1;
228
- maxInputValue = Math.max(maxInputValue, r, g, b);
229
- const mapped = operator === "aces" ? acesFilmicRgb([r, g, b], exposure, whitePoint) : undefined;
230
- output[index] = mapped ? encodeColorByte(mapped[0], gamma, outputColorSpace) : encodeToneMappedChannel(r, exposure, whitePoint, gamma, operator, outputColorSpace);
231
- output[index + 1] = mapped ? encodeColorByte(mapped[1], gamma, outputColorSpace) : encodeToneMappedChannel(g, exposure, whitePoint, gamma, operator, outputColorSpace);
232
- output[index + 2] = mapped ? encodeColorByte(mapped[2], gamma, outputColorSpace) : encodeToneMappedChannel(b, exposure, whitePoint, gamma, operator, outputColorSpace);
233
- output[index + 3] = clampByte(a * 255);
234
- }
235
- return {
236
- width,
237
- height,
238
- pixels: output,
239
- colorSpace: outputColorSpace,
240
- calibration: createToneMappingCalibration({ exposure, whitePoint, gamma, operator, inputColorSpace: "linear", outputColorSpace }),
241
- inputOverbrightPixels,
242
- maxInputValue: Number(maxInputValue.toFixed(6))
243
- };
244
- }
245
- export function colorGradePixels(pixels, width, height, options = {}) {
246
- validatePixelBuffer(pixels, width, height, "Color grading");
247
- const settings = {
248
- contrast: options.contrast ?? 1,
249
- temperature: options.temperature ?? 0,
250
- tint: options.tint ?? 0,
251
- saturation: options.saturation ?? 1,
252
- vibrance: options.vibrance ?? 0,
253
- vignette: options.vignette ?? 0,
254
- sharpening: options.sharpening ?? 0
255
- };
256
- validateRange(settings.contrast, 0, 3, "Color grading contrast");
257
- validateRange(settings.temperature, -1, 1, "Color grading temperature");
258
- validateRange(settings.tint, -1, 1, "Color grading tint");
259
- validateRange(settings.saturation, 0, 3, "Color grading saturation");
260
- validateRange(settings.vibrance, -1, 1, "Color grading vibrance");
261
- validateRange(settings.vignette, 0, 1, "Color grading vignette");
262
- validateRange(settings.sharpening, 0, 2, "Color grading sharpening");
263
- const graded = new Uint8Array(pixels.byteLength);
264
- let changedPixels = 0;
265
- let vignetteDarkenedPixels = 0;
266
- for (let y = 0; y < height; y += 1) {
267
- for (let x = 0; x < width; x += 1) {
268
- const index = (y * width + x) * 4;
269
- let r = (pixels[index] ?? 0) / 255;
270
- let g = (pixels[index + 1] ?? 0) / 255;
271
- let b = (pixels[index + 2] ?? 0) / 255;
272
- const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;
273
- r = (r - 0.5) * settings.contrast + 0.5;
274
- g = (g - 0.5) * settings.contrast + 0.5;
275
- b = (b - 0.5) * settings.contrast + 0.5;
276
- r += settings.temperature * 0.08 - settings.tint * 0.02;
277
- g += settings.tint * 0.06;
278
- b -= settings.temperature * 0.08 + settings.tint * 0.02;
279
- const vibranceBoost = settings.vibrance * (1 - Math.min(1, Math.abs(r - luma) + Math.abs(g - luma) + Math.abs(b - luma)));
280
- const saturation = settings.saturation + vibranceBoost;
281
- r = luma + (r - luma) * saturation;
282
- g = luma + (g - luma) * saturation;
283
- b = luma + (b - luma) * saturation;
284
- const centerX = width <= 1 ? 0 : (x / (width - 1)) * 2 - 1;
285
- const centerY = height <= 1 ? 0 : (y / (height - 1)) * 2 - 1;
286
- const vignette = 1 - settings.vignette * Math.min(1, Math.max(0, Math.hypot(centerX, centerY) - 0.28) / 1.12);
287
- if (vignette < 0.98)
288
- vignetteDarkenedPixels += 1;
289
- r *= vignette;
290
- g *= vignette;
291
- b *= vignette;
292
- graded[index] = clampByte(r * 255);
293
- graded[index + 1] = clampByte(g * 255);
294
- graded[index + 2] = clampByte(b * 255);
295
- graded[index + 3] = pixels[index + 3] ?? 255;
296
- if (Math.abs(graded[index] - (pixels[index] ?? 0)) + Math.abs(graded[index + 1] - (pixels[index + 1] ?? 0)) + Math.abs(graded[index + 2] - (pixels[index + 2] ?? 0)) > 3) {
297
- changedPixels += 1;
298
- }
299
- }
300
- }
301
- const sharpened = settings.sharpening > 0 ? sharpenPixels(graded, width, height, settings.sharpening) : { pixels: graded, sharpenedPixels: 0 };
302
- return {
303
- width,
304
- height,
305
- pixels: sharpened.pixels,
306
- changedPixels: Math.max(changedPixels, countChangedRgb(pixels, sharpened.pixels)),
307
- vignetteDarkenedPixels,
308
- sharpenedPixels: sharpened.sharpenedPixels,
309
- settings
310
- };
311
- }
312
- export const toneMappingPresets = {
313
- natural: createToneMappingPreset("natural", "Natural", {
314
- operator: "neutral",
315
- exposure: 1,
316
- autoExposure: false
317
- }),
318
- cinematic: createToneMappingPreset("cinematic", "Cinematic", {
319
- operator: "aces",
320
- exposure: 1.2,
321
- autoExposure: true,
322
- adaptationSpeed: 0.3,
323
- temperature: -0.1,
324
- contrast: 1.1,
325
- saturation: 0.95
326
- }),
327
- vibrant: createToneMappingPreset("vibrant", "Vibrant", {
328
- operator: "uncharted2",
329
- exposure: 1.3,
330
- autoExposure: false,
331
- temperature: 0.1,
332
- contrast: 1.15,
333
- saturation: 1.2
334
- }),
335
- realistic: createToneMappingPreset("realistic", "Realistic", {
336
- operator: "agx",
337
- exposure: 1,
338
- autoExposure: true,
339
- adaptationSpeed: 0.5
340
- }),
341
- stylized: createToneMappingPreset("stylized", "Stylized", {
342
- operator: "filmic",
343
- exposure: 1.4,
344
- autoExposure: false,
345
- temperature: 0.2,
346
- contrast: 1.25,
347
- saturation: 1.1
348
- })
349
- };
350
- export function resolveToneMappingPreset(name, overrides = {}) {
351
- const preset = toneMappingPresets[name];
352
- return {
353
- ...preset,
354
- toneMapping: {
355
- ...preset.toneMapping,
356
- exposure: overrides.exposure ?? preset.toneMapping.exposure,
357
- whitePoint: overrides.whitePoint ?? preset.toneMapping.whitePoint,
358
- gamma: overrides.gamma ?? preset.toneMapping.gamma,
359
- operator: overrides.operator ?? preset.toneMapping.operator,
360
- inputColorSpace: overrides.inputColorSpace ?? preset.toneMapping.inputColorSpace,
361
- outputColorSpace: overrides.outputColorSpace ?? preset.toneMapping.outputColorSpace
362
- },
363
- colorGrade: {
364
- ...preset.colorGrade,
365
- contrast: overrides.contrast ?? preset.colorGrade.contrast,
366
- temperature: overrides.temperature ?? preset.colorGrade.temperature,
367
- tint: overrides.tint ?? preset.colorGrade.tint,
368
- saturation: overrides.saturation ?? preset.colorGrade.saturation,
369
- vibrance: overrides.vibrance ?? preset.colorGrade.vibrance,
370
- vignette: overrides.vignette ?? preset.colorGrade.vignette,
371
- sharpening: overrides.sharpening ?? preset.colorGrade.sharpening
372
- },
373
- autoExposure: overrides.autoExposure ?? preset.autoExposure,
374
- adaptationSpeed: overrides.adaptationSpeed ?? preset.adaptationSpeed,
375
- minExposure: overrides.minExposure ?? preset.minExposure,
376
- maxExposure: overrides.maxExposure ?? preset.maxExposure
377
- };
378
- }
379
- export function computeExposureHistogramFromPixels(pixels, width, height, options = {}) {
380
- validatePixelBuffer(pixels, width, height, "Exposure histogram");
381
- const inputColorSpace = options.inputColorSpace ?? "linear";
382
- const binCount = options.binCount ?? 64;
383
- const minLuminance = options.minLuminance ?? 0.001;
384
- const maxLuminance = options.maxLuminance ?? 16;
385
- validateHistogramOptions(binCount, minLuminance, maxLuminance);
386
- const bins = Array.from({ length: binCount }, () => 0);
387
- const logMin = Math.log2(minLuminance);
388
- const logMax = Math.log2(maxLuminance);
389
- let luminanceSum = 0;
390
- let minObservedLuminance = Number.POSITIVE_INFINITY;
391
- let maxObservedLuminance = 0;
392
- for (let index = 0; index < pixels.length; index += 4) {
393
- const r = decodeColorByte(pixels[index] ?? 0, inputColorSpace);
394
- const g = decodeColorByte(pixels[index + 1] ?? 0, inputColorSpace);
395
- const b = decodeColorByte(pixels[index + 2] ?? 0, inputColorSpace);
396
- const luminance = Math.max(0, 0.2126 * r + 0.7152 * g + 0.0722 * b);
397
- luminanceSum += luminance;
398
- minObservedLuminance = Math.min(minObservedLuminance, luminance);
399
- maxObservedLuminance = Math.max(maxObservedLuminance, luminance);
400
- const safeLuminance = Math.max(minLuminance, Math.min(maxLuminance, luminance));
401
- const bin = clampInt(Math.round(((Math.log2(safeLuminance) - logMin) / (logMax - logMin)) * (binCount - 1)), 0, binCount - 1);
402
- bins[bin] += 1;
403
- }
404
- const pixelCount = width * height;
405
- return {
406
- bins,
407
- binCount,
408
- minLuminance,
409
- maxLuminance,
410
- pixelCount,
411
- averageLuminance: Number((luminanceSum / pixelCount).toFixed(6)),
412
- minObservedLuminance: Number((minObservedLuminance === Number.POSITIVE_INFINITY ? 0 : minObservedLuminance).toFixed(6)),
413
- maxObservedLuminance: Number(maxObservedLuminance.toFixed(6))
414
- };
415
- }
416
- export function computeAutoExposureFromHistogram(histogram, options = {}) {
417
- if (histogram.pixelCount <= 0 || histogram.bins.length !== histogram.binCount) {
418
- throw new Error("Auto exposure histogram must contain bins and a positive pixel count.");
419
- }
420
- const targetLuminance = options.targetLuminance ?? 0.18;
421
- const previousExposure = options.previousExposure ?? 1;
422
- const adaptationSpeed = options.adaptationSpeed ?? 1;
423
- const deltaTimeSeconds = options.deltaTimeSeconds ?? 1 / 60;
424
- const minExposure = options.minExposure ?? 0.1;
425
- const maxExposure = options.maxExposure ?? 10;
426
- validateRange(targetLuminance, 0.001, 4, "Auto exposure targetLuminance");
427
- validateRange(previousExposure, 0.001, 128, "Auto exposure previousExposure");
428
- validateRange(adaptationSpeed, 0, 1, "Auto exposure adaptationSpeed");
429
- validateRange(deltaTimeSeconds, 0, 10, "Auto exposure deltaTimeSeconds");
430
- validateRange(minExposure, 0.001, 128, "Auto exposure minExposure");
431
- validateRange(maxExposure, minExposure, 128, "Auto exposure maxExposure");
432
- const averageLuminance = histogram.averageLuminance > 0 ? histogram.averageLuminance : histogramAverageFromBins(histogram);
433
- const unclampedTarget = targetLuminance / Math.max(0.001, averageLuminance);
434
- const targetExposure = Math.max(minExposure, Math.min(maxExposure, unclampedTarget));
435
- const adaptationRate = 1 - Math.pow(1 - adaptationSpeed, deltaTimeSeconds * 60);
436
- const exposure = previousExposure + (targetExposure - previousExposure) * adaptationRate;
437
- return {
438
- exposure: Number(exposure.toFixed(6)),
439
- targetExposure: Number(targetExposure.toFixed(6)),
440
- averageLuminance: Number(averageLuminance.toFixed(6)),
441
- adaptationRate: Number(adaptationRate.toFixed(6)),
442
- clamped: targetExposure !== unclampedTarget
443
- };
444
- }
445
- export function applyToneMappingPreset(pixels, width, height, presetName, options = {}) {
446
- const preset = resolveToneMappingPreset(presetName, options);
447
- const histogram = computeExposureHistogramFromPixels(pixels, width, height, {
448
- inputColorSpace: preset.toneMapping.inputColorSpace
449
- });
450
- const autoExposure = preset.autoExposure
451
- ? computeAutoExposureFromHistogram(histogram, {
452
- targetLuminance: options.targetLuminance,
453
- previousExposure: options.previousExposure ?? preset.toneMapping.exposure,
454
- adaptationSpeed: options.adaptationSpeed ?? preset.adaptationSpeed,
455
- deltaTimeSeconds: options.deltaTimeSeconds,
456
- minExposure: options.minExposure ?? preset.minExposure,
457
- maxExposure: options.maxExposure ?? preset.maxExposure
458
- })
459
- : undefined;
460
- const toneMapped = toneMapPixels(pixels, width, height, {
461
- ...preset.toneMapping,
462
- exposure: autoExposure?.exposure ?? preset.toneMapping.exposure
463
- });
464
- const colorGraded = colorGradePixels(toneMapped.pixels, width, height, preset.colorGrade);
465
- return {
466
- width,
467
- height,
468
- preset: presetName,
469
- pixels: colorGraded.pixels,
470
- toneMapped,
471
- colorGraded,
472
- histogram,
473
- autoExposure
474
- };
475
- }
476
- export function chromaticAberrationPixels(pixels, width, height, options = {}) {
477
- validatePixelBuffer(pixels, width, height, "Chromatic aberration");
478
- const strength = options.strength ?? 0.35;
479
- validateRange(strength, 0, 2, "Chromatic aberration strength");
480
- const output = new Uint8Array(pixels);
481
- let changedPixels = 0;
482
- let maxChannelOffsetPixels = 0;
483
- const centerX = (width - 1) / 2;
484
- const centerY = (height - 1) / 2;
485
- const maxDistance = Math.max(1, Math.hypot(centerX, centerY));
486
- for (let y = 0; y < height; y += 1) {
487
- for (let x = 0; x < width; x += 1) {
488
- const index = (y * width + x) * 4;
489
- const directionX = centerX === 0 ? 0 : (x - centerX) / maxDistance;
490
- const directionY = centerY === 0 ? 0 : (y - centerY) / maxDistance;
491
- const radial = Math.min(1, Math.hypot(x - centerX, y - centerY) / maxDistance);
492
- const offset = Math.round(strength * radial * 2);
493
- maxChannelOffsetPixels = Math.max(maxChannelOffsetPixels, offset);
494
- const redX = clampInt(Math.round(x + directionX * offset), 0, width - 1);
495
- const redY = clampInt(Math.round(y + directionY * offset), 0, height - 1);
496
- const blueX = clampInt(Math.round(x - directionX * offset), 0, width - 1);
497
- const blueY = clampInt(Math.round(y - directionY * offset), 0, height - 1);
498
- output[index] = channelAt(pixels, width, height, redX, redY, 0);
499
- output[index + 1] = pixels[index + 1] ?? 0;
500
- output[index + 2] = channelAt(pixels, width, height, blueX, blueY, 2);
501
- output[index + 3] = pixels[index + 3] ?? 255;
502
- if (Math.abs(output[index] - (pixels[index] ?? 0)) + Math.abs(output[index + 2] - (pixels[index + 2] ?? 0)) > 2) {
503
- changedPixels += 1;
504
- }
505
- }
506
- }
507
- return { width, height, pixels: output, changedPixels, maxChannelOffsetPixels };
508
- }
509
- export function outlinePixels(pixels, width, height, options = {}) {
510
- validatePixelBuffer(pixels, width, height, "Outline");
511
- const outlineWidth = options.width ?? 1;
512
- const threshold = options.threshold ?? 0.22;
513
- const opacity = options.opacity ?? 0.85;
514
- const color = options.color ?? [255, 188, 64, 255];
515
- if (!Number.isInteger(outlineWidth) || outlineWidth < 1 || outlineWidth > 6) {
516
- throw new Error("Outline width must be an integer in [1, 6].");
517
- }
518
- validateRange(threshold, 0, 4, "Outline threshold");
519
- validateRange(opacity, 0, 1, "Outline opacity");
520
- validateOutlineColor(color);
521
- const edgeMask = new Uint8Array(width * height);
522
- const gradientBound = createOutlineGradientBound(threshold).numberValue;
523
- let maxGradientNumerator = 0;
524
- for (let y = 0; y < height; y += 1) {
525
- for (let x = 0; x < width; x += 1) {
526
- const { gx, gy } = sobelLumaNumeratorGradient(pixels, width, height, x, y);
527
- const squared = gx * gx + gy * gy;
528
- if (squared > maxGradientNumerator)
529
- maxGradientNumerator = squared;
530
- if (outlineEdgeExceedsBound(gx, gy, gradientBound)) {
531
- edgeMask[y * width + x] = 255;
532
- }
533
- }
534
- }
535
- const maxGradient = Math.sqrt(maxGradientNumerator) / OUTLINE_LUMA_SCALE;
536
- const outlineMask = dilateMask(edgeMask, width, height, outlineWidth);
537
- const output = new Uint8Array(pixels);
538
- let outlinedPixels = 0;
539
- let changedPixels = 0;
540
- const colorAlpha = (color[3] ?? 255) / 255;
541
- const alpha = opacity * colorAlpha;
542
- for (let index = 0; index < outlineMask.length; index += 1) {
543
- if (outlineMask[index] === 0)
544
- continue;
545
- outlinedPixels += 1;
546
- const pixelIndex = index * 4;
547
- const beforeRed = pixels[pixelIndex] ?? 0;
548
- const beforeGreen = pixels[pixelIndex + 1] ?? 0;
549
- const beforeBlue = pixels[pixelIndex + 2] ?? 0;
550
- output[pixelIndex] = clampByte(beforeRed * (1 - alpha) + color[0] * alpha);
551
- output[pixelIndex + 1] = clampByte(beforeGreen * (1 - alpha) + color[1] * alpha);
552
- output[pixelIndex + 2] = clampByte(beforeBlue * (1 - alpha) + color[2] * alpha);
553
- output[pixelIndex + 3] = pixels[pixelIndex + 3] ?? 255;
554
- if (Math.abs(output[pixelIndex] - beforeRed) + Math.abs(output[pixelIndex + 1] - beforeGreen) + Math.abs(output[pixelIndex + 2] - beforeBlue) > 3) {
555
- changedPixels += 1;
556
- }
557
- }
558
- return {
559
- width,
560
- height,
561
- pixels: output,
562
- outlineMask,
563
- outlinedPixels,
564
- changedPixels,
565
- maxGradient: Number(maxGradient.toFixed(6)),
566
- method: "sobel-luma"
567
- };
568
- }
569
- export function filmGrainPixels(pixels, width, height, options = {}) {
570
- validatePixelBuffer(pixels, width, height, "Film grain");
571
- const intensity = options.intensity ?? 0.08;
572
- const seed = options.seed ?? 1;
573
- const monochrome = options.monochrome ?? true;
574
- validateRange(intensity, 0, 1, "Film grain intensity");
575
- if (!Number.isInteger(seed)) {
576
- throw new Error("Film grain seed must be an integer.");
577
- }
578
- const output = new Uint8Array(pixels);
579
- let changedPixels = 0;
580
- for (let y = 0; y < height; y += 1) {
581
- for (let x = 0; x < width; x += 1) {
582
- const index = (y * width + x) * 4;
583
- const luma = ((pixels[index] ?? 0) * 0.2126 + (pixels[index + 1] ?? 0) * 0.7152 + (pixels[index + 2] ?? 0) * 0.0722) / 255;
584
- const grain = (noise2d(x, y, seed) +
585
- noise2d(Math.floor(x / 2), Math.floor(y / 2), seed + 97) +
586
- noise2d(x + 19, y + 31, seed + 193)) / 3 * 2 - 1;
587
- const amplitude = intensity * 84 * (0.35 + 0.65 * (1 - luma));
588
- const redGrain = grain;
589
- const greenGrain = monochrome ? grain : grain * 0.72 + (noise2d(x, y, seed + 17) * 2 - 1) * 0.28;
590
- const blueGrain = monochrome ? grain : grain * 0.72 + (noise2d(x, y, seed + 31) * 2 - 1) * 0.28;
591
- output[index] = clampByte((pixels[index] ?? 0) + redGrain * amplitude);
592
- output[index + 1] = clampByte((pixels[index + 1] ?? 0) + greenGrain * amplitude);
593
- output[index + 2] = clampByte((pixels[index + 2] ?? 0) + blueGrain * amplitude);
594
- output[index + 3] = pixels[index + 3] ?? 255;
595
- if (Math.abs(output[index] - (pixels[index] ?? 0)) + Math.abs(output[index + 1] - (pixels[index + 1] ?? 0)) + Math.abs(output[index + 2] - (pixels[index + 2] ?? 0)) > 0) {
596
- changedPixels += 1;
597
- }
598
- }
599
- }
600
- return { width, height, pixels: output, changedPixels, seed, intensity, monochrome };
601
- }
602
- export function depthOfFieldPixels(pixels, width, height, options) {
603
- validatePixelBuffer(pixels, width, height, "Depth of field");
604
- const focusDepth = options.focusDepth ?? 0.5;
605
- const focusRange = options.focusRange ?? 0.12;
606
- const maxRadius = options.maxRadius ?? 2;
607
- validateRange(focusDepth, 0, 1, "Depth of field focusDepth");
608
- validateRange(focusRange, 0.001, 1, "Depth of field focusRange");
609
- if (!Number.isInteger(maxRadius) || maxRadius < 0 || maxRadius > 8) {
610
- throw new Error("Depth of field maxRadius must be an integer in [0, 8].");
611
- }
612
- const depthTexture = requireDepthTextureBinding(options.depth, "Depth of field");
613
- if (depthTexture.width !== width || depthTexture.height !== height) {
614
- throw new Error("Depth of field depth texture dimensions must match source pixels.");
615
- }
616
- const output = new Uint8Array(pixels);
617
- let blurredPixels = 0;
618
- for (let y = 0; y < height; y += 1) {
619
- for (let x = 0; x < width; x += 1) {
620
- const depth = depthAt(depthTexture, x, y);
621
- const radius = Math.min(maxRadius, Math.round(Math.max(0, Math.abs(depth - focusDepth) - focusRange) / Math.max(focusRange, 0.001) * maxRadius));
622
- if (radius === 0)
623
- continue;
624
- blurredPixels += 1;
625
- const index = (y * width + x) * 4;
626
- let red = 0;
627
- let green = 0;
628
- let blue = 0;
629
- let samples = 0;
630
- for (let offsetY = -radius; offsetY <= radius; offsetY += 1) {
631
- for (let offsetX = -radius; offsetX <= radius; offsetX += 1) {
632
- if (Math.hypot(offsetX, offsetY) > radius + 0.01)
633
- continue;
634
- const sampleX = clampInt(x + offsetX, 0, width - 1);
635
- const sampleY = clampInt(y + offsetY, 0, height - 1);
636
- const sampleIndex = (sampleY * width + sampleX) * 4;
637
- red += pixels[sampleIndex] ?? 0;
638
- green += pixels[sampleIndex + 1] ?? 0;
639
- blue += pixels[sampleIndex + 2] ?? 0;
640
- samples += 1;
641
- }
642
- }
643
- output[index] = clampByte(red / samples);
644
- output[index + 1] = clampByte(green / samples);
645
- output[index + 2] = clampByte(blue / samples);
646
- output[index + 3] = pixels[index + 3] ?? 255;
647
- }
648
- }
649
- return { width, height, pixels: output, blurredPixels, maxBlurRadius: maxRadius, focusDepth, focusRange };
650
- }
651
- export function volumetricLightPixels(pixels, width, height, options = {}) {
652
- validatePixelBuffer(pixels, width, height, "Volumetric light");
653
- const depth = requireDepthTextureBinding(options.depth, "Volumetric light");
654
- if (depth.width !== width || depth.height !== height) {
655
- throw new Error("Volumetric light depth texture dimensions must match source pixels.");
656
- }
657
- const lightPosition = options.lightPosition ?? [0.5, 0.18];
658
- if (lightPosition.length !== 2 || !lightPosition.every((value) => Number.isFinite(value) && value >= 0 && value <= 1)) {
659
- throw new RangeError("Volumetric light position must contain two finite normalized coordinates.");
660
- }
661
- const color = options.color ?? [1, 0.88, 0.62];
662
- if (color.length !== 3 || !color.every((value) => Number.isFinite(value) && value >= 0 && value <= 1)) {
663
- throw new RangeError("Volumetric light color must contain three finite values within [0, 1].");
664
- }
665
- const density = numberInRange(options.density ?? 0.9, 0.01, 2, "Volumetric light density");
666
- const decay = numberInRange(options.decay ?? 0.96, 0, 1, "Volumetric light decay");
667
- const weight = numberInRange(options.weight ?? 0.18, 0, 2, "Volumetric light weight");
668
- const exposure = numberInRange(options.exposure ?? 0.72, 0, 4, "Volumetric light exposure");
669
- const samples = integerNumberInRange(options.samples ?? 32, 4, 128, "Volumetric light samples");
670
- const occlusionThreshold = numberInRange(options.occlusionThreshold ?? 0.985, 0, 1, "Volumetric light occlusionThreshold");
671
- const output = new Uint8Array(pixels);
672
- const lightX = lightPosition[0] * (width - 1);
673
- const lightY = lightPosition[1] * (height - 1);
674
- let changedPixels = 0;
675
- let occludedSamples = 0;
676
- let maxScattering = 0;
677
- for (let y = 0; y < height; y += 1) {
678
- for (let x = 0; x < width; x += 1) {
679
- const deltaX = ((lightX - x) / samples) * density;
680
- const deltaY = ((lightY - y) / samples) * density;
681
- let sampleX = x;
682
- let sampleY = y;
683
- let illuminationDecay = 1;
684
- let scattering = 0;
685
- for (let sample = 0; sample < samples; sample += 1) {
686
- sampleX += deltaX;
687
- sampleY += deltaY;
688
- const sx = clampInt(Math.round(sampleX), 0, width - 1);
689
- const sy = clampInt(Math.round(sampleY), 0, height - 1);
690
- const offset = (sy * width + sx) * 4;
691
- const luminance = ((pixels[offset] ?? 0) * 0.2126 + (pixels[offset + 1] ?? 0) * 0.7152 + (pixels[offset + 2] ?? 0) * 0.0722) / 255;
692
- const source = Math.max(0, luminance - 0.42) / 0.58;
693
- const sampleDepth = depthAt(depth, sx, sy);
694
- const visible = sampleDepth >= occlusionThreshold || source > 0.05 ? 1 : 0;
695
- if (visible === 0)
696
- occludedSamples += 1;
697
- scattering += source * visible * illuminationDecay * weight;
698
- illuminationDecay *= decay;
699
- }
700
- const boost = scattering * exposure;
701
- maxScattering = Math.max(maxScattering, boost);
702
- const offset = (y * width + x) * 4;
703
- const beforeR = pixels[offset] ?? 0;
704
- const beforeG = pixels[offset + 1] ?? 0;
705
- const beforeB = pixels[offset + 2] ?? 0;
706
- // A5: ordered Bayer dither (one LSB) so smooth inscatter gradients do
707
- // not band in 8-bit output. Off by default to preserve legacy bytes.
708
- const dither = options.dither === true ? bayer2(x, y) : 0;
709
- output[offset] = clampByte(beforeR + color[0] * boost * 255 + dither);
710
- output[offset + 1] = clampByte(beforeG + color[1] * boost * 255 + dither);
711
- output[offset + 2] = clampByte(beforeB + color[2] * boost * 255 + dither);
712
- if (output[offset] !== beforeR || output[offset + 1] !== beforeG || output[offset + 2] !== beforeB) {
713
- changedPixels += 1;
714
- }
715
- }
716
- }
717
- return {
718
- width,
719
- height,
720
- pixels: output,
721
- changedPixels,
722
- occludedSamples,
723
- maxScattering: Number(maxScattering.toFixed(5)),
724
- sampleCount: samples,
725
- method: "depth-aware-radial-participating-media"
726
- };
727
- }
728
- export function motionBlurPixels(pixels, width, height, options) {
729
- validatePixelBuffer(pixels, width, height, "Motion blur");
730
- const samples = options.samples ?? 5;
731
- const scale = options.scale ?? 1;
732
- if (!Number.isInteger(samples) || samples < 2 || samples > 16) {
733
- throw new Error("Motion blur samples must be an integer in [2, 16].");
734
- }
735
- if (!Number.isFinite(scale) || scale < 0 || scale > 8) {
736
- throw new Error("Motion blur scale must be finite in [0, 8].");
737
- }
738
- if (options.velocity.length !== width * height * 2) {
739
- throw new Error("Motion blur velocity must contain width * height * 2 float samples.");
740
- }
741
- const output = new Uint8Array(pixels);
742
- let blurredPixels = 0;
743
- let maxVelocityPixels = 0;
744
- for (let y = 0; y < height; y += 1) {
745
- for (let x = 0; x < width; x += 1) {
746
- const velocityIndex = (y * width + x) * 2;
747
- const vx = (options.velocity[velocityIndex] ?? 0) * scale;
748
- const vy = (options.velocity[velocityIndex + 1] ?? 0) * scale;
749
- const velocityPixels = Math.hypot(vx, vy);
750
- maxVelocityPixels = Math.max(maxVelocityPixels, velocityPixels);
751
- if (velocityPixels < 0.01)
752
- continue;
753
- blurredPixels += 1;
754
- const index = (y * width + x) * 4;
755
- let red = 0;
756
- let green = 0;
757
- let blue = 0;
758
- for (let sample = 0; sample < samples; sample += 1) {
759
- const t = samples === 1 ? 0 : sample / (samples - 1) - 0.5;
760
- const sampleX = clampInt(Math.round(x - vx * t), 0, width - 1);
761
- const sampleY = clampInt(Math.round(y - vy * t), 0, height - 1);
762
- const sampleIndex = (sampleY * width + sampleX) * 4;
763
- red += pixels[sampleIndex] ?? 0;
764
- green += pixels[sampleIndex + 1] ?? 0;
765
- blue += pixels[sampleIndex + 2] ?? 0;
766
- }
767
- output[index] = clampByte(red / samples);
768
- output[index + 1] = clampByte(green / samples);
769
- output[index + 2] = clampByte(blue / samples);
770
- output[index + 3] = pixels[index + 3] ?? 255;
771
- }
772
- }
773
- return { width, height, pixels: output, blurredPixels, samples, maxVelocityPixels };
774
- }
775
- export function ssaoPixels(pixels, width, height, options) {
776
- validatePixelBuffer(pixels, width, height, "SSAO");
777
- const depthTexture = requireDepthTextureBinding(options.depth, "SSAO");
778
- if (depthTexture.width !== width || depthTexture.height !== height) {
779
- throw new Error("SSAO depth texture dimensions must match source pixels.");
780
- }
781
- const radius = options.radius ?? 2;
782
- const intensity = options.intensity ?? 0.38;
783
- const bias = options.bias ?? 0.015;
784
- if (!Number.isInteger(radius) || radius < 1 || radius > 8) {
785
- throw new Error("SSAO radius must be an integer in [1, 8].");
786
- }
787
- validateRange(intensity, 0, 2, "SSAO intensity");
788
- validateRange(bias, 0, 0.25, "SSAO bias");
789
- const output = new Uint8Array(pixels);
790
- let occludedPixels = 0;
791
- let occlusionTotal = 0;
792
- for (let y = 0; y < height; y += 1) {
793
- for (let x = 0; x < width; x += 1) {
794
- const centerDepth = depthAt(depthTexture, x, y);
795
- let occlusion = 0;
796
- let samples = 0;
797
- for (let offsetY = -radius; offsetY <= radius; offsetY += radius) {
798
- for (let offsetX = -radius; offsetX <= radius; offsetX += radius) {
799
- if (offsetX === 0 && offsetY === 0)
800
- continue;
801
- const sampleDepth = depthAt(depthTexture, clampInt(x + offsetX, 0, width - 1), clampInt(y + offsetY, 0, height - 1));
802
- occlusion += Math.max(0, Math.min(1, (centerDepth - sampleDepth - bias) / (0.14 + radius * 0.04)));
803
- samples += 1;
804
- }
805
- }
806
- const factor = Math.max(0.18, 1 - (occlusion / Math.max(1, samples)) * intensity * 0.72);
807
- if (factor < 0.995)
808
- occludedPixels += 1;
809
- occlusionTotal += 1 - factor;
810
- const index = (y * width + x) * 4;
811
- output[index] = clampByte((pixels[index] ?? 0) * factor);
812
- output[index + 1] = clampByte((pixels[index + 1] ?? 0) * factor);
813
- output[index + 2] = clampByte((pixels[index + 2] ?? 0) * factor);
814
- output[index + 3] = pixels[index + 3] ?? 255;
815
- }
816
- }
817
- return { width, height, pixels: output, occludedPixels, averageOcclusion: Number((occlusionTotal / (width * height)).toFixed(6)), radius, intensity };
818
- }
819
- export function contactShadowPixels(pixels, width, height, options) {
820
- validatePixelBuffer(pixels, width, height, "Contact shadow");
821
- const depthTexture = requireDepthTextureBinding(options.depth, "Contact shadow");
822
- if (depthTexture.width !== width || depthTexture.height !== height) {
823
- throw new Error("Contact shadow depth texture dimensions must match source pixels.");
824
- }
825
- const radius = options.radius ?? 4;
826
- const intensity = options.intensity ?? 0.72;
827
- const bias = options.bias ?? 0.008;
828
- const thickness = options.thickness ?? 0.12;
829
- if (!Number.isInteger(radius) || radius < 1 || radius > 16) {
830
- throw new Error("Contact shadow radius must be an integer in [1, 16].");
831
- }
832
- validateRange(intensity, 0, 2, "Contact shadow intensity");
833
- validateRange(bias, 0, 0.25, "Contact shadow bias");
834
- validateRange(thickness, 0.005, 1, "Contact shadow thickness");
835
- const direction = normalizeContactShadowDirection(options.direction ?? [0.35, 0.8]);
836
- const output = new Uint8Array(pixels);
837
- let contactPixels = 0;
838
- let darkeningTotal = 0;
839
- for (let y = 0; y < height; y += 1) {
840
- for (let x = 0; x < width; x += 1) {
841
- const receiverDepth = depthAt(depthTexture, x, y);
842
- let contact = 0;
843
- for (let step = 1; step <= radius; step += 1) {
844
- const longitudinal = step / radius;
845
- const lateralRadius = Math.max(1, Math.round(radius * 0.28 * (1 - longitudinal * 0.35)));
846
- for (let side = -lateralRadius; side <= lateralRadius; side += 1) {
847
- const offsetX = direction[0] * step + -direction[1] * side;
848
- const offsetY = direction[1] * step + direction[0] * side;
849
- const sampleX = clampInt(Math.round(x - offsetX), 0, width - 1);
850
- const sampleY = clampInt(Math.round(y - offsetY), 0, height - 1);
851
- const casterDepth = depthAt(depthTexture, sampleX, sampleY);
852
- const depthGap = receiverDepth - casterDepth - bias;
853
- if (depthGap <= 0 || depthGap > thickness)
854
- continue;
855
- const spatialFalloff = Math.max(0, 1 - longitudinal);
856
- const lateralFalloff = Math.max(0, 1 - Math.abs(side) / (lateralRadius + 1));
857
- const depthFalloff = 1 - depthGap / thickness;
858
- contact = Math.max(contact, spatialFalloff * lateralFalloff * depthFalloff);
859
- }
860
- }
861
- if (contact <= 0)
862
- continue;
863
- const shadow = Math.min(0.82, contact * intensity * 0.72);
864
- const factor = 1 - shadow;
865
- const index = (y * width + x) * 4;
866
- output[index] = clampByte((pixels[index] ?? 0) * factor);
867
- output[index + 1] = clampByte((pixels[index + 1] ?? 0) * factor);
868
- output[index + 2] = clampByte((pixels[index + 2] ?? 0) * factor);
869
- output[index + 3] = pixels[index + 3] ?? 255;
870
- contactPixels += 1;
871
- darkeningTotal += shadow;
872
- }
873
- }
874
- return {
875
- width,
876
- height,
877
- pixels: output,
878
- contactPixels,
879
- averageContactDarkening: Number((darkeningTotal / Math.max(1, contactPixels)).toFixed(6)),
880
- radius,
881
- intensity,
882
- mode: "screen-space-depth-contact"
883
- };
884
- }
885
- export function ssrPixels(pixels, width, height, options) {
886
- validatePixelBuffer(pixels, width, height, "SSR");
887
- const depthTexture = requireDepthTextureBinding(options.depth, "SSR");
888
- if (depthTexture.width !== width || depthTexture.height !== height) {
889
- throw new Error("SSR depth texture dimensions must match source pixels.");
890
- }
891
- const intensity = options.intensity ?? 0.32;
892
- const maxDistance = options.maxDistance ?? 16;
893
- validateRange(intensity, 0, 2, "SSR intensity");
894
- if (!Number.isInteger(maxDistance) || maxDistance < 1 || maxDistance > 64) {
895
- throw new Error("SSR maxDistance must be an integer in [1, 64].");
896
- }
897
- const output = new Uint8Array(pixels);
898
- let reflectedPixels = 0;
899
- let maxReflectionBoost = 0;
900
- for (let y = 0; y < height; y += 1) {
901
- for (let x = 0; x < width; x += 1) {
902
- const depth = depthAt(depthTexture, x, y);
903
- const rayDistance = Math.max(1, Math.round((1 - depth) * maxDistance));
904
- const sampleX = clampInt(x + (x < width / 2 ? rayDistance : -rayDistance), 0, width - 1);
905
- const sampleY = clampInt(height - 1 - y, 0, height - 1);
906
- const sourceIndex = (sampleY * width + sampleX) * 4;
907
- const targetIndex = (y * width + x) * 4;
908
- const sourceLuma = ((pixels[sourceIndex] ?? 0) + (pixels[sourceIndex + 1] ?? 0) + (pixels[sourceIndex + 2] ?? 0)) / (3 * 255);
909
- if (sourceLuma < 0.18 || depth > 0.92)
910
- continue;
911
- const boost = sourceLuma * intensity * (1 - depth);
912
- maxReflectionBoost = Math.max(maxReflectionBoost, boost);
913
- reflectedPixels += 1;
914
- output[targetIndex] = clampByte((pixels[targetIndex] ?? 0) + (pixels[sourceIndex] ?? 0) * boost);
915
- output[targetIndex + 1] = clampByte((pixels[targetIndex + 1] ?? 0) + (pixels[sourceIndex + 1] ?? 0) * boost);
916
- output[targetIndex + 2] = clampByte((pixels[targetIndex + 2] ?? 0) + (pixels[sourceIndex + 2] ?? 0) * boost);
917
- output[targetIndex + 3] = pixels[targetIndex + 3] ?? 255;
918
- }
919
- }
920
- return { width, height, pixels: output, reflectedPixels, maxReflectionBoost: Number(maxReflectionBoost.toFixed(6)), intensity, maxDistance };
921
- }
922
- export function taaPixels(pixels, width, height, options) {
923
- validatePixelBuffer(pixels, width, height, "TAA");
924
- if (options.history.byteLength !== pixels.byteLength) {
925
- throw new Error("TAA history must contain width * height * 4 RGBA bytes.");
926
- }
927
- const blend = options.blend ?? 0.18;
928
- validateRange(blend, 0, 0.95, "TAA blend");
929
- const output = new Uint8Array(pixels.byteLength);
930
- let blendedPixels = 0;
931
- for (let index = 0; index < pixels.length; index += 4) {
932
- output[index] = clampByte((pixels[index] ?? 0) * (1 - blend) + (options.history[index] ?? 0) * blend);
933
- output[index + 1] = clampByte((pixels[index + 1] ?? 0) * (1 - blend) + (options.history[index + 1] ?? 0) * blend);
934
- output[index + 2] = clampByte((pixels[index + 2] ?? 0) * (1 - blend) + (options.history[index + 2] ?? 0) * blend);
935
- output[index + 3] = pixels[index + 3] ?? 255;
936
- if (Math.abs(output[index] - (pixels[index] ?? 0)) + Math.abs(output[index + 1] - (pixels[index + 1] ?? 0)) + Math.abs(output[index + 2] - (pixels[index + 2] ?? 0)) > 0) {
937
- blendedPixels += 1;
938
- }
939
- }
940
- return { width, height, pixels: output, blendedPixels, blend };
941
- }
942
- export function bloomPixels(pixels, width, height, options = {}) {
943
- validatePixelBuffer(pixels, width, height, "Bloom");
944
- const threshold = options.threshold ?? 0.75;
945
- const intensity = options.intensity ?? 0.35;
946
- const radius = options.radius ?? 1;
947
- validateBloomOptions(threshold, intensity, radius);
948
- const { pixels: brightPixels, brightPixelCount, brightEnergy } = extractBloomBrightPixels(pixels, width, height, threshold);
949
- const horizontalBlurPixels = blurBloomPixelsHorizontal(brightPixels, width, height, radius);
950
- const verticalBlurPixels = blurBloomPixelsVertical(horizontalBlurPixels, width, height, radius);
951
- const composite = compositeBloomPixels(pixels, verticalBlurPixels, width, height, intensity, brightPixels);
952
- return {
953
- width,
954
- height,
955
- pixels: composite.pixels,
956
- brightPixels,
957
- horizontalBlurPixels,
958
- verticalBlurPixels,
959
- brightPixelCount,
960
- brightEnergy,
961
- maxNeighborBoost: composite.maxNeighborBoost,
962
- changedPixels: composite.changedPixels,
963
- maxChannelDelta: composite.maxChannelDelta,
964
- pipeline: ["bright-extract", "horizontal-blur", "vertical-blur", "composite"]
965
- };
966
- }
967
- export function extractBloomBrightPixels(pixels, width, height, threshold) {
968
- validatePixelBuffer(pixels, width, height, "Bloom bright extraction");
969
- if (!Number.isFinite(threshold) || threshold < 0 || threshold > 1) {
970
- throw new Error("Bloom threshold must be finite and in [0, 1].");
971
- }
972
- const brightPixels = new Uint8Array(pixels.byteLength);
973
- let brightPixelCount = 0;
974
- let brightEnergy = 0;
975
- for (let index = 0; index < pixels.length; index += 4) {
976
- const luma = (0.2126 * pixels[index] + 0.7152 * pixels[index + 1] + 0.0722 * pixels[index + 2]) / 255;
977
- if (luma >= threshold) {
978
- brightPixelCount += 1;
979
- brightEnergy += luma;
980
- brightPixels[index] = pixels[index];
981
- brightPixels[index + 1] = pixels[index + 1];
982
- brightPixels[index + 2] = pixels[index + 2];
983
- brightPixels[index + 3] = pixels[index + 3];
984
- }
985
- }
986
- return { pixels: brightPixels, brightPixelCount, brightEnergy };
987
- }
988
- export function blurBloomPixelsHorizontal(pixels, width, height, radius) {
989
- validatePixelBuffer(pixels, width, height, "Bloom horizontal blur");
990
- validateBloomBlurRadius(radius);
991
- const kernelSize = radius * 2 + 1;
992
- const output = new Uint8Array(pixels.byteLength);
993
- for (let y = 0; y < height; y += 1) {
994
- for (let x = 0; x < width; x += 1) {
995
- const targetIndex = (y * width + x) * 4;
996
- let red = 0;
997
- let green = 0;
998
- let blue = 0;
999
- let alpha = 0;
1000
- for (let offsetX = -radius; offsetX <= radius; offsetX += 1) {
1001
- const sampleX = clampInt(x + offsetX, 0, width - 1);
1002
- const sampleIndex = (y * width + sampleX) * 4;
1003
- red += pixels[sampleIndex];
1004
- green += pixels[sampleIndex + 1];
1005
- blue += pixels[sampleIndex + 2];
1006
- alpha += pixels[sampleIndex + 3];
1007
- }
1008
- output[targetIndex] = clampByte(red / kernelSize);
1009
- output[targetIndex + 1] = clampByte(green / kernelSize);
1010
- output[targetIndex + 2] = clampByte(blue / kernelSize);
1011
- output[targetIndex + 3] = clampByte(alpha / kernelSize);
1012
- }
1013
- }
1014
- return output;
1015
- }
1016
- export function blurBloomPixelsVertical(pixels, width, height, radius) {
1017
- validatePixelBuffer(pixels, width, height, "Bloom vertical blur");
1018
- validateBloomBlurRadius(radius);
1019
- const kernelSize = radius * 2 + 1;
1020
- const output = new Uint8Array(pixels.byteLength);
1021
- for (let y = 0; y < height; y += 1) {
1022
- for (let x = 0; x < width; x += 1) {
1023
- const targetIndex = (y * width + x) * 4;
1024
- let red = 0;
1025
- let green = 0;
1026
- let blue = 0;
1027
- let alpha = 0;
1028
- for (let offsetY = -radius; offsetY <= radius; offsetY += 1) {
1029
- const sampleY = clampInt(y + offsetY, 0, height - 1);
1030
- const sampleIndex = (sampleY * width + x) * 4;
1031
- red += pixels[sampleIndex];
1032
- green += pixels[sampleIndex + 1];
1033
- blue += pixels[sampleIndex + 2];
1034
- alpha += pixels[sampleIndex + 3];
1035
- }
1036
- output[targetIndex] = clampByte(red / kernelSize);
1037
- output[targetIndex + 1] = clampByte(green / kernelSize);
1038
- output[targetIndex + 2] = clampByte(blue / kernelSize);
1039
- output[targetIndex + 3] = clampByte(alpha / kernelSize);
1040
- }
1041
- }
1042
- return output;
1043
- }
1044
- export function compositeBloomPixels(sourcePixels, blurredPixels, width, height, intensity, brightPixels) {
1045
- validatePixelBuffer(sourcePixels, width, height, "Bloom composite source");
1046
- validatePixelBuffer(blurredPixels, width, height, "Bloom composite blur");
1047
- if (brightPixels)
1048
- validatePixelBuffer(brightPixels, width, height, "Bloom composite bright source");
1049
- if (!Number.isFinite(intensity) || intensity < 0) {
1050
- throw new Error("Bloom intensity must be finite and non-negative.");
1051
- }
1052
- const output = new Uint8Array(sourcePixels);
1053
- let maxNeighborBoost = 0;
1054
- let changedPixels = 0;
1055
- let maxChannelDelta = 0;
1056
- for (let index = 0; index < sourcePixels.length; index += 4) {
1057
- const previousRed = output[index];
1058
- const previousGreen = output[index + 1];
1059
- const previousBlue = output[index + 2];
1060
- const redBoost = blurredPixels[index] * intensity;
1061
- const greenBoost = blurredPixels[index + 1] * intensity;
1062
- const blueBoost = blurredPixels[index + 2] * intensity;
1063
- output[index] = clampByte(output[index] + redBoost);
1064
- output[index + 1] = clampByte(output[index + 1] + greenBoost);
1065
- output[index + 2] = clampByte(output[index + 2] + blueBoost);
1066
- output[index + 3] = sourcePixels[index + 3];
1067
- const redDelta = Math.abs(output[index] - previousRed);
1068
- const greenDelta = Math.abs(output[index + 1] - previousGreen);
1069
- const blueDelta = Math.abs(output[index + 2] - previousBlue);
1070
- const pixelDelta = Math.max(redDelta, greenDelta, blueDelta);
1071
- if (pixelDelta > 0) {
1072
- changedPixels += 1;
1073
- maxChannelDelta = Math.max(maxChannelDelta, pixelDelta);
1074
- }
1075
- if (!brightPixels || (brightPixels[index] === 0 && brightPixels[index + 1] === 0 && brightPixels[index + 2] === 0)) {
1076
- maxNeighborBoost = Math.max(maxNeighborBoost, redBoost, greenBoost, blueBoost);
1077
- }
1078
- }
1079
- return { pixels: output, maxNeighborBoost, changedPixels, maxChannelDelta };
1080
- }
1081
- export function bloomFloatPixels(pixels, width, height, options = {}) {
1082
- if (!Number.isInteger(width) || width <= 0 || !Number.isInteger(height) || height <= 0) {
1083
- throw new Error("HDR bloom dimensions must be positive integers.");
1084
- }
1085
- if (pixels.length !== width * height * 4) {
1086
- throw new Error("HDR bloom input must contain width * height * 4 RGBA float values.");
1087
- }
1088
- const threshold = options.threshold ?? 0.75;
1089
- const intensity = options.intensity ?? 0.35;
1090
- const radius = options.radius ?? 1;
1091
- validateBloomOptions(threshold, intensity, radius);
1092
- const brightPixels = new Float32Array(pixels.length);
1093
- let brightPixelCount = 0;
1094
- let brightEnergy = 0;
1095
- let maxInputValue = 0;
1096
- for (let index = 0; index < pixels.length; index += 4) {
1097
- const red = finiteHdrChannel(pixels[index], index);
1098
- const green = finiteHdrChannel(pixels[index + 1], index + 1);
1099
- const blue = finiteHdrChannel(pixels[index + 2], index + 2);
1100
- const alpha = finiteHdrChannel(pixels[index + 3], index + 3);
1101
- maxInputValue = Math.max(maxInputValue, red, green, blue);
1102
- const luma = 0.2126 * red + 0.7152 * green + 0.0722 * blue;
1103
- if (luma >= threshold) {
1104
- brightPixelCount += 1;
1105
- brightEnergy += luma;
1106
- brightPixels[index] = red;
1107
- brightPixels[index + 1] = green;
1108
- brightPixels[index + 2] = blue;
1109
- brightPixels[index + 3] = alpha;
1110
- }
1111
- }
1112
- const horizontalBlurPixels = blurBloomFloatPixelsHorizontal(brightPixels, width, height, radius);
1113
- const verticalBlurPixels = blurBloomFloatPixelsVertical(horizontalBlurPixels, width, height, radius);
1114
- const composite = compositeBloomFloatPixels(pixels, verticalBlurPixels, width, height, intensity, brightPixels);
1115
- return {
1116
- width,
1117
- height,
1118
- pixels: composite.pixels,
1119
- brightPixels,
1120
- horizontalBlurPixels,
1121
- verticalBlurPixels,
1122
- brightPixelCount,
1123
- brightEnergy: Number(brightEnergy.toFixed(6)),
1124
- maxNeighborBoost: Number(composite.maxNeighborBoost.toFixed(6)),
1125
- changedPixels: composite.changedPixels,
1126
- maxChannelDelta: Number(composite.maxChannelDelta.toFixed(6)),
1127
- maxInputValue: Number(maxInputValue.toFixed(6)),
1128
- pipeline: ["bright-extract", "horizontal-blur", "vertical-blur", "composite"]
1129
- };
1130
- }
1131
- function blurBloomFloatPixelsHorizontal(pixels, width, height, radius) {
1132
- validateFloatPixelBuffer(pixels, width, height, "HDR bloom horizontal blur");
1133
- validateBloomBlurRadius(radius);
1134
- const kernelSize = radius * 2 + 1;
1135
- const output = new Float32Array(pixels.length);
1136
- for (let y = 0; y < height; y += 1) {
1137
- for (let x = 0; x < width; x += 1) {
1138
- const targetIndex = (y * width + x) * 4;
1139
- let red = 0;
1140
- let green = 0;
1141
- let blue = 0;
1142
- let alpha = 0;
1143
- for (let offsetX = -radius; offsetX <= radius; offsetX += 1) {
1144
- const sampleX = clampInt(x + offsetX, 0, width - 1);
1145
- const sampleIndex = (y * width + sampleX) * 4;
1146
- red += finiteHdrChannel(pixels[sampleIndex], sampleIndex);
1147
- green += finiteHdrChannel(pixels[sampleIndex + 1], sampleIndex + 1);
1148
- blue += finiteHdrChannel(pixels[sampleIndex + 2], sampleIndex + 2);
1149
- alpha += finiteHdrChannel(pixels[sampleIndex + 3], sampleIndex + 3);
1150
- }
1151
- output[targetIndex] = red / kernelSize;
1152
- output[targetIndex + 1] = green / kernelSize;
1153
- output[targetIndex + 2] = blue / kernelSize;
1154
- output[targetIndex + 3] = alpha / kernelSize;
1155
- }
1156
- }
1157
- return output;
1158
- }
1159
- function blurBloomFloatPixelsVertical(pixels, width, height, radius) {
1160
- validateFloatPixelBuffer(pixels, width, height, "HDR bloom vertical blur");
1161
- validateBloomBlurRadius(radius);
1162
- const kernelSize = radius * 2 + 1;
1163
- const output = new Float32Array(pixels.length);
1164
- for (let y = 0; y < height; y += 1) {
1165
- for (let x = 0; x < width; x += 1) {
1166
- const targetIndex = (y * width + x) * 4;
1167
- let red = 0;
1168
- let green = 0;
1169
- let blue = 0;
1170
- let alpha = 0;
1171
- for (let offsetY = -radius; offsetY <= radius; offsetY += 1) {
1172
- const sampleY = clampInt(y + offsetY, 0, height - 1);
1173
- const sampleIndex = (sampleY * width + x) * 4;
1174
- red += finiteHdrChannel(pixels[sampleIndex], sampleIndex);
1175
- green += finiteHdrChannel(pixels[sampleIndex + 1], sampleIndex + 1);
1176
- blue += finiteHdrChannel(pixels[sampleIndex + 2], sampleIndex + 2);
1177
- alpha += finiteHdrChannel(pixels[sampleIndex + 3], sampleIndex + 3);
1178
- }
1179
- output[targetIndex] = red / kernelSize;
1180
- output[targetIndex + 1] = green / kernelSize;
1181
- output[targetIndex + 2] = blue / kernelSize;
1182
- output[targetIndex + 3] = alpha / kernelSize;
1183
- }
1184
- }
1185
- return output;
1186
- }
1187
- function compositeBloomFloatPixels(sourcePixels, blurredPixels, width, height, intensity, brightPixels) {
1188
- validateFloatPixelBuffer(sourcePixels, width, height, "HDR bloom composite source");
1189
- validateFloatPixelBuffer(blurredPixels, width, height, "HDR bloom composite blur");
1190
- if (brightPixels)
1191
- validateFloatPixelBuffer(brightPixels, width, height, "HDR bloom composite bright source");
1192
- if (!Number.isFinite(intensity) || intensity < 0) {
1193
- throw new Error("Bloom intensity must be finite and non-negative.");
1194
- }
1195
- const output = new Float32Array(sourcePixels);
1196
- let maxNeighborBoost = 0;
1197
- let changedPixels = 0;
1198
- let maxChannelDelta = 0;
1199
- for (let index = 0; index < sourcePixels.length; index += 4) {
1200
- const previousRed = finiteHdrChannel(output[index], index);
1201
- const previousGreen = finiteHdrChannel(output[index + 1], index + 1);
1202
- const previousBlue = finiteHdrChannel(output[index + 2], index + 2);
1203
- const redBoost = finiteHdrChannel(blurredPixels[index], index) * intensity;
1204
- const greenBoost = finiteHdrChannel(blurredPixels[index + 1], index + 1) * intensity;
1205
- const blueBoost = finiteHdrChannel(blurredPixels[index + 2], index + 2) * intensity;
1206
- output[index] = previousRed + redBoost;
1207
- output[index + 1] = previousGreen + greenBoost;
1208
- output[index + 2] = previousBlue + blueBoost;
1209
- output[index + 3] = finiteHdrChannel(output[index + 3], index + 3);
1210
- const pixelDelta = Math.max(Math.abs(output[index] - previousRed), Math.abs(output[index + 1] - previousGreen), Math.abs(output[index + 2] - previousBlue));
1211
- if (pixelDelta > 0) {
1212
- changedPixels += 1;
1213
- maxChannelDelta = Math.max(maxChannelDelta, pixelDelta);
1214
- }
1215
- if (!brightPixels || (brightPixels[index] === 0 && brightPixels[index + 1] === 0 && brightPixels[index + 2] === 0)) {
1216
- maxNeighborBoost = Math.max(maxNeighborBoost, redBoost, greenBoost, blueBoost);
1217
- }
1218
- }
1219
- return { pixels: output, maxNeighborBoost, changedPixels, maxChannelDelta };
1220
- }
1221
- export function createDepthTextureBinding(options) {
1222
- const { label, width, height } = options;
1223
- if (!label)
1224
- throw new Error("Depth texture label is required.");
1225
- if (!Number.isInteger(width) || width <= 0 || !Number.isInteger(height) || height <= 0) {
1226
- throw new Error("Depth texture dimensions must be positive integers.");
1227
- }
1228
- const data = options.data ? new Float32Array(options.data) : new Float32Array(width * height);
1229
- if (data.length !== width * height) {
1230
- throw new Error("Depth texture data must contain width * height float samples.");
1231
- }
1232
- for (const value of data) {
1233
- if (!Number.isFinite(value) || value < 0 || value > 1) {
1234
- throw new Error("Depth texture samples must be finite normalized values in [0, 1].");
1235
- }
1236
- }
1237
- return { label, width, height, format: "depth24", data };
1238
- }
1239
- export function createToneMappingCalibration(options) {
1240
- const samples = [0, 0.18, 0.5, 1].map((inputLinear) => {
1241
- const mappedLinear = applyToneMapping(inputLinear, options.exposure, options.whitePoint, options.operator);
1242
- return {
1243
- inputLinear,
1244
- mappedLinear,
1245
- encodedByte: encodeColorByte(mappedLinear, options.gamma, options.outputColorSpace)
1246
- };
1247
- });
1248
- return {
1249
- operator: options.operator,
1250
- exposure: options.exposure,
1251
- whitePoint: options.whitePoint,
1252
- gamma: options.gamma,
1253
- inputColorSpace: options.inputColorSpace,
1254
- outputColorSpace: options.outputColorSpace,
1255
- samples,
1256
- monotonic: samples.every((sample, index) => index === 0 || sample.encodedByte >= samples[index - 1].encodedByte)
1257
- };
1258
- }
1259
- export function visualizeDepthTexture(texture, options = {}) {
1260
- const edgeThreshold = options.edgeThreshold ?? 0.08;
1261
- if (!Number.isFinite(edgeThreshold) || edgeThreshold < 0 || edgeThreshold > 1) {
1262
- throw new Error("Depth visualization edgeThreshold must be finite and in [0, 1].");
1263
- }
1264
- const stats = depthTextureStats(texture, edgeThreshold);
1265
- const pixels = new Uint8Array(texture.width * texture.height * 4);
1266
- for (let y = 0; y < texture.height; y += 1) {
1267
- for (let x = 0; x < texture.width; x += 1) {
1268
- const pixelIndex = (y * texture.width + x) * 4;
1269
- const depth = depthAt(texture, x, y);
1270
- const edge = isDepthEdge(texture, x, y, edgeThreshold);
1271
- const shade = clampByte((1 - depth) * 255);
1272
- pixels[pixelIndex] = edge ? 255 : shade;
1273
- pixels[pixelIndex + 1] = edge ? 98 : shade;
1274
- pixels[pixelIndex + 2] = edge ? 36 : shade;
1275
- pixels[pixelIndex + 3] = 255;
1276
- }
1277
- }
1278
- return { width: texture.width, height: texture.height, pixels, stats };
1279
- }
1280
- export function depthTextureStats(texture, edgeThreshold = 0.08) {
1281
- if (texture.data.length !== texture.width * texture.height) {
1282
- throw new Error("Depth texture data length does not match dimensions.");
1283
- }
1284
- let minDepth = Number.POSITIVE_INFINITY;
1285
- let maxDepth = Number.NEGATIVE_INFINITY;
1286
- let edgePixelCount = 0;
1287
- for (let y = 0; y < texture.height; y += 1) {
1288
- for (let x = 0; x < texture.width; x += 1) {
1289
- const depth = depthAt(texture, x, y);
1290
- minDepth = Math.min(minDepth, depth);
1291
- maxDepth = Math.max(maxDepth, depth);
1292
- if (isDepthEdge(texture, x, y, edgeThreshold))
1293
- edgePixelCount += 1;
1294
- }
1295
- }
1296
- return {
1297
- label: texture.label,
1298
- width: texture.width,
1299
- height: texture.height,
1300
- format: texture.format,
1301
- byteLength: texture.data.byteLength,
1302
- minDepth,
1303
- maxDepth,
1304
- centerDepth: depthAt(texture, Math.floor(texture.width / 2), Math.floor(texture.height / 2)),
1305
- nearSample: depthAt(texture, Math.floor(texture.width * 0.48), Math.floor(texture.height * 0.44)),
1306
- farSample: depthAt(texture, 1, 1),
1307
- edgePixelCount
1308
- };
1309
- }
1310
- export function fxaaPixels(pixels, width, height, options = {}) {
1311
- validatePixelBuffer(pixels, width, height, "FXAA");
1312
- const edgeThreshold = options.edgeThreshold ?? 0.125;
1313
- const subpixelBlend = options.subpixelBlend ?? 0.75;
1314
- validateFXAAOptions(edgeThreshold, subpixelBlend);
1315
- const output = new Uint8Array(pixels);
1316
- const edgeMask = new Uint8Array(width * height);
1317
- for (let y = 0; y < height; y += 1) {
1318
- for (let x = 0; x < width; x += 1) {
1319
- const index = (y * width + x) * 4;
1320
- const centerLuma = lumaAt(pixels, width, height, x, y);
1321
- const northLuma = lumaAt(pixels, width, height, x, y - 1);
1322
- const southLuma = lumaAt(pixels, width, height, x, y + 1);
1323
- const westLuma = lumaAt(pixels, width, height, x - 1, y);
1324
- const eastLuma = lumaAt(pixels, width, height, x + 1, y);
1325
- const minLuma = Math.min(centerLuma, northLuma, southLuma, westLuma, eastLuma);
1326
- const maxLuma = Math.max(centerLuma, northLuma, southLuma, westLuma, eastLuma);
1327
- if (maxLuma - minLuma < edgeThreshold) {
1328
- continue;
1329
- }
1330
- edgeMask[y * width + x] = 255;
1331
- for (let channel = 0; channel < 3; channel += 1) {
1332
- const average = (channelAt(pixels, width, height, x, y - 1, channel)
1333
- + channelAt(pixels, width, height, x, y + 1, channel)
1334
- + channelAt(pixels, width, height, x - 1, y, channel)
1335
- + channelAt(pixels, width, height, x + 1, y, channel)) / 4;
1336
- output[index + channel] = clampByte(pixels[index + channel] * (1 - subpixelBlend) + average * subpixelBlend);
1337
- }
1338
- output[index + 3] = pixels[index + 3];
1339
- }
1340
- }
1341
- return { width, height, pixels: output, edgeMask };
1342
- }
1343
- export function fusedLdrPostprocessPixels(pixels, width, height, passes, options = {}) {
1344
- validatePixelBuffer(pixels, width, height, "Fused LDR postprocess");
1345
- const bloom = passes.find((pass) => pass.name === "bloom");
1346
- const toneMapping = passes.find((pass) => pass.name === "tone-mapping");
1347
- const colorGrade = passes.find((pass) => pass.name === "color-grade");
1348
- const fxaa = passes.find((pass) => pass.name === "fxaa");
1349
- const toneMappingLookup = toneMapping
1350
- ? getToneMappingLookup({
1351
- ...(options.toneMappingDefaults ?? {}),
1352
- ...toneMapping.options
1353
- }, options.scratch)
1354
- : undefined;
1355
- const colorGradeSettings = colorGrade ? normalizeColorGradeOptions(colorGrade.options) : undefined;
1356
- const byteLength = pixels.byteLength;
1357
- let current = bloom
1358
- ? bloomPixels(pixels, width, height, bloom.options).pixels
1359
- : pixels;
1360
- if (toneMappingLookup || colorGradeSettings) {
1361
- const target = options.mutateInput
1362
- ? pixels
1363
- : acquireFusedLdrBuffer(options.scratch, byteLength, 0);
1364
- const vignetteFactors = colorGradeSettings && colorGradeSettings.vignette > 0
1365
- ? getVignetteFactors(width, height, colorGradeSettings.vignette, options.scratch)
1366
- : undefined;
1367
- applyToneMappingAndColorGrade(current, target, width, height, toneMappingLookup, colorGradeSettings, vignetteFactors);
1368
- current = target;
1369
- }
1370
- if (colorGradeSettings && colorGradeSettings.sharpening > 0) {
1371
- const target = acquireFusedLdrBuffer(options.scratch, byteLength, current === options.scratch?.bufferA ? 1 : 0);
1372
- sharpenPixelsInto(current, target, width, height, colorGradeSettings.sharpening);
1373
- current = target;
1374
- }
1375
- if (fxaa) {
1376
- const settings = normalizeFXAAOptions(fxaa.options);
1377
- const target = acquireFusedLdrBuffer(options.scratch, byteLength, current === options.scratch?.bufferA ? 1 : 0);
1378
- fxaaPixelsInto(current, target, width, height, settings.edgeThreshold, settings.subpixelBlend);
1379
- current = target;
1380
- }
1381
- return current;
1382
- }
1383
- function validatePixelBuffer(pixels, width, height, label) {
1384
- if (!Number.isInteger(width) || width <= 0 || !Number.isInteger(height) || height <= 0) {
1385
- throw new Error(`${label} dimensions must be positive integers.`);
1386
- }
1387
- if (pixels.byteLength !== width * height * 4) {
1388
- throw new Error(`${label} input must contain width * height * 4 RGBA bytes.`);
1389
- }
1390
- }
1391
- function validateFloatPixelBuffer(pixels, width, height, label) {
1392
- if (!Number.isInteger(width) || width <= 0 || !Number.isInteger(height) || height <= 0) {
1393
- throw new Error(`${label} dimensions must be positive integers.`);
1394
- }
1395
- if (pixels.length !== width * height * 4) {
1396
- throw new Error(`${label} input must contain width * height * 4 RGBA float values.`);
1397
- }
1398
- }
1399
- function requireDepthTextureBinding(depth, label) {
1400
- if (!depth) {
1401
- throw new Error(`${label} requires a depth texture binding. Renderer-owned postprocess passes inject this automatically when the backend exposes depth readback.`);
1402
- }
1403
- return depth;
1404
- }
1405
- function validateFXAAOptions(edgeThreshold, subpixelBlend) {
1406
- if (!Number.isFinite(edgeThreshold) || edgeThreshold < 0 || edgeThreshold > 1) {
1407
- throw new Error("FXAA edgeThreshold must be finite and in [0, 1].");
1408
- }
1409
- if (!Number.isFinite(subpixelBlend) || subpixelBlend < 0 || subpixelBlend > 1) {
1410
- throw new Error("FXAA subpixelBlend must be finite and in [0, 1].");
1411
- }
1412
- }
1413
- function normalizeColorGradeOptions(options) {
1414
- const settings = {
1415
- contrast: options.contrast ?? 1,
1416
- temperature: options.temperature ?? 0,
1417
- tint: options.tint ?? 0,
1418
- saturation: options.saturation ?? 1,
1419
- vibrance: options.vibrance ?? 0,
1420
- vignette: options.vignette ?? 0,
1421
- sharpening: options.sharpening ?? 0
1422
- };
1423
- validateRange(settings.contrast, 0, 3, "Color grading contrast");
1424
- validateRange(settings.temperature, -1, 1, "Color grading temperature");
1425
- validateRange(settings.tint, -1, 1, "Color grading tint");
1426
- validateRange(settings.saturation, 0, 3, "Color grading saturation");
1427
- validateRange(settings.vibrance, -1, 1, "Color grading vibrance");
1428
- validateRange(settings.vignette, 0, 1, "Color grading vignette");
1429
- validateRange(settings.sharpening, 0, 2, "Color grading sharpening");
1430
- return settings;
1431
- }
1432
- function normalizeFXAAOptions(options) {
1433
- const settings = {
1434
- edgeThreshold: options.edgeThreshold ?? 0.125,
1435
- subpixelBlend: options.subpixelBlend ?? 0.75
1436
- };
1437
- validateFXAAOptions(settings.edgeThreshold, settings.subpixelBlend);
1438
- return settings;
1439
- }
1440
- function acquireFusedLdrBuffer(scratch, byteLength, slot) {
1441
- if (!scratch)
1442
- return new Uint8Array(byteLength);
1443
- if (slot === 0) {
1444
- if (!scratch.bufferA || scratch.bufferA.byteLength !== byteLength) {
1445
- scratch.bufferA = new Uint8Array(byteLength);
1446
- }
1447
- return scratch.bufferA;
1448
- }
1449
- if (!scratch.bufferB || scratch.bufferB.byteLength !== byteLength) {
1450
- scratch.bufferB = new Uint8Array(byteLength);
1451
- }
1452
- return scratch.bufferB;
1453
- }
1454
- function getToneMappingLookup(options, scratch) {
1455
- const exposure = options.exposure ?? 1;
1456
- const whitePoint = options.whitePoint ?? 1;
1457
- const gamma = options.gamma ?? 2.2;
1458
- const operator = options.operator ?? "reinhard";
1459
- const inputColorSpace = options.inputColorSpace ?? "linear";
1460
- const outputColorSpace = options.outputColorSpace ?? "linear";
1461
- if (!Number.isFinite(exposure) || exposure < 0) {
1462
- throw new Error("Tone mapping exposure must be finite and non-negative.");
1463
- }
1464
- if (!Number.isFinite(whitePoint) || whitePoint <= 0) {
1465
- throw new Error("Tone mapping whitePoint must be finite and positive.");
1466
- }
1467
- if (!Number.isFinite(gamma) || gamma <= 0) {
1468
- throw new Error("Tone mapping gamma must be finite and positive.");
1469
- }
1470
- const key = `${exposure}|${whitePoint}|${gamma}|${operator}|${inputColorSpace}|${outputColorSpace}`;
1471
- if (scratch?.toneMappingLookup && scratch.toneMappingLookupKey === key) {
1472
- return scratch.toneMappingLookup;
1473
- }
1474
- const lookup = scratch?.toneMappingLookup ?? new Uint8Array(256);
1475
- for (let value = 0; value < 256; value += 1) {
1476
- lookup[value] = encodeToneMappedChannel(decodeColorByte(value, inputColorSpace), exposure, whitePoint, gamma, operator, outputColorSpace);
1477
- }
1478
- if (scratch) {
1479
- scratch.toneMappingLookup = lookup;
1480
- scratch.toneMappingLookupKey = key;
1481
- }
1482
- return lookup;
1483
- }
1484
- function getVignetteFactors(width, height, vignette, scratch) {
1485
- const key = `${width}x${height}|${vignette}`;
1486
- if (scratch?.vignetteFactors && scratch.vignetteFactorsKey === key) {
1487
- return scratch.vignetteFactors;
1488
- }
1489
- const factors = scratch?.vignetteFactors && scratch.vignetteFactors.length === width * height
1490
- ? scratch.vignetteFactors
1491
- : new Float32Array(width * height);
1492
- for (let y = 0; y < height; y += 1) {
1493
- const centerY = height <= 1 ? 0 : (y / (height - 1)) * 2 - 1;
1494
- for (let x = 0; x < width; x += 1) {
1495
- const centerX = width <= 1 ? 0 : (x / (width - 1)) * 2 - 1;
1496
- factors[y * width + x] = 1 - vignette * Math.min(1, Math.max(0, Math.sqrt(centerX * centerX + centerY * centerY) - 0.28) / 1.12);
1497
- }
1498
- }
1499
- if (scratch) {
1500
- scratch.vignetteFactors = factors;
1501
- scratch.vignetteFactorsKey = key;
1502
- }
1503
- return factors;
1504
- }
1505
- function applyToneMappingAndColorGrade(input, output, width, height, toneMappingLookup, colorGradeSettings, vignetteFactors) {
1506
- const contrast = colorGradeSettings?.contrast ?? 1;
1507
- const contrastOffset = 0.5 - 0.5 * contrast;
1508
- const temperature = colorGradeSettings?.temperature ?? 0;
1509
- const tint = colorGradeSettings?.tint ?? 0;
1510
- const redShift = temperature * 0.08 - tint * 0.02;
1511
- const greenShift = tint * 0.06;
1512
- const blueShift = -temperature * 0.08 - tint * 0.02;
1513
- const saturationBase = colorGradeSettings?.saturation ?? 1;
1514
- const vibrance = colorGradeSettings?.vibrance ?? 0;
1515
- const applyColorGrade = colorGradeSettings !== undefined;
1516
- for (let pixel = 0, index = 0; pixel < width * height; pixel += 1, index += 4) {
1517
- const toneRed = toneMappingLookup ? toneMappingLookup[input[index]] : input[index];
1518
- const toneGreen = toneMappingLookup ? toneMappingLookup[input[index + 1]] : input[index + 1];
1519
- const toneBlue = toneMappingLookup ? toneMappingLookup[input[index + 2]] : input[index + 2];
1520
- if (!applyColorGrade) {
1521
- output[index] = toneRed;
1522
- output[index + 1] = toneGreen;
1523
- output[index + 2] = toneBlue;
1524
- output[index + 3] = input[index + 3] ?? 255;
1525
- continue;
1526
- }
1527
- let red = toneRed / 255;
1528
- let green = toneGreen / 255;
1529
- let blue = toneBlue / 255;
1530
- const luma = 0.2126 * red + 0.7152 * green + 0.0722 * blue;
1531
- red = red * contrast + contrastOffset + redShift;
1532
- green = green * contrast + contrastOffset + greenShift;
1533
- blue = blue * contrast + contrastOffset + blueShift;
1534
- const vibranceBoost = vibrance === 0
1535
- ? 0
1536
- : vibrance * (1 - Math.min(1, Math.abs(red - luma) + Math.abs(green - luma) + Math.abs(blue - luma)));
1537
- const saturation = saturationBase + vibranceBoost;
1538
- red = luma + (red - luma) * saturation;
1539
- green = luma + (green - luma) * saturation;
1540
- blue = luma + (blue - luma) * saturation;
1541
- const vignette = vignetteFactors ? vignetteFactors[pixel] : 1;
1542
- output[index] = clampByteFast(red * vignette * 255);
1543
- output[index + 1] = clampByteFast(green * vignette * 255);
1544
- output[index + 2] = clampByteFast(blue * vignette * 255);
1545
- output[index + 3] = input[index + 3] ?? 255;
1546
- }
1547
- }
1548
- function sharpenPixelsInto(input, output, width, height, amount) {
1549
- output.set(input);
1550
- const rowStride = width * 4;
1551
- for (let y = 1; y < height - 1; y += 1) {
1552
- const rowOffset = y * rowStride;
1553
- for (let x = 1; x < width - 1; x += 1) {
1554
- const index = rowOffset + x * 4;
1555
- for (let channel = 0; channel < 3; channel += 1) {
1556
- const center = input[index + channel] ?? 0;
1557
- const blur = ((input[index - 4 + channel] ?? 0) +
1558
- (input[index + 4 + channel] ?? 0) +
1559
- (input[index - rowStride + channel] ?? 0) +
1560
- (input[index + rowStride + channel] ?? 0)) / 4;
1561
- output[index + channel] = clampByteFast(center + (center - blur) * amount);
1562
- }
1563
- }
1564
- }
1565
- }
1566
- function fxaaPixelsInto(input, output, width, height, edgeThreshold, subpixelBlend) {
1567
- output.set(input);
1568
- const rowStride = width * 4;
1569
- for (let y = 0; y < height; y += 1) {
1570
- const rowOffset = y * rowStride;
1571
- const northOffset = y > 0 ? rowOffset - rowStride : rowOffset;
1572
- const southOffset = y < height - 1 ? rowOffset + rowStride : rowOffset;
1573
- for (let x = 0; x < width; x += 1) {
1574
- const index = rowOffset + x * 4;
1575
- const westIndex = x > 0 ? index - 4 : index;
1576
- const eastIndex = x < width - 1 ? index + 4 : index;
1577
- const northIndex = northOffset + x * 4;
1578
- const southIndex = southOffset + x * 4;
1579
- const centerLuma = lumaAtIndex(input, index);
1580
- const northLuma = lumaAtIndex(input, northIndex);
1581
- const southLuma = lumaAtIndex(input, southIndex);
1582
- const westLuma = lumaAtIndex(input, westIndex);
1583
- const eastLuma = lumaAtIndex(input, eastIndex);
1584
- const minLuma = Math.min(centerLuma, northLuma, southLuma, westLuma, eastLuma);
1585
- const maxLuma = Math.max(centerLuma, northLuma, southLuma, westLuma, eastLuma);
1586
- if (maxLuma - minLuma < edgeThreshold)
1587
- continue;
1588
- for (let channel = 0; channel < 3; channel += 1) {
1589
- const average = ((input[northIndex + channel] ?? 0) +
1590
- (input[southIndex + channel] ?? 0) +
1591
- (input[westIndex + channel] ?? 0) +
1592
- (input[eastIndex + channel] ?? 0)) / 4;
1593
- output[index + channel] = clampByteFast(input[index + channel] * (1 - subpixelBlend) + average * subpixelBlend);
1594
- }
1595
- output[index + 3] = input[index + 3];
1596
- }
1597
- }
1598
- }
1599
- function lumaAtIndex(pixels, index) {
1600
- return (0.2126 * pixels[index] + 0.7152 * pixels[index + 1] + 0.0722 * pixels[index + 2]) / 255;
1601
- }
1602
- function clampByteFast(value) {
1603
- if (value <= 0)
1604
- return 0;
1605
- if (value >= 255)
1606
- return 255;
1607
- return Math.round(value);
1608
- }
1609
- function validateBloomOptions(threshold, intensity, radius) {
1610
- if (!Number.isFinite(threshold) || threshold < 0 || threshold > 1) {
1611
- throw new Error("Bloom threshold must be finite and in [0, 1].");
1612
- }
1613
- if (!Number.isFinite(intensity) || intensity < 0) {
1614
- throw new Error("Bloom intensity must be finite and non-negative.");
1615
- }
1616
- validateBloomBlurRadius(radius);
1617
- }
1618
- function validateBloomBlurRadius(radius) {
1619
- if (!Number.isInteger(radius) || radius < 0 || radius > 16) {
1620
- throw new Error("Bloom radius must be an integer in [0, 16].");
1621
- }
1622
- }
1623
- function validateOutlineColor(color) {
1624
- for (let index = 0; index < color.length; index += 1) {
1625
- const channel = color[index] ?? 0;
1626
- if (!Number.isFinite(channel) || channel < 0 || channel > 255) {
1627
- throw new Error(`Outline color channel ${index} must be finite and within [0, 255].`);
1628
- }
1629
- }
1630
- }
1631
1
  /**
1632
- * Sobel response of the integer luma numerator `2126 * r + 7152 * g + 722 * b`.
1633
- *
1634
- * This is the same operator as {@link sobelLumaGradient} scaled by `OUTLINE_LUMA_SCALE`, but every
1635
- * intermediate is an exact integer: each numerator is at most `2550000`, so a response is at most
1636
- * `4 * 2550000` and the squared magnitude used by {@link outlineEdgeExceedsBound} stays below 2^48,
1637
- * well inside the range where float64 represents integers exactly.
2
+ * @deprecated The CPU post-process kernels moved to `./reference` (PRD-03
3
+ * Phase 3): the v2 chain executes them on the GPU, so they are
4
+ * reference/test code now. This shim keeps the old path compiling; import
5
+ * `@aura3d/rendering/reference` or `./reference/PostProcessPass` directly.
6
+ * Dropping the root re-export is Q-15-4.
1638
7
  */
1639
- function sobelLumaNumeratorGradient(pixels, width, height, x, y) {
1640
- const nw = lumaNumeratorAt(pixels, width, height, x - 1, y - 1);
1641
- const n = lumaNumeratorAt(pixels, width, height, x, y - 1);
1642
- const ne = lumaNumeratorAt(pixels, width, height, x + 1, y - 1);
1643
- const w = lumaNumeratorAt(pixels, width, height, x - 1, y);
1644
- const e = lumaNumeratorAt(pixels, width, height, x + 1, y);
1645
- const sw = lumaNumeratorAt(pixels, width, height, x - 1, y + 1);
1646
- const s = lumaNumeratorAt(pixels, width, height, x, y + 1);
1647
- const se = lumaNumeratorAt(pixels, width, height, x + 1, y + 1);
1648
- return {
1649
- gx: -nw - 2 * w - sw + ne + 2 * e + se,
1650
- gy: -nw - 2 * n - ne + sw + 2 * s + se
1651
- };
1652
- }
1653
- /**
1654
- * Exact outline edge predicate shared by the CPU kernel and the WebGL2 shader.
1655
- *
1656
- * Equivalent to `hypot(gx, gy) >= threshold` on the real numbers, but decided with integers so
1657
- * that it never depends on float rounding. `bound` comes from {@link createOutlineGradientBound},
1658
- * which pre-squares the threshold as an exact rational and rounds up.
1659
- */
1660
- function outlineEdgeExceedsBound(gx, gy, bound) {
1661
- return gx * gx + gy * gy >= bound;
1662
- }
1663
- function dilateMask(mask, width, height, radius) {
1664
- const output = new Uint8Array(mask.length);
1665
- for (let y = 0; y < height; y += 1) {
1666
- for (let x = 0; x < width; x += 1) {
1667
- let outlined = false;
1668
- for (let offsetY = -radius; offsetY <= radius && !outlined; offsetY += 1) {
1669
- for (let offsetX = -radius; offsetX <= radius; offsetX += 1) {
1670
- if (Math.hypot(offsetX, offsetY) > radius + 0.01)
1671
- continue;
1672
- const sampleX = clampInt(x + offsetX, 0, width - 1);
1673
- const sampleY = clampInt(y + offsetY, 0, height - 1);
1674
- if (mask[sampleY * width + sampleX] !== 0) {
1675
- outlined = true;
1676
- break;
1677
- }
1678
- }
1679
- }
1680
- if (outlined)
1681
- output[y * width + x] = 255;
1682
- }
1683
- }
1684
- return output;
1685
- }
1686
- export function writePostProcessPixels(device, source, target, pixels) {
1687
- if (!target) {
1688
- if (!device.presentRenderTarget) {
1689
- throw new RenderDeviceError("Post-process presentation requires a render device with presentRenderTarget support", "POSTPROCESS_PRESENT_UNSUPPORTED", {
1690
- source: source.label
1691
- });
1692
- }
1693
- const presentationTarget = device.createRenderTarget({
1694
- width: source.width,
1695
- height: source.height,
1696
- label: `${source.label}-postprocess-present`,
1697
- format: "rgba8",
1698
- depth: false
1699
- });
1700
- try {
1701
- if (!device.writeRenderTargetPixels) {
1702
- throw new RenderDeviceError("Post-process presentation requires a render device with writeRenderTargetPixels support", "POSTPROCESS_WRITE_UNSUPPORTED", {
1703
- source: source.label
1704
- });
1705
- }
1706
- device.writeRenderTargetPixels(presentationTarget, pixels);
1707
- device.presentRenderTarget(presentationTarget);
1708
- }
1709
- finally {
1710
- presentationTarget.dispose();
1711
- }
1712
- return;
1713
- }
1714
- if (target.width !== source.width || target.height !== source.height) {
1715
- throw new Error("Post-process source and target dimensions must match.");
1716
- }
1717
- if (device.writeRenderTargetPixels) {
1718
- device.writeRenderTargetPixels(target, pixels);
1719
- }
1720
- else {
1721
- const writable = target;
1722
- if (writable.colorPixels) {
1723
- writable.colorPixels.set(pixels);
1724
- }
1725
- else {
1726
- throw new RenderDeviceError("Post-process target does not support byte pixel writes", "POSTPROCESS_WRITE_UNSUPPORTED", {
1727
- target: target.label
1728
- });
1729
- }
1730
- }
1731
- device.setRenderTarget(target);
1732
- }
1733
- function writeDepthTarget(target, width, height, pixels) {
1734
- if (!target)
1735
- return;
1736
- if (target.width !== width || target.height !== height) {
1737
- throw new Error("Depth visualization target dimensions must match source depth texture.");
1738
- }
1739
- const writable = target;
1740
- if (writable.colorPixels) {
1741
- writable.colorPixels.set(pixels);
1742
- }
1743
- }
1744
- function writeRenderTarget(device, source, target, pixels) {
1745
- writePostProcessPixels(device, source, target, pixels);
1746
- }
1747
- function encodeToneMappedChannel(value, exposure, whitePoint, gamma, operator, outputColorSpace) {
1748
- return encodeColorByte(applyToneMapping(value, exposure, whitePoint, operator), gamma, outputColorSpace);
1749
- }
1750
- function finiteHdrChannel(value, index) {
1751
- if (!Number.isFinite(value)) {
1752
- throw new Error(`HDR tone mapping input contains non-finite float value at channel ${index}.`);
1753
- }
1754
- return Math.max(0, value);
1755
- }
1756
- function applyToneMapping(value, exposure, whitePoint, operator) {
1757
- const exposed = Math.max(0, value * exposure) / whitePoint;
1758
- return operator === "linear"
1759
- ? Math.min(1, exposed)
1760
- : operator === "reinhard"
1761
- ? exposed / (1 + exposed)
1762
- : operator === "aces"
1763
- ? aces(exposed)
1764
- : operator === "filmic"
1765
- ? filmic(exposed)
1766
- : operator === "uncharted2"
1767
- ? uncharted2(exposed)
1768
- : operator === "agx"
1769
- ? agx(exposed)
1770
- : neutral(exposed);
1771
- }
1772
- function decodeColorByte(value, colorSpace) {
1773
- const normalized = Math.max(0, Math.min(1, value / 255));
1774
- if (colorSpace === "linear")
1775
- return normalized;
1776
- if (normalized <= 0.04045)
1777
- return normalized / 12.92;
1778
- return Math.pow((normalized + 0.055) / 1.055, 2.4);
1779
- }
1780
- function encodeColorByte(value, gamma, colorSpace) {
1781
- const linear = Math.max(0, Math.min(1, value));
1782
- if (colorSpace === "linear") {
1783
- return clampByte(linear * 255);
1784
- }
1785
- const encoded = linear <= 0.0031308
1786
- ? linear * 12.92
1787
- : 1.055 * Math.pow(linear, 1 / 2.4) - 0.055;
1788
- return clampByte(encoded * 255);
1789
- }
1790
- function aces(value) {
1791
- return (value * (2.51 * value + 0.03)) / (value * (2.43 * value + 0.59) + 0.14);
1792
- }
1793
- function acesFilmicRgb(color, exposure, whitePoint) {
1794
- const scale = exposure / Math.max(0.0001, whitePoint) / 0.6;
1795
- const input = [color[0] * scale, color[1] * scale, color[2] * scale];
1796
- const aces = [
1797
- 0.59719 * input[0] + 0.35458 * input[1] + 0.04823 * input[2],
1798
- 0.07600 * input[0] + 0.90834 * input[1] + 0.01566 * input[2],
1799
- 0.02840 * input[0] + 0.13383 * input[1] + 0.83777 * input[2]
1800
- ].map(acesRrtAndOdtFit);
1801
- return [
1802
- Math.max(0, Math.min(1, 1.60475 * aces[0] - 0.53108 * aces[1] - 0.07367 * aces[2])),
1803
- Math.max(0, Math.min(1, -0.10208 * aces[0] + 1.10813 * aces[1] - 0.00605 * aces[2])),
1804
- Math.max(0, Math.min(1, -0.00327 * aces[0] - 0.07276 * aces[1] + 1.07602 * aces[2]))
1805
- ];
1806
- }
1807
- function acesRrtAndOdtFit(value) {
1808
- return (value * (value + 0.0245786) - 0.000090537) / (value * (0.983729 * value + 0.4329510) + 0.238081);
1809
- }
1810
- function filmic(value) {
1811
- const x = Math.max(0, value);
1812
- const toe = Math.max(0, x - 0.004);
1813
- const curve = (toe * (6.2 * toe + 0.5)) / (toe * (6.2 * toe + 1.7) + 0.06);
1814
- return Math.min(curve, x * 1.08);
1815
- }
1816
- function uncharted2(value) {
1817
- const a = 0.15;
1818
- const b = 0.5;
1819
- const c = 0.1;
1820
- const d = 0.2;
1821
- const e = 0.02;
1822
- const f = 0.3;
1823
- const w = 11.2;
1824
- const curve = (x) => ((x * (a * x + c * b) + d * e) / (x * (a * x + b) + d * f)) - e / f;
1825
- return Math.max(0, Math.min(1, curve(value * 2) / curve(w)));
1826
- }
1827
- function agx(value) {
1828
- const x = Math.max(0, value);
1829
- const logEncoded = Math.log2(1 + x) / Math.log2(1 + 16);
1830
- const shaped = logEncoded * logEncoded * (3 - 2 * logEncoded);
1831
- return Math.max(0, Math.min(1, shaped));
1832
- }
1833
- function neutral(value) {
1834
- const x = Math.max(0, value);
1835
- return Math.min(1, (x * (1 + x / 7.5)) / (1 + x));
1836
- }
1837
- function createToneMappingPreset(name, label, options) {
1838
- return {
1839
- name,
1840
- label,
1841
- toneMapping: {
1842
- exposure: options.exposure ?? 1,
1843
- whitePoint: options.whitePoint ?? 1,
1844
- gamma: options.gamma ?? 2.2,
1845
- operator: options.operator ?? "reinhard",
1846
- inputColorSpace: options.inputColorSpace ?? "linear",
1847
- // Display presets feed display-referred chains (public composer, parity
1848
- // probes): linear-out crushed every preset to near-black (5 buckets on
1849
- // the comprehensive fixture). Explicit overrides still win.
1850
- outputColorSpace: options.outputColorSpace ?? "srgb"
1851
- },
1852
- colorGrade: {
1853
- contrast: options.contrast ?? 1,
1854
- temperature: options.temperature ?? 0,
1855
- tint: options.tint ?? 0,
1856
- saturation: options.saturation ?? 1,
1857
- vibrance: options.vibrance ?? 0,
1858
- vignette: options.vignette ?? 0,
1859
- sharpening: options.sharpening ?? 0
1860
- },
1861
- autoExposure: options.autoExposure,
1862
- adaptationSpeed: options.adaptationSpeed ?? 0.5,
1863
- minExposure: options.minExposure ?? 0.1,
1864
- maxExposure: options.maxExposure ?? 10
1865
- };
1866
- }
1867
- function validateHistogramOptions(binCount, minLuminance, maxLuminance) {
1868
- if (!Number.isInteger(binCount) || binCount < 4 || binCount > 1024) {
1869
- throw new Error("Exposure histogram binCount must be an integer in [4, 1024].");
1870
- }
1871
- validateRange(minLuminance, 0.000001, 128, "Exposure histogram minLuminance");
1872
- validateRange(maxLuminance, minLuminance, 1024, "Exposure histogram maxLuminance");
1873
- }
1874
- function histogramAverageFromBins(histogram) {
1875
- const logMin = Math.log2(histogram.minLuminance);
1876
- const logMax = Math.log2(histogram.maxLuminance);
1877
- let weighted = 0;
1878
- let count = 0;
1879
- for (let index = 0; index < histogram.binCount; index += 1) {
1880
- const binValue = histogram.bins[index] ?? 0;
1881
- const t = histogram.binCount <= 1 ? 0 : index / (histogram.binCount - 1);
1882
- const luminance = Math.pow(2, logMin + (logMax - logMin) * t);
1883
- weighted += luminance * binValue;
1884
- count += binValue;
1885
- }
1886
- return count > 0 ? weighted / count : 0.18;
1887
- }
1888
- function noise2d(x, y, seed) {
1889
- let value = (x + 1) * 374761393 + (y + 1) * 668265263 + seed * 2147483647;
1890
- value = (value ^ (value >>> 13)) * 1274126177;
1891
- return ((value ^ (value >>> 16)) >>> 0) / 0xffffffff;
1892
- }
1893
- function sharpenPixels(pixels, width, height, amount) {
1894
- const output = new Uint8Array(pixels);
1895
- let sharpenedPixels = 0;
1896
- for (let y = 1; y < height - 1; y += 1) {
1897
- for (let x = 1; x < width - 1; x += 1) {
1898
- const index = (y * width + x) * 4;
1899
- for (let channel = 0; channel < 3; channel += 1) {
1900
- const center = pixels[index + channel] ?? 0;
1901
- const blur = ((pixels[index - 4 + channel] ?? 0) +
1902
- (pixels[index + 4 + channel] ?? 0) +
1903
- (pixels[index - width * 4 + channel] ?? 0) +
1904
- (pixels[index + width * 4 + channel] ?? 0)) / 4;
1905
- output[index + channel] = clampByte(center + (center - blur) * amount);
1906
- }
1907
- if (Math.abs(output[index] - (pixels[index] ?? 0)) + Math.abs(output[index + 1] - (pixels[index + 1] ?? 0)) + Math.abs(output[index + 2] - (pixels[index + 2] ?? 0)) > 3) {
1908
- sharpenedPixels += 1;
1909
- }
1910
- }
1911
- }
1912
- return { pixels: output, sharpenedPixels };
1913
- }
1914
- function countChangedRgb(before, after) {
1915
- let count = 0;
1916
- for (let index = 0; index < before.length; index += 4) {
1917
- if (Math.abs((before[index] ?? 0) - (after[index] ?? 0)) + Math.abs((before[index + 1] ?? 0) - (after[index + 1] ?? 0)) + Math.abs((before[index + 2] ?? 0) - (after[index + 2] ?? 0)) > 3)
1918
- count += 1;
1919
- }
1920
- return count;
1921
- }
1922
- function validateRange(value, min, max, label) {
1923
- if (!Number.isFinite(value) || value < min || value > max) {
1924
- throw new Error(`${label} must be finite and within [${min}, ${max}].`);
1925
- }
1926
- }
1927
- function numberInRange(value, min, max, label) {
1928
- validateRange(value, min, max, label);
1929
- return value;
1930
- }
1931
- function integerNumberInRange(value, min, max, label) {
1932
- validateRange(value, min, max, label);
1933
- if (!Number.isInteger(value))
1934
- throw new Error(`${label} must be an integer.`);
1935
- return value;
1936
- }
1937
- function clampByte(value) {
1938
- return Math.round(Math.max(0, Math.min(255, value)));
1939
- }
1940
- /** 2x2 Bayer ordered dither in [-0.5, 0.5]; A5 one-LSB anti-banding. */
1941
- function bayer2(x, y) {
1942
- const index = ((y & 1) << 1) | (x & 1);
1943
- return (index === 0 ? -0.375 : index === 1 ? 0.375 : index === 2 ? -0.125 : 0.125);
1944
- }
1945
- function clampInt(value, min, max) {
1946
- return Math.min(max, Math.max(min, value));
1947
- }
1948
- function lumaAt(pixels, width, height, x, y) {
1949
- const sampleX = clampInt(x, 0, width - 1);
1950
- const sampleY = clampInt(y, 0, height - 1);
1951
- const index = (sampleY * width + sampleX) * 4;
1952
- return (0.2126 * pixels[index] + 0.7152 * pixels[index + 1] + 0.0722 * pixels[index + 2]) / 255;
1953
- }
1954
- /** Integer luma numerator at a clamped coordinate, matching the outline shader exactly. */
1955
- function lumaNumeratorAt(pixels, width, height, x, y) {
1956
- const sampleX = clampInt(x, 0, width - 1);
1957
- const sampleY = clampInt(y, 0, height - 1);
1958
- const index = (sampleY * width + sampleX) * 4;
1959
- return 2126 * pixels[index] + 7152 * pixels[index + 1] + 722 * pixels[index + 2];
1960
- }
1961
- function channelAt(pixels, width, height, x, y, channel) {
1962
- const sampleX = clampInt(x, 0, width - 1);
1963
- const sampleY = clampInt(y, 0, height - 1);
1964
- return pixels[(sampleY * width + sampleX) * 4 + channel];
1965
- }
1966
- function normalizeContactShadowDirection(direction) {
1967
- const [x, y] = direction;
1968
- if (!Number.isFinite(x) || !Number.isFinite(y)) {
1969
- throw new Error("Contact shadow direction must contain finite x/y values.");
1970
- }
1971
- const length = Math.hypot(x, y);
1972
- if (length < 0.0001) {
1973
- throw new Error("Contact shadow direction must not be zero length.");
1974
- }
1975
- return [x / length, y / length];
1976
- }
1977
- function depthAt(texture, x, y) {
1978
- const sampleX = clampInt(x, 0, texture.width - 1);
1979
- const sampleY = clampInt(y, 0, texture.height - 1);
1980
- return texture.data[sampleY * texture.width + sampleX];
1981
- }
1982
- function isDepthEdge(texture, x, y, edgeThreshold) {
1983
- const center = depthAt(texture, x, y);
1984
- const delta = Math.max(Math.abs(center - depthAt(texture, x + 1, y)), Math.abs(center - depthAt(texture, x - 1, y)), Math.abs(center - depthAt(texture, x, y + 1)), Math.abs(center - depthAt(texture, x, y - 1)));
1985
- return delta >= edgeThreshold;
1986
- }
8
+ export * from "./reference/PostProcessPass.js";
1987
9
  //# sourceMappingURL=PostProcessPass.js.map