I need to create a lot (10000+) same objects in a scene. It seems that it works much faster if I join all meshes in one with different position and orientation of every single object. I found the technique how to merge all meshes but I cannot understand how can I use different position and orientation this way.
You probably want to look into static geometry, which does exactly that!
It merges objects which are the same into one big batch which get pushed as single object to the GPU which increases performance dramatically! http://www.ogre3d.org/tikiwiki/Intermediate+Tutorial+5 had a part in it how to set it up.
dont think you can set pos/orient with subMesh...only material...
if you are using ogre 1.x ....
ogre 1.x can't realy handle scenes with lot of objects, beside the slow scene traversing and culling it's also very much cpu-bounded...
you can use some tricks like instancing, page streaming, static geometry etc
but moving to ogre 2.x may solve your issues, ogre2.0 has fast scene traversing/culling and ogre2.1 is considered to be gpu-bounded( azdo optimization )
Edit: but he said he wants to move stuff... (-:
don't know enough about static geometry...
is it possible to move/orient individual parts of the static geometry? is there any additional cost for doing so?
edit2: ok i've read again your post..."same object"...use instancing...or move to ogre 2.1 (-:
the woods are lovely dark and deep
but i have promises to keep
and miles to code before i sleep
and miles to code before i sleep..
frostbyte wrote:
ogre 1.x can't realy handle scenes with lot of objects, beside the slow scene traversing and culling it's also very much cpu-bounded...
Edit: but he said he wants to move stuff... (-:
don't know enough about static geometry...
is it possible to move/orient individual parts of the static geometry? is there any additional cost for doing so?
Ogre 1.9/1.10 can handle lots of objects perfectly fine depending on your setup.
If the objects are non moving, static geometry is the way to go (16000 cubes in 1 static batch can run perfectly 60fps+ on a Intel HD4600), I have not been able to replicate that performance on 2.1 yet (among other issues).
Moving individual objects part of static geom is not possible though, since you will have to rebuild the entire static geom batch due to the way it is setup.
We mostly don't add dynamic objects or objects with dynamic properties to the batch upon load, or detach objects when scene(re)loading happens.
In my case 'Static Geometry' is notthe solution. I also cannot use OGRE 2.X since there is no stable release. I started working with Instance and now I have some questions.
1. Can I add several Ogre::InstancedEntity to one Ogre::SceneNode and change position/orientation of Ogre::InstancedEntity? Or should I create a Ogre::SceneNode for every Ogre::InstancedEntity?
2. How can I release memory correctly?
I need to add approximately 30K cubes to a scene. I tried to add 2 cubes and change position of the second cube but withou success: