UPdated from OpenSceneGraph-Data with handling of non textured text decoration
This commit is contained in:
@@ -243,7 +243,7 @@ Font::Font(FontImplementation* implementation):
|
||||
setImplementation(implementation);
|
||||
|
||||
char *ptr;
|
||||
if( (ptr = getenv("OSG_MAX_TEXTURE_SIZE")) != 0)
|
||||
if ((ptr = getenv("OSG_MAX_TEXTURE_SIZE")) != 0)
|
||||
{
|
||||
unsigned int osg_max_size = atoi(ptr);
|
||||
|
||||
@@ -251,6 +251,14 @@ Font::Font(FontImplementation* implementation):
|
||||
if (osg_max_size<_textureHeightHint) _textureHeightHint = osg_max_size;
|
||||
}
|
||||
|
||||
if ((ptr = getenv("OSG_SDF_TEXT")) != 0)
|
||||
{
|
||||
_glyphTextureFeatures = GlyphTexture::ALL_FEATURES;
|
||||
}
|
||||
else if ((ptr = getenv("OSG_GREYSCALE_TEXT")) != 0)
|
||||
{
|
||||
_glyphTextureFeatures = GlyphTexture::GREYSCALE;
|
||||
}
|
||||
}
|
||||
|
||||
Font::~Font()
|
||||
|
||||
@@ -104,6 +104,13 @@ char text_sdf_frag[] = "$OSG_GLSL_VERSION\n"
|
||||
"\n"
|
||||
"void main(void)\n"
|
||||
"{\n"
|
||||
" if (texCoord.x<0.0 && texCoord.y<0.0)\n"
|
||||
" {\n"
|
||||
" osg_FragColor = vertexColor;\n"
|
||||
" return;\n"
|
||||
" }\n"
|
||||
"\n"
|
||||
"\n"
|
||||
" float near_fade_away = 2.0;\n"
|
||||
" float far_fade_away = near_fade_away+5.0;\n"
|
||||
"\n"
|
||||
|
||||
Reference in New Issue
Block a user