[solved] Performance issue with scene nodes
[solved] Performance issue with scene nodes
Hi all,
I'm trying to do some molecular modeling stuff which implie to create a scene node per "atome". My problem is the following : when I try to add average 20 "molecules" of about 20 atome each (what does ~500 scene nodes) the framerate is about 100fps for just rendering them... if I double it then it is largely <30 fps what is unacceptable for what I'm trying to do.
Am I doing wrong with the asumption 1 scene node per atome ? Is there a way to do what I want differently ?
I 'm currently using sphere meshes generated by the scenemanager method addspherescenenode() with a polycount param of 16. Additionaly I use some functions that remove from the scene manager the nodes that are too far to be displayed and gain a lot of fps since in fact I have thousands other molecules not attched to the scene manager.
Thanks in advance for your suggestions : I'm really stuck from now...
I'm trying to do some molecular modeling stuff which implie to create a scene node per "atome". My problem is the following : when I try to add average 20 "molecules" of about 20 atome each (what does ~500 scene nodes) the framerate is about 100fps for just rendering them... if I double it then it is largely <30 fps what is unacceptable for what I'm trying to do.
Am I doing wrong with the asumption 1 scene node per atome ? Is there a way to do what I want differently ?
I 'm currently using sphere meshes generated by the scenemanager method addspherescenenode() with a polycount param of 16. Additionaly I use some functions that remove from the scene manager the nodes that are too far to be displayed and gain a lot of fps since in fact I have thousands other molecules not attched to the scene manager.
Thanks in advance for your suggestions : I'm really stuck from now...
Last edited by Akabane87 on Fri Jun 01, 2012 8:30 am, edited 1 time in total.
Re: Performance issue with scene nodes
Maybe you can use Billboards instead of Spheres...
MTLZ
== Invisible Spirit - http://www.is06.com ==
== Invisible Spirit - http://www.is06.com ==
Re: Performance issue with scene nodes
lol these sphere shapes are temporary. It will be true mesh in the future that have nothing common to spheres and neither could be billbords.
I just tried to use the same mesh for each atom and surprisingly it doesn't change anything... I'm more and more confused
edit : last thing : I read that merging mesh could resolve my problem but in fact it could only do so if I sacrifice any movement or cool displacements my atoms could have relative to each other (what I can do if there is no other way). The second point is that I would need a merging function that can merge in less than 100ms my "molecule" because I want to be able to break a molecule whenever I want.
I just tried to use the same mesh for each atom and surprisingly it doesn't change anything... I'm more and more confused
edit : last thing : I read that merging mesh could resolve my problem but in fact it could only do so if I sacrifice any movement or cool displacements my atoms could have relative to each other (what I can do if there is no other way). The second point is that I would need a merging function that can merge in less than 100ms my "molecule" because I want to be able to break a molecule whenever I want.
Re: Performance issue with scene nodes
How much does it change with smaller/larger polycount values? I'm just wondering if it's the polycount or the nodecount that is the problem here.
Also in case you are on Linux make sure you have hardware accelaration enabled "glxinfo | grep direct" should result in "Direct rendering: Yes".
I just wanted to test some old code of mine for comparison where I had some molecule display (with opengl directly), but unfortunately doesn't compile anymore due to physics library I used back then being outdated *sigh*.
Also in case you are on Linux make sure you have hardware accelaration enabled "glxinfo | grep direct" should result in "Direct rendering: Yes".
I just wanted to test some old code of mine for comparison where I had some molecule display (with opengl directly), but unfortunately doesn't compile anymore due to physics library I used back then being outdated *sigh*.
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: Performance issue with scene nodes
The poly count change nearly nothing but if I create empty scene nodes instead, I get back all the fps (>700 fps). This means my fps issue is a render only issue. But in fact I don't know how to tell the renderer he will have to use the same static X models and textures (for example 20 if I need 20 different objects) each frame at various positions and orientations (defines by my nodes for now). For now it seems to take each node one by one and stupidely transfer the mesh (my sphere) to the gpu after reloading the texture (which is the same too...).
I wonder if I shouldn't code myself the drawAll method to take advantage of the mesh redundancy...
I wonder if I shouldn't code myself the drawAll method to take advantage of the mesh redundancy...
Re: Performance issue with scene nodes
Your problem is a high draw calls count (now an application is CPU bound) so instancing will help You, but You need some tricks to implement it in Your project (You can find an instancing examples on the forum).
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Re: Performance issue with scene nodes
You can avoid uploading the mesh with IMeshBuffer::setHardwareMappingHint to EHM_STATIC. But if changing the polycount changes nearly nothing it probably isn't the bottleneck. Textures should be re-used already.
Do they have for now all the exact same material?
Do they have for now all the exact same material?
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: Performance issue with scene nodes
Yes it seems to be this exactly. What do you mean by instancing ? For my current tests there is a single mesh instance that is used through all nodes.Nadro wrote:Your problem is a high draw calls count (now an application is CPU bound) so instancing will help You, but You need some tricks to implement it in Your project (You can find an instancing examples on the forum).
I tried this trick but it changes exactly nothing...CuteAlien wrote:You can avoid uploading the mesh with IMeshBuffer::setHardwareMappingHint to EHM_STATIC. But if changing the polycount changes nearly nothing it probably isn't the bottleneck. Textures should be re-used already.
Do they have for now all the exact same material?
-
- Posts: 1010
- Joined: Mon Oct 24, 2011 10:03 pm
- Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d
Re: Performance issue with scene nodes
how old is your hardware? (I get pretty good FPS when multitasking on a Pentium IV processor and NVidia 7600 GT and 1.5GB ddr2 ram)
"this is not the bottleneck you are looking for"
Re: Performance issue with scene nodes
This year... laptop core i7 with radeon hd 5800. How can you multitask irrlicht ?
Re: Performance issue with scene nodes
When You will use an instancing, You will draw all meshes by one draw call instead of current 500 calls (You will need only one node and transform matrices).Akabane87 wrote:Yes it seems to be this exactly. What do you mean by instancing ? For my current tests there is a single mesh instance that is used through all nodes.Nadro wrote:Your problem is a high draw calls count (now an application is CPU bound) so instancing will help You, but You need some tricks to implement it in Your project (You can find an instancing examples on the forum).
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Re: Performance issue with scene nodes
Is there some code or explanation on how implementing geometry instancing on irrlicht ? I found the thread where the term is mentionned but it only provide screenshots and high level explanation about grass instancing but nothing on how he performs the instancing...
src: http://irrlicht.sourceforge.net/forum/v ... =6&t=38748
src: http://irrlicht.sourceforge.net/forum/v ... =6&t=38748
Re: Performance issue with scene nodes
AFAIR he used Nvidia's fake instancing, you should be able to find that paper in google.
Re: Performance issue with scene nodes
Finally found something interresting here : http://irrlicht.sourceforge.net/forum/v ... instancing . The term shader instancing had confused me since I was looking for geometry instancing :p.
This should be really usefull in my case ^^.
This should be really usefull in my case ^^.
-
- Posts: 1010
- Joined: Mon Oct 24, 2011 10:03 pm
- Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d
Re: Performance issue with scene nodes
You got me wrong, with multitasking I mean general multitasking (music, video editing, blender with some really high-poly stuffz, GIMP /../)Akabane87 wrote:This year... laptop core i7 with radeon hd 5800. How can you multitask irrlicht ?
"this is not the bottleneck you are looking for"