How does Irrlicht count the polygons?

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
Amt0571
Posts: 128
Joined: Mon Mar 06, 2006 6:29 pm

How does Irrlicht count the polygons?

Post by Amt0571 »

Hello,

I have a mesh that irrlicht, when creating an octtree, it tells me it has 29980 polys. However, using the polygon counter in 3D Studio it tells me it has 14400 polygons. Thats half the polygons that irrlicht is reporting. How is this possible? which is the real number?

I'm asking this because I'm trying to keep the mesh below the 65536 poly limit, but it's growing very fast.

Thanks!
sgt_pinky
Posts: 149
Joined: Sat Oct 14, 2006 11:20 am
Location: Melbourne, Australia

Post by sgt_pinky »

That's interesting. Test it with a small model, where you can count the number of polys by hand. A few flat planes to make a couple of corners, or something like that.
Intellectuals solve problems - geniuses prevent them. -- Einstein
#irrlicht on irc.freenode.net
Saturn
Posts: 418
Joined: Mon Sep 25, 2006 5:58 pm

Post by Saturn »

Don't let 3ds count quads, let it count triangles. One quad --> Two triangles.

There is not a 64k poly limit, but a 64k vertex limit per mesh buffer.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Some mesh loaders are also duplicating some vertices. This depends on material settings and normal smoothing (mostly). But as found in some threads here there's also some optimization potential in Irrlicht :)
Amt0571
Posts: 128
Joined: Mon Mar 06, 2006 6:29 pm

Post by Amt0571 »

With a small model both give the same polycount. It's curious however that if I use any big meshe, the polycount is different... I don't have the time to check where they start to differ... but I don't understand what causes this.

Saturn, how do I get 3D studio to count triangles instead of quads?

And finally, I think that avoiding the 64k vertex limit is as easy as splitting the mesh in two different ones, am I right?
Saturn
Posts: 418
Joined: Mon Sep 25, 2006 5:58 pm

Post by Saturn »

Amt0571, I do not know how to change the counting style. I remember it can count in quads and tries, when I last watched over the shoulder of a modeller. Though this distinction of course only matters, when you model with quads. When you model with triangles, then the count should be correct and it is what hybrid said, problems with the loader. Though I don't know why a loader would create redundant polies, I can imagine vertices, but not polies.

As for the 64k vertex limit, yes, splitting solves the problem.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

But split into mesh buffers, not into meshes.
Amt0571
Posts: 128
Joined: Mon Mar 06, 2006 6:29 pm

Post by Amt0571 »

And how is a mesh splitted into different mesh buffers?

Thanks
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Simply create a new meshbuffer when the old one is full, add it to the mesh and use it for further additions.
killrazor
Posts: 5
Joined: Thu Oct 26, 2006 10:14 pm
Location: Barcelona (find me in the pubs)

Post by killrazor »

I have a similar problem. I'm triyng the terrain render tutorial and I have modified the code by putting this simply line:

Code: Select all

// create triangle selector for the terrain	
	scene::ITriangleSelector* selector =
		smgr->createTerrainTriangleSelector(terrain, 0);
	terrain->setTriangleSelector(selector);
        // this is the line which I've put
	int triangleCount = selector->getTriangleCount();

	selector->drop();
But the height map has 256x256 pixels and the triangle count is 115200. Why? Even being doublesided triangles the triangle count should be 65536*2....
Frank-Lho
Posts: 2
Joined: Wed Dec 13, 2006 6:59 pm

Post by Frank-Lho »

When woring with 3D studio max's editable poly, you'll only get the number of polygons (more than 3 sides). What you want is the number of triangles. Convert your "editable poly" to "editable mesh" and the counter will display the number of triangles.
Post Reply