Ogre renders objects as instancedgeometry, staticgeometry, and entity instances.
Differences:
Instancedgeometry: Pre-transforms and batches up meshes for efficient use as instanced geometry in a scene. That is to say, all the grids are used as an instance geometry.
This shader instancing implementation stores only 80 times the object, and then re-uses the vertex data with different shader parameter. you can only store the same object 80 times, and then reuse vertex data using different rendering parameters.
You can adjust the position, direction, and size of each frame.
Staticgeometry: uses all the grids as a static ry, so that each material is a batch. However, if you see a small part, all staticgeometry will be rendered.
Entity: each entity contains a mesh.
Each rendering operation is quite resource-consuming. Therefore, we should reduce the number of DIP calls.
Ogre rendering process
Void scenemanager: rendersingleobject (renderable * rend, const Pass * pass ,...)
{
//...
Static renderoperation ro;
Ro. srcrenderable = rend;
//...
Mdestrendersystem-> _ render (RO );
//...
}
Void scenemanager: scenemgrqueuedrenderablevisitor: visit (renderable * r)
{
// Give SM a chance to eliminate
If (targetscenemgr-> validaterenderableforrendering (musedpass, R ))
{
// Render a single object, this will set up auto Params if required
Targetscenemgr-> rendersingleobject (R, musedpass, scissoring, autolights, manuallightlist );
}
}
Void queuedrenderablecollection: acceptvisitorgrouped (
Queuedrenderablevisitor * visitor) const
{
Passgrouprenderablemap: const_iterator IPASS, ipassend;
Ipassend = mgrouped. End ();
For (IPASS = mgrouped. Begin (); IPASS! = Ipassend; ++ IPASS)
{
// Fast bypass if this group is now empty
If (IPASS-> second-> Empty () continue;
// Visit pass-Allow skip
If (! Visitor-> visit (IPASS-> first ))
Continue;
Renderablelist * rendlist = IPASS-> second;
Renderablelist: const_iterator irend, irendend;
Irendend = rendlist-> end ();
For (irend = rendlist-> begin (); irend! = Irendend; ++ irend)
{
// Visit renderable
Visitor-> visit (const_cast <renderable *> (* irend ));
}
}
}
For (IPASS = mgrouped. Begin (); IPASS! = Ipassend; ++ IPASS)
{
________//....
________ Renderablelist * rendlist = IPASS-> second;
________ For (irend = rendlist-> begin (); irend! = Irendend; ++ irend)
______________{
_____________ Visitor-> visit (const_cast <renderable *> (* irend ));
______________}
}
That is to say, each rendable calls dip once. When the rendable with the same pass is merged once, the call to dip can be reduced.
This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/zhangshuncai/archive/2010/06/30/5705055.aspx