Changeset 202 for trunk/VUT


Ignore:
Timestamp:
08/07/05 16:51:06 (19 years ago)
Author:
mattausch
Message:

stable

Location:
trunk/VUT
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibilityPreprocessor/scripts/Preprocessor.vcproj

    r190 r202  
    6262                        <Tool 
    6363                                Name="VCCLCompilerTool" 
    64                                 AdditionalIncludeDirectories="..\support;..\support\zlib\include;&quot;$(QTDIR)\include&quot;;&quot;$(QTDIR)\include\Qt&quot;;..\include" 
     64                                AdditionalIncludeDirectories="..\support;..\support\devil\include;..\support\zlib\include;&quot;$(QTDIR)\include&quot;;&quot;$(QTDIR)\include\Qt&quot;;..\include" 
    6565                                PreprocessorDefinitions="WIN32;NDEBUG;_LIB" 
    6666                                RuntimeLibrary="2" 
     67                                RuntimeTypeInfo="TRUE" 
    6768                                UsePrecompiledHeader="0" 
    6869                                WarningLevel="3" 
     
    7374                        <Tool 
    7475                                Name="VCLinkerTool" 
    75                                 AdditionalDependencies="xerces-c_2.lib zdll.lib zziplib.lib" 
    76                                 AdditionalLibraryDirectories="..\support\xercesc\lib\;..\support\zlib\lib\;&quot;$(QTDIR)\lib&quot;"/> 
     76                                AdditionalDependencies="xerces-c_2.lib zdll.lib zziplib.lib devil.lib" 
     77                                AdditionalLibraryDirectories="..\support\xercesc\lib\;..\support\zlib\lib\;..\support\devil\lib;&quot;$(QTDIR)\lib&quot;"/> 
    7778                        <Tool 
    7879                                Name="VCMIDLTool"/> 
     
    234235                        </File> 
    235236                        <File 
     237                                RelativePath="..\src\ViewCell.h"> 
     238                        </File> 
     239                        <File 
    236240                                RelativePath="..\src\ViewCellBsp.cpp"> 
    237241                        </File> 
  • trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBSP.h

    r197 r202  
    3838  {    
    3939  public: 
    40           BSPInterior(Plane3 *plane): mPlane(plane) {} 
     40          BSPInterior(Plane3 plane): mPlane(plane) {} 
    4141          /** @return false since it is an interior node */ 
    4242          bool IsLeaf() const; 
  • trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.cpp

    r197 r202  
    55#include "ViewCell.h" 
    66#include <stack> 
     7 
    78//namespace GtpVisibilityPreprocessor { 
    89/****************************************************************/ 
     
    8485                BSPNode *node = SubdivideNode(dynamic_cast<BSPLeaf *>(data.mNode), 
    8586                                                                          data.mParent, 
    86                                                                       data.mParent, 
    87                                                                           data.mDepth, 
     87                                                                          &data.mViewCell, 
     88                                                                      data.mDepth, 
    8889                                                                          backPolys, 
    8990                                                                          frontPolys); 
     
    118119        // add the new nodes to the tree + select subdivision plane 
    119120        Plane3 *plane = SelectPlane(viewCell); 
    120         BSPInterior *node = new BSPInterior(&plane); // ERROR!! 
     121        BSPInterior *node = new BSPInterior(*plane); // ERROR!! 
    121122   
    122123 
  • trunk/VUT/Ogre/include/OgreVisibilityOctreeSceneManager.h

    r187 r202  
    142142        /// flag for passes which should not be deleted from queue during first traversal 
    143143        int mLeavePassesInQueue; 
    144         ShadowTechnique mSavedShadowTechnique; 
     144         
    145145 
    146146        /// if transparent object are considered for item buffer visibility 
  • trunk/VUT/Ogre/include/OgreVisibilityTerrainSceneManager.h

    r164 r202  
    8989        void endFrame(); 
    9090 
     91        void renderAdditiveStencilShadowedQueueGroupObjects(RenderQueueGroup* pGroup); 
     92        void renderModulativeStencilShadowedQueueGroupObjects(RenderQueueGroup* pGroup); 
    9193 
    9294protected: 
     
    146148        /// flag for passes which should not be deleted from queue during first traversal 
    147149        int mLeavePassesInQueue; 
    148         ShadowTechnique mSavedShadowTechnique; 
    149150 
    150151        /// if transparent object are considered for item buffer visibility 
     
    152153        /// Always execute the vertex program of a pass, e.g., for the depth pass or item buffer 
    153154        bool mExecuteVertexProgramForAllPasses; 
     155 
     156        bool mIsHierarchicalCulling; 
    154157}; 
    155158 
  • trunk/VUT/Ogre/src/OgreVisibilityOctreeSceneManager.cpp

    r192 r202  
    3232mEnableDepthWrite(true), 
    3333mSkipTransparents(false), 
    34 mSavedShadowTechnique(SHADOWTYPE_NONE), 
    3534mRenderTransparentsForItemBuffer(true), 
    3635mExecuteVertexProgramForAllPasses(true), 
     
    318317 
    319318                mLeavePassesInQueue = 0; 
    320                 mShadowTechnique = mSavedShadowTechnique; 
    321  
    322319 
    323320                // add visible nodes found by the visibility culling algorithm 
     
    639636        mVisibilityManager->GetCullingManager()->InitFrame(mVisualizeCulledNodes); 
    640637 
    641         // save shadow technique. It will be reset after hierarchical culling 
    642         mSavedShadowTechnique = mShadowTechnique; 
    643  
    644         // render standard solids without shadows during hierarchical culling pass 
    645         /*if ((mShadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE) || 
    646             (mShadowTechnique == SHADOWTYPE_STENCIL_MODULATIVE)) 
    647         {        
    648                 mShadowTechnique = SHADOWTYPE_NONE; 
    649         }*/ 
    650  
    651638        // set depth pass flag before rendering 
    652639        mRenderDepthPass = mUseDepthPass; 
     
    670657        if (!mUseDepthPass && !mUseItemBuffer) 
    671658        { 
    672                 if (mSavedShadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE) 
     659                if (mShadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE) 
    673660                { 
    674661                        // TODO: remove this pass because it should be processed during hierarchical culling 
     
    684671                } 
    685672         
    686                 if (mSavedShadowTechnique == SHADOWTYPE_STENCIL_MODULATIVE) 
     673                if (mShadowTechnique == SHADOWTYPE_STENCIL_MODULATIVE) 
    687674                { 
    688675                        mLeavePassesInQueue |= RenderPriorityGroup::SOLID_PASSES_NOSHADOW; 
  • trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp

    r192 r202  
    3131mEnableDepthWrite(true), 
    3232mSkipTransparents(false), 
    33 mSavedShadowTechnique(SHADOWTYPE_NONE), 
    3433mRenderTransparentsForItemBuffer(true), 
    35 mExecuteVertexProgramForAllPasses(true) 
     34mExecuteVertexProgramForAllPasses(true), 
     35mIsHierarchicalCulling(false) 
    3636{ 
    3737        mHierarchyInterface = new OctreeHierarchyInterface(this, mDestRenderSystem); 
     
    319319                mSkipTransparents = false; 
    320320                mLeavePassesInQueue = 0; 
    321                 mShadowTechnique = mSavedShadowTechnique; 
    322321                 
    323322 
     
    640639        mVisibilityManager->GetCullingManager()->InitFrame(mVisualizeCulledNodes); 
    641640 
    642         // save shadow technique. It will be reset after hierarchical culling 
    643         mSavedShadowTechnique = mShadowTechnique; 
    644  
    645         // render standard solids without shadows during hierarchical culling pass 
    646         if ((mShadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE) || 
    647             (mShadowTechnique == SHADOWTYPE_STENCIL_MODULATIVE)) 
    648         {        
    649                 mShadowTechnique = SHADOWTYPE_NONE; 
    650         } 
    651  
    652641        // set depth pass flag before rendering 
    653642        mRenderDepthPass = mUseDepthPass; 
     
    666655        mLeavePassesInQueue = 0; 
    667656 
    668         if (!mUseDepthPass || !mUseItemBuffer) 
    669         { 
    670                 if (mSavedShadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE) 
     657        if (!mUseDepthPass && !mUseItemBuffer) 
     658        { 
     659                if (mShadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE) 
    671660                { 
    672661                        // 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; 
    675663 
    676664                        mLeavePassesInQueue |= RenderPriorityGroup::SOLID_PASSES_DECAL; 
     
    682670                } 
    683671         
    684                 if (mSavedShadowTechnique == SHADOWTYPE_STENCIL_MODULATIVE) 
     672                if (mShadowTechnique == SHADOWTYPE_STENCIL_MODULATIVE) 
    685673                { 
    686674                        mLeavePassesInQueue |= RenderPriorityGroup::SOLID_PASSES_NOSHADOW; 
     
    722710} 
    723711//----------------------------------------------------------------------- 
    724 /*void VisibilityTerrainSceneManager::renderBasicQueueGroupObjects(RenderQueueGroup* pGroup) 
    725 { 
    726     // Basic render loop: Iterate through priorities 
    727     RenderQueueGroup::PriorityMapIterator groupIt = pGroup->getIterator(); 
    728  
    729     while (groupIt.hasMoreElements()) 
    730     { 
    731         RenderPriorityGroup* pPriorityGrp = groupIt.getNext(); 
    732  
    733         // Sort the queue first 
    734         pPriorityGrp->sort(mCameraInProgress); 
    735  
    736                 // Do solids 
    737                 // TODO: render other solid passes for shadows 
    738         renderObjects(pPriorityGrp->_getSolidPassesNoShadows(), true); 
    739  
    740                 // do solid passes no shadows if addititive stencil shadows 
    741                 if (mSavedShadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE) 
    742                         renderObjects(pPriorityGrp->_getSolidPassesNoShadows(), true); 
    743                  
    744         // Do transparents 
    745         renderObjects(pPriorityGrp->_getTransparentPasses(), true); 
    746  
    747  
    748     }// for each priority 
    749 } 
    750 */ 
    751 //----------------------------------------------------------------------- 
    752712Entity* VisibilityTerrainSceneManager::createEntity(const String& entityName,  
    753713                                                                                                        const String& meshName) 
     
    765725        return ent; 
    766726} 
     727//----------------------------------------------------------------------- 
     728void 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//----------------------------------------------------------------------- 
     760void 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} 
    767783} // namespace Ogre 
Note: See TracChangeset for help on using the changeset viewer.