Flickering meshes on Irrlicht 1.4

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
Carnafex
Posts: 15
Joined: Wed Sep 05, 2007 1:32 am
Location: Sydney, Australia

Flickering meshes on Irrlicht 1.4

Post by Carnafex »

Heya all!

I've recently discovered an error that seems to have cropped up in my project since upgrading from 1.3.1 to 1.4

Basically, whenever I load an .X model into Irrlicht, and then animate it (using basic Irrlicht animators, like rotate, etc) it seems to 'flicker' every second or so. By this I mean the model renders and animates perfectly, except that every second it disappears, only to reappear just as quickly.

I'm currently using directx 9 as the renderer, although the problem occurs in dx8 and opengl as well. Oh, and it's the standard 1.4 distribution, not SVN, if that makes a difference.

The code I use is as follows:

Code: Select all

IAnimatedMesh* tempmesh;
IAnimatedMeshSceneNode* tempanimmesh;
	tempmesh = m_pGMgr->smgr->getMesh("Data/Models/temp.x");
	tempanimmesh = m_pGMgr->smgr->addAnimatedMeshSceneNode(tempmesh);
	m_pFleets.push_back(tempanimmesh);
	m_pFleets[i]->setPosition(core::vector3df(lgamedata.m_pStarmap.vFleets[i].x,0,lgamedata.m_pStarmap.vFleets[i].y));
	m_pFleets[i]->setMaterialFlag(video::EMF_LIGHTING, false);
	m_pFleets[i]->setAutomaticCulling(scene::EAC_FRUSTUM_BOX);
(m_pFleets is simply a core::array, nothing special)

I've tried disabling the lighting, changing materials, etc, but nothing seems to fix the weird flickering. Would anyone have any idea why this might be happening?

Any help would be really appreciated!
Luke
Admin
Posts: 449
Joined: Fri Jul 14, 2006 7:55 am
Location: Australia
Contact:

Post by Luke »

not really sure, could you post the mesh you are using?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Try to disable the culling, could be due to non-animated bboxes.
Carnafex
Posts: 15
Joined: Wed Sep 05, 2007 1:32 am
Location: Sydney, Australia

Post by Carnafex »

I tried disabling the culling, and it didn't seem to help.

I've uploaded the model here http://www.megaupload.com/?d=LS4SUMZZ (it's a zip of the .x file with it's texture, very basic.)

In the meantime I'll continue trying different things to see if I can fix the problem as well.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

That's a problem with zfighting. You have several layers on top of each other, without much space in between. Due to floating point inaccuracy it happens that sometimes layers from beneath are drawn on top. You should remove those layers from the mesh. Also try to recalculate the normals and probably also reset vertex colors.
Carnafex
Posts: 15
Joined: Wed Sep 05, 2007 1:32 am
Location: Sydney, Australia

Post by Carnafex »

ah, cool! I'll remove the extra layers and give it a shot!
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

Also just for the record there are some bugs in the Mac OS X version of 1.4 too. In the 2nd tutorial with the Quake map, whenever you get a short distance from some walls they begin to have flickers of triangles at the seam, defined edges between ground and wall. As you move further back the flickering black triangles get bigger and bigger.
TheQuestion = 2B || !2B
Post Reply