先关注排序部分:
RenderPriorityGroup的sort方法中,用到mSolidsBasic,mSolidsDecal,mSolidsDiffuseSpecular,mSolidsNoShadowReceive,mTransparentsUnsorted, mTransparents
void RenderPriorityGroup::sort(const Camera* cam)
{
mSolidsBasic.sort(cam);
mSolidsDecal.sort(cam);
mSolidsDiffuseSpecular.sort(cam);
mSolidsNoShadowReceive.sort(cam);
mTransparentsUnsorted.sort(cam);
mTransparents.sort(cam);
}
调用的堆栈:
SceneManager::_renderScene()
SceneManager::_renderVisibleObjects()
SceneManager::renderVisibleObjectsDefaultSequence()
SceneManager::_renderQueueGroupObjects()
SceneManager::renderBasicQueueGroupObjects() --这里会先排序
SceneManager::renderObjects()
QueueRenderableCollection::acceptVisitor()
QueueRenderableCollection::acceptVisitorGrouped()
SceneManager::SceneMgrQueuedRenderableVisitor::visit()
SceneManager::renderSingleObject()