Skip to content

Fix count-then-fill vector rendering#10

Merged
ChrLackner merged 1 commit into
mainfrom
fix-countthenfill-vector-rendering
Jun 23, 2026
Merged

Fix count-then-fill vector rendering#10
ChrLackner merged 1 commit into
mainfrom
fix-countthenfill-vector-rendering

Conversation

@ChrLackner

Copy link
Copy Markdown
Contributor

No description provided.

…onvergence

- shapes.py: force per-instance direction stride for vector renderers. The
  count-then-fill output buffer is momentarily 1 element (the bootstrap), which
  the stride heuristic read as "one constant direction for all" (stride 0) → every
  arrow read directions[0] → all arrows pointed the same way. Renderers that set
  _directions_per_instance now always stride 12.

- engine/compute.js: on a count-then-fill resize the output buffer is freshly
  allocated and EMPTY (the fill runs next frame via onRerender). Writing the
  readback count to the indirect buffer then drew uninitialized slots → garbage
  positions/directions (random vectors / jumps during clip drag). Draw 0 until the
  refill; the next execute's cap shader sets the real count. processReadbacks()
  now returns whether it resized.

- engine/engine.js: add settle() to drive count-then-fill passes to convergence
  for one-shot captures (screenshots/headless), so they don't render blank;
  captureFrameBuffer() settles first; _renderNow() gains an autoReadback flag so
  settle() can drive the readbacks itself.

- scene.py: set _render_via_js so vector renderers skip their blocking Python
  count+eval+readback bootstrap when a live JS engine (GUI) or the exported HTML
  engine owns rendering and runs the count-then-fill GPU-side.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ChrLackner ChrLackner merged commit 6e59b30 into main Jun 23, 2026
1 check passed
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.

1 participant