参考: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_FUNCS_AVAILABLE
if (!_state->getUseVertexAttributeAliasin

本文探讨了C++在osg::State模块中关于_useVertexAttributeAliasing特性的影响,该特性与OpenGL API的使用紧密相关。当启用此特性,将决定是否调用glColor4fv或glVertexAttrib4fv。同时,它也会对使用的默认着色器代码产生影响。
osg::State中_useVertexAttributeAliasing的作用&spm=1001.2101.3001.5002&articleId=119270604&d=1&t=3&u=191f0c89dc614571a231340ccb9d30bc)
3631

被折叠的 条评论
为什么被折叠?



