How can I disable shadows PagedGeometry

monah

11-11-2010 09:51:38

Shadows tune like this:

Ogre:: TerrainMaterialGeneratorA:: SM2Profile * matProfile =
static_cast <Ogre::TerrainMaterialGeneratorA::SM2Profile*> (mTerrainOpt-> getDefaultMaterialGenerator () -> getActiveProfile ());
matProfile-> setReceiveDynamicShadowsEnabled (true);
matProfile-> setReceiveDynamicShadowsLowLod (false);
mSceneMgr-> setShadowTechnique (Ogre:: SHADOWTYPE_TEXTURE_ADDITIVE_INTEGRATED);
mSceneMgr-> setShadowFarDistance (200);
mSceneMgr-> setShadowTextureCountPerLightType (Ogre:: Light:: LT_DIRECTIONAL, 3);
Ogre:: PSSMShadowCameraSetup * pssmSetup = new Ogre:: PSSMShadowCameraSetup ();
pssmSetup-> setSplitPadding (mSceneMgr-> getCamera ("MainCamera") -> getNearClipDistance ());
pssmSetup-> calculateSplitPoints (3, mSceneMgr-> getCamera ("MainCamera") -> getNearClipDistance (), mSceneMgr-> getShadowFarDistance ());
pssmSetup-> setOptimalAdjustFactor (0, 2);
pssmSetup-> setOptimalAdjustFactor (1, 1);
pssmSetup-> setOptimalAdjustFactor (2, 0.5);
mPSSMSetup.bind (pssmSetup);
mSceneMgr-> setShadowCameraSetup (mPSSMSetup);
mSceneMgr-> setShadowTextureCount (3);
mSceneMgr-> setShadowTextureConfig (0, 1024, 1024, Ogre:: PF_X8B8G8R8);
mSceneMgr-> setShadowTextureConfig (1, 512, 512, Ogre:: PF_X8B8G8R8);
mSceneMgr-> setShadowTextureConfig (2, 512, 512, Ogre:: PF_X8B8G8R8);
mSceneMgr-> setShadowTextureSelfShadow (false);
mSceneMgr-> setShadowCasterRenderBackFaces (false);
mSceneMgr-> setShadowTextureCasterMaterial (Ogre:: StringUtil:: BLANK);
matProfile-> setReceiveDynamicShadowsDepth (false);
matProfile-> setReceiveDynamicShadowsPSSM (static_cast <Ogre::PSSMShadowCameraSetup*> (mPSSMSetup.get ()));


by adding a tree in TreeLoader do so:

Ogre:: Entity * ent = mSceneMgr-> createEntity ("Tree" Ogre:: StringConverter:: toString (num), name);
ent-> setCastShadows (false);


but it does not give any result as the shadows were true. Who knows how to disable shadow PagedGeometry?

monah

21-11-2010 13:22:27

Somebody can help me?

keymouse

13-01-2011 06:49:57

I meet the same question, the entity has been setCastShadows(false), but in the scene the shadows still there. somebody can help me!!!
the following code is my shadow setting
m_pSceneMgr->setShadowTechnique(Ogre::SHADOWTYPE_TEXTURE_MODULATIVE);
m_pSceneMgr->setShadowTextureSettings(2048, 1);
m_CurrentShadowCameraSetup = Ogre::ShadowCameraSetupPtr(new Ogre::LiSPSMShadowCameraSetup());
m_pSceneMgr->setShadowCameraSetup(m_CurrentShadowCameraSetup);