irr 0.9 culling bugs ... => low fps => .....

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
Pr3t3nd3r
Posts: 186
Joined: Tue Feb 08, 2005 6:02 pm
Location: Romania
Contact:

irr 0.9 culling bugs ... => low fps => .....

Post by Pr3t3nd3r »

Niko, in 0.9 you made some changes but them are incomplete.
I was having the impresion that 0.9 is slower than 0.8 but i was thinking is only an ilusion .., and because i havn't got time until now i never check it.

The problem is with:
void CSceneManager::registerNodeForRendering(ISceneNode* node, E_SCENE_NODE_RENDER_PASS time)

because in some nodes (for sure in CAnimatedMeshSceneNode, CMeshSceneNode, CShadowVolumeSceneNode, CTextSceneNode) the registerNodeForRendering is called with the second parameter and the result is that the node get register for renderig with out being culled.

Because i'm creating hundred of nodes the fps is droping form more than 50 to 10-17 ...

I tried with if (!isCulled(node)) before rendering the nodes and it's working ... but i'm sure that you want to make other changes ...

And ... some stuff:
the ESNRP_LIGHT_AND_CAMERA the sould be render even if they are not in the view port? any posibility to not register them if ...
... same for ESNRP_SHADOW

And the switch. Isn't posible to take it out? if you are changing the rengering metod (multipasing) or at least rearange'it in an order like this: ESNRP_AUTOMATIC, ESNRP_SOLID, ESNRP_TRANSPARENT, ESNRP_LIGHT_AND_CAMERA, ESNRP_SHADOW, ESNRP_SKY_BOX...
because most of the time the material will be ESNRP_AUTOMATIC (if you change them all to this) or ESNRP_SOLID if you let them like now ...
Ps.
and if you read this meybe you can answer at my question about the sphere ...
http://irrlicht.sourceforge.net/phpBB2/ ... php?t=6305
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

As far as the switch statement, you most likely won't see any difference at all, and it will be faster if you're not using automatic. Switch statements are compiled into binary lookup tables and are very, very fast. I'm assuming you meant replace the switch with an IF and have the most common nodes first in the IF? That would actually probably slow things down a lot.

Switches are much faster than IFs, but are limited to constant and single comparisons. They server a particular purpose which works out very well here.
Image
Pr3t3nd3r
Posts: 186
Joined: Tue Feb 08, 2005 6:02 pm
Location: Romania
Contact:

Post by Pr3t3nd3r »

Spintz wrote:As far as the switch statement, you most likely won't see any difference at all, and it will be faster if you're not using automatic. Switch statements are compiled into binary lookup tables and are very, very fast. I'm assuming you meant replace the switch with an IF and have the most common nodes first in the IF? That would actually probably slow things down a lot.

Switches are much faster than IFs, but are limited to constant and single comparisons. They server a particular purpose which works out very well here.
Depend's on how many objects you have. Ies in this code is 'faster' with the exception that now arew many many poligons forom my many object's send to the graphic card.
Switch statements are compiled into binary lookup tables ... not realy ... only if conting is 0 1 2 3 5 6 4 ... but is nor ...
Not with if ... withh switch( case:0 ; ... 1 2 3 4 5 6 or ....
Pr3t3nd3r
Posts: 186
Joined: Tue Feb 08, 2005 6:02 pm
Location: Romania
Contact:

Request

Post by Pr3t3nd3r »

IGUIButton have
virtual void setImage (video::ITexture *image, const core::rect< s32 > &pos)=0 what alows to use a portion of a big texture.

IGUIImage have only virtual void setImage (video::ITexture *image)=0
there sould be and and
virtual void setImage (video::ITexture *image, const core::rect< s32 > &pos)=0 function
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

Thanks for posting this, that's quite a huge bug making Irrlicht a lot slower. Shame on me that I didn't see it. A short

Code: Select all

if (isCulled(node)) return;
at the begin of CSceneManager::registerNodeForRendering will help.
About the request: Yes, would be an idea.
Post Reply