This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA2HG: [OpenGL] off-screen render support

Part Number: TDA2HG


Hello all:

  we see the release notes mentioned on visionSDK 3.08 

Basic SGX/OpenGL support - SGX link on A15 can be used to render/texture the video frames 
 Support GPU off-screen rendering using EGL PixMap and IPU allocated buffers 

is any connection with frame buffer as following code, do it mean that without above feature we can not use FBO?

        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
        
        // bind renderbuffer and create a 16-bit depth buffer
        // width and height of renderbuffer = width and height of
        // the texture
        glBindRenderbuffer(GL_RENDERBUFFER, m_stage_depth_render_buffer[i]);
        glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, width, height);

        // bind the framebuffer
        glBindFramebuffer(GL_FRAMEBUFFER, m_stage_fbo[i]);
        // specify texture as color attachment
        glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_stage_texture[i], 0);
        // specify depth_renderbufer as depth attachment
        glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, m_stage_depth_render_buffer[i]);
        // check for framebuffer complete
        GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
        if (status != GL_FRAMEBUFFER_COMPLETE)

  • Hello,

    The quoted note for for video frames refers to the fact that GPU can take video frames as an input and can use them as a texture in any application - like 3D surround view.

    This is different from the framebuffer bind code that you have quoted above. This code binds an fbo for rendering the GPU output into. This has no correlation with video textures. Hope this helps.

    I do agree that the language in release notes can cause some confusion. We will look into this. Thank you for raising.

    Regards

    Hemant

  • Hi Hemant:

      Thanks. Just to confirm that  visionSDK 3.05 t0 3.08 support FBO, right?

    for example, should we use GL_TEXTURE_EXTERNAL_OES instead of  GL_TEXTURE_2D?

    // specify texture as color attachment
            glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_stage_texture[i], 0);

    should change like 

    /// specify texture as color attachment
            glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_EXTERNAL_OES, m_stage_texture[i], 0);

  • Hello,

    Can you provide your requirements? What is it that you are trying to achieve? I am not sure if we understand the need to write to external textures.

    Regards

    Hemant

  • Hi Hemant:

      On visionsdk 3.05, we use GL_TEXTURE_EXTERNAL_OES to import the NV12 image data, the OpenGl should operate on GL_TEXTURE_EXTERNAL_OES target.

    for glFramebufferTexture2D, should we call glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_EXTERNAL_OES, m_stage_texture[i], 0) 

    when looking into the visionsdk source code we found 

      glFramebufferTexture2DOES = (PFNGLFRAMEBUFFERTEXTURE2DOES)PVRGetProcAddress(glFramebufferTexture2DOES);

    in ./apps/src/hlos/modules/sgxRenderUtils/Tools/OGLES/PVRTglesExt.cpp.

    so which is the right way when we want to use  glFramebufferTexture2D

    Thanks.