diff options
Diffstat (limited to 'src/LivingVillage.Desktop')
| -rw-r--r-- | src/LivingVillage.Desktop/Game.fs | 8 | ||||
| -rw-r--r-- | src/LivingVillage.Desktop/M6Presentation.fs | 12 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/LivingVillage.Desktop/Game.fs b/src/LivingVillage.Desktop/Game.fs index c6da443..537ae3b 100644 --- a/src/LivingVillage.Desktop/Game.fs +++ b/src/LivingVillage.Desktop/Game.fs @@ -1186,6 +1186,14 @@ type LivingVillageGame() as this = let veilAlpha = M6Presentation.goldenVeilAlpha world.Tick if veilAlpha > 0 then spriteBatch.Draw(pixel, Rectangle(0, 0, viewport.Width, viewport.Height), VillageArt.premultiply 255 150 70 veilAlpha) + + // Cool moonlight wash on top of the night scene: a premultiplied blue veil whose + // alpha is a pure tick function (zero by day, suppressed through dusk/dawn warmth). + // Like the golden veil it adds light and can never saturate to white. + let moonAlpha = M6Presentation.moonlightVeilAlpha world.Tick + if moonAlpha > 0 then + let mr, mg, mb = M6Presentation.moonlightRgb + spriteBatch.Draw(pixel, Rectangle(0, 0, viewport.Width, viewport.Height), VillageArt.premultiply mr mg mb moonAlpha) spriteBatch.End() // Contextual floating prompt over the unique target; same CJK atlas font path as the HUD. diff --git a/src/LivingVillage.Desktop/M6Presentation.fs b/src/LivingVillage.Desktop/M6Presentation.fs index 90d2e65..825847a 100644 --- a/src/LivingVillage.Desktop/M6Presentation.fs +++ b/src/LivingVillage.Desktop/M6Presentation.fs @@ -65,6 +65,18 @@ module M6Presentation = let goldenVeilAlpha (tick: int64) : int = int (150.0f * transitionWarmth tick) + /// Cool moonlight wash applied as a premultiplied veil over the finished night scene. + /// Multiplicative night tint can only darken, so this additive cool layer is what makes deep + /// night read moon-blue. It is zero whenever the sun lights the scene (blend 0) and is + /// suppressed through the warm dawn/dusk windows (warmth), so it never competes with the + /// golden veil. Purely desktop render state; the Kernel never sees it. + let moonlightRgb : int * int * int = (120, 170, 235) + + let moonlightVeilAlpha (tick: int64) : int = + let blend = lightingBlend tick + let warmth = transitionWarmth tick + int (72.0f * blend * (1.0f - warmth)) + let private lerp (a: int) (b: int) (blend: float32) : int = a + int (float32 (b - a) * blend) |
