Disable/Configure Terrain Lod

Problems building or running the engine, queries about how to use features etc.
Post Reply
BonneCW
Gnoblar
Posts: 1
Joined: Mon Aug 08, 2016 7:39 pm

Disable/Configure Terrain Lod

Post by BonneCW »

Hey,

I'm working on a game engine based on Ogre3d 1.9. I'm actually trying to change the lodding of my Terrain component for my tower defense game. The problem is most changes don't affect anything (e.g. _mTerrainGroup->setAutoUpdateLod(nullptr);), others do crazy stuff.

So at first the complete Terrain class can be found here: https://github.com/ClockworkOrigins/i6e ... errain.cpp

Actually it looks like this from distance:

Image

The right marker on the right side shows a weird effect I couldn't figure out where it comes from. I think it's also connected to the lod levels. The left one shows that the path is planar up there and so the monsters walk in the ground.

Image

At this screen I moved the camera to the right error. It changed and is less visible. What might be important to mention is, that it actually occures in the middle of the map (0 axis in z direction).

Image

This image shows that the terrain is as expected when moving the camera directly to the position.

So my question is how I can change the lodding of the terrain and what can cause this bug on the right side.

I actually tried:

Code: Select all

_mTerrainGroup->setAutoUpdateLod(nullptr); // no effect, called before generating the terrain

Code: Select all

for (int i = 1; i < t->getNumLodLevels(); i++) {
	t->decreaseLodLevel(); // thought removing lod levels might help, doesn't change anything, called after generating the terrain (of course, it uses the terrain)
}
Deriving from Ogre::TerrainAutoUpdateLodByDistance, but this just removed all layers and everything was green and the bug on the right side was still visible, the lodding is hard to say with everything green.

Code: Select all

class TerrainNoAutoUpdateLOD : public Ogre::TerrainAutoUpdateLodByDistance {
public:
	TerrainNoAutoUpdateLOD() : Ogre::TerrainAutoUpdateLodByDistance() {
	}

	void autoUpdateLod(Ogre::Terrain * terrain, bool synchronous, const Ogre::Any & data) override {
	}

	Ogre::uint32 getStrategyId() override {
		return 2;
	}
};
I hope someone has an idea and can lead me into the right direction. The basic goal is to fix the bug on the right side and in the best case to change the lodding distance or enable/disable lodding dynamically.
Post Reply