I am planning a small project targeting html5 using box2d and a fair amount of code-generated vector shapes.
Now coming from the classic Air / Starling world, I am wondering how openfl handles vector graphics.
Are they somehow converted to textures, or are they drawn as pure vectors in canvas, which, I’d guess would not be too performant.
What is the general concept when using runtime-created graphics regarding performance?
Thanks a lot.
In my personal experience, how does openfl handle vector graphics? Badly.
Most of the times, the webgl render dies on me if I draw too many vectors. (Literally dies, screen goes black and an error saying that the glcontext was lost)
So what is the usual course of action ?
Use starling and textures?
Or does openfl handle textures without starling as well?
As far as I am concerned, starling on openfl no longer provides a boost in performance (like it did in old school flash). You can still use it though if you are more familiar with it but I don’t know how to batch render there since I have never used it.
Best performance is achieved by doing batched render, in raw openfl there are two ways: You use the Tilemap class or you draw everything to a single displayobject with drawquads.
Tilemap is structured similar to the Display List (instead of addChild you do addTile) and solves a lot of transformations for you.
If you are familiar, I think haxeflixel uses drawquads and their own display list for rendering, so that could be a good approach too.
(If I am too confusing please ask again and I will try to elaborate better )
thanks a lot, its not too confusing.
However, I guess I still would need to do a full structured tutorial for all of openFL’s features to fully grasp the concepts.
My main concern with what I need to do is performance and the ability to not have to deal with all the different resolutions too much, since that is always a royal pita. …
I guess haxeflixel is somehow the starling for openFL, right?
OpenFL has two render paths – software and hardware.
Using vector shapes hits the software render path most of the time – we have plans to change this
OpenFL does accelerate the display list, though. Our software path is considerably slower than Flash Player (mostly due to using HTML5 canvas) but the hardware path is going to be somewhat like Starling, since both are hardware accelerated.
HaxeFlixel is more like Flixel or another game engine