From Farshild Lashkari, "Attached is a simple patch that avoids the depth write pass in Text::renderWithDelayedDepthWrites if the current osg::State object has GL_DEPTH_TEST disabled."

This commit is contained in:
Robert Osfield 2011-09-13 09:21:07 +00:00
parent 43483408f3
commit 6d1ba5b06d

View File

@ -1601,6 +1601,12 @@ void Text::renderOnlyForegroundText(osg::State& state, const osg::Vec4& colorMul
void Text::renderWithDelayedDepthWrites(osg::State& state, const osg::Vec4& colorMultiplier) const
{
// If depth testing is disabled, then just render text as normal
if( !state.getLastAppliedMode(GL_DEPTH_TEST) ) {
drawTextWithBackdrop(state,colorMultiplier);
return;
}
//glPushAttrib( _enableDepthWrites ? (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) : GL_DEPTH_BUFFER_BIT);
// Render to color buffer without writing to depth buffer.
glDepthMask(GL_FALSE);