Sign in to follow this  

glutWireTeapot very slow???

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

hi, i made a simple program to show glut primitives like teapot, cube, torus... i realised that wire teapot reduces FPS a lot. with the single window a take about 1800 fps, but with just a glutWireTeapot it downs to 100? (if solid it is 300) is teapot soo high poly and is it normal? or am i making something wrong? how can i up the fps? (i use back face culling, and do not make any color/blend/texture operation) Thank you...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
store it in a display list, otherwise it has to recompute it every frame

Share this post


Link to post
Share on other sites
i know display lists but i just want to know if this framerate is normal? i mean do i make some settings wrong? are there any other function for initGL like backface culling?
thank you..

Share this post


Link to post
Share on other sites
if you were asking, you can turn on/off backface culling iwth glEnable()/glDisable() GL_CULL_FACE, but anywho, as far as the teapot goes, i dont think theres much you can do about it, it is fairly high poly, a few things to think about are: is textureing turned off? is lighting on or off? is it windowed or fullscreen (though ive heard the difference is becomming less and less of a problem) but anyways, yeah

hope that helps
-Dan

Share this post


Link to post
Share on other sites
Don't care about the fps when it's not drawing anything.
It's of course insanely fast if it only has to render a black buffer.
Don't care about the fps when it's that high.
When you draw something it will (on my card) fall 100-200 fps and therefore cannot be acounted with. There's a logical/technical explanation behind this, but just telling it like this, should be enough for you.

I'm guessing you're a beginner to OpenGL and especially the graphics card, since this sort of fps drop could surprise you. But don't worry, just keep learning, and your fps will rise as you learn and try (it did indeed for me ;)).

Also, don't use GLUT (it will ease your work now, but you won't be able to optimize it, which will be needed if you draw more), make the models in a 3D program like Milkshape 3D, Blender or Cinema 4D CE 6 (all free programs) and import them (then you'll have to make a 3ds loader or such, but more experience :P).
Then you can experiment on how to sort and draw the polygons to make most fps. All the programs I've mentioned can make cubes and torus' plus many other primitives (and Cinema also makes humans), but not teapots (well, don't know about Milkshape, but guessing).
This may not be the best for one primitive as you're drawing right now, but which game only had 1 primitive? (don't answer, I know some had...)
You should rather be worrying about drawing 1 million triangles at 100 fps (depends on you card of course) instead of a teapot at 100 fps. Because when you reach the lower fps (< 1000 on my card), then it won't change that much if you draw 10000 triangles more (still, depends on the card, but just erase a couple of 0's on all the numbers, then the point will still remain on lower-end cards).

Learn something about static VBO's (this will make the biggest difference), display lists, culling, import your own teapot (as close to the GLUT one as you can get) and then render them as fast as possible and you'll probaly see a way higher fps count (otherwise, try more and more teapots untill your old, slow, method is too slow). The VBO's wont help if the teapot is below 100 triangles (because the VBO's are slow to set up every frame, but nothing compared to drawing 10000 triangles without them), but rendering a couple of thoudsands of triangles, then you'll see a major change in fps.

Well, I don't know if your card is able to use VBO's, but if it's newer than G3 then it should be able to (probaly also lower than that, but haven't checked it). You can always check the if an extension like VBO is available with glGet or glGetString (don't remember what it's called).

Share this post


Link to post
Share on other sites
thanks for reply but i think noone understand my problem. [sad] i know fps will decrease and i am not suprised for that(i just dont want to tell my pc specs so i give the blank window framerate), in lots of my programs wireframe mode makes fps better. i mean lines are fast from polygons. (even if they are not textured) and i was making this program for my tutorial. not for learning. just realised that wireteapot gives 100 fps and solid gives 300.. so i just wanted to know if there are any special functions for lines in opengl that i did not set? and i asked that if it is normal because it is not normal for me as i tell. [wink]
what about your programs? in wireframe mode do they give higher or lower fps?
thank you..

Share this post


Link to post
Share on other sites
Lower fps in wireframe mode. Something like yours, and I've read the reason somewhere on the net, when I first discovered this "problem", but I've forgotten that now when I need it, of course :P

If you use glPolygonMode with GL_LINES, then I'm pretty sure that the calulations are done in software, so therefore it's slower...

EDIT: just found this thread, which pretty much explains the fps drop: http://www.gamedev.net/community/forums/topic.asp?topic_id=215416

Share this post


Link to post
Share on other sites
>>If you use glPolygonMode with GL_LINES, then I'm pretty sure that the calulations are done in software, so therefore it's slower.<<

naw if it was software itll be a lot slower, my understanding is most drivers in wireframe will draw very thin triangles (so they look like lines) ie each triangle is infact drawn as 3 triangles in wireframe

Share this post


Link to post
Share on other sites
Yes, but then there sure are a lot of calculations involved with that (doesn't sound like it though...), cause the fps wouldn't drop like that, if there wasn't some sort of bottleneck... I just assume it is the driver, but of course I could be wrong ;)

Share this post


Link to post
Share on other sites
i tested some of my 3ds models for line and solid modes, and i just realised that; if the object is lowpoly then fps is better @wireframe mode.. if not, then solid mode gives better results.. is it a normal response? did anyone tried that?

Share this post


Link to post
Share on other sites
Quote:
Original post by stroma
i tested some of my 3ds models for line and solid modes, and i just realised that; if the object is lowpoly then fps is better @wireframe mode.. if not, then solid mode gives better results.. is it a normal response? did anyone tried that?


Well, there shouldn't be a noticable difference at all with wireframe vs. solid in a low-poly model. As for the second part, yes, that's normal. A high-poly model in wireframe would need to render every triangle on the model, since you don't get any benefits of culling.

Share this post


Link to post
Share on other sites
>>Well, there shouldn't be a noticable difference at all with wireframe vs. solid in a low-poly model.<<

yes there should the solid draws more pixels on the screen

this should make it clear(ignoring culling)
bollux numbers but u should get the idea
------------100 tris
wireframe 3*3*100 verts 1000pixels on screen
solid 3*1*100 verts 100000pixels on screen

------------10000 tris
wireframe 3*3*10000 verts 20000pixels on screen
solid 3*1*10000 verts 100000pixels on screen

Share this post


Link to post
Share on other sites
Quote:
Original post by zedzeek
>>Well, there shouldn't be a noticable difference at all with wireframe vs. solid in a low-poly model.<<

yes there should the solid draws more pixels on the screen

this should make it clear(ignoring culling)
bollux numbers but u should get the idea
------------100 tris
wireframe 3*3*100 verts 1000pixels on screen
solid 3*1*100 verts 100000pixels on screen

------------10000 tris
wireframe 3*3*10000 verts 20000pixels on screen
solid 3*1*10000 verts 100000pixels on screen


I said a low-poly model. So < 100 triangles wireframe vs. solid will not make a significant difference in the overall FPS, from my experience.

Share this post


Link to post
Share on other sites
Quote:

I said a low-poly model. So < 100 triangles wireframe vs. solid will not make a significant difference in the overall FPS, from my experience.


hmm maybe i wasnt clear

------------10 tris
wireframe 3*3*10 verts 1000pixels on screen 100fps
solid 3*1*10 verts 100000pixels on screen 90fps

------------10000 tris
wireframe 3*3*10000 verts 20000pixels on screen 30fps
solid 3*1*10000 verts 100000pixels on screen 60fps

Share this post


Link to post
Share on other sites
Quote:
Original post by zedzeek
hmm maybe i wasnt clear

------------10 tris
wireframe 3*3*10 verts 1000pixels on screen 100fps
solid 3*1*10 verts 100000pixels on screen 90fps


I guess I wasn't clear either. But I'm not going to be ignorant and repost my original response.

For one thing, you provided no context in which those numbers came from. For all I know, you pulled them out of your imagination. In the tests I ran on my computer, I'm seeing no noticable (1-3?) difference in the wireframe vs. solid in low-poly models.

Share this post


Link to post
Share on other sites
Quote:
Original post by stroma
i tested some of my 3ds models for line and solid modes, and i just realised that; if the object is lowpoly then fps is better @wireframe mode.. if not, then solid mode gives better results.. is it a normal response? did anyone tried that?


I hate to guess at performance bottlenecks based on so little information, but it sounds like you are pushing the bottleneck around when you change the number of polys. It could be that you are bandwidth limited transferring the data of the high poly models, so you see no savings from drawing fewer pixels. In fact you could have some slowdown due to the overhead of wire frame drawing. If the card is optimized to draw filled polys I could imagine the wire frame overhead being significant. With the low poly models you may be fill rate limited, so drawing fewer pixels gives you savings there.

But this is all just speculation without the app to play with. You might try tracking down your bottleneck in each situation (try resizing the window and see if that affects frame rate, etc.) There are some good articles on that out there.

It's hard to get really useful timings with such high frame rates, small changes in state can have big affects at those speeds. Also FPS is not a linear scale with respect to speed. A drop from 300 to 100 is only a 6 or 7 ms difference, which is still significant, but not as bad as it sounds. That's the same as a drop from 45 to 35 fps for example.

Share this post


Link to post
Share on other sites

This topic is 4730 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this