Page 1 of 1

[Mesh] How to hide invisible polies ??

Posted: Wed Sep 14, 2005 6:06 pm
by lor
How can I hide invisible poligons, so that the program runs faster ?? I'm not asking about the algorithm of searching invisible polies, but for example if I already know that I can't see some poly, how to hide it, what function to use to select, hide and unhide concrete polies if I have a complete mesh (made in 3ds max) ??

Posted: Wed Sep 14, 2005 6:40 pm
by luckymutt
Invisible as in they are behind something else so cannot be seen?
You'll prolly have to export those items seperately, load them seperately, then just do
node->setVisible(false);
But I wouldn't worry about it much, it's still going to be sitting there in memory, and if I am not mistaken, objects that are unseen (Visible(true) but not within the viewing area) are not taxing your resources.
Besides, if you want that node to show up when you walk around the corner or whatever and it becomes visible, you are going to waste more power to detect if it should be seen or not?

did that describe what you're asking?

Posted: Wed Sep 14, 2005 8:26 pm
by Elise
Study the OctTree scenenode (COctTreeSceneNode in Irrlicht source). It does pretty much what you describe, hide polys from mesh that are not visible.
Basicly you make a custom scenenode and only draw the triangles that should be visible.

Posted: Wed Sep 14, 2005 8:31 pm
by lor
Thanks for answers. It helped me a bit. I've got another question similar, so I'll not make a new thread: How to make my program (game) work faster if it uses irrlicht. On my athl. 2400+ it runs perfectly but on my duron 800 it jumps heavily. There aren't many polies and so on but the game seems to be very slow :?

Posted: Wed Sep 14, 2005 8:50 pm
by JP
Using smgr->addOctTreeSceneNode() should help with that, as said before it will not render unnecessary vertices.

Posted: Wed Sep 14, 2005 10:17 pm
by bitplane
it's impossible to say what's slow if we don't know what the code is doing!
you should profile your code to find out where the slow bits are, then concentrate your efforts there.
for example in dev-cpp, go to the 'execute' menu and choose 'profile analysis' to find out which parts are eating the most processor time

Posted: Thu Sep 15, 2005 12:27 pm
by Electron
Irrlicht also has rather poor culling methods.There are many techniques to reduce triangle count