WebGL difficulty

I’m new to unity, and programming in general, and wanted to ask about creating games for browsers.

When using unity is it any more difficult to create games for webGL?

I’m making a card game but thought it would be much more accessible if it could be played in a browser window.

The main constraint I see is memory, you are more restricted than Standalone version (because the Browser offers only a limited amount to your application).

The second contraint is the fact that the Graphic API is OpenGLES 3.0 (aka WebGL 2.0), which has some limitations compare to DX11. This is similar to the mobile APIs (iOS, Android).

This is subject to evolve a lot, with for example the new Vulkan API coming soon.

For the rest, you might have other limitations here and there but overall WebGL in pretty straight forward in Unity, I would recommand you to try it !

Also note that with WebAssembly (WASM) coming with Unity 5.6 (beta for now), the WebGL performances are being improve a lot ! Which is good for you.

On recommandation would be use the approach of asset bundles for download your assets progressivly AFTER your application WebGL is loaded in the browser, so your user don’t have to wait too long before interacting with your application.

1 Like

Thank you so much for your reply, it is very helpful. I will delve deeper when I’m at my desk later.

Just one question. From looking at the links I’m getting the impression that conversion to mobile platforms is pretty straight forward. Is that the case?

Yes. Unity is relativly agnositic of the platform.

Your code and content can be easily exported in any of the platform supported by Unity. Unity is taking care of each platform under the hood.

Still, you may face some bugs and somes limitations of Unity per platform, that you will have to handle by yourself :slight_smile:

And of course, each plaform has its reality: CPU/GPU strenght, GPU Api capabilities, cache miss cost, memory available, connectivity, TRC, etc.