<div dir="ltr"><div><div>Hello,<br><br></div>thank you for your answer. I am indeed using the same texture sizes and formats.<br></div>If I use GL_LUMINANCE8 as pixelFormat and GL_LUMINANCE as internalFormat, I get a "invalid enumerant" error<br></div><div class="gmail_extra"><br><div class="gmail_quote">2016-10-21 7:56 GMT+01:00 Sebastian Messerschmidt <span dir="ltr"><<a href="mailto:sebastian.messerschmidt@gmx.de" target="_blank">sebastian.messerschmidt@gmx.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Hi Bruno:<br>
Sorry for not reading to the end:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
Hello,<br>
<br>
I'm trying to create a Texture2DArray. My textures are uchar images with<br>
size (texWidth, 256), single channel. The combination of texture<br>
internalFormat and pixelFormat with pixelType is not working. I use<br>
GL_R8UI for internalFormat, GL_RED_INTEGER for pixelFormat and<br>
GL_UNSIGNED_BYTE for type. This yields the following error when I try to<br>
render my scene:<br>
<br></span>
/Warning: detected OpenGL error 'invalid enumerant' at after<br>
RenderBin::draw(..)/<span class=""><br>
<br>
However, if I use GL_LUMINANCE for internalFormat and also GL_LUMINANCE<br>
for pixelFormat, I get no errors but my textures are not correctly<br>
sized. WHat formats should I use here?<br>
</span></blockquote>
When using GL_LUMINCANE as internal formet the pixlel format needs to be GL_LUMINANCE4/8/12/16[F/I/UI] ...<br>
<br>
So basically for default precision (GL_BYTE) it should be<br>
<br>
GL_LUMINANCE8<br>
<br>
<br>
Cheers<br>
Sebastian<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
<br>
This is my code:<br>
<br>
<br>
<br>
osg::ref_ptr<osg::Texture2DArr<wbr>ay> texture = new osg::Texture2DArray;<br>
texture->setFilter(osg::Textur<wbr>e2DArray::MIN_FILTER,<br>
osg::Texture2DArray::LINEAR);<br>
texture->setFilter(osg::Textur<wbr>e2DArray::MAG_FILTER,<br>
osg::Texture2DArray::LINEAR);<br>
texture->setWrap(osg::Texture2<wbr>DArray::WRAP_R, osg::Texture2DArray::REPEAT);<br></span>
 texture->setInternalFormat(*t<wbr>extureFormat()*);<span class=""><br>
<br>
<br>
// Add some images as follows:<br>
for (...) {<br>
<br>
 osg::Image* image = new osg::Image;<br></span>
image->setImage(texWidth, 256, 1, *textureFormat(), pixelFormat(),<br>
type(),* dataPtr);<span class=""><br>
<br>
texture->setImage(i, image);<br>
}<br>
<br>
<br>
I am using:<br>
textureFormat() = GL_R8UI;<br>
pixelFormat() = GL_RED_INTEGER;<br>
type() = GL_UNSIGNED_BYTE<br>
<br>
<br></span><span class="">
______________________________<wbr>_________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph<wbr>.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.or<wbr>g/listinfo.cgi/osg-users-opens<wbr>cenegraph.org</a><br>
<br>
</span></blockquote><div class="HOEnZb"><div class="h5">
______________________________<wbr>_________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph<wbr>.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.or<wbr>g/listinfo.cgi/osg-users-opens<wbr>cenegraph.org</a><br>
</div></div></blockquote></div><br></div>