Thread: composing layers is openGL

  1. #1
    Registered User
    Join Date
    Feb 2005

    composing layers is openGL

    I'm writing an application in openGL, and I thought of a method to optimise my drawing. Basically I will have to compose three layers.
    - 1 : this layer will contain only colors with alpha = 1
    - 2 : this one will also contain transparant and semitransparent colors.
    - 3 : same as two.

    Right before calling SwapBuffers, I would then compose these three layers to form the final render. If I do it this way, I can easyly update only (parts of) the first layer, and get the desired output without having to rerender (parts of) the 2nd and 3rd layer. Also when nothing has to be redrawn, I should only compose the layers again and call SwapBuffers.

    My question is : Is there a way to do this with openGL ? I've read about the accumulation buffer, but I don't know if I could do it like that.

    Does anyone know how I could get my method to work ?

    Thanks in advance.

  2. #2
    vae victus! skorman00's Avatar
    Join Date
    Nov 2003
    I'm not sure if you can use the accumlation buffer for your purpose. The first idea that came to my mind was drawing to a texture. Keep 3 textures hanging around, which will be your 3 layers, and blit them to the front buffer each frame.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linking OpenGL in Dev-C++
    By linkofazeroth in forum Game Programming
    Replies: 4
    Last Post: 09-13-2005, 10:17 AM
  2. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM
  3. OpenGL .dll vs video card dll
    By Silvercord in forum Game Programming
    Replies: 14
    Last Post: 02-12-2003, 07:57 PM
  4. OpenGL and Windows
    By sean345 in forum Game Programming
    Replies: 5
    Last Post: 06-24-2002, 10:14 PM
  5. opengl code not working
    By Unregistered in forum Windows Programming
    Replies: 4
    Last Post: 02-14-2002, 10:01 PM