- 判断对象是否半透明实体
- //-----------------------------------------------------------------------
- bool Pass::isTransparent(void) const
- {
- // Transparent if any of the destination colour is taken into account
- if (mDestBlendFactor == SBF_ZERO &&
- mSourceBlendFactor != SBF_DEST_COLOUR &&
- mSourceBlendFactor != SBF_ONE_MINUS_DEST_COLOUR &&
- mSourceBlendFactor != SBF_DEST_ALPHA &&
- mSourceBlendFactor != SBF_ONE_MINUS_DEST_ALPHA)
- {
- return false;
- }
- else
- {
- return true;
- }
- }
- //-----------------------------------------------------------------------
- void RenderPriorityGroup::addRenderable(Renderable* rend, Technique* pTech)
- {
- // Transparent and depth/colour settings mean depth sorting is required?
- // Note: colour write disabled with depth check/write enabled means
- // setup depth buffer for other passes use.
- // <strong>这个很长的if决定对象是否半透明实体</strong>
- if (pTech->isTransparentSortingForced() ||
- (pTech->isTransparent() &&
- (!pTech->isDepthWriteEnabled() ||
- !pTech->isDepthCheckEnabled() ||
- pTech->hasColourWriteDisabled())))
- {
- if (pTech->isTransparentSortingEnabled())
- addTransparentRenderable(pTech, rend);
- else
- addUnsortedTransparentRenderable(pTech, rend);
- }
- else
- {
- if (mSplitNoShadowPasses &&
- mParent->getShadowsEnabled() &&
- (!pTech->getParent()->getReceiveShadows() ||
- rend->getCastsShadows() && mShadowCastersNotReceivers))
- {
- // Add solid renderable and add passes to no-shadow group
- addSolidRenderable(pTech, rend, true);
- }
- else
- {
- if (mSplitPassesByLightingType && mParent->getShadowsEnabled())
- {
- addSolidRenderableSplitByLightType(pTech, rend);
- }
- else
- {
- addSolidRenderable(pTech, rend, false);
- }
- }
- }
- }
每一个RenderPriorityGroup由6个队列组成
+ mSolidsBasic {msRadixSorter1={...} msRadixSorter2={...} mOrganisationMode='' ...} Ogre::QueuedRenderableCollection
+ mSolidsDiffuseSpecular {msRadixSorter1={...} msRadixSorter2={...} mOrganisationMode='' ...} Ogre::QueuedRenderableCollection
+ mSolidsDecal {msRadixSorter1={...} msRadixSorter2={...} mOrganisationMode='' ...} Ogre::QueuedRenderableCollection
+ mSolidsNoShadowReceive {msRadixSorter1={...} msRadixSorter2={...} mOrganisationMode='' ...} Ogre::QueuedRenderableCollection
+ mTransparentsUnsorted {msRadixSorter1={...} msRadixSorter2={...} mOrganisationMode='' ...} Ogre::QueuedRenderableCollection
+ mTransparents {msRadixSorter1={...} msRadixSorter2={...} mOrganisationMode='' ...} Ogre::QueuedRenderableCollection