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

Thread: how to use multi-surface of pbuffer

  1. #1
    Intern Newbie
    Join Date
    Apr 2003
    Location
    Beijing,China
    Posts
    40

    how to use multi-surface of pbuffer

    As we know changing pbuffers is slow, changing surfaces is fast. But I don't how to make it work.
    (Here I have set the Wgl_Double_Buffer in pbuffer pixel format)
    pbuffer->MakeCurrent();
    ///Front surface
    glDrawBuffer(WGL_FRONT_LEFT_ARB);
    glBindTexture(GL_TEXTURE_RECTANGLE_NV, tex0_id);
    wglReleaseTexImageARB(hpf, WGL_FRONT_LEFT_ARB);
    glBindProgramNV(GL_FRAGMENT_PROGRAM_NV, ShaderID);

    DrawSomething;

    glBindTexture(GL_TEXTURE_RECTANGLE_NV, tex0_id);
    wglBindTexImageARB(hpf, WGL_FRONT_LEFT_ARB);

    ///Back
    glDrawBuffer(WGL_BACK_LEFT_ARB);
    wglReleaseTexImageARB(hpf, WGL_BACK_LEFT_ARB);
    glBindTexture(GL_TEXTURE_RECTANGLE_NV, tex1_id);
    wglReleaseTexImageARB(hpf, WGL_BACK_LEFT_ARB);
    glBindProgramNV(GL_FRAGMENT_PROGRAM_NV, ShaderID);

    DrawSomething;

    glBindTexture(GL_TEXTURE_RECTANGLE_NV, tex1_id);
    wglBindTexImageARB(hpf, WGL_BACK_LEFT_ARB);

    Thank you in advance.
    Glad to meet you and talk something about CG

  2. #2
    Senior Member OpenGL Pro Zengar's Avatar
    Join Date
    Sep 2001
    Location
    Germany
    Posts
    1,979

    Re: how to use multi-surface of pbuffer

    That sounds like I problem I've got recently. I was trying to do gaussian blur. Everything is fine, but I need to blur the texture several times - and copying to a texture is soooo slow! I get 30 fps using a 64x64 rgba texture with 5 renderpasses. I thought, render to texture may solve it, but I have to switch pbuffers all the time, so I result in lower performance.
    Isn't there a way of rendering to the same texture several times?

  3. #3
    Junior Member Newbie
    Join Date
    Feb 2004
    Location
    Russia
    Posts
    4

    Re: how to use multi-surface of pbuffer

    I have another question on the pbuffer. Is there a way (as fast as SwapBuffers()) to render pbuffer to the main window with alpha blending (after or before I draw a main scene)?

Posting Permissions

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