Added optimization for text where the colour alpha value is 0.0, returning early to aovid any GL calls.

This commit is contained in:
Robert Osfield
2017-10-25 16:29:25 +01:00
parent 248805fedd
commit fa58d01644

View File

@@ -1115,6 +1115,8 @@ void Text::drawImplementation(osg::RenderInfo& renderInfo) const
void Text::drawImplementationSinglePass(osg::State& state, const osg::Vec4& colorMultiplier) const
{
if (colorMultiplier.a()==0.0f || _color.a()==0.0f) return;
osg::VertexArrayState* vas = state.getCurrentVertexArrayState();
bool usingVertexBufferObjects = state.useVertexBufferObject(_supportsVertexBufferObjects && _useVertexBufferObjects);
bool usingVertexArrayObjects = usingVertexBufferObjects && state.useVertexArrayObject(_useVertexArrayObject);