the ShadowMap is not correct !


03-02-2010 05:59:27

I use ETL(ETM has the same problem), i generate terrain shadow with follow code:

Ogre::ColourValue color(mSunLight->getDiffuseColour().r,mSunLight->getDiffuseColour().g,mSunLight->getDiffuseColour().b);
Ogre::Vector3 direction = mSunLight->getDirection();

if(direction.x == 0.0f && direction.z == 0.0f) return;
// calculate new lightmap
ET::ColourArray2D mArray (m_LightMapSize,m_LightMapSize, Ogre::ColourValue::White);
ET::generateLightMap(mArray, m_Terrain, direction,
color, mSceneMgr->getAmbientLight());
ET::generateShadowMap(mArray, m_Terrain, direction, mShadowColor );
ET::boxFilter(mArray, 2); //blur

the result is :

you see, the terrain's shadow is not correct, it won't farther than tree's shadow, tree's shadow generated by OGRE shadow technology,
correct is :

what's wrong ? anybody help me?