Shadows :(

Problems building or running the engine, queries about how to use features etc.
Mightimus
Gnoblar
Posts: 4
Joined: Thu Jan 20, 2005 9:21 am

Shadows :(

Post by Mightimus »

Hello!
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)); 
	
creation of source of lighting :

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); 
   } 
Please, say me where here is an error? How to do is it correct?[/code]
Mightimus
Gnoblar
Posts: 4
Joined: Thu Jan 20, 2005 9:21 am

Post by Mightimus »

Anybody?
Mightimus
Gnoblar
Posts: 4
Joined: Thu Jan 20, 2005 9:21 am

Post by Mightimus »

with it I understood
A theme is closed...
all problem was in initialization:
InitRenderSystem("Direct3D9 Rendering SubSystem","1024 x 768 @ 16-bit colour");
should be:
InitRenderSystem("Direct3D9 Rendering SubSystem","1024 x 768 @ 32-bit colour");
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67

Post by sinbad »

And the moral is.... read Ogre.log first!