Changeset 202 for trunk/VUT/Ogre
- Timestamp:
- 08/07/05 16:51:06 (19 years ago)
- Location:
- trunk/VUT/Ogre
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/Ogre/include/OgreVisibilityOctreeSceneManager.h
r187 r202 142 142 /// flag for passes which should not be deleted from queue during first traversal 143 143 int mLeavePassesInQueue; 144 ShadowTechnique mSavedShadowTechnique;144 145 145 146 146 /// if transparent object are considered for item buffer visibility -
trunk/VUT/Ogre/include/OgreVisibilityTerrainSceneManager.h
r164 r202 89 89 void endFrame(); 90 90 91 void renderAdditiveStencilShadowedQueueGroupObjects(RenderQueueGroup* pGroup); 92 void renderModulativeStencilShadowedQueueGroupObjects(RenderQueueGroup* pGroup); 91 93 92 94 protected: … … 146 148 /// flag for passes which should not be deleted from queue during first traversal 147 149 int mLeavePassesInQueue; 148 ShadowTechnique mSavedShadowTechnique;149 150 150 151 /// if transparent object are considered for item buffer visibility … … 152 153 /// Always execute the vertex program of a pass, e.g., for the depth pass or item buffer 153 154 bool mExecuteVertexProgramForAllPasses; 155 156 bool mIsHierarchicalCulling; 154 157 }; 155 158 -
trunk/VUT/Ogre/src/OgreVisibilityOctreeSceneManager.cpp
r192 r202 32 32 mEnableDepthWrite(true), 33 33 mSkipTransparents(false), 34 mSavedShadowTechnique(SHADOWTYPE_NONE),35 34 mRenderTransparentsForItemBuffer(true), 36 35 mExecuteVertexProgramForAllPasses(true), … … 318 317 319 318 mLeavePassesInQueue = 0; 320 mShadowTechnique = mSavedShadowTechnique;321 322 319 323 320 // add visible nodes found by the visibility culling algorithm … … 639 636 mVisibilityManager->GetCullingManager()->InitFrame(mVisualizeCulledNodes); 640 637 641 // save shadow technique. It will be reset after hierarchical culling642 mSavedShadowTechnique = mShadowTechnique;643 644 // render standard solids without shadows during hierarchical culling pass645 /*if ((mShadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE) ||646 (mShadowTechnique == SHADOWTYPE_STENCIL_MODULATIVE))647 {648 mShadowTechnique = SHADOWTYPE_NONE;649 }*/650 651 638 // set depth pass flag before rendering 652 639 mRenderDepthPass = mUseDepthPass; … … 670 657 if (!mUseDepthPass && !mUseItemBuffer) 671 658 { 672 if (mS avedShadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE)659 if (mShadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE) 673 660 { 674 661 // TODO: remove this pass because it should be processed during hierarchical culling … … 684 671 } 685 672 686 if (mS avedShadowTechnique == SHADOWTYPE_STENCIL_MODULATIVE)673 if (mShadowTechnique == SHADOWTYPE_STENCIL_MODULATIVE) 687 674 { 688 675 mLeavePassesInQueue |= RenderPriorityGroup::SOLID_PASSES_NOSHADOW; -
trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp
r192 r202 31 31 mEnableDepthWrite(true), 32 32 mSkipTransparents(false), 33 mSavedShadowTechnique(SHADOWTYPE_NONE),34 33 mRenderTransparentsForItemBuffer(true), 35 mExecuteVertexProgramForAllPasses(true) 34 mExecuteVertexProgramForAllPasses(true), 35 mIsHierarchicalCulling(false) 36 36 { 37 37 mHierarchyInterface = new OctreeHierarchyInterface(this, mDestRenderSystem); … … 319 319 mSkipTransparents = false; 320 320 mLeavePassesInQueue = 0; 321 mShadowTechnique = mSavedShadowTechnique;322 321 323 322 … … 640 639 mVisibilityManager->GetCullingManager()->InitFrame(mVisualizeCulledNodes); 641 640 642 // save shadow technique. It will be reset after hierarchical culling643 mSavedShadowTechnique = mShadowTechnique;644 645 // render standard solids without shadows during hierarchical culling pass646 if ((mShadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE) ||647 (mShadowTechnique == SHADOWTYPE_STENCIL_MODULATIVE))648 {649 mShadowTechnique = SHADOWTYPE_NONE;650 }651 652 641 // set depth pass flag before rendering 653 642 mRenderDepthPass = mUseDepthPass; … … 666 655 mLeavePassesInQueue = 0; 667 656 668 if (!mUseDepthPass ||!mUseItemBuffer)669 { 670 if (mS avedShadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE)657 if (!mUseDepthPass && !mUseItemBuffer) 658 { 659 if (mShadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE) 671 660 { 672 661 // TODO: remove this pass because it should be processed during hierarchical culling 673 //mLeavePassesInQueue |= RenderPriorityGroup::SOLID_PASSES; 674 mLeavePassesInQueue |= RenderPriorityGroup::SOLID_PASSES_NOSHADOW; 662 //mLeavePassesInQueue |= RenderPriorityGroup::SOLID_PASSES_NOSHADOW; 675 663 676 664 mLeavePassesInQueue |= RenderPriorityGroup::SOLID_PASSES_DECAL; … … 682 670 } 683 671 684 if (mS avedShadowTechnique == SHADOWTYPE_STENCIL_MODULATIVE)672 if (mShadowTechnique == SHADOWTYPE_STENCIL_MODULATIVE) 685 673 { 686 674 mLeavePassesInQueue |= RenderPriorityGroup::SOLID_PASSES_NOSHADOW; … … 722 710 } 723 711 //----------------------------------------------------------------------- 724 /*void VisibilityTerrainSceneManager::renderBasicQueueGroupObjects(RenderQueueGroup* pGroup)725 {726 // Basic render loop: Iterate through priorities727 RenderQueueGroup::PriorityMapIterator groupIt = pGroup->getIterator();728 729 while (groupIt.hasMoreElements())730 {731 RenderPriorityGroup* pPriorityGrp = groupIt.getNext();732 733 // Sort the queue first734 pPriorityGrp->sort(mCameraInProgress);735 736 // Do solids737 // TODO: render other solid passes for shadows738 renderObjects(pPriorityGrp->_getSolidPassesNoShadows(), true);739 740 // do solid passes no shadows if addititive stencil shadows741 if (mSavedShadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE)742 renderObjects(pPriorityGrp->_getSolidPassesNoShadows(), true);743 744 // Do transparents745 renderObjects(pPriorityGrp->_getTransparentPasses(), true);746 747 748 }// for each priority749 }750 */751 //-----------------------------------------------------------------------752 712 Entity* VisibilityTerrainSceneManager::createEntity(const String& entityName, 753 713 const String& meshName) … … 765 725 return ent; 766 726 } 727 //----------------------------------------------------------------------- 728 void VisibilityTerrainSceneManager::renderAdditiveStencilShadowedQueueGroupObjects(RenderQueueGroup* pGroup) 729 { 730 // only render solid passes during hierarchical culling 731 if (mIsHierarchicalCulling) 732 { 733 RenderQueueGroup::PriorityMapIterator groupIt = pGroup->getIterator(); 734 LightList lightList; 735 736 while (groupIt.hasMoreElements()) 737 { 738 RenderPriorityGroup* pPriorityGrp = groupIt.getNext(); 739 740 // Sort the queue first 741 pPriorityGrp->sort(mCameraInProgress); 742 743 // Clear light list 744 lightList.clear(); 745 746 // Render all the ambient passes first, no light iteration, no lights 747 mIlluminationStage = IRS_AMBIENT; 748 749 OctreeSceneManager::renderObjects(pPriorityGrp->_getSolidPasses(), false, &lightList); 750 // Also render any objects which have receive shadows disabled 751 OctreeSceneManager::renderObjects(pPriorityGrp->_getSolidPassesNoShadow(), true); 752 } 753 } 754 else 755 { 756 OctreeSceneManager::renderAdditiveStencilShadowedQueueGroupObjects(pGroup); 757 } 758 } 759 //----------------------------------------------------------------------- 760 void VisibilityTerrainSceneManager::renderModulativeStencilShadowedQueueGroupObjects(RenderQueueGroup* pGroup) 761 { 762 if (mIsHierarchicalCulling) 763 { 764 // Iterate through priorities 765 RenderQueueGroup::PriorityMapIterator groupIt = pGroup->getIterator(); 766 767 while (groupIt.hasMoreElements()) 768 { 769 RenderPriorityGroup* pPriorityGrp = groupIt.getNext(); 770 771 // Sort the queue first 772 pPriorityGrp->sort(mCameraInProgress); 773 774 // Do (shadowable) solids 775 OctreeSceneManager::renderObjects(pPriorityGrp->_getSolidPasses(), true); 776 } 777 } 778 else 779 { 780 SceneManager::renderModulativeStencilShadowedQueueGroupObjects(pGroup); 781 } 782 } 767 783 } // namespace Ogre
Note: See TracChangeset
for help on using the changeset viewer.