Flixel was developed in a time whenÂ Flash capabilities were solely based on CPU. In order to display all thoseÂ sprites and effects on the screen, developers had to manipulate bitmaps, copying pixels from one place to another. Usually the pixels from each game asset are copied to a bitmap representing the screen, pretty much like a drawing buffer. That process is known as blitting.
Even thought Flash is really fast at copying pixels around, blittingÂ has lost its meaningÂ when game engines started to use the GPU to draw assets on the screen. A GPU is power friendly, which makes it aÂ better fit for mobile development, not mentioning that it is way faster than the CPU to draw things.
Lately we have been hard at work to bring Flixel Community to the GPU world, leaving the good old days of blitting behind. The current implementation, tracked under issueÂ #90Â on Github, is more of aÂ prototype than a final version,Â since no bigÂ optimizationsÂ were performed yet. Despite of that, the results are outstanding so far.
Below is a chart showing the BunnymarkÂ benchmarkÂ running the latestÂ dev version of Flixel Community, using a blitting and a GPU render (powered by Genome2D): As demonstrated the blitting render was able to draw between 500 and 1000 sprites simultaneouslyÂ before dropping the FPS rate. The GPU render, on the other hand, was able to draw up to 2500Â sprites before dropping the 30 FPS mark. Using the amount of 2500 bunniesÂ as a parameter, the GPU render performed 428% better than the blitting one.Â That is a huge performance gain!
Here’s an image ofÂ BunnymarkÂ using the GPU render: And here is the same benchmark using the blitting render: The new GPU render is being developed toÂ be a drop in replacement for the current blitting render. If everything goes as planned, developers will justÂ recompile their projects using the upcomingÂ Flixel Community version and the result should be GPU accelerated, no significant codeÂ modifications will be required regarding the drawing process.
Making Flixel Community GPU accelerated will be a huge boost for several developers. I hope you likeÂ this new featureÂ as much as we do