[osg-users] How to disable Antialiasing of an osg::Text

Robert Osfield robert.osfield at gmail.com
Thu Mar 2 10:39:00 PST 2017


HI Lv,

osgText::Text renders into a 3D scene using OpenGL, which is quite
different than Qt rendering to a 2D window where font resolutions can
exactly matched to the pixels on screen, so you can't really compare
the two.

osgText::Text itself doesn't implement anti-aliasing, anti-aliasing is
a property of the GraphicsWindow that you've created.  For the
blurriness you reporting it's unlikely to be an high level
anti-aliasing issue.

My guess is that it's more likely an issue of undersampling of the
glyph texture (magnification) if the size of glyph on screen is lower
than the font resolution, or possible magnification if the glyph on
screen is smaller than the font resolution.  A 1:1 ratio will likely
minimize these effects.

You don't provide any guidance on how you are rendering so I can't
provide any more details than this.

Robert.

On 2 March 2017 at 17:41, Lv Qing <donlvqing at msn.com> wrote:
> Hi,
>
>     In linux we are using  osg::Text to display some chinese characters.Then
>  we find the  osg::Text looks a little blur when the size of characters is small.Or,the Black characters  seems a little gray when the character size is small.I have setFontSolution(128,128),it not help.
>
>    Then I fond our old app which using QT to draw text,and with the same font,QT text looks better than  osg::Text.
>
>    I fond QT use QPaint to loading font and drawing text ,and It can enable or disable Antialiasing of text  like below.
>
>
>
> Code:
> class Q_GUI_EXPORT QPainter
> {
>     Q_DECLARE_PRIVATE(QPainter)
>     Q_GADGET
>     Q_FLAGS(RenderHint RenderHints)
>
> public:
>     enum RenderHint {
>         Antialiasing = 0x01,
>         TextAntialiasing = 0x02,
>         SmoothPixmapTransform = 0x04,
>         HighQualityAntialiasing = 0x08,
>         NonCosmeticDefaultPen = 0x10
>     };
>
>
>
>
>      So my question is ,does osg can  enable or disable Antialiasing to an osg::Text?
>
>
>
>
> ...
>
> Thank you!
>
> Cheers,
> Lv
> Code:
>
>
>
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=70395#70395
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



More information about the osg-users mailing list