Skip to content

Conversation

@deluksic
Copy link
Contributor

@deluksic deluksic commented Nov 22, 2025

This is a complete rewrite of the lineSegmentVariableWidth utility, switching from 2 triangles per line and max-area triangle joins to 4 triangles per line and fan-out joins. The new approach produces more overdraw, but it is a MUCH simpler approach. We should have a purpose-built line rendering for optimizing triangle counts and sizes.

New abilities:

  • color based on "distance" to centerline
  • render only one half, for example for outlines which don't cover inside or outside

NOTE: I'll need a few more iterations to prettify the code and come up with better names for everything, so don't review yet.

image image
image image

@deluksic deluksic changed the title WIP: @tgpu/geometry Simplify variable width lines implementation WIP: @typegpu/geometry Simplify variable width lines implementation Nov 22, 2025
@deluksic deluksic force-pushed the de/simplify-lines branch 2 times, most recently from 6f83c01 to 7e1978f Compare November 23, 2025 16:30
@deluksic deluksic force-pushed the de/simplify-lines branch 2 times, most recently from db2258a to ac64859 Compare November 23, 2025 23:06
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