PDA

View Full Version : OpenGL/WebAssembly vs. WebGL



AugustoAlvarez
10-30-2017, 09:03 PM
This might be a stupid question since I'm just now diving into this stuff, but please bear with me.

Would it be useful to directly compile OpenGL to WebAssembly for use in the browser? Would this bring any significant performance benefits in very dynamic environments (i.e. many draw calls)?

Are people generally satisfied with using WebGL or is it limiting since it is only a subset of OpenGL (based off OpenGL ES 2.0 specification) instead of the complete OpenGL API? I can't seem to find a clear answer online. Some people like using WebGL and others don't.

Basically, would it be useful/feasible to use OpenGl compiled to .wasm for use on the web instead of WebGL.

I really appreciate any responses, please enlighten me!

GClements
10-31-2017, 05:53 AM
Basically, would it be useful/feasible to use OpenGl compiled to .wasm for use on the web instead of WebGL.
No. WebGL is the only way that you can use the GPU from the browser. Compiling e.g. Mesa to WebAssembly (or asm.js) will produce something that runs entirely on the CPU, and that will be slower than using the GPU even if WebAssembly has equivalent performance to native code.