![](wink.gif)
🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
Polygon problems
Here are some questions over polygons:
- How many polygones could I normally set into a scene? (e.g. P3 667 MHZ / NIVIDA RIVA TNT2 32 MB)
In this case only polygons, no other stuff (for speed testing). I''ve getting only 100000 polygons with 20 FPS on this system, is this normal?.
- Does the graphic hardware normally supports simply one colored sold polygon drawing, and do it support line drawing (I think no)?
- Which OpenGL setting have the most influence on the FPS (glEnable(GL_BLEND)...)?
- In some situations the backface culling is slower as no backface culling, I think this isn''t possible (my program fooling me)? (e.g. glEnable(GL_CULL_FACE); / glCullFace(GL_BACK)
In this case, is there a speed difference in clockwise or anticlockwise sorting?
- Is it right that lighting (glEnable(GL_LIGHTING)) can be very slow? (Yes, I used plane normals...)
- Has OpenGL an intern polygon counter which shows me how many polygons in a frame are drawn? When yes, how could I get this number?
I know some of this questions may be stupid.
Chris
![](wink.gif)
how do you display the 100000 polygons?
with glVertex() or glDrawElements()?
or do you use a displaylist?
// Just wondering, Ankan
with glVertex() or glDrawElements()?
or do you use a displaylist?
// Just wondering, Ankan
i just get around 50 fps when drawing 200 untextured and unlit triangles.... and you get 20 fps when drawing 100000, you should be happy!!!, I have a celeron 550 Mhz with a matrox G400 with latest drivers. What can be wrong with my code if i''m only getting 50 fps @ 200 triangles? i''ve taken lesson 1 and just made a loop which iterates 200 times and 3 glVertex() calls each loop. What''s wrong with that?
Ankan
Ankan
The slowness probably comes from this:
You are making three calls to glVertex3f() each iteration, why not use a vertex array and make one call to glVertex3fv() one call, and only one parameter.
Or, you might try putting the object in a display list.
Try something like that.
-Mezz
You are making three calls to glVertex3f() each iteration, why not use a vertex array and make one call to glVertex3fv() one call, and only one parameter.
Or, you might try putting the object in a display list.
Try something like that.
-Mezz
When a company says their hardware can display 20 millions polygons per second (like the GeForce), it is only a best case scenario.
These are only flat-shaded, no lightning, no whatever, triangles drawn with one vertex definition per triangle (fan-strips, for example, which use, I think, 2+n vertex for n triangles).
Thus, on this best case scenario, you won''t have more than 50FPS for 400k triangles.
You must not forget the fill-rate either, but I don''t think it will make any noticeable difference unless you use high resolutions or FSAA.
EL
These are only flat-shaded, no lightning, no whatever, triangles drawn with one vertex definition per triangle (fan-strips, for example, which use, I think, 2+n vertex for n triangles).
Thus, on this best case scenario, you won''t have more than 50FPS for 400k triangles.
You must not forget the fill-rate either, but I don''t think it will make any noticeable difference unless you use high resolutions or FSAA.
EL
- In some situations the backface culling is slower as no backface culling, I think this isn''t possible (my program fooling me)? (e.g. glEnable(GL_CULL_FACE); / glCullFace(GL_BACK)
In this case, is there a speed difference in clockwise or anticlockwise sorting?
don''t think so
- Is it right that lighting (glEnable(GL_LIGHTING)) can be very slow? (Yes, I used plane normals...)
one directional light is on nvidia processors free
- Has OpenGL an intern polygon counter which shows me how many polygons in a frame are drawn? When yes, how could I get this number?
nope u have to count them yourself
You have to have something wrong with your card man. I have a 2/ppro233 Matrox Millenium and I get about 20 fps with around 2.5k lit, nontextured triangles. Thats with one directional and one positional spot light. Use display lists and vertex arrays when ever possible. I usually get a 10 fps jump using one of the two over immediate mode. Don''t forget backface culling.
ankan666 make your window smaller + watch the fps rise, the reason being glClear(..) isn''t free.
youre getting 50fps with 200 polys try 2000polys u should get about 45fps
youre getting 50fps with 200 polys try 2000polys u should get about 45fps
Good point about glClear(...). If you're inside a totally enclosed draw area (like inside a skybox/dome or whatever), then just skip clearing the color(frame) buffer each frame. Even if you're not enclosed, try it... it looks way trippy ![](wink.gif)
You still need to clear the depth buffer though (if you use it)... there is trick that you can use to avoid this as well, but I can never remember the damn thing![](smile.gif)
More generally speaking, something to avoid in OpenGL is state changes. Switching features on and off willy-nilly will see frame rates plummet, especially changing texture state (swapping texture objects).
Also, avoid redundant vertices whenever possible. Do you really need to specify 3 vertices for every triangle, or are some shared? And try to pack as much stuff between each glBegin(..) and glEnd() as you can.
ahh, random thoughts of a disturbed man...
-------------
squirrels are a remarkable source of protein...
Edited by - Bad Monkey on July 11, 2000 2:37:18 AM
![](wink.gif)
You still need to clear the depth buffer though (if you use it)... there is trick that you can use to avoid this as well, but I can never remember the damn thing
![](smile.gif)
More generally speaking, something to avoid in OpenGL is state changes. Switching features on and off willy-nilly will see frame rates plummet, especially changing texture state (swapping texture objects).
Also, avoid redundant vertices whenever possible. Do you really need to specify 3 vertices for every triangle, or are some shared? And try to pack as much stuff between each glBegin(..) and glEnd() as you can.
ahh, random thoughts of a disturbed man...
-------------
squirrels are a remarkable source of protein...
Edited by - Bad Monkey on July 11, 2000 2:37:18 AM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement