Terrain not rendered if shadows/light

Vorl

25-10-2006 11:45:05

Hi again

After having finally been able to use the mapsplitter I have now a problem displaying my terrain. Everything works fine until I try to add shadows. That is when I add
(i) m_sceneMgr->setShadowTechnique( SHADOWTYPE_TEXTURE_MODULATIVE ); whatever the SHADOWTYPE
AND
(ii) add a light (whatever the type: POINT, DIRECTIONAL...)

Independently these both things work but not together: the terrain is simply no more rendered. I know I'm not the first one to run into this problem but I havent found any solution.
It seems really due to the scenemanager because with the generic or the TSM, the same code works.
I'm using a non shader material (such as splatting3) and I dont want to use shader. I have tested different materials and it has no influence on the problem.

I'm with the last PLSM2 sdk and Ogre 1.2.2

This is the main part of my code, nothing special actually I think:

// load terrain
m_sceneMgr->setWorldGeometry( Ogre::String("terrain4_plsm2.cfg") );

// Set ambient light
m_sceneMgr->setAmbientLight( ColourValue(0.7, 0.7, 0.7) );

// shadow type for the scene
m_sceneMgr->setShadowTechnique( SHADOWTYPE_TEXTURE_MODULATIVE );

// Set sun light
Light *sunLight = m_sceneMgr->createLight( "SunLight" );
sunLight->setType( Light::LT_DIRECTIONAL );
sunLight->setDirection( Vector3( -1, -1, 0 ) );


I'm stuck with this for hours. I'm probably missing something. Any idea ???

Vorl