Jump to content
  • Advertisement
Sign in to follow this  
Aliii

Changing offset in VBO after object instances

This topic is 1669 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I want to draw the same object many times, but with different colors. In one VBO I have the vertex positions, in an other VBO I have the colors. (So if I want to draw 10 instances from the object, the color-VBO has 10 times as many elements as the first VBO.)

 

So I would need to change the offset in the color-VBO after every instance. Is it possible without vertexAttribPointer? ....or any expensive state change? Thanks!

Share this post


Link to post
Share on other sites
Advertisement

glColorPointer takes a pointer, or with VBOs, treats it as an offset to start from, so you could vary that to the offset of the color you want.

Share this post


Link to post
Share on other sites

glColorPointer is deprecated, and is an expensive state change.

Im looking for something like instanced rendering but sort of the opposite.

Edited by Aliii

Share this post


Link to post
Share on other sites

Are you quite sure that issuing a glVertexAttribPointer call is an "expensive state change" (as you say)?  Have you actually profiled this and determined that this is a bottleneck for you, or are you pre-emptively optimizing?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!