Page 1 of 1

LOD: Mesh and Material - PixelCount

Posted: Sat Aug 22, 2015 11:14 am
by Bananenfreak
Hello,

I want to implement MeshLOD to my Project (Because I have a FPSproblem... again).
My idea was to add the LOD, when I´m converting the *.mesh.xml files to *.mesh. I´m running the XMLConverter in interactive mode (-i), asks me if I want to create LOD (y), then the number of LOD-Levels (f.e.: 3) and the strategy I want to use(distance/PixelCount).
I want to use "PixelCount" as strategy, but after that, the Converter still asks me for distances,... .

Does anyone has knowledge in this? I can´t find anything in the Internet about it.


A second Topic is MaterialLOD. Does anyone has an example for this?


Thanks :)


EDIT:
I integrated it with "distance", but it seems to be wrong.
This is, what half of the Terrain looks like:
Image
Now I´m moving just a Little bit and ALL trees are highres:
Image
I though this LOD works with distance, but it is working in an Abstract way I don´t understand...

Re: LOD: Mesh and Material - PixelCount

Posted: Sun Aug 23, 2015 10:36 pm
by Samuel
What's the distance you are using for your Mesh LOD, and approximately how far away is the first tree from the last tree in world units?

As for the Material LOD you need to use "lod_values" in a material script. http://www.ogre3d.org/docs/manual/manua ... 005fvalues

An example.

Code: Select all

material LOD_material
{
	lod_strategy Distance 
	lod_values 100 200
	technique near
	{
		lod_index 0
		pass
		{
			ambient 1 0 0
			diffuse 0 0 0
		}
	}
	technique far
	{
		lod_index 1
		pass
		{
			ambient 1 1 0
			diffuse 0 0 0
		}
	}
	technique distant
	{
		lod_index 2
		pass
		{
			ambient 0 1 0
			diffuse 0 0 0
		}
	}
}

Re: LOD: Mesh and Material - PixelCount

Posted: Mon Aug 24, 2015 7:52 am
by Bananenfreak
MeshLOD-distance = 10
Levels = 2 (distance 0 included)
Between each tree there is a gap of x=10, z=10 -> sqr(2)*10

Perhaps this occures, because I´m using staticgeometry for it?

EDIT: Yes, staticgeometry got a Problem with LOD.
Here you can see the whole Terrain (256x256): https://www.dropbox.com/s/3oyukba81iw3too/LOD3.PNG?dl=0
This is the Terrain without(!) staticgeometry: https://www.dropbox.com/s/n5fsx5kgbl6zv7h/LOD4.PNG?dl=0

LOD works normal. When I´m under 10 WU near the tree, next LODlevel pops up.
But with staticgeometry, LOD is strange. I write a small code and post it here with my treeleaves.

EDIT2: I posted the code in bugsection: http://www.purebasic.fr/english/viewtop ... =4&t=62901

Re: LOD: Mesh and Material - PixelCount

Posted: Mon Aug 24, 2015 2:28 pm
by Bananenfreak
Thank you, Samuel for helping me out.

The meshLOD with Staticgeometry works the way it works, it´s no bug (But (b)ugly :D).

If anyone knows how to get to PixelCount-Mesh-LOD, please tell me.