Hello
I'm using a shader to draw a texture of 32-bit floating point data. That's
working fine, but I need to pass through whether a given texel should be
visible or not.
I'm trying to create a 1-bit texture, like this:
int internalFormat = GL_RED;
int pixelFormat = GL_RED;
int dataType = GL_BITMAP;
/* generate 'imdata' */
transp_image = new osg::Image;
transp_image->setImage(
width,
height,
1,
internalFormat,
pixelFormat,
dataType,
(unsigned char *)imdata,
osg::Image::USE_NEW_DELETE);
I get the following error when running this code:
Warning: detected OpenGL error 'invalid enumerant' after RenderBin::draw(,)
If I use dataType = GL_UNSIGNED_CHAR everything works fine, but that'll use
eight times the memory. Does anyone have any idea what I can do to get a 1-bit
texture I can access from my shader?
Thanks in advance for any help!
Cheers
Grahame
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=29979#29979
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org