LOD: Mesh and Material - PixelCount

Everything related to 3D programming
User avatar
Bananenfreak
Enthusiast
Enthusiast
Posts: 519
Joined: Mon Apr 15, 2013 12:22 pm

LOD: Mesh and Material - PixelCount

Post 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...
Image
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 756
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: LOD: Mesh and Material - PixelCount

Post 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
		}
	}
}
User avatar
Bananenfreak
Enthusiast
Enthusiast
Posts: 519
Joined: Mon Apr 15, 2013 12:22 pm

Re: LOD: Mesh and Material - PixelCount

Post 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
Image
User avatar
Bananenfreak
Enthusiast
Enthusiast
Posts: 519
Joined: Mon Apr 15, 2013 12:22 pm

Re: LOD: Mesh and Material - PixelCount

Post 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.
Image
Post Reply