When working on the webgl2 renderer, there're two features we could use to improve the performance as usually we're CPU-bound. One if Vertex Array Objects (VAO) and the other one is Uniform Buffer Objects. While VAO could be used on WebGL1 too via extensions, UBO can't, so we could just implement it on the webgl2 renderer.
As it will require lot of changes, it could be nice to benchmark first how good it will perform and specially try to identify which level of granularity when choosing the blocks are we aiming for, as it will have impact on the code's complexity and performance.
Hi, coming from this twitter thread: https://twitter.com/mozillareality/status/978696743276699648 :) My experience with new WebGL2 features is a bit of a mixed bag performance-wise, some are specific to WebGL2 vs GLES3, but many also apply to GLES3 or GL in general.
I've been doing smaller cross-platform things, with the HTML5 side covered through cross-compiled asm.js / wasm, and rendering backends WebGL/WebGL2, GLES2/GLES3, GL3.3, D3D11 and Metal, so I have a pretty good way to compare performance and design strategies across platforms and 3D APIs.
Most features that WebGL2 adds over WebGL (new texture types, new renderable pixel formats, etc...) work well.
Things that I hoped would help were disappointing though:
Here are a few blog posts with more detailed infos of my WebGL2 experiments:
Cheers!
-Floh.
Just my 2 cents. Commercial engine I wrote, UBO was fine but it was vs uniforms. Never tried to compare with uniform arrays. Regarding VAO. I had to port from GLES2 to ES3 and I can confirm ,I hadn't noticed any gain vs direct vertex buffer binding neither on ios nor android. But I guess it can depend on a number separate buffer objects you bind.
We're refactoring our material system by introducing node base material system. I think it's good to start to think of UBO after we finish the refactoring.
Regarding VAO, I made the PR #14600. You can test. And feedback is welcome.
Most helpful comment
Hi, coming from this twitter thread: https://twitter.com/mozillareality/status/978696743276699648 :) My experience with new WebGL2 features is a bit of a mixed bag performance-wise, some are specific to WebGL2 vs GLES3, but many also apply to GLES3 or GL in general.
I've been doing smaller cross-platform things, with the HTML5 side covered through cross-compiled asm.js / wasm, and rendering backends WebGL/WebGL2, GLES2/GLES3, GL3.3, D3D11 and Metal, so I have a pretty good way to compare performance and design strategies across platforms and 3D APIs.
Most features that WebGL2 adds over WebGL (new texture types, new renderable pixel formats, etc...) work well.
Things that I hoped would help were disappointing though:
Here are a few blog posts with more detailed infos of my WebGL2 experiments:
Cheers!
-Floh.