一、StateSet中有些是把属性类提取出设置,有些是用setMode设置,让我混乱了,是不是所有使用glEnable的都使用setMode设置?就来探索下吧!
二、void StateSet::setMode(StateAttribute::GLMode mode, StateAttribute::GLModeValue value)
从源码上看,mode 被分成了三类:
1. 纹理 mode
2. GL_COLOR_MATERIAL
如果mode==GL_COLOR_MATERIAL,即使glEnable(GL_COLOR_MATREIAL)了,如果osg::Material没有做相应的设置,纹理的颜色一样不被glColor影响。所以用setMode来设置GL_COLOR_MATREIAL没有意义。
3. 其他的mode
成员变量_modeList记录所有的mode。