Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize tessellation of filled circles #1616

Merged
merged 4 commits into from
May 10, 2022
Merged

Optimize tessellation of filled circles #1616

merged 4 commits into from
May 10, 2022

Conversation

emilk
Copy link
Owner

@emilk emilk commented May 10, 2022

Part of #1196

When painting a scatter plot we sometimes want to paint hundreds of thousands of points (filled circles) on screen every frame.

In this PR the font texture atlas is pre-populated with some filled circled of various radii. These are then used when painting (small) filled circled, which means A LOT less triangles and vertices are generated for them.

In a new benchmark we can see a 10x speedup in circle tessellation, but the the real benefit comes in the painting of these circles: since we generate a lot less vertices, the backend painter has less to do.

In a real-life scenario with a lot of things being painted (including around 100k points) I saw tessellation go from 35ms -> 7ms and painting go from 45ms -> 1ms. This means the total frame time went from 80ms to 8ms, or a 10x speedup.

emilk added 4 commits May 10, 2022 18:52
10x speedup in tessellation, and even more in painting due to how much
fewer vertices are being generated.

In a real-life scenarion, tessellation went from 35ms -> 7ms
and painting went from 45ms -> 1ms, for a total 10x speedup.
@emilk emilk merged commit 7b18fab into master May 10, 2022
@emilk emilk deleted the optimize-circles branch May 10, 2022 17:31
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