xfy f4e937f35b fix(stars): round anti-aliased stars via 3x3x3 neighborhood scan
Background stars looked square even with anti-aliasing on, and toggling
AA just made them bigger rather than round. Two compounding causes, both
in star_color():

1. Square shape: the fast path measured cell distance with
   max(f.x, max(f.y, f.z)) — Chebyshev distance, which draws an
   axis-aligned cube, not a sphere. The visible star was literally a
   faded cube face.

2. AA "just makes it bigger": the Gaussian AA path used Euclidean
   distance, but only inside ONE cell. hash13(cell) returns a different
   value across a cell boundary, so a star's radial falloff could never
   reach zero — it was hard-clipped at the cell edge. The star's outline
   was therefore the cell's bounding box regardless of the radius
   parameter; bumping the gain/radius just filled more of that box.

Fix: scan the 3x3x3 neighborhood of cells so a star whose center lies in
an adjacent cell still contributes across the whole cell it lives in,
and take the brightest contributor. Distance is Euclidean in both paths,
so both are now genuinely round. star_aa selects soft Gaussian glow (on)
vs. a tight smoothstep disk (off) — a real shape choice instead of
square-vs-clipped-square.

Validated: naga type-checks the preprocessed shader; app runs 20s on
Metal (Apple M4) with no shader/compile/validation errors; cargo test
(14 physics tests) passes.
2026-07-15 10:00:57 +08:00
..