Problems with MET when updating to Mogre 1.4.8


09-06-2008 19:11:02


First of all I apologize if this isn't the correct forum for this, just thought I might find more people with MET/ETM knowledge from here than the general Help-forum.

I've been using Mogre 1.4.6. and MET 2.2, and everything has worked smoothly. Now I decided to try updating to Mogre 1.4.8, so I downloaded DirectX March Redistributables, changed dll's in my project references and got sample applications to run just fine this way. However I then ran into some problems with projects using MET.

With the same code that worked fine previously, MET now crashes after the following lines with "System.AccessViolationException":

splattingManager_ = new MET.SplattingManager("ETSplatting", "ET", 512, 512, 3);
splattingManager_.NumTextures = 6;

No error message could be found from Ogre.log.

I then tried to compile ETM and MET against 1.4.8. SDK's, which got me past the lines just mentioned, but it now crashes just a few lines later, at the line: splattingManager_.LoadMapFromImage(0, splat1);
again with System.AccessViolationException. Image (splat1) is loaded fine, so the problem isn't there.

Ogre.log says OGRE EXCEPTION(5:ItemIdentityException): SceneNode 'ETTerrain/Terrain' not found. in SceneManager::getSceneNode at d:\cubicalminds\mogreworld\mogre\ogrenew\ogremain\src\ogrescenemanager.cpp (line 784)

Any help would be greatly appreciated, and it would be nice if someone could confirm that (s)he has got Mogre 1.4.8 and MET 2.2 to work so I'll know to keep trying ;)

I'm using Visual Studio 2008.

Here is the code from the function where these crashes happen:
void LoadTerrain()
terrainManager_ = new MET.TerrainManager(sceneMgr_);
terrainManager_.SetLodErrorMargin(2, (uint)viewport_.ActualHeight);
terrainManager_.SetUseLodMorphing(true, 0.2f, "morphFactor");

Mogre.MaterialPtr material = Mogre.MaterialManager.Singleton.GetByName("ETTerrainMaterial");
terrainManager_.Material = material;

splattingManager_ = new MET.SplattingManager("ETSplatting", "ET", 512, 512, 3);
splattingManager_.NumTextures = 6;

float[] hm = new float[513 * 513];
for (int i = 0; i < 513 * 513; i++)
hm[i] = 0.5f;
terrainInfo_ = new MET.TerrainInfo(513, 513, hm);
terrainInfo_.Extents = new Mogre.AxisAlignedBox(0, -500, 0, 2000, 500, 2000);


Mogre.Image im1 = new Mogre.Image();
im1.Load("heightmap.png", "ET");

MET.TerrainInfo.LoadHeightmapFromImage(terrainInfo_, im1);

Mogre.Image splat1 = new Mogre.Image();
splat1.Load("splat1.png", "ET");

Mogre.Image splat2 = new Mogre.Image();
splat2.Load("splat2.png", "ET");

splattingManager_.LoadMapFromImage(0, splat1);
splattingManager_.LoadMapFromImage(0, splat2);




09-06-2008 20:41:36

Unfortunately I have no insight to offer into MOgre, but I can confirm that ETMv2 works with Ogre 1.4.8. I would double-check that you have the correct DLLs and that everything is really linked against the right versions. The error really sounds like some mistake there.


09-06-2008 21:32:57

OK thanks, in that case I'll assume MET should work too. Gonna check the dll's once more.

Edit: Compiled everything from the beginning, used debug dll's every step of the way, still no luck. Now it crashes in a little different place than before though :roll: