From ebe7f80bcf54189cc51a15bf17b99293b6ff57a3 Mon Sep 17 00:00:00 2001 From: "Somhairle H. Marisol" Date: Tue, 22 Sep 2026 09:26:53 +0800 Subject: feat(desktop): P26 夜晚冷月光 veil(纯渲染层)+ 灯笼光晕径向无方斑回归 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/LivingVillage.Desktop.Tests/DesktopTests.fs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/LivingVillage.Desktop.Tests/DesktopTests.fs') diff --git a/src/LivingVillage.Desktop.Tests/DesktopTests.fs b/src/LivingVillage.Desktop.Tests/DesktopTests.fs index b78f4e0..7e4a849 100644 --- a/src/LivingVillage.Desktop.Tests/DesktopTests.fs +++ b/src/LivingVillage.Desktop.Tests/DesktopTests.fs @@ -159,6 +159,30 @@ type DesktopTests () = Assert.IsTrue(noon.Background.B > noon.Background.G) Assert.IsTrue(noon.Background.B > noon.Background.R) + [] + member _.MoonlightVeilIsCoolAndOnlyAtNight () = + let noonTick = 12L * Sim.ticksPerDay / 24L + let midnightTick = 0L + let deepNightTick = 23L * Sim.ticksPerDay / 24L + Assert.IsTrue(M6Presentation.moonlightVeilAlpha noonTick = 0, "daytime must have no moonlight") + + let moon = M6Presentation.moonlightVeilAlpha midnightTick + Assert.IsTrue(moon > 0, "deep night must get a cool moonlight wash") + Assert.AreEqual(moon, M6Presentation.moonlightVeilAlpha deepNightTick) + Assert.IsTrue(moon <= 72, "moonlight veil stays a low alpha so the scene is not washed out") + + let r, g, b = M6Presentation.moonlightRgb + Assert.IsTrue(b > g && g > r, "moonlight must be cool: blue-dominant channels") + + // Dusk is owned by the warm golden veil, so moonlight is suppressed there. + let duskTick = M6Presentation.startTickForHour 20.75 + Assert.IsTrue(M6Presentation.moonlightVeilAlpha duskTick < moon, "dusk is warmed, not moonlit") + + // Premultiplied premultiply of this colour never saturates to white. + let veiled = VillageArt.premultiply r g b moon + Assert.IsTrue(int veiled.B <= int veiled.A) + Assert.IsTrue(int (max veiled.R (max veiled.G veiled.B)) < 250) + [] member _.DaylightAutoplayBootstrapStartsAtDawnAndPreservesDefaultStart () = let dawnTick = 6L * Sim.ticksPerDay / 24L -- cgit v1.2.3