Search Unity

  1. Get the latest news, tutorials and offers directly to your inbox with our newsletters. Sign up now.
    Dismiss Notice

WebGL in mobile phones.

Discussion in '2021.1 Beta' started by Steven_Damian, Mar 14, 2021.

  1. Steven_Damian

    Steven_Damian

    Joined:
    Mar 1, 2021
    Posts:
    65
    WebGL support for mobile phones would be a game changer. I mean i can already load my projects into mobile phones and i just comment the line in the html to remove the warning. The problem is with the decompression. When trying to load my brottli compressed builds it gets stacked at 90% for about 5 seconds. Making the decompression faster or anything else that would increase the loading speeds, will be a game changer for sure.
    Any thoughts/solutions please? Thank you.
     
    Inter-Illusion likes this.
  2. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    7,642
    In theory Tiny should reduce build size but is still in development and may not have all the features your game needs.
     
  3. jRocket

    jRocket

    Joined:
    Jul 12, 2012
    Posts:
    569
    It would be nice to have, but I hardly think it would be a game changer. It's not like people are going to flock from app stores to playing games on webpages. The big problem is that textures are all uncompressed on the GPU because Unity doesn't use mobile compatible texture formats for the WebGL platform. Until that gets sorted out, I think its better to use a native JS engine like Babylon if you need mobile web support.
     
  4. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    7,642
    So all that would be needed is a WebGL build with browser/platform specific texture image sets for PC and Mobile.

    Surely that would be very easy to add?
     
  5. jRocket

    jRocket

    Joined:
    Jul 12, 2012
    Posts:
    569
    You would think, yes. It's been discussed in the WebGL forum, but I haven't seen any progress. There is also a bunch of boat in Unity in general, but much of that can stripped out in the package manager. A basic project with no physics, animation, ect should load fast-ish, even on mobile. The problem I usually see on mobile is people trying to load a bunch of large textures and levels which isn't a good idea for mobile by itself, more so if those textures are going to end up uncompressed because mobile hardware doesn't understand dxt. Also, Apple has been willfully negligent in adding support for WebGL 2.0, which may further limit you.
     
  6. Steven_Damian

    Steven_Damian

    Joined:
    Mar 1, 2021
    Posts:
    65
    Okay. So to sum up, if the loading times get smaller with webgl and the mobile support becomes better, do you guys see a new era of opportunities forming ?
     
  7. jencleary

    jencleary

    Joined:
    Oct 4, 2018
    Posts:
    2
    I think if WebGL ran on phone browsers it would certainly be a miracle for me. My game is a fun friends and family football pickem' app and it was rejected by Apple last NFL season because it was 'simulated gambling' - even though no money was involved I couldn't get it through testflight. Currently I have no way for my players to put their picks in on an iphone or ipad, which most of them have. They have to either get an android device or find a computer tower or laptop to make their weekly picks on my webGL version. I don't have a very high opinion of Apple right now, seems like there are plenty of big name developers that make real gambling apps - yet they will say 'no' to me because I'm an indy developer. I don't live close enough to many of my family to download it on to their phones...which I could do if I was near them, but I am not...plus covid. I was hoping to use Unity Tiny but it doesn't seem to be supported...and I would need the UnityWebRequest to handle all my PHP and SQL database which wasn't in Unity Tiny the first time I looked at it. Still would like to use Unity, but am at a crossroads.
     
    Last edited: Mar 30, 2021
unityunity