Archived

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

Why so slooooooow?!?!

This topic is 5112 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

I created a simple 3d engine that loads and displays simple objects on the screen (using x files) for small scenes i can get a pretty reasonable frame rate, but on more complex objects the scene slows dramatically... i see people who have their engines running at 100+ fps while the top i have seen for my demos was around 61... on my laptop i got 32 when the scene was visible, then it went to around 60 when the scene was not visible... Does anyone know how i can increase my framerate? for pictures and more information about the engine, please visit: sky.prohosting.com/gibsoncj/

Share this post


Link to post
Share on other sites
Yeah im sorry about that, i was in a hurry to write this message and was way too vague... what kind of information do you need? At this point i just dont know what to give you, so it would be great if you could tell me what you need...

[edited by - Pirosan on December 15, 2003 9:42:31 PM]

Share this post


Link to post
Share on other sites
Well, define system specs of the machines you tried it on, what do you mean by complex objects, how many polygons are you trying to push, what version of DX or OGL, what are you trying to do with your scene.

Asking anyone here to give you advice on the information you gave, is like me saying to you "I have a car, but something is wrong. Can you tell me ?"

Share this post


Link to post
Share on other sites
Well mainly, what kind of culling are you using? Are you sending every object down the pipeline? Do you have backface culling enabled? Are you using frustrum culling at all?

These things matter greatly in improving your framerate, even for "simple" objects. There are lots of articles here on gamedev.net about culling, I advise that you read up, then modify your pipeline

Share this post


Link to post
Share on other sites
I know that backface culling is enabled, and since the scene gets dramatically faster when it isnt visible, im pretty sure i have frustrum culling as well... Also, when i said complex objects i meant objects with more polygons than a box

[edited by - Pirosan on December 15, 2003 10:02:21 PM]

Share this post


Link to post
Share on other sites
Yes i am actually looking into distance fog right now...
But, even when the scene is empty (seriously... 0 polygons) any computer that runs it runs at about 60 fps...

Share this post


Link to post
Share on other sites
naa, not yet

occlusion culling is later in the gig.

If you are pusing less than 100,000 poly, and you are getting 32 fps, it depends on SEVERAL things.

What is the grafx card? What version of DX? What are the sys specs? How are you creating Vertex Buffers, What drawing methods/textures are you using? Are you sorting your objects by textures? I mean, give us some help here!

There is still a slu of information you have not told us!

Share this post


Link to post
Share on other sites
Ok lets see... im using directx 8 and so far EVERY computer that has used the demo i came up with (10-15 comps of different speed and graphics capability) all ended up with 60 frames a second...

My laptop, a beef of a comp, is the only one to score really below 40 (im pretty sure)...

My other comp, with a ConquererFX 5200 Plus and a 2.3 gigahertz celeron processor ran at 60-61 all the time...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Could be vertical sync. You can''t get reliable FPS measurements with that on. 60 Hz is a fairly common (although somewhat low) refresh rate.

Share this post


Link to post
Share on other sites
so do the other engines that run at 100+ fps not wait for verticle sync? wouldnt that cause slicing (er whatever its called)

Also, im not exactly sure if this is another problem, but u see i do the calculations and changes in scenery everytime i render the scene... probably slowing my fps even more... should i just do the changes (and calculations) constantly and only render when the previous frame is done being writton onto the screen?

Share this post


Link to post
Share on other sites
It''s called tearing, and I''ve turned off waiting for VSYNC and still max out about 62 FPS, and I''ve proven that there''s some B.S. time in there where I can do AI/ColDet/etc and not lose framerate/frametime.

Share this post


Link to post
Share on other sites
Are you using textures? Bad textures can decrease your fps dramatically.

If you are using x-files, probably your render method is like:

for(DWORD i = 0; i < nMaterials; i++)
{
device3D->SetMaterial(&Materials);
device3D->SetTexture(0, Textures[i]);
mesh->DrawSubset(i);
}

This method can set the textures many times per frame. The key is to write a routine to set each texture ONCE per frame.

Also, optimize your meshes:
DWORD *pAdj = new DWORD[mesh->GetNumFaces()*3];
mesh->GenerateAdjacency(0.0f,pAdj);
mesh->OptimizeInplace(D3DXMESHOPT_ATTRSORT, pAdj, NULL, NULL, NULL);

Share this post


Link to post
Share on other sites
60 fps is standard for most flat panel active matrix LCD displays. They don''t flicker like a CRT would at that frame rate.

Games that get higher FPS turn off VSYNC. Ideally, they also use triple buffering.

You haven''t told us at all:

How many meshes?
How many vertices per mesh?
How many polys per mesh?
How many materials (textures) per mesh?
Are you view frustum culling the meshes?
What is the framerate if you make the window/screen 320x240?
What is the framerate if you make each mesh just be a cube (i e, very low number of verts but same screen area)?
What is the frame rate if you use the same, 8x8 size, texture for all the meshes?

Once you answer these things, you''ll probably figure out what the problem is. My guess: your old laptop doesn''t have Hardware Transform and Lighting, so you''re vertex limited. To give it a double-punch, that old laptop ALSO has a slow CPU, which has to be spent BOTH transforming vertices AND doing your main processing.

The only way to make the situation worse would be to also make the graphics "intergrated" which means the CPU, rasterizer and frame buffer are all fighting for the same main memory bottleneck. That''ll make it run REALLY slowly.

Share this post


Link to post
Share on other sites
the slowness... it burns doesnt it
Thats why i took my old desktop and added all i could to make it run fast and smooth... it works so nice :D

hrm... tangent alert

Ok, well i see what ur saying, and im pretty sure its the vsinc effecting the program... ill give u an update if i come up with otherwise...

THOUGHT: well, one of my comps has a higher refresh (i think around 85) but still stays at 60 fps... hmmm

[edited by - Pirosan on December 15, 2003 12:37:56 AM]

Share this post


Link to post
Share on other sites
By the way, i have two simple demos up and running at this point, below are links leading to the zip files:

Good lighting and text demo:
http://sky.prohosting.com/gibsoncj/Osiris01.zip

Weird lighting demo:
http://sky.prohosting.com/gibsoncj/Osiris02.zip

These show the fps so anyone who downloads these are welcome to post their fps

PS:the lighting and text demo has a cool feature... press esc to go into bullet time (i just goofed around... nothing fancy but fun )

Share this post


Link to post
Share on other sites
YEP, definately a VSync thing! Do what I told you about the PresentationInterval!!!

Say, not a bad demo! The Intro screen is fantastic! and the light demo is well thought out! But I would suggest zipping the release version instead of the debug version. will cut the exe 1/3!

Share this post


Link to post
Share on other sites