too many primitives (65535 instead of 4294967296)

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
Quadorrli
Posts: 6
Joined: Tue Jul 29, 2008 3:31 pm
Location: Winti

too many primitives (65535 instead of 4294967296)

Post by Quadorrli »

hello

i'm trying to create a large terrain as IAnimatedMeshSceneNode due to LOD.

it's a lot of terrain :lol:
At some time the terrain disapeares and i get the errormessage from bellow.

it seems to have a maximum of 0xffffffff but i can not draw that many as the errormessage states :!:

does someone know why it says that the maximum of primitives is 65535 (which is the limit of u16) and not 4294967296?

Codeextraction from CNullDriver.cpp:

Code: Select all

//! Returns the maximum amount of primitives (mostly vertices) which
//! the device is able to render with one drawIndexedTriangleList
//! call.
u32 CNullDriver::getMaximalPrimitiveCount() const
{
	return 0xFFFFFFFF;
}


//! checks triangle count and print warning if wrong
bool CNullDriver::checkPrimitiveCount(u32 prmCount) const
{
	const u32 m = getMaximalPrimitiveCount();

	if (prmCount > m)
	{
		char tmp[1024];
		sprintf(tmp,"Could not draw triangles, too many primitives(%u), maxium is %u.", prmCount, m);
		os::Printer::log(tmp, ELL_ERROR);
		return false;
	}

	return true;
}
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

does someone know why it says that the maximum of primitives is 65535 (which is the limit of u16) and not 4294967296
The CNullDriver implementation of getMaximalPrimitiveCount() is a fallback in case the derived driver doesn't implement it. The value there is wrong, but that shouldn't matter. Actually, the result should always be 65535 or less because Irrlicht uses 16-bit index buffers internally (until 32-bit index buffers are fully supported).

Travis
Last edited by vitek on Fri Aug 15, 2008 3:43 pm, edited 1 time in total.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Why are you trying to use An animated mesh scene node for terrain?

If you want to render a large terrain there are quite a few solutions on this forum which will be easier to use, such as Arras' tiled terrain scene node.
Image Image Image
Quadorrli
Posts: 6
Joined: Tue Jul 29, 2008 3:31 pm
Location: Winti

Post by Quadorrli »

thank you for the response.
until 32-bit index buffers are fully supported
so it's a matter of time?

the terrain does not need to be an animatedmeshscenenode (meshscenenode works too) however does the terrain need to be loaded at runtime via a recalculated mesh,
since i'm using terrain engine libmini with Irrlicht
http://irrlicht.sourceforge.net/phpBB2/ ... 03&start=0.

is there a way to apend an irregular mesh (sort of heightfield with gaps) to a terrain?

i really like stefan röttgers algorythm!
if you have a better idea how to use this alg. i would be glad to read...
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I've updated the libmini example from their webpage to recent Irrlicht 1.4.x, it should be available from the libmini page anytime soon. Just ask those people, they have the full sources for some time now.
32bit indices need a proper interface, and cannot be made the general default due to performance reasons. But Luke's working on this issue, so it might be in one of the next releases.
You can easily update a mesh from a mesh scene node, the API should be clear enough to easily find the correct way.
Post Reply