Changeset 316
- Timestamp:
- 10/10/05 15:23:32 (19 years ago)
- Location:
- trunk/VUT
- Files:
-
- 1 deleted
- 34 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibility/include/DistanceQueue.h
r87 r316 17 17 a greater distance has a lower priority in the queue. 18 18 */ 19 template <typename T> class G reaterDistance19 template <typename T> class GtDistance 20 20 { 21 21 public: 22 G reaterDistance(HierarchyInterface *hierarchyInterface): mHierarchyInterface(hierarchyInterface)22 GtDistance(HierarchyInterface *hierarchyInterface): mHierarchyInterface(hierarchyInterface) 23 23 {} 24 24 … … 34 34 /** A priority queue where closer hierarchy nodes are given a higher priority. 35 35 */ 36 typedef std::priority_queue<HierarchyNode *, std::vector<HierarchyNode *>, G reaterDistance<std::vector<HierarchyNode *>::value_type> > DistanceQueue;36 typedef std::priority_queue<HierarchyNode *, std::vector<HierarchyNode *>, GtDistance<std::vector<HierarchyNode *>::value_type> > DistanceQueue; 37 37 38 38 } // namespace GtpVisibility -
trunk/VUT/GtpVisibility/include/DummyPreprocessingManager.h
r65 r316 52 52 */ 53 53 virtual int AddViewCellPVS(const int cellID, 54 InfoContainer<NodeInfo>*visibleNodes,55 InfoContainer<MeshInfo> *visibleMeshes);54 NodeInfoContainer *visibleNodes, 55 MeshInfoContainer *visibleMeshes); 56 56 57 57 }; -
trunk/VUT/GtpVisibility/include/DummyQueryManager.h
r174 r316 23 23 virtual void 24 24 ComputeCameraVisibility(const Camera &camera, 25 InfoContainer<NodeInfo>*visibleNodes,26 InfoContainer<MeshInfo>*visibleGeometry,27 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches,25 NodeInfoContainer *visibleNodes, 26 MeshInfoContainer *visibleGeometry, 27 PatchInfoContainer *visiblePatches, 28 28 bool relativeVisibility = false ); 29 29 … … 33 33 virtual void 34 34 ComputeFromPointVisibility(const Vector3 &point, 35 InfoContainer<NodeInfo>*visibleNodes,36 InfoContainer<MeshInfo>*visibleGeometry,37 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches,35 NodeInfoContainer *visibleNodes, 36 MeshInfoContainer *visibleGeometry, 37 PatchInfoContainer *visiblePatches, 38 38 bool relativeVisibility = false 39 39 ); -
trunk/VUT/GtpVisibility/include/PreprocessingManager.h
r113 r316 82 82 virtual bool GetPVS(const Vector3 &point, 83 83 const float radius, 84 InfoContainer<NodeInfo>*visibleNodes,85 InfoContainer<MeshInfo> *visibleMeshes);84 NodeInfoContainer *visibleNodes, 85 MeshInfoContainer *visibleMeshes); 86 86 87 87 … … 125 125 */ 126 126 virtual int AddViewCellPVS(const int cellID, 127 InfoContainer<NodeInfo>*visibleNodes,128 InfoContainer<MeshInfo>*visibleMeshes ) = 0;127 NodeInfoContainer *visibleNodes, 128 MeshInfoContainer *visibleMeshes ) = 0; 129 129 130 130 HierarchyInterface *mSceneTraverser; -
trunk/VUT/GtpVisibility/include/QueryManager.h
r174 r316 49 49 virtual void 50 50 ComputeCameraVisibility(const Camera &camera, 51 InfoContainer<NodeInfo>*visibleNodes,52 InfoContainer<MeshInfo>*visibleGeometry,53 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches,51 NodeInfoContainer *visibleNodes, 52 MeshInfoContainer *visibleGeometry, 53 PatchInfoContainer *visiblePatches, 54 54 bool relativeVisibility = false 55 55 ) = 0; … … 61 61 virtual void 62 62 ComputeFromPointVisibility(const Vector3 &point, 63 InfoContainer<NodeInfo>*visibleNodes,64 InfoContainer<MeshInfo>*visibleGeometry,65 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches,63 NodeInfoContainer *visibleNodes, 64 MeshInfoContainer *visibleGeometry, 65 PatchInfoContainer *visiblePatches, 66 66 bool relativeVisibility = false 67 67 ) = 0; -
trunk/VUT/GtpVisibility/include/VisibilityInfo.h
r159 r316 8 8 9 9 namespace GtpVisibility { 10 10 11 11 /** Class storing visibility information. 12 12 */ 13 template<typename T> 13 14 class VisibilityInfo 14 15 { 15 16 public: 16 VisibilityInfo(const int visiblePixels, const int projectedPixels); 17 VisibilityInfo(T source, const int visiblePixels, const int projectedPixels); 18 19 /** set source of the info. 20 */ 21 void SetSource(T source); 22 /** get source of the info. 23 */ 24 T GetSource() const; 17 25 18 26 int GetVisiblePixels() const; … … 27 35 /** Adds visibility to current visibility information. 28 36 */ 29 void AddVisibility(const VisibilityInfo &info);37 void AddVisibility(const VisibilityInfo<T> &info); 30 38 /** Adds visibility to current visibility information. 31 39 */ 32 void AddVisibility(const int visiblePixels, const int vrojectedPixels);40 void AddVisibility(const int visiblePixels, const int projectedPixels); 33 41 34 42 protected: … … 39 47 */ 40 48 int mProjectedPixels; 41 };42 /** Class storing the visibility information of a hierarchy node.43 */44 class NodeInfo: public VisibilityInfo45 {46 public:47 NodeInfo(HierarchyNode *node, const int visiblePixels, const int projectedPixels);48 49 49 void SetNode(HierarchyNode *node); 50 HierarchyNode *GetNode() const; 51 //bool operator<(const NodeInfo& rhs) const {return mNode < rhs.mNode;} 52 53 protected: 54 55 /** Pointer to the hierarchy nnode. 56 */ 57 HierarchyNode *mNode; 58 }; 59 60 /** Class storing the visibility information of a mesh. 61 */ 62 class MeshInfo: public VisibilityInfo 63 { 64 public: 65 MeshInfo(Mesh *mesh, const int visiblePixels, const int projectedPixels); 66 67 Mesh *GetMesh() const; 68 void SetMesh(Mesh *mesh); 69 70 //bool operator<(const MeshInfo& rhs) const {return mMesh < rhs.mMesh;} 71 //bool operator==(const MeshInfo& rhs) const {return mMesh == rhs.mMesh;} 72 73 protected: 74 75 /** Pointer to the mesh. 76 */ 77 Mesh *mMesh; 50 T mSource; 78 51 }; 79 52 80 /** Class storing the visibility information of a patch, i.e., parts of meshes having the same material 81 properties. 82 */ 83 class PatchInfo: public VisibilityInfo 53 //----------------------------------------------------------------------- 54 template <typename T> 55 T VisibilityInfo<T>::GetSource() const 84 56 { 85 public: 86 PatchInfo(Patch *Patch, const int visiblePixels, const int projectedPixels); 57 return mSource; 58 } 87 59 88 Patch *GetPatch() const; 89 void SetPatch(Patch *patch); 90 91 protected: 60 //----------------------------------------------------------------------- 61 template <typename T> 62 void VisibilityInfo<T>::SetSource(T source) 63 { 64 return mSource; 65 } 92 66 93 /** Pointer to the patch. 94 */ 95 Patch *mPatch; 67 //----------------------------------------------------------------------- 68 template <typename T> 69 VisibilityInfo<T>::VisibilityInfo(T source, const int visiblePixels, const int projectedPixels): 70 mSource(source), mProjectedPixels(projectedPixels), mVisiblePixels(visiblePixels) 71 { 72 } 73 74 //----------------------------------------------------------------------- 75 template <typename T> 76 int VisibilityInfo<T>::GetVisiblePixels() const 77 { 78 return mVisiblePixels; 79 } 80 //----------------------------------------------------------------------- 81 template <typename T> 82 int VisibilityInfo<T>::GetProjectedPixels() const 83 { 84 return mProjectedPixels; 85 } 86 //----------------------------------------------------------------------- 87 template <typename T> 88 void VisibilityInfo<T>::SetVisiblePixels(int vis) 89 { 90 mVisiblePixels = vis; 91 } 92 //----------------------------------------------------------------------- 93 template <typename T> 94 void VisibilityInfo<T>::SetProjectedPixels(int vis) 95 { 96 mProjectedPixels = vis; 97 } 98 //----------------------------------------------------------------------- 99 template <typename T> 100 float VisibilityInfo<T>::ComputeRelativeVisibility() 101 { 102 if (!mProjectedPixels) 103 return 0; 104 105 return (float)mVisiblePixels / (float)mProjectedPixels; 106 } 107 //----------------------------------------------------------------------- 108 template <typename T> 109 void VisibilityInfo<T>::AddVisibility(const VisibilityInfo<T> &info) 110 { 111 mVisiblePixels += info.GetVisiblePixels(); 112 mProjectedPixels += info.GetProjectedPixels(); 113 } 114 115 //----------------------------------------------------------------------- 116 template <typename T> 117 void VisibilityInfo<T>::AddVisibility(const int visiblePixels, const int projectedPixels) 118 { 119 mVisiblePixels += visiblePixels; 120 mProjectedPixels += projectedPixels; 121 } 122 123 typedef VisibilityInfo<Patch *> PatchInfo; 124 typedef VisibilityInfo<Mesh *> MeshInfo; 125 typedef VisibilityInfo<HierarchyNode *> NodeInfo; 126 127 128 template<class T> 129 struct InfoContainer 130 { 131 typedef std::vector<VisibilityInfo<T> > Type; 96 132 }; 97 133 98 //TODO: this define shall be replaced by template typedef 99 #define InfoContainer std::vector 100 //#define InfoContainer std::set 101 }; 134 typedef std::vector<PatchInfo> PatchInfoContainer; 135 typedef std::vector<MeshInfo> MeshInfoContainer; 136 typedef std::vector<NodeInfo> NodeInfoContainer; 102 137 138 } // namespace GtpVisibility 103 139 104 140 #endif -
trunk/VUT/GtpVisibility/scripts/GtpVisibility.vcproj
r144 r316 112 112 </File> 113 113 <File 114 RelativePath="..\src\DummyQueryManager.cpp">115 </File>116 <File117 114 RelativePath="..\src\FrustumCullingManager.cpp"> 118 115 </File> … … 133 130 </File> 134 131 <File 135 RelativePath="..\src\VisibilityInfo.cpp">136 </File>137 <File138 132 RelativePath="..\src\VisibilityManager.cpp"> 139 133 </File> … … 151 145 <File 152 146 RelativePath="..\include\DistanceQueue.h"> 147 </File> 148 <File 149 RelativePath="..\include\DummyPreprocessingManager.h"> 153 150 </File> 154 151 <File -
trunk/VUT/GtpVisibility/src/DummyPreprocessingManager.cpp
r74 r316 40 40 */ 41 41 int DummyPreprocessingManager::AddViewCellPVS(const int cellID, 42 InfoContainer<NodeInfo>*visibleNodes,43 InfoContainer<MeshInfo>*visibleMeshes )42 NodeInfoContainer *visibleNodes, 43 MeshInfoContainer *visibleMeshes ) 44 44 { 45 45 // return the root of the hierarchyInterface regardless of the cellId -
trunk/VUT/GtpVisibility/src/DummyQueryManager.cpp
r159 r316 9 9 void 10 10 DummyQueryManager::ComputeCameraVisibility(const Camera &camera, 11 InfoContainer<NodeInfo>*visibleNodes,12 InfoContainer<MeshInfo>*visibleGeometry,13 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches,11 NodeInfoContainer *visibleNodes, 12 MeshInfoContainer *visibleGeometry, 13 PatchInfoContainer *visiblePatches, 14 14 bool relativeVisibility) 15 15 { 16 visibleNodes-> push_back(NodeInfo(mHierarchyInterface->GetHierarchyRoot(), 0, 0));16 visibleNodes->Type.push_back(NodeInfo(mHierarchyInterface->GetHierarchyRoot(), 0, 0)); 17 17 18 18 // HierarchyInterface::MeshIterator *mi = … … 28 28 void 29 29 DummyQueryManager::ComputeFromPointVisibility(const Vector3 &point, 30 InfoContainer<NodeInfo>*visibleNodes,31 InfoContainer<MeshInfo>*visibleGeometry,32 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches,30 NodeInfoContainer *visibleNodes, 31 MeshInfoContainer *visibleGeometry, 32 PatchInfoContainer *visiblePatches, 33 33 bool relativeVisibility) 34 34 { 35 visibleNodes-> push_back(NodeInfo(mHierarchyInterface->GetHierarchyRoot(), 0, 0));35 visibleNodes->Type.push_back(NodeInfo(mHierarchyInterface->GetHierarchyRoot(), 0, 0)); 36 36 37 37 // HierarchyInterface::MeshIterator *mi = -
trunk/VUT/GtpVisibility/src/HierarchyInterface.cpp
r174 r316 10 10 mSavedNode(NULL), mCurrentTestIdx(0), mTestGeometryForVisibleLeaves(false) 11 11 { 12 mDistanceQueue = new DistanceQueue(G reaterDistance<HierarchyNode *>(this));12 mDistanceQueue = new DistanceQueue(GtDistance<HierarchyNode *>(this)); 13 13 } 14 14 //----------------------------------------------------------------------- -
trunk/VUT/GtpVisibility/src/PreprocessingManager.cpp
r71 r316 13 13 bool PreprocessingManager::GetPVS(const Vector3 ¢er, 14 14 const float radius, 15 InfoContainer<NodeInfo>*visibleNodes,16 InfoContainer<MeshInfo>*visibleMeshes)15 NodeInfoContainer *visibleNodes, 16 MeshInfoContainer *visibleMeshes) 17 17 { 18 18 vector<int> viewCellIds; -
trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.cpp
r315 r316 465 465 exporter->ExportViewCell(vc); 466 466 467 Debug << "pvs size: " << (int)vc->GetPvs().GetSize() << " of " << objects.size();467 Debug << "pvs size: " << (int)vc->GetPvs().GetSize() << " of " << (int)objects.size(); 468 468 Debug << " exporting rays: " << (int)vcRays[j].size() << endl; 469 469 -
trunk/VUT/GtpVisibilityPreprocessor/src/X3dExporter.cpp
r313 r316 689 689 else 690 690 { 691 Debug << "polygon not valid: " << *planePoly << " size: " << planePoly->mVertices.size() << endl;691 Debug << "polygon not valid: " << *planePoly << " size: " << (int)planePoly->mVertices.size() << endl; 692 692 DEL_PTR(planePoly); 693 693 } -
trunk/VUT/GtpVisibilityPreprocessor/src/default.env
r311 r316 9 9 # filename vienna.x3d 10 10 # filename ../data/vienna/vienna-simple.x3d 11 filename ../data/vienna/vienna-buildings.x3d11 # filename ../data/vienna/vienna-buildings.x3d 12 12 # filename ../data/vienna/viewcells-25-sel.x3d 13 #filename ../data/atlanta/atlanta2.x3d13 filename ../data/atlanta/atlanta2.x3d 14 14 # filename ../data/soda/soda.dat 15 15 # filename ../data/soda/soda5.dat … … 56 56 57 57 Sampling { 58 totalSamples 100000059 samplesPerPass 558 totalSamples 200000 59 samplesPerPass 10 60 60 } 61 61 62 62 ViewCells { 63 63 hierarchyType bspTree 64 height 7.0 65 maxViewCells 20 64 66 #hierarchyType kdTree 65 67 #hierarchyType sceneDependent 66 # filename ../data/atlanta/atlanta_viewcells_large.x3d 67 # filename ../data/atlanta/atlanta_viewcells_large2.x3d 68 filename ../data/vienna/viewcells-25-sel.x3d 68 filename ../data/atlanta/atlanta_viewcells_large.x3d 69 # filename ../data/vienna/viewcells-25-sel.x3d 69 70 # filename ../data/vienna/viewcells-25.x3d 70 71 # filename ../data/vienna/viewcells-large-sel.x3d … … 101 102 102 103 maxCandidates 50 103 maxViewCells 999999104 104 105 Termination { 105 106 maxPolysForAxisAligned 100 -
trunk/VUT/Ogre/include/OgreOcclusionQueriesQueryManager.h
r174 r316 19 19 20 20 void ComputeCameraVisibility(const Camera &camera, 21 InfoContainer<GtpVisibility::NodeInfo>*visibleNodes,22 InfoContainer<GtpVisibility::MeshInfo>*visibleGeometry,23 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches,21 GtpVisibility::NodeInfoContainer *visibleNodes, 22 GtpVisibility::MeshInfoContainer *visibleGeometry, 23 GtpVisibility::PatchInfoContainer *visiblePatches, 24 24 bool relativeVisibility = false); 25 25 … … 29 29 */ 30 30 void ComputeFromPointVisibility(const Vector3 &point, 31 InfoContainer<GtpVisibility::NodeInfo>*visibleNodes,32 InfoContainer<GtpVisibility::MeshInfo>*visibleGeometry,33 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches,31 GtpVisibility::NodeInfoContainer *visibleNodes, 32 GtpVisibility::MeshInfoContainer *visibleGeometry, 33 GtpVisibility::PatchInfoContainer *visiblePatches, 34 34 bool relativeVisibility = false); 35 35 … … 40 40 GtpVisibility::QueryList::iterator &projQueryIt, 41 41 GtpVisibility::GeometryList *geometryList, 42 InfoContainer<GtpVisibility::MeshInfo>*visibleGeometry,42 GtpVisibility::MeshInfoContainer *visibleGeometry, 43 43 bool relativeVisibility); 44 44 … … 46 46 GtpVisibility::QueryList::iterator &projQueryIt, 47 47 GtpVisibility::HierarchyNodeList *nodeList, 48 InfoContainer<GtpVisibility::NodeInfo>*visibleNodes,48 GtpVisibility::NodeInfoContainer *visibleNodes, 49 49 bool relativeVisibility); 50 50 51 51 void CollectRelativeGeometryVisibilityForItemBuffer(GtpVisibility::QueryList::iterator &projQueryIt, 52 52 GtpVisibility::GeometryList *geometryList, 53 InfoContainer<GtpVisibility::MeshInfo>*visibleGeometry);53 GtpVisibility::MeshInfoContainer *visibleGeometry); 54 54 55 55 void CollectRelativePatchVisibilityForItemBuffer( 56 56 GtpVisibility::QueryList::iterator &projQueryIt, 57 57 GtpVisibility::PatchList *patchList, 58 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches);58 GtpVisibility::PatchInfoContainer *visiblePatches); 59 59 60 60 void CollectPatchVisibility(GtpVisibility::QueryList::iterator &visQueryIt, 61 61 GtpVisibility::QueryList::iterator &projQueryIt, 62 62 GtpVisibility::PatchList *patchList, 63 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches,63 GtpVisibility::PatchInfoContainer *visiblePatches, 64 64 bool relativeVisibility); 65 65 66 void RemoveDuplicateNodes( InfoContainer<GtpVisibility::NodeInfo>*visibleNodes);67 void RemoveDuplicateGeometry( InfoContainer<GtpVisibility::MeshInfo>*visibleMesh);68 void RemoveDuplicatePatches( InfoContainer<GtpVisibility::PatchInfo>*visiblePatches);66 void RemoveDuplicateNodes(GtpVisibility::NodeInfoContainer *visibleNodes); 67 void RemoveDuplicateGeometry(GtpVisibility::MeshInfoContainer *visibleMesh); 68 void RemoveDuplicatePatches(GtpVisibility::PatchInfoContainer *visiblePatches); 69 69 70 70 /** Returns the patches of the geometry of a given node. -
trunk/VUT/Ogre/include/OgrePlatformQueryManager.h
r174 r316 25 25 */ 26 26 void ComputeFromPointVisibility(const Vector3 &point, 27 InfoContainer<GtpVisibility::NodeInfo>*visibleNodes,28 InfoContainer<GtpVisibility::MeshInfo>*visibleGeometry,29 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches,27 GtpVisibility::NodeInfoContainer *visibleNodes, 28 GtpVisibility::MeshInfoContainer *visibleGeometry, 29 GtpVisibility::PatchInfoContainer *visiblePatches, 30 30 bool relativeVisibility = false); 31 31 32 32 void ComputeCameraVisibility(const Camera &camera, 33 InfoContainer<GtpVisibility::NodeInfo>*visibleNodes,34 InfoContainer<GtpVisibility::MeshInfo>*visibleGeometry,35 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches,33 GtpVisibility::NodeInfoContainer *visibleNodes, 34 GtpVisibility::MeshInfoContainer *visibleGeometry, 35 GtpVisibility::PatchInfoContainer *visiblePatches, 36 36 bool relativeVisibility = false); 37 37 … … 45 45 46 46 void CollectItemBufferResults( 47 InfoContainer<GtpVisibility::MeshInfo>*visibleGeometry,48 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches);47 GtpVisibility::MeshInfoContainer *visibleGeometry, 48 GtpVisibility::PatchInfoContainer *visiblePatches); 49 49 50 void InitItemBuffer( InfoContainer<GtpVisibility::MeshInfo>*visibleGeometry,51 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches);50 void InitItemBuffer(GtpVisibility::MeshInfoContainer *visibleGeometry, 51 GtpVisibility::PatchInfoContainer *visiblePatches); 52 52 53 53 Viewport *mViewport; -
trunk/VUT/Ogre/scripts/Plugin_VisibilitySceneManager.vcproj
r171 r316 150 150 Filter=""> 151 151 <File 152 RelativePath="..\include\OgreBspHierarchyInterface.h">153 </File>154 <File155 152 RelativePath="..\include\OgreOctreeHierarchyInterface.h"> 156 153 </File> … … 191 188 Name="Header Files" 192 189 Filter="h;hpp;hxx;hm;inl;inc"> 190 <File 191 RelativePath="..\include\OgreBspHierarchyInterface.h"> 192 </File> 193 193 <File 194 194 RelativePath="..\include\OgreOcclusionQueriesQueryManager.h"> -
trunk/VUT/Ogre/src/OgreOcclusionQueriesQueryManager.cpp
r175 r316 8 8 namespace Ogre { 9 9 10 /** 11 These functions necessary to enable sorting of node / mesh / patch info. 12 */ 13 //----------------------------------------------------------------------- 14 inline bool nodeinfo_eq(const GtpVisibility::NodeInfo &info1, const GtpVisibility::NodeInfo &info2) 15 { 16 return info1.GetNode() == info2.GetNode(); 17 } 18 //----------------------------------------------------------------------- 19 inline bool meshinfo_eq(const GtpVisibility::MeshInfo &info1, const GtpVisibility::MeshInfo &info2) 20 { 21 return info1.GetMesh() == info2.GetMesh(); 22 } 23 //----------------------------------------------------------------------- 24 inline bool patchinfo_eq(const GtpVisibility::PatchInfo &info1, const GtpVisibility::PatchInfo &info2) 25 { 26 return info1.GetPatch() == info2.GetPatch(); 27 } 28 //----------------------------------------------------------------------- 29 inline bool nodeinfo_lower(const GtpVisibility::NodeInfo &info1, const GtpVisibility::NodeInfo &info2) 30 { 31 return info1.GetNode() < info2.GetNode(); 32 } 33 //----------------------------------------------------------------------- 34 inline bool meshinfo_lower(const GtpVisibility::MeshInfo &info1, const GtpVisibility::MeshInfo &info2) 35 { 36 return info1.GetMesh() < info2.GetMesh(); 37 } 38 //----------------------------------------------------------------------- 39 inline bool patchinfo_lower(const GtpVisibility::PatchInfo &info1, const GtpVisibility::PatchInfo &info2) 40 { 41 return info1.GetPatch() < info2.GetPatch(); 42 } 43 10 //----------------------------------------------------------------------- 11 bool nodeinfo_eq(const GtpVisibility::NodeInfo &a, const GtpVisibility::NodeInfo &b) 12 { 13 return a.GetSource() == b.GetSource(); 14 } 15 bool nodeinfo_lt(const GtpVisibility::NodeInfo &a, const GtpVisibility::NodeInfo &b) 16 { 17 return a.GetSource() < b.GetSource(); 18 } 19 bool meshinfo_eq(const GtpVisibility::MeshInfo &a, const GtpVisibility::MeshInfo &b) 20 { 21 return a.GetSource() == b.GetSource(); 22 } 23 bool meshinfo_lt(const GtpVisibility::MeshInfo &a, const GtpVisibility::MeshInfo &b) 24 { 25 return a.GetSource() < b.GetSource(); 26 } 27 bool patchinfo_eq(const GtpVisibility::PatchInfo &a, const GtpVisibility::PatchInfo &b) 28 { 29 return a.GetSource() == b.GetSource(); 30 } 31 bool patchinfo_lt(const GtpVisibility::PatchInfo &a, const GtpVisibility::PatchInfo &b) 32 { 33 return a.GetSource() < b.GetSource(); 34 } 44 35 45 36 //----------------------------------------------------------------------- … … 55 46 //----------------------------------------------------------------------- 56 47 void OcclusionQueriesQueryManager::ComputeCameraVisibility(const Camera &camera, 57 InfoContainer<GtpVisibility::NodeInfo>*visibleNodes,58 InfoContainer<GtpVisibility::MeshInfo>*visibleGeometry,59 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches,48 GtpVisibility::NodeInfoContainer *visibleNodes, 49 GtpVisibility::MeshInfoContainer *visibleGeometry, 50 GtpVisibility::PatchInfoContainer *visiblePatches, 60 51 bool relativeVisibility) 61 52 { … … 238 229 //----------------------------------------------------------------------- 239 230 void OcclusionQueriesQueryManager::ComputeFromPointVisibility(const Vector3 &point, 240 InfoContainer<GtpVisibility::NodeInfo>*visibleNodes,241 InfoContainer<GtpVisibility::MeshInfo>*visibleGeometry,242 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches,231 GtpVisibility::NodeInfoContainer *visibleNodes, 232 GtpVisibility::MeshInfoContainer *visibleGeometry, 233 GtpVisibility::PatchInfoContainer *visiblePatches, 243 234 bool relativeVisibility) 244 235 { … … 265 256 GtpVisibility::QueryList::iterator &projQueryIt, 266 257 GtpVisibility::HierarchyNodeList *nodeList, 267 InfoContainer<GtpVisibility::NodeInfo>*visibleNodes,258 GtpVisibility::NodeInfoContainer *visibleNodes, 268 259 bool relativeVisibility) 269 260 { … … 299 290 GtpVisibility::QueryList::iterator &projQueryIt, 300 291 GtpVisibility::GeometryList *geometryList, 301 InfoContainer<GtpVisibility::MeshInfo>*visibleGeometry)292 GtpVisibility::MeshInfoContainer *visibleGeometry) 302 293 { 303 294 GtpVisibility::GeometryList::iterator geometryIt; … … 323 314 GtpVisibility::QueryList::iterator &projQueryIt, 324 315 GtpVisibility::PatchList *patchList, 325 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches)316 GtpVisibility::PatchInfoContainer *visiblePatches) 326 317 { 327 318 GtpVisibility::PatchList::iterator patchIt; … … 348 339 GtpVisibility::QueryList::iterator &projQueryIt, 349 340 GtpVisibility::GeometryList *geometryList, 350 InfoContainer<GtpVisibility::MeshInfo>*visibleGeometry,341 GtpVisibility::MeshInfoContainer *visibleGeometry, 351 342 bool relativeVisibility) 352 343 { … … 383 374 GtpVisibility::QueryList::iterator &projQueryIt, 384 375 GtpVisibility::PatchList *patchList, 385 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches,376 GtpVisibility::PatchInfoContainer *visiblePatches, 386 377 bool relativeVisibility) 387 378 { … … 415 406 //----------------------------------------------------------------------- 416 407 void OcclusionQueriesQueryManager::RemoveDuplicateNodes( 417 InfoContainer<GtpVisibility::NodeInfo> *visibleNodes) 418 { 419 sort(visibleNodes->begin(), visibleNodes->end(), nodeinfo_lower); 420 InfoContainer<GtpVisibility::NodeInfo>::iterator visibleNodesIt, 408 GtpVisibility::NodeInfoContainer *visibleNodes) 409 { 410 sort(visibleNodes->begin(), visibleNodes->end(), nodeinfo_lt); 411 412 GtpVisibility::NodeInfoContainer::iterator visibleNodesIt, 421 413 visibleNodesIt_end = visibleNodes->end(); 422 414 … … 426 418 ++visibleNodesIt) 427 419 { 428 if (!nodeInfo || (nodeInfo->Get Node() != (*visibleNodesIt).GetNode()))420 if (!nodeInfo || (nodeInfo->GetSource() != (*visibleNodesIt).GetSource())) 429 421 { 430 422 nodeInfo = &(*visibleNodesIt); … … 437 429 438 430 // physically delete duplicates 439 visibleNodes->erase( std::unique(visibleNodes->begin(),440 visibleNodes->end(), nodeinfo_eq),visibleNodes->end());431 visibleNodes->erase(std::unique(visibleNodes->begin(), visibleNodes->end(), nodeinfo_eq), 432 visibleNodes->end()); 441 433 } 442 434 //----------------------------------------------------------------------- 443 435 void OcclusionQueriesQueryManager::RemoveDuplicateGeometry( 444 InfoContainer<GtpVisibility::MeshInfo>*visibleGeometry)445 { 446 sort(visibleGeometry->begin(), visibleGeometry->end(), meshinfo_l ower);447 448 InfoContainer<GtpVisibility::MeshInfo>::iterator visibleGeomIt,436 GtpVisibility::MeshInfoContainer *visibleGeometry) 437 { 438 sort(visibleGeometry->begin(), visibleGeometry->end(), meshinfo_lt); 439 440 GtpVisibility::MeshInfoContainer::iterator visibleGeomIt, 449 441 visibleGeomIt_end = visibleGeometry->end(); 450 442 … … 454 446 ++visibleGeomIt) 455 447 { 456 if (!geomInfo || (geomInfo->Get Mesh() != (*visibleGeomIt).GetMesh()))448 if (!geomInfo || (geomInfo->GetSource() != (*visibleGeomIt).GetSource())) 457 449 { 458 450 geomInfo = &(*visibleGeomIt); … … 465 457 466 458 // physically delete duplicates 467 visibleGeometry->erase(std::unique(visibleGeometry->begin(), visibleGeometry->end(), 468 meshinfo_eq),visibleGeometry->end());459 visibleGeometry->erase(std::unique(visibleGeometry->begin(), visibleGeometry->end(), meshinfo_eq), 460 visibleGeometry->end()); 469 461 } 470 462 //----------------------------------------------------------------------- 471 463 void OcclusionQueriesQueryManager::RemoveDuplicatePatches( 472 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches)473 { 474 sort(visiblePatches->begin(), visiblePatches->end(), patchinfo_l ower);475 476 InfoContainer<GtpVisibility::PatchInfo>::iterator visiblePatchIt,464 GtpVisibility::PatchInfoContainer *visiblePatches) 465 { 466 sort(visiblePatches->begin(), visiblePatches->end(), patchinfo_lt); 467 468 GtpVisibility::PatchInfoContainer::iterator visiblePatchIt, 477 469 visiblePatchIt_end = visiblePatches->end(); 478 470 … … 482 474 ++visiblePatchIt) 483 475 { 484 if (!patchInfo || (patchInfo->Get Patch() != (*visiblePatchIt).GetPatch()))476 if (!patchInfo || (patchInfo->GetSource() != (*visiblePatchIt).GetSource())) 485 477 { 486 478 patchInfo = &(*visiblePatchIt); … … 493 485 494 486 // physically delete duplicates 495 visiblePatches->erase(std::unique(visiblePatches->begin(), visiblePatches->end(), 496 patchinfo_eq),visiblePatches->end());487 visiblePatches->erase(std::unique(visiblePatches->begin(), visiblePatches->end(), patchinfo_eq), 488 visiblePatches->end()); 497 489 } 498 490 //----------------------------------------------------------------------- -
trunk/VUT/Ogre/src/OgrePlatformHierarchyInterface.cpp
r187 r316 87 87 88 88 mRenderSystem->_setWorldMatrix(Ogre::Matrix4::IDENTITY); 89 mSceneManager->useRenderableViewProjMode (solidBox);89 mSceneManager->useRenderableViewProjModeWrapper(solidBox); 90 90 91 91 // set no depth write, no color, no lighting material 92 mSceneManager->setPass (solidBox->getTechnique()->getPass(0));92 mSceneManager->setPassWrapper(solidBox->getTechnique()->getPass(0)); // HACK! (mySetPass should be setPass) 93 93 //SetOcclusionPass(); 94 94 -
trunk/VUT/Ogre/src/OgrePlatformQueryManager.cpp
r174 r316 26 26 //----------------------------------------------------------------------- 27 27 void PlatformQueryManager::ComputeFromPointVisibility(const Vector3 &point, 28 InfoContainer<GtpVisibility::NodeInfo>*visibleNodes,29 InfoContainer<GtpVisibility::MeshInfo>*visibleGeometry,30 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches,28 GtpVisibility::NodeInfoContainer *visibleNodes, 29 GtpVisibility::MeshInfoContainer *visibleGeometry, 30 GtpVisibility::PatchInfoContainer *visiblePatches, 31 31 bool relativeVisibility) 32 32 { … … 86 86 //----------------------------------------------------------------------- 87 87 void PlatformQueryManager::ComputeCameraVisibility(const Camera &camera, 88 InfoContainer<GtpVisibility::NodeInfo>*visibleNodes,89 InfoContainer<GtpVisibility::MeshInfo>*visibleGeometry,90 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches,88 GtpVisibility::NodeInfoContainer *visibleNodes, 89 GtpVisibility::MeshInfoContainer *visibleGeometry, 90 GtpVisibility::PatchInfoContainer *visiblePatches, 91 91 bool relativeVisibility) 92 92 { … … 137 137 //----------------------------------------------------------------------- 138 138 void PlatformQueryManager::CollectItemBufferResults( 139 InfoContainer<GtpVisibility::MeshInfo>*visibleGeometry,140 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches)139 GtpVisibility::MeshInfoContainer *visibleGeometry, 140 GtpVisibility::PatchInfoContainer *visiblePatches) 141 141 { 142 142 int dimx = 0; … … 180 180 //----------------------------------------------------------------------- 181 181 void PlatformQueryManager::InitItemBuffer( 182 InfoContainer<GtpVisibility::MeshInfo>*visibleGeometry,183 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches)182 GtpVisibility::MeshInfoContainer *visibleGeometry, 183 GtpVisibility::PatchInfoContainer *visiblePatches) 184 184 { 185 185 if (mWasInitialised) -
trunk/VUT/work/README_ONLINE.txt
r227 r316 24 24 RenderSystem_Direct7 25 25 OgreMain 26 example projects 26 GuiRenderer 27 28 Also add the flag to the example projects you want to use 27 29 28 30 5) Add following resources to OGRE_PATH\Samples\Common\bin\Release\resource.cfg: -
trunk/VUT/work/TestCullingTerrain/TerrainFrameListener.cpp
r259 r316 450 450 sm->GetVisibilityManager()->SetQueryManager(mQueryManager); 451 451 452 InfoContainer<GtpVisibility::NodeInfo>visibleNodes;453 InfoContainer<GtpVisibility::MeshInfo>visibleGeometry;454 InfoContainer<GtpVisibility::PatchInfo>visiblePatches;452 GtpVisibility::NodeInfoContainer visibleNodes; 453 GtpVisibility::MeshInfoContainer visibleGeometry; 454 GtpVisibility::PatchInfoContainer visiblePatches; 455 455 456 456 … … 478 478 int geomSize = 0, nodesSize = 0, patchSize = 0; 479 479 480 InfoContainer<GtpVisibility::MeshInfo>::iterator geomIt, geomIt_end = visibleGeometry.end();480 GtpVisibility::MeshInfoContainer::iterator geomIt, geomIt_end = visibleGeometry.end(); 481 481 482 482 for (geomIt = visibleGeometry.begin(); geomIt != geomIt_end; ++geomIt) … … 492 492 493 493 std::stringstream d; 494 d << "Geometry " << geomSize << " id: " << (*geomIt).Get Mesh()->getSubEntity(0)->getId()494 d << "Geometry " << geomSize << " id: " << (*geomIt).GetSource()->getSubEntity(0)->getId() 495 495 << " visibility: " << (*geomIt).GetVisiblePixels() << ", " << (*geomIt).GetProjectedPixels(); 496 496 LogManager::getSingleton().logMessage(d.str()); … … 498 498 } 499 499 500 InfoContainer<GtpVisibility::NodeInfo>::iterator nodesIt, nodesIt_end = visibleNodes.end();500 GtpVisibility::NodeInfoContainer::iterator nodesIt, nodesIt_end = visibleNodes.end(); 501 501 502 502 for (nodesIt = visibleNodes.begin(); nodesIt != nodesIt_end; ++nodesIt) … … 516 516 } 517 517 518 InfoContainer<GtpVisibility::PatchInfo>::iterator patchIt, patchIt_end = visiblePatches.end();518 GtpVisibility::PatchInfoContainer::iterator patchIt, patchIt_end = visiblePatches.end(); 519 519 520 520 for (patchIt = visiblePatches.begin(); patchIt != patchIt_end; ++ patchIt) -
trunk/VUT/work/iv/IVFrameListener.cpp
r259 r316 436 436 << "worst frame time: " << mWindow->getWorstFrameTime() << "\n" 437 437 << "avg. #triangles: " << avgTris << " M\n" 438 << "#frames: " << mFrameCount < "\n";438 << "#frames: " << mFrameCount << "\n"; 439 439 440 440 LogManager::getSingleton().logMessage(d.str()); -
trunk/VUT/work/ogre_changes/OgreMain/include/OgreRenderSystem.h
r193 r316 947 947 virtual Real getMaximumDepthInputValue(void) = 0; 948 948 949 #ifdef GTP_VISIBILITY_MODIFIED_OGRE950 /** sets colour.951 */952 void setColour(int r, int g, int b, int a);953 #endif // GTP_VISIBILITY_MODIFIED_OGRE954 955 949 protected: 956 950 … … 990 984 991 985 bool mInvertVertexWinding; 992 993 #ifdef GTP_VISIBILITY_MODIFIED_OGRE994 int mColour[4];995 #endif // GTP_VISIBILITY_MODIFIED_OGRE996 986 }; 997 987 } -
trunk/VUT/work/ogre_changes/OgreMain/include/OgreSceneManager.h
r183 r316 136 136 */ 137 137 void _deleteRenderedQueueGroups(int leavePassesInQueue = 0); 138 /** Internal method used by _renderVisibleObjects to deal with renderables 138 /** Wrapper for useRenderableViewProjMde with is an 139 Internal method used by _renderVisibleObjects to deal with renderables 139 140 which override the camera's own view / projection materices. 140 @remark made public by matt 141 */ 142 void useRenderableViewProjMode(Renderable* pRend); 143 /** Method for setting up the renderstate for a rendering pass. 141 */ 142 void useRenderableViewProjModeWrapper(Renderable* pRend); // HACK 143 /** HACK: A public wrapper method for setting up the renderstate for a rendering pass. 144 144 @param 145 145 pass The Pass details to set. … … 149 149 @remark made public by matt 150 150 */ 151 virtual Pass* setPass (Pass* pass);151 virtual Pass* setPassWrapper(Pass* pass); 152 152 153 153 /** Renders an Ogre Entity. … … 273 273 /** Retrieves the internal render queue. */ 274 274 virtual RenderQueue* getRenderQueue(void); 275 #ifndef GTP_VISIBILITY_MODIFIED_OGRE // made public, is found in the modfified section 275 276 276 /** Internal method for setting up the renderstate for a rendering pass. 277 277 @param … … 282 282 */ 283 283 virtual Pass* setPass(Pass* pass); 284 #endif 284 285 285 /// A pass designed to let us render shadow colour on white for texture shadows 286 286 Pass* mShadowCasterPlainBlackPass; … … 357 357 AnimationList mAnimationsList; 358 358 AnimationStateSet mAnimationStates; 359 #ifndef GTP_VISIBILITY_MODIFIED_OGRE // made public, is found in the modfified section 359 360 360 /** Internal method used by _renderVisibleObjects to deal with renderables 361 361 which override the camera's own view / projection materices. */ 362 362 void useRenderableViewProjMode(Renderable* pRend); 363 #endif 363 364 364 /// Controller flag for determining if we need to set view/proj matrices 365 365 bool mCamChanged; -
trunk/VUT/work/ogre_changes/OgreMain/src/OgreRenderSystem.cpp
r150 r316 63 63 // instanciate RenderSystemCapabilities 64 64 mCapabilities = new RenderSystemCapabilities(); 65 66 #ifdef GTP_VISIBILITY_MODIFIED_OGRE67 mColour[0] = mColour[1] = mColour[2] = mColour[3] = 255;68 #endif // GTP_VISIBILITY_MODIFIED_OGRE69 65 } 70 66 … … 420 416 } 421 417 } 422 #ifdef GTP_VISIBILITY_MODIFIED_OGRE423 // ------------------------------------------------------------------424 void RenderSystem::setColour(int r, int g, int b, int a)425 {426 mColour[0] = r;427 mColour[1] = g;428 mColour[2] = b;429 mColour[3] = a;430 }431 #endif // GTP_VISIBILITY_MODIFIED_OGRE432 418 } 433 419 -
trunk/VUT/work/ogre_changes/OgreMain/src/OgreSceneManager.cpp
r193 r316 4200 4200 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 4201 4201 //----------------------------------------------------------------------- 4202 Pass* SceneManager::setPassWrapper(Pass* pass) 4203 { 4204 return setPass(pass); 4205 } 4206 //----------------------------------------------------------------------- 4202 4207 void SceneManager::_renderSceneNode(Camera *cam, SceneNode *node, const int leavePassesInQueue) 4203 4208 { … … 4259 4264 renderSingleObject(rend, pass, false); 4260 4265 } 4266 //----------------------------------------------------------------------- 4267 void SceneManager::useRenderableViewProjModeWrapper(Renderable* pRend) 4268 { 4269 useRenderableViewProjMode(pRend); 4270 } 4261 4271 #endif //GTP_VISIBILITY_MODIFIED_OGRE 4262 4272 } -
trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/include/OgreOctree.h
r193 r316 208 208 int mDepth; 209 209 210 211 210 #endif // GTP_VISIBILITY_MODIFIED_OGRE 212 211 }; -
trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/include/OgreOctreeSceneManager.h
r193 r316 261 261 262 262 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 263 /* the number of nodes in the octree. do not confuse this with the OctreeNode264 class with is derived from SceneNode.263 /** The number of nodes in the octree. 264 @remark counts the octree hierarchy nodes in the tree. 265 265 */ 266 int mNumOct reeNodes;266 int mNumOctants; 267 267 #endif // GTP_VISIBILITY_MODIFIED_OGRE 268 268 -
trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/include/OgreTerrainRenderable.h
r193 r316 49 49 50 50 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 51 #define MAX_RENDERLEVEL_INDEX 15 51 #define MAX_RENDERLEVEL_INDEX 15 // maximal different number of render levels, e.g., used for chc 52 52 #endif // GTP_VISIBILITY_MODIFIED_OGRE 53 53 -
trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/src/OgreOctree.cpp
r193 r316 108 108 else 109 109 mDepth = 0; 110 110 // update bounds because we want tight octree 111 111 _updateBounds(); 112 112 113 #endif //GTP_VISIBILITY_MODIFIED_OGRE 113 114 mNumNodes = 0; … … 133 134 134 135 mParent = 0; 136 135 137 } 136 138 -
trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/src/OgreOctreeSceneManager.cpp
r158 r316 318 318 319 319 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 320 mNumOct reeNodes = 1; // count number of octants320 mNumOctants = 1; // initialise number of octants in tree 321 321 #endif // GTP_VISIBILITY_MODIFIED_OGRE 322 322 … … 470 470 octant -> mChildren[ x ][ y ][ z ] = new Octree( octant ); 471 471 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 472 ++ mNumOctreeNodes;472 ++ mNumOctants; 473 473 #endif // GTP_VISIBILITY_MODIFIED_OGRE 474 474 -
trunk/VUT/work/ogre_changes/RenderSystems/GL/src/OgreGLRenderSystem.cpp
r193 r316 2328 2328 glDisableVertexAttribArrayARB_ptr(1); // disable weights 2329 2329 } 2330 #ifndef GTP_VISIBILITY_MODIFIED_OGRE2331 glColor4f(1,1,1,1);2332 #else2333 glColor4ub(mColour[0], mColour[1], mColour[2], mColour[3]);2334 #endif // GTP_VISIBILITY_MODIFIED_OGRE2335 2330 2336 2331 glSecondaryColor3fEXT_ptr(0.0f, 0.0f, 0.0f);
Note: See TracChangeset
for help on using the changeset viewer.