WebGL for Mobile Devices

Hi Community,

does anybody know when it will possible to export WebGL with Unity5.0 for Mobile Devices like e.g. in CopperCube? A customer asks for it and unfortunately we have to constantly deny him again and again.

Thanks,
Matthias

1 Like

It’s not supported for Unity 5.0. Mobile support for WebGL isn’t really advanced enough yet.

–Eric

It’s strange, is WebGL Browser, or Unity use something extra?

So it is in development now?
When do the UnityCommunity get profit of it?

There’s nothing special that needs to be done from Unity side. Problem is, mobile browsers at this point of time aren’t really ready for WebGL games. Sure, you might get a simple scene running with a spinning cube, but anything more advanced will make your run out of memory in no time. Remember, you’re executing your game in JavaScript, rather than native code, and that considerably increases hardware requirements. That’s why we’re saying it’s not officially supported at this point in time.

That’s definitly wrong! You are able to get quite good VR solutions in WebGL from other Authoring Tools than Unity3D. Even the low cost Tool “Coppercube” is able to do so! But Unity3D is awesome (inclusive a very good community) and we don’t want to change because of the not running WebGL export.

1 Like

There are probably engines out there which handle the use case of WebGL on mobiles better then Unity does right now, by simply being more lightweight then we are, and less demanding in terms of memory and raw performance (and also more limiting). That said, I am certain that it will only be a matter of time until Unity WebGL on mobile becomes feasible, as hardware gets faster. As written before, other then a warning in JS (which you can easily disable), there is nothing preventing you from trying on mobiles now. Simple stuff should work, but it is usually pretty quick that you will reach the limits of the device.

Hi Jonas,

yes I understand. But why isn’t running WebGL at all on Mobile Devices exported from Unity3D?
We just would like to explore a technical device (little more than a cube).
It should run on a LMS,without any plugin and not as an app (so WebGL is the only option).

We don’t do anything to stop it from running. What is the error you are seeing?

[JavaScript-Anwendung]
--------------------------------
Please note that Unity WebGL is not
currently supported on mobiles. Press Ok if
you wish to continue anyways
Abbrechen OK

My mobile: Samsung Galaxy S5
So anybody has done something …
We not at least (I hope so :wink:

“Press Ok if you wish to continue anyways.” - did you try pressing ok and then continue playing the game?

Yes, we did — crashed in Firefox App on the mobile.
Abbrechen (Abort) loads the player and chrashes afterwards.

Using the default Chrome Browser the WebGL is starting and does nothing.

Well, if your browser crashes, then that is an issue with your browser :slight_smile:

In practice, the most likely issue you will face on mobile is the browser running out of memory. You can try building with a lower memory size in WebGL Player Settings. Also, Try building with the latest 5.0b19, and not with 5.0b9.

We would like to download 5.0b19.
But here:

the latest full tested version is the 18.

b18 should be fine. you can also take the “last release with minimal testing”, which is at b20 now. In either case, b9 is very outdated by now, so you should update to one of those.

Hi Jonas,

below you find a CubeTestProject.zip where a little scene with a rotating cube is inside.
The Project was made new with b20.
Maybe you look inside and give a hint which export settings are wrong.
The WebGL Export does not work on my Samsung Galaxy s5.

BTW: Why is a WebGL demo of a rotating cube such big (30 MB)?

1923104–124171–CubeTestProject.zip (635 KB)

It works fine on my iPhone 5s. But, as I said before, the biggest issue on mobiles is memory constraints, so you should try decreasing the memory allocation in the WebGL player settings to be less then the default 256 MB.

Read the the Unity 5.0 documentation, it has a section on WebGL build size. If your web server is properly configured, it will only serve the files in the “Compressed” folder, which are only 5.5 MB for your project - and if you enable stripping that number goes down a little more.

Danke Jonas,

einmal in deutsch :wink:
Werde dann in englisch weiterschreiben, damit alle es lesen können.

Viele GrĂĽĂźe aus Bremen,
lg Matthias

Sorry, but I have decreased the 256 to 128 and it did not work on Samsung Galaxy 5S and also not on iPhone.
Would you please send an Internet URL where you have published the WebGL out of my Project I sent you?
And would you please send me back the project with the right settings?

Thank you. You are very pleased!

That was really good :wink: I have deleted the Data Folder and the WebGL ran. So the compressed folder was used. Very good issue because of the package width.

I did not change anything at all, i just built your attached project (non-development build), and loaded it on my iPhone 5s. That said, earlier iPhones might not be able to load it. IIRC, my previous iPhone 4 would crash if I set the WebGL memory size to more 64MB (which is really not enough to do anything more then a spinning cube).