[osg-users] Image::readPixels and color matrix

Robert Osfield robert.osfield at gmail.com
Fri Jul 20 11:38:04 PDT 2007


HI Glenn,

ColorMatrix is only used in fragment program (a fixed function
pipeline at that) so doesn't affect glReadPixels, rather than
rendering itself.  ColorMatrix is supported on all hardware/drivers
either so it may well not even work on your hardware.  These days
using a fragment shader to do the conversion would be the better
approach.#

W.r.t reading to a 422 format... this conversion may well be done on
the CPU.  I don't think that this format is support into osg::Image
anyway though...

W.r.t setReadPixelsColorMatrix(), well consider this is not related
OpenGL state or function is inappropriate.

Robert.

On 7/20/07, Glenn Waldron <gwaldron at gmail.com> wrote:
> Robert et al.,
>
> I am using an FBO to render to a texture. I've attached an osg::Image so it
> will read back the image each frame via glReadPixels.
>
> I ultimately require the image to be in YUV422 format, not RGB. Now from
> what I've read, I can actually do the conversion on the card by first
> applying a color matrix (glColorMatrix) to convert RGB to YUV, then calling
> glReadPixels() with GL_422_EXT. This would be great since it would reduce
> the number of readback pixels by 50% (since YUV422 stores 2 pixels in each
> 32 bit word).
>
> SO, my question is: is there a way using OSG to apply that color matrix so
> that osg::Image::readPixels will use it? If not, would you entertain the
> idea of setting a "setReadPixelsColorMatrix()" or some such method to
> osg::Image?
>
> Thanks in advance. -gw
>
> --
> Glenn Waldron : Pelican Mapping : http://pelicanmapping.com : 703-652-4791
> _______________________________________________
> 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