Skip to content

3D strokes, vertex baking and draw pooling. - #295

Open
tychedelia wants to merge 4 commits into
mainfrom
strokes-3d
Open

tychedelia wants to merge 4 commits into
mainfrom
strokes-3d

Conversation

@tychedelia

@tychedelia tychedelia commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

Follow up to the previous PR that moves the rest of our strokes onto the new line renderer, plus some perf work I found that fell out of it.

On perf - we were spawning and despawning an entity for every draw every frame. Draws are pooled now and reuse their entities, and materials and primitive meshes are cached. This is something I've avoided in the past as it adds a lot of complexity but it does appear to yield pretty massive performance wins under certain circumstances.

Relatedly - fill color for primitives is passed per instance through the mesh tag instead of making a new material per color. We read the tag in the vertex shader and multiply it into the vertex color, which means we carry our own copy ofBevy's mesh vertex shader with a small patch.

Because the fill arrives as the vertex color, custom materials get it too now. Previously a custom shader just ignored fill(). A custom shader can still ignore it, but if you read the vertex color it'll work. Adds processing::mesh shader module so you can write a custom vertex shader.

Misc:

  • line() and point() take a z.
  • hint(ENABLE_STROKE_PERSPECTIVE) for strokes sized in world units.
  • Custom materials with blending weren't being drawn in the transparent pass, so they ordered wrong against opaque shapes.
  • A few fixes for the first frame of a sketch dropping draws, with visual tests that capture frame 1.

Stack created with GitHub Stacks CLI • Give Feedback 💬

@tychedelia
tychedelia added this pull request to stack #290 November 30, 2026 18:12
@tychedelia
tychedelia force-pushed the strokes-3d branch 2 times, most recently from 0ae85ef to 073d187 Compare November 30, 2026 21:54
Base automatically changed from vertex-strokes to main November 30, 2026 22:02
@tychedelia tychedelia mentioned this pull request Nov 30, 2026
@processing processing deleted a comment from github-actions Bot Nov 30, 2026
@tychedelia
tychedelia requested a review from catilac November 30, 2026 22:34
@tychedelia
tychedelia marked this pull request as ready for review November 30, 2026 22:34
@github-actions

Copy link
Copy Markdown

Visual regression: 1 changed, 2 new of 45 cases

case status detail
py_custom_vertex 🆕 new no baseline on main
py_particles_stress ❌ changed 100% of pixels differ
py_first_frame 🆕 new no baseline on main

If these changes are intentional, add the deliberate-rendering-change label.

baseline 27c15a47d5 · adapter llvmpipe (LLVM 20.1.2, 256 bits) (Vulkan, Mesa 25.2.8-0ubuntu0.24.04.5 (LLVM 20.1.2))

Open the visual report · workflow run

This branch has not been deployed

No deployments
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