Jump to content
  • Advertisement
Sign in to follow this  
programBoy

Vertex arrays + colors

This topic is 5150 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

When I'm using vertex arrays, and the for example 4 vertices are red, the other 4 vertices are green. If I put that then in an array, there are 4 times the same color called. Isn't that a bit waste of time? And how's that exactly with texture coordinates?

Share this post


Link to post
Share on other sites
Advertisement
I'm not sure what you mean about texcoords, but yeah you have to duplicate the colors in the array. Basically, for one api call such as glDrawElements(), it's all or nothing. Either you have the color array activated and you submit a color for each vert, or you deactivate the color array and set an overall color with glColor**(). So it's not really a waste of time. The api doesn't care whether the colors are the same or different - it's going to access them in the array either way.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!