mrdoob / three.js

JavaScript 3D Library.
https://threejs.org/
MIT License
102.77k stars 35.38k forks source link

Fast Renderer for iPhone/iPad #549

Closed SunboX closed 12 years ago

SunboX commented 13 years ago

WebGL doesn´t work and the CanvasRenderer is very, very, very slow. I tried to do a simple panorama viewer (like the WebGL example but with CanvasRenderer), but it doesn´t work on iPhone (renders only one time, it´s too haevy).

But the krpano renderer runs smooth!

Should be possible, see here: http://krpano.com/tours/kuchlerhaus/html5only.html

http://krpano.com/krpanoiphone.js http://developer.apple.com/library/safari/#documentation/AudioVideo/Reference/WebKitPointClassReference/WebKitPoint/WebKitPoint.html

Is it possible to have a iPhone/iPad Renderer?

mrdoob commented 13 years ago

The example says that I need Safari or Chrome to see it. But I'm running Chrome... Anyway, I guess it uses CSS3D. Maybe a CSS3D Renderer could be useful for some cases. I wonder if WebGL will land on iPhone/iPad soon though.

SunboX commented 13 years ago

Try running it using an iOS or Android device. Works really great/smooth. I couldn't find a way doing this with three, but it's a simple 3D projection. I don't know how they're doing it. If it's really CSS3D, a CSS3DRenderer would be cool.

greetings André

mrdoob commented 13 years ago

On Android it's showing the same error... I guess it's only iOS?

SunboX commented 13 years ago

It works on iPhone 3GS. Maybe the feature detection isn´t the best. :/ But on an "old" 3GS it runns very smooth (fullscreen).

SunboX commented 13 years ago

On desktop Safari 5.1 it works, too. Tried it just now.

SunboX commented 13 years ago

Maybe this link is helpful for someone:

http://www.webkit.org/blog/386/3d-transforms/

And a CSS - 3D - Renderer written in JavaScript:

https://github.com/jlongster/dom3d http://hacks.mozilla.org/2011/08/rendering-3d-with-css-and-javascript-with-dom3d-guest-post/

rdzah commented 13 years ago

CSS 3d transforms would be wonderful as a rendering backend option, more uptake than webgl so far - http://caniuse.com/#feat=transforms3d IE10, FF10, android3.0+, ios demos here http://minimal.be/lab/Sprite3D/

vs webgl http://caniuse.com/#feat=webgl no ios/android/IE

mrdoob commented 13 years ago

This is how dom3d renders a teapot on chrome/linux:

http://twitpic.com/73emwt/full

It this how it's supposed to look?

garydot commented 12 years ago

this is great! but how can we useful 3d model data create the object model of the CSS 3d func, and interactive. (e.g. show of the 3d car)

SunboX commented 12 years ago

Someone should implement an Renderer like he did:

https://github.com/jlongster/dom3d

Or see my other links above. It´s not easy and way too difficult for me. :/

mrdoob commented 12 years ago

By the time the new renderer would be ready, Apple would have enabled WebGL on the iPhone/iPad... Just wait a bit more, WebGL is coming to mobile devices.

SunboX commented 12 years ago

Sure? I think there are reasons, Apple only enabled WebGL on small HTML5-Mobile-Advertise-Banners.

If you ask me, WebGL will not be enabled on iPhone 3GS or iPhone 4 (not enough power - take a look at Siri).

mrdoob commented 12 years ago

Well, that's something Apple would have to consider, otherwise some people would move to Android devices with WebGL support. At least that's how I feel things will turn out :P

Irrelon commented 12 years ago

WebGL should be able to run on an iPhone 3GS and certainly on an iPhone 4. Siri is a silly example because the processing isn't even being done on the phone anyway, all the phone is doing is streaming your voice audio to a server which then processes the request and sends back the response. Siri could run on a 3GS no problem... this is about selling new phones, not performance or compatibility.

Back to WebGL, both handsets have the technical capability to handle WebGL - think about it for a second... 3d games work fine via OpenGL through Obj-C... all we need is a pipe from the browser to the underlying hardware via OpenGL. It's a technical issue, not a performance one.

SunboX commented 12 years ago

Hi coolbloke1324,

your first statement isn´t right. I know a hacker group tried to backport Siri to iPhone 3GS. They could get it running, but it was so slow that they given up. So no Siri on Jailbroken 3GS ...

WebGL: I know that Safari Mobile "only" needs a good WebGL -> OpenGL pipelining to the render engine. But it hasn´t one and CSS3D works great ... I cant "update" Safari for better WebGL handling! :(

SunboX commented 12 years ago

once again, I know Siri sends all to a Server and logic happens there. But iPhone 3GS isn´t strong enought to run the Siri App at all ...

Irrelon commented 12 years ago

Hey Sunbox, sorry if that sounded rude, it wasn't meant to... not enough coffee, too much coding :)

I was referring to the fact that Siri actually existed as an app prior to the 4S and that it ran on all iOS devices - see http://techcrunch.com/2011/10/04/the-original-siri-app-gets-pulled-from-the-app-store-servers-killed/

I'm sure that since then, Apple have added to it in many ways and have made it slightly (or totally) incompatible with older models but the app itself at least used to run on the older devices. It's a real shame what Apple did but that's marketing for you!

Still, in regard to WebGL, I concur that the word "only" gets banded about just a little too much, it's "only" hardware accelerated 3d on a web page after all LOL :) I have no doubt that iOS Safari will support WebGL though... it is coming and I also agree with Ol' Doob that it would take longer to create a fully functional CSS renderer than it would to just wait for WebGL support.

Out of interest, do any other browsers have WebGL for iOS? I know that Firefox for Android does it.

Dino4674 commented 12 years ago

I am reading this and tried the example from fist post on iPhone4 and iPad2 and they both work perfectly. http://krpano.com/tours/kuchlerhaus/html5only.html.

@mrdoob : You say that it uses CSS3D. I don't know the background and how long would it take for you to make CSS3D renderer. But what do you think would work better on iOS, WebGL or CSS3D?

Because I don't see WebGL coming to iOS very soon.

mrdoob commented 12 years ago

WebGL. Lets wait what they do for IOS6. It's just some weeks away...

rdzah commented 12 years ago

Sry to beat a dead horse, but now that both ios6 https://devforums.apple.com/thread/153871?start=0&tstart=0 & android4.1 http://developer.android.com/about/versions/jelly-bean.html#browser have been shown not to have webgl, but both having hw accel css3d, any chance of merging the css3d render backend plugin from here as a start? https://github.com/unconed/CSS3D.js

thanks

SunboX commented 12 years ago

A CSS 3D renderer for iOS would really be cool :/

Dino4674 commented 12 years ago

Agree :)

alteredq commented 12 years ago

Sry to beat a dead horse, but now that both ios6 https://devforums.apple.com/thread/153871?start=0&tstart=0

Out of curiosity - could you please copy-paste relevant text snippet here? This link is accessible only for registered users.

Is there some official info from somebody from Apple or just people trying iOS6 beta? Not that I would expect it, just it would be nice to know what they tell about the thing.

E.g. here is what mobile Chrome devs tell about WebGL there:

It’s working internally. Issues are denial of service and GPU availability. There’s some work in Chrome OS to make it safer, and we’re looking at that right now to see if we can release it in a safe way. Some GPUs are more stable than others.

http://www.zdnet.com/blog/burnette/google-io-2012-android-fireside-chat/2637

mrdoob commented 12 years ago

Bah, I just denial-of-serviced me with 50.000 particles in a context2d canvas on a Galaxy Nexus (hard reboot).

alteredq commented 12 years ago

Haha, on Galaxy Nexus max reasonable number of particles is about 500.

I think I crashed Galaxy Nexus once or twice though I don't remember exactly how (could have been also Opera or Firefox).

Transformer Pad (Tegra 3), on the other hand, crashes on sneeze. So I kinda get the line about varying stability.

rdzah commented 12 years ago

@alteredq - thx for the google io link; here's the text you wanted - "* About features that are still not available in iOS 6 Beta 1

not official info, see original redacted blog post http://www.mobilexweb.com/blog/ios-6-beta-1-html5-native

alteredq commented 12 years ago

I'm curious - if I understood well on iOS WebGL is officially enabled for iAds - has anybody seen any 3D ads in the wild? Or for that matter, where you can see some iAds?

SunboX commented 12 years ago

One more thing, UIWebViews on Android 4.1 don´t (!) have the new Chrome Browser as Rendering Engine. UIWebViews still have the "old" Android Browser. Don´t know why, but it´s stupid. :( So no pseudo native App could have the "power" of the new Chrome for Android. :(

gunta commented 12 years ago

We should stop the talk and just implement it using Sprite3D.js as a backend.

Before I was waiting for Apple to support WebGL in Safari, but it seems Apple is NOT going to enable WebGL for web developers anytime soon, neither is Android going to have a good WebGL implementation on most of the devices.

mrdoob commented 12 years ago

As far as I can see, CSS3DRenderer is pretty much the same thing Sprite3D is. http://mrdoob.github.com/three.js/examples/misc_css3d.html