PDA

View Full Version : Improving fps



Chirag Varde
01-23-2011, 06:02 AM
Currently I am in the middle of development of a game using OpenGL. Now I have started to realize that the fps of my game is not so good. I did not consider any display list or any form of optimizing techniques other than the algorithm of collision detection of my game( it causes the app to get slower).

Suggest me the techniques which can help me increase the fps. I thought of reading about display lists, but I found out that it is depreciated and more over it is used to create static graphics and my game is not a static one. I don't have knowledge of any other techniques.

Dark Photon
01-23-2011, 05:05 PM
There are many, many possibilities here. It depends on what you're doing now, and what your bottleneck is.

It'd be better if you post some of your core GL rendering code so folks can provide pointed, applicable suggestions to you.

Even better, package this snippet in a stand-alone GLUT test program so folks can pull and compile locally.

Chirag Varde
01-27-2011, 04:27 AM
thanx for suggestion. Well there were some basic errors in the code and now after correcting them all things are going fine. 50 fps is cool, isn't it?

if I need any help, will post here. :D

ZbuffeR
01-27-2011, 04:47 AM
Submit geometry using VBO.
Try to reduces state changes.
Example, avoid things like use tex1, draw, use tex2 draw, use tex1 draw, use tex3, draw : try to pack together all stuff needing tex1 together.

Dan Bartlett
01-27-2011, 09:51 AM
If you are using immediate mode rendering, eg.

glBegin(GL_TRIANGLES);
glNormal3f(...);
glVertex3f(...);
glEnd();

Then it's possible you could get much higher framerates by using VBOs + vertex arrays. Without knowing the current techniques you are using, or seeing some code, then it's hard to suggest what you could do to improve.

Chirag Varde
02-20-2011, 02:50 AM
I am stuck at some points

I started making game using the basic OpenGL techniques and now I want to incorporate textures into my game and I do not know how?

I tried browsing it on internet and got no help. Basically what I want is simple 2d texture (decal type) on my simple 2d objects. Some are moving and some are stationary. Can any of you give me a simple code for such kind of 2d texture using any format of file. I am developing application on visual c++ 2005 express edition and programming using glut only avoiding any assembly language programming dealing with the windows directly.

Chirag Varde
02-20-2011, 02:57 AM
And about the techniques I am using for making the game, I am probably using OpenGL 1.1 techniques for my game.

1. Immediate mode for drawing objects with use of display lists.
2. For taking inputs from keyboard, I am using glut.
3. irrKlang sound library.
4. C++ coding for algorithm of the game.

That's it. No lighting yet and no textures yet (I want to incorporate textures desperately).

ZbuffeR
02-20-2011, 03:40 AM
Surpising you found nothing. This is both simple and very old.
Read any tutorial on GL textures.
You just need to draw textured quads.
Use any image loading library such as openIL, freeimage, libpng, etc.

Can you be more specific about your problems ?

Chirag Varde
02-20-2011, 03:57 AM
Thank you for consideration

Well I found a code which was creating textures with raw format files. So now I can create textures for any quad using that raw file.

Is there any better way for creating textures other than using raw files as I am having difficulty in finding raw files for desired texture.

ZbuffeR
02-20-2011, 04:23 AM
Please read answers given to you.

Use any image loading library such as openIL, freeimage, libpng, etc.

Chirag Varde
02-20-2011, 05:48 AM
Yeah I am working on openIL.

Thank you for suggestion.

Chirag Varde
03-06-2011, 10:52 AM
hey I am done with game

http://www.mediafire.com/?1ss5zw2pqd233n1

this is the link of the game

Suggestions for the game.

Chirag Varde
05-14-2011, 11:26 PM
can i get suggestions over it??