<?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 Re: [OpenGL ES 3.0]  Frame Buffer Object with Texture format set to GL_LUMINANCE issues in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/OpenGL-ES-3-0-Frame-Buffer-Object-with-Texture-format-set-to-GL/m-p/638023#M97247</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #333333; background-color: #fafafa; font-size: 13px;"&gt;GL_LUMINANCE is not a color renderable format in OpenGL ES 3.0. The specification states in Section 4.4.4 (Framebuffer Completeness):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV class="" style="color: #333333; background-color: #fafafa; font-size: 13px; margin: 5px 20px 20px;"&gt;&lt;DIV class="" style="background: none #f2f6f8; border: 1px solid #4d5e70; font-size: 13px; margin: 0px 10px 10px;"&gt;&lt;DIV class="" style="padding: 5px 10px;"&gt;&lt;DIV class=""&gt; &lt;/DIV&gt;An internal format is color-renderable if it is one of the formats from table 3.12 noted as color-renderable or if it is unsized format RGBA or RGB. No other formats, including compressed internal formats, are color-renderable.&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN style="color: #333333; background-color: #fafafa; font-size: 13px;"&gt;Since GL_LUMINANCE is not included in this list, it is impossible to render to such a texture. I use GL_R8 instead.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Oct 2016 14:56:03 GMT</pubDate>
    <dc:creator>anthonygonin</dc:creator>
    <dc:date>2016-10-18T14:56:03Z</dc:date>
    <item>
      <title>[OpenGL ES 3.0]  Frame Buffer Object with Texture format set to GL_LUMINANCE issues</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/OpenGL-ES-3-0-Frame-Buffer-Object-with-Texture-format-set-to-GL/m-p/638022#M97246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #333333; background-color: #fafafa; font-size: 13px;"&gt;Hi all,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; background-color: #fafafa; font-size: 13px;"&gt;I'm working with OpenGL ES 3.0 on the imx6q&amp;nbsp;sabreSD.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; background-color: #fafafa; font-size: 13px;"&gt;Here is my problem : I would like to render 2 images offscreen (which come from previous rendering) and then blend them together with a special algorithm. My first image/texture is RGB and the second one is in grayscale, so I only got the luminance.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; background-color: #fafafa; font-size: 13px;"&gt;I think the best way to achieve my goal is to use Frame Buffer Object. So I create one FBO for the first image, then I associate to that FBO a new texture which will received the rendering output. The texture's format is GL_RGB and it works fine, my first FBO contains the rendering in its texture.&lt;/SPAN&gt;&lt;BR style="color: #333333; background-color: #fafafa; font-size: 13px;" /&gt;&lt;SPAN style="color: #333333; background-color: #fafafa; font-size: 13px;"&gt;Then I do the same with the second image which its format is GL_LUMINANCE. But in the draw function, when I bind to this FrameBuffer and check the Status I got the error GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT. And if I change the texture to RGB it works.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; background-color: #fafafa; font-size: 13px;"&gt;But for the blending I need to access to the luminance and not the rgb component of my image.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; background-color: #fafafa; font-size: 13px;"&gt;Do you have any solutions?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; background-color: #fafafa; font-size: 13px;"&gt;Here is my code : &lt;/SPAN&gt;&lt;BR style="color: #333333; background-color: #fafafa; font-size: 13px;" /&gt;&lt;SPAN style="color: #333333; background-color: #fafafa; font-size: 13px;"&gt;1 - Creation of the Frame Buffer Object and texture&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class="" style="color: #333333; background-color: #fafafa; font-size: 13px; margin: 5px 20px 20px;"&gt;&lt;DIV class=""&gt;Code :&lt;/DIV&gt;&lt;DIV class="" style="background: none repeat-x #f2f6f8; border: 1px inset; font-size: 12px; padding: 6px;"&gt;&lt;DIV class=""&gt;&lt;PRE style="background: none; font-size: 1em;"&gt;glGenFramebuffers(1, &amp;amp;m_uiFrameBufferObject); glBindFramebuffer(GL_FRAMEBUFFER, m_uiFrameBufferObject); &amp;nbsp; glGenTextures(1, &amp;amp;m_uiTextureId[1]); glBindTexture(GL_TEXTURE_2D, m_uiTextureId[1]); &amp;nbsp; glTexImage2D(&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;GL_TEXTURE_2D, 0, GL_LUMINANCE, 1280, 960, &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0, GL_LUMINANCE, GL_UNSIGNED_BYTE, nullptr); &amp;nbsp; glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); &amp;nbsp; glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_uiTextureId[1], 0); glDrawBuffers(1, attachments);&amp;nbsp;&amp;nbsp;&amp;nbsp; //GL_COLOR_ATTACHMENT0&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR style="color: #333333; background-color: #fafafa; font-size: 13px;" /&gt;&lt;SPAN style="color: #333333; background-color: #fafafa; font-size: 13px;"&gt;Then in the draw function : &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV class="" style="color: #333333; background-color: #fafafa; font-size: 13px; margin: 5px 20px 20px;"&gt;&lt;DIV class=""&gt;Code :&lt;/DIV&gt;&lt;DIV class="" style="background: none repeat-x #f2f6f8; border: 1px inset; font-size: 12px; padding: 6px;"&gt;&lt;DIV class=""&gt;&lt;PRE style="background: none; font-size: 1em;"&gt;glBindFramebuffer(GL_FRAMEBUFFER, m_uiFrameBufferObject); &amp;nbsp; if( glCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT ) {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // I go there } &amp;nbsp; glViewport(0, 0, 1280, 960); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); &amp;nbsp; glUseProgram(m_ProgCamera.GetHandle()); &amp;nbsp; glVertexAttribPointer(0, 3, GL_FLOAT, 0, 0, vVertices); glEnableVertexAttribArray(0); &amp;nbsp; // Bind the color attributes glVertexAttribPointer(1, 3, GL_FLOAT, 0, 0, g_vertexColors); glEnableVertexAttribArray(1); &amp;nbsp; glVertexAttribPointer(2, 2, GL_FLOAT, 0, 0, g_vertexTexCoords); glEnableVertexAttribArray(2); // Select Our Texture glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, m_textureCamera.GetHandle()); &amp;nbsp; glDrawArrays( GL_TRIANGLES, 0, 6 ); &amp;nbsp; // Cleanup glDisableVertexAttribArray(0); glDisableVertexAttribArray(1); glDisableVertexAttribArray(2);&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR style="color: #333333; background-color: #fafafa; font-size: 13px;" /&gt;&lt;SPAN style="color: #333333; background-color: #fafafa; font-size: 13px;"&gt;Thanks for your time.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Oct 2016 13:28:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/OpenGL-ES-3-0-Frame-Buffer-Object-with-Texture-format-set-to-GL/m-p/638022#M97246</guid>
      <dc:creator>anthonygonin</dc:creator>
      <dc:date>2016-10-14T13:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: [OpenGL ES 3.0]  Frame Buffer Object with Texture format set to GL_LUMINANCE issues</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/OpenGL-ES-3-0-Frame-Buffer-Object-with-Texture-format-set-to-GL/m-p/638023#M97247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #333333; background-color: #fafafa; font-size: 13px;"&gt;GL_LUMINANCE is not a color renderable format in OpenGL ES 3.0. The specification states in Section 4.4.4 (Framebuffer Completeness):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV class="" style="color: #333333; background-color: #fafafa; font-size: 13px; margin: 5px 20px 20px;"&gt;&lt;DIV class="" style="background: none #f2f6f8; border: 1px solid #4d5e70; font-size: 13px; margin: 0px 10px 10px;"&gt;&lt;DIV class="" style="padding: 5px 10px;"&gt;&lt;DIV class=""&gt; &lt;/DIV&gt;An internal format is color-renderable if it is one of the formats from table 3.12 noted as color-renderable or if it is unsized format RGBA or RGB. No other formats, including compressed internal formats, are color-renderable.&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN style="color: #333333; background-color: #fafafa; font-size: 13px;"&gt;Since GL_LUMINANCE is not included in this list, it is impossible to render to such a texture. I use GL_R8 instead.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2016 14:56:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/OpenGL-ES-3-0-Frame-Buffer-Object-with-Texture-format-set-to-GL/m-p/638023#M97247</guid>
      <dc:creator>anthonygonin</dc:creator>
      <dc:date>2016-10-18T14:56:03Z</dc:date>
    </item>
  </channel>
</rss>

