Results 1 to 2 of 2

Thread: Copying pixels from FBO to another texture.

  1. #1
    Member Contributor
    Join Date
    Sep 2007
    Location
    Southern California
    Posts
    60

    Copying pixels from FBO to another texture.

    Oh great OpenGL gurus:

    I'm implementing a simple paint procedure in a film graphics app for retouching dirt out. I want to create a texture that will hold the current results of the painting procedure.

    The problem is that the texture is both the source image and the destination render texture. The only way I can think to do this is to render each brush stroke to an FBO, and then copy the pixel data to the source texture.

    My question is: What is the easiest way to copy an FBO texture to another identical texture?

  2. #2
    Member Contributor
    Join Date
    Aug 2009
    Posts
    78

    Re: Copying pixels from FBO to another texture.

    How are you rendering your strokes? If you are using shaders you probably could render your input texture into a fullscreen quad and apply the stroke in the shader. Then simply swap the destination texture (bound to the fbo color attachment) with the input texture and paint the next stroke... (no complete copy needed)

    As a simpler, but maybe not so efficient answer you could always use glCopyTexImage2D ...?

Similar Threads

  1. Copying alpha from different texture
    By 3DTOPO in forum OpenGL: Basic Coding
    Replies: 9
    Last Post: 12-19-2010, 04:13 AM
  2. copying texture to an array
    By brett01 in forum OpenGL: Basic Coding
    Replies: 8
    Last Post: 08-14-2009, 12:02 AM
  3. copying a 3D texture using glCopyTexImage
    By quynh-clone in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 01-03-2004, 05:05 PM
  4. method of copying pixels between pbuffer
    By pango in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 12-14-2003, 07:21 AM
  5. copying pixels between textures
    By nestal in forum OpenGL: General
    Replies: 2
    Last Post: 01-07-2001, 08:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean