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

Design / architecture / roadmap discussions related to future of Ogre3D (version 2.0 and above)
Post Reply
xissburg
Halfling
Posts: 41
Joined: Sun Feb 21, 2010 4:58 pm
x 1

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

Post by xissburg » Tue Mar 20, 2018 10:38 pm

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
0 x

xrgo
OGRE Expert User
OGRE Expert User
Posts: 884
Joined: Sat Jul 06, 2013 10:59 pm
Location: Chile
x 47

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

Post by xrgo » Tue Mar 20, 2018 11:06 pm

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 );
0 x

Hrenli
Halfling
Posts: 43
Joined: Tue Jun 14, 2016 12:26 pm
x 8

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

Post by Hrenli » Wed Mar 21, 2018 10:24 am

For manual LODs check this thread:

viewtopic.php?f=25&t=93330

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

xissburg
Halfling
Posts: 41
Joined: Sun Feb 21, 2010 4:58 pm
x 1

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

Post by xissburg » Thu Mar 22, 2018 5:25 am

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.
0 x

Post Reply