That's pretty neat! An unfortunate side effect is that running Mobile Safari unsigned negates the 'dynamic-codesigning' entitlement, which means that Nitro is disabled.
That said, a WebGL-enabled UIWebView running in your own app will also not be Nitro-enabled. I've run the PhiloGL spinning world demo on my device and it's running at 40fps, so simpler demos may be possible without a Nitro to boost things a bit.
Just as a reminder, if you link against any private api or framework in and app and submit it to the App Store, your app will be denied. You may get lucky and have your app slip through, but expect that at any time it will get removed from the store.
Given that WebKit has support for WebM, I wonder how much work it would take to do the same kind of hack to enable WebM support for the video tag? (More, I suspect, since iOS probably doesn't ship the required libraries.)
I feel the same. I would love to understand a bit more of what is going on under the hood. I did a quick research but I could not find something quick enough to work as a primer.
As an iOS developer I feel that native apps will have a technical edge for a while. WebApps are built with tools that weren't designed for creating GUIs, you can do it but it is much less efficient and effective. This is especially true for complex applications like games (the ones that would benefit the most from webGL).
I put some video going through few WebGL enabled websites and it's looks very promising http://vimeo.com/31644717 The JavaSript performance itself for example in mesh building is really terrible. Trying to benchmark it against Nitro in normal Mobile Safari would be a good thing to do.
I just tried running the code in an iPhone 4 with iOS 4.3.5 - got a invalid selector (_setWebGLEnabled). Worked just fine with an iTouch 4gen with iOS 5 though... Has anyone tested this on a device with iOS 4.2+?
hey atnan, great article, very insightful, congrats.
Seems like Apple has put a lot of effort on improving UIWebviews, there is more than just Nitro, apparently.
I strongly believe the whole HTML5 standard is supported on iOS5 but it has to be enabled. Did anyone notice the SQLite database that's created everytime you use a UIWebview? I've been trying to enable offline navigation and got kinda stuck but this gives me a couple of good new ideas.
I does work on MobileSafari but not on UIWebviews. There's a key called "WebKitOfflineWebApplicationCacheEnabled" that's automatically set to YES but it doesn't seem make any difference. I'm trying to find out why, but for that I need to go down to the dungeons of Apple's private frameworks and there is where I'm struggling at the moment.
Cat's out of the bag, may as well make public my experiment to enable WebGL on all webviews: https://github.com/rpetrich/WebGLEnabler