Videocard readbuffer performance

Started by
14 comments, last by GameDev.net 19 years, 1 month ago
I'm working on a project wich requires the readback of large buffers. I once wrote a realtime raytracer using openGL for first hit optimisation among some others things. To do this i had to readback the framebuffer using glReadpixels. Unfortunately the download speed was reached on my gf4. At 1024x768 it was hardly realtime anymore. I looked around and read that the readback is slow. For my current project i need to read back large panorama views, wich are much larger than 1024x768. So my questions are: 1. Are there any cards wich have suitable for this problem. 2. Is there any resource on the internet about this (specs?) 3. any other way?
Advertisement
Disclaimer: I'm pretty sure this is accurate but not 100%, so please feel free to correct me if I'm wrong.

It's not really the card itself that makes reading back a framebuffer or whatever so slow although it does stall the pipeline. The slowest part is that AGP is terrible at sending stuff to system ram. PCI express is slowly becoming more widespread, which is much faster for both sending to vram and system ram.
Your best bet is to start getting into pixel shader 3.0, this should give you access to being able to start a raytracer in a pixel shader ... with this link there is an example from nvidia named "Raytrace" that can give you a head start (scroll down the page).

http://developer.nvidia.com/object/fx_composer_shaders.html

[edit] If you are looking for a cheap 3.0 video card Nvidia just came out with a 6200 model which is a cheap low-end 3.0 ps/vs video card. it comes in AGP/PCI-EXPRESS.
-------------Become part of developing the specifications of a new language. Visit CodeBASIC.org
Thanks for your reply but,
The things about that raytracer where just a background story to introduce my problem. I need to readback a large buffer for a new project. I did'nt start coding yet, but i expect to run into some problems because of my earlier experience.

It's for a commercial project, so i'm not really on a tight budget, but i will need some numbers or specs to make my boss buy one.

[EDIT added:]
I think readback bandwidth of the AGP bus is kindda slow, but most cards can't fill it by far, but i don't have any numbers.
So if anybody knows the exact readback bandwidth speed of the AGP bus and PCI express, plz let me know
(Googling for it myself atm)
[/EDIT]
From my experience, i WRITE 175 screens of 640*480 per second on a geforce2 with AGP2x. In 1024*768, if i remember, i obtain 50-60. (note that quake2 in software run at 45fps in 1024*768 with an Athlon 1.5Ghz on the same bus ;)
I think read operations are similar in term of speed. If no, they are less fast.

Hope that help you :)
see GL_EXT_pixel_buffer_object,
the problem is what do u want to do with the data, if its quite simple (and can run in a fragment program then u could just copy the buffer into a texture)
Quote:Original post by zedzeek
see GL_EXT_pixel_buffer_object,
the problem is what do u want to do with the data, if its quite simple (and can run in a fragment program then u could just copy the buffer into a texture)


Pixel Shader 3.0 uses Multiple Render Targets, so you could easily use this to perform multiple tasks within the fragment/pixel shader all in one pass. You could even do very complex stuff. I haven't tried it because I sorta stuck to PS 2.0, but i wan't to move to 3.0 for this very reason, store info on multiple render targets and read output via cpu/gpu. And now that 3.0 will become main stream in probably a year (once new consoles come out), then its something to start programming with now. This is something I would seriously consider, especially if you want to manipulate pixels.
-------------Become part of developing the specifications of a new language. Visit CodeBASIC.org
GPU programming is all about avoiding to have to read pixels back to the CPU. Check www.gpgpu.org
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Quote:Pixel Shader 3.0 uses Multiple Render Targets, so you could easily use this to perform multiple tasks within the fragment/pixel shader all in one pass.
MRTs are supported with PS 2.0 aswell, but GeForce FX does not support it. ATi does.
@Fruny
I know most card aren't build for it, but i really NEED to read back those pixels.

@zedzeek
GL_EXT_pixel_buffer_object can save the data on the card, but how do i get it in CPU ram or on disk??

@all
thx for helping so far

This topic is closed to new replies.

Advertisement