-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
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
[4.x] Faster Path2D drawing with polyline #55516
Conversation
Changes the Path2D drawing to use POLYLINE instead of thick lines.
In |
Yup I'm sure doing it properly ourselves will be better in the long run (for instance, OpenGL AA doesn't do anything on a lot of hardware, including most mobile afaik). Am unsure whether to leave this PR as is or just switch the anti-aliasing to false as a stop gap. 🤔 |
Can you post a before/after performance comparison? |
Yup sure I'll take a look. It's probably less than in 3.x as drawcalls are more expensive there, be interesting to see actually. 😁 |
Have done a test with 10 fairly squiggly Before 130 fps So comparing like with like (as before has no anti alias) it's around 16x faster on my system. That's fairly typical for differences I've seen between batched stuff and vulkan - vulkan is faster than GL but batched stuff for canvas items is still a good 10x faster in a lot of cases (for same type stuff). For mixed rendering vulkan does relatively better. I think on 3.x, this code is around 40-80x faster which is more typical for GL, and that will probably be the case for the OpenGL renderer in Godot 4. Here's the project BTW (needs recompiling with and without PR): |
Thanks! |
Changes the Path2D drawing to use POLYLINE instead of thick lines.
Notes
Before this PR
Before zoomed out:

Before zoomed in:

This is the result of the PR with anti-aliasing on (the current pushed state):
After zoomed out:

After zoomed in:

Also for comparison, this PR with anti-aliasing switched to off (let me know if this is preferred and I can change it):