4

I'm planning on rendering multiple instances of a single model by modifying various uniform variables (such as location, rotation, et al.).

Is there a better way then modifying the uniform variables for every instance I want to render?

1 Answer 1

4

For instanced rendering you can use the ARB_instanced_arrays extension. With this extension you can define your not-so-uniform variables in a standard vertex array, and with the glVertexAttribDivisor function you can fine tune when the not-so-uniform variable change.

Sign up to request clarification or add additional context in comments.

1 Comment

As a side note, instanced arrays have been made core in OpenGL 3.3. And even before that you could still use instanced rendering (which is core since GL 3.0 or 3.1, I think). You just have to store the per-instance parameters in a uniform array/buffer and access them using the special shader variable gl_InstanceID.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.