ElChupacabra
ElChupacabra

Reputation: 1091

Update VBO or use uniforms?

Let's say I've got hundreds of rectangles on my scene. Each of them is changing each frame:

How should I do it to get the best performance? There are my ideas. Please help me choose which is the best of them or suggest something else:

The main question actually is: which functions can I call as many times as I want and which I should avoid calling more than few time per main loop?

Upvotes: 0

Views: 1632

Answers (1)

Etay Meiri
Etay Meiri

Reputation: 356

Usually the model remains the same in its local space so you only need to upload it once to the VBO. Changes such as translations, rotations, scaling, etc are performed by loading corresponding transformation matrices into uniforms and using them in the shaders.

Upvotes: 2

Related Questions