fix(sky): seamless night-sky star lattice — no face seams, no flare, round pixel-exact stars

The first night-sky gate (2026-08-23 screenshot) showed three defects:
glowing beams along the cube-face boundaries (fwidth blowup where
adjacent pixels land on different faces lights every neighbourhood star
solid), diffraction-spiked standouts the user rejects ('that is in a
photo only, not in real sky'), and ellipse-stretched stars from scalar
length(fwidth) sizing at oblique view angles.

One rewrite removes all three: stars now live on a seamless 3D lattice
over the unit sphere (no faces, so no seams by construction), each star
resolved through an exact tangent-plane -> screen-pixel 2x2 solve of
the direction derivatives (perfectly round, true pixel sizing at every
view angle, sharper cores), spikes deleted in favour of a soft round
halo on the bright tiers. Guard test updated to pin the new anchors and
forbid both fwidth-face grids and spikes; sky.frag.spv re-pinned.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-08-23 18:00:28 +02:00
parent 508cefdeb1
commit b8cfee6d08
5 changed files with 58 additions and 46 deletions

View file

@ -52,7 +52,7 @@ public sealed class VulkanShaderManifestTests
// override, retail's GameSky::Draw @0x00506FF0 rule (see
// SkyFogRuleTests). A deliberate default-path change, reviewed
// with the world-fog-range fix in the same commit.
["sky.frag.spv"] = "8105984072fc1b9075b5efdffd75d959c4087710d354d50a0e00ee0500462ca7",
["sky.frag.spv"] = "2d2de4080c7f4b0885aee4441e37a1725d3f30661b45773bcb39383674b1718b",
["sky.vert.spv"] = "3b51945fa4ff1be1604144df92866bdd47aade22f9dd90267591ef36adb28cde",
["terrain_modern.frag.spv"] = "7b3cdb01b837ed77ee20559a81c1ce5c9d5395300efcc072560ab0be3c5a1af9",
["terrain_modern.vert.spv"] = "9f4cb221ea6aed94a8d23af6cb8e3f3ed96c3cce6e50d135a72d3b55667b1557",

View file

@ -23,8 +23,14 @@ public sealed class EnhancedNightSkyRuleTests
Assert.Contains("if (uParamA > 0.5)", code, StringComparison.Ordinal);
Assert.Contains("nightSky(normalize(vDir), uint(uParamB))", code, StringComparison.Ordinal);
// Screen-pixel star sizing is the reason this exists — the stretched
// texture flaw must not creep back in via a fixed-size grid.
Assert.Contains("fwidth(g)", code, StringComparison.Ordinal);
// texture flaw must not creep back in via a fixed-size grid, and the
// cube-face fwidth seams must not return (the 2026-08-23 gate's
// glowing "Y"): the crispness anchor is the seamless 3D-lattice
// tangent-plane solve on the direction derivatives.
Assert.Contains("dFdx(dir)", code, StringComparison.Ordinal);
Assert.DoesNotContain("fwidth(g)", code, StringComparison.Ordinal);
// No diffraction spikes — user-directed: flare is photographic.
Assert.DoesNotContain("spike", code, StringComparison.OrdinalIgnoreCase);
}
[Fact]