Greetings,
after reading several OpenGL documentations I understand that glVertexAttribPointer takes a numeral value between 1 and 4 for its second parameter (size) as information how many vertices are taken into consideration to render a single triangle. But I do not understand how to use other then three vertices for a triangle. Also trying different values and seeing the result doesn't help me.
What exactly does this do and what is it used for?
Cheers,
Jan
glVertexAttribPointer - understanding the size attribute
Started by nonsenseinc, Nov 18 2012 04:28 AM
2 replies to this topic
Sponsor:
#3 Members - Reputation: 1088
Posted 18 November 2012 - 01:18 PM
For example, you might have an attribute with 2 as size for texture coords, or a size of 4 if you need x,y,z,w coords (which you will eventually). Moreover, it doesn't needs to be juts coordinates, you could store color in with 4 components in RGBA form (red, green, blue, alpha).
You can additional information besides the position of a vertex.
You can additional information besides the position of a vertex.
Edited by TheChubu, 18 November 2012 - 01:23 PM.
My journal: Making a Terrain Generator






