Computer Being Slow

I’m wondering, are there certain types of computers or video cards that JOGL just doesn’t like?

On this computer I’m on right now, most jogl and lwjgl stuff runs just fine, all graphics in tact and more than adequate speed.

On my other computer, though, it’s rare if I can get either lwjgl or jogl to operate at a playable rate (unless it’s a turn based game, like Conquer, which still had a slow framerate on the mouse).
It has:
Windows 98 (XP would kill it)
850 mhz Athlon processor
NVidia TNT2 card (worried about this)
192 mb ram

I threw together a pathetically simple graphics test in eclipse, which just draws two stationary points and one animated one (swings from left to right based on a sine calculation). Every 60 frames it sends an output line giving the total frame count and the fps for the last 60 frames, as shown below.

	public void display(GLDrawable draw) {
		count++;
		GL gl = draw.getGL();
		gl.glClear(GL.GL_COLOR_BUFFER_BIT);
		gl.glBegin(GL.GL_POINTS);
		gl.glVertex2i(100, 50);
		gl.glVertex2i(100, 130);
		gl.glVertex2i(150 + loc, 130);
		gl.glEnd();
		gl.glFlush();
		if (count % 60 == 0){
			time2 = System.nanoTime();
			System.out.println("Count=" + count + " at " 
					+ (int)(60/((double)(time2 - time1)/1000000000)) + " fps");
			time1 = System.nanoTime();
		}
	}

So, if I take this, and stick it in a 400 by 400 frame, I get about 130 fps. But if I make it a 800 by 800 frame, it suddenly drops to 30 fps, and full screen (1024 by 768) is a mere 20 fps. I know it’s a slow computer, but displaying three dots at 20 fps??

Have I done something stupid, or is my computer just slow?

GL_POINTS is usually much much slower than polygon rendering on most consumer cards. Try doing your test with a quad or something instead.

Also, the TNT2 will be heavily fill limited. You can get 250-300 MTexel/s with a TNT2. Compare that to a recent card like a Ti4800 with 2400 MTexel/s or 6800 Ultra with 6400 MTexels/s.

Furthermore the TNT2 bandwidth is 2.7-3.0 GB/s. Compared to the Ti4800 10.4 GB/s or the 6800 Ultra 35 GB/s.

VRAM is also quite limited. Try 640x480 fullscreen instead (good enough for most shareware games).

n00bs! The reason it is slow is because he calls glFlush().

Cas :slight_smile:

As a “noob” then… would calling glFlush() really get slower and slower with high resolutions?

I mean, it’s not like glFinish(), it’s only making sure all data is sent to the gfx-card, which shouldn’t be any slower on high resolutions.

So much for my n00bish reasoning… :slight_smile:

The specs for glFlush and glFinish are so horribly vauge that they could be doing all sorts of unpredictable things (or nothing at all). It might have been useful back when OpenGL was a networked client-server rather than the CPU-GPU client-server we’ve got now. But other than that there’s absolutely no reason you’d ever want to call either of them.

And no, profiling isn’t a valid use - they could easily be a no-op and be perfectly fine.

POINTS is pretty slow, but the default settings (no smoothing, point size of 1) is pretty damn fast on any card I’ve come across.

Ok ok, did a few more tests (thanks for all the responses btw, very quick). Unfortunately it looks like my only option is going to be to do what oNyx said, and just cap anything I run in java at 640 by 480.

What I found out was this.

  • If I remove the glVertex calls (using size 4.0F points), there is virtually no impact on speed
  • If I remove glFlush, there is again no impact on speed (:frowning: was hopeful on this one)
  • If I remove glClear, it runs about 60% faster
  • After trying out various frame sizes, framerate seems directly proportional to the number of pixels on screen

Odd thing is, I know I can get much higher framerates on a similarly sized JFrame if I just use Swing with BufferStrategy. I did that in the past, and as long as I only had a few basic geometry elements the computer would have 300 fps easily.

Oh, and the program and suddenly decided it wants to crash every time I resize the frame (only on that computer though, not this one). Even though it wasn’t doing that a couple hours ago. I didn’t change any resize code.

/boggle

Maybe you are getting the software renderer. Print out the vendor and make sure it is not from microsoft. Upgrade the drivers to fix it.

I found Jogl to be very flaky when it came to resizing GL canvases. Random crashes and loss of the display seemed to be entirely unpredicatable and occur on computers that were otherwise entirely stable. That was well over a year ago, I guess they’ve still not done anything about it.

Ye, tom has a point there. The TNT2 is slow, but it should be certainly better than that.

If you cant be arsed to write code for dumping the card/driver details you can just use some tool like Everest (display->opengl).

You can also generate reports (rightclick on opengl->quick report) like this one, which are quite handy :wink:

You know… come to think of it, it never occured to me it could be a driver issue. In fact I don’t recall updating any open gl drivers since we reformatted this computer from Windows ME (horrid, horrid OS).

I’ll look into that :slight_smile:

Ok. Uninstalled NVidia drivers. Downloaded new TNT drivers (claming OpenGL 1.5 support). Ran the exe. Ran the setup - NVidia card cannot be found on this system. Uninstalled everything again, reinstalled again. NVidia hardware cannot be found. Ok, go to website, look for help… nothing. Look for other drivers… nope nothing there.

Aaaaand now I’m stuck in 16 color mode, and have been for the last two hours. Really, really frustrating.

Yes, I had the same problem with an TNT2 card. The website of nVidia claims it supports those cards, but they just DO NOT ! >:(

So you have to Google your way out, find yourself drivers of like 1-2 years ago, they will definitly work.

Hmm. If you’ve used a voodoo card before there can be several issues with opengl.

Also try booting up in secure mode (or whatever its called) and take then a look at the hardware manager. In the secured mode you can see zombie devices which you usually cant see. Remove all graphic cards there.

You should also try things like uninstalling drivers from the software panel (if they show up there its the only way to remove em). And finally if nothing helps you can try specialized driver removal tools like the “detonator destroyer”.

Well ok, I finally got something worked out. Turns out that while NVidia lists an entire section of drivers under TNT2 (only ONE of which they actually say isn’t compatible), the vast majority appear to crash/fail/not install in some way or another when I set them up in my computer.

So, for now, I tried the first 7 drivers or so (from 77 to 56), and then gave up, and went to the oldest driver available. This one wouldn’t download… so I went to the second oldest, setup that, got hit with a massive list of “required files” that I didn’t have, skipped all of them, and how-on-earth-I-don’t-know it worked.

Unfortunately, I’m using the exact same OpenGL version as before, which was 1.3.1, using “RIVA TNT2/PCI/3D NOW!” as the renderer and NVidia as the vendor, according to the Everest software (very helpful, btw).

On the other hand, my n00b program that was running at 21 fps has now inexplicably begun running at 83 fps, and maintains 83 fps for all windows sizes. So I guess I’m happy :).

Unfortunately, merely touching the title screen of Quix (which looks incredible on my other computer… love the game), causes the framerate to drop to about 2 per second, and had the weird side effect of actually slowing down my JVM clock speed when I ran my program again (dot animated about twice as slow, though the framerate also shot to 220). Reboot fixed everything though.

So if you have any links to a driver that supports above 1.3.1, I’ll give it a shot. Otherwise I might try out some other NVidia drivers later if I have time. Quite honestly I’m tired of working with the things though.

Total time wasted: 3 hours 50 minutes >_<

Win98 TNT2 v4.12.01

I went to great pains finding this file myself >:( I hope this one does it for ya.

Ooooh. Good news! I started going up the list and found a lot more working drivers. In fact, I’m not entirely sure, but the fact that I was uninstalling drivers completely before updating the new ones (stopped doing this) might have been killing a few files I didn’t want it to.

Anywho, I’m now using version 53, which supports OpenGL 1.4.1. Woot. :slight_smile:

Oh and Riven… sorry but that driver doesn’t really work (gave me the 16-color screen of death and the blue screen of death), plus it’s a lot older than the ones I got working. If it worked for you, I suspect I might have a slightly different TNT card then (pro/ultra/64, several types), which might affect something. Anyway you should try some of the older NVidia drivers under http://www.nvidia.com/object/win9x_archive.html, some actually do work.