Current WebGL limitations

I’ve just begun publishing to WebGL. I see the Chrome and Firefox requirement is only with Unity’s implementation. When can we expect additional browser support? And and full feature support like realtime GI and substances? One of the hurdles i’ve faced with the Webplayer is that it wasn’t seamless, some browser’s worked better than others and you needed to install the viewer. I’m looking forward to all of the pieced being in place. Thanks.

Actually Safari already works well at this point (with the exception of fullscreen, joystick and mouse lock support, which Safari does not have). IE works, but without Audio, which Microsoft is fixing. I hope that we will support realtime GI at some point in the course of this year, not so sure about substances.

It was mentioned in anothervthread, but just wanted to make sure: PlayerPrefs are not supported currently right?

As I just wrote in the other thread: They should work - backed on the IndexedDB local storage.

whoopsy, looks like i got it wrong. What about WebPlayer? we are using the same code path for both to store key/value pairs. Maybe we should use PlayerPrefs in WebGL then.

I’m glad to hear about the additional browser support. Realtime GI would be nice, and I only mentioned substances because they were mentioned in the blog as a restriction. I can easily use the exported maps. So It sounds like I can publish the WebGL content without a disclaimer (this will only work on… ) as long as I don’t use sound, full screen or mouse lock?

Wait… Just tried my test scene on IE11, it works in the end but I get the error in the screenshot below. Then the Audio API error. Can you remove the ‘Not Supported…’ message. That will stop users from continuing. And actually, refreshing the page to get another look at the errors, the Audio API error does not come to the front. So I don’t see the error and cannot proceed. I’ll have to test safari on my wifes mac :confused:

Also, I had a bear of a time getting the WebGL content to work on my Host’s server. I’ll start a seperate thread/bug report for that.

Web Player also supports PlayerPrefs, but using a different mechanism, so you cannot read prefs written by the web player in webgl or vice versa.

You can remove this by editing the UnityConfig.js. We will not remove it by default until we can claim “proper” support in IE (which is clearly not the case without audio).

Negative on Safari. I got the compatibility error and then it recommended I use Firefox. Started loading and never got there. My test project does contain mouse lock code, and the template I used provides the fullscreen option. Would having that code in my project prevent it from loading? Throw errors? or just not include those features?

As a disclaimer, I don’t know anything about my wife’s mac, safari, or whether or not 72 open tabs played a part :confused:

I have searched the docs but haven’t found anything considering cache. Does WebGL support cache like Web Player did? Because my game has a lot of stuff in bundles and using Web Player my players downloaded the files only once and it was stored in their cache so they didn’t have to redownload whole parts of the game every time they opened it. If that’s not the case with WebGL is there some workaround for it?

You have to actually enable WebGL first. Then it works.

–Eric

Browsers do cache JavaScript if you serve the files with the correct HTTP headers

But that’s browser cache, which is limited to 1 gb or less(out of total browser cache which includes videos, images etc. so it get’s rewritten pretty fast) depending on the browser. Web Player had dedicated cache which got saved to your local storage and got loaded by request. I guess IO is not possible with WebGL and therefore there can’t be dedicated cache like with the Web Player. This things should have been mentioned in the docs, and I think there should be some workaround for this.

Yes, In that case there isn’t much you can do (I think). HTML5 storage is less than this so the browser cache is most likely the biggest you can get.

Not to mention, that PlayerPrefs get stored in the IndexedDB, which gets deleted when people Delete their cookies and other site data, where PlayerPrefs in the web player were safe if the user switched browsers, cleared their cache, or deleted cookies.

Our company is moving all our web games that require saving to cloud storage, its the safest way to alleviate this issue and opens us up to cross platform data sharing.

Actually, In Safari 8, WebGL is enabled by default. In earlier versions, it is a hidden development option.

Yes, unlike people wrote here, AssetBundle caching using WWW.LoadFromCacheOrDownload is supported in WebGL (where it will be backed by IndexedDB storage). However, since, unlike the Web Player, we don’t control this, it is upon the browser to decide how much storage you get, when to clear it, and whether it will ask the user for permission to store the data. Different browsers have different policies here. Also unlike the Web Player, we no longer require a special license to use this feature.

I thought so, but I have Safari 7 so I wasn’t completely sure.

–Eric