Performance
by Peter Frisch · in Torque Game Engine · 07/01/2004 (5:34 am) · 8 replies
I have to admit that I'm not too deep in the openGL stuff, but I wondered what really makes torque so much faster than a "stupid" openGL viewer. I use a Cosmo3D based viewer these days, which basically does nothing more than providing some scene graph functionality, that traverses a scene graph and sends the openGL commands to the video card. As far as I can see torque does pretty much the same in the very end. So I wondered where the performance comes from. Any ideas?
About the author
#2
07/01/2004 (6:02 am)
*grin* Thanks, but imagine I have no clue about a cars engine. So someone would explain, the RR is faster, because it got more cylinders, hence more cylinder capacity and in the end more horse powers to drive it faster forward. Where is the cylinder capacity in torque?
#3
In general, your OpenGL viewer is going to get a higher framerate than Torque; on the other hand, you can't play a networked car racing game in your OpenGL viewer. ;)
07/01/2004 (8:07 am)
Torque isn't faster than the OpenGL viewer, it's more clever. It will not render things you can't see, and it does level of detail so distant objects draw faster.In general, your OpenGL viewer is going to get a higher framerate than Torque; on the other hand, you can't play a networked car racing game in your OpenGL viewer. ;)
#4
Is it the space partitioning? The fact that torque doen't use materials and every object has to be textured? Anything else?
07/02/2004 (1:31 am)
Hmm ... for perfromance comparison I had a scene in which in both cases 80 objects with about 11000 polygons were visible. No LOD were defined for both scenes and still torque was about 6 times faster. That's why I'm so curious ... in the end both had to render about a million polygons. Is it the space partitioning? The fact that torque doen't use materials and every object has to be textured? Anything else?
#5
07/02/2004 (8:09 am)
I've no idea. Maybe the GL viewer was poorly written. Were all 80 objects onscreen all the time?
#6
Torque uses many different optimizations. There is a lot more than a post can reasonably discuss, but here's a few things to chew on:
View frustum culling: removes objects not in your PVS
Network ghosting: everything from zone management to visibility
Occlusion culling: things you can't see because they are behind something
Vertex buffers: using the hardware the way it's meant to be used
Billboarding: objects at a distance don't need many polys
Distance and fog: objects outside the far plane, or deep in the fog don't render
These are just a few things that aren't done by default in OpenGL, but by using them you can see massive speed-ups. Intelligent use of the GL pipeline lead to faster rendering.
- Brett
07/02/2004 (8:28 am)
Well, now, Ben.. I would figure you could go deeper than that!!Torque uses many different optimizations. There is a lot more than a post can reasonably discuss, but here's a few things to chew on:
View frustum culling: removes objects not in your PVS
Network ghosting: everything from zone management to visibility
Occlusion culling: things you can't see because they are behind something
Vertex buffers: using the hardware the way it's meant to be used
Billboarding: objects at a distance don't need many polys
Distance and fog: objects outside the far plane, or deep in the fog don't render
These are just a few things that aren't done by default in OpenGL, but by using them you can see massive speed-ups. Intelligent use of the GL pipeline lead to faster rendering.
- Brett
#7
07/03/2004 (4:29 am)
Thank you guys, as far as I can tell, I have to assume it's the Cosmo3d library that slows down the rendering, because it's not very smart written.
#8
Of course, usually you want all that stuff, because you're writing a game, not a model viewer.
@Peter: Yeah, if you're using Cosmo3d, then Torque is pretty much guaranteed to be faster.
07/03/2004 (11:37 am)
@Brett: But when it comes to raw on-screen polygon pushing, none of those things matter. If I have a million polygon model, a very simple GL renderer might go faster than Torque because Torque does all that other stuff.Of course, usually you want all that stuff, because you're writing a game, not a model viewer.
@Peter: Yeah, if you're using Cosmo3d, then Torque is pretty much guaranteed to be faster.
Torque Owner Ace