Using CHC in PLSM2

ming4883

08-01-2007 07:30:55

Dear all,

Since the PLSM had implement the CHC algorithm; I would like use it to display my urban scene,
however my screen appears blank after I enabled the CHC.

The following code is how I create the PLSM and how to enable CHC:

mSceneMgr = Ogre::Root::getSingleton().createSceneManager(Ogre::ST_EXTERIOR_REAL_FAR);

mCamera = mSceneMgr->createCamera("Default");
mViewport = mWindow->addViewport(mCamera);
mViewport->setBackgroundColour(Ogre::ColourValue(0.2f, 0.2f, 0.2f, 1.0f));

mCamera->setNearClipDistance(0.01f);
mCamera->setFarClipDistance(1000.0f);
mCamera->setAutoAspectRatio(true);
mCamera->setFOVy( Ogre::Radian(Ogre::Math::PI / 4.0f) );
mCamera->setPosition( Ogre::Vector3(0.0f, 10.0f, 10.0f) );
mCamera->lookAt( 0.0f, 10.0f, 0.0f );

// PLSM2 Init
Ogre::String cullMode("CHC");
bool cullDebug = true;

mSceneMgr->setWorldGeometry(""); // since I don't need terrain
mSceneMgr->setOption("CurrentOptionCamera", mCamera);
mSceneMgr->setOption("setCullingMode", &cullMode);
mSceneMgr->setOption("CullDebug", &cullDebug);
mSceneMgr->setOption("ShowPagingLandScapeOctree", &cullDebug);


Then I add the buildings to the scene by creating SceneNodes and attaching entities to those SceneNodes.

i.e.

Ogre::SceneNode *node = mSceneMgr->getRootSceneNode()->createChildSceneNode("buildingA-01");
Ogre::Entity *ent = mSceneMgr->createEntity("buildingA.mesh");
node->attachObject(ent);
node->setPosition(0, 0, 0);
node->setOrientation(Ogre::Quaternion::IDENTITY);


I am using the Ogre 1.2.4 and the PLSM plugin is built form the lastest source code in http://tuan.kuranes.free.fr/Ogre.html.

As I don't need the terrain, I just added the file "colors.material" to my resource path.


Am I did something wrong / have I miss something important in order to use the CHC in PLSM?


Thank you very much for your attentions and any answering.

sklug

09-01-2007 02:47:34

I posted about this a while ago and haven't heard anything. I use terrain, and I get a black screen there as well. Tried to trace through it, but it's difficult to follow without a description of the algorithm. I keep meaning to get back to it, but it keeps getting pushed down in priority, since my scene complexity does not yet warrant CHC.

Hopefully our busy benefactor will get a chance to look at it one of these days.

sklug

Anonymous

11-01-2007 13:12:46

Did you name the entities correctly - names are supposed to begin with "Static", "StaticOccluder", "Occludee"?
http://www.ogre3d.org/wiki/index.php?title=Paging_Scene_Manager#Coherent_Occlusion_Culling_.28CHC.29

ming4883

12-01-2007 08:27:29

I haven't try this before.

After I test this; I will post the result here.

Thank you very much for your suggestion. :D

ming4883

13-01-2007 04:04:04

I have tried following the name conversion, some scenes still doesn't work :-(

tuan kuranes

16-01-2007 14:31:11

Can you pack a bug source that demos bug so that I can reproduce it ?