[osg-users] Image getColor not implemented for GL_RED

Robert Osfield robert.osfield at gmail.com
Fri May 18 06:00:22 PDT 2018


Hi Tim,

> Hi,
> I was just trying to read out an Image with getColor(). My texture is LUT, so I chose a pixel format GL_RED. This works fine in my shader, but for the getColor method this format is not implemented, thus it returns vec4(1, 1, 1, 1) all the time.
>
> Now judging by the code I can change to GL_ALPHA and achieve my result, but adding the GL_RED with more or less the same code seems like it isn't too much work and I find it more intuitive to use only the red channel (rather than only the alpha channel).

I just had a look at the Image::getColor(), widespread use of GL_RED
and GL_RG usage in OpenGL post-dates when getColor() was written, but
adding it is straight forward so I've added this to the 3.6 branch:

    https://github.com/openscenegraph/OpenSceneGraph/commit/7602b868f40be58ab2bc4ffd6004df77a2695914

> Kind Regards,
> Tim
>
> p.s: @robert, in case you advice me to change my name again - i tried, i can't. there is no possibility for me to do so in my profile settings (or perhaps i just don't have the authority).

I'm no a forum user, but following the link on your post that appeared
on osg-users it looks like just "Tim" appears.  However, as an
osg-users user (forum posts appear and osg-users and visa-versa) you
see an expansion of your email address which is "Tim Whowantstoknow
<.....>".  You might not use your email too often but you might want
to just adjust the address to read "Tim <...>".

Cheers,
Robert.


More information about the osg-users mailing list