- Our First OpenGL Rendering
- from OpenGL Programming Guide: The Official Guide to Learning OpenGL, Version 4.3, Eighth Edition
- Publisher: Addison-Wesley Professional
- Released: March 2013
It seems each VAO can be thought of as an ordered collection of N vertices. All vertices have K attributes, where K can be arbitrary chosen (ie. describe each vertex with as many attributes as you need. Typical attributes include position, colour, normal, texture Coordinate, material, and so on.)
How to specify the K attributes values of our N vertices? Two steps: 1) Specify each of the K attributes in our vertex shader as input variables. 2) For each attribute i / shader input variable, use glVertexAttributePointer to provide i values of all vertices. Essentially mapping shader input variable i to a buffer containing values [V1.i, V2.i, .. VN.i]
Concerns: 1) What ha...
Share this highlighthttp://www.safaribooksonline.com/a/opengl-programming-guide/4781/