Add support for generating outline and signed distance field channels in a RGBA packed GlyphTexture Image.

This commit is contained in:
Robert Osfield
2017-09-08 16:59:43 +01:00
parent 77d4705182
commit de47eb3666
5 changed files with 292 additions and 64 deletions

View File

@@ -494,8 +494,10 @@ void Text::computeGlyphRepresentation()
osg::Vec2 maxtc = glyph->getMaxTexCoord();
osg::Vec2 vDiff = maxtc - mintc;
float fHorizTCMargin = 1.0f / glyph->getTexture()->getTextureWidth();
float fVertTCMargin = 1.0f / glyph->getTexture()->getTextureHeight();
float texelMargin = 4.0f;
float fHorizTCMargin = texelMargin / glyph->getTexture()->getTextureWidth();
float fVertTCMargin = texelMargin / glyph->getTexture()->getTextureHeight();
float fHorizQuadMargin = vDiff.x() == 0.0f ? 0.0f : width * fHorizTCMargin / vDiff.x();
float fVertQuadMargin = vDiff.y() == 0.0f ? 0.0f : height * fVertTCMargin / vDiff.y();