PDA

View Full Version : need some performance hints!



prich
10-01-2009, 07:37 AM
Hello there!

I'm currently reprogramming an old computer game called ultima online. I'm trying to setup the map an the static data, but i have some serious problems with performance.

The game is split into quads 44x44 pixel.
There is my first question:
I use a VBO to push all my vertexdata(pos * 3, color * 4, tex * 2) into the graphic memory. Now i can render easily with

glDrawArrays(GL_QUADS,0,x); //x is the count of quads

BUT: QUADS are deprecated reffering to this post: link (http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=264745#Post2647 45)
would it be faster to set up index data and render triangles?

Further more i use sometimes alot of textures (~200) per frame (it is not possible to use less, because i already render with ZBuffer and bind every texture just once)
Is there any performance hint you can give me?

This are 2 important questions and i hope some of you can help a beginner in opengl! :)

thx prich

ZbuffeR
10-01-2009, 08:09 AM
some serious problems with performance
Can you be more precise ? milliseconds per frame ? your computer and video card specs ? viewport size ?

Quads are only deprecated from GL 3.x so you don't need to worry too much about deprecation.

would it be faster to set up index data and render triangles?
No.

200 textures is quite a lot, switching textures has a cost. sounds like you can put all your texture ona single one, with carefull texture coordinates : this is called a "texture atlas".

EDIT: and make sure you just rebind textures, and NOT reupload them at each frame (ie. glTexImage2D only called once per texture during the whole life of the program)

prich
10-01-2009, 08:45 AM
ok

the renderaction takes about 1,3 ms
if have about 200 fps every frame (but there will be added more textures)

i use archlinux with flgrx. Card: ATI Mobility Radeon HD 3650

the application is developed in java using lwjgl...

i only bind my textures and upload them once

ZbuffeR
10-01-2009, 09:10 AM
1.3 ms ? come back when you are at 130 ms per frame :)

You have to understand that performance is never completely linear to one criterion. Maybe the limiting factor is number of pixel to render, or number of calls, or number of triangles, or maybe number of textures, or other things...

Out of curiosity, do you have any reasons to use lwjgl, instead of jogl ?

prich
10-01-2009, 10:03 AM
when i started i only knew lwjgl because of jMonkeyEngine and Slick2D...
Also lwjgl offers OpenAL which i really like :)

would you recommend jogl? is there such a HUGE difference?

ZbuffeR
10-02-2009, 01:00 AM
Probably not much, but jogl became standard for jdk 1.5 or 1.6 so it might help for the deployment.
I don't have a lot of experience with either lwjgl or jogl, so I was just asking.