Vexator
08-05-2006, 06:32 AM
while reading through sample shaders by ati, nv and several tutorials, i realized that a lot of people give access to normals, texture and light positions coordinates through custom attributes instead of using the built-in attributes.
i wanted to see if it makes a difference, so i tried myself:
glEnableClientState( GL_NORMAL_ARRAY );
glBindBuffer( GL_ARRAY_BUFFER, m_uiNormalsId );
glNormalPointer( 3, GL_FLOAT, 0, 0 );
...
glBindBuffer( GL_ARRAY_BUFFER, m_uiNormalsId );
GetShader()->SetAttributeArray( "a_Normal", 3, 0 );now, using a simple phong shader, i get same results when using a_Normal instead of gl_Normal.. so what's the advantage/difference when using custom attributes although there are built-in alternatives?
i wanted to see if it makes a difference, so i tried myself:
glEnableClientState( GL_NORMAL_ARRAY );
glBindBuffer( GL_ARRAY_BUFFER, m_uiNormalsId );
glNormalPointer( 3, GL_FLOAT, 0, 0 );
...
glBindBuffer( GL_ARRAY_BUFFER, m_uiNormalsId );
GetShader()->SetAttributeArray( "a_Normal", 3, 0 );now, using a simple phong shader, i get same results when using a_Normal instead of gl_Normal.. so what's the advantage/difference when using custom attributes although there are built-in alternatives?