Added support for toggling on use of the new SignedDistanceFunction function now built into osgText, just use --sdf to enable.

This commit is contained in:
Robert Osfield
2017-09-21 15:52:07 +01:00
parent a1f519cbec
commit 12904105f8

View File

@@ -184,11 +184,6 @@ osg:: Node* createTextLeft(const osg::BoundingBox& bb, const std::string& label,
text->setFont(font);
text->setFontResolution(110,120);
if (s_useSDF)
{
text->getFont()->setGyphTextureFeatures(osgText::GlyphTexture::ALL_FEATURES);
text->setBackdropImplementation(osgText::Text::USE_SHADERS);
}
text->setAlignment(osgText::Text::RIGHT_CENTER);
text->setAxisAlignment(osgText::Text::XZ_PLANE);
@@ -198,17 +193,23 @@ osg:: Node* createTextLeft(const osg::BoundingBox& bb, const std::string& label,
//text->setColor(osg::Vec4(0.37f,0.48f,0.67f,1.0f)); // Neil's original OSG colour
text->setColor(osg::Vec4(0.20f,0.45f,0.60f,1.0f)); // OGL logo colour
text->setText(label);
text->setBackdropType(osgText::Text::OUTLINE);
text->setBackdropOffset(0.03f);
text->setBackdropColor(osg::Vec4(0.0f, 0.0f, 0.5f, 1.0f));
if (s_useSDF)
{
text->getFont()->setGyphTextureFeatures(osgText::GlyphTexture::ALL_FEATURES);
text->setBackdropImplementation(osgText::Text::USE_SHADERS);
}
text->setColorGradientMode(osgText::Text::OVERALL);
osg::Vec4 lightblue(0.30f,0.6f,0.90f,1.0f);
osg::Vec4 blue(0.10f,0.30f,0.40f,1.0f);
text->setColorGradientCorners(lightblue, blue, blue, lightblue);
text->setText(label);
geode->addDrawable( text );