[osg-users] Text colors in shaders

Robert Osfield robert.osfield at gmail.com
Fri Feb 24 07:09:52 PST 2017


On 24 February 2017 at 14:30, Werner Modenbach
<Werner.Modenbach at texion.eu> wrote:
> that's great. It works with the shader you suggested.
> Strange is, that just using vertex color doesn't work. It seems alpha is set
> to transparent (0).
> Also a texture is set but only alpha has a meaning. Texture color is black.
> That looks odd to me.

If you build the OSG against the GL3 core profile it maps the texture
format to GL_RED rather than GL_ALPHA as the later is no longer
supported.  The graphics hardware doesn't expand GL_RED in the same
way as GL_ALPHA so it can cause problems.  It's a bit of pain having
GL pull the rug from GL_ALPHA as it has a particularly useful mapping.
Potentially one could use texture swizzle to get round this but it's
not support on all GL versions.

Robert.



More information about the osg-users mailing list