Skip to content

Fix triangle fill striping and black corners on alpha-off surfaces - #338

Merged
markwpearce merged 2 commits into
mainfrom
fix/issue-119-332-triangle-fill
Oct 16, 2026
Merged

markwpearce merged 2 commits into
mainfrom
fix/issue-119-332-triangle-fill

Conversation

@markwpearce

Copy link
Copy Markdown
Owner

Fixes #119, fixes #332

  • Oriented DrawableRectangle fill misses its corner triangles on device when a projected edge is exactly vertical #332 wasn't a 90° DrawTransformedObject quirk - the demo draws to an alphaEnable: false bitmap, so the later walls' temp bitmaps copied their transparent corners as black over the side walls. Renderer now turns alpha blending on for its target.
  • SceneObjectRectangle: diagonal striping artifact on thin oriented billboards during motion #119: the moving fill fanned lines from a corner, which leaves gaps at any step. Replaced with DrawRect bands (drawTriangleAsSpansTo). Also SceneObjectRectangle/Polygon always said didFastDraw: false, so a coarse fill never got redrawn once still - they now check getLossyTriangleFillCount().
  • Small triangles (≤16px short side) always use 1px bands - gap-free and no slower than the exact fill. Break-even came out ~16 on both a Roku Ultra and the simulator, so no platform gating needed. Dropped triangleQuickDrawThreshold from the quality settings.
  • New rendererTest demo triangle-fill-check compares/times each fill method.

BSP benchmark on device: 1966ms vs 2177ms on main. examples/3d RectanglesScene FPS unchanged.

🤖 Generated with Claude Code

, #332)

Moving flat triangles were filled with fanned lines that left gaps, and a
coarse fill was never redrawn because SceneObjectRectangle/Polygon always
reported didFastDraw: false. Small triangles now fill with DrawRect bands,
coarse bands only while moving, and lossy fills are reported so they get
redrawn once still. The Renderer turns on alpha blending on its target, so
temp bitmaps' transparent corners no longer black out what's behind them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@claude

claude Bot commented Oct 16, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.


…band axis and grid

- SceneObjectRectangle's direct canvas draw only allows the coarse fill while moving
- triangles sharing an edge band the same way, on a grid aligned to the band size
- document that Renderer turns on alpha blending on its target

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@markwpearce
markwpearce merged commit 52ef5a5 into main Oct 16, 2026
4 checks passed
@markwpearce
markwpearce deleted the fix/issue-119-332-triangle-fill branch October 16, 2026 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant