OpenGL to WASM, learning from my mistakes
9 comments
·March 1, 2025avianlyric
modeless
WebGL runs on the same machine but uses a very different path to the GPU. On Mac, OpenGL is deprecated and the implementation is very outdated and feature poor. WebGL is not deprecated, and uses the ANGLE library to run on top of Metal.
shooly
From what I know, OpenGL on macOS is internally implemented using Metal and supports more features than ANGLE.
ANGLE on macOS supports OpenGL ES 3.0 when running using Metal backend (source: https://github.com/google/angle), whereas macOS natively supports Core 4.1.
And from my experience, there is basically no difference in performance between Apple's implementation and ANGLE, especially for simple things like what the author is doing.
modeless
I don't have internal knowledge of Apple's implementation but it could potentially be layered on top of Metal for Apple Silicon (probably not for Intel) though if so it probably uses internal-only capabilities not exposed to Metal users.
OpenGL 4.1 predates OpenGL ES 3.0 by several years and has a different feature set which is not necessarily better depending on your application. Also the window system integration is neglected since it has been deprecated so long. It's a backwards compatibility feature and not intended for new development. Lack of KHR_debug and general bugginess makes it a poor choice for learning OpenGL or deploying software on.
linwangg
Nice write-up! Emscripten is powerful, but it can also be a nightmare. What was the most frustrating part of the whole process? Anything you’d do differently if you had to start over?
bobajeff
This page must be loading a webgl scene since it's making my poor mobile browser gradually unresponsive to my scrolling. Thankfully closed to page before it was to late.
rossant
Same. Consider putting the demo in a separate page.
theophinetheo
Same here, happened on my computer.
null
This is a very confusing article that doesn’t make much sense to me. The authors runs into performance limits on their laptop and states
> maybe it’s time to port this to the web and not my machine be a blocker for the demo.
So their solution is to port from C++ and OpenGL to WASM and WebGL. Last I checked WASM and WebGL all ran on the local machine, how on earth would porting to WebGL and WASM allow the author to make their “machine be a blocker for the demo”. They’re not changing any of the hardware involved, and they’re barely changing the technologies involved.