Simply too many meshes...

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Kaiser
Posts: 12
Joined: Thu Nov 22, 2007 3:59 pm

Simply too many meshes...

Post by Kaiser »

OK, I accept that there will come a point at which my computer just can't render as fast as I want it to, but surely it can handle rendering 256 spheres?! When I put in that many I end up dropping down to about 15 fps. I have more faith in Irrlicht(and my computer) than that...

Is there any possible way of rendering 256 independent SceneNodes at a more reasonable rate? I shudder to think of how it would perform when I finish the game, where it might be required to render several thousand of them...
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Have you tried running with release builds of Irrlicht and your app? There can be a huge difference in performance.

Also, are you doing anything other than just rendering spheres? Like, collision detection.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Kaiser
Posts: 12
Joined: Thu Nov 22, 2007 3:59 pm

Post by Kaiser »

Well to be honest, I'm using Irrlicht.NET. I don't know how badly that will decrease the performance... Also no. The lag persists whether I check for collisions or not.
GameCreator
Posts: 22
Joined: Wed Jun 08, 2005 2:44 pm

Post by GameCreator »

I suppose we should get the simple stuff out of the way as well:
- You're rendering with DirectX or OpenGL, right (as opposed to software)? Have you tried switching from one to the other? Does that change performance?
- And each sphere is composed of a "reasonable" amount of polys, right?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Indeed, sphere with a decent tiling can have pretty many tris, I think the default has 32^2 tris, at a total of 262144 tris with 256 spheres. Quite a lot for lightweight gfx cards. But that reminds me of a good test for VBOs :)
Kaiser
Posts: 12
Joined: Thu Nov 22, 2007 3:59 pm

Post by Kaiser »

Each sphere contains exactly 200 triangles, which, although it isn't quite as much as 1024, is still probably a hefty load for a graphics card as weak as mine. I've also tested all of the available options, and so far it seems like Direct3D9 works best.

Is my search for answers fruitless? Is there really no way to get around the lag? :(
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

The quick thing to augment frame rate, is to use the fog and lower your camera depth level (FAR value of the view frustum). So the card won't have all theses spheres to render.

Also if they are really "rounds" as a sphere. A trick could be to use some billboards. (Would could perhaps need the extended billboard node). The only problem is that the spehere textures would not "rotate" depending of the angle of vision unless you do anothe programming trick.

Another thing would be to use LOD (Level of details). Calculate the distance from the camera to the object and replace it with variation of the sphere (EX: Very Far: Billboard, Far: A sphere with 60 tris, Near: Sphere with 200 tris,Very near: Spehre with 400 tris). You will have to replace each node at each frame (if your camera moved) with the LOD needed for that particuliar frame.
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Post by MasterGod »

christianclavet wrote:The quick thing to augment frame rate, is to use the fog and lower your camera depth level (FAR value of the view frustum). So the card won't have all theses spheres to render.

Also if they are really "rounds" as a sphere. A trick could be to use some billboards. (Would could perhaps need the extended billboard node). The only problem is that the spehere textures would not "rotate" depending of the angle of vision unless you do anothe programming trick.

Another thing would be to use LOD (Level of details). Calculate the distance from the camera to the object and replace it with variation of the sphere (EX: Very Far: Billboard, Far: A sphere with 60 tris, Near: Sphere with 200 tris,Very near: Spehre with 400 tris). You will have to replace each node at each frame (if your camera moved) with the LOD needed for that particuliar frame.
Although I don't have this problem this solution sounds very insightful. Maybe I'll use that in the near future so thanks.
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
Mirror
Posts: 218
Joined: Sat Dec 01, 2007 4:09 pm

Post by Mirror »

he is right max sphere size is just 254x128 resulting in 32512 faces or 65024 polys which is not too much for modern cards. so just with that ( .irr file ) i get the same low FPS ..about 17.. while on the DEMO coming with irrlicht it shows a framerate of 70 with 600 polys. huge difference. ( nvidia 6600 here )
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Mirror wrote:he is right max sphere size is just 254x128 resulting in 32512 faces or 65024 polys which is not too much for modern cards. ... ( nvidia 6600 here )
65000 Polys are rather a lot and I wouldn't be surprised if that's already slowing down a nvidia 6600. I have a 6200 and the FPS hit is always noticable here above 60000 polys.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Kaiser
Posts: 12
Joined: Thu Nov 22, 2007 3:59 pm

Post by Kaiser »

Thanks for the input guys. At this point it may be difficult to effectively implement the LOD idea, but I think its definitely worth a try. It seems reasonable to expect the user to suffer some lag if they try to view their entire army up close.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Ok, Luke has VBOs working, and I just had 256 spheres with 1024 tris each at over 100 FPS (on this old 6600 here) :D VBOs FTW (and Luke of course) :D
Mirror
Posts: 218
Joined: Sat Dec 01, 2007 4:09 pm

Post by Mirror »

CuteAlien wrote:
Mirror wrote:he is right max sphere size is just 254x128 resulting in 32512 faces or 65024 polys which is not too much for modern cards. ... ( nvidia 6600 here )
65000 Polys are rather a lot and I wouldn't be surprised if that's already slowing down a nvidia 6600. I have a 6200 and the FPS hit is always noticable here above 60000 polys.
then how come that the Demo.exe has 500k polys and runs decently with 70+ FPS ?

edit :

i have some ideas on how to implement LOD with meshes. if someone is interested i will elaborate.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Mirror wrote:
CuteAlien wrote:
Mirror wrote:he is right max sphere size is just 254x128 resulting in 32512 faces or 65024 polys which is not too much for modern cards. ... ( nvidia 6600 here )
65000 Polys are rather a lot and I wouldn't be surprised if that's already slowing down a nvidia 6600. I have a 6200 and the FPS hit is always noticable here above 60000 polys.
then how come that the Demo.exe has 500k polys and runs decently with 70+ FPS ?
Don't know. I just started the demo now for the first time and yes, seems you are right. I got the numbers from my own game which is using an older version - maybe Irrlicht got that much faster - or I used larger polygons, other lights, other materials, whatever. Polygoncounts are probably a bad unit for measuring speed anyway. I'm surprised that the demo has that many polygons.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

IMHO the demo has 500k polys *per second*, which reduces to about 10k polys rendered per frame. And the demo has octree meshes, so even if the total polycount is much larger you do some efficient culling in there.

Oh, I have a discrete LOD scene node, but I'm not sure how to use it with arbitrary scene nodes and at the same time exposing all necessary interfaces (e.g. animatedmeshscenenode, billboardscenenode, etc.). I tested it with differently tesselated spheres, works pretty well.
Post Reply