What are the differences between a Frame Buffer Object and a Pixel Buffer Object in OpenGL?

前端 未结 4 866

What is the difference between FBO and PBO? Which one should I use for off-screen rendering?

相关标签:
4条回答
  • 2021-01-30 09:29

    A FBO (Framebuffer object) is a target where you can render images other than the default frame buffer or screen.

    A PBO (Pixel Buffer Object) allows asynchronous transfers of pixel data to and from the device. This can be helpful to improve overall performance when rendering if you have other things that can be done while waiting for the pixel transfer.

    0 讨论(0)
  • 2021-01-30 09:30

    What is the difference between FBO and PBO?

    A better question is how are they similar. The only thing that is similar about them is their names.

    A Framebuffer Object (note the capitalization: framebuffer is one word, not two) is an object that contains multiple images which can be used as render targets.

    A Pixel Buffer Object is:

    1. A Buffer Object. FBOs are not buffer objects. Again: framebuffer is one word.
    2. A buffer object that is used for asynchronous uploading/downloading of pixel data to/from images.

    If you want to render to a texture or just a non-screen framebuffer, then you use FBOs. If you're trying to read pixel data back to your application asynchronously, or you're trying to transfer pixel data to OpenGL images asynchronously, then you use PBOs.

    They're nothing alike.

    0 讨论(0)
  • 2021-01-30 09:35

    I would read VBOs, PBOs and FBOs:

    Apple has posted two very nice bits of sample code demonstrating PBOs and FBOs. Even though these are Mac-specific, as sample code they're good on any platoform because PBOs and FBOs are OpenGL extensions, not windowing system extensions.

    So what are all these objects? Here's the situation:

    0 讨论(0)
  • 2021-01-30 09:37

    I want to highlight something.

    FBO it not memory block. I think it look like struct of pointer. You Must attach Texture to FBO to use it. After attach Texture you now can draw to it for offscreen render or for second pass effect.

    struct FBO{
    AttachColor0 *ptr0;
    AttachColor1 *ptr1;
    AttachColor2 *ptr2;
    AttachDepth  *ptr3;
    };
    

    In the other hand, PBO is memory block "block to hold type of memory. "Try to think of it as malloc of x size, then you can use memcpy to copy data from it to texture/FBO or to it".

    • Why to use PBO?

    Create intermediate memory buffer to interface with Host memory and not stop OpenGL drawing will upload texture to or from host.

    0 讨论(0)
提交回复
热议问题