gltf2: lods

Problems building or running the engine, queries about how to use features etc.
slapin
Bronze Sponsor
Bronze Sponsor
Posts: 77
Joined: Fri May 23, 2025 5:04 pm
x 2

gltf2: lods

Post by slapin »

Hi, all!

Is it possible to generate LODs after gltf load?

paroj
OGRE Team Member
OGRE Team Member
Posts: 2180
Joined: Sun Mar 30, 2014 2:51 pm
x 1168

Re: gltf2: lods

Post by paroj »

yes, but you have to do it programmatically at each lod instead of just storing them in the mesh file:
https://ogrecave.github.io/ogre/api/lat ... shlod-prog

slapin
Bronze Sponsor
Bronze Sponsor
Posts: 77
Joined: Fri May 23, 2025 5:04 pm
x 2

Re: gltf2: lods

Post by slapin »

That is perfectly fine for me. Thanks!

slapin
Bronze Sponsor
Bronze Sponsor
Posts: 77
Joined: Fri May 23, 2025 5:04 pm
x 2

Re: gltf2: lods

Post by slapin »

Can I cache generated LODs for Ogre to use them automatically (including animations)?
I.e. I have a character as .glb file with animations. I want to have LODs for all submeshes
and for animations to work and lods properly auto-swtched. Possible?

paroj
OGRE Team Member
OGRE Team Member
Posts: 2180
Joined: Sun Mar 30, 2014 2:51 pm
x 1168

Re: gltf2: lods

Post by paroj »

yes, store the LODded mesh as .mesh and load that instead of the glb

slapin
Bronze Sponsor
Bronze Sponsor
Posts: 77
Joined: Fri May 23, 2025 5:04 pm
x 2

Re: gltf2: lods

Post by slapin »

But can I go about this without storing anything on disk?

paroj
OGRE Team Member
OGRE Team Member
Posts: 2180
Joined: Sun Mar 30, 2014 2:51 pm
x 1168

Re: gltf2: lods

Post by paroj »

that should be the default behavior of meshmanager. Once you loaded the glb, it is not read again unless you unload it manually - that includes any modifications you do like adding LOD levels

slapin
Bronze Sponsor
Bronze Sponsor
Posts: 77
Joined: Fri May 23, 2025 5:04 pm
x 2

Re: gltf2: lods

Post by slapin »

But can I create LOD-enabled mesh in memory from that loaded glb and use it without saving to disk?

paroj
OGRE Team Member
OGRE Team Member
Posts: 2180
Joined: Sun Mar 30, 2014 2:51 pm
x 1168

Re: gltf2: lods

Post by paroj »

you can load the glb (at which point it gets converted to the .mesh format), then generate the LODs and then use it as usual. Unless you unload the glb, the LODs will stay. Or am I missing something related to your usecase?

slapin
Bronze Sponsor
Bronze Sponsor
Posts: 77
Joined: Fri May 23, 2025 5:04 pm
x 2

Re: gltf2: lods

Post by slapin »

No, it looks good for my use case, thanks!