Meshes disappearing from view too early

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
motorfreak
Posts: 21
Joined: Thu Feb 20, 2014 7:39 pm

Meshes disappearing from view too early

Post by motorfreak »

I have a problem with meshes disappearing from view when they are still in view. Like when I start moving the camera away from the mesh it can disappear and then reappear - when I think what the engine wants to do is hide it when it goes out of view. I have a custom scene loader and I have tried calling MeshBuffer->setDirty after creating a mesh buffer but it did not help.

Any ideas on what can be causing this?
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Meshes disappearing from view too early

Post by hendu »

Your bounding box is incorrect.
CuteAlien
Admin
Posts: 10035
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Meshes disappearing from view too early

Post by CuteAlien »

Note that you also can have different culling-types. See ISceneNode::setAutomaticCulling which takes one of E_CULLING_TYPE.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
motorfreak
Posts: 21
Joined: Thu Feb 20, 2014 7:39 pm

Re: Meshes disappearing from view too early

Post by motorfreak »

I have had no problem with IMeshSceneNode. It is only the IOctreeSceneNode that culls incorrectly.
CuteAlien
Admin
Posts: 10035
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Meshes disappearing from view too early

Post by CuteAlien »

Changing octree settings is unfortunately so far only possible by changing the defines in Octree.h and recompiling the engine.

It's been a while since I used Octree (the places I used it back then were probably better handled by setting meshbuffers to EHC_STATIC instead). But back then I used the following settings:

Code: Select all

 
//! use meshbuffer for drawing, enables VBO usage
#define OCTREE_USE_HARDWARE true
//! use visibility information together with VBOs
#define OCTREE_USE_VISIBILITY true
//! use bounding box or frustum for calculate polys
#define OCTREE_BOX_BASED false
//! bypass full invisible/visible test
#define OCTREE_PARENTTEST
 
And before you ask - I would also prefer having the parameters more flexible, having more tests etc - but so far no one volunteered to rework the octree.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply