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.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Well, I''m posting this here because I have tried speeding up my engine a lot of ways, but I can''t... My PC is kinda crap, but the engine I had made in C++ Builder(now I''m working with Dev C++) which was about 3 times as large had WAAY better FPS. I mean, look at the results: PC Specs -------- Intel Pentium 3 866 ATI Rage 128 VideoCard C++ Builder older project ------------------------- Normal FPS: 28 Models on Screen(display lists)(moving): ~40 Textures: some of the models where the same model, so basically they used the same textures. About 10 total. Other stuff: 2D ortho HUD, 3DS/BMP/MIDI loading Dev C++ new project ------------------- Normal FPS: 4~5 (WTF?!) Models on Screen(display lists)(not moving): 2 Textures: 3 Other stuff: 1 alpha mapped billboard, way more modulate/optimized coding, 3DS/BMP/TGA/JPG loading, Fonts Now, my question is, what could be the problem with my new engine''s FPS? Is it the Dev C++ compiler or could it be that the modulated code is giving me trouble? 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''m really, really sure my code is optimized, very processor healthy(heh), and the Render code is actually a for loop with all the objects on the scene( 3 right now ). It''s very disapointing to get this FPS when you think you''re going on the right track, and much worse when you know, your previous crappier engine runs way better. Any comments? help!

Share this post


Link to post
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 this post


Link to post
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 this post


Link to post
Share on other sites
post your rendering code.

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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
Share on other sites
First of all, thanks to every1 that has replied this post.
shadowbobble:
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);
glLoadIdentity ();

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);
glBegin(GL_QUADS);

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?
Thanks to all, please read before posting.

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

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

Share this post


Link to post
Share on other sites