Fix overlay shapes ignoring the z-buffer (bugreport 20260920-131610)
authorSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Sun, 20 Sep 2026 10:54:56 +0000 (13:54 +0300)
committerSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Sun, 20 Sep 2026 10:54:56 +0000 (13:54 +0300)
commit8eeecdb82b8947a6f96c2026606ad7ca5dacc31f
tree8f9dfc3c356a25abcdcbe5ba5aaec4a2ae354c28
parented0a7e9dd0c9d9d9e7b637c829484fe579ecbde0
Fix overlay shapes ignoring the z-buffer (bugreport 20260920-131610)

Solid geometry never occluded Line or Billboard/GlowingPoint output:
their span writers blended pixels unconditionally ('overlay semantics'),
so wireframe shapes, text sprites and glow points showed through solid
surfaces — e.g. wireframe pyramids visible through the solid sphere in
ShapeGalleryDemo.

Lines: interpolate 1/z per pixel (projectively linear along the 2D
projected segment; thick path projects each span pixel onto the line
parameter, thin paths reuse their walk parameter) and depth-test with
the same idiom as SolidPolygon. Sprites: screen-aligned, so one 1/z
value covers the whole quad. Both depth-TEST only and never depth-
WRITE (like pass-2 translucent geometry): a line/sprite must not
occlude geometry painted after it, and the HiZ pyramid is unaffected.

Verified: bug-pose render (Snapshot.cameraFromPose on the bugreport
pose) shows a clean sphere disc; all 21 unaffected goldens bit-
identical; shape-gallery + stereo goldens re-blessed after visual
review confirmed every changed pixel is a correct occlusion (wireframe
lines/grid/particles blocked by the solid sphere). Engine 48/48.
src/main/java/eu/svjatoslav/aukio/e3d/renderer/raster/shapes/basic/Billboard.java
src/main/java/eu/svjatoslav/aukio/e3d/renderer/raster/shapes/basic/line/Line.java