#### Archived

This topic is now archived and is closed to further replies.

# Reeeaally crap FPS...

This topic is 5115 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

##### Share on other sites
What are you using for vertex submission? If you''re using immediate mode (glBegin( ) glVertex3f glEnd( )etc) then that''s what''s slowing you down, look into using vertex arrays if that''s the case.

##### Share on other sites
quote:
Original post by Monder
What are you using for vertex submission? If you''re using immediate mode (glBegin( ) glVertex3f glEnd( )etc) then that''s what''s slowing you down, look into using vertex arrays if that''s the case.

Yeah, I thought about this case... but then again, the older project used glBegin() and glEnd().. plus, as I said, I''m using Displaylists, so I don''t know if the glBegin/End are an issue in this case.

##### Share on other sites
Hmm I dunno how vertex arrays compare to display lists in terms of speed but I''ve got a feeling vertex arrays are faster.

##### Share on other sites

Also what are the polygon counts of the models you''re rendering? How many texture units are enabled? What resolution are you doing this at? Without more information it is impossible to answer your question.

##### Share on other sites
sure you''re getting a hardware accelerated context?

##### Share on other sites
4-5 fps is not a matter of optimization etc. display lists are fast, all that stuff is, but even 1000 glbegins wont give 4fps. on your system.

like the previous poster said, something is probably wrong with the opengl initialization.

##### Share on other sites
quote:
I''ve used the profiler, but it aint helping, since the functions that are last longer are the loading functions, basically the same ones for the first engine.

You sure you''re not calling some load or init function every frame that only needs to be called once?

##### Share on other sites
quote:

I''ve used the profiler, but it aint helping, since the functions that are last longer are the loading functions, basically the same ones for the first engine.

I run into this problem all of the time. Basically you are going to have to let the application run for more than a few minutes to lower the impact the loading routines have on the overall results. I find that 10-20 minutes works great for that kind of thing.

Have you messed with the order of things at all. All your still sorting by render states and textures etc. You are not creating the display lists every frame are you?

Like the other said some code or high level overview of what you are doing would help quite a bit.

##### Share on other sites
check to make sure your drivers are installed ?

##### Share on other sites
what does glGetString(GL_VENDOR) return?

##### Share on other sites
I''ve never used DevC++, but try this.

Look through your gl libraries etc. You MAY be using the Software mode libraries.

The Software ones are the ones that are from SGI. They run slower overall (except vectors which run faster than hardware for some reason) than the ones that come with Borland.

The Borland ones are the Microsoft OpenGL Distribution (with Intel format libraries instead of the MSVC style libraries). You can get a fresh set from the opengl website somewhere.

Otherwise it could just be your program. Try moving your borland source code (the full engine) into devc++. That way you can accuratly benchmark them against each other. The DEV C++ version should be no more than 2 fps slower than the Borland version unless it is in software mode.

Oh if you can, (lets say that you aren''t using the VCL libraries - ist just a straight win32 or console app) make the project so that it can be compiled both by the dev c++ compiler and the borland one. That way you can use both compilers on the identical engine and see some more accurate comparisons. As I said before, they should be really similar.

##### Share on other sites
First of all, thanks to every1 that has replied this post.
Polygon counts are not an issue, since its the same model I had on the old engine. Its about 600 polygons.
There are about 3 texures available. And finally, the resolution is 640 x 480... really small. Here, I'll post the rendering code:

void Draw (void)
{
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

g_Scene.Render();

glFlush ();
}
...
void CScene::Render()
{
_Camera.Look();
for(unsigned int i=0;i<_Objects.Count();++i)
_Objects[i]->Render();
}
...
void CModel::Render()
{
glPushMatrix();
glTranslatef(_vPosition._x,_vPosition._y,_vPosition._z);
glCallList( _ID_DisplayList );
glPopMatrix();
}
...
void CSprite::Render()
{
float w = (float)(_Scale * _Texture->sizeX / 2);
float h = (float)(_Scale * _Texture->sizeY / 2);

glPushMatrix();

glTranslatef(_vPosition._x,_vPosition._y,_vPosition._z);

if( _DoBillboard )
BeginSphericalBillboard( _vPosition );

glBindTexture(GL_TEXTURE_2D, _Texture->ID);

glTexCoord2f(1.0f, 0.0f); glVertex3f(-w,-h, 0);
glTexCoord2f(1.0f, 1.0f); glVertex3f(-w, h, 0);
glTexCoord2f(0.0f, 1.0f); glVertex3f( w, h, 0);
glTexCoord2f(0.0f, 0.0f); glVertex3f( w,-h, 0);

glEnd();

if( _DoBillboard )
EndBillboard();

glPopMatrix();
}

code_evo & the_phantom: Well, I dont think so... the main initialization is made by nehegl. My initialization is just to load all properties from the scene. The 3DS(make it into a display list, then delete it), the textures, and 1 font.
NewSmyle: Yeah, I've checked loads of times.
Entz: Nope, haven't messed with the order of the things rendered. Basically cuz I have no render states other than enabling/disabling textures(which i think i havent even touched it in the code..). And no..im not creating the display lists everytime as you could see.
benjamin bunny: glGetString(GL_VENDOR) returns "Microsoft Corporation"
Dredge-Master: Well, I'm still trying to port the code from Borland to Dev, but I get some linker errors, I'll be sure to tell you the results when I can.
This is what's on the header of gl.h, could you check if its the same as in yours?

/* $Id: gl.h,v 1.2 2003/02/09 14:12:01 earnie Exp$ */

/*
* Mesa 3-D graphics library
* Version: 4.0
*
*/
...
* Modified this file to better fit a wider range of compilers, removed
* Mesa specific stuff,

In here, it says that the other stuff are on the extensions..but I guess thats for every1's version.. im gonna search for some headers and see the difference... How can I know if its the software version?

[edited by - skullfire on December 17, 2003 12:47:06 PM]

[edited by - skullfire on December 17, 2003 12:49:24 PM]

##### Share on other sites
quote:
benjamin bunny: glGetString(GL_VENDOR) returns "Microsoft Corporation"

That''s the one!

##### Share on other sites
see, thats software rendering

*loves being right*