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 4 of 4

Thread: Manipulating color buffer

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    3

    Manipulating color buffer

    Hi, is there any way to work straight with the buffer in order to apply post processing
    effects?
    No in the way of glGetPixels()... createTexture and then draw it.
    The idea is to create a underwater view effect..
    Regards
    JyC

  2. #2
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,527

    Re: Manipulating color buffer

    The straight-forward way is to use glCopyTexImage which omits the host copy you outlined with glReadPixels().
    Or more complex, if you render to a p-buffer texture rectangle target you can bind it as texture directly.

  3. #3
    Senior Member OpenGL Guru
    Join Date
    Dec 2000
    Location
    Reutlingen, Germany
    Posts
    2,052

    Re: Manipulating color buffer

    There are ways to do post-processing effects, BUT there is no way to directly access a pixel like an array or so, without doing a glReadPixels.

    Jan.
    GLIM - Immediate Mode Emulation for GL3

  4. #4
    Intern Contributor
    Join Date
    Jul 2001
    Location
    Santa Clara, CA
    Posts
    85

    Re: Manipulating color buffer

    Typically post-processing effects are done using render-to-texture:
    - Render your scene to an offscreen pbuffer
    - Bind the pbuffer as a texture
    - Process the image by looking up in the texture using a fragment program (or fixed functiont texturing)
    - Write the results to the frame buffer
    http://www.nvidia.com/dev_content/nv...er_texture.txt http://developer.nvidia.com/object/ogl_rtt.h
    tml

    Originally posted by Jan2000:
    There are ways to do post-processing effects, BUT there is no way to directly access a pixel like an array or so, without doing a glReadPixels.

    Jan.

Posting Permissions

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