Search Unity

  1. We want you to join us at GDC this year! Take a peek at all of the events we will be hosting during the week of GDC.
    Dismiss Notice
  2. Tell us about your experience here and you’ll get early access to the 2018 Game Studios report + more goodies.
    Dismiss Notice
  3. Unity 2017.3 has arrived! Read about it here.
    Dismiss Notice
  4. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice
  5. We've closed the job boards. If you're looking for work, or looking to hire check out Unity Connect. You can see more information here.
    Dismiss Notice

WebGL mobile isn't supported because of incompetence

Discussion in 'WebGL' started by StaffanEk, Jan 24, 2018.

  1. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    361
    Unity WebGL for mobiles isn't supported because it doesn't run well enough on mobiles. WebGL doesn't run well enough because Unity doesn't support S3TC and ETC2 compression in WebGL which leads to too much texture memory use for WebGL mobile, which isn't a problem since Unity WebGL isn't suppoted on mobiles, because it doesn't run well enough on mobiles. WebGL doesn't run well enough because Unity doesn't support S3TC and ETC2 compressio.......... etc.

    Why won't Unity just support mobile texture compression and stop bending the truth about the tech not being mature enough. Play Canvas has fixed this in 2016. It's 2018, and Unity still can't fix this.
     
    Last edited: Jan 24, 2018
    Gaurav-Gulati likes this.
  2. summerian

    summerian

    Joined:
    Jul 6, 2014
    Posts:
    76
    Well, to be honest it must be more than just texture compression. If I create a single scene with just a cube and a light in it the build will still crash on mobile. Sometimes it will work though, so not entirely sure what's going on. I'd wish that Unity would work on mobile browsers but as it is I have resorted to Cocos Creator.
     
  3. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    361
    It will work on just about any mobile phone if you set the available memory to something like 80 instead of the default 256.
     
  4. summerian

    summerian

    Joined:
    Jul 6, 2014
    Posts:
    76
    I have previously tried using 64 and it would still randomly crash. Is 80 mb a magic number in this case?
     
  5. jRocket

    jRocket

    Joined:
    Jul 12, 2012
    Posts:
    366
    There's probably differences between phones. I was able to get my somewhat simple game project running WebGL on my Galaxy Note 5. I think the memory was set to 64 or 80. To get it that low I had to optimize my game a bit- namely keeping texture sizes low and crunched, making sure that managed modules are stripped(physics is the big one), and making sure that inactive gameobjects are destroyed instead of turned off.

    Of course there are a whole lot of other issues like audio/video not working.
     
  6. summerian

    summerian

    Joined:
    Jul 6, 2014
    Posts:
    76
    That’s weird. I have a simple scene where I only add a cube. That’s all. I don’t know how I could create a simpler scene. I have tried all kinds of player settings to get it to not crash.

    I’ve tried iPhone SE, 6, 6s, 7 and a 10. For Android I’ve tested on Samsung galaxy S6 to 8.

    All the same behavior. Sometimes it runs other times it crashes.

    If you actually got a game running I’d really like to know all your player settings. I feel like I’m missing an important switch.
     
  7. kognito1

    kognito1

    Joined:
    Apr 7, 2015
    Posts:
    135
    I believe webassembly was broken for mobile safari in like 11.2.1 or something, not sure if it has since been fixed. You'll have much more luck trying Android. IIRC our nexus 9 does okay (all things considering) running our content but has a showstopping input bug. Having said all that, I agree having an ETC2 texture option for webgl would be nice. I doubt it will be the game changer though.
     
  8. jRocket

    jRocket

    Joined:
    Jul 12, 2012
    Posts:
    366
    Does that cube have a box collider on it? If so, its bringing in the physx engine. If you remove the collider, it should strip the managed physics code out.
     
  9. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    361
    I don't know what to tell you I got a fairly complex scene working from iPhone 6 upwards, and on all regular phones aswell.
     
  10. summerian

    summerian

    Joined:
    Jul 6, 2014
    Posts:
    76
    About 1 mb was stripped and it actually did seem to make it more stable. So thanks for that tip.
    I could still get it to crash if I reload the browser five or six times but I wouldn't say that's and issue.

    It's too bad that I can't use the build in physics but it's definitely a step in the right direction.

    Thanks again.
     
  11. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    962
    I highly appreciate every discussion about Unitys unsatisfying WebGL support.
    My clients ask for WebGl and I have to look for Sketchfab/Playcanvas programmers.....
    It´s a shame. That simple.
     
    Daemonhahn likes this.
  12. summerian

    summerian

    Joined:
    Jul 6, 2014
    Posts:
    76
    If you have to support mobile and your game is 2D only I'd recommend Cocos Creator until Unity starts working on mobile browsers. It's very Unity like in many aspects. I'd much rather work with Unity but I'm forced to do otherwise for now.
     
  13. Daemonhahn

    Daemonhahn

    Joined:
    Oct 5, 2013
    Posts:
    374
    take a look at godot.
     
  14. summerian

    summerian

    Joined:
    Jul 6, 2014
    Posts:
    76
    Godot creates too big builds for webgl.

    Last time I looked (v.3 beta) it was 25 mb just for the engine.
     
    Daemonhahn likes this.