diff options
| author | Somhairle H. Marisol <[email protected]> | 2026-09-29 10:58:24 +0800 |
|---|---|---|
| committer | Somhairle H. Marisol <[email protected]> | 2026-09-29 10:58:24 +0800 |
| commit | 0b1330de9b8d78f398753d878f495f324617d203 (patch) | |
| tree | 298710d868c5a965c4dfb94fa5db89a796ca78c0 /src/LivingVillage.Desktop/M6Presentation.fs | |
| parent | d170af8485ad787cbc2a87b352d2b5cd81605b4d (diff) | |
| download | living-village-0b1330de9b8d78f398753d878f495f324617d203.tar.gz | |
p73: 昼夜光照四时段档(清晨/正午/黄昏/夜晚)
M6Presentation 新增 periodAtTick/periodLighting 参数表(AmbientTint 乘性色调 + Veil/VeilAlpha 加性覆盖 + LanternGlow),边界与 timePeriodLabel 一致;正午为恒等档不改白平衡。DrawWorldView 并入时段色调与 effectiveLanternGlow(黄昏 0.6 起点亮、夜晚 1.0),覆盖色最后叠加。新增 P73 回归;新增 LV_P73_SHOT 同机位四帧证据 + analyze-p73(verdict=PASS);字形表补 正/午(345)。Desktop 346/346、Kernel 120/120、digest 与 p70 一致。
Diffstat (limited to 'src/LivingVillage.Desktop/M6Presentation.fs')
| -rw-r--r-- | src/LivingVillage.Desktop/M6Presentation.fs | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/src/LivingVillage.Desktop/M6Presentation.fs b/src/LivingVillage.Desktop/M6Presentation.fs index 825847a..4e88bd9 100644 --- a/src/LivingVillage.Desktop/M6Presentation.fs +++ b/src/LivingVillage.Desktop/M6Presentation.fs @@ -159,3 +159,73 @@ module M6Presentation = elif hour < 17 then "白天" elif hour < 21 then "黄昏" else "夜晚" + + // ------------------------------------------------------------------ + // P73:四时段光照档(清晨/正午/黄昏/夜晚)。 + // 既有的 blend/warmth 是连续曲线;这里在其上叠加一层「时段档」—— + // 每个时段一份乘性环境色调 + 加性覆盖色 + 灯光强度,保证 6/12/18/22 时 + // 四张真实帧肉眼可辨,尤其填补 17:00–19:15 原本与正午无差的黄昏空档。 + // 正午档为恒等(白 tint / alpha 0 / 灯光 0),因此不改变既有正午观感。 + // ------------------------------------------------------------------ + + type M6Period = + | Morning + | Noon + | Dusk + | Night + + type M6PeriodLighting = + { AmbientTint: Color + Veil: Color + VeilAlpha: int + LanternGlow: float32 } + + /// 时段档参数表(纯数据)。调用方按 periodAtTick 取值。 + let periodLighting (period: M6Period) : M6PeriodLighting = + match period with + | Morning -> + { AmbientTint = Color(238, 246, 255) + Veil = Color(255, 222, 160) + VeilAlpha = 20 + LanternGlow = 0.0f } + | Noon -> + { AmbientTint = Color(255, 255, 255) + Veil = Color(255, 255, 255) + VeilAlpha = 0 + LanternGlow = 0.0f } + | Dusk -> + { AmbientTint = Color(255, 231, 200) + Veil = Color(255, 140, 58) + VeilAlpha = 52 + LanternGlow = 0.6f } + | Night -> + { AmbientTint = Color(150, 176, 216) + Veil = Color(70, 110, 190) + VeilAlpha = 26 + LanternGlow = 1.0f } + + /// 时段枚举名(证据日志用,纯函数;与 timePeriodLabel 边界一致)。 + let lightingPeriodName = function + | Morning -> "清晨" + | Noon -> "正午" + | Dusk -> "黄昏" + | Night -> "夜晚" + + /// tick → 四时段档。边界与 timePeriodLabel 完全一致:<5 夜晚、<8 清晨、<17 正午、<21 黄昏、否则夜晚。 + let periodAtTick (tick: int64) : M6Period = + let hour = hourOf tick + if hour < 5 then Night + elif hour < 8 then Morning + elif hour < 17 then Noon + elif hour < 21 then Dusk + else Night + + let periodLightingAtTick (tick: int64) : M6PeriodLighting = periodAtTick tick |> periodLighting + + /// 两乘性色调逐通道相乘(255 为恒等)。用于把时段环境色调并入世界 tint。 + let multiplyTint (a: Color) (b: Color) : Color = + Color(int a.R * int b.R / 255, int a.G * int b.G / 255, int a.B * int b.B / 255, 255) + + /// 实际灯光强度:连续曲线与时段档取较大者(黄昏档让灯笼从 18:00 起点亮)。 + let effectiveLanternGlow (tick: int64) : float32 = + max (lightingAtTick tick).LanternGlow (periodLightingAtTick tick).LanternGlow |
