![]() |
OGRE
13.0
Object-Oriented Graphics Rendering Engine
|
Instancing significantly reduces the CPU overhead of submitting many separate draw calls and is a great technique for rendering trees, rocks, grass, RTS units and other groups of similar (but necessarily identical) objects.
OGRE supports a variety of techniques to speed up the rendering of many objects in the Scene.
Modern graphics cards (GPUs) prefer to receive geometry in large batches. It is orders of magnitude faster to render 10 batches of 10,000 triangles than it is to render 10,000 batches of 10 triangles, even though both result in the same number of on-screen triangles.
Therefore it is important when you are rendering a lot of geometry to batch things up into as few rendering calls as possible. This class allows you to build a batched object from a series of entities in order to benefit from this behaviour. Batching has implications of it's own though:
Consult the following links to get more information:
Instancing is a rendering technique to draw multiple instances of the same mesh using just one render call. There are two kinds of instancing:
Software: Two larges vertex & index buffers are created and the mesh vertices/indices are duplicated N number of times. When rendering, invisible instances receive a transform matrix filled with 0s. This technique can take a lot of VRAM and has limited culling capabilities. Hardware: The hardware supports an extra param which allows Ogre to tell the GPU to repeat the drawing of vertices N number of times; thus taking considerably less VRAM. Because N can be controlled at runtime, individual instances can be culled before sending the data to the GPU. Hardware techniques are almost always superior to Software techniques, but Software are more compatible, where as Hardware techniques require D3D9 or GL3, and is not supported in GLES2
All instancing techniques require shaders. It is not possible to use instancing with FFP (Fixed Function Pipeline)
Consult the following links to get more information:
Static Geometry | Instancing |
---|---|
Static Geometry is more about any sort of mesh grouped in a minimal number of meshes, and cannot be updated (each mesh cannot move independently, only all the static geometry would be able to do so.) | Instancing is mainly about same mesh used many times, so Instanced geometry can be updated (each mesh can move independently) |
If you have a scene with many unique meshes, static geometry still is the best solution. | Instancing is only about reusing same mesh many times without the draw call cost. |
StaticGeometry is useful for batching up small static detail fragments like grass without shaders. | Instancing lets you have one mesh repeated many times without the performance hit of having them as individual meshes. |
Staticgeometry is for geometry that doesn't move and has low in GPU requirements | Instanced is more for dynamic geometry (animated or moving) and better GPU (sm2.0+) |
StaticGeometry batches separate sets of polygons together, as long as they have the same properties such as material. These batches are then automatically split into regions for better culling. You can control the region size. This is a good way to reduce batches for static elements. | InstancedGeometry is good for large numbers of the same exact object. You can have multiple instances of one object that can dynamically move but that are drawn in one draw call. |