Page 1 of 1

[2.1] Are levels of detail (LODs) supported?

Posted: Tue Mar 20, 2018 10:38 pm
by xissburg
I have imported a mesh with LODs but it doesn't work. In this case it is a "manual" LOD because I have a separate mesh so it doesn't just use the same vertex buffer with a different index buffer specifying fewer triangles (I think that is the difference between manual and automatic LODs, correct me if I'm wrong). The code/comment at OgreMesh2.cpp-546 seems misleading because it says "So far we only import manual LOD levels." and then it only gets the LOD values from the mesh "if( !mesh->hasManualLodLevel() )".

So, overall, what's the current status of LODs? Am I missing something?

Thanks

Re: [2.1] Are levels of detail (LODs) supported?

Posted: Tue Mar 20, 2018 11:06 pm
by xrgo
Working for me using autogenerated lods:

Code: Select all

    Ogre::LodStrategyManager::getSingleton().setDefaultStrategy( "screen_ratio_pixel_count" );
and:

Code: Select all

Ogre::MeshLodGenerator::getSingleton().generateAutoconfiguredLodLevels( myMesh );

Re: [2.1] Are levels of detail (LODs) supported?

Posted: Wed Mar 21, 2018 10:24 am
by Hrenli
For manual LODs check this thread:

viewtopic.php?f=25&t=93330

I am using SolarPortal's workaround and it seems to work fine.

Re: [2.1] Are levels of detail (LODs) supported?

Posted: Thu Mar 22, 2018 5:25 am
by xissburg
What SolarPortal is doing is to simply assign values to mLodValues. That still assumes the LODs use the same vertex buffer as the original mesh with a different index buffer with fewer triangles (and I have actually tested that as well). I need to use a different mesh at each LOD, with different vertices. After digging through the code I found that v1 meshes use an array of MeshLodUsage (mMeshLodUsageList) to store LOD info and for "manual" LODs it stores the mesh name and loads it when needed. OgreMesh2.cpp has a bunch of commented code which references mMeshLodUsageList so I can confirm that this is not implemented.

And now I'm wondering what is necessary to support this feature.