Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Unity 5 WebGL == mobile browser support?

Discussion in 'General Discussion' started by AntiLunchBox, May 19, 2014.

  1. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    Hey all,

    As I understand, Unity 5 will support WebGL. Now does that basically mean HTML5 support? From what I see, a lot of browsers don't support WebGL... especially mobile browsers. So is it really that great an option? I obviously like the idea, but it doesn't seem to be great for mobile web. iOS devices seem to disable WebGL by default-- so is this just replacing a barrier with another?

    Would love to get some insight here, I don't know much about HTML5/WebGL.

    Thanks
     
  2. Graham-Dunnett

    Graham-Dunnett

    Unity Technologies

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    Yes, WebGL and HTML5 are used to refer to the same thing - running Unity content in a browser without requiring a plugin to be installed. This is high on our list of needs given that Google is going to stop the Unity plugin from running inside Chrome at the end of the year. It's considered "the future" since many gamers don't like the idea of installing some plugin that they don't understand.

    You might want to ask Apple what their view is about WebGL support on mobile Safari. I suspect they are a bit unsure about it, given that they may not want 3d games running on their devices without being marshalled through the AppStore. (And the 30% they take.)
     
    schetty likes this.
  3. SiegfriedCroes

    SiegfriedCroes

    Joined:
    Oct 19, 2013
    Posts:
    569
    I actually tested the Angry Bots WebGL version on my Samsung Galaxy Note 8 and even though it didn't run perfectly it did actually run and that's totally awesome!
     
  4. triLight

    triLight

    Joined:
    May 7, 2014
    Posts:
    30
    Thanks Graham and DSSiege for clearing that up, I was about if the new export unto WebGL would be sustainable on the Mobile Platform/Device. Also I always had though HTML5 was an upgrade to the HTML language and that WebGL was a rendering library for HTML or other net languages. Though I believe the question remains about its position on its deployment status.
     
  5. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    And I'm assuming Unity can't build out without WebGL? I've definitely seen HTML5 games work on mobile Safari, but seems like WebGL is a no go.
     
  6. DallonF

    DallonF

    Joined:
    Nov 12, 2009
    Posts:
    620
    HTML5 has devolved into little more than a buzzword meaning "relatively modern browser features". So I'm grateful UT decided to be more precise and call it WebGL to refer to the actual technology that it's using.

    As for mobile browsers, lol no. Here's a page that shows browser support for WebGL. iOS and Android are the two big red bars. (Chrome for Android, however, does have it, which is kind of cool)
     
  7. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    As pointed out, HTML5 is often used as a rather broad term referring to modern browser technologies (of which WebGL is one) in general.

    Could we make a version of Unity which uses HTML5 technologies but does not require WebGL? Not if we want to do hardware accelerated 3d graphics. Possibly we could make a subset of our 2D features work using canvas or css features, but then what would be left would be a very feature-reduced "Unity" (which might still have it's uses though).

    However, I think the more interesting path lies in actually running WebGL on mobile. It is true that it is not yet supported on the majority of mobile browsers - with iOS being the biggest platform with official options to support it, for Android, there are several browsers which have it. But, personally, I am convinced that it is only a matter of time until we will see a wide adoption of WebGL on mobile browsers.
     
  8. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    HTML5 doesn't refer to HyperText Markup Language version 5 like you think it would - it's a specification for a variety of technologies, some of which explicitly involved in the specification, like XHTML or whatever they are calling it now, CSS 3, Canvas and so on, and some kind of 'grey area' technologies like WebGL, which isn't automatically assumed to be implemented in any browser claiming to meet the HTML 5 specification

    If you're talking 3D and HTML5 however you'd be referring to either CSS 3's 3D, which is NOT appropriate for the kind of paradigm Unity works under, and WebGL, which is and happens to equate to the current, latest OGLES spec - So a mobile phone appertaining to the specification could in a perfect world be equivalent to the WebGL spec. That's my understanding of it anyway. It's not a perfect world however and many browsers and hardware manufacturers do love to play fast and loose with specifications but generally you could expect firefox and chrome to keep a pretty respectable adherence to the specification - go to the #webgl room on irc.freenode and you'll get to talk to lots of people who know a ton about it all and can be a massive education. I was lucky enough to talk to both firefox engineers and this guy http://codeflow.org/ a couple of years back on the subject and i'm tempted to go back some time soon, especially when webgl becomes back as a concern of mine which it inevitably will do.

    Making not-for-profit performance intensive games makes WebGL a no brainer for anyone with a decent internet connection

    I'd like to point out that WebGL can run fine on some, if not all, android mobile phones, mine for eg is fine with it iirc, as is my previous and also my partners. Apple are being typically irritating and closed on the matter. Just like iOs supports OpenCL but only Apple can use it, similarly, bizarrely, apparently WebGL is functional for iAds but not their mobile browsers.

    I am hoping Apple change their attitude or are simply letting everything mature until letting the peons have at it, but for now I find WebGL for Unity in regular edesktop browsers the exciting thing and while it may take a while to fully develop, it's a great move that i'm very happy about. I've mentioned potential problems in usability on this forum before and I hope Unity both mention it as a consideration and also provide answers for it but that aside it's great. And may well run on your android phone if you have an expensive one
     
  9. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Oop Jonas beat me to most of the punches - Jonas has there been any discussion about documentation or a service for dealing with any CORS related problems? With WebGL as a platform it would/should be almost trivial to stream in content from another domain using traditional web methods and something a lot of people might try, and get a headache with, as soon as it doesn't work and they're not sure why not.
     
  10. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    I should add that, while I do see WebGL on mobile as something which will happen in the future (I think that is pretty much inevitable), it is *not* a use case we will support in Unity 5.0.
     
  11. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    I think adding some documentation for CORS would make sense, even if it would just be linking to public guides or specifications on the topic.
     
  12. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Oops sorry hasty trigger finger
     
  13. TylerPerry

    TylerPerry

    Joined:
    May 29, 2011
    Posts:
    5,577
    Does that mean touch isn't supported? Or just its performance is not fast enough(The demos were pretty slow on Intel HD4000 and 0fps on GT19100)
     
  14. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    I was wondering if there was some existing service or UT could provide one for simply adding necessary headers to requests during-flight. Making the innately web-natured characteristics of WebGL a selling point of the platform for Unity could bring about some powerful features that are already well documented pretty much everywhere, not just Unity's scripting API. Stuff like being able to bring in content from your own storage using web methods rather than unity's WWW, that storage being anywhere - it's very flexible. Even using other HTML5 specs even in the 'grey area' like WebRTC that naturally 'fit in' with WebGL would be impressive.

    I suppose I wonder if WebGL will be used simply as a basis by which to function as normal within a browser, or you'll be allowing devs to use the full flexibility implied by using WebGL to leverage other parts of the HTML5 specification

    So in fact when you say 'Unity is implementing HTML 5' that's actually a much bigger deal than people seem to realise
     
  15. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    Currently it means both. Adding touch support probably isn't hard (and could be done by users as well, we allow calling into js functions directly from script code in WebGL), but we don't see it as a viable platform yet, so we'd rather focus on getting WebGL as polished as we can for desktops for 5.0.
     
  16. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    While the HTML5 stuff we expose directly to the scripting API will probably be limited (at least in the beginning), you can do whatever you want by calling js functions from your game code. For instance I wrote a little wrapper library (which i plan to share) for using WebSockets from C# in your scripts to allow networking in WebGL, by just implementing wrappers around the corresponding HTML5 APIs. And all this can be perfectly done on the user level, by anyone.
     
  17. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    That's exactly what i wanted to read aha, i guess really it's not so much a matter of Unity implementing things within its own API, but giving users the freedom to use the platform's strengths within Unity themselves - you gave a great example. Would you be able to, say, have an overlay to where the main game rendering was drawn called from c# in the game (Typical to your example) to establish a video chat via webRTC drawn where you specified? So assuming webRTC is browser supported (Quite sure it is now, in Firefox and Chrome) then by publishing to WebGL you can very easily implement something like that?

    Would the game's output be an element as flexible as any other in the pages' DOM?

    That would make Unity the most powerful WebGL 'editor' going if there's minimal overhead as far as I know? That would justify the license fee considerably for many things
     
  18. TechnicalArtist

    TechnicalArtist

    Joined:
    Jul 9, 2012
    Posts:
    736
    any update?
     
  19. Kolovrat

    Kolovrat

    Joined:
    May 5, 2014
    Posts:
    17
    Does anyone have some experience with WebGL on mobile browsers? Does Unity WebGL game work in mobile browser?I've tried to open Angry bots demo on my tablet(both iPad and Android) but didn't have luck.
     
  20. Zinov

    Zinov

    Joined:
    Jul 20, 2015
    Posts:
    38
    WebGL is still a not good choice for mobile. Look at the topic. 2 years have passed. They are still feeding us this "open and cloudless" "html5" future. Pathetic.