It’s hard to find the 5-50 (?) adopters out there across space and timezones, let alone encourage them to get in touch via Github issues or YouTube comments. I try to be just easy enough to find, which seems to fit discord best.
Reddit and bluesky gave me too much stress altogether so I’m off of those.
So just in edge case you were looking for me, I’ll be checking the discord daily and I have a chance of being active between 21:30 and 00:00 CEST
Updating curves at runtime does seem to cause some cpu spikes.
Of course I try to put in some stuff to help mitigate it, but it’s pretty hard to get across all the potential of 2D vector graphics.
Most notably:
you could pack and ship a pretty tiny web game, with all the disk space you save using 2D vector graphics.
you could generate rasterized images at runtime via script using code I already built in (if you follow the button trail that is)… Even spritesheets
auto scaling images for GUI (is also in there)… Currently I’m working on auto-scaling touch button textures in my game
But also drawing collision shapes in engine way more quickly .. I dunno, seemed quite useful to me.
For 2D rendering OpenGL does seem to perform best by far on the devices I’ve tested with, but of course to make stuff look good some type of GPU based antialiasing is helpful
Which is why I’ve been lobbying a bit for likes on this pull request:
For instance by making this video about it:
I don’t know about you, but I think Godot for lightweight web games has huge potential.
I think this has a lot of uses beyond that. A LOT of published game resources come in SVG formats. Being able to manipulate them for animation could be really useful. All of Kenney’s 2D assets have alternate SVG versions - usually in sprite sheet form. Craftpix releases a lot of their art with alternate SVG versions.
How do you do it? From what I saw in your videos, you tesselate beziers and update native line and polygon nodes with tesselated points. Point count change will always trigger the whole gpu buffer update. Since in most typical bezier editing situations only a single/few segments are affected, you could do partial buffer updates for those segments only, going directly to the rendering server. The constraint would be fixing the number of sample points but that may be acceptable.
If you constantly tesselate, the obvious thing for improving performance would be to delegate that part to native code via gdextension. It’d be harder to maintain and install but you could have this version for anyone who needs performance boost.
From what I saw in your videos, you tesselate beziers and update native line and polygon nodes with tesselated points
Yes, each time ScalableVectorShape2D.curve emits changed a flag is set to invoke tessellate on it in the next _process invocation. For bézier curves I can simply invoke the native code from godot’s core.
When there are arcs registered in the ScalableVectorShape2D.arc_list those segments are tessellated by gdscript code I adapted from godsvg’s bounding-box calculation:
If you constantly tesselate, the obvious thing for improving performance would be to delegate that part to native code via gdextension
As you can see, performance optimization is not my forté, but for a lot of use-cases there are no serious bottlenecks.
That being said, if I were a good c-programmer I would probably want to have a dedicated compute thread to batch all these tessellates to… I’m not a good c-programmer though
And with only 2 focus hours per day to spend I need to pick something I can handle without too much effort: learning better c/c++ would take too long.
Also: I love the ease of shipping for web (also android based web browsers and pwa for touch interaction) and with that ease comes the nothreads compile flag
As of today you can rig your 2D Scalable Vector Shapes (and .svg as a node imports) to a Skeleton2D.
Early access
You can get early access to this feature via the 2.24.4 release on github. Do so at your own peril, the functionality was less stable than expected,
Released soon?
Well, I am a working dad too, so I hope I will get around to the bug fixes soon. I will revoke the releases for now.
Sneak preview
SVG import demo on youtube short
[edit]: after some extra extensive testing in the live you can see below, I still ran into some bugs having to to with transform mismatches (between skeleton and rigged parts). I will get back on it as soon as I am able,
Hear ye, hear ye!
To anyone who wants to be in the Scalable Vector Shapes 2D Testimonial video this summer, you can still share how you used the plugin with a short story, screenshot and ideally a 1HD video (1920x1080)!
Just drop whatever you’d like me to promote in the discord showcase channel (with your explicit consent, so I know you want me to promote it).
These screenshots already made it into the asset store front:
The answer is simple: I was not aware it was faster.
The biggest performance bottlenecks pop up in the profiler at runtime.
This specific example did not pop up. Probably because it is usually called during edit mode to test whether a line can be considered closed or not. But not sure right now, as I’m on a phone and not on a laptop. (Edit: from the top of my head, this is of course not true: testing whether a curve can be considered closed is of course used all over the place.)
I see the docs mention it being faster, but that to me raises the other question: why are there two separate methods that compute the same thing? One with an intuitive name and another with a mildly less self-documenting name that just happens to be faster. What problem does this solve and why not make distance_to an alias of distance_squared_to? There must be an important underlying reason I’m missing here. Do you know?
What I would welcome a lot is a very rigid code review, to see what all can be done to improve runtime performance (in pure gdscript) of the most Geometry heavy operations.
I am more a UX oriented programmer by trade, so a thorough review or contributions via pull request from a good - performance savvy - game developer would be super helpful.
But you see, we all do this in our spare time, so thus far I have not found anyone willing.
If you ever feel enthusiastic about going through all this code I would love it!
Then again. I understand perfectly if you too, like most of us, do not have time for all that either.