- Polygon count
- Size (resolution) of textures
- Dynamic lighting
- Graphics hardware
- (edit) Culling
- (edit) Batching with CBatchedMesh
Reducing Render Time
-
cheshirekow
- Posts: 105
- Joined: Mon Jul 27, 2009 4:06 pm
- Location: Cambridge, MA
Reducing Render Time
I'm interested in what are some good rules of thumb for designing a scene to keep the frame count high. These are some of the things that I imagine contribute to the render time in a particular scene:
Last edited by cheshirekow on Tue Mar 30, 2010 4:19 pm, edited 2 times in total.
-
Lonesome Ducky
- Competition winner
- Posts: 1123
- Joined: Sun Jun 10, 2007 11:14 pm
-
cheshirekow
- Posts: 105
- Joined: Mon Jul 27, 2009 4:06 pm
- Location: Cambridge, MA
No, good point. Culling is done by irrlicht though right? I guess the question is, if any polygons are culled, will they contribute zero to the render time? Or essentially zero? Or some fraction? Can I make an arbitrarily large scene and then just cull-away the things that are "far" without any contribution to the render time?
I guess it might depend on whether or not the whole object is past the "far" plane. In which case the scene manager may disable it all together. Though if part of it is in-plane, then it will still have to process the mesh and figure out which polygon's are visible right?
I'll probably be doing some far-plane culling eventually for large scenes, but I wasn't thinking about that in my original post. I was only really thinking of like a "room" or something. In which case, the next question is, does irrlicht (or the underlying driver) think about whether or not polygons are obstructed? If so, I suppose that could also cut down on render time as well. If that's the case, maybe "visible polygons" is more of an indicating factor.
Thanks for the input though, and if you happen to know the answers to the above questions, please let me know!
I guess it might depend on whether or not the whole object is past the "far" plane. In which case the scene manager may disable it all together. Though if part of it is in-plane, then it will still have to process the mesh and figure out which polygon's are visible right?
I'll probably be doing some far-plane culling eventually for large scenes, but I wasn't thinking about that in my original post. I was only really thinking of like a "room" or something. In which case, the next question is, does irrlicht (or the underlying driver) think about whether or not polygons are obstructed? If so, I suppose that could also cut down on render time as well. If that's the case, maybe "visible polygons" is more of an indicating factor.
Thanks for the input though, and if you happen to know the answers to the above questions, please let me know!
-
Lonesome Ducky
- Competition winner
- Posts: 1123
- Joined: Sun Jun 10, 2007 11:14 pm
I wouldn't say there's really a rule of thumb for keeping a frame rate. Hardware varies wildly on computers. You don't have the benefit of consoles where if it runs on the one you're testing, it'll run perfectly on the others. Chances are even if you get a program to run quickly on yours, it's not going to run very well on another. I try using a mid range system for testing and try to get around 70 fps. And about the culling, most games now a days use portal culling. Basically it says if you're in this area (like a room), then only these areas can be seen. Obviously if you're in an enclosed room, you won't see most of the other rooms in the buildings through the wall
So if you're displaying an indoor map, you can cull more than 90% of the whole map at most given times using this method. There's also a method called occlusion culling, which is done by the graphics card. I remember an example on these forums a while ago, but I don't have the link anymore.
Draw calls and batching.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
I was thinking about optimizing an .irr file with, let's say, 100 meshes.
My idea was to add all these meshes to one octree node in code. That would help on fps, right? But would it be enough for the effort?
My idea was to add all these meshes to one octree node in code. That would help on fps, right? But would it be enough for the effort?
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps
Step back! I have a void pointer, and I'm not afraid to use it!
Height2Normal v. 2.1 - convert height maps to normal maps
Step back! I have a void pointer, and I'm not afraid to use it!
-
Lonesome Ducky
- Competition winner
- Posts: 1123
- Joined: Sun Jun 10, 2007 11:14 pm
-
cheshirekow
- Posts: 105
- Joined: Mon Jul 27, 2009 4:06 pm
- Location: Cambridge, MA
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:

http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
-
cheshirekow
- Posts: 105
- Joined: Mon Jul 27, 2009 4:06 pm
- Location: Cambridge, MA
Oh nice. That seems very easy to use as well. So for a (mostly) static scene, if all the meshes are batched together using a CBatchingMesh then it will reduce the number of draw calls and speed things up. Roughly speaking, will this be the same as if all the meshes were actually loaded as a single mesh?
-
hybrid
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Yes, that comes very close. Please note, though, that batching everything might become counter-productive. Culling works on a per-node level, so it could happen that much geometry from behind the camera needs to be rendered then. And the number of vertices shouldn't become too high to fill the GPU continuously.
So maybe use an Octree to cull some stuff?
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps
Step back! I have a void pointer, and I'm not afraid to use it!
Height2Normal v. 2.1 - convert height maps to normal maps
Step back! I have a void pointer, and I'm not afraid to use it!