From b0da8f7e8f02d943d3c31f6e4496b93118127239 Mon Sep 17 00:00:00 2001 From: Attacktive Date: Mon, 27 Jul 2026 16:39:07 +0900 Subject: [PATCH] fix: remove the hard seam across the sky at the far scenery crest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The horizon glow ramped up to full alpha and then its rect simply ended at sceneryFarCrestY, while the inter-plane haze started at alpha 55 on that same line. Both edges landed on one row, drawing a straight line right across the sky — on the beach scene at the sailboat mast top (SEA_HORIZON - 0.078). The glow now fills past the crest (CLAMP holds the end color, and the silhouettes cover it) and the haze ramps in from above the crest instead of appearing at full strength on it. Co-Authored-By: Claude Opus 5 --- .../weatherd/domain/render/SceneRenderer.kt | 31 ++++++++++++++++--- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/xyz/attacktive/weatherd/domain/render/SceneRenderer.kt b/app/src/main/java/xyz/attacktive/weatherd/domain/render/SceneRenderer.kt index 647433e..2324eae 100644 --- a/app/src/main/java/xyz/attacktive/weatherd/domain/render/SceneRenderer.kt +++ b/app/src/main/java/xyz/attacktive/weatherd/domain/render/SceneRenderer.kt @@ -530,8 +530,18 @@ class SceneRenderer { val bandTop = (sceneryFarCrestY - height * 0.06f).coerceAtLeast(height * 0.55f) - paint.shader = LinearGradient(0f, bandTop, 0f, sceneryFarCrestY, withAlpha(tint, 0), withAlpha(tint, alpha), Shader.TileMode.CLAMP) - canvas.drawRect(0f, bandTop, width, sceneryFarCrestY, paint) + paint.shader = LinearGradient( + 0f, + bandTop, + 0f, + sceneryFarCrestY, + withAlpha(tint, 0), + withAlpha(tint, alpha), + Shader.TileMode.CLAMP + ) + + // Fill past the crest (CLAMP holds the end color, and the silhouettes cover it) so the band never stops on a hard bright edge across the sky. + canvas.drawRect(0f, bandTop, width, height, paint) } /** A translucent wash between the two crests so the far plane reads as atmospheric depth rather than a second flat sticker. */ @@ -542,9 +552,22 @@ class SceneRenderer { return } + // The wash ramps in above the far crest too — starting it at full strength on the crest line drew a seam right across the sky. + val fade = (bottom - top) * 0.5f + val fadeTop = top - fade val haze = lighten(skyBottom, 0.15f) - paint.shader = LinearGradient(0f, top, 0f, bottom, withAlpha(haze, 55), withAlpha(haze, 0), Shader.TileMode.CLAMP) - canvas.drawRect(0f, top, width, bottom, paint) + + paint.shader = LinearGradient( + 0f, + fadeTop, + 0f, + bottom, + intArrayOf(withAlpha(haze, 0), withAlpha(haze, 55), withAlpha(haze, 0)), + floatArrayOf(0f, fade / (bottom - fadeTop), 1f), + Shader.TileMode.CLAMP + ) + + canvas.drawRect(0f, fadeTop, width, bottom, paint) } /**