Huge X meshes

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
Anteater

Huge X meshes

Post by Anteater »

Ok, I think this may be a bug, but I'm not 100% sure, so I'm putting it in Open Discussion.

Anyway, I have a huge X file for my game world (I decided to make my game have just one big world) but I have a problem. After going really far to the right, it looks as if the rest of the level is non-existant, and the camera falls off into oblivion.

The loading code seems to be correct, plus I tried it with both OctTree and Animate scene node types.

Code: Select all

scene::IAnimatedMesh* level1mesh = smgr->getMesh("media/level1.x");
scene::IAnimatedMeshSceneNode* level1node = 0;
scene::ITriangleSelector* triselector1 = 0;
if (level1mesh)
{
level1node = smgr->addAnimatedMeshSceneNode(level1mesh);
level1node->setMaterialFlag(EMF_LIGHTING, true);
triselector1 = smgr->createOctTreeTriangleSelector(level1mesh->getMesh(0),level1node, 0);
level1node->setTriangleSelector(triselector1);
level1node->setVisible(true);
}
It's really odd.
ExtraNoob

Post by ExtraNoob »

Huge in terms of virtual size or as in polycount?

Anyway, my spontaneus reaction is that its furstrum farplane culling (removing polys that are really far away) but I dont know how this is implemented in irrlicht.
Guest

Post by Guest »

try using the setFarValue function. I don't see where you defined your camera.
Anteater

Post by Anteater »

Here's where the camera is defined:

Code: Select all

scene::ICameraSceneNode* camera1 =
smgr->addCameraSceneNodeFPS();
Pretty darn basic, I know. Also, I don't know if this makes any difference, but its not the it appears invisible at a distance, its that the part of the mesh doesn't seem to exist (not visible, the tri selector doesn't pick tris from it, even when the camera is right near it, etc.)
Sorry about posting this topic 3 or 4 times, it was a server error or maybe my stupid slow 56K modem. Try playing Battlefield 1942 on one of those, and you'll find a new meaning of frustration. :D
Oh, and by the way, huge in terms of virtual size, although polycount is also high.
X_for_Extra
Posts: 69
Joined: Mon May 23, 2005 4:42 pm

Post by X_for_Extra »

Chill. He apologized.

Anyway. If there are friggin huge polys in the model its possible that they all fall outside of view box? I dont know if the culling algo is inclusive or not..
Should put something witty here I suppose.
Anteater

Post by Anteater »

Setting the far value doesn't help, because that just increases the draw distance, but setting it to 6000 sure made the frame rate interesting :) Anyway, to make it more clear, it is if my level mesh ended at a certain point, but I know for a fact there is more to the level.
Guest

Post by Guest »

Chill. He apologized.
he is administrator, dont forget that :) i wouldnt talk to him like that (or at least we dont do so in germany, its rude )
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

Np, I removed my post. I hadn't noticed he had already mentioned it. And I had also forgotten how posting on 56k modems was. :D

just trying to keep the forums clean a bit.

carry on! :wink:
Armen138
Posts: 298
Joined: Mon Feb 23, 2004 3:38 am

Post by Armen138 »

maybe you exceeded the maximum amount of triangles your graphicscard can render.... or i remember there was a post on the forums somewhere about some hardcoded limit in irrlicht to 65535 poligons
if you're looking for me, start looking on irc, i'm probably there.
Guest

Post by Guest »

yes, you have this triangle limit (65... blabla). if you want to have more triangles, have a look for 32bit indices,because irrlicht uses 16bit indices. i know that spintz has made a patch for it :)
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

Yep, looks like it's that problem. However, the 16 bit index limit should not be that worse, I think I implemented some of the loaders so that they split up the vertices quite intelligent so that the 16 bit limit is no problem. Looks like I didn't implement this feature for .X files, I don't really remember to be honest.
Post Reply