Ignore:
Timestamp:
05/30/05 03:20:23 (19 years ago)
Author:
mattausch
Message:

added depth pass algorithm + delayed transparent object rendering (so depth ordering is right)

Location:
trunk/VUT/work/TestCulling
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/work/TestCulling/TestCulling.vcproj

    r107 r115  
    1313                <Configuration 
    1414                        Name="Debug|Win32" 
    15                         OutputDirectory=".\bin\$(ConfigurationName)" 
     15                        OutputDirectory=".\lib\$(ConfigurationName)" 
    1616                        IntermediateDirectory=".\obj\$(ConfigurationName)" 
    1717                        ConfigurationType="1" 
     
    2121                                Name="VCCLCompilerTool" 
    2222                                Optimization="0" 
    23                                 AdditionalIncludeDirectories="&quot;$(OGRE_PATH)\Dependencies\include&quot;;&quot;$(OGRE_PATH)\OgreMain\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include\CEGUI&quot;;&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\include&quot;;&quot;$(OGRE_ADDONS_PATH)\dotsceneoctree\PlugIns\DotSceneManager\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include&quot;;../include;../../GtpVisibility/include" 
     23                                AdditionalIncludeDirectories="&quot;$(OGRE_PATH)\Dependencies\include&quot;;&quot;$(OGRE_PATH)\OgreMain\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include\CEGUI&quot;;&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\include&quot;;&quot;$(OGRE_ADDONS_PATH)\dotsceneoctree\PlugIns\DotSceneManager\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include&quot;;../include;../../GtpVisibility/include;../../Ogre/include" 
    2424                                PreprocessorDefinitions="_WINDOWS;_STLP_USE_DYNAMIC_LIB;OGRE_LIBRARY_IMPORTS;_DEBUG;WIN32;_STLP_DEBUG;PLUGIN_TERRAIN_IMPORTS;GTP_VISIBILITY_MODIFIED_OGRE" 
    2525                                MinimalRebuild="TRUE" 
     
    3434                        <Tool 
    3535                                Name="VCLinkerTool" 
    36                                 AdditionalDependencies="Plugin_OctreeSceneManager.lib OGREMain_d.LIB CEGUIBase_d.lib OgreGUIRenderer_d.lib Plugin_DotSceneManager.lib" 
     36                                AdditionalDependencies="Plugin_OctreeSceneManager.lib OGREMain_d.LIB CEGUIBase_d.lib OgreGUIRenderer_d.lib Plugin_DotSceneManager.lib Plugin_VisibilitySceneManager.lib" 
    3737                                OutputFile="$(OGRE_PATH)/Samples/Common/bin/Debug/TestCulling.exe" 
    3838                                LinkIncremental="2" 
    39                                 AdditionalLibraryDirectories="&quot;$(OGRE_PATH)\Dependencies\Lib\$(ConfigurationName)&quot;;&quot;$(OGRE_ADDONS_PATH)\dotsceneoctree\PlugIns\DotSceneManager\bin\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\OgreMain\Lib\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib&quot;" 
     39                                AdditionalLibraryDirectories="&quot;$(OGRE_PATH)\Dependencies\Lib\$(ConfigurationName)&quot;;&quot;$(OGRE_ADDONS_PATH)\dotsceneoctree\PlugIns\DotSceneManager\bin\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\OgreMain\Lib\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib&quot;;&quot;$(GAMETOOLS_PATH)\trunk\VUT\Ogre\lib\$(ConfigurationName)&quot;" 
    4040                                GenerateDebugInformation="TRUE" 
    4141                                ProgramDatabaseFile="$(OutDir)/TestCulling.pdb" 
  • trunk/VUT/work/TestCulling/TestCullingApplication.cpp

    r112 r115  
    8181void TestCullingApplication::createFrameListener() 
    8282{ 
    83         mFrameListener= new MouseQueryListener(mWindow, mCamera, mSceneMgr,  
     83        mFrameListener= new TerrainMouseQueryListener(mWindow, mCamera, mSceneMgr,  
    8484                mGUIRenderer, mSceneContentGenerator); 
    8585        mFrameListener->showDebugOverlay(true); 
     
    9494 
    9595/***********************************************/ 
    96 /* MouseQueryListener implementation           */ 
     96/* TerrainMouseQueryListener implementation           */ 
    9797/***********************************************/ 
    9898//----------------------------------------------------------------------- 
    99 MouseQueryListener::MouseQueryListener(RenderWindow* win, Camera* cam,  
     99TerrainMouseQueryListener::TerrainMouseQueryListener(RenderWindow* win, Camera* cam,  
    100100                                                                           SceneManager *sceneManager,  
    101101                                                                           CEGUI::Renderer *renderer, 
     
    111111mCurrentAlgorithm(GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING), 
    112112mShowOctree(false), 
    113 mUseVisibilityCulling(true), 
     113mUseDepthPass(false), 
    114114mUseOptimization(true), 
    115115mShowVisualization(false), 
     
    154154         
    155155        mSceneMgr->setOption("UseOptimization", &mUseOptimization); 
    156         mSceneMgr->setOption("UseVisibilityCulling", &mUseVisibilityCulling); 
     156        mSceneMgr->setOption("UseDepthPass", &mUseDepthPass); 
    157157        mSceneMgr->setOption("ShowVizualisation", &mShowVisualization); 
    158158        mSceneMgr->setOption("ShowOctree", &mShowOctree); 
     
    161161}  
    162162//----------------------------------------------------------------------- 
    163 MouseQueryListener::~MouseQueryListener( ) 
    164 { 
    165 } 
    166 //----------------------------------------------------------------------- 
    167 void MouseQueryListener::mouseMoved (MouseEvent *e) 
     163TerrainMouseQueryListener::~TerrainMouseQueryListener( ) 
     164{ 
     165} 
     166//----------------------------------------------------------------------- 
     167void TerrainMouseQueryListener::mouseMoved (MouseEvent *e) 
    168168{ 
    169169        // Update CEGUI with the mouse motion 
     
    171171} 
    172172//----------------------------------------------------------------------- 
    173 void MouseQueryListener::mousePressed(MouseEvent* e) 
     173void TerrainMouseQueryListener::mousePressed(MouseEvent* e) 
    174174{ 
    175175     // Left mouse button down 
     
    187187 
    188188 //----------------------------------------------------------------------- 
    189 void MouseQueryListener::mouseReleased(MouseEvent* e) 
     189void TerrainMouseQueryListener::mouseReleased(MouseEvent* e) 
    190190{ 
    191191    // Left mouse button up 
     
    203203}  
    204204//----------------------------------------------------------------------- 
    205 void MouseQueryListener::mouseDragged (MouseEvent *e) 
     205void TerrainMouseQueryListener::mouseDragged (MouseEvent *e) 
    206206 { 
    207207         // If we are dragging the left mouse button.             
     
    218218} 
    219219//----------------------------------------------------------------------- 
    220 bool MouseQueryListener::frameStarted(const FrameEvent &evt) 
     220bool TerrainMouseQueryListener::frameStarted(const FrameEvent &evt) 
    221221{         
    222222        return ExampleFrameListener::frameStarted(evt); 
    223223} 
    224224//----------------------------------------------------------------------- 
    225 bool MouseQueryListener::frameEnded(const FrameEvent& evt) 
     225bool TerrainMouseQueryListener::frameEnded(const FrameEvent& evt) 
    226226{ 
    227227        if (mShutdownRequested) 
     
    236236        KEY_PRESSED(KC_ADD, 0, changeThreshold(10)); 
    237237        KEY_PRESSED(KC_O, 0.3, toggleUseOptimization()); 
    238         KEY_PRESSED(KC_C, 0.3, toggleUseVisibilityCulling()); 
     238        KEY_PRESSED(KC_C, 0.3, toggleUseDepthPass()); 
    239239        KEY_PRESSED(KC_V, 0.3, toggleShowViz()); 
    240240 
     
    244244} 
    245245//----------------------------------------------------------------------- 
    246 void MouseQueryListener::changeThreshold(int incr) 
     246void TerrainMouseQueryListener::changeThreshold(int incr) 
    247247{ 
    248248        mVisibilityThreshold += incr;  
     
    255255} 
    256256//----------------------------------------------------------------------- 
    257 void MouseQueryListener::nextAlgorithm() 
     257void TerrainMouseQueryListener::nextAlgorithm() 
    258258{ 
    259259        mCurrentAlgorithm = ++mCurrentAlgorithm %  
     
    263263} 
    264264//----------------------------------------------------------------------- 
    265 void MouseQueryListener::toggleUseOptimization() 
     265void TerrainMouseQueryListener::toggleUseOptimization() 
    266266{ 
    267267        mUseOptimization = !mUseOptimization; 
     
    275275} 
    276276//----------------------------------------------------------------------- 
    277 void MouseQueryListener::toggleShowOctree() 
     277void TerrainMouseQueryListener::toggleShowOctree() 
    278278{ 
    279279        mShowOctree = !mShowOctree; 
     
    282282} 
    283283//----------------------------------------------------------------------- 
    284 void MouseQueryListener::toggleUseVisibilityCulling() 
    285 { 
    286         mUseVisibilityCulling = !mUseVisibilityCulling; 
    287  
    288         mSceneMgr->setOption("UseVisibilityCulling", &mUseVisibilityCulling); 
    289 } 
    290 //----------------------------------------------------------------------- 
    291 void MouseQueryListener::toggleShowViz() 
     284void TerrainMouseQueryListener::toggleUseDepthPass() 
     285{ 
     286        mUseDepthPass = !mUseDepthPass; 
     287 
     288        mSceneMgr->setOption("UseDepthPass", &mUseDepthPass); 
     289} 
     290//----------------------------------------------------------------------- 
     291void TerrainMouseQueryListener::toggleShowViz() 
    292292{ 
    293293        mShowVisualization = !mShowVisualization; 
     
    297297} 
    298298//----------------------------------------------------------------------- 
    299 void MouseQueryListener::setAlgorithm(int algorithm) 
     299void TerrainMouseQueryListener::setAlgorithm(int algorithm) 
    300300{ 
    301301        mAlgorithmInfo->setCaption(": " + mCurrentAlgorithmCaptions[mCurrentAlgorithm]); 
     
    303303} 
    304304//----------------------------------------------------------------------- 
    305 void MouseQueryListener::updateStats() 
     305void TerrainMouseQueryListener::updateStats() 
    306306{ 
    307307        unsigned int opt = 0; 
     
    330330} 
    331331//----------------------------------------------------------------------- 
    332 void MouseQueryListener::keyPressed(KeyEvent* e) 
     332void TerrainMouseQueryListener::keyPressed(KeyEvent* e) 
    333333{ 
    334334        if(e->getKey() == KC_ESCAPE) 
     
    344344} 
    345345//----------------------------------------------------------------------- 
    346 void MouseQueryListener::keyReleased(KeyEvent* e) 
     346void TerrainMouseQueryListener::keyReleased(KeyEvent* e) 
    347347{ 
    348348        CEGUI::System::getSingleton().injectKeyUp(e->getKey()); 
     
    350350} 
    351351//----------------------------------------------------------------------- 
    352 void MouseQueryListener::keyClicked(KeyEvent* e)  
     352void TerrainMouseQueryListener::keyClicked(KeyEvent* e)  
    353353{ 
    354354        // Do nothing 
  • trunk/VUT/work/TestCulling/TestCullingApplication.h

    r112 r115  
    2525}; 
    2626 
    27 class MouseQueryListener : public ExampleFrameListener, public MouseListener, public MouseMotionListener 
     27class TerrainMouseQueryListener : public ExampleFrameListener, public MouseListener, public MouseMotionListener 
    2828{ 
    2929public: 
    3030 
    31     MouseQueryListener(RenderWindow* win, Camera* cam, SceneManager *sceneManager,  
     31    TerrainMouseQueryListener(RenderWindow* win, Camera* cam, SceneManager *sceneManager,  
    3232                        CEGUI::Renderer *renderer, SceneContentGenerator *sceneContentGenerator); 
    3333 
    3434 
    35     ~MouseQueryListener( ); 
     35    ~TerrainMouseQueryListener( ); 
    3636 
    3737        bool frameStarted(const FrameEvent& evt); 
     
    6666        void toggleUseOptimization(); 
    6767        void toggleShowOctree(); 
    68         void toggleUseVisibilityCulling(); 
     68        void toggleUseDepthPass(); 
    6969        void toggleShowViz(); 
    7070 
     
    9494        bool mUseOptimization; 
    9595        bool mShowOctree; 
    96         bool mUseVisibilityCulling; 
     96        bool mUseDepthPass; 
    9797        bool mShowVisualization; 
    9898 
Note: See TracChangeset for help on using the changeset viewer.