Hello Guest

Opengl 1.1 vs Opengl2.0 Performance

  • 6 Replies
  • 11223 Views
Opengl 1.1 vs Opengl2.0 Performance
« on: April 11, 2011, 06:14:56 »
Hello, i'm developing a 2D Game Engine with lwjgl and i'm using opengl version 1.1, but i have a performance question: is opengl 2.0 faster than opengl 1.1? i'm asking this because a simple game i made (like a tower defense) runs 850 fps on title screen and 450 on gameplay, i've tried Slick and i can see it runs the demos easily at 850 fps in gameplay,  and even JMonkeyEngine3 runs it's demos at 700 fps, but they are in 3D!, i've tried to optimize my code and i already speed it up by 10-15% but no more, can i expect more speed if i implement opengl 2.0 as in Slick and JME3?  Another question, do LWJGL caps the speed of an application to 1000 fps top??? because i did a test with an infinite loop (without LWJGL) that only calls a function i made to show the FPS on console, and this loop runs at 1'600,000 times per second!!!!!!! why does it slows down to 1000 times per second, when i call the Display.update(); method?

thanks in advance!!!

Re: Opengl 1.1 vs Opengl2.0 Performance
« Reply #1 on: April 11, 2011, 11:39:08 »
I would guess that proper execution of more advanced OpenGL options will speed up your implementation, yes. Otherwise they wouldn't have added them.

Quote
why does it slows down to 1000 times per second, when i call the Display.update(); method?

Because Display.update takes time! :D It causes the buffers to switch so that everything that's been rendered is now on the screen. If you get a max frame rate of 1000, it just means that it takes about 1 millisecond on your computer, which isn't that bad.

Also, I think you're getting a bit over-worried about performance. 450 fps is really good enough for most games.

Re: Opengl 1.1 vs Opengl2.0 Performance
« Reply #2 on: April 11, 2011, 12:54:40 »
450fps is fast enough indeed! but im on a decent pc, when i try it on slower pc's it runs at 60 top and not steady, mainly on the first run (im aware of java's warmup and i've implemented the vm option CompileThreshold) that's why im asking!

Re: Opengl 1.1 vs Opengl2.0 Performance
« Reply #3 on: April 11, 2011, 19:42:16 »
Can you put up a screenshot of your game so I can see how much is going on?

If you're slowing down on an older PC, it's entirely possible that it's such a POS that you don't need to worry - for example, if you only have about 100 textured quads and you're still slowing down on the computer, don't worry about it, either the drivers are bad or there's simply no hope.

Re: Opengl 1.1 vs Opengl2.0 Performance
« Reply #4 on: April 13, 2011, 01:01:39 »
i've uploaded this 4 screenshots, first is the title screen, and the others are from the gameplay, you can see the FPS on the title bar of the window, i have to say... maybe.... it gets slow because i have an image for each "virus" you see there, and all the animations within that image, so in promedy there are 6 images 1700x600 and one image for the background that is 2000x600, and two other images of 400x600 both, is that could be what is doing fps dropping down?? can i improve it to make it faster?





Re: Opengl 1.1 vs Opengl2.0 Performance
« Reply #5 on: April 13, 2011, 02:33:33 »
You said that you're wanting it to run faster on slower computers.  I think the irony might be that 2.0 features don't even work and/or not installed on these computers.  I really don't see how 2.0 would be faster, unless you're taking advantage of newer features that will probably not work on slower computers anyway.  My 2 cents.
cool story, bro

Re: Opengl 1.1 vs Opengl2.0 Performance
« Reply #6 on: April 13, 2011, 11:18:21 »
Good point.

My guess is that you're simply dealing with an old computer that's too old. Conceivably you are running out of texture space; if you're using Power-Of-Two textures (the default) your required texture memory is:

1700x600 = 2048x1024
2000x600 = 2048x1024
400x600 = 512x1024.

Still, I'd imagine you have enough memory, but that is still fairly inefficient texture usage.