Grahame Bowland wrote:
HelloI'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?
GL_BITMAP is not valid for a texture data type. The smallest data type allowed, as you've already discovered, is GL_UNSIGNED_BYTE.
--"J" _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

