Skip to content

feat: adaptive trail sampling for smoother ribbons with less geometry#46

Merged
mrpollo merged 2 commits intomainfrom
feat/adaptive-trail-sampling
Mar 11, 2026
Merged

feat: adaptive trail sampling for smoother ribbons with less geometry#46
mrpollo merged 2 commits intomainfrom
feat/adaptive-trail-sampling

Conversation

@mrpollo
Copy link
Member

@mrpollo mrpollo commented Mar 11, 2026

Rebased version of #44 on latest main.

  • Replace fixed-interval trail sampling (every 16ms) with direction-aware adaptive sampling that records points densely on turns and sparsely on straights
  • Halve trail buffer from 3600 to 1800 points per vehicle since adaptive sampling achieves comparable coverage with fewer points
  • Restore Snow view mode speed ribbon gradient (navy → blue → teal → green → yellow → red) which was falling through to the Grid default

Replace fixed-interval trail sampling (every 16ms) with direction-aware
adaptive sampling. Points are recorded densely on turns (>5.7° direction
change) and sparsely on straights (0.5m max / 64ms floor), producing
smoother ribbon curves where it matters without wasting buffer on
redundant straight-line segments.

Halve TRAIL_MAX from 3600 to 1800 since adaptive sampling achieves
comparable trail coverage with fewer points, reducing per-vehicle memory
and draw cost — significant for multi-vehicle scenarios.
Snow mode was falling through to the Grid default thermal gradient
(purple → white) instead of its dedicated palette (navy → blue →
teal → green → yellow → red).
@mrpollo mrpollo merged commit 1a09526 into main Mar 11, 2026
5 checks 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.

2 participants