Doing hardware accelerated vector rendering has been something I’ve been interested trying for a long time so I spared a bit of time to get started with it this week. So far I’ve been able to render quadratic bezier curves in closed paths and ellipses which you can see in the screenshot below.
I’m still working on getting cubic beziers and stroked paths working but so far I’m very happy with the results. Because the curve is drawn using a pixel shader I never have to worry about zooming too far or having my polygon approximation of the curve be apparent which is currently the case with my gravity game. Also if you haven’t seen it check out masagin. Here’s a video if you don’t feel like downloading it, but you should because the video doesnt do it justice.
As far as I can tell he just approximates the curves with polygons and doesn’t use a shader to evaluate the actual curve. It still looks excellent but you can see that the curvature isn’t perfect when the camera zooms in really close on some of the elements. I’m working on parsing svg files at the moment so hopefully I’ll have some more examples soon, including the svg tiger.
Also here’s a zip with a few papers I’ve found if anybody else is interested in messing around with this stuff.
And alliteration in my titles. Made some more menus for my gravity game with some cool transitions. Sol’s interpolation tutorial was helpful but ultimately I didn’t end up using any of the methods he went over. Instead I used a pair of cascaded low pass filters. You can set the damping ratio and frequency and get a range of interesting behavior out of it.
Level select screen:
And the options menu:
And here’s a download link if you want to try it out:
And now I’ll go back to starting more projects I won’t finish and self aggrandizing, but that should be fairly obvious by this point if you’ve kept up with my blog.
It’s really late but I want to go ahead and post this since I never posted last week. So, I decided to add a main menu to the game I’m working on and I went ahead and made a quick mockup.
A few hours later after writing a good amount of code this is what it looks like in game.
The trail on the particle still isn’t quite right but I’m happy with how it turned out and the animation looks pretty slick. I may upload a build later so people can try it out. Also, I’d be suprised if anybody recognizes where I got the name from.