Added explict call to state.applyModelViewAndProjectionUniformsIfRequired() when required for better GL3/GlES2 support.

This commit is contained in:
Robert Osfield
2017-03-16 15:46:51 +00:00
parent 5f407b3cc4
commit 44e303ad90

View File

@@ -1118,6 +1118,9 @@ void Text::drawImplementation(osg::State& state, const osg::Vec4& colorMultiplie
// ** apply this new modelview matrix
state.applyModelViewMatrix(modelview);
// workaround for GL3/GL2
if (state.getUseModelViewAndProjectionUniforms()) state.applyModelViewAndProjectionUniformsIfRequired();
// OSG_NOTICE<<"New state.applyModelViewMatrix() "<<modelview<<std::endl;
}
else
@@ -1249,7 +1252,9 @@ void Text::drawImplementation(osg::State& state, const osg::Vec4& colorMultiplie
if (needToApplyMatrix)
{
// apply this new modelview matrix
state.applyModelViewMatrix(previous_modelview);
// workaround for GL3/GL2
if (state.getUseModelViewAndProjectionUniforms()) state.applyModelViewAndProjectionUniformsIfRequired();
}
}