From 26e34241958576c26dfb219ff9ea1e7f5c1f983f Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 22 Aug 2006 12:33:35 +0000 Subject: [PATCH] Changed the default implementation of backdrop text to DEPTH_RANGE and tweaked the depth range values to minimize the depth rage witout causing z fighting on osgtext example. --- src/osgText/Text.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/osgText/Text.cpp b/src/osgText/Text.cpp index b2a6d21c9..365ae822e 100644 --- a/src/osgText/Text.cpp +++ b/src/osgText/Text.cpp @@ -46,7 +46,7 @@ Text::Text(): _kerningType(KERNING_DEFAULT), _lineCount(0), _backdropType(NONE), - _backdropImplementation(POLYGON_OFFSET), + _backdropImplementation(DEPTH_RANGE), _backdropHorizontalOffset(0.07f), _backdropVerticalOffset(0.07f), _backdropColor(0.0f, 0.0f, 0.0f, 1.0f), @@ -2088,13 +2088,14 @@ void Text::renderWithDepthRange(osg::State& state) const if (!transformedBackdropCoords.empty()) { state.setVertexPointer( 3, GL_FLOAT, 0, &(transformedBackdropCoords.front())); - glDepthRange(0.01f + ((max_backdrop_index-backdrop_index)/1000.0f), 1.0); + double offset = double(max_backdrop_index-backdrop_index)*0.003; + glDepthRange( offset, 1.0+offset); glDrawArrays(GL_QUADS,0,transformedBackdropCoords.size()); } } - glDepthRange(0.0, 0.982); + glDepthRange(0.0, 1.0); drawForegroundText(state, glyphquad); }