![]() |
![]() ![]() ![]() |
|
![]() |
Full Screen Canvas | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
![]() |
![]() |
![]() ![]() |
|
Full Screen CanvasPosted on December 31st, 2015 23:12I may have gone a year without an update, but I'll be skippy if I go a full calendar year without one. Well, an update I actually announced, at least. I have still been doing Minecraft mods. With the year coming to a close, I'm reminded of the thing that has haunted me this past year -- and some of the previous, too, if the bills I've found for my various boards are any indication. ![]() Some of you (which I guess at this point is most of you who still come around here) may recognize the above image. It is NeaPUZZLEtan, my silly game about icecream that has been in development for the past couple years now. Well, it has been unreleased for the past couple of years, at least. There hasn't been much development done to it. And that's the problem. See, when I created Reality's End sixteen years ago, dial-up was still a thing. I targeted a niche market of low powered computers and connections that emphasized thought over flash (in more ways than one~!). Of course, nowadays, most people have a high-speed connection in their pocket (present company excluded) and multiplayer gaming pretty much has to have a real-time interactive component. Waiting for someone to respond to an email (which is itself an archaic medium) is ludicrous. I, of course, know this. It is why I just wrote it, genius. I've also known this for quite a few years. That's why I hopped aboard the HTML5 bandwagon years ago. See, HTML5 finally offered an alternative to Flash: Canvas. It was an entirely JavaScript and browser-based approach that did not require an external plugin like Flash or Java do. It was guided by standards, was entirely open, and based on a language I already knew and admired. Of course, it also sucked. Early canvas had terrible performance. The major browsers have remedied this in recent years, but one of the biggest selling points of canvas was still missing: mobile. It was said to be a great cross-platform development target, but a canvas application could get below five frames per second on a mobile device. It is a strange thing to move into the future while simultaneously spiting the flagbearer of new tech. The Chrome mobile browser at least seems to have finally slain that beast, but there was one other pain point: Embedded. Getting a high FPS on a desktop isn't good enough for me. Low-powered single-board computers should also be able to get in on the fun. It is mostly just graphics anyway, right? And most of these boards have some pretty decent GPUs on them, so why shouldn't they be able to power through Canvas? Really, why shouldn't they? Because they couldn't. I have been trying everything for the longest time to get a decent display out of any development board, and I have quite a few. GPU accelerated HTML5 canvas remained some sort of a holy grail, and I couldn't quite find any solution which would generate a decent frame rate. Good framerates are easy with embedded, of course, but framerates tank once Canvas comes into the picture. Even drawing a single rectangle and nothing else could slow things to a crawl. Qt (which, as far as I'm concerned, is only useful for display server-less browsers and even then grudgingly) released their WebEngine officially this year. It is essentially a Chromium browser. After a few (read: not a few) distractions early on, I was finally able to get back to it and get it building on all of my boards I cared about, but I still wasn't seeing the performance I wanted. It was slightly better, but still not good. I then made the following discoveries:
Seriously, I've thought I've had something wrong with my Pis forever. My Model B worked fine when powered off of my old motherboard, but it wasn't flying with my new one for my Haswell at all, nor with any power adapters I purchased. Finally, I tried the supply from a Hummingboard I had lying around (that's an MX6 part, folks -- a monster that requires 2A) and that worked. And that is what this little entry is all about: the above image. That is a grab from NeaPUZZLEtan running on my new RaspberryPi2. It is actually being stretched out to fill up my entire widescreen TV, but grabbing the Canvas pixels doesn't relate this. Regardless, it is getting 30 FPS -- which is exactly what I have the game clocked at. Yes, all it took was using the most popular hobby board (instead of those freaks I usually use -- I'm looking at you, Ci20 Creator!) and then powering it with one of the least popular hobby board's supplies. To think of all the time I spent in graphics libraries and WebKit code. Now I'm free to create input device drivers for joysticks wired to the headers. That's all I ever wanted. And I really wanted it, too. I don't know if people realize just how much time I've spent delving into embedded these last way-too-many months. Now, all that time has become free. Even if I want to use something else -- say, trying to benchmark my Odroid and its stupid propriety and hard to find graphics libraries -- I can always give up and fall back to my Raspi, since I know it works. This going to be a huge time and headache saver for me. I wonder what I'm going to do with all my time and headaches now... |
|
Copyright © 1999-2022 |