[osg-users] Please test OpenSceneGraph-3.6 branch in prep for 3.6.1

Daniel Emminizer, Code 5773 dan.emminizer at nrl.navy.mil
Tue Apr 24 04:41:23 PDT 2018

Hi Robert,

This looks much more crisp and easier to read both in the modified osgtext example and in our end application.  The difference is night and day.  Thanks for taking a look at this.

I am currently testing the OSG_GL3_FEATURES change for defaulting version to 3.3, and still plan to have a PR in the next hour or two once my builds finish.

 - Dan

-----Original Message-----
From: osg-users [mailto:osg-users-bounces at lists.openscenegraph.org] On Behalf Of Robert Osfield
Sent: Tuesday, April 24, 2018 7:22 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Please test OpenSceneGraph-3.6 branch in prep for 3.6.1

Hi Daniel,

On 23 April 2018 at 20:46, Daniel Emminizer, Code 5773 <dan.emminizer at nrl.navy.mil> wrote:
> I also added a status display text to the lower left that is similar to something we're doing in our HUD.  In arial you can see the text bouncing.  If you press "2", it changes between Times and Arial:
> - Times looks worse than Arial with a drop shadow, at the same font 
> size
> - You can see the fading effect in Arial as the text moves left and 
> right
> You can also toggle the lower-left corner's drop shadow using the "1" key.  The intent is to demonstrate that the shifting text is not due to the shadow as I first thought.  It also is intended to demonstrate the visibility problems I am having.  We had been using drop shadows to make the text more readable against similar colored backgrounds.  But in 3.6, it actually makes it harder to read the same text, especially at smaller font size.
> You can find demonstrations of this in the attached osgtext.cpp.  Feel free to ignore the first attachment -- this includes those changes and more, with only the relevant code and not the rest of osgtext.
> I hope this example helps demonstrate the problems I'm seeing.

The example makes the shadow quality clear. In the case of arial.ttf, it's a font that has body of the glyph pixel wide or even alpha'd at the default font resolution of 32x32 so causes more problems when you start blending, which is why things look worst for arial.ttf.

I have experimented with various changes to the OpenSceneGraph-Data/shaders/text.frag shader that does the fragment shading for osgText (in 3.6 onwards). I've found that applying a power function to the alpha value of the glyph and it's shadow results in clear text and shadow, and overall I think this is a decent enough improvement to consider.  I've attached my OpenSceneGraph-Data/shaders/text.frag, could you copy this into your OpenSceneGraph-Data/shaders directory (if you don't have one yet check it out and then make sure OSG_FILE_PATH points to the location of your
OpenSceneGraph-Data.)  If this works better then I'll regenerate the shaders that are built into osgText (see src/osgText/shaders/*.cpp.)

I have yet looked at the bounding box side of things in detail.


More information about the osg-users mailing list