Improved WebGL 2 Performance

Hey everyone!

I’m excited to share that I’m currently in the process of porting my diamond renderer to Babylon JS. The reason for this is that Babylon JS supports the latest WebGL 2, which is necessary for https://sevenxsports.com/

Currently, with each diamond, I’m required to send a lot of uniforms, which has become a bottleneck on WebGL 1. However, with Babylon JS, I’m hoping to take advantage of the uniform buffer support to streamline this process and improve performance.

I’m wondering if anyone has experience using the uniform buffer in Babylon JS? Is there anything specific I need to keep in mind, or are there any examples I could reference?

Thanks in advance for your help!

Welcome aboard!

The standard and PBR materials use a uniform buffer by default, so if you use these materials, ubo support will come right out of the box. You can even augment them with your own code through material plugins, and your additional settings will also become part of the uniform buffer.

Uniform buffers are also supported by ShaderMaterial, if you need to write a custom shader from scratch.

2 Likes