• Advertisement
Sign in to follow this  

multi fbo

This topic is 4310 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi, Here is my problem: I would like to draw 2 pictures into 2 different textures. And then display it in my frame buffer. Should I use 2 different FBO for each texture, or could I with a simple FBO wriet my picture into a texture. To draw my picture, I use 2 different shader(vertex and fragment). I want the result of each shader to be writen in a texture...

Share this post


Link to post
Share on other sites
Advertisement
Thanks,

I use a single FBO, but with multiple texture and it works...
Now I would like to use multiple FBO, and each one with a single tex...
But I am little disapointed to learn that the texture attached to the FBO must be in the GPU memory, it can't be in the CPU memory.
So if I want to have it in the GPU, I have to do a ReadPiexel or sth like that, which means traffic on the bus....:(

Share this post


Link to post
Share on other sites
ok, i don't get you right now. what are you trying to achieve? as usually you want things to be on GPU memory, hence that's what FBO is made for.

Share this post


Link to post
Share on other sites
Quote:
Original post by 7Days
Now I would like to use multiple FBO, and each one with a single tex...
But I am little disapointed to learn that the texture attached to the FBO must be in the GPU memory, it can't be in the CPU memory.
So if I want to have it in the GPU, I have to do a ReadPiexel or sth like that, which means traffic on the bus....:(


Mars_999 infact has the right idea, you should use one FBO with two textures attached, you then swap the texture attachment you are drawing depending on which texture you want to update.

This is because swapping a draw target is faster than swapping an FBO.

And yes, everything rendered by the GPU will end up in VRAM, thats how it works as thats the only memory the GPU has direct access to, writing wise.

You could perform a readback using one of 3 methods;
- glGetTexImage() which would read back from a texture
- glReadPixels() to read back from the framebuffer
- use a pixel buffer object and perform an async readback, this should avoid any total stalls.

The first option might be a better one as it would (in theory) allow you to read back from a texture while rendering to the next texture, which means at worse you'll stall on the 2nd readback.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement