GF2 Speed

Hi !

I have a little perfomance problem with my App. It tries
to paint 500 Sprites with the help of jogl. The Problem is the FPS. It get’s only 70-80 FPS on my GF2. I asked kevglass to check it, on his 9000 mobilit he gets 250. What’s wrong? And yes, i switched off vsync and i reinstalled the nvidia driver.

Could someone test this :

http://www.informatik.uni-oldenburg.de/~troggan/bodo/JOGLTest.zip

???

I did forget to ask actually, is it by chance a GF2 MX ?

Kev

It’s an NForce chipset. I checked and it’s a GF2 MX.
Is that the reason for the speed of the game?

GF2 MX is very old school, but if you’re just drawing sprites I don’t see why it would be that slow. I should be back in action after this weekend as the OSX port is wrapping up.

thanks in advance for looking at the source. i hope you will find a way to speed it up a little bit. i don’t want to buy a new card to be able to code that game :-/

Could anybody PLEASE look at the code ??? I tried a lot of stuff the past few days, but I can’t get it faster. Sometimes the Java2d-Stuff is faster than the JOGL-Version on my PC (Geforce 2MX). Is THAT normal ?

When you say its a GF2 MX above, you also say its an NForce chipset. From what I understand (lets face it, not much), NForce is a motherboard chipset. Are you refering to an “onboard” graphics processor that is GF2?

If so, I suspect you’re performance would be pretty dire.

Incidently, I looked at your code before, it all looked fine. I also ran it on my 9000 Mobility, and got decent frame rates, so I’m guessing its your hardware… (possibly a driver update?)

Kev

I tried it with my Onboard GF2 and with an normal GF2. Both had the same speed :frowning:

Just out of curiosity, how is 70-80 fps bad? I mean, it’s not jerky, right?

Sure, but its not doing anything much yet, its about what happens when it all scales up…

Kev

Hrm. Are you sure VSync isn’t messing you around? Cut the number of sprites down to 10 or so and run again - if you still get the same frame rate with significantly fewer sprites, you may have a VSync problem.

A GeForce2 MX should be able to push out a lot more sprites than 500 - if done correctly! Comments:

Unnecessary loadIdentity() call per sprite: You do a loadIdentity()/translatef() for every sprite rendered. Try using pushMatrix()/popMatrix() instead. Even better, don’t do the translate but render the sprite at the correct x,y coordinates straight off.

Unnecessary texture changes: You rebind the OpenGL texture object for every sprite rendered. Try sorting the sprites into “same texture” groups and bind the texture only once for each group. At the very least just track the last texture you rendered and don’t bind the new one if it’s the same as the old. (Sample code only uses one texture.)

Float vertices: You’re casting all your vertices from ints to floats - why not keep them as ints and use the vertex2i() call? Let the OpenGL driver decide what’s fastest. (Very minor issue.)

The value “80-90” fps I also get with my own small Jogl application, no matter how many polygons I draw. When there are very many the FPS number drops to lower values which is reasonable, but I also “just” geht 80-90 fps if there’s only one polygon. Looks like there’s some internal barrier with my used TimerTasks. Or something else. :slight_smile:

Thanks for the help !

Yes, I switched off VSync. If I only Draw 1 Sprite, it goes up to 250 (but thats very slow, too :frowning: ).

I have added all your changes to my code, but I have received only 5 Fps more :(. Do you have an Example on how to do this the right way? And are you sure that a GF2 MX should be faster than this??

troggan

Btw: Bought a new Card, runs like hell on it :wink:

How do you turn off vsync anyway? My driver (nvidia’s latest tnt2 driver for an ancient diamond viper 32mb) offers me the ability to turn off vsync in the control panel, but it never actually occurs in my app. I always run at exactly my refresh rate.

I switch it off in the Control Panel. Don’t know why it doesn’t switch it off in your case, but the 250fps proves, that it works for me :wink:

troggan

[quote]When you say its a GF2 MX above, you also say its an NForce chipset. From what I understand (lets face it, not much), NForce is a motherboard chipset. Are you refering to an “onboard” graphics processor that is GF2?
[/quote]
The beauty of the NForce chipset was that - coming from nVidia - it was the first widely-available chipset with onboard video to actually have really GOOD onboard video (for the time, GF2MX was pretty good, although of course no vertex-shaders etc :frowning: ).

IIRC from reviews at the time there was negligible performance loss compared to an AGP GF2MX (although I may be completely wrong here :)).

The nForce2 was a GF4MX, so nVidia are keeping a fairly consistent approach of stuffing their “budget-card-of-the-season” into a chipset. Blurb from NV:

“Introducing the NVIDIA nForce2 Ultra 400 and NVIDIA nForce2 400
The NVIDIA nForce2 Ultra 400 incorporates dual 400MHz DDR controllers, delivering twice the bandwidth of typical DDR chipsets, an optimized 128-bit architecture, and 400MHz frontside bus (FSB) support for unparalleled performance. The NVIDIA nForce2 400 relies on a single 64-bit memory channel to deliver 400 MHz FSB and 400MHz DDR performance to the mainstream.”