I switched to Irrlicht .NET recently and I come with a couple of questions on "how to release resources".
Here's the problem :
My world is composed by many terrains (heightmap + texture) and I load them with a basic addTerrainSceneNode. The problem comes when a player leaves on of these terrains... I tried everything but whatever I do, no RAM is released and whenever he re-enters, the resource for the terrain (~50 MO) are reallocated... Moreover, with each new terrain loaded I lose ~10 FPS even if I release old terrain... I even tried to modify .NET wrapper to release resources but nothing has worked... Is there a way to solve this problem ?
2nd "problem" :
I use 256x256 heightmaps and I need to scale them greatly... When there were moutains, the render was horrible, not smoothed at all...
I modified "bool CTerrainSceneNode::loadHeightMap( io::IReadFile* file, video::SColor vertexColor )" in Irrlicht base library and added :
Code: Select all
for(s32 i = 0; i < 10; i++)
{
for(int index = 2; index < (TerrainData.Size * TerrainData.Size - 2); index++)
{
pMeshBuffer->Vertices[index].Pos.Y =
(pMeshBuffer->Vertices[index - 2].Pos.Y + pMeshBuffer->Vertices[index - 1].Pos.Y +
pMeshBuffer->Vertices[index + 1].Pos.Y + pMeshBuffer->Vertices[index + 2].Pos.Y) / 4;
}
}
Thank you for everything (more than all for trying to understand my terrible english :p)