Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Color conversion and fetching buffer from shader.

  1. #1
    Newbie Newbie
    Join Date
    Oct 2013
    Posts
    1

    Color conversion and fetching buffer from shader.

    Hi All,

    I'm implementing a YUV to RGB color converter which requires me to get the RGB buffer after conversion using OpenGL Shading Language.
    I've used three textures for Y (Luma) , U (Chroma b) & V (Chroma R) respectively. The fragment shader has the main color conversion algorithm, and after the conversion am setting gl_FragColor to vec4(r,g,b,1.0) (vector of RGB and Alpha).

    Can anyone please let me know if its possible to get the RGB buffers from the shader without rendering/drawing the fragment on the screen?
    OR In other words if a memory to memory color conversion routine is possible using OpenGL Shading Language?

    FYI: I used glCopyTexImage2D and glGetTexImage but to no avail (I guess it only works after rendering)

    Thanks,
    Dexter

  2. #2
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    3,194
    Quote Originally Posted by dextergk View Post
    Can anyone please let me know if its possible to get the RGB buffers from the shader without rendering/drawing the fragment on the screen? OR In other words if a memory to memory color conversion routine is possible using OpenGL Shading Language?
    Long gone are the days when the only target for rendering is an on-screen window. Create a texture, bind it to a framebuffer object, and then do your conversion rendering to that. In the wiki, see:

    * http://www.opengl.org/wiki/Framebuffer_Object
    * http://www.opengl.org/wiki/Framebuffer_Object_Examples

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •