I tried to include drawing of shades, did as written in an example, but nothing turned out so...
here code of that as I did:
initialization:
Code:
Code: Select all
m_pSceneManager = (TerrainSceneManager *)m_pOgreRoot->getSceneManager(ST_EXTERIOR_CLOSE);
m_pSceneManager->setShadowTechnique(SHADOWTYPE_STENCIL_ADDITIVE);
m_pSceneManager->setShadowFarDistance(80000);
m_pSceneManager->setShowDebugShadows(true);
m_pSceneManager->setAmbientLight(ColourValue(0,0,0));
m_pSceneManager->setShadowTextureSettings(1024, 2);
m_pSceneManager->setShadowColour(ColourValue(0.5, 0.5, 0.5));
Code:
Code: Select all
m_pDefLight = m_pSceneManager->createLight("PointLight");
m_pDefLight->setType(Light::LT_POINT);
m_pDefLight->setDiffuseColour(ColourValue(1,1,1));
m_pDefLight->setPosition(Vector3(0,1000,0));
m_pDefLight->setDirection(Vector3(0,-1,0));
m_pDefLight->setVisible(true);
m_pDefLight->setCastShadows(true);
m_pDefLight->setAttenuation(1000,1,0.00005,0);
Creation of scene:
Code:
Code: Select all
CFile file;
CString buffer;
if(!file.Open(scen->name,CFile::modeCreate|CFile::modeWrite))
{
MessageBox(NULL,"?????? ??????? ???? ???????????? ?????","??????",MB_OK|MB_ICONEXCLAMATION);
return;
}
buffer = "WorldTexture=" +scen->WorldTexture + "\n";
buffer +="DetailTexture=" +scen->DetailTexture + "\n";
buffer +="DetailTile=" +scen->DetailTile + "\n";
buffer +="PageSource=" +scen->PageSource + "\n";
buffer +=scen->PageSource + ".image = " + scen->Heightmap_image + "\n";
buffer +="PageSize=" + scen->PageSize + "\n";
buffer +="TileSize=" + scen->TileSize + "\n";
buffer +="MaxPixelError=" + scen->MaxPixelError + "\n";
buffer +="PageWorldX=" + scen->PageWorldX + "\n";
buffer +="PageWorldZ=" + scen->PageWorldZ + "\n";
buffer +="MaxHeight =" + scen->MaxHeight + "\n";
buffer +="MaxMipMapLevel=" + scen->MaxMipMapLevel + "\n";
buffer +="VertexNormals=yes\n";
buffer +=CString("VertexProgramMorph=yes") + "\n";
buffer +=CString("LODMorphStart=0.2") + "\n";
file.Write(buffer,buffer.GetLength());
CString path = file.GetFilePath();
file.Close();
try
{
m_pSceneManager->setWorldGeometry(path.GetBuffer());
}catch(Ogre::Exception& e)
{
m_ShowOgreException(e);
}
