@aura3d/rendering 1.3.3 → 1.4.1

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 (314) hide show
  1. package/dist/ForwardPass.js +7 -1
  2. package/dist/ForwardPass.js.map +1 -1
  3. package/dist/MorphTarget.d.ts +1 -0
  4. package/dist/MorphTarget.d.ts.map +1 -1
  5. package/dist/MorphTarget.js.map +1 -1
  6. package/dist/Renderer.js +7 -1
  7. package/dist/Renderer.js.map +1 -1
  8. package/package.json +38 -4
  9. package/src/ArchitecturalLightingFixtures.ts +0 -241
  10. package/src/ArchitecturalMaterialCatalog.ts +0 -130
  11. package/src/ArchitecturalMeasurementFixtures.ts +0 -155
  12. package/src/BRDFLut.ts +0 -47
  13. package/src/CameraFraming.ts +0 -200
  14. package/src/CanonicalSceneFixtures.ts +0 -95
  15. package/src/CascadedShadowMaps.ts +0 -449
  16. package/src/ColorManagement.ts +0 -127
  17. package/src/CullingFixtures.ts +0 -280
  18. package/src/DecalGeometry.ts +0 -26
  19. package/src/DepthPass.ts +0 -110
  20. package/src/EnvironmentBackgroundPass.ts +0 -194
  21. package/src/EnvironmentBackgroundResources.ts +0 -309
  22. package/src/EnvironmentLighting.ts +0 -96
  23. package/src/EnvironmentMapResources.ts +0 -1026
  24. package/src/EnvironmentPipeline.ts +0 -69
  25. package/src/EnvironmentPlatform.ts +0 -1306
  26. package/src/EnvironmentPreset.ts +0 -155
  27. package/src/Exposure.ts +0 -66
  28. package/src/ExternalParityRenderPreset.ts +0 -725
  29. package/src/ForwardPass.ts +0 -1663
  30. package/src/FrameVisualMetrics.ts +0 -301
  31. package/src/Geometry.ts +0 -461
  32. package/src/GeometryPrimitives.ts +0 -2
  33. package/src/HDRRenderPipeline.ts +0 -94
  34. package/src/IBL.ts +0 -86
  35. package/src/IndexBuffer.ts +0 -57
  36. package/src/InstancedPBRMaterial.ts +0 -186
  37. package/src/InstancedUnlitMaterial.ts +0 -60
  38. package/src/Instancing.ts +0 -19
  39. package/src/LightCollector.ts +0 -82
  40. package/src/LightUniforms.ts +0 -47
  41. package/src/LightingDebug.ts +0 -80
  42. package/src/LightingDefaults.ts +0 -79
  43. package/src/LightingRig.ts +0 -301
  44. package/src/LineGeometry.ts +0 -2
  45. package/src/Material.ts +0 -209
  46. package/src/MaterialBinding.ts +0 -131
  47. package/src/MaterialInstance.ts +0 -59
  48. package/src/MaterialPresets.ts +0 -272
  49. package/src/MorphTarget.ts +0 -123
  50. package/src/MorphTargetPlan.ts +0 -178
  51. package/src/MorphUnlitMaterial.ts +0 -60
  52. package/src/NormalMappedPBRMaterial.ts +0 -188
  53. package/src/OceanFixtures.ts +0 -318
  54. package/src/PBRLightingDefaults.ts +0 -12
  55. package/src/PBRMaterial.ts +0 -442
  56. package/src/PMREM.ts +0 -53
  57. package/src/PbrReference.ts +0 -681
  58. package/src/PostProcessPass.ts +0 -2507
  59. package/src/ProceduralTextureFixtures.ts +0 -393
  60. package/src/ProductTurntableFixtures.ts +0 -815
  61. package/src/Raycaster.ts +0 -21
  62. package/src/ReflectionProbe.ts +0 -13
  63. package/src/ReflectionSurfaces.ts +0 -219
  64. package/src/RenderBackend.ts +0 -43
  65. package/src/RenderDebugViews.ts +0 -138
  66. package/src/RenderDevice.ts +0 -836
  67. package/src/RenderGraph.ts +0 -194
  68. package/src/RenderPass.ts +0 -27
  69. package/src/RenderPipeline.ts +0 -101
  70. package/src/RenderQueue.ts +0 -12
  71. package/src/RenderState.ts +0 -12
  72. package/src/Renderer.ts +0 -2626
  73. package/src/RendererDebugOverlay.ts +0 -80
  74. package/src/RendererFeatureGates.ts +0 -150
  75. package/src/RendererPostprocessPlan.ts +0 -279
  76. package/src/RendererTiming.ts +0 -251
  77. package/src/RendererVisualPipelineReport.ts +0 -836
  78. package/src/ResourceLifecycle.ts +0 -21
  79. package/src/Sampler.ts +0 -37
  80. package/src/SceneOptimization.ts +0 -518
  81. package/src/ShaderChunks.ts +0 -393
  82. package/src/ShaderLibrary.ts +0 -2766
  83. package/src/ShaderModule.ts +0 -36
  84. package/src/ShaderPreprocessor.ts +0 -260
  85. package/src/ShaderReflection.ts +0 -201
  86. package/src/ShadowMap.ts +0 -237
  87. package/src/ShadowPass.ts +0 -198
  88. package/src/ShadowProjection.ts +0 -115
  89. package/src/SkinnedLitMaterial.ts +0 -397
  90. package/src/SkinnedUnlitMaterial.ts +0 -63
  91. package/src/SkinningBounds.ts +0 -131
  92. package/src/SpaceEnvironmentFixtures.ts +0 -200
  93. package/src/SpriteGeometry.ts +0 -21
  94. package/src/StereoCameraRig.ts +0 -127
  95. package/src/StereoEffects.ts +0 -274
  96. package/src/TerrainFixtures.ts +0 -180
  97. package/src/Texture.ts +0 -307
  98. package/src/TextureBinding.ts +0 -91
  99. package/src/TexturedPBRMaterial.ts +0 -1112
  100. package/src/TexturedUnlitMaterial.ts +0 -67
  101. package/src/ToneMapping.ts +0 -105
  102. package/src/UniformBinder.ts +0 -16
  103. package/src/UniformLayout.ts +0 -129
  104. package/src/UnlitMaterial.ts +0 -75
  105. package/src/VegetationFixtures.ts +0 -314
  106. package/src/VertexBuffer.ts +0 -120
  107. package/src/VertexFormat.ts +0 -171
  108. package/src/VoxelWorldFixtures.ts +0 -280
  109. package/src/WeatherFixtures.ts +0 -223
  110. package/src/WebGL2Device.ts +0 -2280
  111. package/src/WebGL2StateCache.ts +0 -330
  112. package/src/WebGPUDevice.ts +0 -2877
  113. package/src/WebGPURenderToTextureProof.ts +0 -139
  114. package/src/advanced-runtime/AdvancedRenderer.ts +0 -73
  115. package/src/advanced-runtime/index.ts +0 -9
  116. package/src/animation/AnimationMaterialStyle.ts +0 -32
  117. package/src/animation/AnimationRenderPreset.ts +0 -45
  118. package/src/animation/AnimationToonMaterial.ts +0 -387
  119. package/src/animation/AnimationVisualQuality.ts +0 -71
  120. package/src/animation/applyAnimationRenderPreset.ts +0 -180
  121. package/src/animation/index.ts +0 -5
  122. package/src/cinematic/BloomPass.ts +0 -26
  123. package/src/cinematic/CinematicDepthComposition.ts +0 -30
  124. package/src/cinematic/CinematicEvidence.ts +0 -123
  125. package/src/cinematic/CinematicLightingRig.ts +0 -144
  126. package/src/cinematic/CinematicMaterialPresets.ts +0 -130
  127. package/src/cinematic/CinematicPostProcess.ts +0 -83
  128. package/src/cinematic/DepthHazePass.ts +0 -30
  129. package/src/cinematic/EmissivePracticalLightSystem.ts +0 -45
  130. package/src/cinematic/FilmGrainPass.ts +0 -24
  131. package/src/cinematic/FogVolumeSystem.ts +0 -30
  132. package/src/cinematic/GlowCardSystem.ts +0 -44
  133. package/src/cinematic/RainParticleSystem.ts +0 -151
  134. package/src/cinematic/VignettePass.ts +0 -25
  135. package/src/cinematic/WetReflectionApproximation.ts +0 -27
  136. package/src/cinematic/index.ts +0 -14
  137. package/src/effects/CollisionModule.ts +0 -64
  138. package/src/effects/ColorModule.ts +0 -60
  139. package/src/effects/ForceModule.ts +0 -25
  140. package/src/effects/GPUParticleBackend.ts +0 -569
  141. package/src/effects/Particle.ts +0 -108
  142. package/src/effects/ParticleDiagnostics.ts +0 -224
  143. package/src/effects/ParticleEffectPresets.ts +0 -147
  144. package/src/effects/ParticleEmitter.ts +0 -326
  145. package/src/effects/ParticleModule.ts +0 -26
  146. package/src/effects/ParticleRenderPass.ts +0 -117
  147. package/src/effects/ParticleRenderer.ts +0 -132
  148. package/src/effects/ParticleSystem.ts +0 -333
  149. package/src/effects/SizeModule.ts +0 -56
  150. package/src/effects/TrailModule.ts +0 -72
  151. package/src/effects/VelocityModule.ts +0 -75
  152. package/src/effects/index.ts +0 -15
  153. package/src/index.ts +0 -925
  154. package/src/materials/AlphaSorting.ts +0 -30
  155. package/src/materials/MaterialExtensions.ts +0 -42
  156. package/src/materials/PhysicalMaterial.ts +0 -133
  157. package/src/materials/TransmissionPass.ts +0 -51
  158. package/src/performance/BVH.ts +0 -18
  159. package/src/performance/Batcher.ts +0 -2
  160. package/src/performance/FrustumCuller.ts +0 -9
  161. package/src/performance/LOD.ts +0 -20
  162. package/src/performance/Octree.ts +0 -10
  163. package/src/performance/RenderItemSorting.ts +0 -170
  164. package/src/performance/RendererStats.ts +0 -43
  165. package/src/performance/ResourceBudget.ts +0 -44
  166. package/src/postprocess/BloomPass.ts +0 -28
  167. package/src/postprocess/CinematicDiagnostics.ts +0 -642
  168. package/src/postprocess/ColorGradingPass.ts +0 -24
  169. package/src/postprocess/DepthOfFieldPass.ts +0 -12
  170. package/src/postprocess/EffectComposer.ts +0 -349
  171. package/src/postprocess/SSAOPass.ts +0 -20
  172. package/src/postprocess/index.ts +0 -34
  173. package/src/production-runtime/AnimationControlsPipeline.ts +0 -77
  174. package/src/production-runtime/PBRHDRPipeline.ts +0 -381
  175. package/src/production-runtime/ProductionEffectsPipeline.ts +0 -85
  176. package/src/production-runtime/ProductionRendererTypes.ts +0 -136
  177. package/src/production-runtime/ProductionRuntimeRenderer.ts +0 -172
  178. package/src/production-runtime/ProductionWebGL2Renderer.ts +0 -313
  179. package/src/production-runtime/ProductionWebGPURenderer.ts +0 -396
  180. package/src/production-runtime/TransmissionBackdropCapture.ts +0 -130
  181. package/src/production-runtime/animation/MorphTargetRenderer.ts +0 -2
  182. package/src/production-runtime/animation/SkinningRenderer.ts +0 -2
  183. package/src/production-runtime/backends/RendererBackend.ts +0 -17
  184. package/src/production-runtime/backends/WebGL2RendererBackend.ts +0 -30
  185. package/src/production-runtime/backends/WebGPURendererBackend.ts +0 -24
  186. package/src/production-runtime/backends/webgl2/WebGL2Buffer.ts +0 -2
  187. package/src/production-runtime/backends/webgl2/WebGL2Capabilities.ts +0 -2
  188. package/src/production-runtime/backends/webgl2/WebGL2RenderTarget.ts +0 -2
  189. package/src/production-runtime/backends/webgl2/WebGL2Shader.ts +0 -2
  190. package/src/production-runtime/backends/webgl2/WebGL2StateCache.ts +0 -1
  191. package/src/production-runtime/backends/webgl2/WebGL2Texture.ts +0 -2
  192. package/src/production-runtime/backends/webgpu/WebGPUBuffer.ts +0 -2
  193. package/src/production-runtime/backends/webgpu/WebGPUCapabilities.ts +0 -2
  194. package/src/production-runtime/backends/webgpu/WebGPURenderTarget.ts +0 -2
  195. package/src/production-runtime/backends/webgpu/WebGPUShader.ts +0 -2
  196. package/src/production-runtime/backends/webgpu/WebGPUTexture.ts +0 -2
  197. package/src/production-runtime/color/ColorManagement.ts +0 -3
  198. package/src/production-runtime/color/ToneMapping.ts +0 -7
  199. package/src/production-runtime/diagnostics/FrameCapture.ts +0 -2
  200. package/src/production-runtime/diagnostics/GPUCapabilities.ts +0 -2
  201. package/src/production-runtime/diagnostics/RendererStats.ts +0 -2
  202. package/src/production-runtime/environment/EnvironmentMap.ts +0 -1
  203. package/src/production-runtime/environment/HDRLoader.ts +0 -57
  204. package/src/production-runtime/environment/PMREMGenerator.ts +0 -713
  205. package/src/production-runtime/framegraph/FrameGraph.ts +0 -18
  206. package/src/production-runtime/framegraph/RenderPass.ts +0 -15
  207. package/src/production-runtime/geometry/ProjectedDecalGeometry.ts +0 -439
  208. package/src/production-runtime/index.ts +0 -127
  209. package/src/production-runtime/lights/LightManager.ts +0 -7
  210. package/src/production-runtime/lights/ShadowMapRenderer.ts +0 -5
  211. package/src/production-runtime/materials/GLTFMaterialAdapter.ts +0 -6
  212. package/src/production-runtime/materials/GLTFPBRMaterialAdapter.ts +0 -2
  213. package/src/production-runtime/materials/MaterialCompiler.ts +0 -7
  214. package/src/production-runtime/materials/MaterialTextureBindings.ts +0 -5
  215. package/src/production-runtime/materials/PBRMaterial.ts +0 -2
  216. package/src/production-runtime/materials/PBRShaderFeatures.ts +0 -2
  217. package/src/production-runtime/passes/ContactShadowPass.ts +0 -184
  218. package/src/production-runtime/passes/DepthPrepass.ts +0 -7
  219. package/src/production-runtime/passes/OpaquePass.ts +0 -7
  220. package/src/production-runtime/passes/ShadowPass.ts +0 -7
  221. package/src/production-runtime/passes/SkyboxPass.ts +0 -7
  222. package/src/production-runtime/passes/ToneMappingPass.ts +0 -7
  223. package/src/production-runtime/passes/TransparentPass.ts +0 -7
  224. package/src/production-runtime/postprocess/BloomPass.ts +0 -51
  225. package/src/production-runtime/postprocess/ColorGradingPass.ts +0 -49
  226. package/src/production-runtime/postprocess/DOFPass.ts +0 -47
  227. package/src/production-runtime/postprocess/FXAAPass.ts +0 -53
  228. package/src/production-runtime/postprocess/ProductionEffectComposer.ts +0 -78
  229. package/src/production-runtime/postprocess/ProductionPostProcessTypes.ts +0 -174
  230. package/src/production-runtime/postprocess/SSAOPass.ts +0 -45
  231. package/src/production-runtime/resources/GPUBuffer.ts +0 -2
  232. package/src/production-runtime/resources/GPUTexture.ts +0 -2
  233. package/src/production-runtime/resources/RenderTarget.ts +0 -3
  234. package/src/production-runtime/resources/ResourceCache.ts +0 -7
  235. package/src/production-runtime/scene/Camera.ts +0 -1
  236. package/src/production-runtime/scene/Lights.ts +0 -2
  237. package/src/production-runtime/scene/RenderableMesh.ts +0 -2
  238. package/src/production-runtime/scene/RenderablePrimitive.ts +0 -1
  239. package/src/production-runtime/scene/RenderableScene.ts +0 -4
  240. package/src/production-runtime/shaders/ShaderProgramLibrary.ts +0 -7
  241. package/src/production-runtime/shaders/chunks/brdf.glsl +0 -2
  242. package/src/production-runtime/shaders/chunks/ibl.glsl +0 -3
  243. package/src/production-runtime/shaders/chunks/pbr.frag.glsl +0 -47
  244. package/src/production-runtime/shaders/chunks/pbr.vert.glsl +0 -8
  245. package/src/production-runtime/shaders/chunks/shadows.glsl +0 -2
  246. package/src/production-runtime/shaders/wgsl/pbr.wgsl +0 -3
  247. package/src/production-runtime/shaders/wgsl/postprocess.wgsl +0 -2
  248. package/src/production-runtime/shaders/wgsl/skybox.wgsl +0 -2
  249. package/src/shaders/depth.frag.glsl +0 -5
  250. package/src/shaders/depth.vert.glsl +0 -8
  251. package/src/shaders/pbr-direct.frag.glsl +0 -687
  252. package/src/shaders/pbr-direct.vert.glsl +0 -18
  253. package/src/shaders/unlit.frag.glsl +0 -18
  254. package/src/shaders/unlit.vert.glsl +0 -13
  255. package/src/shadows/CascadedShadowPipeline.ts +0 -53
  256. package/src/shadows/ContactShadows.ts +0 -106
  257. package/src/shadows/ShadowDebugViews.ts +0 -46
  258. package/src/threejs-compatibility/InstancingSystem.ts +0 -17
  259. package/src/threejs-compatibility/LightingSystem.ts +0 -22
  260. package/src/threejs-compatibility/MaterialSystem.ts +0 -9
  261. package/src/threejs-compatibility/RenderTargetSystem.ts +0 -35
  262. package/src/threejs-compatibility/RendererDiagnostics.ts +0 -61
  263. package/src/threejs-compatibility/SceneRenderer.ts +0 -34
  264. package/src/threejs-compatibility/ShadowSystem.ts +0 -19
  265. package/src/threejs-compatibility/TextureSystem.ts +0 -19
  266. package/src/threejs-compatibility/ThreeCompatRenderer.ts +0 -90
  267. package/src/threejs-compatibility/TransparencySystem.ts +0 -19
  268. package/src/threejs-compatibility/index.ts +0 -29
  269. package/src/threejs-compatibility/performance/BVH.ts +0 -14
  270. package/src/threejs-compatibility/performance/FrustumCulling.ts +0 -10
  271. package/src/threejs-compatibility/performance/Instancing.ts +0 -4
  272. package/src/threejs-compatibility/performance/LODSystem.ts +0 -16
  273. package/src/threejs-compatibility/performance/OcclusionCulling.ts +0 -6
  274. package/src/threejs-compatibility/performance/RaycastAcceleration.ts +0 -12
  275. package/src/threejs-compatibility/performance/RendererProfiler.ts +0 -19
  276. package/src/threejs-compatibility/performance/TextureStreaming.ts +0 -4
  277. package/src/threejs-compatibility/performance/index.ts +0 -12
  278. package/src/threejs-compatibility/postprocess/BloomPass.ts +0 -16
  279. package/src/threejs-compatibility/postprocess/ColorGradingPass.ts +0 -16
  280. package/src/threejs-compatibility/postprocess/DepthOfFieldPass.ts +0 -21
  281. package/src/threejs-compatibility/postprocess/EffectComposer.ts +0 -14
  282. package/src/threejs-compatibility/postprocess/FXAAPass.ts +0 -15
  283. package/src/threejs-compatibility/postprocess/MotionBlurPass.ts +0 -20
  284. package/src/threejs-compatibility/postprocess/OutlinePass.ts +0 -21
  285. package/src/threejs-compatibility/postprocess/PostProcessTypes.ts +0 -169
  286. package/src/threejs-compatibility/postprocess/RenderPass.ts +0 -9
  287. package/src/threejs-compatibility/postprocess/SMAAPass.ts +0 -15
  288. package/src/threejs-compatibility/postprocess/SSAOPass.ts +0 -21
  289. package/src/threejs-compatibility/postprocess/ShaderPass.ts +0 -7
  290. package/src/threejs-compatibility/postprocess/TAAPass.ts +0 -15
  291. package/src/threejs-compatibility/postprocess/VignettePass.ts +0 -16
  292. package/src/threejs-compatibility/postprocess/index.ts +0 -15
  293. package/src/threejs-compatibility/shaders/NodeMaterial.ts +0 -21
  294. package/src/threejs-compatibility/shaders/RawShaderMaterial.ts +0 -6
  295. package/src/threejs-compatibility/shaders/ShaderDiagnostics.ts +0 -17
  296. package/src/threejs-compatibility/shaders/ShaderMaterial.ts +0 -18
  297. package/src/threejs-compatibility/shaders/ThreeCompatShaderChunks.ts +0 -6
  298. package/src/threejs-compatibility/shaders/Uniforms.ts +0 -18
  299. package/src/threejs-compatibility/shaders/index.ts +0 -9
  300. package/src/threejs-compatibility/vfx/GPUPointCloud.ts +0 -7
  301. package/src/threejs-compatibility/vfx/LineRenderer.ts +0 -13
  302. package/src/threejs-compatibility/vfx/ParticleSystem.ts +0 -23
  303. package/src/threejs-compatibility/vfx/SpriteSystem.ts +0 -14
  304. package/src/threejs-compatibility/vfx/TrailRenderer.ts +0 -8
  305. package/src/threejs-compatibility/vfx/VFXDiagnostics.ts +0 -23
  306. package/src/threejs-compatibility/vfx/index.ts +0 -9
  307. package/src/threejs-example-parity/index.ts +0 -205
  308. package/src/webgpu/WebGPUBuffer.ts +0 -1
  309. package/src/webgpu/WebGPUCompute.ts +0 -2
  310. package/src/webgpu/WebGPUPipelineCache.ts +0 -15
  311. package/src/webgpu/WebGPUPostProcess.ts +0 -2
  312. package/src/webgpu/WebGPUTexture.ts +0 -2
  313. package/tsconfig.json +0 -26
  314. package/vitest.config.ts +0 -20
@@ -1,642 +0,0 @@
1
- import type { RenderDevice, RenderDeviceCapability } from "../RenderDevice";
2
-
3
- export type CinematicCapabilityStatus = "implemented" | "conditional" | "unsupported";
4
- export type CinematicCapabilityArea = "postprocess" | "camera" | "timeline";
5
-
6
- export type CinematicPostProcessEffectId =
7
- | "bloom"
8
- | "fxaa"
9
- | "depth-of-field"
10
- | "motion-blur"
11
- | "ambient-occlusion"
12
- | "outline"
13
- | "lut"
14
- | "film-grain"
15
- | "render-layers-aov";
16
-
17
- export type CinematicDiagnosticId =
18
- | CinematicPostProcessEffectId
19
- | "cinematic-camera-auto-frame"
20
- | "cinematic-camera-shot-timeline";
21
-
22
- export interface CinematicCapabilityEntry {
23
- readonly id: CinematicDiagnosticId;
24
- readonly label: string;
25
- readonly area: CinematicCapabilityArea;
26
- readonly status: CinematicCapabilityStatus;
27
- readonly implementedPass?: string;
28
- readonly implementation: string;
29
- readonly rendererOwned: boolean;
30
- readonly publicPixelKernel: boolean;
31
- readonly requiredCapabilities: readonly RenderDeviceCapability[];
32
- readonly requiredInputs: readonly string[];
33
- readonly evidence: readonly string[];
34
- readonly limitations: readonly string[];
35
- }
36
-
37
- export interface CinematicDiagnosticsBackendInfo {
38
- readonly backend?: string;
39
- readonly capabilities?: readonly RenderDeviceCapability[];
40
- readonly limitations?: readonly string[];
41
- }
42
-
43
- export interface CinematicDiagnosticsReport {
44
- readonly backend: string;
45
- readonly capabilities: readonly RenderDeviceCapability[];
46
- readonly postprocess: readonly CinematicCapabilityEntry[];
47
- readonly camera: readonly CinematicCapabilityEntry[];
48
- readonly timeline: readonly CinematicCapabilityEntry[];
49
- readonly summary: {
50
- readonly implemented: readonly CinematicDiagnosticId[];
51
- readonly conditional: readonly CinematicDiagnosticId[];
52
- readonly unsupported: readonly CinematicDiagnosticId[];
53
- };
54
- readonly claimGuidance: readonly string[];
55
- }
56
-
57
- export type CinematicPostprocessClarityStatus = "clear" | "watch" | "risk";
58
- export type CinematicPostprocessClaritySeverity = "info" | "warning" | "failure";
59
- export type CinematicPostprocessClarityFindingId =
60
- | "washed-out-tone"
61
- | "noisy-bloom"
62
- | "film-grain-noise"
63
- | "soft-detail"
64
- | "detail-margin"
65
- | "conditional-input-missing"
66
- | "unsupported-pass-request";
67
-
68
- export interface CinematicPostprocessClarityFinding {
69
- readonly id: CinematicPostprocessClarityFindingId;
70
- readonly severity: CinematicPostprocessClaritySeverity;
71
- readonly evidence: string;
72
- readonly mitigation: string;
73
- }
74
-
75
- export interface CinematicPostprocessFrameMetrics {
76
- readonly averageLuma?: number;
77
- readonly meanLuma?: number;
78
- readonly localContrast?: number;
79
- readonly localContrastRatio?: number;
80
- readonly detailEdgeDensity?: number;
81
- readonly edgePixelRatio?: number;
82
- readonly uniqueColorBuckets?: number;
83
- readonly colorBuckets?: number;
84
- readonly foregroundCoverage?: number;
85
- }
86
-
87
- export interface CinematicPostprocessPipelineDescriptor {
88
- readonly passNames?: readonly string[];
89
- readonly targetFormat?: string;
90
- readonly toneMapping?: {
91
- readonly exposure?: number;
92
- readonly whitePoint?: number;
93
- readonly gamma?: number;
94
- readonly operator?: string;
95
- } | false;
96
- readonly colorGrade?: {
97
- readonly contrast?: number;
98
- readonly saturation?: number;
99
- readonly vibrance?: number;
100
- readonly vignette?: number;
101
- readonly sharpening?: number;
102
- } | boolean | false;
103
- readonly bloom?: {
104
- readonly threshold?: number;
105
- readonly intensity?: number;
106
- readonly radius?: number;
107
- } | boolean | false;
108
- readonly filmGrain?: {
109
- readonly intensity?: number;
110
- } | boolean | false;
111
- readonly fxaa?: {
112
- readonly edgeThreshold?: number;
113
- readonly subpixelBlend?: number;
114
- } | boolean | false;
115
- readonly depthOfField?: {
116
- readonly depth?: unknown;
117
- } | boolean | false;
118
- readonly motionBlur?: {
119
- readonly velocity?: unknown;
120
- } | boolean | false;
121
- readonly ssao?: {
122
- readonly depth?: unknown;
123
- } | boolean | false;
124
- }
125
-
126
- export interface CinematicPostprocessClarityInput {
127
- readonly pipeline?: CinematicPostprocessPipelineDescriptor;
128
- readonly frameMetrics?: CinematicPostprocessFrameMetrics;
129
- }
130
-
131
- export interface CinematicPostprocessClarityReport {
132
- readonly status: CinematicPostprocessClarityStatus;
133
- readonly score: number;
134
- readonly activePasses: readonly string[];
135
- readonly findings: readonly CinematicPostprocessClarityFinding[];
136
- readonly unsupportedRequested: readonly string[];
137
- readonly conditionalMissingInputs: readonly string[];
138
- readonly claimGuidance: readonly string[];
139
- }
140
-
141
- export const CINEMATIC_POSTPROCESS_EFFECT_IDS: readonly CinematicPostProcessEffectId[] = [
142
- "bloom",
143
- "fxaa",
144
- "depth-of-field",
145
- "motion-blur",
146
- "ambient-occlusion",
147
- "outline",
148
- "lut",
149
- "film-grain",
150
- "render-layers-aov"
151
- ];
152
-
153
- export function analyzeCinematicPostprocessClarity(input: CinematicPostprocessClarityInput): CinematicPostprocessClarityReport {
154
- const pipeline = input.pipeline ?? {};
155
- const metrics = input.frameMetrics ?? {};
156
- const activePasses = normalizeActivePasses(pipeline);
157
- const activePassSet = new Set(activePasses);
158
- const findings: CinematicPostprocessClarityFinding[] = [];
159
- const unsupportedRequested: string[] = [];
160
- const conditionalMissingInputs: string[] = [];
161
- const averageLuma = metrics.averageLuma ?? metrics.meanLuma;
162
- const localContrast = metrics.localContrast;
163
- const localContrastRatio = metrics.localContrastRatio;
164
- const detailEdgeDensity = metrics.detailEdgeDensity ?? metrics.edgePixelRatio;
165
- const uniqueColorBuckets = metrics.uniqueColorBuckets ?? metrics.colorBuckets;
166
-
167
- const toneMapping = typeof pipeline.toneMapping === "object" && pipeline.toneMapping !== null ? pipeline.toneMapping : undefined;
168
- const colorGrade = typeof pipeline.colorGrade === "object" && pipeline.colorGrade !== null ? pipeline.colorGrade : undefined;
169
- if (
170
- (averageLuma !== undefined && averageLuma >= 180 && (localContrast === undefined || localContrast < 24))
171
- || (localContrastRatio !== undefined && localContrastRatio < 0.045 && averageLuma !== undefined && averageLuma >= 150)
172
- || ((toneMapping?.exposure ?? 1) > 1.55 && (toneMapping?.whitePoint ?? 1) < 1.15)
173
- || ((colorGrade?.contrast ?? 1) < 0.82 && (colorGrade?.saturation ?? 1) > 1.22)
174
- ) {
175
- findings.push({
176
- id: "washed-out-tone",
177
- severity: "warning",
178
- evidence: summarizeMetricEvidence({
179
- averageLuma,
180
- localContrast,
181
- localContrastRatio,
182
- exposure: toneMapping?.exposure,
183
- whitePoint: toneMapping?.whitePoint,
184
- contrast: colorGrade?.contrast,
185
- saturation: colorGrade?.saturation
186
- }),
187
- mitigation: "Lower exposure or saturation, raise whitePoint/contrast, and validate the route with local contrast or histogram evidence."
188
- });
189
- }
190
-
191
- const bloom = typeof pipeline.bloom === "object" && pipeline.bloom !== null
192
- ? pipeline.bloom
193
- : pipeline.bloom === true || activePassSet.has("bloom")
194
- ? {}
195
- : undefined;
196
- if (bloom) {
197
- const threshold = bloom.threshold ?? 0.75;
198
- const intensity = bloom.intensity ?? 0.35;
199
- const radius = bloom.radius ?? 1;
200
- if (threshold < 0.48 || intensity > 0.62 || radius > 3) {
201
- findings.push({
202
- id: "noisy-bloom",
203
- severity: intensity > 0.8 || threshold < 0.32 || radius > 5 ? "failure" : "warning",
204
- evidence: `bloom threshold=${round3(threshold)}, intensity=${round3(intensity)}, radius=${round3(radius)}`,
205
- mitigation: "Use a higher bloom threshold, lower intensity/radius, or keep bloom opt-in until halo artifacts are bounded by screenshot evidence."
206
- });
207
- }
208
- }
209
-
210
- const filmGrain = typeof pipeline.filmGrain === "object" && pipeline.filmGrain !== null
211
- ? pipeline.filmGrain
212
- : pipeline.filmGrain === true || activePassSet.has("film-grain")
213
- ? {}
214
- : undefined;
215
- if (filmGrain) {
216
- const intensity = filmGrain.intensity ?? 0.08;
217
- if (intensity >= 0.06) {
218
- findings.push({
219
- id: "film-grain-noise",
220
- severity: intensity > 0.14 ? "failure" : "warning",
221
- evidence: `filmGrain intensity=${round3(intensity)}`,
222
- mitigation: "Use film grain only when the route intentionally proves it; keep deterministic default captures grain-free for clarity gates."
223
- });
224
- }
225
- }
226
-
227
- if (
228
- (detailEdgeDensity !== undefined && detailEdgeDensity < 0.035)
229
- || (localContrast !== undefined && localContrast < 28 && detailEdgeDensity !== undefined && detailEdgeDensity < 0.045)
230
- || (uniqueColorBuckets !== undefined && uniqueColorBuckets < 160)
231
- ) {
232
- findings.push({
233
- id: "soft-detail",
234
- severity: "warning",
235
- evidence: summarizeMetricEvidence({ detailEdgeDensity, localContrast, uniqueColorBuckets }),
236
- mitigation: "Add purposeful authored or procedural edges, improve material contrast, and avoid compensating with grain or fake blur."
237
- });
238
- } else if (detailEdgeDensity !== undefined && detailEdgeDensity < 0.04) {
239
- findings.push({
240
- id: "detail-margin",
241
- severity: "info",
242
- evidence: `detailEdgeDensity=${round6(detailEdgeDensity)} is above the 0.035 floor but still close enough to track.`,
243
- mitigation: "Keep future clarity changes purposeful and rerun screenshot metrics after camera or postprocess changes."
244
- });
245
- }
246
-
247
- if (activePassSet.has("depth-of-field") || pipeline.depthOfField) {
248
- const depthOfField = typeof pipeline.depthOfField === "object" && pipeline.depthOfField !== null ? pipeline.depthOfField : undefined;
249
- if (!depthOfField?.depth) {
250
- conditionalMissingInputs.push("depth-of-field:depth");
251
- findings.push({
252
- id: "conditional-input-missing",
253
- severity: "warning",
254
- evidence: "depth-of-field is requested without a depth texture binding in the pipeline descriptor.",
255
- mitigation: "Only claim DOF when a real depth input is supplied or renderer-owned depth readback is documented."
256
- });
257
- }
258
- }
259
- if (activePassSet.has("motion-blur") || pipeline.motionBlur) {
260
- const motionBlur = typeof pipeline.motionBlur === "object" && pipeline.motionBlur !== null ? pipeline.motionBlur : undefined;
261
- if (!motionBlur?.velocity) {
262
- conditionalMissingInputs.push("motion-blur:velocity");
263
- findings.push({
264
- id: "conditional-input-missing",
265
- severity: "warning",
266
- evidence: "motion-blur is requested without a velocity buffer in the pipeline descriptor.",
267
- mitigation: "Only claim motion blur when real per-pixel velocity data is supplied; the forward renderer does not generate a velocity AOV."
268
- });
269
- }
270
- }
271
- if (activePassSet.has("ssao") || activePassSet.has("ambient-occlusion") || pipeline.ssao) {
272
- const ssao = typeof pipeline.ssao === "object" && pipeline.ssao !== null ? pipeline.ssao : undefined;
273
- if (!ssao?.depth) {
274
- conditionalMissingInputs.push("ssao:depth");
275
- findings.push({
276
- id: "conditional-input-missing",
277
- severity: "warning",
278
- evidence: "SSAO/ambient occlusion is requested without a depth texture binding in the pipeline descriptor.",
279
- mitigation: "Only claim SSAO when a real depth input is supplied or renderer-owned depth readback is documented."
280
- });
281
- }
282
- }
283
-
284
- for (const unsupported of ["lut", "aov", "render-layers-aov", "render-layer", "object-id-outline"]) {
285
- if (!activePassSet.has(unsupported)) continue;
286
- unsupportedRequested.push(unsupported);
287
- }
288
- if (unsupportedRequested.length > 0) {
289
- findings.push({
290
- id: "unsupported-pass-request",
291
- severity: "failure",
292
- evidence: `unsupported requested: ${unsupportedRequested.join(", ")}`,
293
- mitigation: "Remove unsupported pass claims or add real renderer support before exposing the route as parity evidence."
294
- });
295
- }
296
-
297
- const score = clampScore(100 - findings.reduce((total, finding) => total + severityPenalty(finding.severity), 0));
298
- return {
299
- status: findings.some((finding) => finding.severity === "failure")
300
- ? "risk"
301
- : findings.some((finding) => finding.severity === "warning")
302
- ? "watch"
303
- : "clear",
304
- score,
305
- activePasses,
306
- findings,
307
- unsupportedRequested,
308
- conditionalMissingInputs,
309
- claimGuidance: [
310
- "Use this report to separate image-quality risks from implemented-pass claims.",
311
- "Noise or washed-out findings should be fixed with bounded post settings or authored visual structure, not fake DOF, motion blur, LUT, or AOV claims.",
312
- "Conditional input findings mean the pass exists but the current pipeline descriptor did not prove the required depth or velocity input."
313
- ]
314
- };
315
- }
316
-
317
- export function createCinematicDiagnosticsReport(input: RenderDevice | CinematicDiagnosticsBackendInfo = {}): CinematicDiagnosticsReport {
318
- const backendInfo = normalizeBackendInfo(input);
319
- const capabilities = [...(backendInfo.capabilities ?? [])];
320
- const capabilitySet = new Set<RenderDeviceCapability>(capabilities);
321
- const supportsCorePostprocess = hasCorePostprocessCapabilities(capabilitySet);
322
- const supportsDepthTexture = capabilitySet.has("depth-textures");
323
- const supportsHdrTargets = capabilitySet.has("hdr-render-targets");
324
- const supportsFloatReadback = capabilitySet.has("float-readback");
325
-
326
- const postprocess: CinematicCapabilityEntry[] = [
327
- {
328
- id: "bloom",
329
- label: "Bloom",
330
- area: "postprocess",
331
- status: supportsCorePostprocess ? "implemented" : "unsupported",
332
- implementedPass: "bloom",
333
- implementation: "RendererPostProcessOptions.bloom, BloomPass, bloomPixels, and HDR bloomFloatPixels.",
334
- rendererOwned: true,
335
- publicPixelKernel: true,
336
- requiredCapabilities: ["render-targets", "postprocess-presentation", "pixel-readback"],
337
- requiredInputs: [],
338
- evidence: [
339
- "Renderer pass catalog includes bloom.",
340
- "PostProcessComposer accepts a bloom pass.",
341
- supportsHdrTargets && supportsFloatReadback
342
- ? "Backend can run HDR bloom paths with float render-target readback."
343
- : "LDR bloom is available; HDR bloom needs hdr-render-targets and float-readback."
344
- ],
345
- limitations: supportsCorePostprocess
346
- ? []
347
- : missingCorePostprocessReasons(capabilitySet)
348
- },
349
- {
350
- id: "fxaa",
351
- label: "FXAA",
352
- area: "postprocess",
353
- status: supportsCorePostprocess ? "implemented" : "unsupported",
354
- implementedPass: "fxaa",
355
- implementation: "RendererPostProcessOptions.fxaa, FXAAPass, and fxaaPixels.",
356
- rendererOwned: true,
357
- publicPixelKernel: true,
358
- requiredCapabilities: ["render-targets", "postprocess-presentation", "pixel-readback"],
359
- requiredInputs: [],
360
- evidence: [
361
- "Renderer pass catalog includes fxaa.",
362
- "PostProcessComposer accepts an fxaa pass."
363
- ],
364
- limitations: supportsCorePostprocess
365
- ? []
366
- : missingCorePostprocessReasons(capabilitySet)
367
- },
368
- {
369
- id: "depth-of-field",
370
- label: "Depth Of Field",
371
- area: "postprocess",
372
- status: supportsCorePostprocess ? "conditional" : "unsupported",
373
- implementedPass: "depth-of-field",
374
- implementation: "depthOfFieldPixels with caller-provided depth, or renderer-owned depth when the backend exposes depth textures/readback.",
375
- rendererOwned: supportsDepthTexture,
376
- publicPixelKernel: true,
377
- requiredCapabilities: ["render-targets", "postprocess-presentation", "pixel-readback", "depth-textures"],
378
- requiredInputs: ["DepthTextureBinding or renderer-owned sampleable depth texture."],
379
- evidence: [
380
- "Renderer pass catalog includes depth-of-field.",
381
- "PostProcessComposer accepts a depth-of-field pass with explicit depth options."
382
- ],
383
- limitations: [
384
- ...missingCorePostprocessReasons(capabilitySet),
385
- ...(supportsDepthTexture ? [] : ["Renderer-owned DOF injection is unavailable without depth-textures; callers may still provide a depth binding to the pixel kernel."]),
386
- "The renderer does not synthesize fake DOF; depth data is required for a meaningful pass."
387
- ]
388
- },
389
- {
390
- id: "motion-blur",
391
- label: "Motion Blur",
392
- area: "postprocess",
393
- status: supportsCorePostprocess ? "conditional" : "unsupported",
394
- implementedPass: "motion-blur",
395
- implementation: "motionBlurPixels samples along caller-provided velocity vectors.",
396
- rendererOwned: false,
397
- publicPixelKernel: true,
398
- requiredCapabilities: ["render-targets", "postprocess-presentation", "pixel-readback"],
399
- requiredInputs: ["Per-pixel velocity Float32Array with width * height * 2 values."],
400
- evidence: [
401
- "Renderer pass catalog includes motion-blur.",
402
- "PostProcessComposer accepts a motion-blur pass with explicit velocity options."
403
- ],
404
- limitations: [
405
- ...missingCorePostprocessReasons(capabilitySet),
406
- "The forward renderer does not generate a velocity AOV; callers must supply velocity data."
407
- ]
408
- },
409
- {
410
- id: "ambient-occlusion",
411
- label: "Ambient Occlusion",
412
- area: "postprocess",
413
- status: supportsCorePostprocess ? "conditional" : "unsupported",
414
- implementedPass: "ssao",
415
- implementation: "ssaoPixels implements a bounded screen-space ambient occlusion approximation from depth.",
416
- rendererOwned: supportsDepthTexture,
417
- publicPixelKernel: true,
418
- requiredCapabilities: ["render-targets", "postprocess-presentation", "pixel-readback", "depth-textures"],
419
- requiredInputs: ["DepthTextureBinding or renderer-owned sampleable depth texture."],
420
- evidence: [
421
- "Renderer pass catalog includes ssao.",
422
- "PostProcessComposer accepts an ssao pass with explicit depth options."
423
- ],
424
- limitations: [
425
- ...missingCorePostprocessReasons(capabilitySet),
426
- ...(supportsDepthTexture ? [] : ["Renderer-owned SSAO injection is unavailable without depth-textures; callers may still provide a depth binding to the pixel kernel."]),
427
- "This is SSAO only; GTAO, HBAO, baked AO generation, and material occlusion-map authoring are separate features."
428
- ]
429
- },
430
- {
431
- id: "outline",
432
- label: "Outline",
433
- area: "postprocess",
434
- status: supportsCorePostprocess ? "implemented" : "unsupported",
435
- implementedPass: "outline",
436
- implementation: "outlinePixels uses luma Sobel edges with configurable color, width, threshold, and opacity.",
437
- rendererOwned: true,
438
- publicPixelKernel: true,
439
- requiredCapabilities: ["render-targets", "postprocess-presentation", "pixel-readback"],
440
- requiredInputs: [],
441
- evidence: [
442
- "Renderer pass catalog includes outline.",
443
- "PostProcessComposer accepts an outline pass."
444
- ],
445
- limitations: [
446
- ...missingCorePostprocessReasons(capabilitySet),
447
- "Current outline is image/luma based; object-ID, normal/depth edge, and selected-object outline layers require render layer or AOV support."
448
- ]
449
- },
450
- {
451
- id: "lut",
452
- label: "LUT",
453
- area: "postprocess",
454
- status: "unsupported",
455
- implementation: "No 2D or 3D LUT postprocess pass is exposed.",
456
- rendererOwned: false,
457
- publicPixelKernel: false,
458
- requiredCapabilities: [],
459
- requiredInputs: ["A LUT texture or table would be required by a future pass."],
460
- evidence: [
461
- "Tone mapping and color-grade passes exist, but they are parameterized math passes rather than LUT sampling passes."
462
- ],
463
- limitations: [
464
- "Do not claim LUT parity from tone mapping or color-grade controls."
465
- ]
466
- },
467
- {
468
- id: "film-grain",
469
- label: "Film Grain",
470
- area: "postprocess",
471
- status: supportsCorePostprocess ? "implemented" : "unsupported",
472
- implementedPass: "film-grain",
473
- implementation: "filmGrainPixels applies deterministic seeded grain.",
474
- rendererOwned: true,
475
- publicPixelKernel: true,
476
- requiredCapabilities: ["render-targets", "postprocess-presentation", "pixel-readback"],
477
- requiredInputs: [],
478
- evidence: [
479
- "Renderer pass catalog includes film-grain.",
480
- "PostProcessComposer accepts a film-grain pass."
481
- ],
482
- limitations: supportsCorePostprocess
483
- ? ["Film grain is a deterministic pixel pass, not camera sensor simulation."]
484
- : missingCorePostprocessReasons(capabilitySet)
485
- },
486
- {
487
- id: "render-layers-aov",
488
- label: "Render Layers / AOV",
489
- area: "postprocess",
490
- status: "unsupported",
491
- implementation: "No public render layer, AOV, g-buffer, object-ID, normal, material-ID, or velocity render-output contract is exposed.",
492
- rendererOwned: false,
493
- publicPixelKernel: false,
494
- requiredCapabilities: [],
495
- requiredInputs: ["Future support would need explicit render-output descriptors and pass wiring."],
496
- evidence: [
497
- "The renderer exposes a forward color target and optional depth texture for selected depth-aware postprocess passes."
498
- ],
499
- limitations: [
500
- "Do not claim render layers, AOV compositing, object-ID outlines, or renderer-generated velocity motion blur."
501
- ]
502
- }
503
- ];
504
-
505
- const camera: CinematicCapabilityEntry[] = [
506
- {
507
- id: "cinematic-camera-auto-frame",
508
- label: "Cinematic Camera Framing",
509
- area: "camera",
510
- status: "implemented",
511
- implementedPass: "computePerspectiveCameraFrame",
512
- implementation: "computePerspectiveCameraFrame plus Renderer cameraPolicy='auto-frame' support deterministic fit-to-bounds camera frames.",
513
- rendererOwned: true,
514
- publicPixelKernel: false,
515
- requiredCapabilities: [],
516
- requiredInputs: ["Bounds, viewport, and optional FOV/yaw/pitch/padding settings."],
517
- evidence: [
518
- "CameraFraming.ts exports computePerspectiveCameraFrame.",
519
- "Renderer resolves cameraFrameBounds/cameraFrameOptions for auto-frame sources."
520
- ],
521
- limitations: [
522
- "This is deterministic camera framing, not a full cinematic shot/timeline editor."
523
- ]
524
- }
525
- ];
526
-
527
- const timeline: CinematicCapabilityEntry[] = [
528
- {
529
- id: "cinematic-camera-shot-timeline",
530
- label: "Cinematic Camera Timeline",
531
- area: "timeline",
532
- status: "unsupported",
533
- implementation: "No renderer-owned shot timeline, keyframed cinematic camera track, or timeline diagnostics report is exposed.",
534
- rendererOwned: false,
535
- publicPixelKernel: false,
536
- requiredCapabilities: [],
537
- requiredInputs: ["A future feature would need camera keyframes, interpolation policy, clip duration, and sampled-frame diagnostics."],
538
- evidence: [
539
- "Renderer.startAnimationLoop runs callbacks, but it is not a timeline system."
540
- ],
541
- limitations: [
542
- "Do not claim cinematic camera timeline support from auto-frame camera helpers or animation-loop callbacks alone."
543
- ]
544
- }
545
- ];
546
-
547
- const allEntries = [...postprocess, ...camera, ...timeline];
548
- return {
549
- backend: backendInfo.backend ?? "unknown",
550
- capabilities,
551
- postprocess,
552
- camera,
553
- timeline,
554
- summary: {
555
- implemented: idsWithStatus(allEntries, "implemented"),
556
- conditional: idsWithStatus(allEntries, "conditional"),
557
- unsupported: idsWithStatus(allEntries, "unsupported")
558
- },
559
- claimGuidance: [
560
- "Claim bloom, FXAA, outline, film grain, tone mapping, and color grading only as implemented postprocess passes when the backend exposes the required render-target, presentation, and readback capabilities.",
561
- "Claim DOF and SSAO only when valid depth data is supplied or renderer-owned depth texture readback is available.",
562
- "Claim motion blur only when a real velocity buffer is supplied; the renderer does not generate velocity AOVs.",
563
- "Do not claim LUT, render layers/AOV, object-ID outlines, or a cinematic camera shot timeline from the current renderer diagnostics."
564
- ]
565
- };
566
- }
567
-
568
- function normalizeBackendInfo(input: RenderDevice | CinematicDiagnosticsBackendInfo): CinematicDiagnosticsBackendInfo {
569
- if (isRenderDevice(input)) {
570
- return {
571
- backend: input.info.backend,
572
- capabilities: input.info.capabilities,
573
- limitations: input.info.limitations
574
- };
575
- }
576
- return input;
577
- }
578
-
579
- function isRenderDevice(input: RenderDevice | CinematicDiagnosticsBackendInfo): input is RenderDevice {
580
- return typeof (input as RenderDevice).info === "object" && (input as RenderDevice).info !== null;
581
- }
582
-
583
- function hasCorePostprocessCapabilities(capabilities: ReadonlySet<RenderDeviceCapability>): boolean {
584
- return capabilities.has("render-targets")
585
- && capabilities.has("postprocess-presentation")
586
- && capabilities.has("pixel-readback");
587
- }
588
-
589
- function missingCorePostprocessReasons(capabilities: ReadonlySet<RenderDeviceCapability>): readonly string[] {
590
- const reasons: string[] = [];
591
- if (!capabilities.has("render-targets")) reasons.push("Backend lacks render-targets.");
592
- if (!capabilities.has("postprocess-presentation")) reasons.push("Backend lacks postprocess-presentation.");
593
- if (!capabilities.has("pixel-readback")) reasons.push("Current CPU/reference postprocess kernels require pixel-readback.");
594
- return reasons;
595
- }
596
-
597
- function idsWithStatus(entries: readonly CinematicCapabilityEntry[], status: CinematicCapabilityStatus): readonly CinematicDiagnosticId[] {
598
- return entries.filter((entry) => entry.status === status).map((entry) => entry.id);
599
- }
600
-
601
- function normalizeActivePasses(pipeline: CinematicPostprocessPipelineDescriptor): readonly string[] {
602
- const names = new Set<string>();
603
- for (const passName of pipeline.passNames ?? []) {
604
- if (passName.trim().length > 0) names.add(passName.trim());
605
- }
606
- if (pipeline.toneMapping && !names.has("tone-mapping")) names.add("tone-mapping");
607
- if (pipeline.colorGrade && !names.has("color-grade")) names.add("color-grade");
608
- if (pipeline.bloom && !names.has("bloom")) names.add("bloom");
609
- if (pipeline.filmGrain && !names.has("film-grain")) names.add("film-grain");
610
- if (pipeline.fxaa && !names.has("fxaa")) names.add("fxaa");
611
- if (pipeline.depthOfField && !names.has("depth-of-field")) names.add("depth-of-field");
612
- if (pipeline.motionBlur && !names.has("motion-blur")) names.add("motion-blur");
613
- if (pipeline.ssao && !names.has("ssao")) names.add("ssao");
614
- return [...names];
615
- }
616
-
617
- function summarizeMetricEvidence(metrics: Readonly<Record<string, number | undefined>>): string {
618
- const parts: string[] = [];
619
- for (const [key, value] of Object.entries(metrics)) {
620
- if (value === undefined || !Number.isFinite(value)) continue;
621
- parts.push(`${key}=${Math.abs(value) < 1 ? round6(value) : round3(value)}`);
622
- }
623
- return parts.length > 0 ? parts.join(", ") : "No numeric frame metrics supplied.";
624
- }
625
-
626
- function severityPenalty(severity: CinematicPostprocessClaritySeverity): number {
627
- if (severity === "failure") return 34;
628
- if (severity === "warning") return 16;
629
- return 3;
630
- }
631
-
632
- function clampScore(value: number): number {
633
- return Math.max(0, Math.min(100, Math.round(value)));
634
- }
635
-
636
- function round3(value: number): number {
637
- return Math.round(value * 1000) / 1000;
638
- }
639
-
640
- function round6(value: number): number {
641
- return Math.round(value * 1000000) / 1000000;
642
- }
@@ -1,24 +0,0 @@
1
- import { colorGradePixels, type ColorGradeOptions, type ColorGradeResult } from "../PostProcessPass";
2
-
3
- export type ExternalParityColorGradePreset = "catalog-hero" | "material-neutral" | "interior-balanced";
4
-
5
- export function runExternalParityColorGrade(
6
- pixels: Uint8Array,
7
- width: number,
8
- height: number,
9
- preset: ExternalParityColorGradePreset,
10
- overrides: ColorGradeOptions = {}
11
- ): ColorGradeResult {
12
- return colorGradePixels(pixels, width, height, { ...presetOptions(preset), ...overrides });
13
- }
14
-
15
- function presetOptions(preset: ExternalParityColorGradePreset): Required<ColorGradeOptions> {
16
- switch (preset) {
17
- case "catalog-hero":
18
- return { contrast: 1.12, temperature: 0.04, tint: 0, saturation: 1.04, vibrance: 0.12, vignette: 0.08, sharpening: 0.25 };
19
- case "material-neutral":
20
- return { contrast: 1, temperature: 0, tint: 0, saturation: 1, vibrance: 0, vignette: 0, sharpening: 0.15 };
21
- case "interior-balanced":
22
- return { contrast: 1.06, temperature: -0.03, tint: 0.02, saturation: 0.98, vibrance: 0.08, vignette: 0.05, sharpening: 0.18 };
23
- }
24
- }
@@ -1,12 +0,0 @@
1
- import { depthOfFieldPixels, type DepthOfFieldOptions, type DepthOfFieldResult } from "../PostProcessPass";
2
- import { createExternalParityDepthBinding } from "./SSAOPass";
3
-
4
- export function runExternalParityDepthOfField(
5
- pixels: Uint8Array,
6
- width: number,
7
- height: number,
8
- options: Omit<DepthOfFieldOptions, "depth"> & Pick<Partial<DepthOfFieldOptions>, "depth"> = {}
9
- ): DepthOfFieldResult {
10
- const focusDepth = options.focusDepth ?? 0.35;
11
- return depthOfFieldPixels(pixels, width, height, { ...options, focusDepth, depth: options.depth ?? createExternalParityDepthBinding(width, height) });
12
- }