Changeset 2161


Ignore:
Timestamp:
02/23/07 13:54:56 (17 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis
Files:
8 edited

Legend:

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

    r2160 r2161  
    18171817        return false; 
    18181818} 
    1819  
    1820  
    1821 #if 0 
     1819//----------------------------------------------------------------------- 
    18221820void OcclusionCullingSceneManager::RenderDepthPass() 
    18231821{ 
     1822        // create material for depth pass 
     1823        InitDepthPass(); 
     1824 
    18241825        //////////////////// 
    18251826        //-- hierarchical culling 
    1826  
    1827         // exclude these queues from hierarchical rendering 
    1828         clearSpecialCaseRenderQueues(); 
    1829         addSpecialCaseRenderQueue(RENDER_QUEUE_BACKGROUND); 
    1830         addSpecialCaseRenderQueue(RENDER_QUEUE_SKIES_EARLY); 
    1831         addSpecialCaseRenderQueue(RENDER_QUEUE_SKIES_LATE); 
    1832         addSpecialCaseRenderQueue(RENDER_QUEUE_OVERLAY); 
    1833         setSpecialCaseRenderQueueMode(SceneManager::SCRQM_EXCLUDE); 
    18341827 
    18351828        // set all necessary parameters for  
     
    18501843        // all which are not in mLeavePassesInQueue) 
    18511844        _deleteRenderedQueueGroups(mLeavePassesInQueue); 
    1852  
    1853         ///////////// 
    1854         //-- reset parameters needed for special rendering 
    1855                  
    1856         mIsDepthPassPhase = false; 
    1857         mIsItemBufferPhase = false; 
    1858         mSkipTransparents = false; 
    1859         mIsHierarchicalCulling = false; 
    1860                  
    1861         mLeavePassesInQueue = 0; 
    1862                  
    1863         ///////////// 
    1864         //-- now we can render all remaining queue objects 
    1865         //-- used for depth pass, transparents, overlay 
    1866     clearSpecialCaseRenderQueues(); 
    1867  
    1868         // the shaded geometry is rendered in a second pass 
    1869         // add visible nodes found by the visibility culling algorithm 
    1870         NodeList::const_iterator it, it_end = mVisible.end(); 
    1871  
    1872         if(1)  
    1873         for (it = mVisible.begin(); it != it_end; ++ it) 
    1874         { 
    1875                 (*it)->_addToRenderQueue(mCameraInProgress, getRenderQueue(), false); 
    1876         } 
    1877 } 
    1878 #endif 
    1879 void OcclusionCullingSceneManager::RenderDepthPass() 
    1880 { 
    1881         InitDepthPass(); // create material for depth pass 
    1882  
    1883         //////////////////// 
    1884         //-- hierarchical culling 
    1885  
    1886         // set all necessary parameters for  
    1887         // hierarchical visibility culling and rendering 
    1888         InitVisibilityCulling(mCameraInProgress); 
    1889  
    1890  
    1891         /**  
    1892         * the hierarchical culling algorithm 
    1893         * for depth pass: we just find objects and update depth buffer 
    1894         * for "delayed" rendering: we render some passes afterwards 
    1895         * e.g., transparents, because they need front-to-back sorting 
    1896         **/ 
    1897                  
    1898         mVisibilityManager->ApplyVisibilityCulling(); 
    1899  
    1900         // delete remaining renderables from queue 
    1901         //_deleteRenderedQueueGroups(); 
    1902         getRenderQueue()->clear(); 
    19031845 
    19041846        ///////////// 
  • GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp

    r2117 r2161  
    621621 
    622622        // HACK 
    623         if (mRayCaster->mVssRayPool.mIndex > mSamplesPerPass) 
     623        /*if (mRayCaster->mVssRayPool.mIndex > mSamplesPerPass) 
    624624        { 
    625625                cout << "warning: new samples: " << castSamples << " " << "queue: "  << (int)mRayQueue.size() << endl; 
    626626                Debug << "warning: new samples: " << castSamples << " " << "queue: "  << (int)mRayQueue.size() << endl; 
    627         } 
     627        }*/ 
    628628 
    629629        return castSamples; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/HashPvs.h

    r2146 r2161  
    22#define __HASHPVS_H 
    33 
    4 //#include <hash_map> 
     4 
    55#include <hash_set> 
    66#include "common.h" 
    77#include <math.h> 
    88#include "PvsBase.h" 
     9#include "google/dense_hash_set" 
    910 
    1011 
     
    2526   size_t operator()(T a) const 
    2627   { 
    27       size_t h = (size_t)(a->GetId());// % 2000; 
    28       //for (; *s; ++s) 
    29       //   h = 5 * h + *s; 
    30       return h; 
     28           return (size_t)(a->GetId()); 
    3129   } 
    3230 
     
    3735}; 
    3836 
    39 /* 
    40 template<typename T> 
    41 struct gt 
    42 { 
    43         bool operator() (T s1, T s2) const 
    44         { 
    45                 return s1 > s2; 
    46         } 
    47 }; 
    48 */ 
    49 //#define HASH_SET stdext::hash_set<T, stdext::hash_compare<T, gt<T> > > 
    50 #define HASH_SET stdext::hash_set<T, my_hash_compare<T> > 
     37 
     38#define HASH_SET google::dense_hash_set<T, my_hash_compare<T> > 
     39//#define HASH_SET stdext::hash_set<T, my_hash_compare<T> > 
     40#define HASH_ITERATOR HASH_SET::iterator 
     41#define CONST_HASH_ITERATOR HASH_SET::const_iterator 
    5142 
    5243/** Iterator over a hash pvs. 
     
    5950        HashPvsIterator<T, S>() {} 
    6051 
    61         HashPvsIterator<T, S>(const typename HASH_SET::const_iterator &itCurrent, 
    62                                                   const typename HASH_SET::const_iterator &itEnd): 
     52        HashPvsIterator<T, S>(const typename CONST_HASH_ITERATOR &itCurrent, 
     53                                                  const typename CONST_HASH_ITERATOR &itEnd): 
    6354        mItCurrent(itCurrent), mItEnd(itEnd) 
    6455        { 
     
    7263        T Next(S &pdf) 
    7364        { 
    74                 // hack: create new pvs entry 
    75                 return *(mItCurrent) ++; 
     65                T sample = *mItCurrent; 
     66                ++ mItCurrent; 
     67 
     68                return sample; 
    7669        } 
    7770 
    7871        T Next() 
    7972        { 
    80                 // hack: create new pvs entry 
    81                 return *(mItCurrent) ++; 
     73                T sample = *mItCurrent; 
     74                ++ mItCurrent; 
     75 
     76                return sample; 
    8277        } 
    8378         
    8479private: 
    85         typename HASH_SET::const_iterator mItCurrent; 
    86         typename HASH_SET::const_iterator mItEnd; 
     80        typename CONST_HASH_ITERATOR mItCurrent; 
     81        typename CONST_HASH_ITERATOR mItEnd; 
    8782}; 
    8883 
     
    139134                it would be added in the sorted vector. 
    140135        */ 
    141         bool Find(T sample, typename HASH_SET::iterator &it); 
     136        inline bool Find(T sample, typename HASH_ITERATOR &it); 
    142137 
    143138        typename HashPvsIterator<T, S> GetIterator() const; 
     
    210205 
    211206template <typename T, typename S> 
    212 bool HashPvs<T, S>::Find(T sample, typename HASH_SET::iterator &it) 
     207bool HashPvs<T, S>::Find(T sample, typename HASH_ITERATOR &it) 
    213208{ 
    214209        it = mEntries.find(sample); 
     
    216211        // already in map 
    217212        return (it != mEntries.end()); 
     213        return false; 
    218214} 
    219215 
     
    236232float HashPvs<T, S>::AddSample(T sample, const float pdf) 
    237233{ 
    238         static HASH_SET::iterator it; 
     234        static HASH_ITERATOR it; 
    239235 
    240236        if (Find(sample, it)) 
     
    256252void HashPvs<T, S>::AddSampleDirty(T sample, const float pdf) 
    257253{ 
    258         static HASH_SET::iterator it; 
     254        static HASH_ITERATOR it; 
    259255 
    260256        // not yet in map 
     
    272268                                                                                const float pdf) 
    273269{ 
    274         /*pair<HASH_SET::iterator, bool> p = mEntries.insert(sample); 
     270        /*pair<HASH_ITERATOR, bool> p = mEntries.insert(sample); 
    275271 
    276272        // already in map 
    277273        return p.second; 
    278274*/ 
    279         static HASH_SET::iterator it; 
     275        static HASH_ITERATOR it; 
    280276 
    281277        // already in map 
     
    375371                                                  const HashPvs<T, S> &b) 
    376372{ 
    377         HASH_SET::const_iterator ait, ait_end = a.mEntries.end(); 
     373        CONST_HASH_ITERATOR ait, ait_end = a.mEntries.end(); 
    378374 
    379375        for (ait = a.mEntries.begin(); ait != ait_end; ++ ait) 
     
    382378        } 
    383379 
    384         HASH_SET::const_iterator bit, bit_end = b.mEntries.end(); 
     380        CONST_HASH_ITERATOR bit, bit_end = b.mEntries.end(); 
    385381 
    386382        for (bit = b.mEntries.begin(); bit != bit_end; ++ bit) 
     
    389385        } 
    390386 
    391         //cerr << "not implemented" << endl;  
    392387} 
    393388 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj

    r2160 r2161  
    2020                                Name="VCCLCompilerTool" 
    2121                                Optimization="0" 
    22                                 AdditionalIncludeDirectories="..\include;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost;Timer" 
    23                                 PreprocessorDefinitions="WIN32;_DEBUG;_LIB" 
     22                                AdditionalIncludeDirectories="..\include;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost;Timer;..\src\sparsehash\src;..\src\sparsehash\src\windows;..\src\sparsehash\src\google;..\src\sparsehash\src\google\sparsehash" 
     23                                PreprocessorDefinitions="WIN32;_DEBUG;_LIB;NO_QT" 
    2424                                MinimalRebuild="TRUE" 
    2525                                BasicRuntimeChecks="3" 
     
    221221                                OptimizeForProcessor="3" 
    222222                                OptimizeForWindowsApplication="TRUE" 
    223                                 AdditionalIncludeDirectories="..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost;..\MultiLevelRayTracing;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(QTDIR)\include\QtOpenGl&quot;;&quot;$(CG_INC_PATH)&quot;;Timer" 
     223                                AdditionalIncludeDirectories="..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost;..\MultiLevelRayTracing;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(QTDIR)\include\QtOpenGl&quot;;&quot;$(CG_INC_PATH)&quot;;Timer;..\src\ootl\src\;..\src\ootl\src\cpp;..\src\ootl\src\include\ootl\sandbox;..\src\ootl\;..\src\ootl\src\include\ootl;..\src\sparsehash\src\google\sparsehash;..\src\sparsehash\src\windows;..\src\sparsehash\src\google;..\src\sparsehash\src" 
    224224                                PreprocessorDefinitions="WIN32;NDEBUG;_LIB;GTP_INTERNAL;USE_QT;USE_HASH_PVS" 
    225225                                ExceptionHandling="TRUE" 
     
    489489                        <File 
    490490                                RelativePath=".\HashPvs.h"> 
     491                        </File> 
     492                        <File 
     493                                RelativePath=".\HashPvs2.h"> 
    491494                        </File> 
    492495                        <File 
     
    10401043                        </File> 
    10411044                </Filter> 
     1045                <Filter 
     1046                        Name="ootl" 
     1047                        Filter=""> 
     1048                        <Filter 
     1049                                Name="include" 
     1050                                Filter=""> 
     1051                                <File 
     1052                                        RelativePath=".\ootl\src\include\ootl\sandbox\ootl_adapters.hpp"> 
     1053                                </File> 
     1054                                <File 
     1055                                        RelativePath=".\ootl\src\include\ootl\sandbox\ootl_benchmark.hpp"> 
     1056                                </File> 
     1057                                <File 
     1058                                        RelativePath=".\ootl\src\include\ootl\sandbox\ootl_bool_stack.hpp"> 
     1059                                </File> 
     1060                                <File 
     1061                                        RelativePath=".\ootl\src\include\ootl\sandbox\ootl_dictionary.hpp"> 
     1062                                </File> 
     1063                                <File 
     1064                                        RelativePath=".\ootl\src\include\ootl\sandbox\ootl_fft.hpp"> 
     1065                                </File> 
     1066                                <File 
     1067                                        RelativePath=".\ootl\src\include\ootl\sandbox\ootl_fft_test.hpp"> 
     1068                                </File> 
     1069                                <File 
     1070                                        RelativePath=".\ootl\src\include\ootl\sandbox\ootl_functions.hpp"> 
     1071                                </File> 
     1072                                <File 
     1073                                        RelativePath=".\ootl\src\include\ootl\sandbox\ootl_generators.hpp"> 
     1074                                </File> 
     1075                                <File 
     1076                                        RelativePath=".\ootl\src\include\ootl\ootl_hash.hpp"> 
     1077                                </File> 
     1078                                <File 
     1079                                        RelativePath=".\ootl\src\include\ootl\sandbox\ootl_iterable.hpp"> 
     1080                                </File> 
     1081                                <File 
     1082                                        RelativePath=".\ootl\src\include\ootl\sandbox\ootl_iterators.hpp"> 
     1083                                </File> 
     1084                                <File 
     1085                                        RelativePath=".\ootl\src\include\ootl\ootl_list.hpp"> 
     1086                                </File> 
     1087                                <File 
     1088                                        RelativePath=".\ootl\src\include\ootl\sandbox\ootl_map.hpp"> 
     1089                                </File> 
     1090                                <File 
     1091                                        RelativePath=".\ootl\src\include\ootl\ootl_misc.hpp"> 
     1092                                </File> 
     1093                                <File 
     1094                                        RelativePath=".\ootl\src\include\ootl\mswin\ootl_mswin.hpp"> 
     1095                                </File> 
     1096                                <File 
     1097                                        RelativePath=".\ootl\src\include\ootl\mswin\ootl_mswin_console.hpp"> 
     1098                                </File> 
     1099                                <File 
     1100                                        RelativePath=".\ootl\src\include\ootl\mswin\ootl_mswin_gdi.hpp"> 
     1101                                </File> 
     1102                                <File 
     1103                                        RelativePath=".\ootl\src\include\ootl\mswin\ootl_mswin_simple_win.hpp"> 
     1104                                </File> 
     1105                                <File 
     1106                                        RelativePath=".\ootl\src\include\ootl\ootl_object.hpp"> 
     1107                                </File> 
     1108                                <File 
     1109                                        RelativePath=".\ootl\src\include\ootl\ootl_output.hpp"> 
     1110                                </File> 
     1111                                <File 
     1112                                        RelativePath=".\ootl\src\include\ootl\sandbox\ootl_polar.hpp"> 
     1113                                </File> 
     1114                                <File 
     1115                                        RelativePath=".\ootl\src\include\ootl\sandbox\ootl_predicate.hpp"> 
     1116                                </File> 
     1117                                <File 
     1118                                        RelativePath=".\ootl\src\include\ootl\sandbox\ootl_procedure.hpp"> 
     1119                                </File> 
     1120                                <File 
     1121                                        RelativePath=".\ootl\src\include\ootl\sandbox\ootl_ptr.hpp"> 
     1122                                </File> 
     1123                                <File 
     1124                                        RelativePath=".\ootl\src\include\ootl\ootl_stack.hpp"> 
     1125                                </File> 
     1126                                <File 
     1127                                        RelativePath=".\ootl\src\include\ootl\ootl_string.hpp"> 
     1128                                </File> 
     1129                                <File 
     1130                                        RelativePath=".\ootl\src\include\ootl\ootl_string_utils.hpp"> 
     1131                                </File> 
     1132                                <File 
     1133                                        RelativePath=".\ootl\src\include\ootl\ootl_tester.hpp"> 
     1134                                </File> 
     1135                                <File 
     1136                                        RelativePath=".\ootl\src\include\ootl\ootl_timer.hpp"> 
     1137                                </File> 
     1138                                <File 
     1139                                        RelativePath=".\ootl\src\include\ootl\sandbox\ootl_valarray.hpp"> 
     1140                                </File> 
     1141                                <File 
     1142                                        RelativePath=".\ootl\src\include\ootl\ootl_vlist.hpp"> 
     1143                                </File> 
     1144                        </Filter> 
     1145                </Filter> 
     1146                <Filter 
     1147                        Name="google" 
     1148                        Filter=""> 
     1149                        <File 
     1150                                RelativePath=".\sparsehash\src\google\sparsehash\config.h"> 
     1151                        </File> 
     1152                        <File 
     1153                                RelativePath=".\sparsehash\src\google\sparsehash\densehashtable.h"> 
     1154                        </File> 
     1155                        <File 
     1156                                RelativePath=".\sparsehash\src\windows\hash_fun.h"> 
     1157                        </File> 
     1158                        <File 
     1159                                RelativePath=".\sparsehash\src\google\sparsehash\hash_fun.h"> 
     1160                        </File> 
     1161                        <File 
     1162                                RelativePath=".\sparsehash\src\windows\hash_map.h"> 
     1163                        </File> 
     1164                        <File 
     1165                                RelativePath=".\sparsehash\src\google\sparsehash\sparsehashtable.h"> 
     1166                        </File> 
     1167                        <File 
     1168                                RelativePath=".\sparsehash\src\windows\stl_hash_fun.h"> 
     1169                        </File> 
     1170                </Filter> 
    10421171                <File 
    10431172                        RelativePath=".\VTune\Preprocessor.vpj"> 
  • GTP/trunk/Lib/Vis/Preprocessing/src/RayCaster.h

    r2077 r2161  
    7979  // pool of vss rays to be used in one pass of the sampling 
    8080  struct VssRayPool { 
    81         VssRayPool():mRays(NULL), mIndex(0), mNumber(0) {} 
    82         ~VssRayPool() { 
    83           if (mRays) 
    84                 delete mRays; 
     81        VssRayPool(): mRays(NULL), mIndex(0), mNumber(0)  
     82        {} 
     83 
     84        ~VssRayPool()  
     85        { 
     86                DEL_PTR(mRays); 
    8587        } 
    8688         
    8789        void Reserve(const int number) { 
    88           if (mRays) 
    89                 delete mRays; 
    90          
     90                cout<<"here3"<<endl; 
     91        //DEL_PTR(mRays); 
     92        cout<<"here44"<<endl; 
    9193          mRays = new VssRay[number]; 
    9294          mNumber = number; 
     
    102104          return mRays + mIndex ++; 
    103105        } 
    104  
     106  protected: 
    105107        VssRay *mRays; 
    106108        int mIndex; 
     
    154156 
    155157  /** Checks if ray is valid. 
    156   I.e., the ray is in valid view space. 
    157   @note: clamps the ray to valid view space. 
     158          I.e., the ray is in valid view space. 
     159          @note: clamps the ray to valid view space. 
    158160  */ 
    159161  bool ValidateRay(const Vector3 &origin, 
  • GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj

    r2146 r2161  
    2020                                Name="VCCLCompilerTool" 
    2121                                Optimization="0" 
    22                                 AdditionalIncludeDirectories="..\include;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost" 
     22                                AdditionalIncludeDirectories="..\include;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost;..\src\sparsehash\src\" 
    2323                                PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NO_QT" 
    2424                                MinimalRebuild="TRUE" 
     
    198198                                OptimizeForProcessor="3" 
    199199                                OptimizeForWindowsApplication="TRUE" 
    200                                 AdditionalIncludeDirectories="..\include;..\..\..\..\..\..\NonGTP\Boost;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;&quot;$(QTDIR)\include\QtOpenGl&quot;;&quot;$(QTDIR)\include\Qt&quot;;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include&quot;;QtInterface" 
     200                                AdditionalIncludeDirectories="..\include;..\..\..\..\..\..\NonGTP\Boost;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;&quot;$(QTDIR)\include\QtOpenGl&quot;;&quot;$(QTDIR)\include\Qt&quot;;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include&quot;;QtInterface;..\src\sparsehash\src\;$(NOINHERIT)" 
    201201                                PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;GTP_INTERNAL;USE_QT;USE_CG;USE_HASH_PVS" 
    202202                                ExceptionHandling="TRUE" 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp

    r2130 r2161  
    2626 
    2727#include "PerfTimer.h" 
    28  
    2928 
    3029 
  • GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp

    r2117 r2161  
    2020#include "SceneGraph.h" 
    2121#include "GlobalLinesRenderer.h" 
    22 #include "PvsDefinitions.h" 
     22//#include "PvsDefinitions.h" 
    2323 
    2424#include "ViewCellsManager.h" 
Note: See TracChangeset for help on using the changeset viewer.