LOD not visible

Problems building or running the engine, queries about how to use features etc.
Post Reply
Anthea
Kobold
Posts: 25
Joined: Tue Oct 28, 2014 1:03 pm

LOD not visible

Post by Anthea »

I like to use LOD for my project. I tried as [url =http://www.ogre3d.org/tikiwiki/MeshLod]wiki[/url] said but I can't see any visual change so far.

First of all I needed to upgrade my SDK and all my meshes to 1.10. I upgraded my meshes with the option -l -3 with a positive output.

Image

Here is my code so far:

Code: Select all

	Ogre::MeshPtr meshPtr = Ogre::MeshManager::getSingleton().load(mesh, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
	Ogre::LodConfig config(meshPtr);
	config.createGeneratedLodLevel(5, 0.5); // At 5 ogre worldspace units use 50% reduced mesh
	config.createGeneratedLodLevel(10, 0.75); // By default, it is using DistanceLodStrategy and proportional reduction.
	config.createGeneratedLodLevel(15, 0.9); 

	config.advanced.useBackgroundQueue = true; // Generate in background thread, later inject with framelistener.
	Ogre::MeshLodGenerator::getSingleton().generateLodLevels(config);

	mEntity = mSceneMgr->createEntity(mName, config.mesh);
Isn't MeshUpgrader generating basic LOD's for me? How do I access the generated LOD's?

Another point: I am doing this for every object in my scene also if they have the same mesh. What is best practise at this point? Create one MeshPtr and use it for serveral Entities or create for every entity an own meshPtr. Does it even make a difference?
User avatar
tod
Troll
Posts: 1394
Joined: Wed Aug 02, 2006 9:41 am
Location: Bucharest
x 94
Contact:

Re: LOD not visible

Post by tod »

I think you also need to set-up the lod strategy in scene manager or something.
xrgo
OGRE Expert User
OGRE Expert User
Posts: 1148
Joined: Sat Jul 06, 2013 10:59 pm
Location: Chile
x 168

Re: LOD not visible

Post by xrgo »

Hello, I am having the same problem, but I am using a manual mesh. I didn't find how to set up any strategy. I think the wiki should mention that part

Thanks
User avatar
tod
Troll
Posts: 1394
Joined: Wed Aug 02, 2006 9:41 am
Location: Bucharest
x 94
Contact:

Re: LOD not visible

Post by tod »

There's a lod stategy manager. If you get the default strategy you will get some kind of a distance strategy. From there you should be able to modify the individual lod levels and have Ogre do the switching for you.
Post Reply