I’ve been looking into features that get unlocked when upgrading from WebGL to a WebGL2 context, such as:
Transform Feedback
Uniform Buffers
Multiple fragment shader outputs
Others I might be missing?
And was wondering if anyone had any recommendations for tutorials, courses, or articles that taught how to use them? Also, are any of these new features impossible to use with Three.js as of the latest build?
I’ll start: I found this Youtube playlist named “Fun with WebGL 2.0” that goes through tons of stuff. It has 140+ videos on all kinds of subjects. The only downside is that it uses vanilla WebGL2 instead of Three.js, but it’s still great to learn the concepts.
As far as I know non of those features are available to use in three.js, at the moment, but there have been some long standing PRs to add the functionality.
I believe there are other PRs, as well. WebGL2 has had a bit of a rocky rollout particularly with Apple still not supporting it on any of their browsers. I believe the plan is to wait until WebGL2 is supported everywhere before adding any WebGL2 specific features.
I asked a bit about this earlier last year and this was @mrdoob’s response:
I’m not sure if thoughts have changed at all since with WebGPU now on the horizon, though. It’s still crazy to me that Apple has stalled WebGL2 for so long. I’d really like to be able to use these new features, too.
AFAIK, a WebGL 2 implementation already landed in Webkit Nightly. So there is hope that WebGL 2 eventually lands in WebKit based browser. Unfortunately, I don’t know when this will happen.
@gkjohnson is right, none of the above techniques can be used with three.js right now. But as mentioned if the browser support gets better, stuff like MRT will definitely land in the engine.
Notice that WebGPURenderer is already based on UBOs so you get this feature right from the beginning.
Oh man. That’s big news! Can I Use lists that it’s available in the technology preview which is new. And I assume that means it’ll be available in IOS Safari, as well. Hopefully we’ll see it land in the next month or two!