A question about Geomipmap's Heuristic

Post your questions, suggestions and experiences regarding to Image manipulation, 3d modeling and level editing for the Irrlicht engine here.
Post Reply
lilei9110
Posts: 2
Joined: Thu Mar 09, 2006 6:41 am

A question about Geomipmap's Heuristic

Post by lilei9110 »

Hi, everyone
recently, I'm writing a terrain engine, and I tried Geomipmap algorithm.
I just wonder how the Heuristic with which to switch LOD is derived.
That is really a mystery for me, if anyone of you can help me, I will
really appreciate it.

Thanks.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Most engines use a simple distance based decision. which is also quite common in other LOD applications.
lilei9110
Posts: 2
Joined: Thu Mar 09, 2006 6:41 am

Post by lilei9110 »

hybrid wrote:Most engines use a simple distance based decision. which is also quite common in other LOD applications.
Yes, I know. But, in irrlicht's source code, there's method like this:

Code: Select all

//! used to calculate or recalculate the distance thresholds
	void CTerrainSceneNode::calculateDistanceThresholds(bool scalechanged)
	{
		// Only update the LODDistanceThreshold if it's not manually changed
		if (!OverrideDistanceThreshold)
		{
			TerrainData.LODDistanceThreshold.set_used(0);
			// Determine new distance threshold for determining what LOD to draw patches at
			TerrainData.LODDistanceThreshold.reallocate(TerrainData.MaxLOD);

			const f64 size = TerrainData.PatchSize * TerrainData.PatchSize *
					TerrainData.Scale.X * TerrainData.Scale.Z;
			for (s32 i=0; i<TerrainData.MaxLOD; ++i)
			{
				TerrainData.LODDistanceThreshold.push_back(size * ((i+1+ i / 2) * (i+1+ i / 2)));
			}
		}
	}
I just wonder why irrlicht does this, what kind of principle is behind this.
Post Reply