multi fbo

Started by
4 comments, last by 7Days 17 years, 11 months ago
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...
Advertisement
Use one FBO and use two color attachments to render to...
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....:(
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.

Life's like a Hydra... cut off one problem just to have two more popping out.
Leader and Coder: Project Epsylon | Drag[en]gine Game Engine

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.
Thanks,

That is exactly what I want to know!!!!

This topic is closed to new replies.

Advertisement