Advice for exporting/loading a single very large object

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
simedj
Goblin
Posts: 262
Joined: Fri Nov 18, 2011 6:50 pm
x 3

Advice for exporting/loading a single very large object

Post by simedj »

I have a large and complex model of the human body - including internal organs not just a game model. It consists of hundreds of separate parts/meshes and textures and a very high polygon count.
It is unlikely I would ever want to have the entire model in memory or rendered all at once... separate parts would be viewed and low-detail versions would be used except for whichever part is being closely examined.

But I don't know the best way to approach exporting the model from 3DS (I am a developer not an artist). It is a single model so exporting as a single scene is 'correct' but then Ogre will load the entire thing which is no good.

I might need to ask in the programming forum about that side of things, but for now I'd like to hear from the artists. How would you approach this in an ogre-friendly way? When a model has loads of meshes and each might have multiple detail versions, how CAN you export the scene which holds all the meshes together?

All tips or discussion welcome, I know this is a bit open-ended!
Looking to find experienced Ogre & shader developers/artists. PM me with a contact email address if interested.

bstone
OGRE Expert User
OGRE Expert User
Posts: 1920
Joined: Sun Feb 19, 2012 9:24 pm
Location: Russia
x 199

Re: Advice for exporting/loading a single very large object

Post by bstone »

I don't think there's anything like a tool that will help you to get the kind of an export from a 3DS file that you're looking for. So I doubt any artist will come to the rescue here.

Use the fact that a scene merely identifies what objects are where in the scene and their general parameters like scale and orientation. That means that you can export your scene but when loading it into Ogre load the least LOD versions of the objects that go into that scene. Then load and discard higher LODs of those objects when you need to. A simple naming scheme with LOD markers would work fine, e.g. heart-0.mesh for the highest LOD, heart-1.mesh for a slightly lower LOD, etc. That will ensure fast load times and higher FPS.

If your objects have non-uniform LOD (e.g. some have 1 some 2 or 3) then you'll either have to make missing LOD files as copies of the higher LODs or have some meta data in another file to describe which objects have what LOD levels.

simedj
Goblin
Posts: 262
Joined: Fri Nov 18, 2011 6:50 pm
x 3

Re: Advice for exporting/loading a single very large object

Post by simedj »

Hi,

I wasn't after a tool as much as an idea how to approach this - what artists have done in their projects to make things easier for the programmers. General anecdotes about what worked well, etc.

It sounds like you're suggesting we export the full model as normal, but then use some kind of scene-loading hook/listener to instead load lowest-LOD versions of meshes? Does Ogre provide that level of control, that at load-time I can see a mesh is described as a node-child and prevent it loading? I vaguely recall OgreMax libs have something like this but not how powerful it is.

Thanks!
Looking to find experienced Ogre & shader developers/artists. PM me with a contact email address if interested.

bstone
OGRE Expert User
OGRE Expert User
Posts: 1920
Joined: Sun Feb 19, 2012 9:24 pm
Location: Russia
x 199

Re: Advice for exporting/loading a single very large object

Post by bstone »

The should be a clear distinction between a mesh and a scene first. Not much can be done to a single mesh with respect to controlling the LOD of its components (sub-meshes). Therefore you have to break your complex model into objects (each with its own mesh, one per LOD if you want progressive loading). Then you should organize those objects into a scene. That's most likely your case already.

Ogre itself has no ready-made code for loading scenes since that is a very specific/individual thing for each project. Some scene managers can deal with loading their world geometry but those are not well suited for your needs.

The most common approach to dealing with scenes is with the .scene format which is a simple XML based scene data description and many Ogre exporters can output that for your scenes. There are a few basic readers with their code around the forums and in the Wiki. Grab one of those and adapt it to your needs (e.g. this one). It's relatively simple.

Nothing stops you from having your own scene format, either based on .scene or completely different (but most likely generated from a .scene file).

simedj
Goblin
Posts: 262
Joined: Fri Nov 18, 2011 6:50 pm
x 3

Re: Advice for exporting/loading a single very large object

Post by simedj »

Ha, I made the assumption everyone used .scene as standard when that's not the case!

You're correct that our large model is already split into many separate meshes. We are using OgreMax to export a standard .scene file which describes where the meshes are positioned, and the free OgreMax lib to load that .scene file. I suppose what I really want is to separate the SceneNode hierarchy from the meshes... so as the .scene is loaded I want to create all the nodes in Ogre, but I want to not load, or load different versions of, the .mesh files specified in the .scene files. Kind of like I want to load the design of where each mesh will go, but not the meshes themselves.

Just writing my questions/replies has helped me understand better what I want, I think it basically comes down to a listener when loading the .scene, which can let me choose whether to load the specified .mesh or instead use some placeholder which is replaced later.
Looking to find experienced Ogre & shader developers/artists. PM me with a contact email address if interested.

Post Reply