Best practices with Vertices in Open GL

Posted by Darestium on Game Development See other posts from Game Development or by Darestium
Published on 2012-07-14T11:08:25Z Indexed on 2012/10/26 17:22 UTC
Read the original article Hit count: 347

Filed under:
|
|

What is the best practice in regards to storing vertex data in Open GL? I.e:

struct VertexColored {
    public:
        GLfloat position[];
        GLfloat normal[];

        byte colours[];
}

class Terrian  {
    private:
        GLuint vbo_vertices;
        GLuint vbo_normals;
        GLuint vbo_colors;
        GLuint ibo_elements;

        VertexColored vertices[];
} 

or having them stored seperatly in the required class like:

class Terrian  {
    private:
        GLfloat vertices[];
        GLfloat normals[];
        GLfloat colors[];

        GLuint vbo_vertices;
        GLuint vbo_normals;
        GLuint vbo_colors;
        GLuint ibo_elements;
}

© Game Development or respective owner

Related posts about c++

Related posts about opengl