Before optimization, first understand the optimization principle.
1). renderable and rendering batches:
What is the rendering batch of Shenma? Let's take a look at the tutorial. In short, it greatly affects the rendering efficiency, so there are as few rendering batches as possible. for example, rendering 10000 triangles in 10 batches is much faster than rendering 10 triangles in 10000 batches,
How is a batch counted? Rendering an renderable is a batch. renderable is the smallest rendering unit in ogre, and all objects to be rendered inherit from this.
One sentence: A renderable is equal to a batching (rendering batch), reducing the renerable in the scenario reduces the batch.
How to Reduce renderable? For example, if there are two trees with the same material (two renderable trees), I can synthesize one tree (one renderable). There are two synthesis methods. One is static merge by the artist in Max, one isProgramDynamic Merge (staticgeometry)
It is worth mentioning that a mesh is not necessarily a batch, but a submesh is. If a mesh has two submesh of different materials, it is normal,
If there are two submesh with the same material, it is not good. I should immediately seek an artist and scold him. Why not combine two submesh with the same material?
2) movableobject and camera Cropping
Ogre's octreescenemanager camera cropping is based on the surrounding box, which means that objects with the surrounding box can be cropped,Is renderable bounded? No! But movableobject is available. movableobject is the basic object for moving objects. It inherits shadowcaster and can cast shadows.
It is worth mentioning that the camera's cropping is not in the unit of movableobject, but in the unit of scenenode. Only the movableobject mounted to the scenenode can be used.
Will be cropped,
3) To render, renderable, to move,Moveable. The simplest object should be simplerenderable: Public movableobject and public renderable.
I think that I used to use mesh for terrain. It was very stupid and inefficient. The mesh class should be too large to contain too many things that I don't need.Simplerenderable is the most efficient.