zhucde
31-05-2009 12:33:05
ETL terrain , no terrain shadow:
[attachment=1]2.jpg[/attachment]
to enable the terrain shadow, like ETM:
[attachment=0]4.jpg[/attachment]
i use the code follow:
but it crashed at ET::generateShadowMap, how to resolve ?
[attachment=1]2.jpg[/attachment]
to enable the terrain shadow, like ETM:
[attachment=0]4.jpg[/attachment]
i use the code follow:
Ogre::ColourValue color(mSunLight->getDiffuseColour().r,mSunLight->getDiffuseColour().g,mSunLight->getDiffuseColour().b);
Ogre::Vector3 direction = mSunLight->getDirection();
direction.normalise();
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, GetSceneManager()->getAmbientLight());
ET::generateShadowMap(mArray, m_Terrain, direction, color / 5.0f);
ET::boxFilter(mArray, 2);
m_LightMap->setColourArray(mArray);
m_LightMap->update();
but it crashed at ET::generateShadowMap, how to resolve ?