WebGL

Unity5 WebGL support means that you can build games that are run in your browser without a plugin, using the WebGL library, right? But my question is, how are that games build? As HTML5? As Javascript? How?

I think there’s some confusion on your terminology here, but I’ll be as clear as possible to map those to what is really happening.

What Unity WebGL export does is cross compile code (the unity engine C++ code and all C# scripts and bindings), utilizing the javascript api’s for HTML5 features and WebGL.

We use a special subset of JavasScript which go by the name ā€œasm.jsā€, which allows for great performance (but not as fast as native, and thus plugins) in the browser. Currently only Firefox directly supports optimizations for asm.js, but asm.js javascript code runs everywhere (but slower in browsers that don’t support it).

1 Like

I’ve read that asm.js will run at around 50% of native speed. Assuming this is correct what approximate speed does the javascript run at in browsers that do not support asm.js?

@TransporterGuy Where have you read this? Link would be appreciated.

This Unity blog mentions 50% frame rate. To be honest the graphs pretty much answer my question.