I am working on LOD managment for Manually changing models based on distance for some Ogre XML Models.
The problem I am running into is if the LOD needs to change while a skeletal animation is happening the animation is restarted for the new LOD Model.
Is there a way that I would be able to have a non attached model have the same animation run on it so the timing would be the same and I would not see a jump in the animation?
Thank you for your input.
The timing doesn’t change in the controls so probably what happens is that you’re changing the model after the controls have already run.
The SkeletonControl runs as the model is rendered by the RenderManager so just make sure to change the model before that.
Is there a plan to implement the Manual LOD functionality for Ogre XML?
Currently I have 3 LOD Models and an Animation channel for each LOD Model.
I start all animations on all models at same time - theoretically if I change a model in mid animation I should see the remaining animation of the newly attached model if it is still running.
Am I correct in this assumption?
Theoretically, yes.
Actually, no.
Can’t you get the current position of the animation, switch the model, set the current position and then start the animation for the new LOD model. I know this is possible, I can’t recall how for the life of me. I would have to assume, you are using the same armatures/animations for each model… so this should work.
You should just swap the mesh rather than load two models
How would I go about swaping the mesh instead of swapping the models?
I currently have 3 j3o files and use the same j3m materials for them.
You can use the SceneGraphVisitor to find geometries and then map them into the LOD ones by name or other means.
I am a little confused on how to do this.
I have 3 j3o files converted from 3 Ogre XML files that had their own skeleton files. The skeleton files are all the exact same.
Would I load the high model and then can I only load the mesh from the other 2 files?
You cannot only load the mesh. The entire model must be loaded and then from there you can find the mesh(es) that are on it. You can remove the entry from the model XML files so that the skeleton file isn’t loaded for the other two models.
I am going to resurrect this thread as I have not found a suitable solution as of yet.
I currently am using a skeletal animation model that I have created 3 different model LODs for.
Currently what I am doing is swapping the models as the models pass through my LOD distance settings.
This causes popping when I am swapping the model if they are in mid animation.
@Momoko_Fan suggested swapping the meshes. I am interested in finding out more in regards to this because if I can get that to happen I assume there would be no popping it will be the same skeleton.
If there is any documentation that is available for this I would be happy to read through it, as of now I have not found any in my searches.
Thank you for any suggestions you may have.
I have one other thought, is there a way for me to assign a different LOD level for each submesh inside a model.
I assume this would accomplish what I am looking for. I am not finding a way to do that currently.
@dm1056 said: @Momoko_Fan suggested swapping the meshes. I am interested in finding out more in regards to this because if I can get that to happen I assume there would be no popping it will be the same skeleton.I am still not sure how you're swapping the models, the issue is that the animation state must be replicated to the new LOD of the model otherwise you might see the effect you describe.
Perhaps I’ll explain how to swap the meshes which might fix the issue you’re having.
When you load your model you will get a scene graph hierarchy similar to this:
-
yourmodelname-ogremesh (Node)
- submesh1 (Geometry)
- submesh2 (Geometry)
- ...
The Node up above is what has the SkeletonControl and the AnimControl, these controls will apply the animation to the geometries below it (assuming they are animated meshes). So, you will need to take the original model’s node, remove the children below it, and then attach the LOD model’s children to that node.
Also LOD are not supposed to be different meshes. It’s several index buffers that tell how to wire the vertices of a single mesh.
Ogre allows you to generate several LOD levels, why don’t you use it? It would resolve your issue, save some memory, and you could manage it easily with the stock LODControl.
The model I am using is a human model with walking and other various animations.
@Momoko_Fan With the description I have given below do you think that your suggestions would be a viable option still?
@Nehon The issue that I am having is if I allow Ogre to assign the lower lods the Texture UV gets screwed up. This is why I created 3 separate LODs so that the UV mapping was correct still.
My 3 Lods triangle counts are
High 3395
Mid 916
Low 250
I am doing a RTS style application so it is possible that I will have up to 1000 units in the scene at one time. On top of that many units they will all also have attached items that will have animations as well.
I am looking for the best way to optimize and improve performance.
Any suggestions would be gladly accepted.
There’s no point in using LOD for RTS games, since the distance between the camera and any game object is more or less constant. If you have 1000 units on-screen at any time then your units must be really small, consider just using less vertices or rendering the units in 2D as quads.
<cite>@Momoko_Fan said:</cite> There's no point in using LOD for RTS games, since the distance between the camera and any game object is more or less constant. If you have 1000 units on-screen at any time then your units must be really small, consider just using less vertices or rendering the units in 2D as quads.
That’s not always true though, look at supreme commander for example. In that you can zoom right down to the individual unit level and then right out to a “map” view all in one continuous zoom.
In my case I have multiple cameras that offer different points of view from far away to close up. So this is why I am in need of the LOD function for the models.