Skip to content

fix: hide seam between drawPinnedCorners' two independently-warped triangles - #176

Merged
markwpearce merged 1 commit into
mainfrom
fix-110-pinned-corners-seam
Aug 30, 2026
Merged

fix: hide seam between drawPinnedCorners' two independently-warped triangles#176
markwpearce merged 1 commit into
mainfrom
fix-110-pinned-corners-seam

Conversation

@markwpearce

Copy link
Copy Markdown
Owner

Summary

Fixes #110. drawPinnedCornersTo() splits a corner-pinned quad into two triangles and warps each independently via its own DrawTransformedObject pipeline. Their shared diagonal edge rounds slightly differently between the two, leaving a visible seam — the same class of fractional-pixel-rounding seam already documented (and fixed with a padding trick) for SceneObjectPlane/SceneObjectSkybox.

Fix

Added Renderer.padPointAwayFrom() and nudge each triangle's copy of the two shared-diagonal points outward (away from that triangle's own apex corner) by pinnedCornersSeamPadding (2px), so the two independently-rasterized triangles overlap by a hair instead of abutting exactly.

Verification

  • npm run check — lint, validate, and headless tests all pass (862 tests).
  • Sideloaded examples/rendererTest to a real Roku and ran the corner-pin-grid demo (CornerPinGridTest, the issue's suggested repro) before/after:
    • Before: a clear diagonal seam line runs through every tile in the grid.
    • After: no visible seam on any tile, no visible distortion to the outer silhouette, FPS unaffected (~62fps in both cases).

Scoped to the two-triangle-split path used by default (unaffected: splitIntoFour, a separate 4-triangle option not exercised by this demo — worth a follow-up if it turns out to have the same class of seam).

🤖 Generated with Claude Code

…iangles

drawPinnedCornersTo() splits a corner-pinned quad into two triangles and
warps each one independently via its own DrawTransformedObject pipeline.
Their shared diagonal edge gets rounded slightly differently by each
triangle's own warp, leaving a visible seam along the diagonal - the
same class of fractional-pixel-rounding seam already documented for
SceneObjectPlane/SceneObjectSkybox.

Fix: pad each triangle's copy of the two shared-edge points outward,
away from that triangle's own apex corner, by a couple pixels
(padPointAwayFrom()/pinnedCornersSeamPadding) so the two triangles
overlap by a hair instead of abutting exactly - same seamPadding
pattern already used elsewhere. Verified visually on real hardware via
examples/rendererTest's CornerPinGridTest demo (issue #110's suspected
repro area): the diagonal line is gone from every tile in the grid at
padding=2px, with no visible distortion to the outer silhouette.

Fixes #110

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@markwpearce
markwpearce merged commit c5a67a5 into main Aug 30, 2026
3 checks passed
@markwpearce
markwpearce deleted the fix-110-pinned-corners-seam branch August 30, 2026 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Visible seam in corner-pinned (drawPinnedCorners) blitted images, e.g. billboards

1 participant