diff --git a/src/osgText/Text.cpp b/src/osgText/Text.cpp index fdd31f8ab..514cb271e 100644 --- a/src/osgText/Text.cpp +++ b/src/osgText/Text.cpp @@ -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);