参考:openGL之API学习(一六七)默认着色器 顶点属性索引 别名索引
State::State():
Referenced(true)
{
#if !defined(OSG_GL_FIXED_FUNCTION_AVAILABLE)
_useVertexAttributeAliasing = true;
#else
_useVertexAttributeAliasing = false;
#endif
}
会影响具体调用哪个opengl函数,使用调用glColor4fv,不使用调用glVertexAttrib4fv,
osg/AttributeDispatchers.cpp
AttributeDispatch* AttributeDispatchers::colorDispatcher(Array* array)
{
return _useVertexAttribAlias ?
vertexAttribDispatcher(_state->getColorAlias()._location, array) :
_colorDispatchers->dispatcher(array);
}
osg/VertexArrayState.cpp
void VertexArrayState::assignVertexArrayDispatcher()
{
#ifdef OSG_GL_VERTEX_ARRAY_