2D OpenGL performance

Hi,

my game is now using LWJGL but I have serious performance problems. The game runs only at 10 fps. What Am I missing? I use display list for each sprite I draw. What about Pbuffers do I need them? What is the equivalent of video buffers?

I know that calling Display.update() swap the buffers but I don’t know more about buffers.

I’ve looked at the NeHe tutorials but didn’t find something that helps me. I’ve also checked the red and blue books but I don’t have time right now to read all the docs.

One question: did you compare the performance of Space Invaders between the Java2D and LWJGL implementations when running in window mode? On my laptop (S3 video card), the Java2D runs at 100 fps and the LWJGL at 45 fps. Why???

By the way, my S3 card has only 16 megs of vram.

Please help!

how do you make a game

[quote][…]the Java2D runs at 100 fps and the LWJGL at 45 fps. Why???
[…]
[/quote]
Because… the card is… uhm… shite :-/

Well, maybe it’s not that bad and a driver update helps?

16mb should be ok-ish. It’s about as good as a TNT2 then? Definitively look for newer drivers.

You’re using an S3 card?
That explains the performance.

S3’s drivers for their earlier cards are really cruddy, you’re better off using a Riva 128 Pro, an 8MB card.

Argh! The card isn’t shite its just not designed for OpenGL. It, like make low end cards designed for windows workstation use is much better suited to DirectX (hence the 100 FPS in Java2D).

A better driver might help yes, but there is nothing persay wrong with you card (its probably comparable to a fair amount of the users cards that might end up playing mighty bubbles).

Infact, that might well be a consideration for design. :slight_smile:

Kev

I didn’t choose the card when I bought the laptop. And didn’t imagine that I could have OpenGL issues with it.

[quote]Definitively look for newer drivers.
[/quote]
Yes Iwill.

[quote] Infact, that might well be a consideration for design. Smiley
[/quote]
Well if you’re talking about my game then it might be true.

What about the Pbuffers?

Thanks all!

How do i create a game? ???

[quote]Hi,

my game is now using LWJGL but I have serious performance problems. The game runs only at 10 fps. What Am I missing? I use display list for each sprite I draw. What about Pbuffers do I need them? What is the equivalent of video buffers?

I know that calling Display.update() swap the buffers but I don’t know more about buffers.

I’ve looked at the NeHe tutorials but didn’t find something that helps me. I’ve also checked the red and blue books but I don’t have time right now to read all the docs.

One question: did you compare the performance of Space Invaders between the Java2D and LWJGL implementations when running in window mode? On my laptop (S3 video card), the Java2D runs at 100 fps and the LWJGL at 45 fps. Why???

By the way, my S3 card has only 16 megs of vram.

Please help!
[/quote]
How did you create this game and whats cards?

[quote]Hi,

my game is now using LWJGL but I have serious performance problems. The game runs only at 10 fps. What Am I missing? I use display list for each sprite I draw. What about Pbuffers do I need them? What is the equivalent of video buffers?
[/quote]
Don’t use display lists if you only got one sprite in it. Use display lists when you’ve got a large number of static triangles. You need to batch up all the sprites in a vertex array. You also need to state sort. It’s a lot of work but will probably speed things up quite a bit.

See the SPGL sprite engine at http://www.sf.net/projects/spgl - poke around in com.shavenpuppy.jglib.sprites for a really nifty sprite engine which I’ve been reusing over and over again.

Sprites are located and rotated using fixed point maths btw, which might be a bit confusing.

Cas :slight_smile:

With Java2D, GAGE Timer, LWJGL FMOD and JInput.

I’m in the process of porting my code to LWJGL for performance reasons and give away Java2D (:frowning: this I will miss this API, it’s so easy to use).

My video card on my laptop is S3 Graphics SuperSavage/IXC 16 megs and it runs on a Toshiba Tecra 9000 Pentium 3 1 Gig.

If you want to create a game you’ll have to consider which type of game and the quality of the game you’d like to reach. For non sophisticated 2D graphics Java2D performs very well on windows but not on Linux and Mac yet. On the other hand Sun said recently that when using the OpenGL pipeline of Java2D on Linux it boosts dramaticaly the performance.

For flashy and cool visual effects, LWJGL should be a very good API for that but be aware that once you enter the OpenGL, you have to deal with low level graphics operations so my advice is use LWJGL if you really need it. Unless you’re already fomfortable with OpenGL.

For 3D game I have very few knowledges in this field but consider Xith3D on top of LWJGL. If not, there’s JOGL, jME and others too.

[quote]See the SPGL sprite engine at http://www.sf.net/projects/spgl - poke around in com.shavenpuppy.jglib.sprites for a really nifty sprite engine which I’ve been reusing over and over again.

Sprites are located and rotated using fixed point maths btw, which might be a bit confusing.

Cas :slight_smile:
[/quote]
Thanks Cas.

Where do I get the libs/jars and docs?

eeehh, er, there ain’t no docs :wink: But if you poke around in the sourcecode you should get a reasonable idea of how it works to hack your own version up. (Or figure out how it works and use it as it is :P)

Cas :slight_smile:

Hi Cas,

I’m back to LWJGL/OpenGL. I’d like to get the sources of SPGL. Do you recommend me WinCVS for that or another CVS client? Maybe eclipse does the job correctly?

Eclipse does great.

Cas :slight_smile: