<div dir="ltr">Bruno,<div>According to this thread you might also need to set your packing to 1 (in the image->setImage call).</div><div>(<a href="https://goo.gl/1pv2Zt">https://goo.gl/1pv2Zt</a>)</div><div><br></div><div>Just a guess.</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Glenn Waldron</div></div></div></div>
<br><div class="gmail_quote">On Fri, Oct 21, 2016 at 9:36 AM, Bruno Oliveira <span dir="ltr"><<a href="mailto:bruno.manata.oliveira@gmail.com" target="_blank">bruno.manata.oliveira@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Thanks for the answer. <br><br></div>Using GL_LUMINANCE8UI yields undefined symbol. The closest symbols I have defined is GL_LUMINANCE8UI_EXT.<br><br></div>However, using internal TExture Format as GL_LUMINANCE8UI_EXT and pixel format GL_LUMINANCE yields  'invalid operation' errors<br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2016-10-21 14:03 GMT+01:00 Sebastian Messerschmidt <span dir="ltr"><<a href="mailto:sebastian.messerschmidt@gmx.de" target="_blank">sebastian.messerschmidt@gmx.<wbr>de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Bruno,<span><br>
<br>
<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
How do I guarantee that my textures will be unsigned integer 8bit texels<br>
with no scaling nor normalization to float or whatsoever? Because using<br>
GL_LUMINANCE is distupring my textures<br>
</blockquote>
<br></span>
GL_LUMINANCE8UI should do the trick. You need use a the correct sampler/data-type in the shader too (usampler and uvec)<br>
<br>
Cheers<br>
Sebatian<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>
<br>
2016-10-21 13:47 GMT+01:00 Glenn Waldron <<a href="mailto:gwaldron@gmail.com" target="_blank">gwaldron@gmail.com</a><br></span>
<mailto:<a href="mailto:gwaldron@gmail.com" target="_blank">gwaldron@gmail.com</a>>>:<span><br>
<br>
    I mean that GL_LUMINANCE is a valid pixel format, and GL_LUMINANCE8<br>
    is an internal format. GL_LUMINANCE8 is not a valid pixel format and<br>
    will probably give you a invalid enumerant error.<br>
<br>
<br>
<br>
    Glenn Waldron<br>
<br>
    On Fri, Oct 21, 2016 at 8:03 AM, Bruno Oliveira<br>
    <<a href="mailto:bruno.manata.oliveira@gmail.com" target="_blank">bruno.manata.oliveira@gmail.c<wbr>om</a><br></span><span>
    <mailto:<a href="mailto:bruno.manata.oliveira@gmail.com" target="_blank">bruno.manata.oliveira@<wbr>gmail.com</a>>> wrote:<br>
<br>
        Sorry Glenn what do you mean by "those reserved"?<br>
<br>
<br>
        By the way, my intention is to pass uchar textures of fixed<br>
        size, to perform texelFetch and bitwise operations inside a<br>
        shader, so I really need my textures to be in the exact format<br>
        of unsigned byte integer, single channel!<br>
<br>
        2016-10-21 12:25 GMT+01:00 Glenn Waldron <<a href="mailto:gwaldron@gmail.com" target="_blank">gwaldron@gmail.com</a><br></span>
        <mailto:<a href="mailto:gwaldron@gmail.com" target="_blank">gwaldron@gmail.com</a>>>:<span><br>
<br>
            Bruno, I think you have those reversed.<br>
<br>
<br>
            On Oct 21, 2016 6:07 AM, "Bruno Oliveira"<br>
            <<a href="mailto:bruno.manata.oliveira@gmail.com" target="_blank">bruno.manata.oliveira@gmail.c<wbr>om</a><br></span><span>
            <mailto:<a href="mailto:bruno.manata.oliveira@gmail.com" target="_blank">bruno.manata.oliveira@<wbr>gmail.com</a>>> wrote:<br>
<br>
                Hello,<br>
<br>
                thank you for your answer. I am indeed using the same<br>
                texture sizes and formats.<br>
                If I use GL_LUMINANCE8 as pixelFormat and GL_LUMINANCE<br>
                as internalFormat, I get a "invalid enumerant" error<br>
<br>
                2016-10-21 7:56 GMT+01:00 Sebastian Messerschmidt<br>
                <<a href="mailto:sebastian.messerschmidt@gmx.de" target="_blank">sebastian.messerschmidt@gmx.d<wbr>e</a><br></span>
                <mailto:<a href="mailto:sebastian.messerschmidt@gmx.de" target="_blank">sebastian.messerschmid<wbr>t@gmx.de</a>>>:<div><div class="m_-7328869486317044285h5"><br>
<br>
<br>
                    Hi Bruno:<br>
                    Sorry for not reading to the end:<br>
<br>
                        Hello,<br>
<br>
                        I'm trying to create a Texture2DArray. My<br>
                        textures are uchar images with<br>
                        size (texWidth, 256), single channel. The<br>
                        combination of texture<br>
                        internalFormat and pixelFormat with pixelType is<br>
                        not working. I use<br>
                        GL_R8UI for internalFormat, GL_RED_INTEGER for<br>
                        pixelFormat and<br>
                        GL_UNSIGNED_BYTE for type. This yields the<br>
                        following error when I try to<br>
                        render my scene:<br>
<br>
                        /Warning: detected OpenGL error 'invalid<br>
                        enumerant' at after<br>
                        RenderBin::draw(..)/<br>
<br>
                        However, if I use GL_LUMINANCE for<br>
                        internalFormat and also GL_LUMINANCE<br>
                        for pixelFormat, I get no errors but my textures<br>
                        are not correctly<br>
                        sized. WHat formats should I use here?<br>
<br>
                    When using GL_LUMINCANE as internal formet the<br>
                    pixlel format needs to be<br>
                    GL_LUMINANCE4/8/12/16[F/I/UI] ...<br>
<br>
                    So basically for default precision (GL_BYTE) it<br>
                    should be<br>
<br>
                    GL_LUMINANCE8<br>
<br>
<br>
                    Cheers<br>
                    Sebastian<br>
<br>
<br>
                        This is my code:<br>
<br>
<br>
<br>
                        osg::ref_ptr<osg::Texture2DArr<wbr>ay> texture = new<br>
                        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,<br>
                        osg::Texture2DArray::REPEAT);<br>
                         texture->setInternalFormat(*t<wbr>extureFormat()*);<br>
<br>
<br>
                        // Add some images as follows:<br>
                        for (...) {<br>
<br>
                         osg::Image* image = new osg::Image;<br>
                        image->setImage(texWidth, 256, 1,<br>
                        *textureFormat(), pixelFormat(),<br>
                        type(),* dataPtr);<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>
                        ______________________________<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></div></div>
                        <mailto:<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.opensc<wbr>enegraph.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><span><br>
                        <<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.o<wbr>rg/listinfo.cgi/osg-users-open<wbr>scenegraph.org</a>><br>
<br>
                    ______________________________<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></span>
                    <mailto:<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.opensc<wbr>enegraph.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><span><br>
                    <<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.o<wbr>rg/listinfo.cgi/osg-users-open<wbr>scenegraph.org</a>><br>
<br>
<br>
<br>
                ______________________________<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></span>
                <mailto:<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.opensc<wbr>enegraph.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><span><br>
                <<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.o<wbr>rg/listinfo.cgi/osg-users-open<wbr>scenegraph.org</a>><br>
<br>
<br>
            ______________________________<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></span>
            <mailto:<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.opensc<wbr>enegraph.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><span><br>
            <<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.o<wbr>rg/listinfo.cgi/osg-users-open<wbr>scenegraph.org</a>><br>
<br>
<br>
<br>
        ______________________________<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></span>
        <mailto:<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.opensc<wbr>enegraph.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><span><br>
        <<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.o<wbr>rg/listinfo.cgi/osg-users-open<wbr>scenegraph.org</a>><br>
<br>
<br>
<br>
    ______________________________<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></span>
    <mailto:<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.opensc<wbr>enegraph.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><span><br>
    <<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.o<wbr>rg/listinfo.cgi/osg-users-open<wbr>scenegraph.org</a>><br>
<br>
<br>
<br>
<br>
______________________________<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="m_-7328869486317044285HOEnZb"><div class="m_-7328869486317044285h5">
______________________________<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>
</div></div><br>______________________________<wbr>_________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.<wbr>openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.<wbr>org/listinfo.cgi/osg-users-<wbr>openscenegraph.org</a><br>
<br></blockquote></div><br></div>