Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualBrother Bob

Posted 22 July 2013 - 11:59 AM

You'll likely also want to implement GL_ELEMENT_ARRAY_BUFFER(for indices) in combination with GL_ARRAY_BUFFER.

 

As was said, GL_ARRAY_BUFFER is generic and can hold many types of info including color.  In the following instance the array that's being passed to the VBO has 4 "types" being passed in.  The first 3 floats are the position, the next 3 are tangents, after that 3 for biTangents, the last 2 are the texCoords.

 

You could also put 4 more in there for color, 3 more for normals or whatever, it's totally generic and user defined.  I'm not sure off hand what the attribute limitation is for the various levels of hardware.  You'd want to check on that for your target platform before getting too carried away with packing various whatever's in there.

In this light, GL_COLOR_ARRAY seems redundant so far as understanding it goes.

//==============================================================================================================================

 

GLfloat facing_UP[] = { //number of vertices = 294 -6.3995, 0.00457, 2.50083, 0,1,01, 0, 0, -0, 1,

....

....

....

};

 

//==============================================================================================================================

  #include   "facing_UP.c"   //<-This is the array shown above   glGenBuffers(1, &facing_UP_VBO);     glBindBuffer(GL_ARRAY_BUFFER, facing_UP_VBO);     glBufferData(GL_ARRAY_BUFFER, sizeof(facing_UP), facing_UP, GL_STATIC_DRAW);     glBindBuffer(GL_ARRAY_BUFFER, 0);

//==============================================================================================================================


#3marcClintDion

Posted 22 July 2013 - 03:24 AM

There is far too much arrogance and out right abuse by site moderators, they are teaching other people to behave this way.  The posts I've made will all be shorty removed and replaced with this notice.  Game development is not the only thing being taught here, bad behavior is being taught as well.


#2marcClintDion

Posted 08 July 2013 - 05:32 AM

You'll likely also want to implement GL_ELEMENT_ARRAY_BUFFER(for indices) in combination with GL_ARRAY_BUFFER.

 

As was said, GL_ARRAY_BUFFER is generic and can hold many types of info including color.  In the following instance the array that's being passed to the VBO has 4 "types" being passed in.  The first 3 floats are the position, the next 3 are tangents, after that 3 for biTangents, the last 2 are the texCoords.

 

You could also put 4 more in there for color, 3 more for normals or whatever, it's totally generic and user defined.  I'm not sure off hand what the attribute limitation is for the various levels of hardware.  You'd want to check on that for your target platform before getting too carried away with packing various whatever's in there.  

In this light, GL_COLOR_ARRAY seems redundant so far as understanding it goes.

//==============================================================================================================================

 

GLfloat facing_UP[] =
{
     //number of vertices = 294

-6.3995, 0.00457, 2.50083, 0,1,01, 0, 0, -0, 1,

....

....

....

};

 

//==============================================================================================================================

        #include    "facing_UP.c"    //<-This is the array shown above                                                                                                           
        glGenBuffers(1, &facing_UP_VBO);                                                                                                
        glBindBuffer(GL_ARRAY_BUFFER, facing_UP_VBO);                                                                                                
        glBufferData(GL_ARRAY_BUFFER, sizeof(facing_UP), facing_UP, GL_STATIC_DRAW);                                                                    
        glBindBuffer(GL_ARRAY_BUFFER, 0);  

//==============================================================================================================================


#1marcClintDion

Posted 08 July 2013 - 05:28 AM

You only need the GL_ARRAY_BUFFER type, and also GL_ELEMENT_ARRAY_BUFFER for indices. 

 

GL_ARRAY_BUFFER is generic and can hold many types of info including color.  In the following instance the array that's being passed to the VBO has 4 "types" being passed in.  The first 3 floats are the position, the next 3 are tangents, after that 3 for biTangents, the last 2 are the texCoords.

 

You could also put 4 more in there for color, 3 more for normals or whatever, it's totally generic and user defined.  I'm not sure off hand what the attribute limitation is for the various levels of hardware.  You'd want to check on that for your target platform before getting too carried away with packing various whatever's in there.  

In this light, GL_COLOR_ARRAY seems redundant so far as understanding it goes.

//==============================================================================================================================

 

GLfloat facing_UP[] =
{
     //number of vertices = 294

-6.3995, 0.00457, 2.50083, 0,1,01, 0, 0, -0, 1,

....

....

....

};

 

//==============================================================================================================================

        #include    "facing_UP.c"    //<-This is the array shown above                                                                                                           
        glGenBuffers(1, &facing_UP_VBO);                                                                                                
        glBindBuffer(GL_ARRAY_BUFFER, facing_UP_VBO);                                                                                                
        glBufferData(GL_ARRAY_BUFFER, sizeof(facing_UP), facing_UP, GL_STATIC_DRAW);                                                                    
        glBindBuffer(GL_ARRAY_BUFFER, 0);  

//==============================================================================================================================


PARTNERS