Ignore:
Timestamp:
03/31/06 10:37:45 (19 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp

    r675 r720  
    1 #include "OgreVisibilityTerrainSceneManager.h" 
     1#include "OgreOcclusionCullingSceneManager.h" 
    22#include "OgreVisibilityOptionsManager.h" 
    33#include <OgreMath.h> 
     
    1414 
    1515//----------------------------------------------------------------------- 
    16 VisibilityTerrainSceneManager::VisibilityTerrainSceneManager( 
     16OcclusionCullingSceneManager::OcclusionCullingSceneManager( 
    1717                                                        GtpVisibility::VisibilityManager *visManager):  
    1818mVisibilityManager(visManager),  
     
    4040        //mShowBoundingBoxes = true; 
    4141        //mShowBoxes = true; 
     42//std::stringstream d; d << "here555"; 
     43//mDummyLog.open(""); 
    4244 
    4345        // TODO: set maxdepth to reasonable value 
     
    4547} 
    4648//----------------------------------------------------------------------- 
    47 void VisibilityTerrainSceneManager::InitDepthPass() 
     49void OcclusionCullingSceneManager::InitDepthPass() 
    4850{ 
    4951        MaterialPtr depthMat = MaterialManager::getSingleton().getByName("Visibility/DepthPass"); 
     
    6668} 
    6769//----------------------------------------------------------------------- 
    68 VisibilityTerrainSceneManager::~VisibilityTerrainSceneManager() 
     70OcclusionCullingSceneManager::~OcclusionCullingSceneManager() 
    6971{ 
    7072        OGRE_DELETE(mHierarchyInterface); 
    7173} 
    7274//----------------------------------------------------------------------- 
    73 void VisibilityTerrainSceneManager::InitItemBufferPass() 
     75void OcclusionCullingSceneManager::InitItemBufferPass() 
    7476{ 
    7577        MaterialPtr itemBufferMat = MaterialManager::getSingleton(). 
     
    9597} 
    9698//------------------------------------------------------------------------- 
    97 void VisibilityTerrainSceneManager::setWorldGeometry( const String& filename ) 
     99void OcclusionCullingSceneManager::setWorldGeometry( const String& filename ) 
    98100{ 
    99101    // Clear out any existing world resources (if not default) 
     
    124126 
    125127//----------------------------------------------------------------------- 
    126 void VisibilityTerrainSceneManager::PrepareVisualization(Camera *cam) 
     128void OcclusionCullingSceneManager::PrepareVisualization(Camera *cam) 
    127129{ 
    128130        // add player camera for visualization purpose 
     
    173175} 
    174176//----------------------------------------------------------------------- 
    175 Pass *VisibilityTerrainSceneManager::setPass(Pass* pass) 
     177Pass *OcclusionCullingSceneManager::setPass(Pass* pass) 
    176178{ 
    177179        // TODO: setting vertex program is not efficient 
     
    236238} 
    237239//----------------------------------------------------------------------- 
    238 void VisibilityTerrainSceneManager::_findVisibleObjects(Camera* cam, 
     240void OcclusionCullingSceneManager::_findVisibleObjects(Camera* cam, 
    239241                                                                                                                bool onlyShadowCasters) 
    240242{ 
     
    266268} 
    267269//----------------------------------------------------------------------- 
    268 void VisibilityTerrainSceneManager::_renderVisibleObjects() 
     270void OcclusionCullingSceneManager::_renderVisibleObjects() 
    269271{ 
    270272 
     
    329331                // hierarchical visibility culling and rendering 
    330332                InitVisibilityCulling(mCameraInProgress); 
     333 
     334                std::stringstream d; d << "here34\n"; 
     335                LogManager::getSingleton().logMessage(d.str()); 
    331336 
    332337                /**  
     
    376381        getRenderQueue()->clear(); // finally clear render queue 
    377382        OGRE_DELETE(mRenderQueue); // HACK: should be cleared before... 
    378         //WriteLog(); // write out stats 
    379  
    380 } 
    381  
    382 //----------------------------------------------------------------------- 
    383 void VisibilityTerrainSceneManager::_updateSceneGraph(Camera* cam) 
     383        WriteLog(); // write out stats 
     384 
     385} 
     386 
     387//----------------------------------------------------------------------- 
     388void OcclusionCullingSceneManager::_updateSceneGraph(Camera* cam) 
    384389{ 
    385390        mVisibilityManager->GetCullingManager()->SetHierarchyInterface(mHierarchyInterface); 
     
    389394} 
    390395//----------------------------------------------------------------------- 
    391 bool VisibilityTerrainSceneManager::setOption(const String & key, const void * val) 
     396bool OcclusionCullingSceneManager::setOption(const String & key, const void * val) 
    392397{ 
    393398        if (key == "UseDepthPass") 
     
    482487} 
    483488//----------------------------------------------------------------------- 
    484 bool VisibilityTerrainSceneManager::getOption(const String & key, void *val) 
     489bool OcclusionCullingSceneManager::getOption(const String & key, void *val) 
    485490{ 
    486491        if (key == "NumHierarchyNodes") 
     
    494499} 
    495500//----------------------------------------------------------------------- 
    496 bool VisibilityTerrainSceneManager::getOptionValues(const String & key,  
     501bool OcclusionCullingSceneManager::getOptionValues(const String & key,  
    497502                                                                                                        StringVector &refValueList) 
    498503{ 
     
    500505} 
    501506//----------------------------------------------------------------------- 
    502 bool VisibilityTerrainSceneManager::getOptionKeys(StringVector & refKeys) 
     507bool OcclusionCullingSceneManager::getOptionKeys(StringVector & refKeys) 
    503508{ 
    504509        return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface). 
     
    506511} 
    507512//----------------------------------------------------------------------- 
    508 void VisibilityTerrainSceneManager::setVisibilityManager(GtpVisibility:: 
     513void OcclusionCullingSceneManager::setVisibilityManager(GtpVisibility:: 
    509514                                                                                                                 VisibilityManager *visManager) 
    510515{ 
     
    512517} 
    513518//----------------------------------------------------------------------- 
    514 GtpVisibility::VisibilityManager *VisibilityTerrainSceneManager::getVisibilityManager( void ) 
     519GtpVisibility::VisibilityManager *OcclusionCullingSceneManager::getVisibilityManager( void ) 
    515520{ 
    516521        return mVisibilityManager; 
    517522} 
    518523//----------------------------------------------------------------------- 
    519 void VisibilityTerrainSceneManager::WriteLog() 
     524void OcclusionCullingSceneManager::WriteLog() 
    520525{ 
    521526        std::stringstream d; 
     
    535540} 
    536541//----------------------------------------------------------------------- 
    537 void VisibilityTerrainSceneManager::renderObjects( 
     542void OcclusionCullingSceneManager::renderObjects( 
    538543        const RenderPriorityGroup::TransparentRenderablePassList& objs,  
    539544    bool doLightIteration, const LightList* manualLightList) 
     
    546551} 
    547552//----------------------------------------------------------------------- 
    548 bool VisibilityTerrainSceneManager::validatePassForRendering(Pass* pass) 
     553bool OcclusionCullingSceneManager::validatePassForRendering(Pass* pass) 
    549554{ 
    550555        // skip all but first pass if we are doing the depth pass 
     
    557562} 
    558563//----------------------------------------------------------------------- 
    559 void VisibilityTerrainSceneManager::renderQueueGroupObjects(RenderQueueGroup* pGroup) 
     564void OcclusionCullingSceneManager::renderQueueGroupObjects(RenderQueueGroup* pGroup) 
    560565{ 
    561566        if (!mIsItemBufferPhase) 
     
    576581} 
    577582//----------------------------------------------------------------------- 
    578 void VisibilityTerrainSceneManager::RenderItemBuffer(RenderPriorityGroup* pGroup) 
     583void OcclusionCullingSceneManager::RenderItemBuffer(RenderPriorityGroup* pGroup) 
    579584{ 
    580585        // Do solids 
     
    602607                for (irend = rendList->begin(); irend != irendend; ++irend) 
    603608                { 
    604                         std::stringstream d; d << "itembuffer, pass name: " <<  
    605                                 ipass->first->getParent()->getParent()->getName(); 
    606                                  
    607                         LogManager::getSingleton().logMessage(d.str()); 
     609                        //std::stringstream d; d << "itembuffer, pass name: " <<  
     610                        //      ipass->first->getParent()->getParent()->getName(); 
     611                        //      LogManager::getSingleton().logMessage(d.str()); 
    608612                         
    609613                        RenderSingleObjectForItemBuffer(*irend, ipass->first); 
     
    633637} 
    634638//----------------------------------------------------------------------- 
    635 void VisibilityTerrainSceneManager::RenderSingleObjectForItemBuffer(Renderable *rend, Pass *pass) 
     639void OcclusionCullingSceneManager::RenderSingleObjectForItemBuffer(Renderable *rend, Pass *pass) 
    636640{ 
    637641        static LightList nullLightList; 
     
    678682} 
    679683//----------------------------------------------------------------------- 
    680 GtpVisibility::VisibilityManager *VisibilityTerrainSceneManager::GetVisibilityManager() 
     684GtpVisibility::VisibilityManager *OcclusionCullingSceneManager::GetVisibilityManager() 
    681685{ 
    682686        return mVisibilityManager; 
    683687} 
    684688//----------------------------------------------------------------------- 
    685 void VisibilityTerrainSceneManager::InitVisibilityCulling(Camera *cam) 
     689void OcclusionCullingSceneManager::InitVisibilityCulling(Camera *cam) 
    686690{ 
    687691        // reset culling manager stats 
     
    704708        mLeavePassesInQueue = 0; 
    705709 
    706         if (!mUseDepthPass && !mUseItemBuffer) 
     710        // if we have the depth pass or use an item buffer, no passes are left in the queue 
     711        if (0 && !mUseDepthPass && !mUseItemBuffer) 
    707712        { 
    708713                if (mShadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE) 
     
    746751                                                                           mLeavePassesInQueue); 
    747752                 
    748         //std::stringstream d; d << "leave passes in queue: " << mLeavePassesInQueue;LogManager::getSingleton().logMessage(d.str()); 
    749 } 
    750 //----------------------------------------------------------------------- 
    751 OctreeHierarchyInterface *VisibilityTerrainSceneManager::GetHierarchyInterface() 
     753        std::stringstream d; d << "leave passes in queue: " << mLeavePassesInQueue; 
     754        LogManager::getSingleton().logMessage(d.str()); 
     755} 
     756//----------------------------------------------------------------------- 
     757OctreeHierarchyInterface *OcclusionCullingSceneManager::GetHierarchyInterface() 
    752758{ 
    753759        return mHierarchyInterface; 
    754760} 
    755761//----------------------------------------------------------------------- 
    756 void VisibilityTerrainSceneManager::endFrame() 
     762void OcclusionCullingSceneManager::endFrame() 
    757763{ 
    758764        TerrainRenderable::ResetRenderLevelIndex(); 
    759765} 
    760766//----------------------------------------------------------------------- 
    761 Entity* VisibilityTerrainSceneManager::createEntity(const String& entityName,  
     767Entity* OcclusionCullingSceneManager::createEntity(const String& entityName,  
    762768                                                                                                        const String& meshName) 
    763769{ 
     
    775781} 
    776782//----------------------------------------------------------------------- 
    777 void VisibilityTerrainSceneManager::renderAdditiveStencilShadowedQueueGroupObjects(RenderQueueGroup* pGroup) 
     783void OcclusionCullingSceneManager::renderAdditiveStencilShadowedQueueGroupObjects(RenderQueueGroup* pGroup) 
    778784{ 
    779785        // only render solid passes during hierarchical culling 
     
    807813} 
    808814//----------------------------------------------------------------------- 
    809 void VisibilityTerrainSceneManager::renderModulativeStencilShadowedQueueGroupObjects(RenderQueueGroup* pGroup) 
     815void OcclusionCullingSceneManager::renderModulativeStencilShadowedQueueGroupObjects(RenderQueueGroup* pGroup) 
    810816{ 
    811817   if (mIsHierarchicalCulling) 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreVisibilityOctreeSceneManager.cpp

    r343 r720  
    681681        mLeavePassesInQueue = 0; 
    682682 
    683         if (!mUseDepthPass && !mUseItemBuffer) 
     683        if (0 && !mUseDepthPass && !mUseItemBuffer) 
    684684        { 
    685685                if (mShadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE) 
     
    724724                                                        mLeavePassesInQueue); 
    725725                 
    726         //std::stringstream d; d << "leave passes in queue: " << mLeavePassesInQueue;LogManager::getSingleton().logMessage(d.str()); 
     726        std::stringstream d; d << "leave passes in queue: " << mLeavePassesInQueue; 
     727        LogManager::getSingleton().logMessage(d.str()); 
    727728} 
    728729//----------------------------------------------------------------------- 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreVisibilityTerrainSceneManager.cpp

    r675 r720  
    1 #include "OgreOcclusionCullingSceneManager.h" 
     1#include "OgreVisibilityTerrainSceneManager.h" 
    22#include "OgreVisibilityOptionsManager.h" 
    33#include <OgreMath.h> 
     
    1010#include <OgreSubEntity.h> 
    1111 
     12// HACK 
     13const static DEBUG_CHC = false; 
    1214 
    1315namespace Ogre { 
    1416 
    1517//----------------------------------------------------------------------- 
    16 OcclusionCullingSceneManager::OcclusionCullingSceneManager( 
     18VisibilityTerrainSceneManager::VisibilityTerrainSceneManager( 
    1719                                                        GtpVisibility::VisibilityManager *visManager):  
    1820mVisibilityManager(visManager),  
     
    3234mSkipTransparents(false), 
    3335mRenderTransparentsForItemBuffer(true), 
    34 mExecuteVertexProgramForAllPasses(true), 
     36mExecuteVertexProgramForAllPasses(false), 
    3537mIsHierarchicalCulling(false) 
    3638{ 
    3739        mHierarchyInterface = new OctreeHierarchyInterface(this, mDestRenderSystem); 
    3840         
    39         //mDisplayNodes = true; 
    40         //mShowBoundingBoxes = true; 
    41         //mShowBoxes = true; 
     41        if (0) 
     42        { 
     43                mDisplayNodes = true; 
     44                mShowBoundingBoxes = true; 
     45                mShowBoxes = true; 
     46        } 
    4247 
    4348        // TODO: set maxdepth to reasonable value 
     
    4550} 
    4651//----------------------------------------------------------------------- 
    47 void OcclusionCullingSceneManager::InitDepthPass() 
     52void VisibilityTerrainSceneManager::InitDepthPass() 
    4853{ 
    4954        MaterialPtr depthMat = MaterialManager::getSingleton().getByName("Visibility/DepthPass"); 
     
    5661 
    5762        mDepthPass = depthMat->getTechnique(0)->getPass(0); 
     63 
    5864                mDepthPass->setColourWriteEnabled(false); 
    5965                mDepthPass->setDepthWriteEnabled(true); 
    6066                mDepthPass->setLightingEnabled(false); 
     67                //mDepthPass->setDepthCheckEnabled(true); 
    6168        } 
    6269        else 
     
    6673} 
    6774//----------------------------------------------------------------------- 
    68 OcclusionCullingSceneManager::~OcclusionCullingSceneManager() 
     75VisibilityTerrainSceneManager::~VisibilityTerrainSceneManager() 
    6976{ 
    7077        OGRE_DELETE(mHierarchyInterface); 
    7178} 
    7279//----------------------------------------------------------------------- 
    73 void OcclusionCullingSceneManager::InitItemBufferPass() 
     80void VisibilityTerrainSceneManager::InitItemBufferPass() 
    7481{ 
    7582        MaterialPtr itemBufferMat = MaterialManager::getSingleton(). 
     
    95102} 
    96103//------------------------------------------------------------------------- 
    97 void OcclusionCullingSceneManager::setWorldGeometry( const String& filename ) 
     104void VisibilityTerrainSceneManager::setWorldGeometry( const String& filename ) 
    98105{ 
    99106    // Clear out any existing world resources (if not default) 
     
    104111            ResourceGroupManager::getSingleton().getWorldResourceGroupName()); 
    105112    } 
     113 
    106114    mTerrainPages.clear(); 
    107     // Load the configuration 
     115         
     116        // Load the configuration 
    108117    loadConfig(filename); 
    109118 
     
    115124        float maxAxis = std::max(max_x, max_y); 
    116125        maxAxis = std::max(maxAxis, max_z); 
    117         resize( AxisAlignedBox( 0, 0, 0, maxAxis, maxAxis, maxAxis ) ); 
     126        resize(AxisAlignedBox(0, 0, 0, maxAxis, maxAxis, maxAxis)); 
    118127     
    119128    setupTerrainMaterial(); 
    120  
    121129    setupTerrainPages(); 
    122  
    123  } 
    124  
    125 //----------------------------------------------------------------------- 
    126 void OcclusionCullingSceneManager::PrepareVisualization(Camera *cam) 
     130} 
     131 
     132//----------------------------------------------------------------------- 
     133void VisibilityTerrainSceneManager::PrepareVisualization(Camera *cam) 
    127134{ 
    128135        // add player camera for visualization purpose 
     
    173180} 
    174181//----------------------------------------------------------------------- 
    175 Pass *OcclusionCullingSceneManager::setPass(Pass* pass) 
     182Pass *VisibilityTerrainSceneManager::setPass(Pass* pass) 
    176183{ 
    177184        // TODO: setting vertex program is not efficient 
     
    179186         
    180187        // set depth fill pass if we currently do not make an aabb occlusion query 
    181         Pass *usedPass = (mIsDepthPassPhase && !mHierarchyInterface->IsBoundingBoxQuery() ?  
    182                                           mDepthPass : pass); 
    183                  
    184         IlluminationRenderStage savedStage = mIlluminationStage;  
     188        const bool useDepthPass = 1 && 
     189                (mIsDepthPassPhase && !mHierarchyInterface->IsBoundingBoxQuery()); 
     190 
     191        Pass *usedPass = useDepthPass ? mDepthPass : pass; 
     192         
     193 
     194        const IlluminationRenderStage savedStage = mIlluminationStage;  
    185195         
    186196        // set illumination stage to NONE so no shadow material is used  
    187197        // for depth pass or for occlusion query 
    188         if (mIsDepthPassPhase || mHierarchyInterface->IsBoundingBoxQuery()) 
     198        if (1 &&  
     199                (mIsDepthPassPhase || mHierarchyInterface->IsBoundingBoxQuery())) 
    189200        { 
    190201                mIlluminationStage = IRS_NONE; 
     
    192203         
    193204        // --- set vertex program of current pass in order to set correct depth 
    194         if (mExecuteVertexProgramForAllPasses && mIsDepthPassPhase && pass->hasVertexProgram()) 
     205        if (mExecuteVertexProgramForAllPasses  
     206                && mIsDepthPassPhase  
     207                && pass->hasVertexProgram()) 
    195208        { 
    196209                // add vertex program of current pass to depth pass 
     
    207220                } 
    208221        } 
    209         else if (mDepthPass->hasVertexProgram()) 
     222        else if (mDepthPass->hasVertexProgram()) // reset vertex program 
    210223        { 
    211224                mDepthPass->setVertexProgram(""); 
    212225        } 
    213226         
    214  
    215         bool IsDepthWrite = usedPass->getDepthWriteEnabled(); 
     227        // save old depth write: needed for item buffer 
     228        const bool IsDepthWrite = usedPass->getDepthWriteEnabled(); 
    216229 
    217230        // global option which enables / disables depth writes 
     
    220233                usedPass->setDepthWriteEnabled(false); 
    221234        } 
    222         //else if (mIsItemBufferPass) {usedPass = mItemBufferPass;} 
    223          
     235         
     236 
     237        //-- set actual pass here 
    224238        Pass *result = SceneManager::setPass(usedPass); 
     239 
    225240 
    226241        // reset depth write 
     
    236251} 
    237252//----------------------------------------------------------------------- 
    238 void OcclusionCullingSceneManager::_findVisibleObjects(Camera* cam, 
     253void VisibilityTerrainSceneManager::_findVisibleObjects(Camera* cam, 
    239254                                                                                                                bool onlyShadowCasters) 
    240255{ 
     
    256271                        TerrainSceneManager::_findVisibleObjects(cam, onlyShadowCasters); 
    257272                } 
     273 
    258274                // only shadow casters will be rendered in shadow texture pass 
    259                 // mHierarchyInterface->SetOnlyShadowCasters(onlyShadowCasters); 
     275                if (0) 
     276                        mHierarchyInterface->SetOnlyShadowCasters(onlyShadowCasters); 
    260277        } 
    261278         
     
    266283} 
    267284//----------------------------------------------------------------------- 
    268 void OcclusionCullingSceneManager::_renderVisibleObjects() 
    269 { 
    270  
     285void VisibilityTerrainSceneManager::_renderVisibleObjects() 
     286{ 
    271287        InitDepthPass();          // create material for depth pass 
    272288        InitItemBufferPass(); // create material for item buffer pass 
     
    312328 
    313329                TerrainSceneManager::_renderVisibleObjects(); 
     330                ///////////////////////////////////////////////// 
    314331 
    315332#ifdef GTP_VISIBILITY_MODIFIED_OGRE 
     
    331348 
    332349                /**  
    333                 * the hierarchical culling algorithm 
    334                 * for depth pass: we just find objects and update depth buffer 
    335                 * for "delayed" rendering: we render some passes afterwards 
    336                 * e.g., transparents, because they need front-to-back sorting 
     350                 * the hierarchical culling algorithm 
     351                 * for depth pass: we just find objects and update depth buffer 
     352                 * for "delayed" rendering: we render some passes afterwards 
     353                 * e.g., transparents, because they need front-to-back sorting 
    337354                **/ 
    338355                 
     
    352369 
    353370                // add visible nodes found by the visibility culling algorithm 
     371#if 1 
    354372                if (mUseDepthPass) 
    355373                { 
     
    359377                        } 
    360378                } 
    361                  
     379#endif   
    362380                //-- now we can render all remaining queue objects 
    363                 // used for depth pass, transparents, overlay  
     381                //-- used for depth pass, transparents, overlay 
    364382                clearSpecialCaseRenderQueues(); 
    365  
    366                 TerrainSceneManager::_renderVisibleObjects(); 
     383         
     384                if (!DEBUG_CHC) 
     385                        TerrainSceneManager::_renderVisibleObjects(); 
    367386        } 
    368387                 
     
    375394 
    376395        getRenderQueue()->clear(); // finally clear render queue 
    377         OGRE_DELETE(mRenderQueue); // HACK: should be cleared before... 
     396        OGRE_DELETE(mRenderQueue); // HACK: should rather only be cleared... 
     397 
    378398        //WriteLog(); // write out stats 
    379  
    380 } 
    381  
    382 //----------------------------------------------------------------------- 
    383 void OcclusionCullingSceneManager::_updateSceneGraph(Camera* cam) 
     399} 
     400 
     401//----------------------------------------------------------------------- 
     402void VisibilityTerrainSceneManager::_updateSceneGraph(Camera* cam) 
    384403{ 
    385404        mVisibilityManager->GetCullingManager()->SetHierarchyInterface(mHierarchyInterface); 
     
    389408} 
    390409//----------------------------------------------------------------------- 
    391 bool OcclusionCullingSceneManager::setOption(const String & key, const void * val) 
     410bool VisibilityTerrainSceneManager::setOption(const String & key, const void * val) 
    392411{ 
    393412        if (key == "UseDepthPass") 
     
    482501} 
    483502//----------------------------------------------------------------------- 
    484 bool OcclusionCullingSceneManager::getOption(const String & key, void *val) 
     503bool VisibilityTerrainSceneManager::getOption(const String & key, void *val) 
    485504{ 
    486505        if (key == "NumHierarchyNodes") 
     
    494513} 
    495514//----------------------------------------------------------------------- 
    496 bool OcclusionCullingSceneManager::getOptionValues(const String & key,  
     515bool VisibilityTerrainSceneManager::getOptionValues(const String & key,  
    497516                                                                                                        StringVector &refValueList) 
    498517{ 
     
    500519} 
    501520//----------------------------------------------------------------------- 
    502 bool OcclusionCullingSceneManager::getOptionKeys(StringVector & refKeys) 
     521bool VisibilityTerrainSceneManager::getOptionKeys(StringVector & refKeys) 
    503522{ 
    504523        return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface). 
     
    506525} 
    507526//----------------------------------------------------------------------- 
    508 void OcclusionCullingSceneManager::setVisibilityManager(GtpVisibility:: 
     527void VisibilityTerrainSceneManager::setVisibilityManager(GtpVisibility:: 
    509528                                                                                                                 VisibilityManager *visManager) 
    510529{ 
     
    512531} 
    513532//----------------------------------------------------------------------- 
    514 GtpVisibility::VisibilityManager *OcclusionCullingSceneManager::getVisibilityManager( void ) 
     533GtpVisibility::VisibilityManager *VisibilityTerrainSceneManager::getVisibilityManager( void ) 
    515534{ 
    516535        return mVisibilityManager; 
    517536} 
    518537//----------------------------------------------------------------------- 
    519 void OcclusionCullingSceneManager::WriteLog() 
     538void VisibilityTerrainSceneManager::WriteLog() 
    520539{ 
    521540        std::stringstream d; 
     
    535554} 
    536555//----------------------------------------------------------------------- 
    537 void OcclusionCullingSceneManager::renderObjects( 
    538         const RenderPriorityGroup::TransparentRenderablePassList& objs,  
    539     bool doLightIteration, const LightList* manualLightList) 
     556void VisibilityTerrainSceneManager::renderObjects( 
     557                                                const RenderPriorityGroup::TransparentRenderablePassList& objs,  
     558                        bool doLightIteration,  
     559                                                const LightList* manualLightList) 
    540560{ 
    541561        // for correct rendering, transparents must be rendered after hierarchical culling 
    542         if (!mSkipTransparents) 
     562        if (1 && !mSkipTransparents) 
    543563        { 
    544564                OctreeSceneManager::renderObjects(objs, doLightIteration, manualLightList); 
     
    546566} 
    547567//----------------------------------------------------------------------- 
    548 bool OcclusionCullingSceneManager::validatePassForRendering(Pass* pass) 
     568bool VisibilityTerrainSceneManager::validatePassForRendering(Pass* pass) 
    549569{ 
    550570        // skip all but first pass if we are doing the depth pass 
    551         if ((mIsDepthPassPhase || mIsItemBufferPhase) && pass->getIndex() > 0) 
     571        if ((mIsDepthPassPhase || mIsItemBufferPhase) && (pass->getIndex() > 0)) 
    552572        { 
    553573                return false; 
    554574        } 
     575        // all but first pass 
     576        /*else if ((!mIsDepthPassPhase || mIsItemBufferPhase) && (pass->getIndex() != 0)) 
     577        { 
     578                return false; 
     579        }*/ 
    555580 
    556581        return SceneManager::validatePassForRendering(pass); 
    557582} 
    558583//----------------------------------------------------------------------- 
    559 void OcclusionCullingSceneManager::renderQueueGroupObjects(RenderQueueGroup* pGroup) 
     584void VisibilityTerrainSceneManager::renderQueueGroupObjects(RenderQueueGroup* pGroup) 
    560585{ 
    561586        if (!mIsItemBufferPhase) 
     
    565590        } 
    566591 
    567         //-- item buffer 
     592        //-- item buffer: render objects using false colors 
    568593 
    569594    // Iterate through priorities 
     
    576601} 
    577602//----------------------------------------------------------------------- 
    578 void OcclusionCullingSceneManager::RenderItemBuffer(RenderPriorityGroup* pGroup) 
     603void VisibilityTerrainSceneManager::RenderItemBuffer(RenderPriorityGroup* pGroup) 
    579604{ 
    580605        // Do solids 
     
    605630                                ipass->first->getParent()->getParent()->getName(); 
    606631                                 
    607                         LogManager::getSingleton().logMessage(d.str()); 
     632                        //LogManager::getSingleton().logMessage(d.str()); 
    608633                         
    609634                        RenderSingleObjectForItemBuffer(*irend, ipass->first); 
     
    633658} 
    634659//----------------------------------------------------------------------- 
    635 void OcclusionCullingSceneManager::RenderSingleObjectForItemBuffer(Renderable *rend, Pass *pass) 
     660void VisibilityTerrainSceneManager::RenderSingleObjectForItemBuffer(Renderable *rend, Pass *pass) 
    636661{ 
    637662        static LightList nullLightList; 
     
    674699 
    675700 
    676         // Render a single object, this will set up auto params if required 
     701        // render a single object, this will set up auto params if required 
    677702        renderSingleObject(rend, usedPass, false, &nullLightList); 
    678703} 
    679704//----------------------------------------------------------------------- 
    680 GtpVisibility::VisibilityManager *OcclusionCullingSceneManager::GetVisibilityManager() 
     705GtpVisibility::VisibilityManager *VisibilityTerrainSceneManager::GetVisibilityManager() 
    681706{ 
    682707        return mVisibilityManager; 
    683708} 
    684709//----------------------------------------------------------------------- 
    685 void OcclusionCullingSceneManager::InitVisibilityCulling(Camera *cam) 
     710void VisibilityTerrainSceneManager::InitVisibilityCulling(Camera *cam) 
    686711{ 
    687712        // reset culling manager stats 
     
    704729        mLeavePassesInQueue = 0; 
    705730 
    706         if (!mUseDepthPass && !mUseItemBuffer) 
     731        if (!DEBUG_CHC && !mUseDepthPass && !mUseItemBuffer) 
    707732        { 
    708733                if (mShadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE) 
     
    733758        } 
    734759 
    735         // skip rendering transparents in the hierarchical culling 
     760        // skip rendering transparents during the hierarchical culling 
    736761        // (because they will be rendered afterwards) 
    737         mSkipTransparents = mUseDepthPass ||  
    738                 (mLeavePassesInQueue & RenderPriorityGroup::TRANSPARENT_PASSES); 
     762        mSkipTransparents = !DEBUG_CHC &&  
     763                (mIsDepthPassPhase || (mLeavePassesInQueue & RenderPriorityGroup::TRANSPARENT_PASSES)); 
    739764 
    740765        // -- initialise interface for rendering traversal of the hierarchy 
     
    749774} 
    750775//----------------------------------------------------------------------- 
    751 OctreeHierarchyInterface *OcclusionCullingSceneManager::GetHierarchyInterface() 
     776OctreeHierarchyInterface *VisibilityTerrainSceneManager::GetHierarchyInterface() 
    752777{ 
    753778        return mHierarchyInterface; 
    754779} 
    755780//----------------------------------------------------------------------- 
    756 void OcclusionCullingSceneManager::endFrame() 
     781void VisibilityTerrainSceneManager::endFrame() 
    757782{ 
    758783        TerrainRenderable::ResetRenderLevelIndex(); 
    759784} 
    760785//----------------------------------------------------------------------- 
    761 Entity* OcclusionCullingSceneManager::createEntity(const String& entityName,  
     786Entity* VisibilityTerrainSceneManager::createEntity(const String& entityName,  
    762787                                                                                                        const String& meshName) 
    763788{ 
     
    775800} 
    776801//----------------------------------------------------------------------- 
    777 void OcclusionCullingSceneManager::renderAdditiveStencilShadowedQueueGroupObjects(RenderQueueGroup* pGroup) 
     802void VisibilityTerrainSceneManager::renderAdditiveStencilShadowedQueueGroupObjects(RenderQueueGroup* pGroup) 
    778803{ 
    779804        // only render solid passes during hierarchical culling 
     
    807832} 
    808833//----------------------------------------------------------------------- 
    809 void OcclusionCullingSceneManager::renderModulativeStencilShadowedQueueGroupObjects(RenderQueueGroup* pGroup) 
     834void VisibilityTerrainSceneManager::renderModulativeStencilShadowedQueueGroupObjects(RenderQueueGroup* pGroup) 
    810835{ 
    811836   if (mIsHierarchicalCulling) 
     
    830855   } 
    831856} 
     857 
    832858} // namespace Ogre 
Note: See TracChangeset for help on using the changeset viewer.