<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Loading texture to integer internal format resukts in all zeroes in Graphics</title>
    <link>https://community.intel.com/t5/Graphics/Loading-texture-to-integer-internal-format-resukts-in-all-zeroes/m-p/341099#M21335</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using OpenGL to convert video frames from 10-bit YUV420p to 8-bit RGB. YUV frame data is loaded as a texture with:&lt;/P&gt;glTexImage2D(GL_TEXTURE_2D, 0, GL_R16UI, m_frameWidth, m_frameHeight + m_frameHeight / 2, 0, GL_RED_INTEGER, GL_UNSIGNED_SHORT, videoFrame.data());&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the fragment shader it's accessed with:&lt;/P&gt;
&lt;P&gt;# version 130&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;// irrelevant variables definitions here&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;uniform usampler2D frameTex;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;void main()&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;    // component value is saved on 10 least significant bits,&lt;/P&gt;
&lt;P&gt;    // so to normalize it divide by maximum value that can be coded on 10 bits (2^10 - 1 = 1023)&lt;/P&gt;
&lt;P&gt;    float Y = float(texture(frameTex, vec2(gl_TexCoord[0].s, gl_TexCoord[0].t * YHeight)).r) / 1023.0;&lt;/P&gt;
&lt;P&gt;    float U = float(texture(frameTex, vec2(gl_TexCoord[0].s / 2, UOffset + gl_TexCoord[0].t * UHeight)).r) / 1023.0;&lt;/P&gt;
&lt;P&gt;    float V = float(texture(frameTex, vec2(gl_TexCoord[0].s / 2, VOffset + gl_TexCoord[0].t * VHeight)).r) / 1023.0;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;    gl_FragColor = vec4(HDTV * vec3(Y, U, V), 1.0);&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, all the texels I get with texture() have value (0, 0, 0, 1).&lt;/P&gt;&lt;P&gt;The very same code works when I switch application to use discrete nVidia card.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What would be a problem here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My system configuration:&lt;/P&gt;&lt;P&gt;Windows 8 64-bit, i7-3740QM with HD Graphics 4000 with driver version 9.17.10.2843 (the newest available for my Lenovo laptop) and discrete nVidia Quadro K1000M.&lt;/P&gt;</description>
    <pubDate>Fri, 11 Dec 2015 15:10:36 GMT</pubDate>
    <dc:creator>JT9</dc:creator>
    <dc:date>2015-12-11T15:10:36Z</dc:date>
    <item>
      <title>Loading texture to integer internal format resukts in all zeroes</title>
      <link>https://community.intel.com/t5/Graphics/Loading-texture-to-integer-internal-format-resukts-in-all-zeroes/m-p/341099#M21335</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using OpenGL to convert video frames from 10-bit YUV420p to 8-bit RGB. YUV frame data is loaded as a texture with:&lt;/P&gt;glTexImage2D(GL_TEXTURE_2D, 0, GL_R16UI, m_frameWidth, m_frameHeight + m_frameHeight / 2, 0, GL_RED_INTEGER, GL_UNSIGNED_SHORT, videoFrame.data());&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the fragment shader it's accessed with:&lt;/P&gt;
&lt;P&gt;# version 130&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;// irrelevant variables definitions here&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;uniform usampler2D frameTex;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;void main()&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;    // component value is saved on 10 least significant bits,&lt;/P&gt;
&lt;P&gt;    // so to normalize it divide by maximum value that can be coded on 10 bits (2^10 - 1 = 1023)&lt;/P&gt;
&lt;P&gt;    float Y = float(texture(frameTex, vec2(gl_TexCoord[0].s, gl_TexCoord[0].t * YHeight)).r) / 1023.0;&lt;/P&gt;
&lt;P&gt;    float U = float(texture(frameTex, vec2(gl_TexCoord[0].s / 2, UOffset + gl_TexCoord[0].t * UHeight)).r) / 1023.0;&lt;/P&gt;
&lt;P&gt;    float V = float(texture(frameTex, vec2(gl_TexCoord[0].s / 2, VOffset + gl_TexCoord[0].t * VHeight)).r) / 1023.0;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;    gl_FragColor = vec4(HDTV * vec3(Y, U, V), 1.0);&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, all the texels I get with texture() have value (0, 0, 0, 1).&lt;/P&gt;&lt;P&gt;The very same code works when I switch application to use discrete nVidia card.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What would be a problem here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My system configuration:&lt;/P&gt;&lt;P&gt;Windows 8 64-bit, i7-3740QM with HD Graphics 4000 with driver version 9.17.10.2843 (the newest available for my Lenovo laptop) and discrete nVidia Quadro K1000M.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Dec 2015 15:10:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Graphics/Loading-texture-to-integer-internal-format-resukts-in-all-zeroes/m-p/341099#M21335</guid>
      <dc:creator>JT9</dc:creator>
      <dc:date>2015-12-11T15:10:36Z</dc:date>
    </item>
    <item>
      <title>Re: Loading texture to integer internal format resukts in all zeroes</title>
      <link>https://community.intel.com/t5/Graphics/Loading-texture-to-integer-internal-format-resukts-in-all-zeroes/m-p/341100#M21336</link>
      <description>&lt;P&gt;Hello jtoma,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for joining the Intel communities.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can get better support at the following link:&lt;/P&gt;&lt;P&gt;&lt;A href="http://software.intel.com/"&gt;http://software.intel.com/&lt;/A&gt; &lt;A href="http://software.intel.com/"&gt;http://software.intel.com/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ivan &lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2015 15:31:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Graphics/Loading-texture-to-integer-internal-format-resukts-in-all-zeroes/m-p/341100#M21336</guid>
      <dc:creator>IUman</dc:creator>
      <dc:date>2015-12-16T15:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: Loading texture to integer internal format resukts in all zeroes</title>
      <link>https://community.intel.com/t5/Graphics/Loading-texture-to-integer-internal-format-resukts-in-all-zeroes/m-p/341101#M21337</link>
      <description>&lt;P&gt;Hello Ivan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I shall try my chances there then.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards!&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2015 10:15:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Graphics/Loading-texture-to-integer-internal-format-resukts-in-all-zeroes/m-p/341101#M21337</guid>
      <dc:creator>JT9</dc:creator>
      <dc:date>2015-12-17T10:15:46Z</dc:date>
    </item>
  </channel>
</rss>

