<div dir="ltr"><div><div><div><div>Hello,<br><br></div>I'm trying to create a Texture2DArray. My textures are uchar images with size (texWidth, 256), single channel. The combination of texture internalFormat and pixelFormat with pixelType is not working. I use GL_R8UI for internalFormat, GL_RED_INTEGER for pixelFormat and GL_UNSIGNED_BYTE for type. This yields the following error when I try to render my scene:<br><br><i>Warning: detected OpenGL error 'invalid enumerant' at after RenderBin::draw(..)</i><br> <br></div><div>However, if I use GL_LUMINANCE for internalFormat and also GL_LUMINANCE for pixelFormat, I get no errors but my textures are not correctly sized. WHat formats should I use here?<br></div><div><br>This is my code:<br><br><br><br>osg::ref_ptr<osg::Texture2DArray> texture = new osg::Texture2DArray; <br>texture->setFilter(osg::Texture2DArray::MIN_FILTER, osg::Texture2DArray::LINEAR); <br>texture->setFilter(osg::Texture2DArray::MAG_FILTER, osg::Texture2DArray::LINEAR);   <br>texture->setWrap(osg::Texture2DArray::WRAP_R, osg::Texture2DArray::REPEAT); <br> texture->setInternalFormat(<b>textureFormat()</b>);<br><br><br></div>// Add some images as follows:<br></div>for (...) {<br><br> osg::Image* image = new osg::Image; <br>image->setImage(texWidth, 256, 1, <b>textureFormat(), pixelFormat(), type(),</b> dataPtr);<br><br></div>texture->setImage(i, image);<br><div>}<br><br><br></div><div>I am using: <br>textureFormat() = GL_R8UI;<br></div><div>pixelFormat() = GL_RED_INTEGER;<br></div><div>type() = GL_UNSIGNED_BYTE<br></div></div>