HELP: PBO + pbuffer Problem!!

I want to do some video process with GPU. I use the PBO(pixel_buffer_object) to get the input stream date from the video_capture device. It’s done. Then I need to do some ping-pong operation in pbuffer,but it doesn’t work. I can only render the PBO to a single pbuffer,and then render the pbuffer to sceern.If I use the pbuffer’s two surface(GL_BACK and GL_FRONT) to do ping-pong,it seemed that the texture data in PBO skip the pbuffer,and render to screen directly. I think the pbuffer configuration is right because the static texture instead of PBO works well.
can anybody help me ,thx!!!

Im not sure what did you do, but following pseudocode might help:

  1. Create PBO (big enough for input image)
  2. Create texture that match input image size
  3. Create two pbuffers or 2x FBO same size as texture
  4. Copy incoming image to PBO. Use PBO data to copy image-data to texture object
  5. activate pbuffer1 and render texture in it (screen aligned texture mapped quad)
  6. loop N times (ping pong)
    — activate pbuffer2 (keep in mind that you may need to clear it’s background/depth after activation)
    — bind pbuffer1 as texture
    — render texture to active pbuffer with some calculations
    — deactivate pbuffer2
    — exchange pbuffers (tmp = pbuffer1; pbuffer1 = pbuffer2; pbuffer2 = tmp)
  7. Result is in pbuffer2

You can do this with FBO too, just replace pbuffers with FBO’s.

yooyo

Originally posted by yooyo:
[b]Im not sure what did you do, but following pseudocode might help:

  1. Create PBO (big enough for input image)
  2. Create texture that match input image size
  3. Create two pbuffers or 2x FBO same size as .

yooyo[/b]
thx for your sugesstion.But I did do it this way.The data in PBO will skip the 2 pbuffers and render to screen directly. if I use only one pbuffer to do “PBO->PBUFFER->SCREEN”,it works well. And " stati_texture->pbuffer1->pbuffer2->screen" is also all right

why :confused: