Three.js WebGL2 uniform block objects


Some time ago, thanks to Michael Herzog I tested a very powerfull feature from WEBGL2 called Uniform Block Objects.

Is there any roadmap to include this feature in the core of official THREEJS code?

Best regards

The PR does still wait to be merged:

Some optimizations were done since our last discussion so you definitely want to use the latest code from the link. In any event, it’s better to state at github that you want this feature and a respective merge.

I’m afraid certain users doubt that intergrating UBO support will introduce a performance benefit for applications. It would be great if you can share some performance data at github to show them the difference.

HI Michael.

Which is the link with the lastest code, [r106]?

Sorry, I am not used to work with Pull Requests.

I guess that in the new code I have to change UniformBlock by UniformsGroup, is there any example about how to use it?

In my example with 200k instances I can guaranty that performance was near 20% faster using Uniform Blocks than using standard Uniforms.

Many thanks in advanced.

The PR contains an example that demonstrates the usage of UniformsGroup.

Oh, I’ve only asked to add a comment at github with your experiences, that’s all :innocent:

Hi Mugen.

My problem is that I cannot find the link with the latest code.

Could you send me the link?

Sorry for bothering you with this topic.

I will add my comment after testing the last version.

Best regards

Try this:

Or just download the repository from:

Many thanks

: )

Hi Michael.

First I have to say sorry for the delay but until now I had no time to test your branch.

I have downloaded your github branch as you told me:

But when I tried to execute your example I got an error.

It seems that the UniformsGroup is not recognized as a valid constructor:


Could you tell me if I have to download the three.js from other allocation?

Best regards

No problem^^.

Before using three.js you have to build it. You can do this by opening a console, go to the project’s root directory and then execute npm i and then npm run build.

It works.

I will give my feedback in short.

Best regards

1 Like

Hi Michael.

After adapting the code to the new library I get more or less the same performance than before.

I am going to try with a big scene and I tell you comparing with the previous.

Best regards