Archived

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

gahre

OpenGL help!!! - opengl performance

Recommended Posts

Help!!! I have < 15 FPS at 2000-3000 triangles drawn! On a Athlon Thunderbird 800 with nVidia geForce 2 GTS with the newest detonator-driver!!! What''s going on? No texturing, only smooth shaded coloured triangles in COMPILED DISPLAY LISTS. There is one display list for each node of my octree. howdy, gahre

Share this post


Link to post
Share on other sites
Perhaps something else in your code?

With my engine, Im doing 5700+ triangles at 120fps, using a quad-tree for culling, using textured tri-strips in display lists for drawing. Also taking care of collision detection and direct input for both keyboard and mouse, running without optimizations, etc.

Im running a GeForce, p3-600, latest DetonatorXP drivers.

Share this post


Link to post
Share on other sites
Whoah! What the hell? I''ve already searched for some expensive stuff in my code, but didn''t really find anything. there must be a mistake in my code that slows the whole thing down. The funny thing is:

If I reduce the number of triangles I get ~75 FPS at 40 tris drawn and ~75 FPS at 600 tris drawn. Maybe it is because I use allegro+win32api??? Or my timer measures wrong (but it has always worked before) maybe the win32api doesn''t like my timer??? I found out that if I give hDC to my octree-building finc to put out some text stuff it is f**king slow if timing is enabled - why that?

Share this post


Link to post
Share on other sites
Are you sure you aren''t regenerating the displaylists every frame? If so, change that :o). Also, what about fillrate? what''s the size of the triangles? It might be that you have too much overdraw.. use some kind of occlusion culling for that.. (Occluders might be an idea..)

cya,
Phil


Visit Rarebyte!
and no!, there are NO kangaroos in Austria (I got this questions a few times over in the states

Share this post


Link to post
Share on other sites
quote:
Original post by gahre
Whoah! What the hell? I''ve already searched for some expensive stuff in my code, but didn''t really find anything. there must be a mistake in my code that slows the whole thing down. The funny thing is:

If I reduce the number of triangles I get ~75 FPS at 40 tris drawn and ~75 FPS at 600 tris drawn. Maybe it is because I use allegro+win32api??? Or my timer measures wrong (but it has always worked before) maybe the win32api doesn''t like my timer??? I found out that if I give hDC to my octree-building finc to put out some text stuff it is f**king slow if timing is enabled - why that?

The FPS locking at 75 is probably because you have your monitor refresh set at 75Hz and OpenGL waits for the vertical retrace. Nothing is wrong with that. If you want to see the true FPS you should change the "Vertical sync" option in the OpenGL settings for your driver to "Off by default" or "Always off" (the exact names may differ for you).

Share this post


Link to post
Share on other sites
Well, that 75 FPS problem is solluted now, but the overdraw stuff not yet. The size of my tirangles is indeed one of my problems, because if I want to prevent triangles from being drawn twice of several times, There is zig-zag where the frustum is culled, I have to include some triangle splitting stuff for my octree nodes. Now I get about 140 FPS at 90 triangles drawn - not very fast! I can''t find any expensive stuff in my code (it''s pretty messy) - but I''m not THE programmer, it''s just a little hobby, so the code is not optimized.

Share this post


Link to post
Share on other sites
Yes, use triangle strips.. they will not speed up rendering _alot_ but they''ll save quite some memory from the display list... I didn''t exactly mean splitting up your triangles is that important.. I wonder how much each triangle covers the screen (-> how much overdraw you''ve got)..

cya,
Phil


Visit Rarebyte!
and no!, there are NO kangaroos in Austria (I got this questions a few times over in the states

Share this post


Link to post
Share on other sites
Another thing: Is there a lot of Alpha blending and stuff like that going on? Disable Alpha test if not needed :o))

cya,
Phil


Visit Rarebyte!
and no!, there are NO kangaroos in Austria (I got this questions a few times over in the states

Share this post


Link to post
Share on other sites
No, no alpha blending going on (so far) and no alpha testing enabled (of course).

I reached ~160 FPS at 90 tris now. I altered the far value in gluPerpective. (to 35.0 :-((((( )

Share this post


Link to post
Share on other sites
When you draw your text, do you use bitmapped fonts?
This may be part of your problem. I''m no expert, just started
learing OpenGL myself recently, but when i use the bitmapped
fonts to draw my text it kills the frame-rate. Although i think
that is a problem related to my Voodoo2 card, i''m not sure.
Has anyone else experiensed problems with bitmapped fonts?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
gahre:

There is something *very* wrong with your engine. On optimal programming (vertex array range, DrawRangeElements, tristrips, direct AGP DMA''s, etc) my engine renders around 180000 triangles at ~40 fps on a GeForce2 GTS. But only very small ones, or you''ll get fillrate limited.

- AH

Share this post


Link to post
Share on other sites
Yeah.
You should be getting nice framrates...hmmm.
What exactly is your program doing ?
What OpenGL commands, what data structures, whats the rendering doing, what ai stuffs going on, blah blah blah blah.
I know you said octrees, smooth shaded tris, compiled display lists, but could you list more of whats going on ?
~V''lion


I came, I saw, I got programmers block.
~V''''lion

Share this post


Link to post
Share on other sites
Well, actually there''s not much going on besides Input stuff, drawing and collision detection. No AI, nothing. I just check for input, transform, draw, do collision detection and then move the player. In my octree I am using compiled display lists for drawind, but the other mothod with glBegin and glEnd brings better results, don''t ask me why, I don''t have the slightest idea. Maybe there''s some other stuff that is faster, because the version with the conventional (???) method is older.

cheers,

Gahre

Share this post


Link to post
Share on other sites
How are you doing your collision detection? Are you testing every triangle or just a couple?

Have you tried profilling your project to see whats taking up all the time?

Care to post the source so we can have a look through to try spot whats going on?

Share this post


Link to post
Share on other sites
I only test a couple, only the node the player is in and only the triangles with whose bounding boxes the player collides.

Post the source? where? in the forum? -> too big, isn''t it?

Share this post


Link to post
Share on other sites
You might be using a software-only feature. Check for any usage of the accumulation buffer... Also, don''t do any stipple transparency.

Also try reinstalling DirectX. Microsoft made Windows require it even for OpenGL.

I once disabled DirectDraw and got the same type of performance problems.

Share this post


Link to post
Share on other sites