Hello Everyone,
Here is what I have so far when it comes to rendering a model with glsl
glsl->setUniform( "Ka" , material.ambient );
glsl->setUniform( "Kd" , material.diffuse );
glsl->setUniform( "Ks" , material.specular );
glsl->setUniform( "mat_shine" , material.shininess );
glBindVertexArray( vao_id );
glDrawArrays( GL_TRIANGLES , 0 , vertices.size() );
glBindVertexArray( 0 );
This works fine for a single material applied across the entire model.
However, I now import an .obj model with various materials from Blender. After mapping triangle faces to material ids I am unsure how the above call to
glDrawArrays( GL_TRIANGLES , 0 , vertices.size() ); needs to change in order to render more than one material on a single model.
Any help would be great appreciated,
Mike