Ejecta – A Fast, Open Source JavaScript, Canvas and Audio Implementation for iOS
impactjs.com
impactjs.com
http://zrusin.blogspot.com/2006/07/hardware-accelerated-poly...
https://github.com/phoboslab/Ejecta/blob/master/Source/Eject...
btw do you have any numbers on how bezie drawing using OpenGL compares to regular drawing on 2d canvas, performance wise?
let's say I have an html5 app which draws stuff using 2d canvas. do you think it makes sense to draw to webgl instead using implementation like yours, i.e. mapping 2d canvas api to webgl?
How does it hold up with many overlapping shapes of varying color; wouldn't it lead to far more state changes and ultimately much greater fill-rate?
And what are your thoughts on using this for font rendering?
This looks brilliant. Thanks for the info.
Needs benchmarks to be able to make any decisions.
If you're doing WebGL stuff, I would encourage you to get the current Ejecta dev version from Github, instead of the last release version. There have been a lot of WebGL related bugfixes since: https://github.com/phoboslab/Ejecta
Ejecta uses OpenGL ES 2 for Canvas, not Core Graphics.
The default demo that comes with Ejecta[1] runs with 60fps on the iPhone4S. Just try it in Mobile Safari. Even Desktop Browsers struggle with this. Of course it's a contrived benchmark, but it still makes a point, I think :)
There are also a lot of other reason to use Ejecta. If you _want_ to distribute your App in the AppStore, the alternative is to use a WebView framework such as PhoneGap, which can't use JIT either. That said, the raw JavaScript performance is rarely the bottleneck for games - most of the time, drawing is.
Company 100, Inc. maintains a patch to WebKit that use OpenGL to implement canvas. It is not yet merged, but I have tried it and it is significantly faster than stock WebKit for game scenario. So I have no trouble believing Ejecta is faster.
The JavaScriptCore API is private on iOS,
which means you're not allowed to link to it.
Ejecta therefore comes bundled with its
own version of the library to circumvent these
restrictions.
So you are basically using another VM(a second javascript core) in an IOS app. Isnt it forbidden to do so,running VMs in IOS apps?A better approach would be to do like TITANIUM ,except that you expose a CANVAS like API,so that your javascript canvas framework is compatible with it => less work,and no trick that would make your app kicked out of the store once the scheme is busted.
Here's a story from when the change was made: http://allthingsd.com/20100909/apple-hands-app-developers-an...
The current terms read:
3.3.2: An Application may not download or install executable code. Interpreted code may only be used in an Application if all scripts, code and interpreters are packaged in the Application and not downloaded. The only exception to the foregoing is scripts and code downloaded and run by Apple's built-in WebKit framework.
Edit: Sorry, just realised the development is done in Objective-C.
As I mentioned in another thread, I currently have a toy project that implements most of the Canvas2D API in plain C. Maybe this will amount to something some day.