@aura3d/rendering 1.4.0 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (308) hide show
  1. package/package.json +38 -4
  2. package/AGENTS.md +0 -46
  3. package/src/ArchitecturalLightingFixtures.ts +0 -241
  4. package/src/ArchitecturalMaterialCatalog.ts +0 -130
  5. package/src/ArchitecturalMeasurementFixtures.ts +0 -155
  6. package/src/BRDFLut.ts +0 -47
  7. package/src/CameraFraming.ts +0 -200
  8. package/src/CanonicalSceneFixtures.ts +0 -95
  9. package/src/CascadedShadowMaps.ts +0 -449
  10. package/src/ColorManagement.ts +0 -127
  11. package/src/CullingFixtures.ts +0 -280
  12. package/src/DecalGeometry.ts +0 -26
  13. package/src/DepthPass.ts +0 -110
  14. package/src/EnvironmentBackgroundPass.ts +0 -194
  15. package/src/EnvironmentBackgroundResources.ts +0 -309
  16. package/src/EnvironmentLighting.ts +0 -96
  17. package/src/EnvironmentMapResources.ts +0 -1026
  18. package/src/EnvironmentPipeline.ts +0 -69
  19. package/src/EnvironmentPlatform.ts +0 -1306
  20. package/src/EnvironmentPreset.ts +0 -155
  21. package/src/Exposure.ts +0 -66
  22. package/src/ExternalParityRenderPreset.ts +0 -725
  23. package/src/ForwardPass.ts +0 -1668
  24. package/src/FrameVisualMetrics.ts +0 -301
  25. package/src/Geometry.ts +0 -461
  26. package/src/GeometryPrimitives.ts +0 -2
  27. package/src/HDRRenderPipeline.ts +0 -94
  28. package/src/IBL.ts +0 -86
  29. package/src/IndexBuffer.ts +0 -57
  30. package/src/InstancedPBRMaterial.ts +0 -186
  31. package/src/InstancedUnlitMaterial.ts +0 -60
  32. package/src/Instancing.ts +0 -19
  33. package/src/LightCollector.ts +0 -82
  34. package/src/LightUniforms.ts +0 -47
  35. package/src/LightingDebug.ts +0 -80
  36. package/src/LightingDefaults.ts +0 -79
  37. package/src/LightingRig.ts +0 -301
  38. package/src/LineGeometry.ts +0 -2
  39. package/src/Material.ts +0 -209
  40. package/src/MaterialBinding.ts +0 -131
  41. package/src/MaterialInstance.ts +0 -59
  42. package/src/MaterialPresets.ts +0 -272
  43. package/src/MorphTarget.ts +0 -124
  44. package/src/MorphTargetPlan.ts +0 -178
  45. package/src/MorphUnlitMaterial.ts +0 -60
  46. package/src/NormalMappedPBRMaterial.ts +0 -188
  47. package/src/OceanFixtures.ts +0 -318
  48. package/src/PBRLightingDefaults.ts +0 -12
  49. package/src/PBRMaterial.ts +0 -442
  50. package/src/PMREM.ts +0 -53
  51. package/src/PbrReference.ts +0 -681
  52. package/src/PostProcessPass.ts +0 -2507
  53. package/src/ProceduralTextureFixtures.ts +0 -393
  54. package/src/ProductTurntableFixtures.ts +0 -815
  55. package/src/Raycaster.ts +0 -21
  56. package/src/ReflectionProbe.ts +0 -13
  57. package/src/ReflectionSurfaces.ts +0 -219
  58. package/src/RenderBackend.ts +0 -43
  59. package/src/RenderDebugViews.ts +0 -138
  60. package/src/RenderDevice.ts +0 -836
  61. package/src/RenderGraph.ts +0 -194
  62. package/src/RenderPass.ts +0 -27
  63. package/src/RenderPipeline.ts +0 -101
  64. package/src/RenderQueue.ts +0 -12
  65. package/src/RenderState.ts +0 -12
  66. package/src/Renderer.ts +0 -2631
  67. package/src/RendererDebugOverlay.ts +0 -80
  68. package/src/RendererFeatureGates.ts +0 -150
  69. package/src/RendererPostprocessPlan.ts +0 -279
  70. package/src/RendererTiming.ts +0 -251
  71. package/src/RendererVisualPipelineReport.ts +0 -836
  72. package/src/ResourceLifecycle.ts +0 -21
  73. package/src/Sampler.ts +0 -37
  74. package/src/SceneOptimization.ts +0 -518
  75. package/src/ShaderChunks.ts +0 -393
  76. package/src/ShaderLibrary.ts +0 -2766
  77. package/src/ShaderModule.ts +0 -36
  78. package/src/ShaderPreprocessor.ts +0 -260
  79. package/src/ShaderReflection.ts +0 -201
  80. package/src/ShadowMap.ts +0 -237
  81. package/src/ShadowPass.ts +0 -198
  82. package/src/ShadowProjection.ts +0 -115
  83. package/src/SkinnedLitMaterial.ts +0 -397
  84. package/src/SkinnedUnlitMaterial.ts +0 -63
  85. package/src/SkinningBounds.ts +0 -131
  86. package/src/SpaceEnvironmentFixtures.ts +0 -200
  87. package/src/SpriteGeometry.ts +0 -21
  88. package/src/StereoCameraRig.ts +0 -127
  89. package/src/StereoEffects.ts +0 -274
  90. package/src/TerrainFixtures.ts +0 -180
  91. package/src/Texture.ts +0 -307
  92. package/src/TextureBinding.ts +0 -91
  93. package/src/TexturedPBRMaterial.ts +0 -1112
  94. package/src/TexturedUnlitMaterial.ts +0 -67
  95. package/src/ToneMapping.ts +0 -105
  96. package/src/UniformBinder.ts +0 -16
  97. package/src/UniformLayout.ts +0 -129
  98. package/src/UnlitMaterial.ts +0 -75
  99. package/src/VegetationFixtures.ts +0 -314
  100. package/src/VertexBuffer.ts +0 -120
  101. package/src/VertexFormat.ts +0 -171
  102. package/src/VoxelWorldFixtures.ts +0 -280
  103. package/src/WeatherFixtures.ts +0 -223
  104. package/src/WebGL2Device.ts +0 -2280
  105. package/src/WebGL2StateCache.ts +0 -330
  106. package/src/WebGPUDevice.ts +0 -2877
  107. package/src/WebGPURenderToTextureProof.ts +0 -139
  108. package/src/advanced-runtime/AdvancedRenderer.ts +0 -73
  109. package/src/advanced-runtime/index.ts +0 -9
  110. package/src/animation/AnimationMaterialStyle.ts +0 -32
  111. package/src/animation/AnimationRenderPreset.ts +0 -45
  112. package/src/animation/AnimationToonMaterial.ts +0 -387
  113. package/src/animation/AnimationVisualQuality.ts +0 -71
  114. package/src/animation/applyAnimationRenderPreset.ts +0 -180
  115. package/src/animation/index.ts +0 -5
  116. package/src/cinematic/BloomPass.ts +0 -26
  117. package/src/cinematic/CinematicDepthComposition.ts +0 -30
  118. package/src/cinematic/CinematicEvidence.ts +0 -123
  119. package/src/cinematic/CinematicLightingRig.ts +0 -144
  120. package/src/cinematic/CinematicMaterialPresets.ts +0 -130
  121. package/src/cinematic/CinematicPostProcess.ts +0 -83
  122. package/src/cinematic/DepthHazePass.ts +0 -30
  123. package/src/cinematic/EmissivePracticalLightSystem.ts +0 -45
  124. package/src/cinematic/FilmGrainPass.ts +0 -24
  125. package/src/cinematic/FogVolumeSystem.ts +0 -30
  126. package/src/cinematic/GlowCardSystem.ts +0 -44
  127. package/src/cinematic/RainParticleSystem.ts +0 -151
  128. package/src/cinematic/VignettePass.ts +0 -25
  129. package/src/cinematic/WetReflectionApproximation.ts +0 -27
  130. package/src/cinematic/index.ts +0 -14
  131. package/src/effects/CollisionModule.ts +0 -64
  132. package/src/effects/ColorModule.ts +0 -60
  133. package/src/effects/ForceModule.ts +0 -25
  134. package/src/effects/GPUParticleBackend.ts +0 -569
  135. package/src/effects/Particle.ts +0 -108
  136. package/src/effects/ParticleDiagnostics.ts +0 -224
  137. package/src/effects/ParticleEffectPresets.ts +0 -147
  138. package/src/effects/ParticleEmitter.ts +0 -326
  139. package/src/effects/ParticleModule.ts +0 -26
  140. package/src/effects/ParticleRenderPass.ts +0 -117
  141. package/src/effects/ParticleRenderer.ts +0 -132
  142. package/src/effects/ParticleSystem.ts +0 -333
  143. package/src/effects/SizeModule.ts +0 -56
  144. package/src/effects/TrailModule.ts +0 -72
  145. package/src/effects/VelocityModule.ts +0 -75
  146. package/src/effects/index.ts +0 -15
  147. package/src/index.ts +0 -925
  148. package/src/materials/AlphaSorting.ts +0 -30
  149. package/src/materials/MaterialExtensions.ts +0 -42
  150. package/src/materials/PhysicalMaterial.ts +0 -133
  151. package/src/materials/TransmissionPass.ts +0 -51
  152. package/src/performance/BVH.ts +0 -18
  153. package/src/performance/Batcher.ts +0 -2
  154. package/src/performance/FrustumCuller.ts +0 -9
  155. package/src/performance/LOD.ts +0 -20
  156. package/src/performance/Octree.ts +0 -10
  157. package/src/performance/RenderItemSorting.ts +0 -170
  158. package/src/performance/RendererStats.ts +0 -43
  159. package/src/performance/ResourceBudget.ts +0 -44
  160. package/src/postprocess/BloomPass.ts +0 -28
  161. package/src/postprocess/CinematicDiagnostics.ts +0 -642
  162. package/src/postprocess/ColorGradingPass.ts +0 -24
  163. package/src/postprocess/DepthOfFieldPass.ts +0 -12
  164. package/src/postprocess/EffectComposer.ts +0 -349
  165. package/src/postprocess/SSAOPass.ts +0 -20
  166. package/src/postprocess/index.ts +0 -34
  167. package/src/production-runtime/AnimationControlsPipeline.ts +0 -77
  168. package/src/production-runtime/PBRHDRPipeline.ts +0 -381
  169. package/src/production-runtime/ProductionEffectsPipeline.ts +0 -85
  170. package/src/production-runtime/ProductionRendererTypes.ts +0 -136
  171. package/src/production-runtime/ProductionRuntimeRenderer.ts +0 -172
  172. package/src/production-runtime/ProductionWebGL2Renderer.ts +0 -313
  173. package/src/production-runtime/ProductionWebGPURenderer.ts +0 -396
  174. package/src/production-runtime/TransmissionBackdropCapture.ts +0 -130
  175. package/src/production-runtime/animation/MorphTargetRenderer.ts +0 -2
  176. package/src/production-runtime/animation/SkinningRenderer.ts +0 -2
  177. package/src/production-runtime/backends/RendererBackend.ts +0 -17
  178. package/src/production-runtime/backends/WebGL2RendererBackend.ts +0 -30
  179. package/src/production-runtime/backends/WebGPURendererBackend.ts +0 -24
  180. package/src/production-runtime/backends/webgl2/WebGL2Buffer.ts +0 -2
  181. package/src/production-runtime/backends/webgl2/WebGL2Capabilities.ts +0 -2
  182. package/src/production-runtime/backends/webgl2/WebGL2RenderTarget.ts +0 -2
  183. package/src/production-runtime/backends/webgl2/WebGL2Shader.ts +0 -2
  184. package/src/production-runtime/backends/webgl2/WebGL2StateCache.ts +0 -1
  185. package/src/production-runtime/backends/webgl2/WebGL2Texture.ts +0 -2
  186. package/src/production-runtime/backends/webgpu/WebGPUBuffer.ts +0 -2
  187. package/src/production-runtime/backends/webgpu/WebGPUCapabilities.ts +0 -2
  188. package/src/production-runtime/backends/webgpu/WebGPURenderTarget.ts +0 -2
  189. package/src/production-runtime/backends/webgpu/WebGPUShader.ts +0 -2
  190. package/src/production-runtime/backends/webgpu/WebGPUTexture.ts +0 -2
  191. package/src/production-runtime/color/ColorManagement.ts +0 -3
  192. package/src/production-runtime/color/ToneMapping.ts +0 -7
  193. package/src/production-runtime/diagnostics/FrameCapture.ts +0 -2
  194. package/src/production-runtime/diagnostics/GPUCapabilities.ts +0 -2
  195. package/src/production-runtime/diagnostics/RendererStats.ts +0 -2
  196. package/src/production-runtime/environment/EnvironmentMap.ts +0 -1
  197. package/src/production-runtime/environment/HDRLoader.ts +0 -57
  198. package/src/production-runtime/environment/PMREMGenerator.ts +0 -713
  199. package/src/production-runtime/framegraph/FrameGraph.ts +0 -18
  200. package/src/production-runtime/framegraph/RenderPass.ts +0 -15
  201. package/src/production-runtime/geometry/ProjectedDecalGeometry.ts +0 -439
  202. package/src/production-runtime/index.ts +0 -127
  203. package/src/production-runtime/lights/LightManager.ts +0 -7
  204. package/src/production-runtime/lights/ShadowMapRenderer.ts +0 -5
  205. package/src/production-runtime/materials/GLTFMaterialAdapter.ts +0 -6
  206. package/src/production-runtime/materials/GLTFPBRMaterialAdapter.ts +0 -2
  207. package/src/production-runtime/materials/MaterialCompiler.ts +0 -7
  208. package/src/production-runtime/materials/MaterialTextureBindings.ts +0 -5
  209. package/src/production-runtime/materials/PBRMaterial.ts +0 -2
  210. package/src/production-runtime/materials/PBRShaderFeatures.ts +0 -2
  211. package/src/production-runtime/passes/ContactShadowPass.ts +0 -184
  212. package/src/production-runtime/passes/DepthPrepass.ts +0 -7
  213. package/src/production-runtime/passes/OpaquePass.ts +0 -7
  214. package/src/production-runtime/passes/ShadowPass.ts +0 -7
  215. package/src/production-runtime/passes/SkyboxPass.ts +0 -7
  216. package/src/production-runtime/passes/ToneMappingPass.ts +0 -7
  217. package/src/production-runtime/passes/TransparentPass.ts +0 -7
  218. package/src/production-runtime/postprocess/BloomPass.ts +0 -51
  219. package/src/production-runtime/postprocess/ColorGradingPass.ts +0 -49
  220. package/src/production-runtime/postprocess/DOFPass.ts +0 -47
  221. package/src/production-runtime/postprocess/FXAAPass.ts +0 -53
  222. package/src/production-runtime/postprocess/ProductionEffectComposer.ts +0 -78
  223. package/src/production-runtime/postprocess/ProductionPostProcessTypes.ts +0 -174
  224. package/src/production-runtime/postprocess/SSAOPass.ts +0 -45
  225. package/src/production-runtime/resources/GPUBuffer.ts +0 -2
  226. package/src/production-runtime/resources/GPUTexture.ts +0 -2
  227. package/src/production-runtime/resources/RenderTarget.ts +0 -3
  228. package/src/production-runtime/resources/ResourceCache.ts +0 -7
  229. package/src/production-runtime/scene/Camera.ts +0 -1
  230. package/src/production-runtime/scene/Lights.ts +0 -2
  231. package/src/production-runtime/scene/RenderableMesh.ts +0 -2
  232. package/src/production-runtime/scene/RenderablePrimitive.ts +0 -1
  233. package/src/production-runtime/scene/RenderableScene.ts +0 -4
  234. package/src/production-runtime/shaders/ShaderProgramLibrary.ts +0 -7
  235. package/src/production-runtime/shaders/chunks/brdf.glsl +0 -2
  236. package/src/production-runtime/shaders/chunks/ibl.glsl +0 -3
  237. package/src/production-runtime/shaders/chunks/pbr.frag.glsl +0 -47
  238. package/src/production-runtime/shaders/chunks/pbr.vert.glsl +0 -8
  239. package/src/production-runtime/shaders/chunks/shadows.glsl +0 -2
  240. package/src/production-runtime/shaders/wgsl/pbr.wgsl +0 -3
  241. package/src/production-runtime/shaders/wgsl/postprocess.wgsl +0 -2
  242. package/src/production-runtime/shaders/wgsl/skybox.wgsl +0 -2
  243. package/src/shaders/depth.frag.glsl +0 -5
  244. package/src/shaders/depth.vert.glsl +0 -8
  245. package/src/shaders/pbr-direct.frag.glsl +0 -687
  246. package/src/shaders/pbr-direct.vert.glsl +0 -18
  247. package/src/shaders/unlit.frag.glsl +0 -18
  248. package/src/shaders/unlit.vert.glsl +0 -13
  249. package/src/shadows/CascadedShadowPipeline.ts +0 -53
  250. package/src/shadows/ContactShadows.ts +0 -106
  251. package/src/shadows/ShadowDebugViews.ts +0 -46
  252. package/src/threejs-compatibility/InstancingSystem.ts +0 -17
  253. package/src/threejs-compatibility/LightingSystem.ts +0 -22
  254. package/src/threejs-compatibility/MaterialSystem.ts +0 -9
  255. package/src/threejs-compatibility/RenderTargetSystem.ts +0 -35
  256. package/src/threejs-compatibility/RendererDiagnostics.ts +0 -61
  257. package/src/threejs-compatibility/SceneRenderer.ts +0 -34
  258. package/src/threejs-compatibility/ShadowSystem.ts +0 -19
  259. package/src/threejs-compatibility/TextureSystem.ts +0 -19
  260. package/src/threejs-compatibility/ThreeCompatRenderer.ts +0 -90
  261. package/src/threejs-compatibility/TransparencySystem.ts +0 -19
  262. package/src/threejs-compatibility/index.ts +0 -29
  263. package/src/threejs-compatibility/performance/BVH.ts +0 -14
  264. package/src/threejs-compatibility/performance/FrustumCulling.ts +0 -10
  265. package/src/threejs-compatibility/performance/Instancing.ts +0 -4
  266. package/src/threejs-compatibility/performance/LODSystem.ts +0 -16
  267. package/src/threejs-compatibility/performance/OcclusionCulling.ts +0 -6
  268. package/src/threejs-compatibility/performance/RaycastAcceleration.ts +0 -12
  269. package/src/threejs-compatibility/performance/RendererProfiler.ts +0 -19
  270. package/src/threejs-compatibility/performance/TextureStreaming.ts +0 -4
  271. package/src/threejs-compatibility/performance/index.ts +0 -12
  272. package/src/threejs-compatibility/postprocess/BloomPass.ts +0 -16
  273. package/src/threejs-compatibility/postprocess/ColorGradingPass.ts +0 -16
  274. package/src/threejs-compatibility/postprocess/DepthOfFieldPass.ts +0 -21
  275. package/src/threejs-compatibility/postprocess/EffectComposer.ts +0 -14
  276. package/src/threejs-compatibility/postprocess/FXAAPass.ts +0 -15
  277. package/src/threejs-compatibility/postprocess/MotionBlurPass.ts +0 -20
  278. package/src/threejs-compatibility/postprocess/OutlinePass.ts +0 -21
  279. package/src/threejs-compatibility/postprocess/PostProcessTypes.ts +0 -169
  280. package/src/threejs-compatibility/postprocess/RenderPass.ts +0 -9
  281. package/src/threejs-compatibility/postprocess/SMAAPass.ts +0 -15
  282. package/src/threejs-compatibility/postprocess/SSAOPass.ts +0 -21
  283. package/src/threejs-compatibility/postprocess/ShaderPass.ts +0 -7
  284. package/src/threejs-compatibility/postprocess/TAAPass.ts +0 -15
  285. package/src/threejs-compatibility/postprocess/VignettePass.ts +0 -16
  286. package/src/threejs-compatibility/postprocess/index.ts +0 -15
  287. package/src/threejs-compatibility/shaders/NodeMaterial.ts +0 -21
  288. package/src/threejs-compatibility/shaders/RawShaderMaterial.ts +0 -6
  289. package/src/threejs-compatibility/shaders/ShaderDiagnostics.ts +0 -17
  290. package/src/threejs-compatibility/shaders/ShaderMaterial.ts +0 -18
  291. package/src/threejs-compatibility/shaders/ThreeCompatShaderChunks.ts +0 -6
  292. package/src/threejs-compatibility/shaders/Uniforms.ts +0 -18
  293. package/src/threejs-compatibility/shaders/index.ts +0 -9
  294. package/src/threejs-compatibility/vfx/GPUPointCloud.ts +0 -7
  295. package/src/threejs-compatibility/vfx/LineRenderer.ts +0 -13
  296. package/src/threejs-compatibility/vfx/ParticleSystem.ts +0 -23
  297. package/src/threejs-compatibility/vfx/SpriteSystem.ts +0 -14
  298. package/src/threejs-compatibility/vfx/TrailRenderer.ts +0 -8
  299. package/src/threejs-compatibility/vfx/VFXDiagnostics.ts +0 -23
  300. package/src/threejs-compatibility/vfx/index.ts +0 -9
  301. package/src/threejs-example-parity/index.ts +0 -205
  302. package/src/webgpu/WebGPUBuffer.ts +0 -1
  303. package/src/webgpu/WebGPUCompute.ts +0 -2
  304. package/src/webgpu/WebGPUPipelineCache.ts +0 -15
  305. package/src/webgpu/WebGPUPostProcess.ts +0 -2
  306. package/src/webgpu/WebGPUTexture.ts +0 -2
  307. package/tsconfig.json +0 -26
  308. package/vitest.config.ts +0 -20
@@ -1,71 +0,0 @@
1
- import { evaluateFrameVisualQuality, type FrameVisualMetrics, type FrameVisualQualityThresholds } from "../FrameVisualMetrics.js";
2
-
3
- export interface AnimationFrameVisualInput {
4
- readonly id: string;
5
- readonly metrics: FrameVisualMetrics;
6
- readonly characterCount?: number | undefined;
7
- readonly captionOccluded?: boolean | undefined;
8
- readonly routeChromeVisible?: boolean | undefined;
9
- readonly debugOverlayVisible?: boolean | undefined;
10
- }
11
-
12
- export interface AnimationFrameVisualQuality {
13
- readonly id: string;
14
- readonly ok: boolean;
15
- readonly failures: readonly string[];
16
- }
17
-
18
- export interface AnimationVisualQualityReport {
19
- readonly kind: "animation-visual-quality";
20
- readonly ok: boolean;
21
- readonly frames: readonly AnimationFrameVisualQuality[];
22
- readonly visibleCharacterCount: number;
23
- readonly blockers: readonly string[];
24
- }
25
-
26
- export interface AnimationVisualQualityOptions {
27
- readonly thresholds?: FrameVisualQualityThresholds | undefined;
28
- readonly minVisibleCharacters?: number | undefined;
29
- }
30
-
31
- export function createAnimationVisualQualityReport(
32
- frames: readonly AnimationFrameVisualInput[],
33
- options: AnimationVisualQualityOptions = {}
34
- ): AnimationVisualQualityReport {
35
- const thresholds = options.thresholds ?? defaultAnimationVisualQualityThresholds;
36
- const frameResults = frames.map((frame): AnimationFrameVisualQuality => {
37
- const base = evaluateFrameVisualQuality(frame.metrics, thresholds);
38
- const failures = [
39
- ...base.failures,
40
- frame.captionOccluded ? "caption occludes important action" : undefined,
41
- frame.routeChromeVisible ? "route chrome is visible" : undefined,
42
- frame.debugOverlayVisible ? "debug overlay is visible" : undefined
43
- ].filter((failure): failure is string => Boolean(failure));
44
- return { id: frame.id, ok: failures.length === 0, failures };
45
- });
46
- const visibleCharacterCount = Math.max(0, ...frames.map((frame) => frame.characterCount ?? 0));
47
- const blockers = [
48
- ...frameResults.flatMap((frame) => frame.failures.map((failure) => `${frame.id}: ${failure}`)),
49
- visibleCharacterCount < (options.minVisibleCharacters ?? 2)
50
- ? `visibleCharacterCount ${visibleCharacterCount} < ${options.minVisibleCharacters ?? 2}`
51
- : undefined
52
- ].filter((blocker): blocker is string => Boolean(blocker));
53
- return {
54
- kind: "animation-visual-quality",
55
- ok: blockers.length === 0,
56
- frames: frameResults,
57
- visibleCharacterCount,
58
- blockers
59
- };
60
- }
61
-
62
- export const defaultAnimationVisualQualityThresholds: FrameVisualQualityThresholds = {
63
- minNonDarkRatio: 0.08,
64
- minSalientRatio: 0.035,
65
- minOccupiedAreaRatio: 0.08,
66
- minOccupiedQuadrants: 2,
67
- minColorBuckets: 6,
68
- maxDominantBucketRatio: 0.92,
69
- maxFlatPixelRatio: 0.98,
70
- minLocalContrastRatio: 0.002
71
- };
@@ -1,180 +0,0 @@
1
- import { AnimationToonMaterial, type AnimationToonMaterialOptions } from "./AnimationToonMaterial.js";
2
- import type { AnimationRenderPresetEvidence } from "./AnimationRenderPreset.js";
3
- import type { AnimationMaterialStyle } from "./AnimationMaterialStyle.js";
4
- import { colorGradePixels, outlinePixels, type ColorGradeResult, type OutlineResult } from "../PostProcessPass.js";
5
-
6
- /**
7
- * applyAnimationRenderPreset — turns a (metadata) AnimationRenderPreset into the
8
- * concrete, pixel-affecting treatment it describes:
9
- *
10
- * 1. MATERIAL: builds a real `AnimationToonMaterial` (banded N·L ramp + rim) from
11
- * the preset's `materialStyle`. The band count comes from `materialStyle.rampSteps`.
12
- * 2. OUTLINE: runs the existing Sobel `outlinePixels()` post-pass when the style
13
- * requests outlines.
14
- * 3. COLOR GRADE: pushes a stylized, slightly-saturated, gently-contrasted grade
15
- * consistent with the preset (storybook look), honoring `reducedFlash`.
16
- *
17
- * WHAT ACTUALLY AFFECTS PIXELS (honest accounting):
18
- * - `material` is a fully-wired engine material. Assigning it to scene meshes and
19
- * rendering with a ShaderLibrary that has the animation program registered produces
20
- * banded toon shading on real fragments. THIS FUNCTION DOES NOT REASSIGN SCENE
21
- * MESH MATERIALS — there is no scene-graph type imported here — it RETURNS the
22
- * material so the caller (which owns the scene) can assign it. That assignment
23
- * step is the one piece that is the caller's responsibility, not this function's.
24
- * - `outline` (when present) is a real OutlineResult whose `.pixels` ARE modified
25
- * image bytes. If you pass a frame buffer, the returned bytes are drawn pixels.
26
- * - `colorGrade` (when a frame is passed) is a real ColorGradeResult — modified
27
- * pixels.
28
- *
29
- * WHAT IS NOT WIRED:
30
- * - Lights / shadows from the preset are reflected in the returned `lighting`
31
- * descriptor and fed into the toon material's single key-light uniforms, but the
32
- * multi-light rig (`preset.lights`) is descriptive — the toon program consumes one
33
- * directional key light, not the full named rig.
34
- * - Bloom/fog from the preset are NOT applied here (they belong to the HDR pipeline);
35
- * only outline + color grade run as post-passes in this function.
36
- */
37
-
38
- export interface ApplyAnimationRenderPresetFrame {
39
- /** RGBA8 pixel buffer (length === width * height * 4). */
40
- readonly pixels: Uint8Array;
41
- readonly width: number;
42
- readonly height: number;
43
- }
44
-
45
- export interface AnimationRenderPresetLightingDescriptor {
46
- readonly keyLightDirection: readonly [number, number, number];
47
- readonly keyLightColor: readonly [number, number, number];
48
- readonly softShadows: boolean;
49
- readonly contactShadows: boolean;
50
- /** The full named rig from the preset (descriptive — not all consumed by the toon program). */
51
- readonly namedRig: readonly string[];
52
- }
53
-
54
- export interface ApplyAnimationRenderPresetOptions {
55
- /** Optional explicit base color override for the toon material. */
56
- readonly baseColor?: readonly [number, number, number, number] | undefined;
57
- /** Optional toon material override knobs (light direction/colors/rim). */
58
- readonly material?: Partial<AnimationToonMaterialOptions> | undefined;
59
- /** Optional frame to run the outline + color-grade post-passes against. */
60
- readonly frame?: ApplyAnimationRenderPresetFrame | undefined;
61
- }
62
-
63
- export interface ApplyAnimationRenderPresetResult {
64
- readonly kind: "animation-render-preset-application";
65
- /** Real engine material — assign to scene meshes to get banded toon pixels. */
66
- readonly material: AnimationToonMaterial;
67
- readonly materialStyle: AnimationMaterialStyle;
68
- /** Key-light descriptor derived from the preset, also baked into the material. */
69
- readonly lighting: AnimationRenderPresetLightingDescriptor;
70
- /** True when the Sobel outline pass is enabled for this preset. */
71
- readonly outlineEnabled: boolean;
72
- /** Present only when a frame was supplied AND outlines are enabled. Real modified pixels. */
73
- readonly outline?: OutlineResult | undefined;
74
- /** Present only when a frame was supplied. Real modified pixels. */
75
- readonly colorGrade?: ColorGradeResult | undefined;
76
- /** Honest per-stage record of what touched pixels. */
77
- readonly appliedToPixels: {
78
- readonly toonMaterial: "returned-for-caller-assignment";
79
- readonly outline: boolean;
80
- readonly colorGrade: boolean;
81
- };
82
- }
83
-
84
- const DEFAULT_KEY_LIGHT_DIRECTION: readonly [number, number, number] = [0.3, 0.8, 0.5];
85
-
86
- /**
87
- * Map a AnimationMaterialStyle.treatment to a shadow-floor that keeps the chosen
88
- * look readable: flatter treatments use a higher floor (less contrast between bands).
89
- */
90
- function shadowFloorForTreatment(style: AnimationMaterialStyle): number {
91
- switch (style.treatment) {
92
- case "flat-readable":
93
- return 0.6;
94
- case "soft-toon":
95
- return 0.45;
96
- case "cel":
97
- return 0.3;
98
- case "preserve-pbr":
99
- default:
100
- return 0.4;
101
- }
102
- }
103
-
104
- export function applyAnimationRenderPreset(
105
- preset: AnimationRenderPresetEvidence,
106
- options: ApplyAnimationRenderPresetOptions = {}
107
- ): ApplyAnimationRenderPresetResult {
108
- const style = preset.materialStyle;
109
-
110
- const keyLightDirection = options.material?.lightDirection ?? DEFAULT_KEY_LIGHT_DIRECTION;
111
- const keyLightColor = options.material?.lightColor ?? [1, 0.97, 0.9];
112
-
113
- // 1. MATERIAL — band count comes straight from the style's rampSteps (clamped to
114
- // the toon material's supported [2, 16] range).
115
- const bands = Math.max(2, Math.min(16, Math.round(style.rampSteps)));
116
- const material = new AnimationToonMaterial({
117
- name: `${preset.name}-toon`,
118
- baseColor: options.baseColor ?? options.material?.baseColor ?? [0.92, 0.58, 0.16, 1],
119
- bands,
120
- shadowFloor: options.material?.shadowFloor ?? shadowFloorForTreatment(style),
121
- lightDirection: keyLightDirection,
122
- lightColor: keyLightColor as readonly [number, number, number],
123
- rimColor: options.material?.rimColor ?? [0.6, 0.72, 1],
124
- rimPower: options.material?.rimPower ?? 3,
125
- // Cel treatment leans on a stronger rim for graphic edges.
126
- rimIntensity: options.material?.rimIntensity ?? (style.treatment === "cel" ? 0.6 : 0.4)
127
- });
128
-
129
- const lighting: AnimationRenderPresetLightingDescriptor = {
130
- keyLightDirection,
131
- keyLightColor: keyLightColor as readonly [number, number, number],
132
- softShadows: preset.shadows.soft,
133
- contactShadows: preset.shadows.contact,
134
- namedRig: preset.lights
135
- };
136
-
137
- const outlineEnabled = style.outline;
138
-
139
- let outline: OutlineResult | undefined;
140
- let colorGrade: ColorGradeResult | undefined;
141
-
142
- if (options.frame) {
143
- const { pixels, width, height } = options.frame;
144
- // 2. OUTLINE — real Sobel edge pass over the supplied frame.
145
- let working = pixels;
146
- if (outlineEnabled) {
147
- outline = outlinePixels(working, width, height, {
148
- // Warm storybook ink that reads against the night palette.
149
- color: [24, 18, 12, 255],
150
- width: 1,
151
- threshold: 0.22,
152
- opacity: 0.85
153
- });
154
- working = outline.pixels;
155
- }
156
- // 3. COLOR GRADE — stylized grade; reducedFlash trims saturation/contrast.
157
- const punch = preset.reducedFlash ? 1 : 1.05;
158
- colorGrade = colorGradePixels(working, width, height, {
159
- contrast: punch,
160
- saturation: 1 + style.saturationBoost,
161
- vibrance: preset.reducedFlash ? 0.05 : 0.12,
162
- vignette: 0.18
163
- });
164
- }
165
-
166
- return {
167
- kind: "animation-render-preset-application",
168
- material,
169
- materialStyle: style,
170
- lighting,
171
- outlineEnabled,
172
- outline,
173
- colorGrade,
174
- appliedToPixels: {
175
- toonMaterial: "returned-for-caller-assignment",
176
- outline: outline !== undefined,
177
- colorGrade: colorGrade !== undefined
178
- }
179
- };
180
- }
@@ -1,5 +0,0 @@
1
- export * from "./AnimationMaterialStyle.js";
2
- export * from "./AnimationRenderPreset.js";
3
- export * from "./AnimationVisualQuality.js";
4
- export * from "./AnimationToonMaterial.js";
5
- export * from "./applyAnimationRenderPreset.js";
@@ -1,26 +0,0 @@
1
- import { createRendererOwnedEvidenceFlag, type CinematicRendererEvidenceFlag } from "./CinematicEvidence";
2
-
3
- export interface CinematicBloomPass {
4
- readonly name: "bloom";
5
- readonly threshold: number;
6
- readonly intensity: number;
7
- readonly radius: number;
8
- readonly rendererOwnedEvidence: CinematicRendererEvidenceFlag;
9
- }
10
-
11
- export function createCinematicBloomPass(options: Partial<Omit<CinematicBloomPass, "name" | "rendererOwnedEvidence">> = {}): CinematicBloomPass {
12
- return {
13
- name: "bloom",
14
- threshold: options.threshold ?? 0.72,
15
- intensity: options.intensity ?? 0.28,
16
- radius: options.radius ?? 1.35,
17
- rendererOwnedEvidence: createRendererOwnedEvidenceFlag({
18
- id: "postprocess:bloom",
19
- feature: "postprocess",
20
- label: "Bloom/glow pass",
21
- source: "renderer-postprocess",
22
- sceneContent: false,
23
- diagnostics: ["Bloom is a renderer postprocess pass over emissive scene content."]
24
- })
25
- };
26
- }
@@ -1,30 +0,0 @@
1
- import { createRendererOwnedEvidenceFlag, type CinematicRendererEvidenceFlag } from "./CinematicEvidence";
2
-
3
- export interface CinematicDepthCompositionPlan {
4
- readonly mode: "depth-aware" | "camera-sorted";
5
- readonly depthTextureRequired: boolean;
6
- readonly fallback: "camera-sorted-transparent-cards";
7
- readonly rendererOwnedEvidence: CinematicRendererEvidenceFlag;
8
- readonly diagnostics: readonly string[];
9
- }
10
-
11
- export function createCinematicDepthCompositionPlan(options: { readonly depthTextureAvailable?: boolean } = {}): CinematicDepthCompositionPlan {
12
- const depthTextureAvailable = options.depthTextureAvailable === true;
13
- return {
14
- mode: depthTextureAvailable ? "depth-aware" : "camera-sorted",
15
- depthTextureRequired: depthTextureAvailable,
16
- fallback: "camera-sorted-transparent-cards",
17
- rendererOwnedEvidence: createRendererOwnedEvidenceFlag({
18
- id: "vfx:depth-composition",
19
- feature: "vfx",
20
- label: "Depth-aware VFX composition",
21
- source: "renderer-vfx",
22
- diagnostics: [depthTextureAvailable ? "VFX can sample renderer-owned depth." : "VFX falls back to camera-sorted renderer cards/particles."]
23
- }),
24
- diagnostics: [
25
- depthTextureAvailable
26
- ? "Depth texture is available for VFX composition."
27
- : "Depth texture is not declared; composition remains renderer-owned but uses camera-sorted approximations."
28
- ]
29
- };
30
- }
@@ -1,123 +0,0 @@
1
- export type CinematicEvidenceFeature =
2
- | "material"
3
- | "lighting"
4
- | "vfx"
5
- | "postprocess"
6
- | "camera"
7
- | "timeline"
8
- | "blocking"
9
- | "asset"
10
- | "environment";
11
-
12
- export type CinematicEvidenceSource =
13
- | "renderer-scene"
14
- | "renderer-material"
15
- | "renderer-light"
16
- | "renderer-vfx"
17
- | "renderer-postprocess"
18
- | "renderer-camera"
19
- | "renderer-timeline"
20
- | "dom-overlay"
21
- | "css-overlay";
22
-
23
- export interface CinematicRendererEvidenceFlag {
24
- readonly id: string;
25
- readonly feature: CinematicEvidenceFeature;
26
- readonly label: string;
27
- readonly source: CinematicEvidenceSource;
28
- readonly rendererOwned: boolean;
29
- readonly sceneContent: boolean;
30
- readonly domOverlay: boolean;
31
- readonly satisfiesPublicCinematicGate: boolean;
32
- readonly diagnostics: readonly string[];
33
- }
34
-
35
- export interface CinematicDomOverlayRejection {
36
- readonly ok: false;
37
- readonly code: "AURA_CINEMATIC_DOM_OVERLAY_EVIDENCE_REJECTED";
38
- readonly missingRendererOwnedFeatures: readonly CinematicEvidenceFeature[];
39
- readonly overlayOnlyFeatures: readonly CinematicEvidenceFeature[];
40
- readonly diagnostics: readonly string[];
41
- }
42
-
43
- export interface CinematicRendererEvidenceAccepted {
44
- readonly ok: true;
45
- readonly rendererOwnedFeatures: readonly CinematicEvidenceFeature[];
46
- readonly diagnostics: readonly string[];
47
- }
48
-
49
- export type CinematicRendererEvidenceValidation = CinematicRendererEvidenceAccepted | CinematicDomOverlayRejection;
50
-
51
- export function createRendererOwnedEvidenceFlag(input: {
52
- readonly id: string;
53
- readonly feature: CinematicEvidenceFeature;
54
- readonly label: string;
55
- readonly source?: Exclude<CinematicEvidenceSource, "dom-overlay" | "css-overlay">;
56
- readonly sceneContent?: boolean;
57
- readonly diagnostics?: readonly string[];
58
- }): CinematicRendererEvidenceFlag {
59
- return {
60
- id: input.id,
61
- feature: input.feature,
62
- label: input.label,
63
- source: input.source ?? "renderer-scene",
64
- rendererOwned: true,
65
- sceneContent: input.sceneContent ?? true,
66
- domOverlay: false,
67
- satisfiesPublicCinematicGate: true,
68
- diagnostics: input.diagnostics ?? []
69
- };
70
- }
71
-
72
- export function createDomOverlayEvidenceFlag(input: {
73
- readonly id: string;
74
- readonly feature: CinematicEvidenceFeature;
75
- readonly label: string;
76
- readonly source?: "dom-overlay" | "css-overlay";
77
- readonly diagnostics?: readonly string[];
78
- }): CinematicRendererEvidenceFlag {
79
- return {
80
- id: input.id,
81
- feature: input.feature,
82
- label: input.label,
83
- source: input.source ?? "dom-overlay",
84
- rendererOwned: false,
85
- sceneContent: false,
86
- domOverlay: true,
87
- satisfiesPublicCinematicGate: false,
88
- diagnostics: input.diagnostics ?? ["DOM/CSS overlays are diagnostic UI only and do not satisfy public cinematic scene evidence."]
89
- };
90
- }
91
-
92
- export function validateRendererOwnedCinematicEvidence(
93
- flags: readonly CinematicRendererEvidenceFlag[],
94
- requiredFeatures: readonly CinematicEvidenceFeature[]
95
- ): CinematicRendererEvidenceValidation {
96
- const rendererOwnedFeatures = unique(flags.filter((flag) => flag.rendererOwned && flag.satisfiesPublicCinematicGate).map((flag) => flag.feature));
97
- const overlayOnlyFeatures = requiredFeatures.filter((feature) => {
98
- const featureFlags = flags.filter((flag) => flag.feature === feature);
99
- return featureFlags.length > 0 && featureFlags.every((flag) => flag.domOverlay || !flag.rendererOwned);
100
- });
101
- const missingRendererOwnedFeatures = requiredFeatures.filter((feature) => !rendererOwnedFeatures.includes(feature));
102
- if (missingRendererOwnedFeatures.length > 0 || overlayOnlyFeatures.length > 0) {
103
- return {
104
- ok: false,
105
- code: "AURA_CINEMATIC_DOM_OVERLAY_EVIDENCE_REJECTED",
106
- missingRendererOwnedFeatures,
107
- overlayOnlyFeatures,
108
- diagnostics: [
109
- "Required cinematic proof must come from renderer-owned scene, material, lighting, VFX, postprocess, camera, timeline, or blocking data.",
110
- ...overlayOnlyFeatures.map((feature) => `${feature} was represented only by DOM/CSS overlay evidence.`)
111
- ]
112
- };
113
- }
114
- return {
115
- ok: true,
116
- rendererOwnedFeatures,
117
- diagnostics: ["All required cinematic evidence features are renderer-owned."]
118
- };
119
- }
120
-
121
- function unique<T>(values: readonly T[]): readonly T[] {
122
- return [...new Set(values)];
123
- }
@@ -1,144 +0,0 @@
1
- import type { EnvironmentLightingOptions } from "../ForwardPass";
2
- import { createRendererOwnedEvidenceFlag, type CinematicRendererEvidenceFlag } from "./CinematicEvidence";
3
-
4
- export type CinematicLightingRigId =
5
- | "soft-key-fill-rim"
6
- | "moody-alley"
7
- | "studio-product"
8
- | "warm-sunrise"
9
- | "cool-moonlit";
10
-
11
- export type CinematicLightRole = "key" | "fill" | "rim" | "practical" | "ambient";
12
- export type CinematicLightType = "directional" | "point" | "spot" | "ambient";
13
-
14
- export interface CinematicRuntimeLight {
15
- readonly id: string;
16
- readonly role: CinematicLightRole;
17
- readonly type: CinematicLightType;
18
- readonly color: readonly [number, number, number];
19
- readonly intensity: number;
20
- readonly position?: readonly [number, number, number];
21
- readonly direction?: readonly [number, number, number];
22
- readonly castsShadow: boolean;
23
- }
24
-
25
- export interface CinematicLightingRig {
26
- readonly id: CinematicLightingRigId;
27
- readonly label: string;
28
- readonly exposure: number;
29
- readonly toneMap: {
30
- readonly operator: "filmic" | "aces" | "reinhard";
31
- readonly whitePoint: number;
32
- };
33
- readonly environmentLighting: EnvironmentLightingOptions;
34
- readonly lights: readonly CinematicRuntimeLight[];
35
- readonly rendererOwnedEvidence: CinematicRendererEvidenceFlag;
36
- readonly diagnostics: readonly string[];
37
- }
38
-
39
- export function createCinematicLightingRig(id: CinematicLightingRigId): CinematicLightingRig {
40
- const rig = rigWithoutEvidence(id);
41
- return {
42
- ...rig,
43
- rendererOwnedEvidence: createRendererOwnedEvidenceFlag({
44
- id: `lighting:${id}`,
45
- feature: "lighting",
46
- label: rig.label,
47
- source: "renderer-light",
48
- diagnostics: rig.diagnostics
49
- })
50
- };
51
- }
52
-
53
- export function listCinematicLightingRigs(): readonly CinematicLightingRig[] {
54
- const ids: readonly CinematicLightingRigId[] = ["soft-key-fill-rim", "moody-alley", "studio-product", "warm-sunrise", "cool-moonlit"];
55
- return ids.map(createCinematicLightingRig);
56
- }
57
-
58
- export function selectCinematicLightingRig(tags: readonly string[]): CinematicLightingRigId {
59
- const lower = tags.map((tag) => tag.toLowerCase());
60
- if (lower.some((tag) => tag.includes("alley") || tag.includes("neon") || tag.includes("rain"))) return "moody-alley";
61
- if (lower.some((tag) => tag.includes("studio") || tag.includes("product"))) return "studio-product";
62
- if (lower.some((tag) => tag.includes("sunrise") || tag.includes("warm") || tag.includes("golden"))) return "warm-sunrise";
63
- if (lower.some((tag) => tag.includes("moon") || tag.includes("night") || tag.includes("cool"))) return "cool-moonlit";
64
- return "soft-key-fill-rim";
65
- }
66
-
67
- function rigWithoutEvidence(id: CinematicLightingRigId): Omit<CinematicLightingRig, "rendererOwnedEvidence"> {
68
- switch (id) {
69
- case "moody-alley":
70
- return makeRig(id, "Moody alley", 1.24, [0.035, 0.045, 0.07], 0.34, [
71
- light("alley-key", "key", "spot", [0.42, 0.58, 1], 2.2, [-2.4, 3.6, 2.2], [0.45, -0.72, -0.52], true),
72
- light("alley-rim", "rim", "point", [0.04, 0.86, 1], 3.4, [1.8, 1.2, -1.4], undefined, true),
73
- light("alley-practical-neon", "practical", "point", [1, 0.08, 0.62], 2.8, [-1.6, 1.7, -2.1], undefined, false)
74
- ], ["Moody alley rig includes key, rim, and practical light metadata compiled for the renderer."]);
75
- case "studio-product":
76
- return makeRig(id, "Studio product", 1.08, [0.78, 0.8, 0.84], 0.54, [
77
- light("studio-key", "key", "directional", [1, 0.95, 0.88], 1.8, undefined, [0.4, -0.7, -0.58], true),
78
- light("studio-fill", "fill", "directional", [0.62, 0.72, 1], 0.7, undefined, [-0.5, -0.35, -0.8], false),
79
- light("studio-rim", "rim", "directional", [1, 1, 1], 0.9, undefined, [0.12, -0.2, 0.97], false)
80
- ], ["Studio product rig uses renderer light records, not CSS panel highlights."]);
81
- case "warm-sunrise":
82
- return makeRig(id, "Warm sunrise", 1.16, [0.9, 0.58, 0.32], 0.48, [
83
- light("sunrise-key", "key", "directional", [1, 0.58, 0.28], 2.05, undefined, [0.62, -0.52, -0.58], true),
84
- light("sunrise-fill", "fill", "ambient", [0.28, 0.36, 0.55], 0.32, undefined, undefined, false),
85
- light("sunrise-rim", "rim", "directional", [1, 0.86, 0.52], 0.78, undefined, [-0.12, -0.28, 0.95], false)
86
- ], ["Warm sunrise is an analytic renderer lighting preset."]);
87
- case "cool-moonlit":
88
- return makeRig(id, "Cool moonlit", 1.32, [0.2, 0.28, 0.48], 0.38, [
89
- light("moon-key", "key", "directional", [0.48, 0.62, 1], 1.35, undefined, [0.24, -0.62, -0.74], true),
90
- light("moon-fill", "fill", "ambient", [0.08, 0.12, 0.2], 0.24, undefined, undefined, false),
91
- light("moon-rim", "rim", "directional", [0.62, 0.86, 1], 0.92, undefined, [-0.22, -0.14, 0.96], false)
92
- ], ["Cool moonlit rig remains renderer-owned lighting evidence."]);
93
- case "soft-key-fill-rim":
94
- return makeRig(id, "Soft key fill rim", 1.12, [0.52, 0.58, 0.66], 0.45, [
95
- light("soft-key", "key", "directional", [1, 0.92, 0.82], 1.55, undefined, [0.42, -0.62, -0.66], true),
96
- light("soft-fill", "fill", "directional", [0.46, 0.58, 0.82], 0.46, undefined, [-0.46, -0.28, -0.84], false),
97
- light("soft-rim", "rim", "directional", [0.7, 0.88, 1], 0.72, undefined, [0.08, -0.28, 0.96], false)
98
- ], ["Soft three-point rig supplies key/fill/rim renderer lights."]);
99
- }
100
- }
101
-
102
- function makeRig(
103
- id: CinematicLightingRigId,
104
- label: string,
105
- exposure: number,
106
- color: readonly [number, number, number],
107
- intensity: number,
108
- lights: readonly CinematicRuntimeLight[],
109
- diagnostics: readonly string[]
110
- ): Omit<CinematicLightingRig, "rendererOwnedEvidence"> {
111
- return {
112
- id,
113
- label,
114
- exposure,
115
- toneMap: { operator: "filmic", whitePoint: id === "cool-moonlit" ? 1.05 : 1.22 },
116
- environmentLighting: {
117
- color,
118
- intensity,
119
- proceduralMap: {
120
- skyColor: [color[0] * 0.9, color[1] * 0.95, Math.min(1, color[2] * 1.15)],
121
- horizonColor: [Math.min(1, color[0] * 1.2), Math.min(1, color[1] * 1.1), color[2]],
122
- groundColor: [0.04, 0.045, 0.05],
123
- specularColor: [1, 0.95, 0.86],
124
- intensity,
125
- specularIntensity: Math.min(1, intensity + 0.28)
126
- }
127
- },
128
- lights,
129
- diagnostics
130
- };
131
- }
132
-
133
- function light(
134
- id: string,
135
- role: CinematicLightRole,
136
- type: CinematicLightType,
137
- color: readonly [number, number, number],
138
- intensity: number,
139
- position: readonly [number, number, number] | undefined,
140
- direction: readonly [number, number, number] | undefined,
141
- castsShadow: boolean
142
- ): CinematicRuntimeLight {
143
- return { id, role, type, color, intensity, position, direction, castsShadow };
144
- }