FFT/drawpixel speed test

Looking for volunteers to test a piece of code for speed. It combines FFT (high pass) with Read/drawpixels so don’t be surprise if the scene looks a little odd. I have to make a recommendation for a video card to run this on, so any tests would be appreciated - specifically I’d like to test Radeon 7500/Geforce 2, and up.
Instructions: Run Maze2.exe, type in any initials(up to 8 chars), then use ‘D’ as the input file. Escape key (or entering the opposite alcove) will exit the maze.
Download at http://www.cs.dal.ca/~macinnwj/downloads/FFTMaze.zip
Thanks!
Joe

It showed 0,5 fps on my GeForce3 with 27.30?

Diapolo

I get 0.18 fps on my Geforce2 MX
-Sundar

I get the picture. I know my Fourier Transform isn’t very fast, but I was hoping that some cards would deal with the read/draw pixels a little better. Any Radeon’s out there?
Joe

I’ve got a Radeon 7200 (aka 64DDR vivo), but I’m at work now. I will test for you when I get home this evening.

edit: With Humus’ input below, I doubt the feedback on my 7200 is necessary.

[This message has been edited by yakuza (edited 02-19-2002).]

0.45 fps on a Radeon 8500.

Why are you reporting only the card name? Chances are, the read is reasonably fast, and the bottleneck is the FFT; thus your CPU and memory speeds would matter much more.

Have you profiled the FFT to measure how long it takes? Compared it to the readpixels? And, to make sure it’s readpixels, and not rendering, have you put a glFinish() before you start timing ReadPixels?

Part of the bottleneck is the FFT, but the following is what I get on my 1.2G Athlon with a Radeon VE
No draw/readpixels or FFT - 85 fps (monitor refresh)
draw/readpixels, no FFT - 3 fps
draw/readpixels and FFT 0.25 fps
Good point with machine differences on the FFT though. I’ve reposted the same program with read/drawpixels without the FFT at:
http://www.cs.dal.ca/~macinnwj/downloads/FFTDemo.zip

Hopefully this will be a better test of the card’s role.
Thanks to everyone who tested (and will re-test)
Joe

System:
Dual PIII 800Mhz
Elsa Gladiac (Geforce 2 GTS 32MB)

FFTMaze: 0.238 fps
FFTDemo: 6.9-7.5 fps (oscillates)

Hope this helps…

Yakuza: I’d like to see the numbers anyway. If the 7200 does nearly the sam job, I’ll save the extra money. Its starting to look like none of these cards do a decent job on glreadpixels.
Joe

Ok, sorry I didn’t get a chance to try it last night, I kind of figured it was unnecessary. But I’ll be glad to try it tonight, and post my results.

How big are the images you are trying to read and write with draw/readPixels? The bigger the better, the overhead of setting up a transfer is pretty much constant, thus less noticeable for bigger images. Make sure you pick an image format that is supported by the harware directly so that the driver doesn’t have to convert it.

Wildcat 5510:
FFTdemo 7.9 fps
FFTmaze 0.29 fps

This is on a 1.4 GHz P4

Barthold
3Dlabs

Dell Dual 600 MHz
Wildcat 4110
FFTMaze 0.19 FPS
FFTDemo 6.2 - 6.6 FPS

Dell 8100 Inspiron 1.2 GHz
nVidia GeForce2Go
FFTMaze 0.36 FPS
FFTDemo 10.2 FPS

This is the first time that I have seen a laptop with a GeForce2Go outperform a desktop workstation with a Wildcat card.

Regards,
Scott

[This message has been edited by heiman (edited 02-21-2002).]

[This message has been edited by heiman (edited 02-21-2002).]

Make sure you ReadPixels with the GL_BGRA format, and the appropriate packing/alignment modes set so that the hardware can just dump a stream of data into your buffer (this means reading the entire texture, too, for alignment).

Alright, I tested it this morning before I went to work.

Radeon 7200
Athlon Tbird 700@900
Maze: 0.26 fps
Demo: 7.6 fps

Hope this helps.

Thanks for the tests everyone.
JWattte, Barthold, I’ve posted my processing code. I actually use GL_RGB, and as far as I can tell, it should be supported. Any advice on optimizing would be welcome.
Joe

int
CApp::ProcessPixels()
{
//prep the array to read the pixels
//for(int i=0;i<(4640480);i++)
// Pixels[i]=0;
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glPixelStorei(GL_PACK_ALIGNMENT, 1);
glReadBuffer(GL_BACK);
glReadPixels(0,0,WinX,WinY,GL_RGB,GL_UNSIGNED_BYTE,Pixels);
if(Pixels != NULL)
{

	glDrawBuffer(GL_BACK); 
	glPushMatrix();//modelview
    glMatrixMode(GL_PROJECTION);
	glPushMatrix();
	//now set to 2D
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0, ScrWidth, 0, ScrHeight, -1, 1);
	GLubyte Temp = 0;
	//take average of pixels and convert to greay scale
	for(int i=0;i&lt;(WinX*WinY);i++)
	{
		Temp=(Pixels[(i*BYTES_PER_PIXEL)]
			+Pixels[(i*BYTES_PER_PIXEL)+1]
			+Pixels[(i*BYTES_PER_PIXEL)+2])/3;
		//GPixels[i%WinX][i/WinX]=Temp;
	}

//FFT Here
//put them back into Pixels
for(int i=0;i<(WinXWinY);i++)
{
//Temp = GPixels[i%WinX][i/WinX];
Temp = FFImage->data[i%WinX][i/WinX];
Pixels[(i
BYTES_PER_PIXEL)]=Temp;
Pixels[(iBYTES_PER_PIXEL)+1]=Temp;
Pixels[(i
BYTES_PER_PIXEL)+2]=Temp;
}
//disable textures, and draw to back buffer
TextureMgr::StopTextures();
glRasterPos2i(0,0);
glDrawPixels(WinX,WinY,GL_RGB,GL_UNSIGNED_BYTE,Pixels);
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
}

}

[This message has been edited by JoeMac (edited 02-27-2002).]

“supported” and “optimal” are two different things. Try reading as GL_BGRA, or as GL_BGR with a pixel size of 4 bytes. That just might make it faster.

Late but here it is …

ASUS A7M266 / AMD TBird 1.4 / 512Mb DDR / GF3

FFTMaze : ~0.5
FFTDemo : ~8.6

Fraction of a fps difference going though all combinations that I could think of, including GL_LUMINANCE : 1-4 Byte alignment as appropriate.
Joe

Do not even think about using OpenGL if you want to read back the frame buffer… er… unless you want to take a snapshot of your framebuffer for a screenshot or something.
-Sundar