Sign in to follow this  

Vertex arrays + colors

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

This topic is 4843 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this