<div dir="ltr">I intend to render a 16 bit per channel, 4 channel image, i.e., each pixel is 4 x unsigned 16bit (uint16_t) RGBA, leading to 64bit per pixel. <br></div><div class="gmail_extra"><br><div class="gmail_quote">2016-07-20 8:48 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">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div>Hi Bruno, <br>
    </div><span class="">
    <blockquote type="cite">
      
      <div>Ok so I meant GL_ vars. Could you suggest any code for
        substituting that setImage line? Thank you</div>
    </blockquote>
    <br></span>
    To what end? You haven't told us, what you want to achieve, except
    from using integer. <br>
    If you want to fill it with 16bit integer values you probably need <br>
    <br>
    <br>
    internal: GL_R16UI<br>
    format: GL_RED_INTEGER <br>
    type: GL_UNSIGNED_SHORT<br>
    <br>
    will give you a format, where the red channel is 16bit with unsigned
    values and your source type is unsigned short values. <br>
    <br>
    Cheers<span class="HOEnZb"><font color="#888888"><br>
    Sebastian <br></font></span><div><div class="h5">
    <br>
    <blockquote type="cite">
      <div><br>
        On 19 Jul 2016, at 09:35, Sebastian Messerschmidt <<a href="mailto:sebastian.messerschmidt@gmx.de" target="_blank">sebastian.messerschmidt@gmx.de</a>>
        wrote:<br>
        <br>
      </div>
      <blockquote type="cite">
        <div>
          
          <div>Hi Bruno,<br>
          </div>
          <blockquote type="cite">
            <div dir="ltr">
              <div>
                <div>Sorry but I didn't quite catch that.<br>
                </div>
                What do you mean by "but I thing you need to use
                GL_RGBA_INTEGER_EXT as source"<br>
              </div>
            </div>
          </blockquote>
          The source type needs to be GL_RGBA_INTEGER_EXT afaik when
          using integer textures. <br>
          <blockquote type="cite">
            <div dir="ltr">Alternatively, how can I replace the macros
              in that setImage function call?<br>
            </div>
          </blockquote>
          Which macros? The GL_ are constants. <br>
          <br>
          Cheers<br>
          Sebastian <br>
          <blockquote type="cite">
            <div class="gmail_extra"><br>
              <div class="gmail_quote">2016-07-19 8:45 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">
                  <div bgcolor="#FFFFFF" text="#000000">
                    <div>Hi,<br>
                      <br>
                      Your internal format needs to be 16bit per channel
                      to I think, so GL_UNSIGNED_INT_8_8_8_8_REV might
                      be inappropriate. <br>
                      GL_R16UI might do, but I thing you need to use
                      GL_RGBA_INTEGER_EXT as source. Alternatively you
                      can use GL_LUMINANCE with GL_LUMINACE16F.<br>
                      <br>
                      What exactly are you doing with the image? <br>
                      <br>
                      Cheers<br>
                      Sebastian<br>
                    </div>
                    <blockquote type="cite">
                      <div>
                        <div>
                          <div dir="ltr">
                            <div>
                              <div>
                                <div>
                                  <div>
                                    <div>
                                      <div>
                                        <div>Hello,<br>
                                          <br>
                                        </div>
                                        I have a 16bit per channel, 4
                                        channel, image. The format is
                                        short (uint16_t). Note that this
                                        image is scaled to the full
                                        16bit depth [0, 65536]<br>
                                        <br>
                                        <br>
                                      </div>
                                      I have this code that works well
                                      for a 8bit, 4 channel image:<br>
                                      <br>
                                      osg::ref_ptr<osg::Image>
                                      image = new osg::Image(); <br>
                                       image->setImage(ImageSize,
                                      ImageSize,1,<br>
                                      GL_RGBA8,<br>
                                      GL_RGBA,<br>
                                      GL_UNSIGNED_INT_8_8_8_8_REV, <br>
                                    </div>
                                    MyDataPtr,<br>
                                    osg::Image::NO_DELETE);<br>
                                    <br>
                                    <br>
                                    <br>
                                  </div>
                                  Now I want to por this to 16bit depth.<br>
                                </div>
                                How is this done?<br>
                                <br>
                              </div>
                              I tried<br>
                              <br>
                               image->setImage(ImageSize,
                              ImageSize,1,<br>
                              GL_RGBA16UI,<br>
                              GL_RGBA,<br>
                              GL_UNSIGNED_INT_8_8_8_8_REV, <br>
                              MyDataPtr,<br>
                              osg::Image::NO_DELETE);<br>
                              <br>
                            </div>
                            But this yields all black textures. How can
                            I do this without converting my 16bit image
                            pixel data?<br>
                          </div>
                          <br>
                          <fieldset></fieldset>
                          <br>
                        </div>
                      </div>
                      <pre>_______________________________________________
osg-users mailing list
<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a>
</pre>
                    </blockquote>
                    <p><br>
                    </p>
                  </div>
                  <br>
                  _______________________________________________<br>
                  osg-users mailing list<br>
                  <a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a><br>
                  <a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
                  <br>
                </blockquote>
              </div>
              <br>
            </div>
            <br>
            <fieldset></fieldset>
            <br>
            <pre>_______________________________________________
osg-users mailing list
<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a>
</pre>
          </blockquote>
          <p><br>
          </p>
        </div>
      </blockquote>
      <blockquote type="cite">
        <div><span>_______________________________________________</span><br>
          <span>osg-users mailing list</span><br>
          <span><a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a></span><br>
          <span><a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a></span><br>
        </div>
      </blockquote>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_______________________________________________
osg-users mailing list
<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a>
</pre>
    </blockquote>
    <p><br>
    </p>
  </div></div></div>

<br>_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
<br></blockquote></div><br></div>