@aura3d/rendering 1.0.6

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 (1433) hide show
  1. package/README.md +18 -0
  2. package/dist/ArchitecturalLightingFixtures.d.ts +40 -0
  3. package/dist/ArchitecturalLightingFixtures.d.ts.map +1 -0
  4. package/dist/ArchitecturalLightingFixtures.js +171 -0
  5. package/dist/ArchitecturalLightingFixtures.js.map +1 -0
  6. package/dist/ArchitecturalMaterialCatalog.d.ts +30 -0
  7. package/dist/ArchitecturalMaterialCatalog.d.ts.map +1 -0
  8. package/dist/ArchitecturalMaterialCatalog.js +90 -0
  9. package/dist/ArchitecturalMaterialCatalog.js.map +1 -0
  10. package/dist/ArchitecturalMeasurementFixtures.d.ts +30 -0
  11. package/dist/ArchitecturalMeasurementFixtures.d.ts.map +1 -0
  12. package/dist/ArchitecturalMeasurementFixtures.js +115 -0
  13. package/dist/ArchitecturalMeasurementFixtures.js.map +1 -0
  14. package/dist/BRDFLut.d.ts +13 -0
  15. package/dist/BRDFLut.d.ts.map +1 -0
  16. package/dist/BRDFLut.js +34 -0
  17. package/dist/BRDFLut.js.map +1 -0
  18. package/dist/CameraFraming.d.ts +31 -0
  19. package/dist/CameraFraming.d.ts.map +1 -0
  20. package/dist/CameraFraming.js +143 -0
  21. package/dist/CameraFraming.js.map +1 -0
  22. package/dist/CanonicalSceneFixtures.d.ts +13 -0
  23. package/dist/CanonicalSceneFixtures.d.ts.map +1 -0
  24. package/dist/CanonicalSceneFixtures.js +78 -0
  25. package/dist/CanonicalSceneFixtures.js.map +1 -0
  26. package/dist/CascadedShadowMaps.d.ts +121 -0
  27. package/dist/CascadedShadowMaps.d.ts.map +1 -0
  28. package/dist/CascadedShadowMaps.js +315 -0
  29. package/dist/CascadedShadowMaps.js.map +1 -0
  30. package/dist/ColorManagement.d.ts +33 -0
  31. package/dist/ColorManagement.d.ts.map +1 -0
  32. package/dist/ColorManagement.js +71 -0
  33. package/dist/ColorManagement.js.map +1 -0
  34. package/dist/CullingFixtures.d.ts +70 -0
  35. package/dist/CullingFixtures.d.ts.map +1 -0
  36. package/dist/CullingFixtures.js +191 -0
  37. package/dist/CullingFixtures.js.map +1 -0
  38. package/dist/DecalGeometry.d.ts +3 -0
  39. package/dist/DecalGeometry.d.ts.map +1 -0
  40. package/dist/DecalGeometry.js +2 -0
  41. package/dist/DecalGeometry.js.map +1 -0
  42. package/dist/DepthPass.d.ts +23 -0
  43. package/dist/DepthPass.d.ts.map +1 -0
  44. package/dist/DepthPass.js +99 -0
  45. package/dist/DepthPass.js.map +1 -0
  46. package/dist/EnvironmentBackgroundPass.d.ts +27 -0
  47. package/dist/EnvironmentBackgroundPass.d.ts.map +1 -0
  48. package/dist/EnvironmentBackgroundPass.js +167 -0
  49. package/dist/EnvironmentBackgroundPass.js.map +1 -0
  50. package/dist/EnvironmentBackgroundResources.d.ts +31 -0
  51. package/dist/EnvironmentBackgroundResources.d.ts.map +1 -0
  52. package/dist/EnvironmentBackgroundResources.js +237 -0
  53. package/dist/EnvironmentBackgroundResources.js.map +1 -0
  54. package/dist/EnvironmentLighting.d.ts +10 -0
  55. package/dist/EnvironmentLighting.d.ts.map +1 -0
  56. package/dist/EnvironmentLighting.js +64 -0
  57. package/dist/EnvironmentLighting.js.map +1 -0
  58. package/dist/EnvironmentMapResources.d.ts +98 -0
  59. package/dist/EnvironmentMapResources.d.ts.map +1 -0
  60. package/dist/EnvironmentMapResources.js +794 -0
  61. package/dist/EnvironmentMapResources.js.map +1 -0
  62. package/dist/EnvironmentPipeline.d.ts +21 -0
  63. package/dist/EnvironmentPipeline.d.ts.map +1 -0
  64. package/dist/EnvironmentPipeline.js +43 -0
  65. package/dist/EnvironmentPipeline.js.map +1 -0
  66. package/dist/EnvironmentPlatform.d.ts +185 -0
  67. package/dist/EnvironmentPlatform.d.ts.map +1 -0
  68. package/dist/EnvironmentPlatform.js +922 -0
  69. package/dist/EnvironmentPlatform.js.map +1 -0
  70. package/dist/EnvironmentPreset.d.ts +35 -0
  71. package/dist/EnvironmentPreset.d.ts.map +1 -0
  72. package/dist/EnvironmentPreset.js +96 -0
  73. package/dist/EnvironmentPreset.js.map +1 -0
  74. package/dist/Exposure.d.ts +19 -0
  75. package/dist/Exposure.d.ts.map +1 -0
  76. package/dist/Exposure.js +34 -0
  77. package/dist/Exposure.js.map +1 -0
  78. package/dist/ExternalParityRenderPreset.d.ts +149 -0
  79. package/dist/ExternalParityRenderPreset.d.ts.map +1 -0
  80. package/dist/ExternalParityRenderPreset.js +519 -0
  81. package/dist/ExternalParityRenderPreset.js.map +1 -0
  82. package/dist/ForwardPass.d.ts +122 -0
  83. package/dist/ForwardPass.d.ts.map +1 -0
  84. package/dist/ForwardPass.js +1352 -0
  85. package/dist/ForwardPass.js.map +1 -0
  86. package/dist/FrameVisualMetrics.d.ts +60 -0
  87. package/dist/FrameVisualMetrics.d.ts.map +1 -0
  88. package/dist/FrameVisualMetrics.js +146 -0
  89. package/dist/FrameVisualMetrics.js.map +1 -0
  90. package/dist/Geometry.d.ts +50 -0
  91. package/dist/Geometry.d.ts.map +1 -0
  92. package/dist/Geometry.js +385 -0
  93. package/dist/Geometry.js.map +1 -0
  94. package/dist/GeometryPrimitives.d.ts +3 -0
  95. package/dist/GeometryPrimitives.d.ts.map +1 -0
  96. package/dist/GeometryPrimitives.js +2 -0
  97. package/dist/GeometryPrimitives.js.map +1 -0
  98. package/dist/HDRRenderPipeline.d.ts +27 -0
  99. package/dist/HDRRenderPipeline.d.ts.map +1 -0
  100. package/dist/HDRRenderPipeline.js +67 -0
  101. package/dist/HDRRenderPipeline.js.map +1 -0
  102. package/dist/IBL.d.ts +37 -0
  103. package/dist/IBL.d.ts.map +1 -0
  104. package/dist/IBL.js +48 -0
  105. package/dist/IBL.js.map +1 -0
  106. package/dist/IndexBuffer.d.ts +15 -0
  107. package/dist/IndexBuffer.d.ts.map +1 -0
  108. package/dist/IndexBuffer.js +51 -0
  109. package/dist/IndexBuffer.js.map +1 -0
  110. package/dist/InstancedPBRMaterial.d.ts +33 -0
  111. package/dist/InstancedPBRMaterial.d.ts.map +1 -0
  112. package/dist/InstancedPBRMaterial.js +147 -0
  113. package/dist/InstancedPBRMaterial.js.map +1 -0
  114. package/dist/InstancedUnlitMaterial.d.ts +11 -0
  115. package/dist/InstancedUnlitMaterial.d.ts.map +1 -0
  116. package/dist/InstancedUnlitMaterial.js +50 -0
  117. package/dist/InstancedUnlitMaterial.js.map +1 -0
  118. package/dist/Instancing.d.ts +7 -0
  119. package/dist/Instancing.d.ts.map +1 -0
  120. package/dist/Instancing.js +14 -0
  121. package/dist/Instancing.js.map +1 -0
  122. package/dist/LightCollector.d.ts +24 -0
  123. package/dist/LightCollector.d.ts.map +1 -0
  124. package/dist/LightCollector.js +56 -0
  125. package/dist/LightCollector.js.map +1 -0
  126. package/dist/LightUniforms.d.ts +14 -0
  127. package/dist/LightUniforms.d.ts.map +1 -0
  128. package/dist/LightUniforms.js +37 -0
  129. package/dist/LightUniforms.js.map +1 -0
  130. package/dist/LightingDebug.d.ts +13 -0
  131. package/dist/LightingDebug.d.ts.map +1 -0
  132. package/dist/LightingDebug.js +69 -0
  133. package/dist/LightingDebug.js.map +1 -0
  134. package/dist/LightingDefaults.d.ts +13 -0
  135. package/dist/LightingDefaults.d.ts.map +1 -0
  136. package/dist/LightingDefaults.js +64 -0
  137. package/dist/LightingDefaults.js.map +1 -0
  138. package/dist/LightingRig.d.ts +53 -0
  139. package/dist/LightingRig.d.ts.map +1 -0
  140. package/dist/LightingRig.js +197 -0
  141. package/dist/LightingRig.js.map +1 -0
  142. package/dist/LineGeometry.d.ts +3 -0
  143. package/dist/LineGeometry.d.ts.map +1 -0
  144. package/dist/LineGeometry.js +2 -0
  145. package/dist/LineGeometry.js.map +1 -0
  146. package/dist/Material.d.ts +77 -0
  147. package/dist/Material.d.ts.map +1 -0
  148. package/dist/Material.js +137 -0
  149. package/dist/Material.js.map +1 -0
  150. package/dist/MaterialBinding.d.ts +17 -0
  151. package/dist/MaterialBinding.d.ts.map +1 -0
  152. package/dist/MaterialBinding.js +119 -0
  153. package/dist/MaterialBinding.js.map +1 -0
  154. package/dist/MaterialInstance.d.ts +16 -0
  155. package/dist/MaterialInstance.d.ts.map +1 -0
  156. package/dist/MaterialInstance.js +53 -0
  157. package/dist/MaterialInstance.js.map +1 -0
  158. package/dist/MaterialPresets.d.ts +31 -0
  159. package/dist/MaterialPresets.d.ts.map +1 -0
  160. package/dist/MaterialPresets.js +219 -0
  161. package/dist/MaterialPresets.js.map +1 -0
  162. package/dist/MorphTarget.d.ts +10 -0
  163. package/dist/MorphTarget.d.ts.map +1 -0
  164. package/dist/MorphTarget.js +101 -0
  165. package/dist/MorphTarget.js.map +1 -0
  166. package/dist/MorphUnlitMaterial.d.ts +11 -0
  167. package/dist/MorphUnlitMaterial.d.ts.map +1 -0
  168. package/dist/MorphUnlitMaterial.js +45 -0
  169. package/dist/MorphUnlitMaterial.js.map +1 -0
  170. package/dist/NormalMappedPBRMaterial.d.ts +37 -0
  171. package/dist/NormalMappedPBRMaterial.d.ts.map +1 -0
  172. package/dist/NormalMappedPBRMaterial.js +148 -0
  173. package/dist/NormalMappedPBRMaterial.js.map +1 -0
  174. package/dist/OceanFixtures.d.ts +62 -0
  175. package/dist/OceanFixtures.d.ts.map +1 -0
  176. package/dist/OceanFixtures.js +240 -0
  177. package/dist/OceanFixtures.js.map +1 -0
  178. package/dist/PBRLightingDefaults.d.ts +4 -0
  179. package/dist/PBRLightingDefaults.d.ts.map +1 -0
  180. package/dist/PBRLightingDefaults.js +10 -0
  181. package/dist/PBRLightingDefaults.js.map +1 -0
  182. package/dist/PBRMaterial.d.ts +84 -0
  183. package/dist/PBRMaterial.d.ts.map +1 -0
  184. package/dist/PBRMaterial.js +349 -0
  185. package/dist/PBRMaterial.js.map +1 -0
  186. package/dist/PMREM.d.ts +26 -0
  187. package/dist/PMREM.d.ts.map +1 -0
  188. package/dist/PMREM.js +26 -0
  189. package/dist/PMREM.js.map +1 -0
  190. package/dist/PbrReference.d.ts +153 -0
  191. package/dist/PbrReference.d.ts.map +1 -0
  192. package/dist/PbrReference.js +500 -0
  193. package/dist/PbrReference.js.map +1 -0
  194. package/dist/PostProcessPass.d.ts +439 -0
  195. package/dist/PostProcessPass.d.ts.map +1 -0
  196. package/dist/PostProcessPass.js +1834 -0
  197. package/dist/PostProcessPass.js.map +1 -0
  198. package/dist/ProceduralTextureFixtures.d.ts +27 -0
  199. package/dist/ProceduralTextureFixtures.d.ts.map +1 -0
  200. package/dist/ProceduralTextureFixtures.js +336 -0
  201. package/dist/ProceduralTextureFixtures.js.map +1 -0
  202. package/dist/ProductTurntableFixtures.d.ts +96 -0
  203. package/dist/ProductTurntableFixtures.d.ts.map +1 -0
  204. package/dist/ProductTurntableFixtures.js +559 -0
  205. package/dist/ProductTurntableFixtures.js.map +1 -0
  206. package/dist/Raycaster.d.ts +14 -0
  207. package/dist/Raycaster.d.ts.map +1 -0
  208. package/dist/Raycaster.js +10 -0
  209. package/dist/Raycaster.js.map +1 -0
  210. package/dist/ReflectionProbe.d.ts +8 -0
  211. package/dist/ReflectionProbe.d.ts.map +1 -0
  212. package/dist/ReflectionProbe.js +10 -0
  213. package/dist/ReflectionProbe.js.map +1 -0
  214. package/dist/ReflectionSurfaces.d.ts +35 -0
  215. package/dist/ReflectionSurfaces.d.ts.map +1 -0
  216. package/dist/ReflectionSurfaces.js +155 -0
  217. package/dist/ReflectionSurfaces.js.map +1 -0
  218. package/dist/RenderBackend.d.ts +14 -0
  219. package/dist/RenderBackend.d.ts.map +1 -0
  220. package/dist/RenderBackend.js +33 -0
  221. package/dist/RenderBackend.js.map +1 -0
  222. package/dist/RenderDebugViews.d.ts +26 -0
  223. package/dist/RenderDebugViews.d.ts.map +1 -0
  224. package/dist/RenderDebugViews.js +97 -0
  225. package/dist/RenderDebugViews.js.map +1 -0
  226. package/dist/RenderDevice.d.ts +280 -0
  227. package/dist/RenderDevice.d.ts.map +1 -0
  228. package/dist/RenderDevice.js +561 -0
  229. package/dist/RenderDevice.js.map +1 -0
  230. package/dist/RenderGraph.d.ts +22 -0
  231. package/dist/RenderGraph.d.ts.map +1 -0
  232. package/dist/RenderGraph.js +159 -0
  233. package/dist/RenderGraph.js.map +1 -0
  234. package/dist/RenderPass.d.ts +23 -0
  235. package/dist/RenderPass.d.ts.map +1 -0
  236. package/dist/RenderPass.js +14 -0
  237. package/dist/RenderPass.js.map +1 -0
  238. package/dist/RenderPipeline.d.ts +39 -0
  239. package/dist/RenderPipeline.d.ts.map +1 -0
  240. package/dist/RenderPipeline.js +67 -0
  241. package/dist/RenderPipeline.js.map +1 -0
  242. package/dist/RenderQueue.d.ts +3 -0
  243. package/dist/RenderQueue.d.ts.map +1 -0
  244. package/dist/RenderQueue.js +2 -0
  245. package/dist/RenderQueue.js.map +1 -0
  246. package/dist/RenderState.d.ts +3 -0
  247. package/dist/RenderState.d.ts.map +1 -0
  248. package/dist/RenderState.js +2 -0
  249. package/dist/RenderState.js.map +1 -0
  250. package/dist/Renderer.d.ts +265 -0
  251. package/dist/Renderer.d.ts.map +1 -0
  252. package/dist/Renderer.js +2094 -0
  253. package/dist/Renderer.js.map +1 -0
  254. package/dist/RendererDebugOverlay.d.ts +20 -0
  255. package/dist/RendererDebugOverlay.d.ts.map +1 -0
  256. package/dist/RendererDebugOverlay.js +54 -0
  257. package/dist/RendererDebugOverlay.js.map +1 -0
  258. package/dist/RendererFeatureGates.d.ts +17 -0
  259. package/dist/RendererFeatureGates.d.ts.map +1 -0
  260. package/dist/RendererFeatureGates.js +92 -0
  261. package/dist/RendererFeatureGates.js.map +1 -0
  262. package/dist/RendererPostprocessPlan.d.ts +59 -0
  263. package/dist/RendererPostprocessPlan.d.ts.map +1 -0
  264. package/dist/RendererPostprocessPlan.js +155 -0
  265. package/dist/RendererPostprocessPlan.js.map +1 -0
  266. package/dist/RendererTiming.d.ts +53 -0
  267. package/dist/RendererTiming.d.ts.map +1 -0
  268. package/dist/RendererTiming.js +186 -0
  269. package/dist/RendererTiming.js.map +1 -0
  270. package/dist/RendererVisualPipelineReport.d.ts +224 -0
  271. package/dist/RendererVisualPipelineReport.d.ts.map +1 -0
  272. package/dist/RendererVisualPipelineReport.js +499 -0
  273. package/dist/RendererVisualPipelineReport.js.map +1 -0
  274. package/dist/ResourceLifecycle.d.ts +8 -0
  275. package/dist/ResourceLifecycle.d.ts.map +1 -0
  276. package/dist/ResourceLifecycle.js +18 -0
  277. package/dist/ResourceLifecycle.js.map +1 -0
  278. package/dist/Sampler.d.ts +20 -0
  279. package/dist/Sampler.d.ts.map +1 -0
  280. package/dist/Sampler.js +19 -0
  281. package/dist/Sampler.js.map +1 -0
  282. package/dist/SceneOptimization.d.ts +127 -0
  283. package/dist/SceneOptimization.d.ts.map +1 -0
  284. package/dist/SceneOptimization.js +342 -0
  285. package/dist/SceneOptimization.js.map +1 -0
  286. package/dist/ShaderChunks.d.ts +8 -0
  287. package/dist/ShaderChunks.d.ts.map +1 -0
  288. package/dist/ShaderChunks.js +386 -0
  289. package/dist/ShaderChunks.js.map +1 -0
  290. package/dist/ShaderLibrary.d.ts +63 -0
  291. package/dist/ShaderLibrary.d.ts.map +1 -0
  292. package/dist/ShaderLibrary.js +2707 -0
  293. package/dist/ShaderLibrary.js.map +1 -0
  294. package/dist/ShaderModule.d.ts +14 -0
  295. package/dist/ShaderModule.d.ts.map +1 -0
  296. package/dist/ShaderModule.js +33 -0
  297. package/dist/ShaderModule.js.map +1 -0
  298. package/dist/ShaderPreprocessor.d.ts +19 -0
  299. package/dist/ShaderPreprocessor.d.ts.map +1 -0
  300. package/dist/ShaderPreprocessor.js +212 -0
  301. package/dist/ShaderPreprocessor.js.map +1 -0
  302. package/dist/ShaderReflection.d.ts +23 -0
  303. package/dist/ShaderReflection.d.ts.map +1 -0
  304. package/dist/ShaderReflection.js +134 -0
  305. package/dist/ShaderReflection.js.map +1 -0
  306. package/dist/ShadowMap.d.ts +58 -0
  307. package/dist/ShadowMap.d.ts.map +1 -0
  308. package/dist/ShadowMap.js +183 -0
  309. package/dist/ShadowMap.js.map +1 -0
  310. package/dist/ShadowPass.d.ts +44 -0
  311. package/dist/ShadowPass.d.ts.map +1 -0
  312. package/dist/ShadowPass.js +162 -0
  313. package/dist/ShadowPass.js.map +1 -0
  314. package/dist/ShadowProjection.d.ts +15 -0
  315. package/dist/ShadowProjection.d.ts.map +1 -0
  316. package/dist/ShadowProjection.js +90 -0
  317. package/dist/ShadowProjection.js.map +1 -0
  318. package/dist/SkinnedLitMaterial.d.ts +63 -0
  319. package/dist/SkinnedLitMaterial.d.ts.map +1 -0
  320. package/dist/SkinnedLitMaterial.js +296 -0
  321. package/dist/SkinnedLitMaterial.js.map +1 -0
  322. package/dist/SkinnedUnlitMaterial.d.ts +13 -0
  323. package/dist/SkinnedUnlitMaterial.d.ts.map +1 -0
  324. package/dist/SkinnedUnlitMaterial.js +52 -0
  325. package/dist/SkinnedUnlitMaterial.js.map +1 -0
  326. package/dist/SkinningBounds.d.ts +10 -0
  327. package/dist/SkinningBounds.d.ts.map +1 -0
  328. package/dist/SkinningBounds.js +107 -0
  329. package/dist/SkinningBounds.js.map +1 -0
  330. package/dist/SpaceEnvironmentFixtures.d.ts +59 -0
  331. package/dist/SpaceEnvironmentFixtures.d.ts.map +1 -0
  332. package/dist/SpaceEnvironmentFixtures.js +132 -0
  333. package/dist/SpaceEnvironmentFixtures.js.map +1 -0
  334. package/dist/SpriteGeometry.d.ts +3 -0
  335. package/dist/SpriteGeometry.d.ts.map +1 -0
  336. package/dist/SpriteGeometry.js +21 -0
  337. package/dist/SpriteGeometry.js.map +1 -0
  338. package/dist/StereoCameraRig.d.ts +34 -0
  339. package/dist/StereoCameraRig.d.ts.map +1 -0
  340. package/dist/StereoCameraRig.js +79 -0
  341. package/dist/StereoCameraRig.js.map +1 -0
  342. package/dist/StereoEffects.d.ts +90 -0
  343. package/dist/StereoEffects.d.ts.map +1 -0
  344. package/dist/StereoEffects.js +171 -0
  345. package/dist/StereoEffects.js.map +1 -0
  346. package/dist/TerrainFixtures.d.ts +36 -0
  347. package/dist/TerrainFixtures.d.ts.map +1 -0
  348. package/dist/TerrainFixtures.js +143 -0
  349. package/dist/TerrainFixtures.js.map +1 -0
  350. package/dist/Texture.d.ts +64 -0
  351. package/dist/Texture.d.ts.map +1 -0
  352. package/dist/Texture.js +257 -0
  353. package/dist/Texture.js.map +1 -0
  354. package/dist/TextureBinding.d.ts +38 -0
  355. package/dist/TextureBinding.d.ts.map +1 -0
  356. package/dist/TextureBinding.js +66 -0
  357. package/dist/TextureBinding.js.map +1 -0
  358. package/dist/TexturedPBRMaterial.d.ts +206 -0
  359. package/dist/TexturedPBRMaterial.d.ts.map +1 -0
  360. package/dist/TexturedPBRMaterial.js +842 -0
  361. package/dist/TexturedPBRMaterial.js.map +1 -0
  362. package/dist/TexturedUnlitMaterial.d.ts +19 -0
  363. package/dist/TexturedUnlitMaterial.d.ts.map +1 -0
  364. package/dist/TexturedUnlitMaterial.js +52 -0
  365. package/dist/TexturedUnlitMaterial.js.map +1 -0
  366. package/dist/ToneMapping.d.ts +19 -0
  367. package/dist/ToneMapping.d.ts.map +1 -0
  368. package/dist/ToneMapping.js +53 -0
  369. package/dist/ToneMapping.js.map +1 -0
  370. package/dist/UniformBinder.d.ts +7 -0
  371. package/dist/UniformBinder.d.ts.map +1 -0
  372. package/dist/UniformBinder.js +14 -0
  373. package/dist/UniformBinder.js.map +1 -0
  374. package/dist/UniformLayout.d.ts +19 -0
  375. package/dist/UniformLayout.d.ts.map +1 -0
  376. package/dist/UniformLayout.js +107 -0
  377. package/dist/UniformLayout.js.map +1 -0
  378. package/dist/UnlitMaterial.d.ts +16 -0
  379. package/dist/UnlitMaterial.d.ts.map +1 -0
  380. package/dist/UnlitMaterial.js +60 -0
  381. package/dist/UnlitMaterial.js.map +1 -0
  382. package/dist/VegetationFixtures.d.ts +68 -0
  383. package/dist/VegetationFixtures.d.ts.map +1 -0
  384. package/dist/VegetationFixtures.js +241 -0
  385. package/dist/VegetationFixtures.js.map +1 -0
  386. package/dist/VertexBuffer.d.ts +29 -0
  387. package/dist/VertexBuffer.d.ts.map +1 -0
  388. package/dist/VertexBuffer.js +106 -0
  389. package/dist/VertexBuffer.js.map +1 -0
  390. package/dist/VertexFormat.d.ts +36 -0
  391. package/dist/VertexFormat.d.ts.map +1 -0
  392. package/dist/VertexFormat.js +127 -0
  393. package/dist/VertexFormat.js.map +1 -0
  394. package/dist/VoxelWorldFixtures.d.ts +54 -0
  395. package/dist/VoxelWorldFixtures.d.ts.map +1 -0
  396. package/dist/VoxelWorldFixtures.js +186 -0
  397. package/dist/VoxelWorldFixtures.js.map +1 -0
  398. package/dist/WeatherFixtures.d.ts +46 -0
  399. package/dist/WeatherFixtures.d.ts.map +1 -0
  400. package/dist/WeatherFixtures.js +142 -0
  401. package/dist/WeatherFixtures.js.map +1 -0
  402. package/dist/WebGL2Device.d.ts +137 -0
  403. package/dist/WebGL2Device.d.ts.map +1 -0
  404. package/dist/WebGL2Device.js +2107 -0
  405. package/dist/WebGL2Device.js.map +1 -0
  406. package/dist/WebGL2StateCache.d.ts +89 -0
  407. package/dist/WebGL2StateCache.d.ts.map +1 -0
  408. package/dist/WebGL2StateCache.js +265 -0
  409. package/dist/WebGL2StateCache.js.map +1 -0
  410. package/dist/WebGPUDevice.d.ts +287 -0
  411. package/dist/WebGPUDevice.d.ts.map +1 -0
  412. package/dist/WebGPUDevice.js +2403 -0
  413. package/dist/WebGPUDevice.js.map +1 -0
  414. package/dist/WebGPURenderToTextureProof.d.ts +29 -0
  415. package/dist/WebGPURenderToTextureProof.d.ts.map +1 -0
  416. package/dist/WebGPURenderToTextureProof.js +96 -0
  417. package/dist/WebGPURenderToTextureProof.js.map +1 -0
  418. package/dist/advanced-runtime/AdvancedRenderer.d.ts +23 -0
  419. package/dist/advanced-runtime/AdvancedRenderer.d.ts.map +1 -0
  420. package/dist/advanced-runtime/AdvancedRenderer.js +45 -0
  421. package/dist/advanced-runtime/AdvancedRenderer.js.map +1 -0
  422. package/dist/advanced-runtime/index.d.ts +10 -0
  423. package/dist/advanced-runtime/index.d.ts.map +1 -0
  424. package/dist/advanced-runtime/index.js +9 -0
  425. package/dist/advanced-runtime/index.js.map +1 -0
  426. package/dist/cinematic/BloomPass.d.ts +10 -0
  427. package/dist/cinematic/BloomPass.d.ts.map +1 -0
  428. package/dist/cinematic/BloomPass.js +18 -0
  429. package/dist/cinematic/BloomPass.js.map +1 -0
  430. package/dist/cinematic/CinematicDepthComposition.d.ts +12 -0
  431. package/dist/cinematic/CinematicDepthComposition.d.ts.map +1 -0
  432. package/dist/cinematic/CinematicDepthComposition.js +22 -0
  433. package/dist/cinematic/CinematicDepthComposition.js.map +1 -0
  434. package/dist/cinematic/CinematicEvidence.d.ts +43 -0
  435. package/dist/cinematic/CinematicEvidence.d.ts.map +1 -0
  436. package/dist/cinematic/CinematicEvidence.js +55 -0
  437. package/dist/cinematic/CinematicEvidence.js.map +1 -0
  438. package/dist/cinematic/CinematicLightingRig.d.ts +32 -0
  439. package/dist/cinematic/CinematicLightingRig.d.ts.map +1 -0
  440. package/dist/cinematic/CinematicLightingRig.js +90 -0
  441. package/dist/cinematic/CinematicLightingRig.js.map +1 -0
  442. package/dist/cinematic/CinematicMaterialPresets.d.ts +16 -0
  443. package/dist/cinematic/CinematicMaterialPresets.d.ts.map +1 -0
  444. package/dist/cinematic/CinematicMaterialPresets.js +114 -0
  445. package/dist/cinematic/CinematicMaterialPresets.js.map +1 -0
  446. package/dist/cinematic/CinematicPostProcess.d.ts +25 -0
  447. package/dist/cinematic/CinematicPostProcess.d.ts.map +1 -0
  448. package/dist/cinematic/CinematicPostProcess.js +64 -0
  449. package/dist/cinematic/CinematicPostProcess.js.map +1 -0
  450. package/dist/cinematic/DepthHazePass.d.ts +12 -0
  451. package/dist/cinematic/DepthHazePass.d.ts.map +1 -0
  452. package/dist/cinematic/DepthHazePass.js +20 -0
  453. package/dist/cinematic/DepthHazePass.js.map +1 -0
  454. package/dist/cinematic/EmissivePracticalLightSystem.d.ts +18 -0
  455. package/dist/cinematic/EmissivePracticalLightSystem.d.ts.map +1 -0
  456. package/dist/cinematic/EmissivePracticalLightSystem.js +25 -0
  457. package/dist/cinematic/EmissivePracticalLightSystem.js.map +1 -0
  458. package/dist/cinematic/FilmGrainPass.d.ts +9 -0
  459. package/dist/cinematic/FilmGrainPass.d.ts.map +1 -0
  460. package/dist/cinematic/FilmGrainPass.js +17 -0
  461. package/dist/cinematic/FilmGrainPass.js.map +1 -0
  462. package/dist/cinematic/FogVolumeSystem.d.ts +12 -0
  463. package/dist/cinematic/FogVolumeSystem.d.ts.map +1 -0
  464. package/dist/cinematic/FogVolumeSystem.js +20 -0
  465. package/dist/cinematic/FogVolumeSystem.js.map +1 -0
  466. package/dist/cinematic/GlowCardSystem.d.ts +17 -0
  467. package/dist/cinematic/GlowCardSystem.d.ts.map +1 -0
  468. package/dist/cinematic/GlowCardSystem.js +28 -0
  469. package/dist/cinematic/GlowCardSystem.js.map +1 -0
  470. package/dist/cinematic/RainParticleSystem.d.ts +22 -0
  471. package/dist/cinematic/RainParticleSystem.d.ts.map +1 -0
  472. package/dist/cinematic/RainParticleSystem.js +114 -0
  473. package/dist/cinematic/RainParticleSystem.js.map +1 -0
  474. package/dist/cinematic/VignettePass.d.ts +10 -0
  475. package/dist/cinematic/VignettePass.d.ts.map +1 -0
  476. package/dist/cinematic/VignettePass.js +17 -0
  477. package/dist/cinematic/VignettePass.js.map +1 -0
  478. package/dist/cinematic/WetReflectionApproximation.d.ts +13 -0
  479. package/dist/cinematic/WetReflectionApproximation.d.ts.map +1 -0
  480. package/dist/cinematic/WetReflectionApproximation.js +18 -0
  481. package/dist/cinematic/WetReflectionApproximation.js.map +1 -0
  482. package/dist/cinematic/index.d.ts +15 -0
  483. package/dist/cinematic/index.d.ts.map +1 -0
  484. package/dist/cinematic/index.js +15 -0
  485. package/dist/cinematic/index.js.map +1 -0
  486. package/dist/effects/CollisionModule.d.ts +15 -0
  487. package/dist/effects/CollisionModule.d.ts.map +1 -0
  488. package/dist/effects/CollisionModule.js +46 -0
  489. package/dist/effects/CollisionModule.js.map +1 -0
  490. package/dist/effects/ColorModule.d.ts +15 -0
  491. package/dist/effects/ColorModule.d.ts.map +1 -0
  492. package/dist/effects/ColorModule.js +45 -0
  493. package/dist/effects/ColorModule.js.map +1 -0
  494. package/dist/effects/ForceModule.d.ts +11 -0
  495. package/dist/effects/ForceModule.d.ts.map +1 -0
  496. package/dist/effects/ForceModule.js +17 -0
  497. package/dist/effects/ForceModule.js.map +1 -0
  498. package/dist/effects/GPUParticleBackend.d.ts +153 -0
  499. package/dist/effects/GPUParticleBackend.d.ts.map +1 -0
  500. package/dist/effects/GPUParticleBackend.js +397 -0
  501. package/dist/effects/GPUParticleBackend.js.map +1 -0
  502. package/dist/effects/Particle.d.ts +49 -0
  503. package/dist/effects/Particle.d.ts.map +1 -0
  504. package/dist/effects/Particle.js +56 -0
  505. package/dist/effects/Particle.js.map +1 -0
  506. package/dist/effects/ParticleDiagnostics.d.ts +58 -0
  507. package/dist/effects/ParticleDiagnostics.d.ts.map +1 -0
  508. package/dist/effects/ParticleDiagnostics.js +145 -0
  509. package/dist/effects/ParticleDiagnostics.js.map +1 -0
  510. package/dist/effects/ParticleEffectPresets.d.ts +8 -0
  511. package/dist/effects/ParticleEffectPresets.d.ts.map +1 -0
  512. package/dist/effects/ParticleEffectPresets.js +137 -0
  513. package/dist/effects/ParticleEffectPresets.js.map +1 -0
  514. package/dist/effects/ParticleEmitter.d.ts +87 -0
  515. package/dist/effects/ParticleEmitter.d.ts.map +1 -0
  516. package/dist/effects/ParticleEmitter.js +254 -0
  517. package/dist/effects/ParticleEmitter.js.map +1 -0
  518. package/dist/effects/ParticleModule.d.ts +15 -0
  519. package/dist/effects/ParticleModule.d.ts.map +1 -0
  520. package/dist/effects/ParticleModule.js +6 -0
  521. package/dist/effects/ParticleModule.js.map +1 -0
  522. package/dist/effects/ParticleRenderPass.d.ts +35 -0
  523. package/dist/effects/ParticleRenderPass.d.ts.map +1 -0
  524. package/dist/effects/ParticleRenderPass.js +91 -0
  525. package/dist/effects/ParticleRenderPass.js.map +1 -0
  526. package/dist/effects/ParticleRenderer.d.ts +34 -0
  527. package/dist/effects/ParticleRenderer.d.ts.map +1 -0
  528. package/dist/effects/ParticleRenderer.js +93 -0
  529. package/dist/effects/ParticleRenderer.js.map +1 -0
  530. package/dist/effects/ParticleSystem.d.ts +51 -0
  531. package/dist/effects/ParticleSystem.d.ts.map +1 -0
  532. package/dist/effects/ParticleSystem.js +261 -0
  533. package/dist/effects/ParticleSystem.js.map +1 -0
  534. package/dist/effects/SizeModule.d.ts +14 -0
  535. package/dist/effects/SizeModule.d.ts.map +1 -0
  536. package/dist/effects/SizeModule.js +42 -0
  537. package/dist/effects/SizeModule.js.map +1 -0
  538. package/dist/effects/TrailModule.d.ts +22 -0
  539. package/dist/effects/TrailModule.d.ts.map +1 -0
  540. package/dist/effects/TrailModule.js +50 -0
  541. package/dist/effects/TrailModule.js.map +1 -0
  542. package/dist/effects/VelocityModule.d.ts +15 -0
  543. package/dist/effects/VelocityModule.d.ts.map +1 -0
  544. package/dist/effects/VelocityModule.js +57 -0
  545. package/dist/effects/VelocityModule.js.map +1 -0
  546. package/dist/effects/index.d.ts +16 -0
  547. package/dist/effects/index.d.ts.map +1 -0
  548. package/dist/effects/index.js +16 -0
  549. package/dist/effects/index.js.map +1 -0
  550. package/dist/index.d.ts +260 -0
  551. package/dist/index.d.ts.map +1 -0
  552. package/dist/index.js +155 -0
  553. package/dist/index.js.map +1 -0
  554. package/dist/materials/AlphaSorting.d.ts +8 -0
  555. package/dist/materials/AlphaSorting.d.ts.map +1 -0
  556. package/dist/materials/AlphaSorting.js +26 -0
  557. package/dist/materials/AlphaSorting.js.map +1 -0
  558. package/dist/materials/MaterialExtensions.d.ts +10 -0
  559. package/dist/materials/MaterialExtensions.d.ts.map +1 -0
  560. package/dist/materials/MaterialExtensions.js +20 -0
  561. package/dist/materials/MaterialExtensions.js.map +1 -0
  562. package/dist/materials/PhysicalMaterial.d.ts +36 -0
  563. package/dist/materials/PhysicalMaterial.d.ts.map +1 -0
  564. package/dist/materials/PhysicalMaterial.js +79 -0
  565. package/dist/materials/PhysicalMaterial.js.map +1 -0
  566. package/dist/materials/TransmissionPass.d.ts +16 -0
  567. package/dist/materials/TransmissionPass.d.ts.map +1 -0
  568. package/dist/materials/TransmissionPass.js +30 -0
  569. package/dist/materials/TransmissionPass.js.map +1 -0
  570. package/dist/performance/BVH.d.ts +3 -0
  571. package/dist/performance/BVH.d.ts.map +1 -0
  572. package/dist/performance/BVH.js +2 -0
  573. package/dist/performance/BVH.js.map +1 -0
  574. package/dist/performance/Batcher.d.ts +3 -0
  575. package/dist/performance/Batcher.d.ts.map +1 -0
  576. package/dist/performance/Batcher.js +2 -0
  577. package/dist/performance/Batcher.js.map +1 -0
  578. package/dist/performance/FrustumCuller.d.ts +3 -0
  579. package/dist/performance/FrustumCuller.d.ts.map +1 -0
  580. package/dist/performance/FrustumCuller.js +5 -0
  581. package/dist/performance/FrustumCuller.js.map +1 -0
  582. package/dist/performance/LOD.d.ts +8 -0
  583. package/dist/performance/LOD.d.ts.map +1 -0
  584. package/dist/performance/LOD.js +15 -0
  585. package/dist/performance/LOD.js.map +1 -0
  586. package/dist/performance/Octree.d.ts +7 -0
  587. package/dist/performance/Octree.d.ts.map +1 -0
  588. package/dist/performance/Octree.js +4 -0
  589. package/dist/performance/Octree.js.map +1 -0
  590. package/dist/performance/RenderItemSorting.d.ts +43 -0
  591. package/dist/performance/RenderItemSorting.d.ts.map +1 -0
  592. package/dist/performance/RenderItemSorting.js +111 -0
  593. package/dist/performance/RenderItemSorting.js.map +1 -0
  594. package/dist/performance/RendererStats.d.ts +23 -0
  595. package/dist/performance/RendererStats.d.ts.map +1 -0
  596. package/dist/performance/RendererStats.js +23 -0
  597. package/dist/performance/RendererStats.js.map +1 -0
  598. package/dist/performance/ResourceBudget.d.ts +19 -0
  599. package/dist/performance/ResourceBudget.d.ts.map +1 -0
  600. package/dist/performance/ResourceBudget.js +21 -0
  601. package/dist/performance/ResourceBudget.js.map +1 -0
  602. package/dist/postprocess/BloomPass.d.ts +11 -0
  603. package/dist/postprocess/BloomPass.d.ts.map +1 -0
  604. package/dist/postprocess/BloomPass.js +14 -0
  605. package/dist/postprocess/BloomPass.js.map +1 -0
  606. package/dist/postprocess/CinematicDiagnostics.d.ts +112 -0
  607. package/dist/postprocess/CinematicDiagnostics.d.ts.map +1 -0
  608. package/dist/postprocess/CinematicDiagnostics.js +492 -0
  609. package/dist/postprocess/CinematicDiagnostics.js.map +1 -0
  610. package/dist/postprocess/ColorGradingPass.d.ts +4 -0
  611. package/dist/postprocess/ColorGradingPass.d.ts.map +1 -0
  612. package/dist/postprocess/ColorGradingPass.js +15 -0
  613. package/dist/postprocess/ColorGradingPass.js.map +1 -0
  614. package/dist/postprocess/DepthOfFieldPass.d.ts +3 -0
  615. package/dist/postprocess/DepthOfFieldPass.d.ts.map +1 -0
  616. package/dist/postprocess/DepthOfFieldPass.js +7 -0
  617. package/dist/postprocess/DepthOfFieldPass.js.map +1 -0
  618. package/dist/postprocess/EffectComposer.d.ts +110 -0
  619. package/dist/postprocess/EffectComposer.d.ts.map +1 -0
  620. package/dist/postprocess/EffectComposer.js +249 -0
  621. package/dist/postprocess/EffectComposer.js.map +1 -0
  622. package/dist/postprocess/SSAOPass.d.ts +6 -0
  623. package/dist/postprocess/SSAOPass.d.ts.map +1 -0
  624. package/dist/postprocess/SSAOPass.js +18 -0
  625. package/dist/postprocess/SSAOPass.js.map +1 -0
  626. package/dist/postprocess/index.d.ts +11 -0
  627. package/dist/postprocess/index.d.ts.map +1 -0
  628. package/dist/postprocess/index.js +7 -0
  629. package/dist/postprocess/index.js.map +1 -0
  630. package/dist/production-runtime/AnimationControlsPipeline.d.ts +37 -0
  631. package/dist/production-runtime/AnimationControlsPipeline.d.ts.map +1 -0
  632. package/dist/production-runtime/AnimationControlsPipeline.js +41 -0
  633. package/dist/production-runtime/AnimationControlsPipeline.js.map +1 -0
  634. package/dist/production-runtime/PBRHDRPipeline.d.ts +81 -0
  635. package/dist/production-runtime/PBRHDRPipeline.d.ts.map +1 -0
  636. package/dist/production-runtime/PBRHDRPipeline.js +279 -0
  637. package/dist/production-runtime/PBRHDRPipeline.js.map +1 -0
  638. package/dist/production-runtime/ProductionEffectsPipeline.d.ts +20 -0
  639. package/dist/production-runtime/ProductionEffectsPipeline.d.ts.map +1 -0
  640. package/dist/production-runtime/ProductionEffectsPipeline.js +65 -0
  641. package/dist/production-runtime/ProductionEffectsPipeline.js.map +1 -0
  642. package/dist/production-runtime/ProductionRendererTypes.d.ts +97 -0
  643. package/dist/production-runtime/ProductionRendererTypes.d.ts.map +1 -0
  644. package/dist/production-runtime/ProductionRendererTypes.js +29 -0
  645. package/dist/production-runtime/ProductionRendererTypes.js.map +1 -0
  646. package/dist/production-runtime/ProductionRuntimeRenderer.d.ts +36 -0
  647. package/dist/production-runtime/ProductionRuntimeRenderer.d.ts.map +1 -0
  648. package/dist/production-runtime/ProductionRuntimeRenderer.js +124 -0
  649. package/dist/production-runtime/ProductionRuntimeRenderer.js.map +1 -0
  650. package/dist/production-runtime/ProductionWebGL2Renderer.d.ts +51 -0
  651. package/dist/production-runtime/ProductionWebGL2Renderer.d.ts.map +1 -0
  652. package/dist/production-runtime/ProductionWebGL2Renderer.js +269 -0
  653. package/dist/production-runtime/ProductionWebGL2Renderer.js.map +1 -0
  654. package/dist/production-runtime/ProductionWebGPURenderer.d.ts +69 -0
  655. package/dist/production-runtime/ProductionWebGPURenderer.d.ts.map +1 -0
  656. package/dist/production-runtime/ProductionWebGPURenderer.js +313 -0
  657. package/dist/production-runtime/ProductionWebGPURenderer.js.map +1 -0
  658. package/dist/production-runtime/TransmissionBackdropCapture.d.ts +11 -0
  659. package/dist/production-runtime/TransmissionBackdropCapture.d.ts.map +1 -0
  660. package/dist/production-runtime/TransmissionBackdropCapture.js +119 -0
  661. package/dist/production-runtime/TransmissionBackdropCapture.js.map +1 -0
  662. package/dist/production-runtime/animation/MorphTargetRenderer.d.ts +7 -0
  663. package/dist/production-runtime/animation/MorphTargetRenderer.d.ts.map +1 -0
  664. package/dist/production-runtime/animation/MorphTargetRenderer.js +2 -0
  665. package/dist/production-runtime/animation/MorphTargetRenderer.js.map +1 -0
  666. package/dist/production-runtime/animation/SkinningRenderer.d.ts +7 -0
  667. package/dist/production-runtime/animation/SkinningRenderer.d.ts.map +1 -0
  668. package/dist/production-runtime/animation/SkinningRenderer.js +2 -0
  669. package/dist/production-runtime/animation/SkinningRenderer.js.map +1 -0
  670. package/dist/production-runtime/backends/RendererBackend.d.ts +16 -0
  671. package/dist/production-runtime/backends/RendererBackend.d.ts.map +1 -0
  672. package/dist/production-runtime/backends/RendererBackend.js +2 -0
  673. package/dist/production-runtime/backends/RendererBackend.js.map +1 -0
  674. package/dist/production-runtime/backends/WebGL2RendererBackend.d.ts +15 -0
  675. package/dist/production-runtime/backends/WebGL2RendererBackend.d.ts.map +1 -0
  676. package/dist/production-runtime/backends/WebGL2RendererBackend.js +25 -0
  677. package/dist/production-runtime/backends/WebGL2RendererBackend.js.map +1 -0
  678. package/dist/production-runtime/backends/WebGPURendererBackend.d.ts +20 -0
  679. package/dist/production-runtime/backends/WebGPURendererBackend.d.ts.map +1 -0
  680. package/dist/production-runtime/backends/WebGPURendererBackend.js +19 -0
  681. package/dist/production-runtime/backends/WebGPURendererBackend.js.map +1 -0
  682. package/dist/production-runtime/backends/webgl2/WebGL2Buffer.d.ts +11 -0
  683. package/dist/production-runtime/backends/webgl2/WebGL2Buffer.d.ts.map +1 -0
  684. package/dist/production-runtime/backends/webgl2/WebGL2Buffer.js +8 -0
  685. package/dist/production-runtime/backends/webgl2/WebGL2Buffer.js.map +1 -0
  686. package/dist/production-runtime/backends/webgl2/WebGL2Capabilities.d.ts +11 -0
  687. package/dist/production-runtime/backends/webgl2/WebGL2Capabilities.d.ts.map +1 -0
  688. package/dist/production-runtime/backends/webgl2/WebGL2Capabilities.js +8 -0
  689. package/dist/production-runtime/backends/webgl2/WebGL2Capabilities.js.map +1 -0
  690. package/dist/production-runtime/backends/webgl2/WebGL2RenderTarget.d.ts +11 -0
  691. package/dist/production-runtime/backends/webgl2/WebGL2RenderTarget.d.ts.map +1 -0
  692. package/dist/production-runtime/backends/webgl2/WebGL2RenderTarget.js +8 -0
  693. package/dist/production-runtime/backends/webgl2/WebGL2RenderTarget.js.map +1 -0
  694. package/dist/production-runtime/backends/webgl2/WebGL2Shader.d.ts +11 -0
  695. package/dist/production-runtime/backends/webgl2/WebGL2Shader.d.ts.map +1 -0
  696. package/dist/production-runtime/backends/webgl2/WebGL2Shader.js +8 -0
  697. package/dist/production-runtime/backends/webgl2/WebGL2Shader.js.map +1 -0
  698. package/dist/production-runtime/backends/webgl2/WebGL2StateCache.d.ts +2 -0
  699. package/dist/production-runtime/backends/webgl2/WebGL2StateCache.d.ts.map +1 -0
  700. package/dist/production-runtime/backends/webgl2/WebGL2StateCache.js +2 -0
  701. package/dist/production-runtime/backends/webgl2/WebGL2StateCache.js.map +1 -0
  702. package/dist/production-runtime/backends/webgl2/WebGL2Texture.d.ts +11 -0
  703. package/dist/production-runtime/backends/webgl2/WebGL2Texture.d.ts.map +1 -0
  704. package/dist/production-runtime/backends/webgl2/WebGL2Texture.js +8 -0
  705. package/dist/production-runtime/backends/webgl2/WebGL2Texture.js.map +1 -0
  706. package/dist/production-runtime/backends/webgpu/WebGPUBuffer.d.ts +11 -0
  707. package/dist/production-runtime/backends/webgpu/WebGPUBuffer.d.ts.map +1 -0
  708. package/dist/production-runtime/backends/webgpu/WebGPUBuffer.js +8 -0
  709. package/dist/production-runtime/backends/webgpu/WebGPUBuffer.js.map +1 -0
  710. package/dist/production-runtime/backends/webgpu/WebGPUCapabilities.d.ts +11 -0
  711. package/dist/production-runtime/backends/webgpu/WebGPUCapabilities.d.ts.map +1 -0
  712. package/dist/production-runtime/backends/webgpu/WebGPUCapabilities.js +8 -0
  713. package/dist/production-runtime/backends/webgpu/WebGPUCapabilities.js.map +1 -0
  714. package/dist/production-runtime/backends/webgpu/WebGPURenderTarget.d.ts +11 -0
  715. package/dist/production-runtime/backends/webgpu/WebGPURenderTarget.d.ts.map +1 -0
  716. package/dist/production-runtime/backends/webgpu/WebGPURenderTarget.js +8 -0
  717. package/dist/production-runtime/backends/webgpu/WebGPURenderTarget.js.map +1 -0
  718. package/dist/production-runtime/backends/webgpu/WebGPUShader.d.ts +11 -0
  719. package/dist/production-runtime/backends/webgpu/WebGPUShader.d.ts.map +1 -0
  720. package/dist/production-runtime/backends/webgpu/WebGPUShader.js +8 -0
  721. package/dist/production-runtime/backends/webgpu/WebGPUShader.js.map +1 -0
  722. package/dist/production-runtime/backends/webgpu/WebGPUTexture.d.ts +11 -0
  723. package/dist/production-runtime/backends/webgpu/WebGPUTexture.d.ts.map +1 -0
  724. package/dist/production-runtime/backends/webgpu/WebGPUTexture.js +8 -0
  725. package/dist/production-runtime/backends/webgpu/WebGPUTexture.js.map +1 -0
  726. package/dist/production-runtime/color/ColorManagement.d.ts +4 -0
  727. package/dist/production-runtime/color/ColorManagement.d.ts.map +1 -0
  728. package/dist/production-runtime/color/ColorManagement.js +3 -0
  729. package/dist/production-runtime/color/ColorManagement.js.map +1 -0
  730. package/dist/production-runtime/color/ToneMapping.d.ts +3 -0
  731. package/dist/production-runtime/color/ToneMapping.d.ts.map +1 -0
  732. package/dist/production-runtime/color/ToneMapping.js +9 -0
  733. package/dist/production-runtime/color/ToneMapping.js.map +1 -0
  734. package/dist/production-runtime/diagnostics/FrameCapture.d.ts +7 -0
  735. package/dist/production-runtime/diagnostics/FrameCapture.d.ts.map +1 -0
  736. package/dist/production-runtime/diagnostics/FrameCapture.js +2 -0
  737. package/dist/production-runtime/diagnostics/FrameCapture.js.map +1 -0
  738. package/dist/production-runtime/diagnostics/GPUCapabilities.d.ts +9 -0
  739. package/dist/production-runtime/diagnostics/GPUCapabilities.d.ts.map +1 -0
  740. package/dist/production-runtime/diagnostics/GPUCapabilities.js +2 -0
  741. package/dist/production-runtime/diagnostics/GPUCapabilities.js.map +1 -0
  742. package/dist/production-runtime/diagnostics/RendererStats.d.ts +9 -0
  743. package/dist/production-runtime/diagnostics/RendererStats.d.ts.map +1 -0
  744. package/dist/production-runtime/diagnostics/RendererStats.js +2 -0
  745. package/dist/production-runtime/diagnostics/RendererStats.js.map +1 -0
  746. package/dist/production-runtime/environment/EnvironmentMap.d.ts +8 -0
  747. package/dist/production-runtime/environment/EnvironmentMap.d.ts.map +1 -0
  748. package/dist/production-runtime/environment/EnvironmentMap.js +2 -0
  749. package/dist/production-runtime/environment/EnvironmentMap.js.map +1 -0
  750. package/dist/production-runtime/environment/HDRLoader.d.ts +19 -0
  751. package/dist/production-runtime/environment/HDRLoader.d.ts.map +1 -0
  752. package/dist/production-runtime/environment/HDRLoader.js +22 -0
  753. package/dist/production-runtime/environment/HDRLoader.js.map +1 -0
  754. package/dist/production-runtime/environment/PMREMGenerator.d.ts +99 -0
  755. package/dist/production-runtime/environment/PMREMGenerator.d.ts.map +1 -0
  756. package/dist/production-runtime/environment/PMREMGenerator.js +534 -0
  757. package/dist/production-runtime/environment/PMREMGenerator.js.map +1 -0
  758. package/dist/production-runtime/framegraph/FrameGraph.d.ts +8 -0
  759. package/dist/production-runtime/framegraph/FrameGraph.d.ts.map +1 -0
  760. package/dist/production-runtime/framegraph/FrameGraph.js +14 -0
  761. package/dist/production-runtime/framegraph/FrameGraph.js.map +1 -0
  762. package/dist/production-runtime/framegraph/RenderPass.d.ts +14 -0
  763. package/dist/production-runtime/framegraph/RenderPass.d.ts.map +1 -0
  764. package/dist/production-runtime/framegraph/RenderPass.js +2 -0
  765. package/dist/production-runtime/framegraph/RenderPass.js.map +1 -0
  766. package/dist/production-runtime/geometry/ProjectedDecalGeometry.d.ts +53 -0
  767. package/dist/production-runtime/geometry/ProjectedDecalGeometry.d.ts.map +1 -0
  768. package/dist/production-runtime/geometry/ProjectedDecalGeometry.js +340 -0
  769. package/dist/production-runtime/geometry/ProjectedDecalGeometry.js.map +1 -0
  770. package/dist/production-runtime/index.d.ts +73 -0
  771. package/dist/production-runtime/index.d.ts.map +1 -0
  772. package/dist/production-runtime/index.js +67 -0
  773. package/dist/production-runtime/index.js.map +1 -0
  774. package/dist/production-runtime/lights/LightManager.d.ts +8 -0
  775. package/dist/production-runtime/lights/LightManager.d.ts.map +1 -0
  776. package/dist/production-runtime/lights/LightManager.js +7 -0
  777. package/dist/production-runtime/lights/LightManager.js.map +1 -0
  778. package/dist/production-runtime/lights/ShadowMapRenderer.d.ts +8 -0
  779. package/dist/production-runtime/lights/ShadowMapRenderer.d.ts.map +1 -0
  780. package/dist/production-runtime/lights/ShadowMapRenderer.js +4 -0
  781. package/dist/production-runtime/lights/ShadowMapRenderer.js.map +1 -0
  782. package/dist/production-runtime/materials/GLTFMaterialAdapter.d.ts +14 -0
  783. package/dist/production-runtime/materials/GLTFMaterialAdapter.d.ts.map +1 -0
  784. package/dist/production-runtime/materials/GLTFMaterialAdapter.js +5 -0
  785. package/dist/production-runtime/materials/GLTFMaterialAdapter.js.map +1 -0
  786. package/dist/production-runtime/materials/GLTFPBRMaterialAdapter.d.ts +3 -0
  787. package/dist/production-runtime/materials/GLTFPBRMaterialAdapter.d.ts.map +1 -0
  788. package/dist/production-runtime/materials/GLTFPBRMaterialAdapter.js +2 -0
  789. package/dist/production-runtime/materials/GLTFPBRMaterialAdapter.js.map +1 -0
  790. package/dist/production-runtime/materials/MaterialCompiler.d.ts +9 -0
  791. package/dist/production-runtime/materials/MaterialCompiler.d.ts.map +1 -0
  792. package/dist/production-runtime/materials/MaterialCompiler.js +5 -0
  793. package/dist/production-runtime/materials/MaterialCompiler.js.map +1 -0
  794. package/dist/production-runtime/materials/MaterialTextureBindings.d.ts +8 -0
  795. package/dist/production-runtime/materials/MaterialTextureBindings.d.ts.map +1 -0
  796. package/dist/production-runtime/materials/MaterialTextureBindings.js +4 -0
  797. package/dist/production-runtime/materials/MaterialTextureBindings.js.map +1 -0
  798. package/dist/production-runtime/materials/PBRMaterial.d.ts +23 -0
  799. package/dist/production-runtime/materials/PBRMaterial.d.ts.map +1 -0
  800. package/dist/production-runtime/materials/PBRMaterial.js +2 -0
  801. package/dist/production-runtime/materials/PBRMaterial.js.map +1 -0
  802. package/dist/production-runtime/materials/PBRShaderFeatures.d.ts +13 -0
  803. package/dist/production-runtime/materials/PBRShaderFeatures.d.ts.map +1 -0
  804. package/dist/production-runtime/materials/PBRShaderFeatures.js +2 -0
  805. package/dist/production-runtime/materials/PBRShaderFeatures.js.map +1 -0
  806. package/dist/production-runtime/passes/ContactShadowPass.d.ts +40 -0
  807. package/dist/production-runtime/passes/ContactShadowPass.d.ts.map +1 -0
  808. package/dist/production-runtime/passes/ContactShadowPass.js +126 -0
  809. package/dist/production-runtime/passes/ContactShadowPass.js.map +1 -0
  810. package/dist/production-runtime/passes/DepthPrepass.d.ts +8 -0
  811. package/dist/production-runtime/passes/DepthPrepass.d.ts.map +1 -0
  812. package/dist/production-runtime/passes/DepthPrepass.js +7 -0
  813. package/dist/production-runtime/passes/DepthPrepass.js.map +1 -0
  814. package/dist/production-runtime/passes/OpaquePass.d.ts +8 -0
  815. package/dist/production-runtime/passes/OpaquePass.d.ts.map +1 -0
  816. package/dist/production-runtime/passes/OpaquePass.js +7 -0
  817. package/dist/production-runtime/passes/OpaquePass.js.map +1 -0
  818. package/dist/production-runtime/passes/ShadowPass.d.ts +8 -0
  819. package/dist/production-runtime/passes/ShadowPass.d.ts.map +1 -0
  820. package/dist/production-runtime/passes/ShadowPass.js +7 -0
  821. package/dist/production-runtime/passes/ShadowPass.js.map +1 -0
  822. package/dist/production-runtime/passes/SkyboxPass.d.ts +8 -0
  823. package/dist/production-runtime/passes/SkyboxPass.d.ts.map +1 -0
  824. package/dist/production-runtime/passes/SkyboxPass.js +7 -0
  825. package/dist/production-runtime/passes/SkyboxPass.js.map +1 -0
  826. package/dist/production-runtime/passes/ToneMappingPass.d.ts +8 -0
  827. package/dist/production-runtime/passes/ToneMappingPass.d.ts.map +1 -0
  828. package/dist/production-runtime/passes/ToneMappingPass.js +7 -0
  829. package/dist/production-runtime/passes/ToneMappingPass.js.map +1 -0
  830. package/dist/production-runtime/passes/TransparentPass.d.ts +8 -0
  831. package/dist/production-runtime/passes/TransparentPass.d.ts.map +1 -0
  832. package/dist/production-runtime/passes/TransparentPass.js +7 -0
  833. package/dist/production-runtime/passes/TransparentPass.js.map +1 -0
  834. package/dist/production-runtime/postprocess/BloomPass.d.ts +15 -0
  835. package/dist/production-runtime/postprocess/BloomPass.d.ts.map +1 -0
  836. package/dist/production-runtime/postprocess/BloomPass.js +37 -0
  837. package/dist/production-runtime/postprocess/BloomPass.js.map +1 -0
  838. package/dist/production-runtime/postprocess/ColorGradingPass.d.ts +16 -0
  839. package/dist/production-runtime/postprocess/ColorGradingPass.d.ts.map +1 -0
  840. package/dist/production-runtime/postprocess/ColorGradingPass.js +34 -0
  841. package/dist/production-runtime/postprocess/ColorGradingPass.js.map +1 -0
  842. package/dist/production-runtime/postprocess/DOFPass.d.ts +16 -0
  843. package/dist/production-runtime/postprocess/DOFPass.d.ts.map +1 -0
  844. package/dist/production-runtime/postprocess/DOFPass.js +31 -0
  845. package/dist/production-runtime/postprocess/DOFPass.js.map +1 -0
  846. package/dist/production-runtime/postprocess/FXAAPass.d.ts +16 -0
  847. package/dist/production-runtime/postprocess/FXAAPass.d.ts.map +1 -0
  848. package/dist/production-runtime/postprocess/FXAAPass.js +39 -0
  849. package/dist/production-runtime/postprocess/FXAAPass.js.map +1 -0
  850. package/dist/production-runtime/postprocess/ProductionEffectComposer.d.ts +21 -0
  851. package/dist/production-runtime/postprocess/ProductionEffectComposer.d.ts.map +1 -0
  852. package/dist/production-runtime/postprocess/ProductionEffectComposer.js +53 -0
  853. package/dist/production-runtime/postprocess/ProductionEffectComposer.js.map +1 -0
  854. package/dist/production-runtime/postprocess/ProductionPostProcessTypes.d.ts +37 -0
  855. package/dist/production-runtime/postprocess/ProductionPostProcessTypes.d.ts.map +1 -0
  856. package/dist/production-runtime/postprocess/ProductionPostProcessTypes.js +124 -0
  857. package/dist/production-runtime/postprocess/ProductionPostProcessTypes.js.map +1 -0
  858. package/dist/production-runtime/postprocess/SSAOPass.d.ts +15 -0
  859. package/dist/production-runtime/postprocess/SSAOPass.d.ts.map +1 -0
  860. package/dist/production-runtime/postprocess/SSAOPass.js +30 -0
  861. package/dist/production-runtime/postprocess/SSAOPass.js.map +1 -0
  862. package/dist/production-runtime/resources/GPUBuffer.d.ts +10 -0
  863. package/dist/production-runtime/resources/GPUBuffer.d.ts.map +1 -0
  864. package/dist/production-runtime/resources/GPUBuffer.js +7 -0
  865. package/dist/production-runtime/resources/GPUBuffer.js.map +1 -0
  866. package/dist/production-runtime/resources/GPUTexture.d.ts +12 -0
  867. package/dist/production-runtime/resources/GPUTexture.d.ts.map +1 -0
  868. package/dist/production-runtime/resources/GPUTexture.js +7 -0
  869. package/dist/production-runtime/resources/GPUTexture.js.map +1 -0
  870. package/dist/production-runtime/resources/RenderTarget.d.ts +11 -0
  871. package/dist/production-runtime/resources/RenderTarget.d.ts.map +1 -0
  872. package/dist/production-runtime/resources/RenderTarget.js +7 -0
  873. package/dist/production-runtime/resources/RenderTarget.js.map +1 -0
  874. package/dist/production-runtime/resources/ResourceCache.d.ts +8 -0
  875. package/dist/production-runtime/resources/ResourceCache.d.ts.map +1 -0
  876. package/dist/production-runtime/resources/ResourceCache.js +8 -0
  877. package/dist/production-runtime/resources/ResourceCache.js.map +1 -0
  878. package/dist/production-runtime/scene/Camera.d.ts +8 -0
  879. package/dist/production-runtime/scene/Camera.d.ts.map +1 -0
  880. package/dist/production-runtime/scene/Camera.js +2 -0
  881. package/dist/production-runtime/scene/Camera.js.map +1 -0
  882. package/dist/production-runtime/scene/Lights.d.ts +9 -0
  883. package/dist/production-runtime/scene/Lights.d.ts.map +1 -0
  884. package/dist/production-runtime/scene/Lights.js +2 -0
  885. package/dist/production-runtime/scene/Lights.js.map +1 -0
  886. package/dist/production-runtime/scene/RenderableMesh.d.ts +8 -0
  887. package/dist/production-runtime/scene/RenderableMesh.d.ts.map +1 -0
  888. package/dist/production-runtime/scene/RenderableMesh.js +2 -0
  889. package/dist/production-runtime/scene/RenderableMesh.js.map +1 -0
  890. package/dist/production-runtime/scene/RenderablePrimitive.d.ts +8 -0
  891. package/dist/production-runtime/scene/RenderablePrimitive.d.ts.map +1 -0
  892. package/dist/production-runtime/scene/RenderablePrimitive.js +2 -0
  893. package/dist/production-runtime/scene/RenderablePrimitive.js.map +1 -0
  894. package/dist/production-runtime/scene/RenderableScene.d.ts +11 -0
  895. package/dist/production-runtime/scene/RenderableScene.d.ts.map +1 -0
  896. package/dist/production-runtime/scene/RenderableScene.js +2 -0
  897. package/dist/production-runtime/scene/RenderableScene.js.map +1 -0
  898. package/dist/production-runtime/shaders/ShaderProgramLibrary.d.ts +12 -0
  899. package/dist/production-runtime/shaders/ShaderProgramLibrary.d.ts.map +1 -0
  900. package/dist/production-runtime/shaders/ShaderProgramLibrary.js +7 -0
  901. package/dist/production-runtime/shaders/ShaderProgramLibrary.js.map +1 -0
  902. package/dist/shadows/CascadedShadowPipeline.d.ts +25 -0
  903. package/dist/shadows/CascadedShadowPipeline.d.ts.map +1 -0
  904. package/dist/shadows/CascadedShadowPipeline.js +31 -0
  905. package/dist/shadows/CascadedShadowPipeline.js.map +1 -0
  906. package/dist/shadows/ContactShadows.d.ts +37 -0
  907. package/dist/shadows/ContactShadows.d.ts.map +1 -0
  908. package/dist/shadows/ContactShadows.js +68 -0
  909. package/dist/shadows/ContactShadows.js.map +1 -0
  910. package/dist/shadows/ShadowDebugViews.d.ts +12 -0
  911. package/dist/shadows/ShadowDebugViews.d.ts.map +1 -0
  912. package/dist/shadows/ShadowDebugViews.js +35 -0
  913. package/dist/shadows/ShadowDebugViews.js.map +1 -0
  914. package/dist/threejs-compatibility/InstancingSystem.d.ts +10 -0
  915. package/dist/threejs-compatibility/InstancingSystem.d.ts.map +1 -0
  916. package/dist/threejs-compatibility/InstancingSystem.js +11 -0
  917. package/dist/threejs-compatibility/InstancingSystem.js.map +1 -0
  918. package/dist/threejs-compatibility/LightingSystem.d.ts +11 -0
  919. package/dist/threejs-compatibility/LightingSystem.d.ts.map +1 -0
  920. package/dist/threejs-compatibility/LightingSystem.js +14 -0
  921. package/dist/threejs-compatibility/LightingSystem.js.map +1 -0
  922. package/dist/threejs-compatibility/MaterialSystem.d.ts +6 -0
  923. package/dist/threejs-compatibility/MaterialSystem.d.ts.map +1 -0
  924. package/dist/threejs-compatibility/MaterialSystem.js +7 -0
  925. package/dist/threejs-compatibility/MaterialSystem.js.map +1 -0
  926. package/dist/threejs-compatibility/RenderTargetSystem.d.ts +16 -0
  927. package/dist/threejs-compatibility/RenderTargetSystem.d.ts.map +1 -0
  928. package/dist/threejs-compatibility/RenderTargetSystem.js +23 -0
  929. package/dist/threejs-compatibility/RenderTargetSystem.js.map +1 -0
  930. package/dist/threejs-compatibility/RendererDiagnostics.d.ts +27 -0
  931. package/dist/threejs-compatibility/RendererDiagnostics.d.ts.map +1 -0
  932. package/dist/threejs-compatibility/RendererDiagnostics.js +41 -0
  933. package/dist/threejs-compatibility/RendererDiagnostics.js.map +1 -0
  934. package/dist/threejs-compatibility/SceneRenderer.d.ts +19 -0
  935. package/dist/threejs-compatibility/SceneRenderer.d.ts.map +1 -0
  936. package/dist/threejs-compatibility/SceneRenderer.js +18 -0
  937. package/dist/threejs-compatibility/SceneRenderer.js.map +1 -0
  938. package/dist/threejs-compatibility/ShadowSystem.d.ts +11 -0
  939. package/dist/threejs-compatibility/ShadowSystem.d.ts.map +1 -0
  940. package/dist/threejs-compatibility/ShadowSystem.js +12 -0
  941. package/dist/threejs-compatibility/ShadowSystem.js.map +1 -0
  942. package/dist/threejs-compatibility/TextureSystem.d.ts +9 -0
  943. package/dist/threejs-compatibility/TextureSystem.d.ts.map +1 -0
  944. package/dist/threejs-compatibility/TextureSystem.js +14 -0
  945. package/dist/threejs-compatibility/TextureSystem.js.map +1 -0
  946. package/dist/threejs-compatibility/ThreeCompatRenderer.d.ts +37 -0
  947. package/dist/threejs-compatibility/ThreeCompatRenderer.d.ts.map +1 -0
  948. package/dist/threejs-compatibility/ThreeCompatRenderer.js +77 -0
  949. package/dist/threejs-compatibility/ThreeCompatRenderer.js.map +1 -0
  950. package/dist/threejs-compatibility/TransparencySystem.d.ts +11 -0
  951. package/dist/threejs-compatibility/TransparencySystem.d.ts.map +1 -0
  952. package/dist/threejs-compatibility/TransparencySystem.js +12 -0
  953. package/dist/threejs-compatibility/TransparencySystem.js.map +1 -0
  954. package/dist/threejs-compatibility/index.d.ts +25 -0
  955. package/dist/threejs-compatibility/index.d.ts.map +1 -0
  956. package/dist/threejs-compatibility/index.js +15 -0
  957. package/dist/threejs-compatibility/index.js.map +1 -0
  958. package/dist/threejs-compatibility/performance/BVH.d.ts +11 -0
  959. package/dist/threejs-compatibility/performance/BVH.d.ts.map +1 -0
  960. package/dist/threejs-compatibility/performance/BVH.js +10 -0
  961. package/dist/threejs-compatibility/performance/BVH.js.map +1 -0
  962. package/dist/threejs-compatibility/performance/FrustumCulling.d.ts +7 -0
  963. package/dist/threejs-compatibility/performance/FrustumCulling.d.ts.map +1 -0
  964. package/dist/threejs-compatibility/performance/FrustumCulling.js +5 -0
  965. package/dist/threejs-compatibility/performance/FrustumCulling.js.map +1 -0
  966. package/dist/threejs-compatibility/performance/Instancing.d.ts +7 -0
  967. package/dist/threejs-compatibility/performance/Instancing.d.ts.map +1 -0
  968. package/dist/threejs-compatibility/performance/Instancing.js +10 -0
  969. package/dist/threejs-compatibility/performance/Instancing.js.map +1 -0
  970. package/dist/threejs-compatibility/performance/LODSystem.d.ts +9 -0
  971. package/dist/threejs-compatibility/performance/LODSystem.d.ts.map +1 -0
  972. package/dist/threejs-compatibility/performance/LODSystem.js +11 -0
  973. package/dist/threejs-compatibility/performance/LODSystem.js.map +1 -0
  974. package/dist/threejs-compatibility/performance/OcclusionCulling.d.ts +3 -0
  975. package/dist/threejs-compatibility/performance/OcclusionCulling.d.ts.map +1 -0
  976. package/dist/threejs-compatibility/performance/OcclusionCulling.js +5 -0
  977. package/dist/threejs-compatibility/performance/OcclusionCulling.js.map +1 -0
  978. package/dist/threejs-compatibility/performance/RaycastAcceleration.d.ts +8 -0
  979. package/dist/threejs-compatibility/performance/RaycastAcceleration.d.ts.map +1 -0
  980. package/dist/threejs-compatibility/performance/RaycastAcceleration.js +11 -0
  981. package/dist/threejs-compatibility/performance/RaycastAcceleration.js.map +1 -0
  982. package/dist/threejs-compatibility/performance/RendererProfiler.d.ts +11 -0
  983. package/dist/threejs-compatibility/performance/RendererProfiler.d.ts.map +1 -0
  984. package/dist/threejs-compatibility/performance/RendererProfiler.js +10 -0
  985. package/dist/threejs-compatibility/performance/RendererProfiler.js.map +1 -0
  986. package/dist/threejs-compatibility/performance/TextureStreaming.d.ts +7 -0
  987. package/dist/threejs-compatibility/performance/TextureStreaming.d.ts.map +1 -0
  988. package/dist/threejs-compatibility/performance/TextureStreaming.js +10 -0
  989. package/dist/threejs-compatibility/performance/TextureStreaming.js.map +1 -0
  990. package/dist/threejs-compatibility/performance/index.d.ts +13 -0
  991. package/dist/threejs-compatibility/performance/index.d.ts.map +1 -0
  992. package/dist/threejs-compatibility/performance/index.js +9 -0
  993. package/dist/threejs-compatibility/performance/index.js.map +1 -0
  994. package/dist/threejs-compatibility/postprocess/BloomPass.d.ts +9 -0
  995. package/dist/threejs-compatibility/postprocess/BloomPass.d.ts.map +1 -0
  996. package/dist/threejs-compatibility/postprocess/BloomPass.js +14 -0
  997. package/dist/threejs-compatibility/postprocess/BloomPass.js.map +1 -0
  998. package/dist/threejs-compatibility/postprocess/ColorGradingPass.d.ts +10 -0
  999. package/dist/threejs-compatibility/postprocess/ColorGradingPass.d.ts.map +1 -0
  1000. package/dist/threejs-compatibility/postprocess/ColorGradingPass.js +16 -0
  1001. package/dist/threejs-compatibility/postprocess/ColorGradingPass.js.map +1 -0
  1002. package/dist/threejs-compatibility/postprocess/DepthOfFieldPass.d.ts +9 -0
  1003. package/dist/threejs-compatibility/postprocess/DepthOfFieldPass.d.ts.map +1 -0
  1004. package/dist/threejs-compatibility/postprocess/DepthOfFieldPass.js +19 -0
  1005. package/dist/threejs-compatibility/postprocess/DepthOfFieldPass.js.map +1 -0
  1006. package/dist/threejs-compatibility/postprocess/EffectComposer.d.ts +7 -0
  1007. package/dist/threejs-compatibility/postprocess/EffectComposer.d.ts.map +1 -0
  1008. package/dist/threejs-compatibility/postprocess/EffectComposer.js +11 -0
  1009. package/dist/threejs-compatibility/postprocess/EffectComposer.js.map +1 -0
  1010. package/dist/threejs-compatibility/postprocess/FXAAPass.d.ts +7 -0
  1011. package/dist/threejs-compatibility/postprocess/FXAAPass.d.ts.map +1 -0
  1012. package/dist/threejs-compatibility/postprocess/FXAAPass.js +10 -0
  1013. package/dist/threejs-compatibility/postprocess/FXAAPass.js.map +1 -0
  1014. package/dist/threejs-compatibility/postprocess/MotionBlurPass.d.ts +9 -0
  1015. package/dist/threejs-compatibility/postprocess/MotionBlurPass.d.ts.map +1 -0
  1016. package/dist/threejs-compatibility/postprocess/MotionBlurPass.js +18 -0
  1017. package/dist/threejs-compatibility/postprocess/MotionBlurPass.js.map +1 -0
  1018. package/dist/threejs-compatibility/postprocess/OutlinePass.d.ts +9 -0
  1019. package/dist/threejs-compatibility/postprocess/OutlinePass.d.ts.map +1 -0
  1020. package/dist/threejs-compatibility/postprocess/OutlinePass.js +19 -0
  1021. package/dist/threejs-compatibility/postprocess/OutlinePass.js.map +1 -0
  1022. package/dist/threejs-compatibility/postprocess/PostProcessTypes.d.ts +42 -0
  1023. package/dist/threejs-compatibility/postprocess/PostProcessTypes.d.ts.map +1 -0
  1024. package/dist/threejs-compatibility/postprocess/PostProcessTypes.js +123 -0
  1025. package/dist/threejs-compatibility/postprocess/PostProcessTypes.js.map +1 -0
  1026. package/dist/threejs-compatibility/postprocess/RenderPass.d.ts +7 -0
  1027. package/dist/threejs-compatibility/postprocess/RenderPass.d.ts.map +1 -0
  1028. package/dist/threejs-compatibility/postprocess/RenderPass.js +8 -0
  1029. package/dist/threejs-compatibility/postprocess/RenderPass.js.map +1 -0
  1030. package/dist/threejs-compatibility/postprocess/SMAAPass.d.ts +7 -0
  1031. package/dist/threejs-compatibility/postprocess/SMAAPass.d.ts.map +1 -0
  1032. package/dist/threejs-compatibility/postprocess/SMAAPass.js +10 -0
  1033. package/dist/threejs-compatibility/postprocess/SMAAPass.js.map +1 -0
  1034. package/dist/threejs-compatibility/postprocess/SSAOPass.d.ts +9 -0
  1035. package/dist/threejs-compatibility/postprocess/SSAOPass.d.ts.map +1 -0
  1036. package/dist/threejs-compatibility/postprocess/SSAOPass.js +19 -0
  1037. package/dist/threejs-compatibility/postprocess/SSAOPass.js.map +1 -0
  1038. package/dist/threejs-compatibility/postprocess/ShaderPass.d.ts +9 -0
  1039. package/dist/threejs-compatibility/postprocess/ShaderPass.d.ts.map +1 -0
  1040. package/dist/threejs-compatibility/postprocess/ShaderPass.js +11 -0
  1041. package/dist/threejs-compatibility/postprocess/ShaderPass.js.map +1 -0
  1042. package/dist/threejs-compatibility/postprocess/TAAPass.d.ts +7 -0
  1043. package/dist/threejs-compatibility/postprocess/TAAPass.d.ts.map +1 -0
  1044. package/dist/threejs-compatibility/postprocess/TAAPass.js +10 -0
  1045. package/dist/threejs-compatibility/postprocess/TAAPass.js.map +1 -0
  1046. package/dist/threejs-compatibility/postprocess/VignettePass.d.ts +9 -0
  1047. package/dist/threejs-compatibility/postprocess/VignettePass.d.ts.map +1 -0
  1048. package/dist/threejs-compatibility/postprocess/VignettePass.js +14 -0
  1049. package/dist/threejs-compatibility/postprocess/VignettePass.js.map +1 -0
  1050. package/dist/threejs-compatibility/postprocess/index.d.ts +16 -0
  1051. package/dist/threejs-compatibility/postprocess/index.d.ts.map +1 -0
  1052. package/dist/threejs-compatibility/postprocess/index.js +15 -0
  1053. package/dist/threejs-compatibility/postprocess/index.js.map +1 -0
  1054. package/dist/threejs-compatibility/shaders/NodeMaterial.d.ts +14 -0
  1055. package/dist/threejs-compatibility/shaders/NodeMaterial.d.ts.map +1 -0
  1056. package/dist/threejs-compatibility/shaders/NodeMaterial.js +15 -0
  1057. package/dist/threejs-compatibility/shaders/NodeMaterial.js.map +1 -0
  1058. package/dist/threejs-compatibility/shaders/RawShaderMaterial.d.ts +6 -0
  1059. package/dist/threejs-compatibility/shaders/RawShaderMaterial.d.ts.map +1 -0
  1060. package/dist/threejs-compatibility/shaders/RawShaderMaterial.js +6 -0
  1061. package/dist/threejs-compatibility/shaders/RawShaderMaterial.js.map +1 -0
  1062. package/dist/threejs-compatibility/shaders/ShaderDiagnostics.d.ts +7 -0
  1063. package/dist/threejs-compatibility/shaders/ShaderDiagnostics.d.ts.map +1 -0
  1064. package/dist/threejs-compatibility/shaders/ShaderDiagnostics.js +12 -0
  1065. package/dist/threejs-compatibility/shaders/ShaderDiagnostics.js.map +1 -0
  1066. package/dist/threejs-compatibility/shaders/ShaderMaterial.d.ts +12 -0
  1067. package/dist/threejs-compatibility/shaders/ShaderMaterial.d.ts.map +1 -0
  1068. package/dist/threejs-compatibility/shaders/ShaderMaterial.js +20 -0
  1069. package/dist/threejs-compatibility/shaders/ShaderMaterial.js.map +1 -0
  1070. package/dist/threejs-compatibility/shaders/ThreeCompatShaderChunks.d.ts +7 -0
  1071. package/dist/threejs-compatibility/shaders/ThreeCompatShaderChunks.d.ts.map +1 -0
  1072. package/dist/threejs-compatibility/shaders/ThreeCompatShaderChunks.js +7 -0
  1073. package/dist/threejs-compatibility/shaders/ThreeCompatShaderChunks.js.map +1 -0
  1074. package/dist/threejs-compatibility/shaders/Uniforms.d.ts +8 -0
  1075. package/dist/threejs-compatibility/shaders/Uniforms.d.ts.map +1 -0
  1076. package/dist/threejs-compatibility/shaders/Uniforms.js +14 -0
  1077. package/dist/threejs-compatibility/shaders/Uniforms.js.map +1 -0
  1078. package/dist/threejs-compatibility/shaders/index.d.ts +10 -0
  1079. package/dist/threejs-compatibility/shaders/index.d.ts.map +1 -0
  1080. package/dist/threejs-compatibility/shaders/index.js +7 -0
  1081. package/dist/threejs-compatibility/shaders/index.js.map +1 -0
  1082. package/dist/threejs-compatibility/vfx/GPUPointCloud.d.ts +7 -0
  1083. package/dist/threejs-compatibility/vfx/GPUPointCloud.d.ts.map +1 -0
  1084. package/dist/threejs-compatibility/vfx/GPUPointCloud.js +12 -0
  1085. package/dist/threejs-compatibility/vfx/GPUPointCloud.js.map +1 -0
  1086. package/dist/threejs-compatibility/vfx/LineRenderer.d.ts +10 -0
  1087. package/dist/threejs-compatibility/vfx/LineRenderer.d.ts.map +1 -0
  1088. package/dist/threejs-compatibility/vfx/LineRenderer.js +7 -0
  1089. package/dist/threejs-compatibility/vfx/LineRenderer.js.map +1 -0
  1090. package/dist/threejs-compatibility/vfx/ParticleSystem.d.ts +12 -0
  1091. package/dist/threejs-compatibility/vfx/ParticleSystem.d.ts.map +1 -0
  1092. package/dist/threejs-compatibility/vfx/ParticleSystem.js +15 -0
  1093. package/dist/threejs-compatibility/vfx/ParticleSystem.js.map +1 -0
  1094. package/dist/threejs-compatibility/vfx/SpriteSystem.d.ts +11 -0
  1095. package/dist/threejs-compatibility/vfx/SpriteSystem.d.ts.map +1 -0
  1096. package/dist/threejs-compatibility/vfx/SpriteSystem.js +7 -0
  1097. package/dist/threejs-compatibility/vfx/SpriteSystem.js.map +1 -0
  1098. package/dist/threejs-compatibility/vfx/TrailRenderer.d.ts +5 -0
  1099. package/dist/threejs-compatibility/vfx/TrailRenderer.d.ts.map +1 -0
  1100. package/dist/threejs-compatibility/vfx/TrailRenderer.js +9 -0
  1101. package/dist/threejs-compatibility/vfx/TrailRenderer.js.map +1 -0
  1102. package/dist/threejs-compatibility/vfx/VFXDiagnostics.d.ts +21 -0
  1103. package/dist/threejs-compatibility/vfx/VFXDiagnostics.d.ts.map +1 -0
  1104. package/dist/threejs-compatibility/vfx/VFXDiagnostics.js +12 -0
  1105. package/dist/threejs-compatibility/vfx/VFXDiagnostics.js.map +1 -0
  1106. package/dist/threejs-compatibility/vfx/index.d.ts +10 -0
  1107. package/dist/threejs-compatibility/vfx/index.d.ts.map +1 -0
  1108. package/dist/threejs-compatibility/vfx/index.js +7 -0
  1109. package/dist/threejs-compatibility/vfx/index.js.map +1 -0
  1110. package/dist/threejs-example-parity/index.d.ts +57 -0
  1111. package/dist/threejs-example-parity/index.d.ts.map +1 -0
  1112. package/dist/threejs-example-parity/index.js +139 -0
  1113. package/dist/threejs-example-parity/index.js.map +1 -0
  1114. package/dist/webgpu/WebGPUBuffer.d.ts +2 -0
  1115. package/dist/webgpu/WebGPUBuffer.d.ts.map +1 -0
  1116. package/dist/webgpu/WebGPUBuffer.js +2 -0
  1117. package/dist/webgpu/WebGPUBuffer.js.map +1 -0
  1118. package/dist/webgpu/WebGPUCompute.d.ts +3 -0
  1119. package/dist/webgpu/WebGPUCompute.d.ts.map +1 -0
  1120. package/dist/webgpu/WebGPUCompute.js +2 -0
  1121. package/dist/webgpu/WebGPUCompute.js.map +1 -0
  1122. package/dist/webgpu/WebGPUPipelineCache.d.ts +6 -0
  1123. package/dist/webgpu/WebGPUPipelineCache.d.ts.map +1 -0
  1124. package/dist/webgpu/WebGPUPipelineCache.js +15 -0
  1125. package/dist/webgpu/WebGPUPipelineCache.js.map +1 -0
  1126. package/dist/webgpu/WebGPUPostProcess.d.ts +3 -0
  1127. package/dist/webgpu/WebGPUPostProcess.d.ts.map +1 -0
  1128. package/dist/webgpu/WebGPUPostProcess.js +2 -0
  1129. package/dist/webgpu/WebGPUPostProcess.js.map +1 -0
  1130. package/dist/webgpu/WebGPUTexture.d.ts +3 -0
  1131. package/dist/webgpu/WebGPUTexture.d.ts.map +1 -0
  1132. package/dist/webgpu/WebGPUTexture.js +2 -0
  1133. package/dist/webgpu/WebGPUTexture.js.map +1 -0
  1134. package/package.json +18 -0
  1135. package/src/ArchitecturalLightingFixtures.ts +241 -0
  1136. package/src/ArchitecturalMaterialCatalog.ts +130 -0
  1137. package/src/ArchitecturalMeasurementFixtures.ts +155 -0
  1138. package/src/BRDFLut.ts +47 -0
  1139. package/src/CameraFraming.ts +200 -0
  1140. package/src/CanonicalSceneFixtures.ts +95 -0
  1141. package/src/CascadedShadowMaps.ts +449 -0
  1142. package/src/ColorManagement.ts +127 -0
  1143. package/src/CullingFixtures.ts +280 -0
  1144. package/src/DecalGeometry.ts +26 -0
  1145. package/src/DepthPass.ts +110 -0
  1146. package/src/EnvironmentBackgroundPass.ts +194 -0
  1147. package/src/EnvironmentBackgroundResources.ts +309 -0
  1148. package/src/EnvironmentLighting.ts +96 -0
  1149. package/src/EnvironmentMapResources.ts +1026 -0
  1150. package/src/EnvironmentPipeline.ts +69 -0
  1151. package/src/EnvironmentPlatform.ts +1306 -0
  1152. package/src/EnvironmentPreset.ts +155 -0
  1153. package/src/Exposure.ts +66 -0
  1154. package/src/ExternalParityRenderPreset.ts +725 -0
  1155. package/src/ForwardPass.ts +1639 -0
  1156. package/src/FrameVisualMetrics.ts +218 -0
  1157. package/src/Geometry.ts +461 -0
  1158. package/src/GeometryPrimitives.ts +2 -0
  1159. package/src/HDRRenderPipeline.ts +94 -0
  1160. package/src/IBL.ts +86 -0
  1161. package/src/IndexBuffer.ts +57 -0
  1162. package/src/InstancedPBRMaterial.ts +186 -0
  1163. package/src/InstancedUnlitMaterial.ts +60 -0
  1164. package/src/Instancing.ts +19 -0
  1165. package/src/LightCollector.ts +82 -0
  1166. package/src/LightUniforms.ts +47 -0
  1167. package/src/LightingDebug.ts +80 -0
  1168. package/src/LightingDefaults.ts +79 -0
  1169. package/src/LightingRig.ts +301 -0
  1170. package/src/LineGeometry.ts +2 -0
  1171. package/src/Material.ts +209 -0
  1172. package/src/MaterialBinding.ts +131 -0
  1173. package/src/MaterialInstance.ts +59 -0
  1174. package/src/MaterialPresets.ts +272 -0
  1175. package/src/MorphTarget.ts +123 -0
  1176. package/src/MorphUnlitMaterial.ts +54 -0
  1177. package/src/NormalMappedPBRMaterial.ts +188 -0
  1178. package/src/OceanFixtures.ts +318 -0
  1179. package/src/PBRLightingDefaults.ts +12 -0
  1180. package/src/PBRMaterial.ts +442 -0
  1181. package/src/PMREM.ts +53 -0
  1182. package/src/PbrReference.ts +681 -0
  1183. package/src/PostProcessPass.ts +2507 -0
  1184. package/src/ProceduralTextureFixtures.ts +393 -0
  1185. package/src/ProductTurntableFixtures.ts +815 -0
  1186. package/src/Raycaster.ts +21 -0
  1187. package/src/ReflectionProbe.ts +13 -0
  1188. package/src/ReflectionSurfaces.ts +219 -0
  1189. package/src/RenderBackend.ts +43 -0
  1190. package/src/RenderDebugViews.ts +138 -0
  1191. package/src/RenderDevice.ts +836 -0
  1192. package/src/RenderGraph.ts +194 -0
  1193. package/src/RenderPass.ts +27 -0
  1194. package/src/RenderPipeline.ts +101 -0
  1195. package/src/RenderQueue.ts +12 -0
  1196. package/src/RenderState.ts +12 -0
  1197. package/src/Renderer.ts +2626 -0
  1198. package/src/RendererDebugOverlay.ts +80 -0
  1199. package/src/RendererFeatureGates.ts +150 -0
  1200. package/src/RendererPostprocessPlan.ts +279 -0
  1201. package/src/RendererTiming.ts +251 -0
  1202. package/src/RendererVisualPipelineReport.ts +836 -0
  1203. package/src/ResourceLifecycle.ts +21 -0
  1204. package/src/Sampler.ts +37 -0
  1205. package/src/SceneOptimization.ts +518 -0
  1206. package/src/ShaderChunks.ts +393 -0
  1207. package/src/ShaderLibrary.ts +2738 -0
  1208. package/src/ShaderModule.ts +36 -0
  1209. package/src/ShaderPreprocessor.ts +260 -0
  1210. package/src/ShaderReflection.ts +201 -0
  1211. package/src/ShadowMap.ts +237 -0
  1212. package/src/ShadowPass.ts +198 -0
  1213. package/src/ShadowProjection.ts +115 -0
  1214. package/src/SkinnedLitMaterial.ts +366 -0
  1215. package/src/SkinnedUnlitMaterial.ts +63 -0
  1216. package/src/SkinningBounds.ts +131 -0
  1217. package/src/SpaceEnvironmentFixtures.ts +200 -0
  1218. package/src/SpriteGeometry.ts +21 -0
  1219. package/src/StereoCameraRig.ts +127 -0
  1220. package/src/StereoEffects.ts +274 -0
  1221. package/src/TerrainFixtures.ts +180 -0
  1222. package/src/Texture.ts +307 -0
  1223. package/src/TextureBinding.ts +91 -0
  1224. package/src/TexturedPBRMaterial.ts +1112 -0
  1225. package/src/TexturedUnlitMaterial.ts +67 -0
  1226. package/src/ToneMapping.ts +105 -0
  1227. package/src/UniformBinder.ts +16 -0
  1228. package/src/UniformLayout.ts +129 -0
  1229. package/src/UnlitMaterial.ts +75 -0
  1230. package/src/VegetationFixtures.ts +314 -0
  1231. package/src/VertexBuffer.ts +120 -0
  1232. package/src/VertexFormat.ts +171 -0
  1233. package/src/VoxelWorldFixtures.ts +280 -0
  1234. package/src/WeatherFixtures.ts +223 -0
  1235. package/src/WebGL2Device.ts +2280 -0
  1236. package/src/WebGL2StateCache.ts +330 -0
  1237. package/src/WebGPUDevice.ts +2806 -0
  1238. package/src/WebGPURenderToTextureProof.ts +139 -0
  1239. package/src/advanced-runtime/AdvancedRenderer.ts +73 -0
  1240. package/src/advanced-runtime/index.ts +9 -0
  1241. package/src/cinematic/BloomPass.ts +26 -0
  1242. package/src/cinematic/CinematicDepthComposition.ts +30 -0
  1243. package/src/cinematic/CinematicEvidence.ts +123 -0
  1244. package/src/cinematic/CinematicLightingRig.ts +144 -0
  1245. package/src/cinematic/CinematicMaterialPresets.ts +130 -0
  1246. package/src/cinematic/CinematicPostProcess.ts +83 -0
  1247. package/src/cinematic/DepthHazePass.ts +30 -0
  1248. package/src/cinematic/EmissivePracticalLightSystem.ts +45 -0
  1249. package/src/cinematic/FilmGrainPass.ts +24 -0
  1250. package/src/cinematic/FogVolumeSystem.ts +30 -0
  1251. package/src/cinematic/GlowCardSystem.ts +44 -0
  1252. package/src/cinematic/RainParticleSystem.ts +151 -0
  1253. package/src/cinematic/VignettePass.ts +25 -0
  1254. package/src/cinematic/WetReflectionApproximation.ts +27 -0
  1255. package/src/cinematic/index.ts +14 -0
  1256. package/src/effects/CollisionModule.ts +64 -0
  1257. package/src/effects/ColorModule.ts +60 -0
  1258. package/src/effects/ForceModule.ts +25 -0
  1259. package/src/effects/GPUParticleBackend.ts +569 -0
  1260. package/src/effects/Particle.ts +108 -0
  1261. package/src/effects/ParticleDiagnostics.ts +224 -0
  1262. package/src/effects/ParticleEffectPresets.ts +147 -0
  1263. package/src/effects/ParticleEmitter.ts +326 -0
  1264. package/src/effects/ParticleModule.ts +26 -0
  1265. package/src/effects/ParticleRenderPass.ts +117 -0
  1266. package/src/effects/ParticleRenderer.ts +132 -0
  1267. package/src/effects/ParticleSystem.ts +333 -0
  1268. package/src/effects/SizeModule.ts +56 -0
  1269. package/src/effects/TrailModule.ts +72 -0
  1270. package/src/effects/VelocityModule.ts +75 -0
  1271. package/src/effects/index.ts +15 -0
  1272. package/src/index.ts +914 -0
  1273. package/src/materials/AlphaSorting.ts +30 -0
  1274. package/src/materials/MaterialExtensions.ts +42 -0
  1275. package/src/materials/PhysicalMaterial.ts +133 -0
  1276. package/src/materials/TransmissionPass.ts +51 -0
  1277. package/src/performance/BVH.ts +18 -0
  1278. package/src/performance/Batcher.ts +2 -0
  1279. package/src/performance/FrustumCuller.ts +9 -0
  1280. package/src/performance/LOD.ts +20 -0
  1281. package/src/performance/Octree.ts +10 -0
  1282. package/src/performance/RenderItemSorting.ts +167 -0
  1283. package/src/performance/RendererStats.ts +43 -0
  1284. package/src/performance/ResourceBudget.ts +44 -0
  1285. package/src/postprocess/BloomPass.ts +28 -0
  1286. package/src/postprocess/CinematicDiagnostics.ts +642 -0
  1287. package/src/postprocess/ColorGradingPass.ts +24 -0
  1288. package/src/postprocess/DepthOfFieldPass.ts +12 -0
  1289. package/src/postprocess/EffectComposer.ts +349 -0
  1290. package/src/postprocess/SSAOPass.ts +20 -0
  1291. package/src/postprocess/index.ts +34 -0
  1292. package/src/production-runtime/AnimationControlsPipeline.ts +77 -0
  1293. package/src/production-runtime/PBRHDRPipeline.ts +381 -0
  1294. package/src/production-runtime/ProductionEffectsPipeline.ts +85 -0
  1295. package/src/production-runtime/ProductionRendererTypes.ts +136 -0
  1296. package/src/production-runtime/ProductionRuntimeRenderer.ts +172 -0
  1297. package/src/production-runtime/ProductionWebGL2Renderer.ts +313 -0
  1298. package/src/production-runtime/ProductionWebGPURenderer.ts +396 -0
  1299. package/src/production-runtime/TransmissionBackdropCapture.ts +130 -0
  1300. package/src/production-runtime/animation/MorphTargetRenderer.ts +2 -0
  1301. package/src/production-runtime/animation/SkinningRenderer.ts +2 -0
  1302. package/src/production-runtime/backends/RendererBackend.ts +17 -0
  1303. package/src/production-runtime/backends/WebGL2RendererBackend.ts +30 -0
  1304. package/src/production-runtime/backends/WebGPURendererBackend.ts +24 -0
  1305. package/src/production-runtime/backends/webgl2/WebGL2Buffer.ts +2 -0
  1306. package/src/production-runtime/backends/webgl2/WebGL2Capabilities.ts +2 -0
  1307. package/src/production-runtime/backends/webgl2/WebGL2RenderTarget.ts +2 -0
  1308. package/src/production-runtime/backends/webgl2/WebGL2Shader.ts +2 -0
  1309. package/src/production-runtime/backends/webgl2/WebGL2StateCache.ts +1 -0
  1310. package/src/production-runtime/backends/webgl2/WebGL2Texture.ts +2 -0
  1311. package/src/production-runtime/backends/webgpu/WebGPUBuffer.ts +2 -0
  1312. package/src/production-runtime/backends/webgpu/WebGPUCapabilities.ts +2 -0
  1313. package/src/production-runtime/backends/webgpu/WebGPURenderTarget.ts +2 -0
  1314. package/src/production-runtime/backends/webgpu/WebGPUShader.ts +2 -0
  1315. package/src/production-runtime/backends/webgpu/WebGPUTexture.ts +2 -0
  1316. package/src/production-runtime/color/ColorManagement.ts +3 -0
  1317. package/src/production-runtime/color/ToneMapping.ts +7 -0
  1318. package/src/production-runtime/diagnostics/FrameCapture.ts +2 -0
  1319. package/src/production-runtime/diagnostics/GPUCapabilities.ts +2 -0
  1320. package/src/production-runtime/diagnostics/RendererStats.ts +2 -0
  1321. package/src/production-runtime/environment/EnvironmentMap.ts +1 -0
  1322. package/src/production-runtime/environment/HDRLoader.ts +57 -0
  1323. package/src/production-runtime/environment/PMREMGenerator.ts +713 -0
  1324. package/src/production-runtime/framegraph/FrameGraph.ts +18 -0
  1325. package/src/production-runtime/framegraph/RenderPass.ts +15 -0
  1326. package/src/production-runtime/geometry/ProjectedDecalGeometry.ts +439 -0
  1327. package/src/production-runtime/index.ts +127 -0
  1328. package/src/production-runtime/lights/LightManager.ts +7 -0
  1329. package/src/production-runtime/lights/ShadowMapRenderer.ts +5 -0
  1330. package/src/production-runtime/materials/GLTFMaterialAdapter.ts +6 -0
  1331. package/src/production-runtime/materials/GLTFPBRMaterialAdapter.ts +2 -0
  1332. package/src/production-runtime/materials/MaterialCompiler.ts +7 -0
  1333. package/src/production-runtime/materials/MaterialTextureBindings.ts +5 -0
  1334. package/src/production-runtime/materials/PBRMaterial.ts +2 -0
  1335. package/src/production-runtime/materials/PBRShaderFeatures.ts +2 -0
  1336. package/src/production-runtime/passes/ContactShadowPass.ts +184 -0
  1337. package/src/production-runtime/passes/DepthPrepass.ts +7 -0
  1338. package/src/production-runtime/passes/OpaquePass.ts +7 -0
  1339. package/src/production-runtime/passes/ShadowPass.ts +7 -0
  1340. package/src/production-runtime/passes/SkyboxPass.ts +7 -0
  1341. package/src/production-runtime/passes/ToneMappingPass.ts +7 -0
  1342. package/src/production-runtime/passes/TransparentPass.ts +7 -0
  1343. package/src/production-runtime/postprocess/BloomPass.ts +51 -0
  1344. package/src/production-runtime/postprocess/ColorGradingPass.ts +49 -0
  1345. package/src/production-runtime/postprocess/DOFPass.ts +47 -0
  1346. package/src/production-runtime/postprocess/FXAAPass.ts +53 -0
  1347. package/src/production-runtime/postprocess/ProductionEffectComposer.ts +78 -0
  1348. package/src/production-runtime/postprocess/ProductionPostProcessTypes.ts +174 -0
  1349. package/src/production-runtime/postprocess/SSAOPass.ts +45 -0
  1350. package/src/production-runtime/resources/GPUBuffer.ts +2 -0
  1351. package/src/production-runtime/resources/GPUTexture.ts +2 -0
  1352. package/src/production-runtime/resources/RenderTarget.ts +3 -0
  1353. package/src/production-runtime/resources/ResourceCache.ts +7 -0
  1354. package/src/production-runtime/scene/Camera.ts +1 -0
  1355. package/src/production-runtime/scene/Lights.ts +2 -0
  1356. package/src/production-runtime/scene/RenderableMesh.ts +2 -0
  1357. package/src/production-runtime/scene/RenderablePrimitive.ts +1 -0
  1358. package/src/production-runtime/scene/RenderableScene.ts +4 -0
  1359. package/src/production-runtime/shaders/ShaderProgramLibrary.ts +7 -0
  1360. package/src/production-runtime/shaders/chunks/brdf.glsl +2 -0
  1361. package/src/production-runtime/shaders/chunks/ibl.glsl +3 -0
  1362. package/src/production-runtime/shaders/chunks/pbr.frag.glsl +47 -0
  1363. package/src/production-runtime/shaders/chunks/pbr.vert.glsl +8 -0
  1364. package/src/production-runtime/shaders/chunks/shadows.glsl +2 -0
  1365. package/src/production-runtime/shaders/wgsl/pbr.wgsl +3 -0
  1366. package/src/production-runtime/shaders/wgsl/postprocess.wgsl +2 -0
  1367. package/src/production-runtime/shaders/wgsl/skybox.wgsl +2 -0
  1368. package/src/shaders/depth.frag.glsl +5 -0
  1369. package/src/shaders/depth.vert.glsl +8 -0
  1370. package/src/shaders/pbr-direct.frag.glsl +687 -0
  1371. package/src/shaders/pbr-direct.vert.glsl +18 -0
  1372. package/src/shaders/unlit.frag.glsl +18 -0
  1373. package/src/shaders/unlit.vert.glsl +13 -0
  1374. package/src/shadows/CascadedShadowPipeline.ts +53 -0
  1375. package/src/shadows/ContactShadows.ts +106 -0
  1376. package/src/shadows/ShadowDebugViews.ts +46 -0
  1377. package/src/threejs-compatibility/InstancingSystem.ts +17 -0
  1378. package/src/threejs-compatibility/LightingSystem.ts +22 -0
  1379. package/src/threejs-compatibility/MaterialSystem.ts +9 -0
  1380. package/src/threejs-compatibility/RenderTargetSystem.ts +35 -0
  1381. package/src/threejs-compatibility/RendererDiagnostics.ts +61 -0
  1382. package/src/threejs-compatibility/SceneRenderer.ts +34 -0
  1383. package/src/threejs-compatibility/ShadowSystem.ts +19 -0
  1384. package/src/threejs-compatibility/TextureSystem.ts +19 -0
  1385. package/src/threejs-compatibility/ThreeCompatRenderer.ts +90 -0
  1386. package/src/threejs-compatibility/TransparencySystem.ts +19 -0
  1387. package/src/threejs-compatibility/index.ts +29 -0
  1388. package/src/threejs-compatibility/performance/BVH.ts +14 -0
  1389. package/src/threejs-compatibility/performance/FrustumCulling.ts +10 -0
  1390. package/src/threejs-compatibility/performance/Instancing.ts +4 -0
  1391. package/src/threejs-compatibility/performance/LODSystem.ts +16 -0
  1392. package/src/threejs-compatibility/performance/OcclusionCulling.ts +6 -0
  1393. package/src/threejs-compatibility/performance/RaycastAcceleration.ts +12 -0
  1394. package/src/threejs-compatibility/performance/RendererProfiler.ts +19 -0
  1395. package/src/threejs-compatibility/performance/TextureStreaming.ts +4 -0
  1396. package/src/threejs-compatibility/performance/index.ts +12 -0
  1397. package/src/threejs-compatibility/postprocess/BloomPass.ts +16 -0
  1398. package/src/threejs-compatibility/postprocess/ColorGradingPass.ts +16 -0
  1399. package/src/threejs-compatibility/postprocess/DepthOfFieldPass.ts +21 -0
  1400. package/src/threejs-compatibility/postprocess/EffectComposer.ts +14 -0
  1401. package/src/threejs-compatibility/postprocess/FXAAPass.ts +15 -0
  1402. package/src/threejs-compatibility/postprocess/MotionBlurPass.ts +20 -0
  1403. package/src/threejs-compatibility/postprocess/OutlinePass.ts +21 -0
  1404. package/src/threejs-compatibility/postprocess/PostProcessTypes.ts +169 -0
  1405. package/src/threejs-compatibility/postprocess/RenderPass.ts +9 -0
  1406. package/src/threejs-compatibility/postprocess/SMAAPass.ts +15 -0
  1407. package/src/threejs-compatibility/postprocess/SSAOPass.ts +21 -0
  1408. package/src/threejs-compatibility/postprocess/ShaderPass.ts +7 -0
  1409. package/src/threejs-compatibility/postprocess/TAAPass.ts +15 -0
  1410. package/src/threejs-compatibility/postprocess/VignettePass.ts +16 -0
  1411. package/src/threejs-compatibility/postprocess/index.ts +15 -0
  1412. package/src/threejs-compatibility/shaders/NodeMaterial.ts +21 -0
  1413. package/src/threejs-compatibility/shaders/RawShaderMaterial.ts +6 -0
  1414. package/src/threejs-compatibility/shaders/ShaderDiagnostics.ts +17 -0
  1415. package/src/threejs-compatibility/shaders/ShaderMaterial.ts +18 -0
  1416. package/src/threejs-compatibility/shaders/ThreeCompatShaderChunks.ts +6 -0
  1417. package/src/threejs-compatibility/shaders/Uniforms.ts +18 -0
  1418. package/src/threejs-compatibility/shaders/index.ts +9 -0
  1419. package/src/threejs-compatibility/vfx/GPUPointCloud.ts +7 -0
  1420. package/src/threejs-compatibility/vfx/LineRenderer.ts +13 -0
  1421. package/src/threejs-compatibility/vfx/ParticleSystem.ts +23 -0
  1422. package/src/threejs-compatibility/vfx/SpriteSystem.ts +14 -0
  1423. package/src/threejs-compatibility/vfx/TrailRenderer.ts +8 -0
  1424. package/src/threejs-compatibility/vfx/VFXDiagnostics.ts +23 -0
  1425. package/src/threejs-compatibility/vfx/index.ts +9 -0
  1426. package/src/threejs-example-parity/index.ts +205 -0
  1427. package/src/webgpu/WebGPUBuffer.ts +1 -0
  1428. package/src/webgpu/WebGPUCompute.ts +2 -0
  1429. package/src/webgpu/WebGPUPipelineCache.ts +15 -0
  1430. package/src/webgpu/WebGPUPostProcess.ts +2 -0
  1431. package/src/webgpu/WebGPUTexture.ts +2 -0
  1432. package/tsconfig.json +26 -0
  1433. package/vitest.config.ts +20 -0
@@ -0,0 +1,2094 @@
1
+ import { Bounds3 as SceneBounds3, Camera, DirectionalLight, Light, PointLight, Scene, SpotLight, identityMat4, invertMat4, multiplyMat4, orthographicMat4, perspectiveMat4, transformPoint } from "@aura3d/scene";
2
+ import { createRenderDevice } from "./RenderBackend.js";
3
+ import { RenderDeviceError } from "./RenderDevice.js";
4
+ import { ENVIRONMENT_BACKGROUND_COLOR_RESOURCE, EnvironmentBackgroundPass } from "./EnvironmentBackgroundPass.js";
5
+ import { ForwardPass } from "./ForwardPass.js";
6
+ import { LightCollector } from "./LightCollector.js";
7
+ import { Geometry } from "./Geometry.js";
8
+ import {} from "./MorphTarget.js";
9
+ import { computeSkinnedMorphTargetWeightedBounds } from "./SkinningBounds.js";
10
+ import { RenderGraph } from "./RenderGraph.js";
11
+ import { BloomPass, FXAAPass, ToneMappingPass, bloomFloatPixels, bloomPixels, chromaticAberrationPixels, colorGradePixels, contactShadowPixels, createDepthTextureBinding, depthOfFieldPixels, filmGrainPixels, fusedLdrPostprocessPixels, fxaaPixels, motionBlurPixels, outlinePixels, ssaoPixels, ssrPixels, taaPixels, toneMapFloatPixels, toneMapPixels, writePostProcessPixels } from "./PostProcessPass.js";
12
+ import { createRendererPostprocessPasses, createRendererPostprocessPlanDiagnostics } from "./RendererPostprocessPlan.js";
13
+ import { createDefaultShaderLibrary } from "./ShaderLibrary.js";
14
+ import { ShadowMap } from "./ShadowMap.js";
15
+ import { ShadowPass } from "./ShadowPass.js";
16
+ import { Sampler } from "./Sampler.js";
17
+ import { TextureBinding } from "./TextureBinding.js";
18
+ import { computePerspectiveCameraFrame } from "./CameraFraming.js";
19
+ import { assertRendererFeatures, createRendererFeatureReport } from "./RendererFeatureGates.js";
20
+ import { batchStaticRenderItems } from "./SceneOptimization.js";
21
+ export const DEFAULT_RENDERER_AUTO_FRAME_OPTIONS = {
22
+ paddingRatio: 0.14,
23
+ yawRadians: -0.38,
24
+ pitchRadians: -0.18,
25
+ nearPadding: 0.2,
26
+ farPadding: 2.4
27
+ };
28
+ export const DEFAULT_RENDERER_ENVIRONMENT_LIGHTING = {
29
+ color: [0.78, 0.8, 0.84],
30
+ intensity: 0.42,
31
+ proceduralMap: {
32
+ skyColor: [0.64, 0.76, 0.94],
33
+ horizonColor: [0.94, 0.82, 0.62],
34
+ groundColor: [0.12, 0.13, 0.15],
35
+ specularColor: [1, 0.94, 0.78],
36
+ intensity: 0.5,
37
+ specularIntensity: 0.82
38
+ }
39
+ };
40
+ const DISABLED_RENDERER_ENVIRONMENT_LIGHTING = {
41
+ color: [0, 0, 0],
42
+ intensity: 0,
43
+ proceduralMap: {
44
+ skyColor: [0, 0, 0],
45
+ horizonColor: [0, 0, 0],
46
+ groundColor: [0, 0, 0],
47
+ specularColor: [0, 0, 0],
48
+ intensity: 0,
49
+ specularIntensity: 0
50
+ },
51
+ environmentMapIntensity: 0,
52
+ environmentMapSpecularIntensity: 0
53
+ };
54
+ export const DEFAULT_RENDERER_DIRECT_LIGHTING = {
55
+ key: {
56
+ color: [1, 0.92, 0.78],
57
+ intensity: 2.25,
58
+ direction: [0.42, -0.58, -0.7]
59
+ },
60
+ fill: {
61
+ color: [0.48, 0.62, 0.9],
62
+ intensity: 0.55,
63
+ direction: [-0.35, -0.22, -0.91]
64
+ }
65
+ };
66
+ export class Renderer {
67
+ device;
68
+ graph = new RenderGraph();
69
+ shaderLibrary;
70
+ canvas;
71
+ width;
72
+ height;
73
+ clearColor;
74
+ disposed = false;
75
+ animationLoop = null;
76
+ fusedLdrPostprocessScratch = {};
77
+ constructor(device, options) {
78
+ this.device = device;
79
+ this.canvas = options.canvas;
80
+ this.width = options.width ?? inferInitialCanvasDimension(options.canvas, "width");
81
+ this.height = options.height ?? inferInitialCanvasDimension(options.canvas, "height");
82
+ this.clearColor = options.clearColor ?? [0, 0, 0, 1];
83
+ this.shaderLibrary = options.shaderLibrary ?? createDefaultShaderLibrary();
84
+ this.resizeCanvas(this.width, this.height);
85
+ }
86
+ static async create(options = {}) {
87
+ const device = await createRenderDevice(options);
88
+ if (options.requiredFeatures && options.requiredFeatures.length > 0) {
89
+ assertRendererFeatures(device, options.requiredFeatures);
90
+ }
91
+ return new Renderer(device, options);
92
+ }
93
+ getFeatureReport() {
94
+ return createRendererFeatureReport(this.device);
95
+ }
96
+ resize(width, height) {
97
+ this.assertAlive();
98
+ if (width <= 0 || height <= 0 || !Number.isInteger(width) || !Number.isInteger(height)) {
99
+ throw new RenderDeviceError("Renderer dimensions must be positive integers", "INVALID_FRAME_SIZE", { width, height });
100
+ }
101
+ this.width = width;
102
+ this.height = height;
103
+ this.resizeCanvas(width, height);
104
+ }
105
+ resizeToDisplay(options = {}) {
106
+ this.assertAlive();
107
+ if (!this.canvas) {
108
+ throw new RenderDeviceError("resizeToDisplay requires a canvas-backed renderer", "CANVAS_REQUIRED");
109
+ }
110
+ const cssWidth = options.cssWidth ?? readCanvasCssSize(this.canvas, "width");
111
+ const cssHeight = options.cssHeight ?? readCanvasCssSize(this.canvas, "height");
112
+ const devicePixelRatio = options.devicePixelRatio ?? globalThis.devicePixelRatio ?? 1;
113
+ if (![cssWidth, cssHeight, devicePixelRatio].every(Number.isFinite) || cssWidth <= 0 || cssHeight <= 0 || devicePixelRatio <= 0) {
114
+ throw new RenderDeviceError("Display size and DPR must be finite positive values", "INVALID_DISPLAY_SIZE", {
115
+ cssWidth,
116
+ cssHeight,
117
+ devicePixelRatio
118
+ });
119
+ }
120
+ const width = Math.max(1, Math.round(cssWidth * devicePixelRatio));
121
+ const height = Math.max(1, Math.round(cssHeight * devicePixelRatio));
122
+ const resized = width !== this.width || height !== this.height;
123
+ if (resized) {
124
+ this.resize(width, height);
125
+ }
126
+ return { resized, cssWidth, cssHeight, devicePixelRatio, width, height };
127
+ }
128
+ startAnimationLoop(callback) {
129
+ this.assertAlive();
130
+ this.animationLoop?.stop();
131
+ const loop = new RendererAnimationLoopImpl(this, callback);
132
+ this.animationLoop = loop;
133
+ loop.start();
134
+ return loop;
135
+ }
136
+ render(sourceOrInput, camera) {
137
+ this.assertAlive();
138
+ const { source, camera: inputCamera } = normalizeRendererInput(sourceOrInput, camera);
139
+ sceneFromSource(source)?.updateWorldTransforms();
140
+ const cameraPolicy = collectCameraPolicy(source);
141
+ const identityPolicyIgnoresSceneCamera = inputCamera === undefined && cameraPolicy === "identity";
142
+ const autoFrameOverridesSceneCamera = inputCamera === undefined && hasExplicitAutoFrameCameraPolicy(source);
143
+ const resolvedCamera = resolveCamera(source, inputCamera, { width: this.width, height: this.height }, {
144
+ allowSceneCamera: !identityPolicyIgnoresSceneCamera && !autoFrameOverridesSceneCamera
145
+ });
146
+ if (!resolvedCamera && cameraPolicy === "require") {
147
+ throw new RenderDeviceError("RenderSource requires an explicit camera but none was supplied or found in the scene.", "CAMERA_REQUIRED");
148
+ }
149
+ let cameraViewProjection = resolvedCamera?.viewProjectionMatrix;
150
+ const collectedItems = collectRenderItemsWithDiagnostics(source, cameraViewProjection, resolvedCamera?.camera);
151
+ const collectionDiagnostics = collectedItems.diagnostics;
152
+ let items = collectedItems.items;
153
+ const lights = collectRenderLights(source);
154
+ const environmentBackground = collectEnvironmentBackground(source);
155
+ const environmentLighting = collectEnvironmentLighting(source);
156
+ const environmentFog = collectEnvironmentFog(source);
157
+ const explicitShadowMap = collectForwardShadowMap(source);
158
+ const shadowOptions = collectRendererShadowOptions(source);
159
+ const sourceCameraPosition = collectSourceCameraPosition(source);
160
+ const explicitRenderTarget = collectRenderTarget(source);
161
+ validateExplicitRenderTarget(explicitRenderTarget, this.width, this.height);
162
+ let cameraPosition = sourceCameraPosition ?? resolvedCamera?.cameraPosition;
163
+ if (!resolvedCamera && cameraPolicy === "auto-frame") {
164
+ const autoFrame = createAutoFrameCamera(source, items, this.width, this.height);
165
+ if (autoFrame) {
166
+ cameraViewProjection = autoFrame.viewProjectionMatrix;
167
+ items = applyViewProjection(items, autoFrame.viewProjectionMatrix);
168
+ cameraPosition = sourceCameraPosition ?? autoFrame.cameraPosition;
169
+ }
170
+ }
171
+ const postprocess = collectPostprocess(source);
172
+ const ownedTargets = [];
173
+ const ownedShadowPasses = [];
174
+ this.graph.clear();
175
+ let postprocessTargetFormat;
176
+ if (postprocess) {
177
+ const format = postprocess.targetFormat ?? defaultPostprocessTargetFormat(this.device, postprocess);
178
+ postprocessTargetFormat = format;
179
+ if ((format === "rgba16f" || format === "rgba32f") && !this.device.info.capabilities?.includes("hdr-render-targets")) {
180
+ throw new RenderDeviceError("Renderer HDR postprocess requires an HDR-capable backend", "HDR_POSTPROCESS_UNSUPPORTED", {
181
+ backend: this.device.kind,
182
+ format
183
+ });
184
+ }
185
+ if ((format === "rgba16f" || format === "rgba32f") && postprocess.toneMapping === false) {
186
+ throw new RenderDeviceError("Renderer HDR postprocess requires tone mapping before presentation or LDR postprocess passes", "HDR_POSTPROCESS_TONEMAPPING_REQUIRED", {
187
+ backend: this.device.kind,
188
+ format
189
+ });
190
+ }
191
+ if (!this.device.presentRenderTarget) {
192
+ throw new RenderDeviceError("Renderer postprocess requires a backend presentation path", "POSTPROCESS_PRESENT_UNSUPPORTED", {
193
+ backend: this.device.kind
194
+ });
195
+ }
196
+ const requiresDepthTexture = postprocessRequiresDepthTexture(postprocess);
197
+ if (requiresDepthTexture && !this.device.info.capabilities?.includes("depth-textures")) {
198
+ throw new RenderDeviceError("Depth-aware renderer postprocess requires a backend with sampleable depth texture render targets.", "DEPTH_POSTPROCESS_UNSUPPORTED", {
199
+ backend: this.device.kind
200
+ });
201
+ }
202
+ const forwardTarget = this.device.createRenderTarget({
203
+ width: this.width,
204
+ height: this.height,
205
+ label: "renderer-forward-color",
206
+ format,
207
+ depth: requiresDepthTexture ? "texture" : true
208
+ });
209
+ ownedTargets.push(forwardTarget);
210
+ this.device.setRenderTarget(forwardTarget);
211
+ }
212
+ this.device.beginFrame(this.width, this.height);
213
+ try {
214
+ const rendererShadowMap = explicitShadowMap ?? this.executeRendererShadowMap({
215
+ shadowOptions,
216
+ source,
217
+ items,
218
+ lights,
219
+ ownedTargets,
220
+ ownedShadowPasses
221
+ });
222
+ if (postprocess) {
223
+ const forwardTarget = ownedTargets[0];
224
+ if (!forwardTarget) {
225
+ throw new RenderDeviceError("Renderer postprocess missing forward render target", "POSTPROCESS_TARGET_MISSING");
226
+ }
227
+ this.device.setRenderTarget(forwardTarget);
228
+ }
229
+ else {
230
+ this.device.setRenderTarget(explicitRenderTarget ?? null);
231
+ }
232
+ this.device.clear(this.clearColor);
233
+ if (environmentBackground) {
234
+ this.graph.addPass(new EnvironmentBackgroundPass({
235
+ ...environmentBackground,
236
+ outputColorSpace: postprocess ? "linear" : environmentBackground.outputColorSpace,
237
+ inverseViewProjectionMatrix: environmentBackground.inverseViewProjectionMatrix ?? invertMat4(cameraViewProjection ?? identityMat4()),
238
+ shaderLibrary: this.shaderLibrary
239
+ }));
240
+ }
241
+ this.graph.addPass(new ForwardPass({
242
+ items,
243
+ lights,
244
+ environmentLighting,
245
+ environmentFog,
246
+ inputColorResource: environmentBackground ? ENVIRONMENT_BACKGROUND_COLOR_RESOURCE : undefined,
247
+ shadowMap: rendererShadowMap,
248
+ cameraPosition,
249
+ outputColorSpace: postprocess ? "linear" : "srgb",
250
+ shaderLibrary: this.shaderLibrary
251
+ }));
252
+ this.graph.execute({ device: this.device, width: this.width, height: this.height });
253
+ if (postprocess) {
254
+ this.executePostprocess(postprocess, ownedTargets, explicitRenderTarget);
255
+ }
256
+ }
257
+ finally {
258
+ this.device.endFrame();
259
+ for (const shadowPass of ownedShadowPasses) {
260
+ shadowPass.dispose();
261
+ }
262
+ for (const target of ownedTargets) {
263
+ target.dispose();
264
+ }
265
+ }
266
+ return withRendererFrameDiagnostics(this.device.getDiagnostics(), collectionDiagnostics, createPostprocessDiagnostics(postprocess, ownedTargets, this.width, this.height, {
267
+ targetFormat: postprocessTargetFormat,
268
+ nativeLdrPostprocess: Boolean(this.device.presentLdrPostprocess),
269
+ rendererDepthAvailable: Boolean(postprocess && postprocessRequiresDepthTexture(postprocess) && this.device.info.capabilities?.includes("depth-textures"))
270
+ }));
271
+ }
272
+ async renderAsync(sourceOrInput, camera) {
273
+ this.assertAlive();
274
+ const { source, camera: inputCamera } = normalizeRendererInput(sourceOrInput, camera);
275
+ sceneFromSource(source)?.updateWorldTransforms();
276
+ const cameraPolicy = collectCameraPolicy(source);
277
+ const identityPolicyIgnoresSceneCamera = inputCamera === undefined && cameraPolicy === "identity";
278
+ const autoFrameOverridesSceneCamera = inputCamera === undefined && hasExplicitAutoFrameCameraPolicy(source);
279
+ const resolvedCamera = resolveCamera(source, inputCamera, { width: this.width, height: this.height }, {
280
+ allowSceneCamera: !identityPolicyIgnoresSceneCamera && !autoFrameOverridesSceneCamera
281
+ });
282
+ if (!resolvedCamera && cameraPolicy === "require") {
283
+ throw new RenderDeviceError("RenderSource requires an explicit camera but none was supplied or found in the scene.", "CAMERA_REQUIRED");
284
+ }
285
+ let cameraViewProjection = resolvedCamera?.viewProjectionMatrix;
286
+ const collectedItems = collectRenderItemsWithDiagnostics(source, cameraViewProjection, resolvedCamera?.camera);
287
+ const collectionDiagnostics = collectedItems.diagnostics;
288
+ let items = collectedItems.items;
289
+ const lights = collectRenderLights(source);
290
+ const environmentBackground = collectEnvironmentBackground(source);
291
+ const environmentLighting = collectEnvironmentLighting(source);
292
+ const environmentFog = collectEnvironmentFog(source);
293
+ const explicitShadowMap = collectForwardShadowMap(source);
294
+ const shadowOptions = collectRendererShadowOptions(source);
295
+ const sourceCameraPosition = collectSourceCameraPosition(source);
296
+ const explicitRenderTarget = collectRenderTarget(source);
297
+ validateExplicitRenderTarget(explicitRenderTarget, this.width, this.height);
298
+ let cameraPosition = sourceCameraPosition ?? resolvedCamera?.cameraPosition;
299
+ if (!resolvedCamera && cameraPolicy === "auto-frame") {
300
+ const autoFrame = createAutoFrameCamera(source, items, this.width, this.height);
301
+ if (autoFrame) {
302
+ cameraViewProjection = autoFrame.viewProjectionMatrix;
303
+ items = applyViewProjection(items, autoFrame.viewProjectionMatrix);
304
+ cameraPosition = sourceCameraPosition ?? autoFrame.cameraPosition;
305
+ }
306
+ }
307
+ const postprocess = collectPostprocess(source);
308
+ const ownedTargets = [];
309
+ const ownedShadowPasses = [];
310
+ this.graph.clear();
311
+ let postprocessTargetFormat;
312
+ if (postprocess) {
313
+ const format = postprocess.targetFormat ?? defaultPostprocessTargetFormat(this.device, postprocess);
314
+ postprocessTargetFormat = format;
315
+ if ((format === "rgba16f" || format === "rgba32f") && !this.device.info.capabilities?.includes("hdr-render-targets")) {
316
+ throw new RenderDeviceError("Renderer HDR postprocess requires an HDR-capable backend", "HDR_POSTPROCESS_UNSUPPORTED", {
317
+ backend: this.device.kind,
318
+ format
319
+ });
320
+ }
321
+ if ((format === "rgba16f" || format === "rgba32f") && postprocess.toneMapping === false) {
322
+ throw new RenderDeviceError("Renderer HDR postprocess requires tone mapping before presentation or LDR postprocess passes", "HDR_POSTPROCESS_TONEMAPPING_REQUIRED", {
323
+ backend: this.device.kind,
324
+ format
325
+ });
326
+ }
327
+ if (!this.device.presentRenderTarget) {
328
+ throw new RenderDeviceError("Renderer postprocess requires a backend presentation path", "POSTPROCESS_PRESENT_UNSUPPORTED", {
329
+ backend: this.device.kind
330
+ });
331
+ }
332
+ const requiresDepthTexture = postprocessRequiresDepthTexture(postprocess);
333
+ if (requiresDepthTexture && !this.device.info.capabilities?.includes("depth-textures")) {
334
+ throw new RenderDeviceError("Depth-aware renderer postprocess requires a backend with sampleable depth texture render targets.", "DEPTH_POSTPROCESS_UNSUPPORTED", {
335
+ backend: this.device.kind
336
+ });
337
+ }
338
+ const forwardTarget = this.device.createRenderTarget({
339
+ width: this.width,
340
+ height: this.height,
341
+ label: "renderer-forward-color",
342
+ format,
343
+ depth: requiresDepthTexture ? "texture" : true
344
+ });
345
+ ownedTargets.push(forwardTarget);
346
+ this.device.setRenderTarget(forwardTarget);
347
+ }
348
+ this.device.beginFrame(this.width, this.height);
349
+ try {
350
+ const rendererShadowMap = explicitShadowMap ?? this.executeRendererShadowMap({
351
+ shadowOptions,
352
+ source,
353
+ items,
354
+ lights,
355
+ ownedTargets,
356
+ ownedShadowPasses
357
+ });
358
+ if (postprocess) {
359
+ const forwardTarget = ownedTargets[0];
360
+ if (!forwardTarget) {
361
+ throw new RenderDeviceError("Renderer postprocess missing forward render target", "POSTPROCESS_TARGET_MISSING");
362
+ }
363
+ this.device.setRenderTarget(forwardTarget);
364
+ }
365
+ else {
366
+ this.device.setRenderTarget(explicitRenderTarget ?? null);
367
+ }
368
+ this.device.clear(this.clearColor);
369
+ if (environmentBackground) {
370
+ this.graph.addPass(new EnvironmentBackgroundPass({
371
+ ...environmentBackground,
372
+ outputColorSpace: postprocess ? "linear" : environmentBackground.outputColorSpace,
373
+ inverseViewProjectionMatrix: environmentBackground.inverseViewProjectionMatrix ?? invertMat4(cameraViewProjection ?? identityMat4()),
374
+ shaderLibrary: this.shaderLibrary
375
+ }));
376
+ }
377
+ this.graph.addPass(new ForwardPass({
378
+ items,
379
+ lights,
380
+ environmentLighting,
381
+ environmentFog,
382
+ inputColorResource: environmentBackground ? ENVIRONMENT_BACKGROUND_COLOR_RESOURCE : undefined,
383
+ shadowMap: rendererShadowMap,
384
+ cameraPosition,
385
+ outputColorSpace: postprocess ? "linear" : "srgb",
386
+ shaderLibrary: this.shaderLibrary
387
+ }));
388
+ this.graph.execute({ device: this.device, width: this.width, height: this.height });
389
+ if (postprocess) {
390
+ await this.executePostprocessAsync(postprocess, ownedTargets, explicitRenderTarget);
391
+ }
392
+ }
393
+ finally {
394
+ this.device.endFrame();
395
+ for (const shadowPass of ownedShadowPasses) {
396
+ shadowPass.dispose();
397
+ }
398
+ for (const target of ownedTargets) {
399
+ target.dispose();
400
+ }
401
+ }
402
+ return withRendererFrameDiagnostics(this.device.getDiagnostics(), collectionDiagnostics, createPostprocessDiagnostics(postprocess, ownedTargets, this.width, this.height, {
403
+ targetFormat: postprocessTargetFormat,
404
+ nativeLdrPostprocess: Boolean(this.device.presentLdrPostprocess),
405
+ rendererDepthAvailable: Boolean(postprocess && postprocessRequiresDepthTexture(postprocess) && this.device.info.capabilities?.includes("depth-textures"))
406
+ }));
407
+ }
408
+ renderScene(scene, camera) {
409
+ return this.render(scene, camera);
410
+ }
411
+ renderItems(items, camera, options = {}) {
412
+ return this.render({ ...options, renderItems: items }, camera);
413
+ }
414
+ captureFrame(source, camera) {
415
+ const diagnostics = source ? this.render(source, camera) : this.device.getDiagnostics();
416
+ const pixels = this.device.readPixels(0, 0, this.width, this.height);
417
+ const metadata = createRendererFrameCaptureMetadata(this.device, this.width, this.height, pixels, diagnostics);
418
+ return {
419
+ width: this.width,
420
+ height: this.height,
421
+ pixels,
422
+ diagnostics,
423
+ capturedAt: metadata.capturedAt,
424
+ renderSize: metadata.renderSize,
425
+ pixelHash: metadata.pixelHash,
426
+ pixelDigest: metadata.pixelDigest,
427
+ pixelStats: metadata.pixelStats,
428
+ diagnosticsSummary: metadata.diagnosticsSummary,
429
+ metadata
430
+ };
431
+ }
432
+ getDiagnostics() {
433
+ return this.device.getDiagnostics();
434
+ }
435
+ dispose() {
436
+ this.animationLoop?.stop();
437
+ this.animationLoop = null;
438
+ this.device.dispose();
439
+ this.disposed = true;
440
+ }
441
+ assertAlive() {
442
+ if (this.disposed || this.device.disposed) {
443
+ throw new RenderDeviceError("Renderer is disposed", "DISPOSED_DEVICE");
444
+ }
445
+ }
446
+ resizeCanvas(width, height) {
447
+ if (!this.canvas)
448
+ return;
449
+ if (this.canvas.width !== width) {
450
+ this.canvas.width = width;
451
+ }
452
+ if (this.canvas.height !== height) {
453
+ this.canvas.height = height;
454
+ }
455
+ }
456
+ executePostprocess(postprocess, ownedTargets, outputTarget) {
457
+ const forwardTarget = ownedTargets[0];
458
+ let current = forwardTarget;
459
+ if (!current) {
460
+ throw new RenderDeviceError("Renderer postprocess missing forward render target", "POSTPROCESS_TARGET_MISSING");
461
+ }
462
+ const passes = createRendererPostprocessPasses(postprocess);
463
+ if (passes.length === 0) {
464
+ if (outputTarget) {
465
+ this.device.setRenderTarget(current);
466
+ writePostProcessPixels(this.device, current, outputTarget, this.device.readPixels(0, 0, current.width, current.height));
467
+ }
468
+ else {
469
+ this.device.presentRenderTarget?.(current);
470
+ }
471
+ return;
472
+ }
473
+ if (this.executeFusedLdrPostprocess(current, passes, outputTarget))
474
+ return;
475
+ for (let index = 0; index < passes.length; index += 1) {
476
+ const pass = passes[index];
477
+ const nextPass = passes[index + 1];
478
+ if (pass.name === "bloom" && isHdrRenderTarget(current)) {
479
+ if (nextPass?.name !== "tone-mapping") {
480
+ throw new RenderDeviceError("Renderer HDR bloom requires tone mapping immediately after the float bloom pass.", "HDR_BLOOM_TONEMAPPING_REQUIRED", {
481
+ source: current.label
482
+ });
483
+ }
484
+ const isCombinedLast = index + 1 === passes.length - 1;
485
+ const target = isCombinedLast ? outputTarget : this.device.createRenderTarget({
486
+ width: this.width,
487
+ height: this.height,
488
+ label: "renderer-postprocess-tone-mapping",
489
+ format: "rgba8",
490
+ depth: false
491
+ });
492
+ if (target)
493
+ ownedTargets.push(target);
494
+ this.device.setRenderTarget(current);
495
+ const bloomed = bloomFloatPixels(this.device.readFloatPixels(0, 0, current.width, current.height), current.width, current.height, pass.options);
496
+ const mapped = toneMapFloatPixels(bloomed.pixels, current.width, current.height, {
497
+ outputColorSpace: "srgb",
498
+ ...nextPass.options
499
+ });
500
+ writePostProcessPixels(this.device, current, target, mapped.pixels);
501
+ if (target)
502
+ current = target;
503
+ index += 1;
504
+ continue;
505
+ }
506
+ const isLast = index === passes.length - 1;
507
+ const target = isLast ? outputTarget : this.device.createRenderTarget({
508
+ width: this.width,
509
+ height: this.height,
510
+ label: `renderer-postprocess-${pass.name}`,
511
+ format: "rgba8",
512
+ depth: false
513
+ });
514
+ if (target)
515
+ ownedTargets.push(target);
516
+ if (pass.name === "tone-mapping") {
517
+ new ToneMappingPass({
518
+ source: current,
519
+ target,
520
+ outputColorSpace: "srgb",
521
+ ...pass.options
522
+ }).execute({ device: this.device, width: this.width, height: this.height });
523
+ }
524
+ else if (pass.name === "bloom") {
525
+ new BloomPass({
526
+ source: current,
527
+ target,
528
+ ...pass.options
529
+ }).execute({ device: this.device, width: this.width, height: this.height });
530
+ }
531
+ else if (pass.name === "fxaa") {
532
+ new FXAAPass({
533
+ source: current,
534
+ target,
535
+ ...pass.options
536
+ }).execute({ device: this.device, width: this.width, height: this.height });
537
+ }
538
+ else {
539
+ this.executePixelPostprocessPass(pass, current, target, forwardTarget);
540
+ }
541
+ if (target)
542
+ current = target;
543
+ }
544
+ }
545
+ executeFusedLdrPostprocess(current, passes, outputTarget) {
546
+ if (!canFuseLdrPostprocess(current, passes))
547
+ return false;
548
+ if (this.device.presentLdrPostprocess) {
549
+ this.device.presentLdrPostprocess(current, {
550
+ passes: passes.map((pass) => ({
551
+ name: pass.name,
552
+ options: pass.options
553
+ })),
554
+ ...(outputTarget ? { outputTarget } : {}),
555
+ toneMappingDefaults: { outputColorSpace: "srgb" }
556
+ });
557
+ return true;
558
+ }
559
+ this.device.setRenderTarget(current);
560
+ const pixels = fusedLdrPostprocessPixels(this.device.readPixels(0, 0, current.width, current.height), current.width, current.height, passes, {
561
+ mutateInput: true,
562
+ scratch: this.fusedLdrPostprocessScratch,
563
+ toneMappingDefaults: { outputColorSpace: "srgb" }
564
+ });
565
+ writePostProcessPixels(this.device, current, outputTarget, pixels);
566
+ return true;
567
+ }
568
+ async executePostprocessAsync(postprocess, ownedTargets, outputTarget) {
569
+ const forwardTarget = ownedTargets[0];
570
+ let current = forwardTarget;
571
+ if (!current) {
572
+ throw new RenderDeviceError("Renderer postprocess missing forward render target", "POSTPROCESS_TARGET_MISSING");
573
+ }
574
+ const passes = createRendererPostprocessPasses(postprocess);
575
+ if (passes.length === 0) {
576
+ if (outputTarget) {
577
+ this.device.setRenderTarget(current);
578
+ writePostProcessPixels(this.device, current, outputTarget, await this.readRenderTargetPixelsAsync(current));
579
+ }
580
+ else {
581
+ this.device.presentRenderTarget?.(current);
582
+ }
583
+ return;
584
+ }
585
+ if (await this.executeFusedLdrPostprocessAsync(current, passes, outputTarget))
586
+ return;
587
+ for (let index = 0; index < passes.length; index += 1) {
588
+ const pass = passes[index];
589
+ const nextPass = passes[index + 1];
590
+ if (pass.name === "bloom" && isHdrRenderTarget(current)) {
591
+ if (nextPass?.name !== "tone-mapping") {
592
+ throw new RenderDeviceError("Renderer HDR bloom requires tone mapping immediately after the float bloom pass.", "HDR_BLOOM_TONEMAPPING_REQUIRED", {
593
+ source: current.label
594
+ });
595
+ }
596
+ const isCombinedLast = index + 1 === passes.length - 1;
597
+ const target = isCombinedLast ? outputTarget : this.device.createRenderTarget({
598
+ width: this.width,
599
+ height: this.height,
600
+ label: "renderer-postprocess-tone-mapping",
601
+ format: "rgba8",
602
+ depth: false
603
+ });
604
+ if (target)
605
+ ownedTargets.push(target);
606
+ const bloomed = bloomFloatPixels(await this.readRenderTargetFloatPixelsAsync(current), current.width, current.height, pass.options);
607
+ const mapped = toneMapFloatPixels(bloomed.pixels, current.width, current.height, {
608
+ outputColorSpace: "srgb",
609
+ ...nextPass.options
610
+ });
611
+ writePostProcessPixels(this.device, current, target, mapped.pixels);
612
+ if (target)
613
+ current = target;
614
+ index += 1;
615
+ continue;
616
+ }
617
+ const isLast = index === passes.length - 1;
618
+ const target = isLast ? outputTarget : this.device.createRenderTarget({
619
+ width: this.width,
620
+ height: this.height,
621
+ label: `renderer-postprocess-${pass.name}`,
622
+ format: "rgba8",
623
+ depth: false
624
+ });
625
+ if (target)
626
+ ownedTargets.push(target);
627
+ if (pass.name === "tone-mapping") {
628
+ const mapped = isHdrRenderTarget(current)
629
+ ? toneMapFloatPixels(await this.readRenderTargetFloatPixelsAsync(current), current.width, current.height, {
630
+ outputColorSpace: "srgb",
631
+ ...pass.options
632
+ })
633
+ : toneMapPixels(await this.readRenderTargetPixelsAsync(current), current.width, current.height, {
634
+ outputColorSpace: "srgb",
635
+ ...pass.options
636
+ });
637
+ writePostProcessPixels(this.device, current, target, mapped.pixels);
638
+ }
639
+ else if (pass.name === "bloom") {
640
+ const bloomed = bloomPixels(await this.readRenderTargetPixelsAsync(current), current.width, current.height, pass.options);
641
+ writePostProcessPixels(this.device, current, target, bloomed.pixels);
642
+ }
643
+ else if (pass.name === "fxaa") {
644
+ const smoothed = fxaaPixels(await this.readRenderTargetPixelsAsync(current), current.width, current.height, pass.options);
645
+ writePostProcessPixels(this.device, current, target, smoothed.pixels);
646
+ }
647
+ else {
648
+ await this.executePixelPostprocessPassAsync(pass, current, target, forwardTarget);
649
+ }
650
+ if (target)
651
+ current = target;
652
+ }
653
+ }
654
+ async executeFusedLdrPostprocessAsync(current, passes, outputTarget) {
655
+ if (!canFuseLdrPostprocess(current, passes))
656
+ return false;
657
+ if (this.device.presentLdrPostprocess) {
658
+ this.device.presentLdrPostprocess(current, {
659
+ passes: passes.map((pass) => ({
660
+ name: pass.name,
661
+ options: pass.options
662
+ })),
663
+ ...(outputTarget ? { outputTarget } : {}),
664
+ toneMappingDefaults: { outputColorSpace: "srgb" }
665
+ });
666
+ return true;
667
+ }
668
+ const pixels = fusedLdrPostprocessPixels(await this.readRenderTargetPixelsAsync(current), current.width, current.height, passes, {
669
+ mutateInput: true,
670
+ scratch: this.fusedLdrPostprocessScratch,
671
+ toneMappingDefaults: { outputColorSpace: "srgb" }
672
+ });
673
+ writePostProcessPixels(this.device, current, outputTarget, pixels);
674
+ return true;
675
+ }
676
+ executePixelPostprocessPass(pass, source, target, forwardTarget) {
677
+ this.device.setRenderTarget(source);
678
+ const input = this.device.readPixels(0, 0, source.width, source.height);
679
+ const rendererDepth = isDepthPostprocessPass(pass.name) && !postprocessPassHasDepth(pass.options)
680
+ ? this.readRendererOwnedDepthTexture(forwardTarget)
681
+ : undefined;
682
+ const result = pass.name === "color-grade"
683
+ ? colorGradePixels(input, source.width, source.height, pass.options).pixels
684
+ : pass.name === "chromatic-aberration"
685
+ ? chromaticAberrationPixels(input, source.width, source.height, pass.options).pixels
686
+ : pass.name === "film-grain"
687
+ ? filmGrainPixels(input, source.width, source.height, pass.options).pixels
688
+ : pass.name === "depth-of-field"
689
+ ? depthOfFieldPixels(input, source.width, source.height, withRendererDepth(pass.options, rendererDepth)).pixels
690
+ : pass.name === "motion-blur"
691
+ ? motionBlurPixels(input, source.width, source.height, pass.options).pixels
692
+ : pass.name === "contact-shadow"
693
+ ? contactShadowPixels(input, source.width, source.height, withRendererDepth(pass.options, rendererDepth)).pixels
694
+ : pass.name === "ssao"
695
+ ? ssaoPixels(input, source.width, source.height, withRendererDepth(pass.options, rendererDepth)).pixels
696
+ : pass.name === "ssr"
697
+ ? ssrPixels(input, source.width, source.height, withRendererDepth(pass.options, rendererDepth)).pixels
698
+ : pass.name === "taa"
699
+ ? taaPixels(input, source.width, source.height, pass.options).pixels
700
+ : pass.name === "outline"
701
+ ? outlinePixels(input, source.width, source.height, pass.options).pixels
702
+ : undefined;
703
+ if (!result) {
704
+ throw new RenderDeviceError("Renderer postprocess pass is outside the supported renderer pass catalog", "POSTPROCESS_PASS_UNKNOWN", {
705
+ pass: pass.name
706
+ });
707
+ }
708
+ writePostProcessPixels(this.device, source, target, result);
709
+ }
710
+ async executePixelPostprocessPassAsync(pass, source, target, forwardTarget) {
711
+ const input = await this.readRenderTargetPixelsAsync(source);
712
+ const rendererDepth = isDepthPostprocessPass(pass.name) && !postprocessPassHasDepth(pass.options)
713
+ ? this.readRendererOwnedDepthTexture(forwardTarget)
714
+ : undefined;
715
+ const result = pass.name === "color-grade"
716
+ ? colorGradePixels(input, source.width, source.height, pass.options).pixels
717
+ : pass.name === "chromatic-aberration"
718
+ ? chromaticAberrationPixels(input, source.width, source.height, pass.options).pixels
719
+ : pass.name === "film-grain"
720
+ ? filmGrainPixels(input, source.width, source.height, pass.options).pixels
721
+ : pass.name === "depth-of-field"
722
+ ? depthOfFieldPixels(input, source.width, source.height, withRendererDepth(pass.options, rendererDepth)).pixels
723
+ : pass.name === "motion-blur"
724
+ ? motionBlurPixels(input, source.width, source.height, pass.options).pixels
725
+ : pass.name === "contact-shadow"
726
+ ? contactShadowPixels(input, source.width, source.height, withRendererDepth(pass.options, rendererDepth)).pixels
727
+ : pass.name === "ssao"
728
+ ? ssaoPixels(input, source.width, source.height, withRendererDepth(pass.options, rendererDepth)).pixels
729
+ : pass.name === "ssr"
730
+ ? ssrPixels(input, source.width, source.height, withRendererDepth(pass.options, rendererDepth)).pixels
731
+ : pass.name === "taa"
732
+ ? taaPixels(input, source.width, source.height, pass.options).pixels
733
+ : pass.name === "outline"
734
+ ? outlinePixels(input, source.width, source.height, pass.options).pixels
735
+ : undefined;
736
+ if (!result) {
737
+ throw new RenderDeviceError("Renderer postprocess pass is outside the supported renderer pass catalog", "POSTPROCESS_PASS_UNKNOWN", {
738
+ pass: pass.name
739
+ });
740
+ }
741
+ writePostProcessPixels(this.device, source, target, result);
742
+ }
743
+ async readRenderTargetPixelsAsync(target) {
744
+ this.device.setRenderTarget(target);
745
+ if (this.device.readPixelsAsync && target.colorTexture.format === "rgba8") {
746
+ return this.device.readPixelsAsync(0, 0, target.width, target.height);
747
+ }
748
+ return this.device.readPixels(0, 0, target.width, target.height);
749
+ }
750
+ async readRenderTargetFloatPixelsAsync(target) {
751
+ this.device.setRenderTarget(target);
752
+ if (this.device.readFloatPixelsAsync && isHdrRenderTarget(target)) {
753
+ return this.device.readFloatPixelsAsync(0, 0, target.width, target.height);
754
+ }
755
+ return this.device.readFloatPixels(0, 0, target.width, target.height);
756
+ }
757
+ readRendererOwnedDepthTexture(forwardTarget) {
758
+ if (!forwardTarget.depthTexture) {
759
+ throw new RenderDeviceError("Renderer-owned depth postprocess requires the forward target to expose a depth texture.", "POSTPROCESS_DEPTH_TARGET_MISSING", {
760
+ renderTarget: forwardTarget.label
761
+ });
762
+ }
763
+ if (!this.device.readDepthPixels) {
764
+ throw new RenderDeviceError("Renderer-owned depth postprocess requires backend depth readback.", "DEPTH_READBACK_UNSUPPORTED", {
765
+ backend: this.device.kind
766
+ });
767
+ }
768
+ this.device.setRenderTarget(forwardTarget);
769
+ return createDepthTextureBinding({
770
+ label: forwardTarget.depthTexture.label,
771
+ width: forwardTarget.width,
772
+ height: forwardTarget.height,
773
+ data: this.device.readDepthPixels(0, 0, forwardTarget.width, forwardTarget.height)
774
+ });
775
+ }
776
+ executeRendererShadowMap(options) {
777
+ if (!options.shadowOptions || options.shadowOptions.enabled === false) {
778
+ return undefined;
779
+ }
780
+ if (!this.device.info.capabilities?.includes("render-targets")) {
781
+ throw new RenderDeviceError("Renderer-owned shadows require render targets", "SHADOW_RENDER_TARGET_UNSUPPORTED", {
782
+ backend: this.device.kind
783
+ });
784
+ }
785
+ const light = options.shadowOptions.light ?? firstShadowCastingLight(options.source, options.lights);
786
+ if (light instanceof PointLight) {
787
+ return this.executeRendererPointShadowMap({
788
+ shadowOptions: options.shadowOptions,
789
+ items: options.items,
790
+ ownedTargets: options.ownedTargets,
791
+ ownedShadowPasses: options.ownedShadowPasses,
792
+ light
793
+ });
794
+ }
795
+ if (light && !(light instanceof DirectionalLight) && !(light instanceof SpotLight)) {
796
+ throw new RenderDeviceError("Renderer-owned shadow maps require directional, spot, or point lights.", "SHADOW_LIGHT_TYPE_UNSUPPORTED", {
797
+ lightName: light.name,
798
+ lightType: light.constructor.name
799
+ });
800
+ }
801
+ const lightMatrix = options.shadowOptions.lightMatrix
802
+ ? toMat4(options.shadowOptions.lightMatrix, "shadow.lightMatrix")
803
+ : createRendererOwnedShadowMatrix(light, options.items, firstShadowCastingCollectedLight(options.lights));
804
+ const shadowMap = new ShadowMap({
805
+ size: options.shadowOptions.size,
806
+ bias: options.shadowOptions.bias,
807
+ filter: options.shadowOptions.filter,
808
+ pcfRadius: options.shadowOptions.pcfRadius,
809
+ pcfSamples: options.shadowOptions.pcfSamples,
810
+ pcfDistribution: options.shadowOptions.pcfDistribution,
811
+ label: options.shadowOptions.label ?? "renderer-shadow-map"
812
+ });
813
+ const shadowPass = new ShadowPass({
814
+ light,
815
+ casters: options.items,
816
+ shadowMap,
817
+ viewProjectionMatrix: lightMatrix,
818
+ shaderLibrary: this.shaderLibrary
819
+ });
820
+ options.ownedShadowPasses.push(shadowPass);
821
+ const result = shadowPass.execute({ device: this.device, width: this.width, height: this.height });
822
+ if (!result.rendered) {
823
+ if (result.reason === "no-light" || result.reason === "light-disabled" || result.reason === "not-shadow-casting") {
824
+ throw new RenderDeviceError("Renderer-owned shadows require an enabled shadow-casting light.", "SHADOW_LIGHT_REQUIRED", {
825
+ reason: result.reason
826
+ });
827
+ }
828
+ return undefined;
829
+ }
830
+ return shadowPass.getForwardShadowMap({
831
+ lightMatrix,
832
+ strength: options.shadowOptions.strength,
833
+ slopeBias: options.shadowOptions.slopeBias,
834
+ texelSize: options.shadowOptions.texelSize,
835
+ bias: options.shadowOptions.bias,
836
+ filterKernel: options.shadowOptions.filterKernel
837
+ }) ?? undefined;
838
+ }
839
+ executeRendererPointShadowMap(options) {
840
+ if (!this.device.writeRenderTargetPixels) {
841
+ throw new RenderDeviceError("Renderer-owned point shadows require render-target pixel upload for the point-light atlas.", "POINT_SHADOW_ATLAS_UPLOAD_UNSUPPORTED", {
842
+ backend: this.device.kind
843
+ });
844
+ }
845
+ options.light.transform.updateWorld(undefined, true);
846
+ const size = options.shadowOptions.size ?? 512;
847
+ const faceMatrices = createPointShadowFaceMatrices(options.light);
848
+ const faceRects = createPointShadowFaceRects();
849
+ const shadowMapOptions = {
850
+ size,
851
+ bias: options.shadowOptions.bias,
852
+ filter: options.shadowOptions.filter,
853
+ pcfRadius: options.shadowOptions.pcfRadius,
854
+ pcfSamples: options.shadowOptions.pcfSamples,
855
+ pcfDistribution: options.shadowOptions.pcfDistribution
856
+ };
857
+ const atlasPixels = new Uint8Array(size * 3 * size * 2 * 4);
858
+ for (let face = 0; face < 6; face += 1) {
859
+ const faceMatrix = faceMatrices.slice(face * 16, face * 16 + 16);
860
+ const shadowPass = new ShadowPass({
861
+ light: options.light,
862
+ casters: options.items,
863
+ shadowMap: new ShadowMap({ ...shadowMapOptions, label: `${options.shadowOptions.label ?? "renderer-point-shadow"}-face-${face}` }),
864
+ viewProjectionMatrix: faceMatrix,
865
+ shaderLibrary: this.shaderLibrary
866
+ });
867
+ options.ownedShadowPasses.push(shadowPass);
868
+ const result = shadowPass.execute({ device: this.device, width: this.width, height: this.height });
869
+ if (!result.rendered) {
870
+ return undefined;
871
+ }
872
+ const target = shadowPass.getRenderTarget();
873
+ if (!target) {
874
+ throw new RenderDeviceError("Renderer-owned point shadow face did not expose a render target.", "POINT_SHADOW_FACE_TARGET_MISSING", { face });
875
+ }
876
+ const facePixels = readShadowFacePixels(this.device, target);
877
+ blitPointShadowFace(atlasPixels, size * 3, size * 2, facePixels, size, faceRects, face);
878
+ }
879
+ const atlasTarget = this.device.createRenderTarget({
880
+ width: size * 3,
881
+ height: size * 2,
882
+ label: `${options.shadowOptions.label ?? "renderer-point-shadow"}-atlas`,
883
+ format: "rgba8",
884
+ depth: false
885
+ });
886
+ options.ownedTargets.push(atlasTarget);
887
+ this.device.writeRenderTargetPixels(atlasTarget, atlasPixels);
888
+ const texture = new TextureBinding({
889
+ name: "u_pointShadowMapTexture",
890
+ texture: atlasTarget.colorTexture,
891
+ sampler: new Sampler({ minFilter: "nearest", magFilter: "nearest", addressU: "clamp-to-edge", addressV: "clamp-to-edge" }),
892
+ required: true
893
+ });
894
+ return {
895
+ texture: new TextureBinding({
896
+ name: "u_shadowMapTexture",
897
+ texture: atlasTarget.colorTexture,
898
+ sampler: new Sampler({ minFilter: "nearest", magFilter: "nearest", addressU: "clamp-to-edge", addressV: "clamp-to-edge" }),
899
+ required: true
900
+ }),
901
+ lightMatrix: identityMat4(),
902
+ strength: options.shadowOptions.strength,
903
+ slopeBias: options.shadowOptions.slopeBias,
904
+ texelSize: options.shadowOptions.texelSize,
905
+ bias: options.shadowOptions.bias,
906
+ filterKernel: options.shadowOptions.filterKernel,
907
+ pointLight: {
908
+ texture,
909
+ lightPosition: [options.light.transform.worldMatrix[12], options.light.transform.worldMatrix[13], options.light.transform.worldMatrix[14]],
910
+ range: options.light.range,
911
+ faceMatrices,
912
+ faceRects,
913
+ strength: options.shadowOptions.strength,
914
+ slopeBias: options.shadowOptions.slopeBias,
915
+ texelSize: [1 / Math.max(1, size * 3), 1 / Math.max(1, size * 2)],
916
+ bias: options.shadowOptions.bias,
917
+ filterKernel: options.shadowOptions.filterKernel
918
+ }
919
+ };
920
+ }
921
+ }
922
+ export function pickSceneRenderables(source, ray, options = {}) {
923
+ return pickSceneRenderableHits(source, ray, options)[0];
924
+ }
925
+ export function pickSceneRenderableHits(source, ray, options = {}) {
926
+ const pointRadius = options.pointRadius;
927
+ const lineRadius = options.lineRadius;
928
+ if (pointRadius !== undefined && (!Number.isFinite(pointRadius) || pointRadius <= 0)) {
929
+ throw new RenderDeviceError("Scene point picking radius must be a finite positive number", "SCENE_PICK_RADIUS_INVALID", { pointRadius });
930
+ }
931
+ if (lineRadius !== undefined && (!Number.isFinite(lineRadius) || lineRadius <= 0)) {
932
+ throw new RenderDeviceError("Scene line picking radius must be a finite positive number", "SCENE_PICK_RADIUS_INVALID", { lineRadius });
933
+ }
934
+ const scene = source.scene;
935
+ if (!scene) {
936
+ throw new RenderDeviceError("Scene picking requires a scene", "SCENE_PICKING_SCENE_MISSING");
937
+ }
938
+ if (!source.geometryLibrary) {
939
+ throw new RenderDeviceError("Scene picking requires a geometryLibrary resource lookup", "SCENE_PICKING_RESOURCES_MISSING");
940
+ }
941
+ scene.updateWorldTransforms();
942
+ const hits = [];
943
+ for (const { node, renderable } of scene.collectRenderables()) {
944
+ const geometry = lookupRenderResource(source.geometryLibrary, renderable.geometry);
945
+ if (!geometry) {
946
+ throw new RenderDeviceError("Scene pick target references missing geometry", "SCENE_PICK_GEOMETRY_MISSING", {
947
+ node: node.name,
948
+ geometry: renderable.geometry
949
+ });
950
+ }
951
+ const morphTargets = source.morphTargetLibrary ? lookupRenderResource(source.morphTargetLibrary, renderable.geometry) : undefined;
952
+ if (renderable.morphWeights.length > 0 && !morphTargets) {
953
+ throw new RenderDeviceError("Scene pick target has morph weights but no morph target resource entry", "SCENE_PICK_MORPH_TARGETS_MISSING", {
954
+ node: node.name,
955
+ geometry: renderable.geometry,
956
+ morphWeights: renderable.morphWeights.length
957
+ });
958
+ }
959
+ const bounds = renderableWorldBounds(geometry, node.transform.worldMatrix, renderable.instanceTransforms, morphTargets, renderable.morphWeights, renderable.skinning);
960
+ if (geometry.topology === "points" && options.pointRadius !== undefined) {
961
+ hits.push(...pickPoints(node, geometry, ray, node.transform.worldMatrix, renderable.instanceTransforms, options.pointRadius));
962
+ continue;
963
+ }
964
+ const pickBounds = geometry.topology === "lines" && options.lineRadius !== undefined
965
+ ? expandSceneBounds(bounds, options.lineRadius)
966
+ : bounds;
967
+ const hitPoint = ray.intersectBox(pickBounds.toMathBox());
968
+ if (hitPoint) {
969
+ hits.push({ node, geometry, bounds: pickBounds, distance: hitPoint.distanceTo(ray.origin), hitPoint: hitPoint.toArray() });
970
+ }
971
+ }
972
+ return hits.sort((left, right) => left.distance - right.distance);
973
+ }
974
+ function pickPoints(node, geometry, ray, modelMatrix, instanceTransforms, pointRadius) {
975
+ const hits = [];
976
+ const radiusSquared = pointRadius * pointRadius;
977
+ const transforms = instanceTransforms ? collectInstanceWorldMatrices(modelMatrix, instanceTransforms) : [modelMatrix];
978
+ for (let instanceIndex = 0; instanceIndex < transforms.length; instanceIndex += 1) {
979
+ const transform = transforms[instanceIndex];
980
+ for (let pointIndex = 0; pointIndex < geometry.vertexBuffer.vertexCount; pointIndex += 1) {
981
+ const position = geometry.vertexBuffer.getAttribute(pointIndex, "position");
982
+ const worldPoint = transformPoint(transform, [position[0] ?? 0, position[1] ?? 0, position[2] ?? 0]);
983
+ const distance = distanceAlongRay(ray, worldPoint);
984
+ if (distance < 0)
985
+ continue;
986
+ const radialDistanceSquared = squaredDistanceToRayAt(ray, worldPoint, distance);
987
+ if (radialDistanceSquared <= radiusSquared) {
988
+ hits.push({
989
+ node,
990
+ geometry,
991
+ bounds: expandPointBounds(worldPoint, pointRadius),
992
+ distance,
993
+ hitPoint: worldPoint,
994
+ pointIndex,
995
+ instanceIndex: instanceTransforms ? instanceIndex : undefined
996
+ });
997
+ }
998
+ }
999
+ }
1000
+ return hits;
1001
+ }
1002
+ function collectInstanceWorldMatrices(modelMatrix, instanceTransforms) {
1003
+ const matrices = [];
1004
+ for (let offset = 0; offset < instanceTransforms.length; offset += 16) {
1005
+ matrices.push(multiplyMat4(modelMatrix, toMat4(instanceTransforms.slice(offset, offset + 16), "instanceTransforms")));
1006
+ }
1007
+ return matrices;
1008
+ }
1009
+ function distanceAlongRay(ray, point) {
1010
+ return ((point[0] - ray.origin.x) * ray.direction.x +
1011
+ (point[1] - ray.origin.y) * ray.direction.y +
1012
+ (point[2] - ray.origin.z) * ray.direction.z);
1013
+ }
1014
+ function squaredDistanceToRayAt(ray, point, distance) {
1015
+ const closestX = ray.origin.x + ray.direction.x * distance;
1016
+ const closestY = ray.origin.y + ray.direction.y * distance;
1017
+ const closestZ = ray.origin.z + ray.direction.z * distance;
1018
+ const dx = point[0] - closestX;
1019
+ const dy = point[1] - closestY;
1020
+ const dz = point[2] - closestZ;
1021
+ return dx * dx + dy * dy + dz * dz;
1022
+ }
1023
+ function expandPointBounds(center, radius) {
1024
+ return new SceneBounds3([center[0] - radius, center[1] - radius, center[2] - radius], [center[0] + radius, center[1] + radius, center[2] + radius]);
1025
+ }
1026
+ function expandSceneBounds(bounds, radius) {
1027
+ return new SceneBounds3([bounds.min[0] - radius, bounds.min[1] - radius, bounds.min[2] - radius], [bounds.max[0] + radius, bounds.max[1] + radius, bounds.max[2] + radius]);
1028
+ }
1029
+ class RendererAnimationLoopImpl {
1030
+ renderer;
1031
+ callback;
1032
+ requestId = null;
1033
+ running = false;
1034
+ constructor(renderer, callback) {
1035
+ this.renderer = renderer;
1036
+ this.callback = callback;
1037
+ }
1038
+ start() {
1039
+ if (typeof requestAnimationFrame !== "function" || typeof cancelAnimationFrame !== "function") {
1040
+ throw new RenderDeviceError("Renderer animation loops require requestAnimationFrame", "ANIMATION_LOOP_UNAVAILABLE");
1041
+ }
1042
+ this.running = true;
1043
+ this.requestId = requestAnimationFrame((timeMs) => this.tick(timeMs));
1044
+ }
1045
+ stop() {
1046
+ this.running = false;
1047
+ if (this.requestId !== null) {
1048
+ cancelAnimationFrame(this.requestId);
1049
+ this.requestId = null;
1050
+ }
1051
+ }
1052
+ tick(timeMs) {
1053
+ if (!this.running) {
1054
+ return;
1055
+ }
1056
+ this.callback(timeMs, this.renderer);
1057
+ if (this.running) {
1058
+ this.requestId = requestAnimationFrame((nextTimeMs) => this.tick(nextTimeMs));
1059
+ }
1060
+ }
1061
+ }
1062
+ function readCanvasCssSize(canvas, axis) {
1063
+ if ("getBoundingClientRect" in canvas) {
1064
+ const bounds = canvas.getBoundingClientRect();
1065
+ const value = axis === "width" ? bounds.width : bounds.height;
1066
+ if (value > 0) {
1067
+ return value;
1068
+ }
1069
+ }
1070
+ return axis === "width" ? canvas.width : canvas.height;
1071
+ }
1072
+ function inferInitialCanvasDimension(canvas, axis) {
1073
+ if (!canvas)
1074
+ return 1;
1075
+ const cssSize = readCanvasCssSize(canvas, axis);
1076
+ const dpr = Number.isFinite(globalThis.devicePixelRatio) && globalThis.devicePixelRatio > 0 ? globalThis.devicePixelRatio : 1;
1077
+ const displaySize = Math.round(cssSize * dpr);
1078
+ return Math.max(1, displaySize || (axis === "width" ? canvas.width : canvas.height) || 1);
1079
+ }
1080
+ function collectEnvironmentLighting(source) {
1081
+ if (source instanceof Scene || isIterable(source))
1082
+ return undefined;
1083
+ if (source.environmentLighting === false)
1084
+ return cloneEnvironmentLighting(DISABLED_RENDERER_ENVIRONMENT_LIGHTING);
1085
+ if (source.environmentLighting)
1086
+ return source.environmentLighting;
1087
+ return cloneEnvironmentLighting(DEFAULT_RENDERER_ENVIRONMENT_LIGHTING);
1088
+ }
1089
+ function collectEnvironmentBackground(source) {
1090
+ if (source instanceof Scene || isIterable(source) || source.environmentBackground === false)
1091
+ return undefined;
1092
+ return source.environmentBackground;
1093
+ }
1094
+ function collectEnvironmentFog(source) {
1095
+ if (source instanceof Scene || isIterable(source))
1096
+ return undefined;
1097
+ return source.environmentFog;
1098
+ }
1099
+ function collectForwardShadowMap(source) {
1100
+ return source instanceof Scene || isIterable(source) ? undefined : source.shadowMap;
1101
+ }
1102
+ function collectRenderTarget(source) {
1103
+ return source instanceof Scene || isIterable(source) ? undefined : source.renderTarget;
1104
+ }
1105
+ function validateExplicitRenderTarget(target, width, height) {
1106
+ if (!target)
1107
+ return;
1108
+ if (target.disposed) {
1109
+ throw new RenderDeviceError("Renderer renderTarget must be a live render target.", "RENDER_TARGET_DISPOSED", {
1110
+ renderTarget: target.label
1111
+ });
1112
+ }
1113
+ if (target.width !== width || target.height !== height) {
1114
+ throw new RenderDeviceError("Renderer renderTarget dimensions must match the renderer viewport.", "RENDER_TARGET_VIEWPORT_MISMATCH", {
1115
+ renderTarget: target.label,
1116
+ targetWidth: target.width,
1117
+ targetHeight: target.height,
1118
+ rendererWidth: width,
1119
+ rendererHeight: height
1120
+ });
1121
+ }
1122
+ }
1123
+ function collectRendererShadowOptions(source) {
1124
+ if (source instanceof Scene || isIterable(source))
1125
+ return undefined;
1126
+ if (source.shadow === true)
1127
+ return {};
1128
+ if (!source.shadow)
1129
+ return undefined;
1130
+ return source.shadow;
1131
+ }
1132
+ function firstShadowCastingLight(source, lights) {
1133
+ const explicit = lights.find((light) => light.castsShadow && light.source.visible)?.source;
1134
+ if (explicit)
1135
+ return explicit;
1136
+ const scene = sceneFromSource(source);
1137
+ return scene?.collectLights().find((light) => light.visible && light.castsShadow) ?? null;
1138
+ }
1139
+ function firstShadowCastingCollectedLight(lights) {
1140
+ return lights.find((light) => light.castsShadow && light.source.visible);
1141
+ }
1142
+ function lightDirectionFromLight(light) {
1143
+ if (!light)
1144
+ return [0, -1, -1];
1145
+ const direction = light instanceof DirectionalLight ? light.getDirection() : undefined;
1146
+ return normalizeVec3([
1147
+ Number(direction?.[0] ?? 0),
1148
+ Number(direction?.[1] ?? -1),
1149
+ Number(direction?.[2] ?? -1)
1150
+ ]);
1151
+ }
1152
+ function createRendererOwnedShadowMatrix(light, items, collectedLight) {
1153
+ if (light instanceof SpotLight) {
1154
+ light.transform.updateWorld(undefined, true);
1155
+ const near = 0.01;
1156
+ const far = Math.max(near + 0.01, light.range);
1157
+ const projectionMatrix = perspectiveMat4(light.angle * 2, 1, near, far);
1158
+ return multiplyMat4(projectionMatrix, light.transform.inverseWorldMatrix);
1159
+ }
1160
+ return createDirectionalShadowMatrix(items, collectedLight?.direction ?? lightDirectionFromLight(light));
1161
+ }
1162
+ function createPointShadowFaceMatrices(light) {
1163
+ light.transform.updateWorld(undefined, true);
1164
+ const position = [
1165
+ light.transform.worldMatrix[12],
1166
+ light.transform.worldMatrix[13],
1167
+ light.transform.worldMatrix[14]
1168
+ ];
1169
+ const projection = perspectiveMat4(Math.PI / 2, 1, 0.01, Math.max(0.02, light.range));
1170
+ const faces = [
1171
+ { direction: [1, 0, 0], up: [0, -1, 0] },
1172
+ { direction: [-1, 0, 0], up: [0, -1, 0] },
1173
+ { direction: [0, 1, 0], up: [0, 0, 1] },
1174
+ { direction: [0, -1, 0], up: [0, 0, -1] },
1175
+ { direction: [0, 0, 1], up: [0, -1, 0] },
1176
+ { direction: [0, 0, -1], up: [0, -1, 0] }
1177
+ ];
1178
+ const matrices = new Float32Array(6 * 16);
1179
+ for (const [index, face] of faces.entries()) {
1180
+ const view = lookAtMatrix(position, addVec3(position, face.direction), face.up);
1181
+ matrices.set(multiplyMat4(projection, view), index * 16);
1182
+ }
1183
+ return matrices;
1184
+ }
1185
+ function createPointShadowFaceRects() {
1186
+ const rects = new Float32Array(6 * 4);
1187
+ for (let face = 0; face < 6; face += 1) {
1188
+ const column = face % 3;
1189
+ const row = Math.floor(face / 3);
1190
+ rects.set([column / 3, row / 2, 1 / 3, 1 / 2], face * 4);
1191
+ }
1192
+ return rects;
1193
+ }
1194
+ function readShadowFacePixels(device, target) {
1195
+ device.setRenderTarget(target);
1196
+ if (target.depthTexture && device.readDepthPixels) {
1197
+ const depth = device.readDepthPixels(0, 0, target.width, target.height);
1198
+ const pixels = new Uint8Array(target.width * target.height * 4);
1199
+ for (let index = 0; index < depth.length; index += 1) {
1200
+ const byte = Math.max(0, Math.min(255, Math.round((depth[index] ?? 1) * 255)));
1201
+ const offset = index * 4;
1202
+ pixels[offset] = byte;
1203
+ pixels[offset + 1] = byte;
1204
+ pixels[offset + 2] = byte;
1205
+ pixels[offset + 3] = 255;
1206
+ }
1207
+ return pixels;
1208
+ }
1209
+ return device.readPixels(0, 0, target.width, target.height);
1210
+ }
1211
+ function blitPointShadowFace(atlasPixels, atlasWidth, atlasHeight, facePixels, faceSize, faceRects, face) {
1212
+ const rectOffset = face * 4;
1213
+ const destX = Math.round((faceRects[rectOffset] ?? 0) * atlasWidth);
1214
+ const destY = Math.round((faceRects[rectOffset + 1] ?? 0) * atlasHeight);
1215
+ for (let row = 0; row < faceSize; row += 1) {
1216
+ const sourceOffset = row * faceSize * 4;
1217
+ const targetOffset = ((destY + row) * atlasWidth + destX) * 4;
1218
+ atlasPixels.set(facePixels.subarray(sourceOffset, sourceOffset + faceSize * 4), targetOffset);
1219
+ }
1220
+ }
1221
+ function lookAtMatrix(eye, target, up) {
1222
+ const forward = normalizeVec3(subtractVec3(target, eye));
1223
+ const right = normalizeVec3(crossVec3(forward, up));
1224
+ const correctedUp = crossVec3(right, forward);
1225
+ return [
1226
+ right[0], correctedUp[0], -forward[0], 0,
1227
+ right[1], correctedUp[1], -forward[1], 0,
1228
+ right[2], correctedUp[2], -forward[2], 0,
1229
+ -dotVec3(right, eye), -dotVec3(correctedUp, eye), dotVec3(forward, eye), 1
1230
+ ];
1231
+ }
1232
+ function createDirectionalShadowMatrix(items, lightDirection) {
1233
+ const bounds = collectRenderItemBounds(items);
1234
+ if (!bounds || bounds.isEmpty()) {
1235
+ return identityMat4();
1236
+ }
1237
+ const basis = directionalLightBasis(lightDirection);
1238
+ const points = boundsCorners(bounds).map((point) => projectPointToLightSpace(point, basis));
1239
+ const lightBounds = boundsFromVec3(points);
1240
+ const width = Math.max(0.01, lightBounds.max[0] - lightBounds.min[0]);
1241
+ const height = Math.max(0.01, lightBounds.max[1] - lightBounds.min[1]);
1242
+ const depth = Math.max(0.01, lightBounds.max[2] - lightBounds.min[2]);
1243
+ const padding = Math.max(width, height, depth) * 0.08 + 0.05;
1244
+ const viewMatrix = lightViewMatrix(basis);
1245
+ const projectionMatrix = orthographicMat4(lightBounds.min[0] - padding, lightBounds.max[0] + padding, lightBounds.min[1] - padding, lightBounds.max[1] + padding, lightBounds.min[2] - padding, lightBounds.max[2] + padding);
1246
+ return multiplyMat4(projectionMatrix, viewMatrix);
1247
+ }
1248
+ function directionalLightBasis(lightDirection) {
1249
+ const forward = normalizeVec3(scaleVec3(normalizeVec3(lightDirection), -1));
1250
+ const fallbackUp = Math.abs(forward[1]) > 0.94 ? [0, 0, 1] : [0, 1, 0];
1251
+ const right = normalizeVec3(crossVec3(fallbackUp, forward));
1252
+ const up = normalizeVec3(crossVec3(forward, right));
1253
+ return { right, up, forward };
1254
+ }
1255
+ function lightViewMatrix(basis) {
1256
+ return [
1257
+ basis.right[0], basis.up[0], basis.forward[0], 0,
1258
+ basis.right[1], basis.up[1], basis.forward[1], 0,
1259
+ basis.right[2], basis.up[2], basis.forward[2], 0,
1260
+ 0, 0, 0, 1
1261
+ ];
1262
+ }
1263
+ function projectPointToLightSpace(point, basis) {
1264
+ return [dotVec3(point, basis.right), dotVec3(point, basis.up), dotVec3(point, basis.forward)];
1265
+ }
1266
+ function boundsCorners(bounds) {
1267
+ return [
1268
+ [bounds.min[0], bounds.min[1], bounds.min[2]],
1269
+ [bounds.max[0], bounds.min[1], bounds.min[2]],
1270
+ [bounds.min[0], bounds.max[1], bounds.min[2]],
1271
+ [bounds.min[0], bounds.min[1], bounds.max[2]],
1272
+ [bounds.max[0], bounds.max[1], bounds.min[2]],
1273
+ [bounds.max[0], bounds.min[1], bounds.max[2]],
1274
+ [bounds.min[0], bounds.max[1], bounds.max[2]],
1275
+ [bounds.max[0], bounds.max[1], bounds.max[2]]
1276
+ ];
1277
+ }
1278
+ function boundsFromVec3(points) {
1279
+ const min = [Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY];
1280
+ const max = [Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY];
1281
+ for (const point of points) {
1282
+ for (let axis = 0; axis < 3; axis += 1) {
1283
+ min[axis] = Math.min(min[axis], point[axis]);
1284
+ max[axis] = Math.max(max[axis], point[axis]);
1285
+ }
1286
+ }
1287
+ return { min, max };
1288
+ }
1289
+ function normalizeVec3(value) {
1290
+ const length = Math.hypot(value[0], value[1], value[2]);
1291
+ if (!Number.isFinite(length) || length <= 1e-8)
1292
+ return [0, -1 / Math.SQRT2, -1 / Math.SQRT2];
1293
+ return [value[0] / length, value[1] / length, value[2] / length];
1294
+ }
1295
+ function scaleVec3(value, amount) {
1296
+ return [value[0] * amount, value[1] * amount, value[2] * amount];
1297
+ }
1298
+ function addVec3(left, right) {
1299
+ return [left[0] + right[0], left[1] + right[1], left[2] + right[2]];
1300
+ }
1301
+ function subtractVec3(left, right) {
1302
+ return [left[0] - right[0], left[1] - right[1], left[2] - right[2]];
1303
+ }
1304
+ function crossVec3(left, right) {
1305
+ return [
1306
+ left[1] * right[2] - left[2] * right[1],
1307
+ left[2] * right[0] - left[0] * right[2],
1308
+ left[0] * right[1] - left[1] * right[0]
1309
+ ];
1310
+ }
1311
+ function dotVec3(left, right) {
1312
+ return left[0] * right[0] + left[1] * right[1] + left[2] * right[2];
1313
+ }
1314
+ function collectPostprocess(source) {
1315
+ if (source instanceof Scene || isIterable(source))
1316
+ return undefined;
1317
+ if (source.postprocess === true)
1318
+ return {};
1319
+ if (!source.postprocess)
1320
+ return undefined;
1321
+ return source.postprocess;
1322
+ }
1323
+ function normalizeRendererInput(sourceOrInput, camera) {
1324
+ if (isRendererInput(sourceOrInput)) {
1325
+ return { source: sourceOrInput.source, camera: camera ?? sourceOrInput.camera };
1326
+ }
1327
+ return { source: sourceOrInput, ...(camera ? { camera } : {}) };
1328
+ }
1329
+ function isRendererInput(value) {
1330
+ return !(value instanceof Scene) && !isIterable(value) && isRecord(value) && "source" in value;
1331
+ }
1332
+ function isRecord(value) {
1333
+ return typeof value === "object" && value !== null;
1334
+ }
1335
+ function collectCameraPolicy(source) {
1336
+ if (source instanceof Scene || isIterable(source))
1337
+ return "identity";
1338
+ if (source.cameraPolicy)
1339
+ return source.cameraPolicy;
1340
+ if (source.scene && !source.renderItems && !source.collectRenderItems)
1341
+ return "auto-frame";
1342
+ if ((source.renderItems || source.collectRenderItems) && !source.renderTarget)
1343
+ return "auto-frame";
1344
+ return "identity";
1345
+ }
1346
+ function postprocessRequiresDepthTexture(postprocess) {
1347
+ return Boolean((postprocess.depthOfField && !postprocess.depthOfField.depth) ||
1348
+ (postprocess.contactShadow && !postprocess.contactShadow.depth) ||
1349
+ (postprocess.ssao && !postprocess.ssao.depth) ||
1350
+ (postprocess.ssr && !postprocess.ssr.depth));
1351
+ }
1352
+ function canFuseLdrPostprocess(source, passes) {
1353
+ const sourceIsHdr = isHdrRenderTarget(source);
1354
+ return passes.length > 1
1355
+ && (!sourceIsHdr || passes[0]?.name === "tone-mapping")
1356
+ && passes.every((pass) => pass.name === "tone-mapping" || pass.name === "color-grade" || pass.name === "fxaa")
1357
+ && passes.every((pass, index) => {
1358
+ const previousRank = index === 0 ? -1 : ldrFusionPassRank(passes[index - 1].name);
1359
+ return ldrFusionPassRank(pass.name) >= previousRank;
1360
+ });
1361
+ }
1362
+ function ldrFusionPassRank(name) {
1363
+ if (name === "tone-mapping")
1364
+ return 0;
1365
+ if (name === "color-grade")
1366
+ return 1;
1367
+ if (name === "fxaa")
1368
+ return 2;
1369
+ return Number.POSITIVE_INFINITY;
1370
+ }
1371
+ function isDepthPostprocessPass(name) {
1372
+ return name === "depth-of-field" || name === "contact-shadow" || name === "ssao" || name === "ssr";
1373
+ }
1374
+ function postprocessPassHasDepth(options) {
1375
+ return typeof options === "object" && options !== null && "depth" in options && Boolean(options.depth);
1376
+ }
1377
+ function withRendererDepth(options, depth) {
1378
+ return depth && !options.depth ? { ...options, depth } : options;
1379
+ }
1380
+ function defaultPostprocessTargetFormat(device, postprocess) {
1381
+ if (postprocess.toneMapping === false)
1382
+ return "rgba8";
1383
+ return device.info.capabilities?.includes("hdr-render-targets") ? "rgba16f" : "rgba8";
1384
+ }
1385
+ function isHdrRenderTarget(target) {
1386
+ return target.colorTexture.format === "rgba16f" || target.colorTexture.format === "rgba32f";
1387
+ }
1388
+ function collectSourceCameraPosition(source) {
1389
+ if (source instanceof Scene || isIterable(source))
1390
+ return undefined;
1391
+ const position = source.cameraPosition;
1392
+ if (position === undefined)
1393
+ return undefined;
1394
+ if (position.length !== 3 || position.some((value) => !Number.isFinite(value))) {
1395
+ throw new RenderDeviceError("RenderSource cameraPosition must contain three finite numbers", "CAMERA_POSITION_INVALID", {
1396
+ cameraPosition: [...position]
1397
+ });
1398
+ }
1399
+ return position;
1400
+ }
1401
+ function collectRenderItems(source, cameraViewProjection, camera) {
1402
+ return collectRenderItemsWithDiagnostics(source, cameraViewProjection, camera).items;
1403
+ }
1404
+ function collectRenderItemsWithDiagnostics(source, cameraViewProjection, camera) {
1405
+ const diagnostics = createRenderCollectionDiagnostics();
1406
+ if (isIterable(source)) {
1407
+ const items = applyViewProjection([...source], cameraViewProjection);
1408
+ diagnostics.submittedObjects += items.length;
1409
+ diagnostics.visibleObjects += items.length;
1410
+ return { items, diagnostics };
1411
+ }
1412
+ if (source instanceof Scene) {
1413
+ const items = collectSceneRenderItems(source, {}, cameraViewProjection, camera, diagnostics);
1414
+ return { items, diagnostics };
1415
+ }
1416
+ const items = [];
1417
+ if (source.scene) {
1418
+ items.push(...collectSceneRenderItems(source.scene, source, cameraViewProjection, source.frustumCulling === false ? undefined : camera, diagnostics));
1419
+ }
1420
+ const explicitItems = [];
1421
+ if (source.collectRenderItems) {
1422
+ explicitItems.push(...source.collectRenderItems());
1423
+ }
1424
+ if (source.renderItems) {
1425
+ explicitItems.push(...source.renderItems);
1426
+ }
1427
+ if (explicitItems.length > 0) {
1428
+ const optimizedItems = applyRendererOwnedStaticBatching(source, explicitItems);
1429
+ const projectedItems = applyViewProjection(optimizedItems, cameraViewProjection);
1430
+ diagnostics.submittedObjects += explicitItems.length;
1431
+ diagnostics.visibleObjects += explicitItems.length;
1432
+ items.push(...projectedItems);
1433
+ }
1434
+ return { items, diagnostics };
1435
+ }
1436
+ const staticBatchGeometryIds = new WeakMap();
1437
+ const staticBatchMaterialIds = new WeakMap();
1438
+ let nextStaticBatchResourceId = 1;
1439
+ function applyRendererOwnedStaticBatching(source, items) {
1440
+ if (!source.staticBatching)
1441
+ return items;
1442
+ const batchable = [];
1443
+ const passthrough = [];
1444
+ for (const item of items) {
1445
+ if (isStaticBatchCandidate(item)) {
1446
+ batchable.push({
1447
+ geometry: item.geometry,
1448
+ material: item.material,
1449
+ modelMatrix: item.modelMatrix ?? identityMat4(),
1450
+ batchKey: staticBatchKey(item),
1451
+ label: item.label
1452
+ });
1453
+ }
1454
+ else {
1455
+ passthrough.push(item);
1456
+ }
1457
+ }
1458
+ if (batchable.length === 0)
1459
+ return items;
1460
+ const options = source.staticBatching === true ? {} : source.staticBatching;
1461
+ const batched = batchStaticRenderItems(batchable, {
1462
+ labelPrefix: "renderer-static-batch",
1463
+ ...options
1464
+ });
1465
+ return [...passthrough, ...batched.renderItems];
1466
+ }
1467
+ function isStaticBatchCandidate(item) {
1468
+ return item.material !== undefined &&
1469
+ item.drawRange === undefined &&
1470
+ item.skinning === undefined &&
1471
+ item.morphTargets === undefined &&
1472
+ item.morphWeights === undefined &&
1473
+ item.instanceTransforms === undefined &&
1474
+ item.instanceColors === undefined &&
1475
+ item.instanceAttributes === undefined;
1476
+ }
1477
+ function staticBatchKey(item) {
1478
+ return `${resourceId(staticBatchGeometryIds, item.geometry)}:${resourceId(staticBatchMaterialIds, item.material)}`;
1479
+ }
1480
+ function resourceId(ids, resource) {
1481
+ const existing = ids.get(resource);
1482
+ if (existing !== undefined)
1483
+ return existing;
1484
+ const next = nextStaticBatchResourceId++;
1485
+ ids.set(resource, next);
1486
+ return next;
1487
+ }
1488
+ function collectSceneRenderItems(scene, source, cameraViewProjection, camera, diagnostics) {
1489
+ scene.updateWorldTransforms();
1490
+ const renderables = scene.collectRenderables();
1491
+ if (renderables.length === 0) {
1492
+ return [];
1493
+ }
1494
+ if (!source.geometryLibrary || !source.materialLibrary) {
1495
+ throw new RenderDeviceError("Scene rendering requires geometryLibrary and materialLibrary resource lookups", "SCENE_RENDER_RESOURCES_MISSING", {
1496
+ renderables: renderables.length
1497
+ });
1498
+ }
1499
+ const items = [];
1500
+ for (const { node, renderable } of renderables) {
1501
+ const geometry = lookupRenderResource(source.geometryLibrary, renderable.geometry);
1502
+ const material = lookupRenderResource(source.materialLibrary, renderable.material);
1503
+ if (!geometry) {
1504
+ throw new RenderDeviceError("Scene renderable references missing geometry", "SCENE_GEOMETRY_MISSING", {
1505
+ node: node.name,
1506
+ geometry: renderable.geometry
1507
+ });
1508
+ }
1509
+ if (!material) {
1510
+ throw new RenderDeviceError("Scene renderable references missing material", "SCENE_MATERIAL_MISSING", {
1511
+ node: node.name,
1512
+ material: renderable.material
1513
+ });
1514
+ }
1515
+ const morphTargets = source.morphTargetLibrary ? lookupRenderResource(source.morphTargetLibrary, renderable.geometry) : undefined;
1516
+ if (renderable.morphWeights.length > 0 && !morphTargets) {
1517
+ throw new RenderDeviceError("Scene renderable has morph weights but no morph target resource entry", "SCENE_MORPH_TARGETS_MISSING", {
1518
+ node: node.name,
1519
+ geometry: renderable.geometry,
1520
+ morphWeights: renderable.morphWeights.length
1521
+ });
1522
+ }
1523
+ const modelMatrix = node.transform.worldMatrix;
1524
+ const bounds = renderableWorldBounds(geometry, modelMatrix, renderable.instanceTransforms, morphTargets, renderable.morphWeights, renderable.skinning);
1525
+ if (diagnostics) {
1526
+ diagnostics.submittedObjects += 1;
1527
+ if (camera)
1528
+ diagnostics.frustumTestedObjects += 1;
1529
+ }
1530
+ if (camera && !camera.frustum.intersectsBox(bounds.toMathBox())) {
1531
+ if (diagnostics)
1532
+ diagnostics.culledObjects += 1;
1533
+ continue;
1534
+ }
1535
+ if (diagnostics)
1536
+ diagnostics.visibleObjects += 1;
1537
+ items.push({
1538
+ geometry,
1539
+ material,
1540
+ label: node.name,
1541
+ modelMatrix,
1542
+ normalMatrix: normalMatrixFromModel(modelMatrix),
1543
+ modelViewProjectionMatrix: multiplyMat4(cameraViewProjection ?? identityMat4(), modelMatrix),
1544
+ ...(renderable.skinning ? { skinning: renderable.skinning } : {}),
1545
+ ...(renderable.instanceTransforms ? { instanceTransforms: renderable.instanceTransforms } : {}),
1546
+ ...(renderable.instanceColors ? { instanceColors: renderable.instanceColors } : {}),
1547
+ ...(morphTargets && renderable.morphWeights.length > 0 ? { morphTargets, morphWeights: renderable.morphWeights } : {})
1548
+ });
1549
+ }
1550
+ return items;
1551
+ }
1552
+ function createRenderCollectionDiagnostics() {
1553
+ return {
1554
+ submittedObjects: 0,
1555
+ visibleObjects: 0,
1556
+ culledObjects: 0,
1557
+ frustumTestedObjects: 0
1558
+ };
1559
+ }
1560
+ function createPostprocessDiagnostics(postprocess, ownedTargets, width, height, context = {}) {
1561
+ if (!postprocess)
1562
+ return undefined;
1563
+ const passes = createRendererPostprocessPasses(postprocess);
1564
+ const targetFormat = context.targetFormat ?? postprocess.targetFormat ?? "rgba8";
1565
+ return {
1566
+ postprocessPasses: passes.length,
1567
+ postprocessPassNames: passes.map((pass) => pass.name),
1568
+ postprocessTargetFormat: targetFormat,
1569
+ postprocessRenderTargets: ownedTargets.length,
1570
+ postprocessTextures: ownedTargets.reduce((total, target) => total + 1 + (target.depthTexture ? 1 : 0), 0),
1571
+ postprocessTargetWidth: width,
1572
+ postprocessTargetHeight: height,
1573
+ postprocessPlan: createRendererPostprocessPlanDiagnostics(postprocess, {
1574
+ sourceTargetFormat: targetFormat,
1575
+ targetFormat,
1576
+ nativeLdrPostprocess: context.nativeLdrPostprocess,
1577
+ rendererDepthAvailable: context.rendererDepthAvailable
1578
+ })
1579
+ };
1580
+ }
1581
+ const CAPTURE_NON_BLANK_LUMINANCE_THRESHOLD = 1 / 255;
1582
+ const CAPTURE_UNDEREXPOSED_LUMINANCE_THRESHOLD = 5 / 255;
1583
+ const CAPTURE_OVEREXPOSED_LUMINANCE_THRESHOLD = 250 / 255;
1584
+ const CAPTURE_CLIPPED_CHANNEL_THRESHOLD = 254;
1585
+ function createRendererFrameCaptureMetadata(device, width, height, pixels, diagnostics) {
1586
+ const pixelDigest = createRendererFramePixelDigest(pixels);
1587
+ return {
1588
+ capturedAt: new Date().toISOString(),
1589
+ renderSize: {
1590
+ width,
1591
+ height,
1592
+ pixelCount: width * height,
1593
+ byteLength: pixels.byteLength,
1594
+ aspectRatio: roundCaptureMetric(height > 0 ? width / height : 0)
1595
+ },
1596
+ pixelHash: pixelDigest.value,
1597
+ pixelDigest,
1598
+ pixelStats: createRendererFramePixelStats(pixels, width, height),
1599
+ diagnosticsSummary: createRendererFrameDiagnosticsSummary(device, diagnostics)
1600
+ };
1601
+ }
1602
+ function createRendererFramePixelDigest(pixels) {
1603
+ return {
1604
+ algorithm: "sha256",
1605
+ encoding: "hex",
1606
+ source: "rgba8",
1607
+ value: sha256Hex(pixels),
1608
+ byteLength: pixels.byteLength
1609
+ };
1610
+ }
1611
+ function createRendererFramePixelStats(pixels, width, height) {
1612
+ const totalPixels = Math.max(0, width * height);
1613
+ const divisor = totalPixels > 0 ? totalPixels : 1;
1614
+ let opaquePixels = 0;
1615
+ let transparentPixels = 0;
1616
+ let nonBlankPixels = 0;
1617
+ let underexposedPixels = 0;
1618
+ let overexposedPixels = 0;
1619
+ let clippedChannelPixels = 0;
1620
+ let luminanceSum = 0;
1621
+ let alphaSum = 0;
1622
+ let redSum = 0;
1623
+ let greenSum = 0;
1624
+ let blueSum = 0;
1625
+ let minLuminance = totalPixels > 0 ? Number.POSITIVE_INFINITY : 0;
1626
+ let maxLuminance = 0;
1627
+ for (let pixel = 0; pixel < totalPixels; pixel += 1) {
1628
+ const offset = pixel * 4;
1629
+ const red = pixels[offset] ?? 0;
1630
+ const green = pixels[offset + 1] ?? 0;
1631
+ const blue = pixels[offset + 2] ?? 0;
1632
+ const alpha = pixels[offset + 3] ?? 0;
1633
+ const luminance = ((0.2126 * red) + (0.7152 * green) + (0.0722 * blue)) / 255;
1634
+ redSum += red;
1635
+ greenSum += green;
1636
+ blueSum += blue;
1637
+ alphaSum += alpha;
1638
+ luminanceSum += luminance;
1639
+ minLuminance = Math.min(minLuminance, luminance);
1640
+ maxLuminance = Math.max(maxLuminance, luminance);
1641
+ if (alpha === 255)
1642
+ opaquePixels += 1;
1643
+ if (alpha === 0)
1644
+ transparentPixels += 1;
1645
+ if (alpha > 0 && luminance > CAPTURE_NON_BLANK_LUMINANCE_THRESHOLD)
1646
+ nonBlankPixels += 1;
1647
+ if (alpha > 0 && luminance <= CAPTURE_UNDEREXPOSED_LUMINANCE_THRESHOLD)
1648
+ underexposedPixels += 1;
1649
+ if (alpha > 0 && luminance >= CAPTURE_OVEREXPOSED_LUMINANCE_THRESHOLD)
1650
+ overexposedPixels += 1;
1651
+ if (alpha > 0 &&
1652
+ (red >= CAPTURE_CLIPPED_CHANNEL_THRESHOLD ||
1653
+ green >= CAPTURE_CLIPPED_CHANNEL_THRESHOLD ||
1654
+ blue >= CAPTURE_CLIPPED_CHANNEL_THRESHOLD)) {
1655
+ clippedChannelPixels += 1;
1656
+ }
1657
+ }
1658
+ return {
1659
+ totalPixels,
1660
+ opaquePixels,
1661
+ opaqueRatio: captureRatio(opaquePixels, totalPixels),
1662
+ transparentPixels,
1663
+ transparentRatio: captureRatio(transparentPixels, totalPixels),
1664
+ nonBlankPixels,
1665
+ nonBlankRatio: captureRatio(nonBlankPixels, totalPixels),
1666
+ underexposedPixels,
1667
+ underexposedRatio: captureRatio(underexposedPixels, totalPixels),
1668
+ overexposedPixels,
1669
+ overexposedRatio: captureRatio(overexposedPixels, totalPixels),
1670
+ clippedChannelPixels,
1671
+ clippedChannelRatio: captureRatio(clippedChannelPixels, totalPixels),
1672
+ averageLuminance: roundCaptureMetric(luminanceSum / divisor),
1673
+ minLuminance: roundCaptureMetric(minLuminance),
1674
+ maxLuminance: roundCaptureMetric(maxLuminance),
1675
+ averageAlpha: roundCaptureMetric((alphaSum / divisor) / 255),
1676
+ averageRgb: [
1677
+ roundCaptureMetric((redSum / divisor) / 255),
1678
+ roundCaptureMetric((greenSum / divisor) / 255),
1679
+ roundCaptureMetric((blueSum / divisor) / 255)
1680
+ ],
1681
+ thresholds: {
1682
+ nonBlankLuminance: roundCaptureMetric(CAPTURE_NON_BLANK_LUMINANCE_THRESHOLD),
1683
+ underexposedLuminance: roundCaptureMetric(CAPTURE_UNDEREXPOSED_LUMINANCE_THRESHOLD),
1684
+ overexposedLuminance: roundCaptureMetric(CAPTURE_OVEREXPOSED_LUMINANCE_THRESHOLD),
1685
+ clippedChannel: roundCaptureMetric(CAPTURE_CLIPPED_CHANNEL_THRESHOLD / 255)
1686
+ }
1687
+ };
1688
+ }
1689
+ function createRendererFrameDiagnosticsSummary(device, diagnostics) {
1690
+ const resources = {
1691
+ buffers: diagnostics.buffers,
1692
+ shaders: diagnostics.shaders,
1693
+ ...(diagnostics.renderTargets !== undefined ? { renderTargets: diagnostics.renderTargets } : {}),
1694
+ ...(diagnostics.textures !== undefined ? { textures: diagnostics.textures } : {})
1695
+ };
1696
+ const memoryBytes = {
1697
+ ...(diagnostics.bufferBytes !== undefined ? { buffers: diagnostics.bufferBytes } : {}),
1698
+ ...(diagnostics.textureBytes !== undefined ? { textures: diagnostics.textureBytes } : {}),
1699
+ ...(diagnostics.approximateGpuMemoryBytes !== undefined ? { approximateGpu: diagnostics.approximateGpuMemoryBytes } : {})
1700
+ };
1701
+ const scene = {
1702
+ ...(diagnostics.submittedObjects !== undefined ? { submittedObjects: diagnostics.submittedObjects } : {}),
1703
+ ...(diagnostics.visibleObjects !== undefined ? { visibleObjects: diagnostics.visibleObjects } : {}),
1704
+ ...(diagnostics.culledObjects !== undefined ? { culledObjects: diagnostics.culledObjects } : {}),
1705
+ ...(diagnostics.frustumTestedObjects !== undefined ? { frustumTestedObjects: diagnostics.frustumTestedObjects } : {})
1706
+ };
1707
+ const postprocess = {
1708
+ ...(diagnostics.postprocessPasses !== undefined ? { passes: diagnostics.postprocessPasses } : {}),
1709
+ ...(diagnostics.postprocessPassNames !== undefined ? { passNames: diagnostics.postprocessPassNames } : {}),
1710
+ ...(diagnostics.postprocessTargetFormat !== undefined ? { targetFormat: diagnostics.postprocessTargetFormat } : {}),
1711
+ ...(diagnostics.postprocessRenderTargets !== undefined ? { renderTargets: diagnostics.postprocessRenderTargets } : {}),
1712
+ ...(diagnostics.postprocessTextures !== undefined ? { textures: diagnostics.postprocessTextures } : {}),
1713
+ ...(diagnostics.postprocessTargetWidth !== undefined ? { targetWidth: diagnostics.postprocessTargetWidth } : {}),
1714
+ ...(diagnostics.postprocessTargetHeight !== undefined ? { targetHeight: diagnostics.postprocessTargetHeight } : {})
1715
+ };
1716
+ return {
1717
+ backend: device.kind,
1718
+ renderer: device.info.renderer,
1719
+ vendor: device.info.vendor,
1720
+ capabilities: device.info.capabilities ?? [],
1721
+ limitations: device.info.limitations ?? [],
1722
+ drawCalls: diagnostics.drawCalls,
1723
+ resources,
1724
+ ...(Object.keys(memoryBytes).length > 0 ? { memoryBytes } : {}),
1725
+ ...(Object.keys(scene).length > 0 ? { scene } : {}),
1726
+ ...(Object.keys(postprocess).length > 0 ? { postprocess } : {}),
1727
+ contextLost: diagnostics.contextLost,
1728
+ lastError: diagnostics.lastError
1729
+ };
1730
+ }
1731
+ function captureRatio(count, total) {
1732
+ return roundCaptureMetric(total > 0 ? count / total : 0);
1733
+ }
1734
+ function roundCaptureMetric(value) {
1735
+ if (!Number.isFinite(value))
1736
+ return 0;
1737
+ return Math.round(value * 1000000) / 1000000;
1738
+ }
1739
+ const SHA256_INITIAL_HASH = [
1740
+ 0x6a09e667,
1741
+ 0xbb67ae85,
1742
+ 0x3c6ef372,
1743
+ 0xa54ff53a,
1744
+ 0x510e527f,
1745
+ 0x9b05688c,
1746
+ 0x1f83d9ab,
1747
+ 0x5be0cd19
1748
+ ];
1749
+ const SHA256_ROUND_CONSTANTS = [
1750
+ 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
1751
+ 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
1752
+ 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
1753
+ 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
1754
+ 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
1755
+ 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
1756
+ 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
1757
+ 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
1758
+ ];
1759
+ function sha256Hex(bytes) {
1760
+ const paddedLength = Math.ceil((bytes.length + 9) / 64) * 64;
1761
+ const bitLengthHigh = Math.floor(bytes.length / 0x20000000);
1762
+ const bitLengthLow = (bytes.length % 0x20000000) * 8;
1763
+ const hash = [...SHA256_INITIAL_HASH];
1764
+ const words = new Uint32Array(64);
1765
+ for (let block = 0; block < paddedLength; block += 64) {
1766
+ for (let index = 0; index < 16; index += 1) {
1767
+ const offset = block + index * 4;
1768
+ words[index] = ((sha256PaddedByte(bytes, offset, paddedLength, bitLengthHigh, bitLengthLow) << 24) |
1769
+ (sha256PaddedByte(bytes, offset + 1, paddedLength, bitLengthHigh, bitLengthLow) << 16) |
1770
+ (sha256PaddedByte(bytes, offset + 2, paddedLength, bitLengthHigh, bitLengthLow) << 8) |
1771
+ sha256PaddedByte(bytes, offset + 3, paddedLength, bitLengthHigh, bitLengthLow)) >>> 0;
1772
+ }
1773
+ for (let index = 16; index < 64; index += 1) {
1774
+ const first = words[index - 15];
1775
+ const second = words[index - 2];
1776
+ const sigma0 = rightRotate32(first, 7) ^ rightRotate32(first, 18) ^ (first >>> 3);
1777
+ const sigma1 = rightRotate32(second, 17) ^ rightRotate32(second, 19) ^ (second >>> 10);
1778
+ words[index] = (words[index - 16] + sigma0 + words[index - 7] + sigma1) >>> 0;
1779
+ }
1780
+ let a = hash[0];
1781
+ let b = hash[1];
1782
+ let c = hash[2];
1783
+ let d = hash[3];
1784
+ let e = hash[4];
1785
+ let f = hash[5];
1786
+ let g = hash[6];
1787
+ let h = hash[7];
1788
+ for (let index = 0; index < 64; index += 1) {
1789
+ const sigma1 = rightRotate32(e, 6) ^ rightRotate32(e, 11) ^ rightRotate32(e, 25);
1790
+ const choice = (e & f) ^ (~e & g);
1791
+ const temp1 = (h + sigma1 + choice + SHA256_ROUND_CONSTANTS[index] + words[index]) >>> 0;
1792
+ const sigma0 = rightRotate32(a, 2) ^ rightRotate32(a, 13) ^ rightRotate32(a, 22);
1793
+ const majority = (a & b) ^ (a & c) ^ (b & c);
1794
+ const temp2 = (sigma0 + majority) >>> 0;
1795
+ h = g;
1796
+ g = f;
1797
+ f = e;
1798
+ e = (d + temp1) >>> 0;
1799
+ d = c;
1800
+ c = b;
1801
+ b = a;
1802
+ a = (temp1 + temp2) >>> 0;
1803
+ }
1804
+ hash[0] = (hash[0] + a) >>> 0;
1805
+ hash[1] = (hash[1] + b) >>> 0;
1806
+ hash[2] = (hash[2] + c) >>> 0;
1807
+ hash[3] = (hash[3] + d) >>> 0;
1808
+ hash[4] = (hash[4] + e) >>> 0;
1809
+ hash[5] = (hash[5] + f) >>> 0;
1810
+ hash[6] = (hash[6] + g) >>> 0;
1811
+ hash[7] = (hash[7] + h) >>> 0;
1812
+ }
1813
+ return hash.map((word) => word.toString(16).padStart(8, "0")).join("");
1814
+ }
1815
+ function sha256PaddedByte(bytes, index, paddedLength, bitLengthHigh, bitLengthLow) {
1816
+ if (index < bytes.length)
1817
+ return bytes[index];
1818
+ if (index === bytes.length)
1819
+ return 0x80;
1820
+ const lengthOffset = index - (paddedLength - 8);
1821
+ if (lengthOffset < 0)
1822
+ return 0;
1823
+ if (lengthOffset < 4)
1824
+ return (bitLengthHigh >>> ((3 - lengthOffset) * 8)) & 0xff;
1825
+ return (bitLengthLow >>> ((7 - lengthOffset) * 8)) & 0xff;
1826
+ }
1827
+ function rightRotate32(value, bits) {
1828
+ return ((value >>> bits) | (value << (32 - bits))) >>> 0;
1829
+ }
1830
+ function withRendererFrameDiagnostics(diagnostics, collection, postprocess) {
1831
+ return {
1832
+ ...diagnostics,
1833
+ submittedObjects: collection.submittedObjects,
1834
+ visibleObjects: collection.visibleObjects,
1835
+ culledObjects: collection.culledObjects,
1836
+ frustumTestedObjects: collection.frustumTestedObjects,
1837
+ ...(postprocess ?? {})
1838
+ };
1839
+ }
1840
+ function renderableWorldBounds(geometry, modelMatrix, instanceTransforms, morphTargets, morphWeights, skinning) {
1841
+ const envelope = computeSkinnedMorphTargetWeightedBounds(geometry, skinning, morphTargets, morphWeights);
1842
+ const local = new SceneBounds3([envelope.min[0], envelope.min[1], envelope.min[2]], [envelope.max[0], envelope.max[1], envelope.max[2]]);
1843
+ if (!instanceTransforms) {
1844
+ return local.transform(modelMatrix);
1845
+ }
1846
+ let bounds = new SceneBounds3();
1847
+ for (let offset = 0; offset < instanceTransforms.length; offset += 16) {
1848
+ const instanceMatrix = toMat4(instanceTransforms.slice(offset, offset + 16), "instanceTransforms");
1849
+ bounds = bounds.union(local.transform(multiplyMat4(modelMatrix, instanceMatrix)));
1850
+ }
1851
+ return bounds;
1852
+ }
1853
+ function applyViewProjection(items, cameraViewProjection) {
1854
+ const hasCameraViewProjection = cameraViewProjection !== undefined;
1855
+ const viewProjection = cameraViewProjection ?? identityMat4();
1856
+ return items.map((item) => {
1857
+ const modelMatrix = toMat4(item.modelMatrix ?? identityMat4(), "modelMatrix", item.label);
1858
+ const explicitModelViewProjection = item.modelViewProjectionMatrix
1859
+ ? toMat4(item.modelViewProjectionMatrix, "modelViewProjectionMatrix", item.label)
1860
+ : undefined;
1861
+ return {
1862
+ ...item,
1863
+ modelMatrix,
1864
+ normalMatrix: item.normalMatrix ? toMat4(item.normalMatrix, "normalMatrix", item.label) : normalMatrixFromModel(modelMatrix),
1865
+ modelViewProjectionMatrix: hasCameraViewProjection || !explicitModelViewProjection
1866
+ ? multiplyMat4(viewProjection, modelMatrix)
1867
+ : explicitModelViewProjection
1868
+ };
1869
+ });
1870
+ }
1871
+ function createAutoFrameCamera(source, items, width, height) {
1872
+ const bounds = collectCameraFrameBounds(source) ?? collectRenderItemBounds(items);
1873
+ if (!bounds || bounds.isEmpty()) {
1874
+ return undefined;
1875
+ }
1876
+ const frame = computePerspectiveCameraFrame(bounds, { width, height }, {
1877
+ ...DEFAULT_RENDERER_AUTO_FRAME_OPTIONS,
1878
+ ...collectCameraFrameOptions(source)
1879
+ });
1880
+ return {
1881
+ viewProjectionMatrix: frame.viewProjectionMatrix,
1882
+ cameraPosition: frame.cameraPosition
1883
+ };
1884
+ }
1885
+ function collectRenderItemBounds(items) {
1886
+ let bounds;
1887
+ for (const item of items) {
1888
+ if (item.includeInAutoFrame === false)
1889
+ continue;
1890
+ const itemBounds = renderableWorldBounds(item.geometry, toMat4(item.modelMatrix ?? identityMat4(), "modelMatrix", item.label), item.instanceTransforms, item.morphTargets, item.morphWeights, item.skinning);
1891
+ bounds = bounds ? bounds.union(itemBounds) : itemBounds;
1892
+ }
1893
+ return bounds;
1894
+ }
1895
+ function collectCameraFrameOptions(source) {
1896
+ if (source instanceof Scene || isIterable(source) || !source.cameraFrameOptions)
1897
+ return {};
1898
+ return source.cameraFrameOptions;
1899
+ }
1900
+ function collectCameraFrameBounds(source) {
1901
+ if (source instanceof Scene || isIterable(source) || !source.cameraFrameBounds)
1902
+ return undefined;
1903
+ const bounds = source.cameraFrameBounds;
1904
+ const min = bounds.min;
1905
+ const max = bounds.max;
1906
+ const values = [...min, ...max];
1907
+ if (values.length !== 6 || values.some((value) => !Number.isFinite(value))) {
1908
+ throw new RenderDeviceError("RenderSource cameraFrameBounds must contain finite min/max vectors.", "CAMERA_FRAME_BOUNDS_INVALID", {
1909
+ min: [...min],
1910
+ max: [...max]
1911
+ });
1912
+ }
1913
+ if (max[0] < min[0] || max[1] < min[1] || max[2] < min[2]) {
1914
+ throw new RenderDeviceError("RenderSource cameraFrameBounds max must be greater than or equal to min.", "CAMERA_FRAME_BOUNDS_INVALID", {
1915
+ min: [...min],
1916
+ max: [...max]
1917
+ });
1918
+ }
1919
+ return new SceneBounds3([min[0], min[1], min[2]], [max[0], max[1], max[2]]);
1920
+ }
1921
+ function resolveCamera(source, camera, viewport, options = {}) {
1922
+ const resolved = camera ?? (options.allowSceneCamera === false ? undefined : resolveSceneCamera(source));
1923
+ if (!resolved) {
1924
+ return undefined;
1925
+ }
1926
+ const resize = maybeCameraResize(resolved);
1927
+ if (viewport && resize) {
1928
+ resize(viewport.width, viewport.height);
1929
+ }
1930
+ resolved.updateCameraMatrices?.();
1931
+ if (resolved.viewProjectionMatrix) {
1932
+ const viewMatrix = resolved.viewMatrix ? toMat4(resolved.viewMatrix, "viewMatrix") : undefined;
1933
+ return {
1934
+ viewProjectionMatrix: toMat4(resolved.viewProjectionMatrix, "viewProjectionMatrix"),
1935
+ ...(resolved instanceof Camera
1936
+ ? { camera: resolved, cameraPosition: cameraWorldPosition(resolved) }
1937
+ : viewMatrix
1938
+ ? { cameraPosition: cameraPositionFromViewMatrix(viewMatrix) }
1939
+ : {})
1940
+ };
1941
+ }
1942
+ if (resolved.projectionMatrix && resolved.viewMatrix) {
1943
+ const viewMatrix = toMat4(resolved.viewMatrix, "viewMatrix");
1944
+ return {
1945
+ viewProjectionMatrix: multiplyMat4(toMat4(resolved.projectionMatrix, "projectionMatrix"), viewMatrix),
1946
+ ...(resolved instanceof Camera
1947
+ ? { camera: resolved, cameraPosition: cameraWorldPosition(resolved) }
1948
+ : { cameraPosition: cameraPositionFromViewMatrix(viewMatrix) })
1949
+ };
1950
+ }
1951
+ throw new RenderDeviceError("Renderer camera must expose a viewProjectionMatrix or projectionMatrix plus viewMatrix", "CAMERA_VIEW_PROJECTION_MISSING");
1952
+ }
1953
+ function hasExplicitAutoFrameCameraPolicy(source) {
1954
+ return !(source instanceof Scene) && !isIterable(source) && source.cameraPolicy === "auto-frame";
1955
+ }
1956
+ function cameraWorldPosition(camera) {
1957
+ const matrix = camera.transform.worldMatrix;
1958
+ return [matrix[12] ?? 0, matrix[13] ?? 0, matrix[14] ?? 0];
1959
+ }
1960
+ function cameraPositionFromViewMatrix(viewMatrix) {
1961
+ const inverseView = invertMat4(viewMatrix);
1962
+ return [inverseView[12] ?? 0, inverseView[13] ?? 0, inverseView[14] ?? 0];
1963
+ }
1964
+ function maybeCameraResize(camera) {
1965
+ const candidate = camera.resize;
1966
+ return typeof candidate === "function" ? candidate.bind(camera) : undefined;
1967
+ }
1968
+ function resolveSceneCamera(source) {
1969
+ return sceneFromSource(source)?.collectCameras()[0];
1970
+ }
1971
+ function sceneFromSource(source) {
1972
+ return source instanceof Scene ? source : isIterable(source) ? undefined : source.scene;
1973
+ }
1974
+ function normalMatrixFromModel(modelMatrix) {
1975
+ const matrix = transposeMat4(invertMat4(modelMatrix));
1976
+ return [
1977
+ matrix[0], matrix[1], matrix[2], 0,
1978
+ matrix[4], matrix[5], matrix[6], 0,
1979
+ matrix[8], matrix[9], matrix[10], 0,
1980
+ 0, 0, 0, 1
1981
+ ];
1982
+ }
1983
+ function transposeMat4(matrix) {
1984
+ return [
1985
+ matrix[0], matrix[4], matrix[8], matrix[12],
1986
+ matrix[1], matrix[5], matrix[9], matrix[13],
1987
+ matrix[2], matrix[6], matrix[10], matrix[14],
1988
+ matrix[3], matrix[7], matrix[11], matrix[15]
1989
+ ];
1990
+ }
1991
+ function toMat4(value, field, label) {
1992
+ const values = Array.from(value);
1993
+ if (values.length !== 16 || !values.every(Number.isFinite)) {
1994
+ throw new RenderDeviceError("Renderer matrix inputs must be finite mat4 values", "RENDERER_MATRIX_CONTRACT", {
1995
+ field,
1996
+ label,
1997
+ scalars: values.length
1998
+ });
1999
+ }
2000
+ return values;
2001
+ }
2002
+ function lookupRenderResource(lookup, key) {
2003
+ if (isReadonlyMap(lookup)) {
2004
+ return lookup.get(key);
2005
+ }
2006
+ return lookup[key];
2007
+ }
2008
+ function isReadonlyMap(lookup) {
2009
+ return typeof lookup.get === "function";
2010
+ }
2011
+ function collectRenderLights(source) {
2012
+ if (source instanceof Scene) {
2013
+ return new LightCollector().collect(source);
2014
+ }
2015
+ if (isIterable(source)) {
2016
+ return [];
2017
+ }
2018
+ if (source.collectedLights !== undefined) {
2019
+ return [...source.collectedLights];
2020
+ }
2021
+ if (source.scene) {
2022
+ const collected = new LightCollector().collect(source.scene);
2023
+ if (collected.length > 0 || source.environmentLighting === false) {
2024
+ return collected;
2025
+ }
2026
+ return createDefaultRendererDirectLights();
2027
+ }
2028
+ if (source.environmentLighting !== false && (source.renderItems || source.collectRenderItems)) {
2029
+ return createDefaultRendererDirectLights();
2030
+ }
2031
+ return [];
2032
+ }
2033
+ function createDefaultRendererDirectLights() {
2034
+ const key = new DirectionalLight("default-renderer-key-light");
2035
+ const fill = new DirectionalLight("default-renderer-fill-light");
2036
+ const lights = [
2037
+ { source: key, ...DEFAULT_RENDERER_DIRECT_LIGHTING.key },
2038
+ { source: fill, ...DEFAULT_RENDERER_DIRECT_LIGHTING.fill }
2039
+ ];
2040
+ return lights.map((light) => {
2041
+ light.source.color = [...light.color];
2042
+ light.source.intensity = light.intensity;
2043
+ return {
2044
+ kind: "directional",
2045
+ color: [...light.color],
2046
+ intensity: light.intensity,
2047
+ position: [0, 0, 0],
2048
+ direction: normalizeDefaultLightDirection(light.direction),
2049
+ range: 0,
2050
+ spotAngle: 0,
2051
+ penumbra: 0,
2052
+ castsShadow: false,
2053
+ layerMask: 0xffffffff,
2054
+ source: light.source
2055
+ };
2056
+ });
2057
+ }
2058
+ function normalizeDefaultLightDirection(direction) {
2059
+ const length = Math.hypot(direction[0], direction[1], direction[2]);
2060
+ if (length <= 0 || !Number.isFinite(length)) {
2061
+ return [0, 0, -1];
2062
+ }
2063
+ return [direction[0] / length, direction[1] / length, direction[2] / length];
2064
+ }
2065
+ function cloneEnvironmentLighting(environment) {
2066
+ return {
2067
+ color: [...environment.color],
2068
+ intensity: environment.intensity,
2069
+ ...(environment.proceduralMap
2070
+ ? {
2071
+ proceduralMap: {
2072
+ skyColor: [...environment.proceduralMap.skyColor],
2073
+ horizonColor: [...environment.proceduralMap.horizonColor],
2074
+ groundColor: [...environment.proceduralMap.groundColor],
2075
+ specularColor: [...environment.proceduralMap.specularColor],
2076
+ intensity: environment.proceduralMap.intensity,
2077
+ specularIntensity: environment.proceduralMap.specularIntensity
2078
+ }
2079
+ }
2080
+ : {}),
2081
+ ...(environment.environmentMapTexture ? { environmentMapTexture: environment.environmentMapTexture } : {}),
2082
+ ...(environment.environmentCubeMapTexture ? { environmentCubeMapTexture: environment.environmentCubeMapTexture } : {}),
2083
+ ...(environment.environmentMapIntensity !== undefined ? { environmentMapIntensity: environment.environmentMapIntensity } : {}),
2084
+ ...(environment.environmentMapSpecularIntensity !== undefined ? { environmentMapSpecularIntensity: environment.environmentMapSpecularIntensity } : {}),
2085
+ ...(environment.environmentMapRotation !== undefined ? { environmentMapRotation: environment.environmentMapRotation } : {}),
2086
+ ...(environment.environmentMapMipCount !== undefined ? { environmentMapMipCount: environment.environmentMapMipCount } : {}),
2087
+ ...(environment.environmentMapEncoding ? { environmentMapEncoding: environment.environmentMapEncoding } : {}),
2088
+ ...(environment.environmentBrdfLutTexture ? { environmentBrdfLutTexture: environment.environmentBrdfLutTexture } : {})
2089
+ };
2090
+ }
2091
+ function isIterable(value) {
2092
+ return typeof value[Symbol.iterator] === "function";
2093
+ }
2094
+ //# sourceMappingURL=Renderer.js.map