[osg-users] osgText - alignment differences using the new implementation

Glenn Waldron gwaldron at gmail.com
Thu Feb 1 09:47:53 PST 2018


Robert,

I've been working with your new osgText implementation. The improvement in
quality is great, especially with outlines and SDF!

I did notice something interesting however. The GREYSALE and SDF shader
techniques yield different extents when you call Text::getBoundingBox().
Since I use the bounding box to align elements on the screen, this became
immediately obvious when switching to the new osgText code.

Here is a simple program you can use to validate:
https://pastebin.com/WhFsQSMT

In the "osgtext" example, you can also see a wider margin in the alignment
box when using SDF vs. GREYSCALE.

The SDF technique uses a non-zero glyph texel margin, which I believe
accounts for this difference. That got me wondering whether the various
AlignmentType techniques ought to be compensating for this extra margin as
well.

Your thoughts? Should the two techniques be drawing at the same location?

Glenn Waldron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20180201/8f849347/attachment.html>


More information about the osg-users mailing list