- Timestamp:
- 11/02/05 17:57:29 (19 years ago)
- Location:
- trunk/VUT
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibility/include/HierarchyInterface.h
r345 r370 10 10 enum CullingType {QUERY_CULLED, FRUSTUM_CULLED}; 11 11 12 typedef std::vector<HierarchyNode *> HierarchyNodeList;13 typedef std::vector<GtpVisibility::Mesh *> Geometry List;14 typedef std::vector<GtpVisibility::Patch *> Patch List;12 typedef std::vector<HierarchyNode *> NodeVector; 13 typedef std::vector<GtpVisibility::Mesh *> GeometryVector; 14 typedef std::vector<GtpVisibility::Patch *> PatchVector; 15 15 typedef std::pair<HierarchyNode *, OcclusionQuery *> QueryPair; 16 typedef std::pair<HierarchyNode *, bool> PendingQuery; 16 17 typedef std::queue<QueryPair> QueryQueue; 18 typedef std::queue<PendingQuery> PendingQueue; 17 19 18 20 … … 136 138 */ 137 139 virtual void GetNodeGeometryList(GtpVisibility::HierarchyNode *node, 138 Geometry List*geometryList,140 GeometryVector *geometryList, 139 141 bool includeChildren) = 0; 140 142 -
trunk/VUT/GtpVisibility/scripts/GtpVisibility.vcproj
r316 r370 103 103 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> 104 104 <File 105 RelativePath="..\src\BatchedQueriesCullingManager.cpp"> 106 </File> 107 <File 105 108 RelativePath="..\src\CoherentHierarchicalCullingManager.cpp"> 106 109 </File> … … 137 140 Filter="h;hpp;hxx;hm;inl;inc;xsd" 138 141 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> 142 <File 143 RelativePath="..\include\BatchedQueriesCullingManager.h"> 144 </File> 139 145 <File 140 146 RelativePath="..\include\CoherentHierarchicalCullingManager.h"> -
trunk/VUT/GtpVisibility/src/VisibilityManager.cpp
r254 r370 5 5 #include "DummyPreprocessingManager.h" 6 6 #include "DummyQueryManager.h" 7 #include "BatchedQueriesCullingManager.h" 7 8 8 9 namespace GtpVisibility { … … 45 46 case VisibilityEnvironment::STOP_AND_WAIT_CULLING: 46 47 mCullingManager = new StopAndWaitCullingManager(); 48 //new BatchedQueriesCullingManager(); 47 49 break; 48 50 -
trunk/VUT/GtpVisibilityPreprocessor/scripts/Preprocessor.vcproj
r361 r370 347 347 </File> 348 348 </Filter> 349 <File 350 RelativePath=".\VTune\Preprocessor.vpj"> 351 </File> 349 352 </Files> 350 353 <Globals> -
trunk/VUT/GtpVisibilityPreprocessor/scripts/default.env
r367 r370 56 56 57 57 Sampling { 58 totalSamples 30000058 totalSamples 1000000 59 59 samplesPerPass 3 60 60 } … … 82 82 # input fromViewCells 83 83 # input fromSceneGeometry 84 samples 1000084 samples 200000 85 85 sideTolerance 0.005 86 86 } … … 120 120 #splitPlaneStrategy 130 121 121 122 splitPlaneStrategy 1 024122 splitPlaneStrategy 130 123 123 124 124 maxCandidates 80 … … 128 128 maxRays 200 129 129 maxPolygons 5 130 maxDepth 100130 maxDepth 50 131 131 132 132 # axis aligned splits 133 133 AxisAligned { 134 134 maxPolys 5000 135 maxRays 5000136 maxObjects 20 00135 maxRays 600 136 maxObjects 20 137 137 maxCostRatio 0.9 138 138 ct_div_ci 0.5 … … 145 145 146 146 PostProcessing { 147 samples 100000147 samples 200000 148 148 } 149 149 -
trunk/VUT/GtpVisibilityPreprocessor/src/Camera.cpp
r362 r370 132 132 ray.kdLeaves.clear(); 133 133 ray.meshes.clear(); 134 ray.bsp Leaves.clear();134 ray.bspIntersections.clear(); 135 135 136 136 ray.Init(mPosition, target, Ray::LOCAL_RAY); -
trunk/VUT/GtpVisibilityPreprocessor/src/Ray.h
r369 r370 56 56 }; 57 57 58 struct BspIntersection { 59 // the point of intersection 60 float mT; 61 62 BspLeaf *mLeaf; 63 64 BspIntersection(const float t, BspLeaf *l): 65 mT(t), mLeaf(l) {} 66 67 BspIntersection() {} 68 69 bool operator<(const BspIntersection &b) const { 70 return mT <b.mT; } 71 }; 58 72 59 73 // I should have some abstract cell data type !!! here … … 63 77 64 78 vector<Intersection> intersections; 65 vector<Bsp Leaf *> bspLeaves;79 vector<BspIntersection> bspIntersections; 66 80 vector<KdLeaf *> kdLeaves; 67 81 vector<MeshInstance *> meshes; -
trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.cpp
r369 r370 34 34 ray.kdLeaves.clear(); 35 35 ray.meshes.clear(); 36 ray.bsp Leaves.clear();36 ray.bspIntersections.clear(); 37 37 38 38 // cout<<point<<" "<<direction<<endl; … … 124 124 125 125 // object can be seen from the view cell => add to view cell pvs 126 for (j=0; j < ray.bspLeaves.size(); ++ j) 127 { // if ray not in unbounded space 128 if (ray.bspLeaves[j]->GetViewCell() != &mUnbounded) 126 for (j=0; j < ray.bspIntersections.size(); ++ j) 127 { 128 BspLeaf *leaf = ray.bspIntersections[j].mLeaf; 129 // if ray not in unbounded space 130 if (leaf->GetViewCell() != &mUnbounded) 129 131 contributingSamples += 130 ray.bspLeaves[j]->GetViewCell()->GetPvs().AddSample(obj);132 leaf->GetViewCell()->GetPvs().AddSample(obj); 131 133 } 132 134 133 135 // rays passing through this viewcell 134 136 if (mPass > 1) 135 for (j=1; j < ((int)ray.bsp Leaves.size() - 1); ++ j)136 { 137 BspLeaf *leaf = ray.bsp Leaves[j];137 for (j=1; j < ((int)ray.bspIntersections.size() - 1); ++ j) 138 { 139 BspLeaf *leaf = ray.bspIntersections[j].mLeaf; 138 140 139 141 if (leaf->GetViewCell() != &mUnbounded) … … 679 681 int merged = 0; 680 682 RayContainer::const_iterator rit, rit_end = rays.end(); 681 vector< BspLeaf *>::const_iterator lit;683 vector<Ray::BspIntersection>::const_iterator iit; 682 684 683 685 for (rit = rays.begin(); rit != rays.end(); ++ rit) … … 685 687 // traverse leaves stored in the rays and compare and merge consecutive 686 688 // leaves (i.e., the neighbors in the tree) 687 if ((*rit)->bsp Leaves.empty())689 if ((*rit)->bspIntersections.empty()) 688 690 continue; 689 691 690 lit = (*rit)->bspLeaves.begin();691 692 BspLeaf *previousLeaf = *lit;693 ++ lit;694 695 for (; lit != (*rit)->bspLeaves.end(); ++ lit)696 { 697 BspLeaf *leaf = *lit;692 iit = (*rit)->bspIntersections.begin(); 693 694 BspLeaf *previousLeaf = (*iit).mLeaf; 695 ++ iit; 696 697 for (; iit != (*rit)->bspIntersections.end(); ++ iit) 698 { 699 BspLeaf *leaf = (*iit).mLeaf; 698 700 699 701 if (mBspTree->ShouldMerge(leaf, previousLeaf)) … … 784 786 Ray *ray = mSampleRays[k]; 785 787 786 for (int j = 0; j < (int)ray->bspLeaves.size(); ++ j) 787 { 788 for (int j = 0; j < (int)ray->bspIntersections.size(); ++ j) 789 { 790 BspLeaf *leaf = ray->bspIntersections[j].mLeaf; 791 788 792 for (int i = 0; i < (int)bspLeaves.size(); ++ i) 789 793 { 790 if (bspLeaves[i]->GetViewCell() == ray->bspLeaves[j]->GetViewCell())794 if (bspLeaves[i]->GetViewCell() == leaf->GetViewCell()) 791 795 { 792 796 vcRays[i].push_back(*ray); -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.cpp
r367 r370 321 321 } 322 322 323 ray->bspLeaves.push_back(this); 323 // warning: not ordered 324 ray->bspIntersections.push_back(Ray::BspIntersection((*it)->mMinT, this)); 324 325 } 325 326 } … … 1621 1622 if (!leaf->mViewCell->Mailed()) 1622 1623 { 1623 ray.bsp Leaves.push_back(leaf);1624 ray.bspIntersections.push_back(Ray::BspIntersection(maxt, leaf)); 1624 1625 leaf->mViewCell->Mail(); 1625 1626 ++ hits; … … 2299 2300 2300 2301 BoundedRayContainer::const_iterator rit, rit_end = rays.end(); 2301 vector< BspLeaf *>::const_iterator lit;2302 vector<Ray::BspIntersection>::const_iterator iit; 2302 2303 2303 2304 ViewCell::NewMail(); … … 2307 2308 Ray *ray = (*rit)->mRay; 2308 2309 2309 for (lit = ray->bspLeaves.begin(); lit != ray->bspLeaves.end(); ++ lit) 2310 { 2311 if ((*lit)->mViewCell->Mailed()) 2310 for (iit = ray->bspIntersections.begin(); iit != ray->bspIntersections.end(); ++ iit) 2311 { 2312 BspViewCell *vc = (*iit).mLeaf->mViewCell; 2313 2314 if (vc->Mailed()) 2312 2315 { 2313 pvsSize += (*lit)->mViewCell->GetPvs().GetSize();2316 pvsSize += vc->GetPvs().GetSize(); 2314 2317 } 2315 2318 } -
trunk/VUT/GtpVisibilityPreprocessor/src/default.env
r369 r370 61 61 62 62 ViewCells { 63 hierarchy kdTree64 #hierarchy bspTree63 #hierarchy kdTree 64 hierarchy bspTree 65 65 # hierarchy sceneDependent 66 66 67 67 height 5.0 68 68 maxViewCells 0 69 70 minPvsDif 100 71 # maxPvsSize 200 69 72 70 73 # filename ../data/atlanta/atlanta_viewcells_large.x3d … … 74 77 } 75 78 76 77 78 79 79 BspTree { 80 80 Construction { … … 82 82 # input fromViewCells 83 83 # input fromSceneGeometry 84 samples 10000 084 samples 10000 85 85 sideTolerance 0.005 86 86 } … … 97 97 # least ray splits = 256 98 98 # balanced rays = 512 99 # pvs = 1024 99 100 100 101 # least splits + balanced polygons … … 119 120 #splitPlaneStrategy 130 120 121 121 splitPlaneStrategy 1 30122 splitPlaneStrategy 1024 122 123 123 124 maxCandidates 80 124 125 125 126 Termination { 126 # autopartition127 maxRays 80128 maxPolygons 0127 # autopartition 128 maxRays 200 129 maxPolygons 5 129 130 maxDepth 100 130 131 131 132 # axis aligned splits 132 133 AxisAligned { 133 maxPolys 500 134 maxRays 300135 maxObjects 20 134 maxPolys 5000 135 maxRays 5000 136 maxObjects 2000 136 137 maxCostRatio 0.9 137 138 ct_div_ci 0.5 … … 142 143 splitBorder 0.01 143 144 } 145 146 PostProcessing { 147 samples 100000 148 } 144 149 145 150 # if split polys are stored for visualization -
trunk/VUT/Ogre/include/OgreOcclusionQueriesQueryManager.h
r316 r370 39 39 void CollectGeometryVisibility(GtpVisibility::QueryList::iterator &visQueryIt, 40 40 GtpVisibility::QueryList::iterator &projQueryIt, 41 GtpVisibility::Geometry List*geometryList,41 GtpVisibility::GeometryVector *geometryList, 42 42 GtpVisibility::MeshInfoContainer *visibleGeometry, 43 43 bool relativeVisibility); … … 45 45 void CollectNodeVisibility(GtpVisibility::QueryList::iterator &visQueryIt, 46 46 GtpVisibility::QueryList::iterator &projQueryIt, 47 GtpVisibility:: HierarchyNodeList*nodeList,47 GtpVisibility::NodeVector *nodeList, 48 48 GtpVisibility::NodeInfoContainer *visibleNodes, 49 49 bool relativeVisibility); 50 50 51 51 void CollectRelativeGeometryVisibilityForItemBuffer(GtpVisibility::QueryList::iterator &projQueryIt, 52 GtpVisibility::Geometry List*geometryList,52 GtpVisibility::GeometryVector *geometryList, 53 53 GtpVisibility::MeshInfoContainer *visibleGeometry); 54 54 55 55 void CollectRelativePatchVisibilityForItemBuffer( 56 56 GtpVisibility::QueryList::iterator &projQueryIt, 57 GtpVisibility::Patch List*patchList,57 GtpVisibility::PatchVector *patchList, 58 58 GtpVisibility::PatchInfoContainer *visiblePatches); 59 59 60 60 void CollectPatchVisibility(GtpVisibility::QueryList::iterator &visQueryIt, 61 61 GtpVisibility::QueryList::iterator &projQueryIt, 62 GtpVisibility::Patch List*patchList,62 GtpVisibility::PatchVector *patchList, 63 63 GtpVisibility::PatchInfoContainer *visiblePatches, 64 64 bool relativeVisibility); … … 73 73 */ 74 74 virtual void GetNodePatchList(GtpVisibility::HierarchyNode *node, 75 GtpVisibility::Patch List*patchList);75 GtpVisibility::PatchVector *patchList); 76 76 77 77 int mItemBufferMode; -
trunk/VUT/Ogre/include/OgreOctreeHierarchyInterface.h
r345 r370 48 48 49 49 void GetNodeGeometryList(GtpVisibility::HierarchyNode *node, 50 GtpVisibility::Geometry List*geometryList,50 GtpVisibility::GeometryVector *geometryList, 51 51 bool includeChildren); 52 52 -
trunk/VUT/Ogre/include/OgreSceneNodeHierarchyInterface.h
r345 r370 43 43 44 44 void GetNodeGeometryList(GtpVisibility::HierarchyNode *node, 45 GtpVisibility::Geometry List*geometryList,45 GtpVisibility::GeometryVector *geometryList, 46 46 bool includeChildren); 47 47 -
trunk/VUT/Ogre/resources/materials/scripts/natFX_Tree1_LOD2.material
r183 r370 31 31 ambient 1 1 1 1 32 32 diffuse 1 1 1 1 33 specular 0.15 0.107 0.039 2033 34 34 emissive 0 0 0 35 35 … … 52 52 ambient 1 1 1 1 53 53 diffuse 1 1 1 1 54 specular 0.15 0.107 0.039 2054 55 55 emissive 0 0 0 56 56 -
trunk/VUT/Ogre/src/OgreOcclusionQueriesQueryManager.cpp
r318 r370 65 65 66 66 // rendered visibile hierarchy nodes from previous rendering 67 GtpVisibility:: HierarchyNodeList*visNodes = mHierarchyInterface->GetVisibleNodes();68 GtpVisibility:: HierarchyNodeList::iterator visNodesIt, visNodesIt_end = visNodes->end();69 70 GtpVisibility:: HierarchyNodeListnodeList;67 GtpVisibility::NodeVector *visNodes = mHierarchyInterface->GetVisibleNodes(); 68 GtpVisibility::NodeVector::iterator visNodesIt, visNodesIt_end = visNodes->end(); 69 70 GtpVisibility::NodeVector nodeList; 71 71 72 72 if (mQueryModes & NODE_VISIBILITY) … … 78 78 } 79 79 80 GtpVisibility:: HierarchyNodeList::iterator nodeIt, nodeIt_end = nodeList.end();80 GtpVisibility::NodeVector::iterator nodeIt, nodeIt_end = nodeList.end(); 81 81 82 82 // vector for storing entities of meshes 83 GtpVisibility::Geometry ListgeometryList;83 GtpVisibility::GeometryVector geometryList; 84 84 85 85 // store geometry of the hierarchy nodes in a geometry list … … 93 93 94 94 // geometry list iterator 95 GtpVisibility::Geometry List::iterator geometryIt, geometryIt_end = geometryList.end();95 GtpVisibility::GeometryVector::iterator geometryIt, geometryIt_end = geometryList.end(); 96 96 97 97 // vector for storing subentities of meshes 98 GtpVisibility::Patch ListpatchList;98 GtpVisibility::PatchVector patchList; 99 99 100 100 // store patchges of the geometries in a patch list … … 107 107 } 108 108 109 GtpVisibility::Patch List::iterator patchIt, patchIt_end = patchList.end();109 GtpVisibility::PatchVector::iterator patchIt, patchIt_end = patchList.end(); 110 110 111 111 // to obtain the correct number of projected pixels, depth write must be disabled … … 229 229 GtpVisibility::QueryList::iterator &visQueryIt, 230 230 GtpVisibility::QueryList::iterator &projQueryIt, 231 GtpVisibility:: HierarchyNodeList*nodeList,231 GtpVisibility::NodeVector *nodeList, 232 232 GtpVisibility::NodeInfoContainer *visibleNodes, 233 233 bool relativeVisibility) 234 234 { 235 GtpVisibility:: HierarchyNodeList::iterator nodeIt;235 GtpVisibility::NodeVector::iterator nodeIt; 236 236 237 237 //-- queries for nodes … … 263 263 void OcclusionQueriesQueryManager::CollectRelativeGeometryVisibilityForItemBuffer( 264 264 GtpVisibility::QueryList::iterator &projQueryIt, 265 GtpVisibility::Geometry List*geometryList,265 GtpVisibility::GeometryVector *geometryList, 266 266 GtpVisibility::MeshInfoContainer *visibleGeometry) 267 267 { 268 GtpVisibility::Geometry List::iterator geometryIt;268 GtpVisibility::GeometryVector::iterator geometryIt; 269 269 270 270 //-- queries for geometry … … 287 287 void OcclusionQueriesQueryManager::CollectRelativePatchVisibilityForItemBuffer( 288 288 GtpVisibility::QueryList::iterator &projQueryIt, 289 GtpVisibility::Patch List*patchList,289 GtpVisibility::PatchVector *patchList, 290 290 GtpVisibility::PatchInfoContainer *visiblePatches) 291 291 { 292 GtpVisibility::Patch List::iterator patchIt;292 GtpVisibility::PatchVector::iterator patchIt; 293 293 294 294 //-- queries for geometry … … 312 312 GtpVisibility::QueryList::iterator &visQueryIt, 313 313 GtpVisibility::QueryList::iterator &projQueryIt, 314 GtpVisibility::Geometry List*geometryList,314 GtpVisibility::GeometryVector *geometryList, 315 315 GtpVisibility::MeshInfoContainer *visibleGeometry, 316 316 bool relativeVisibility) 317 317 { 318 GtpVisibility::Geometry List::iterator geometryIt;318 GtpVisibility::GeometryVector::iterator geometryIt; 319 319 320 320 //-- queries for geometry … … 347 347 GtpVisibility::QueryList::iterator &visQueryIt, 348 348 GtpVisibility::QueryList::iterator &projQueryIt, 349 GtpVisibility::Patch List*patchList,349 GtpVisibility::PatchVector *patchList, 350 350 GtpVisibility::PatchInfoContainer *visiblePatches, 351 351 bool relativeVisibility) 352 352 { 353 GtpVisibility::Patch List::iterator patchIt;353 GtpVisibility::PatchVector::iterator patchIt; 354 354 355 355 //-- queries for patch … … 464 464 //----------------------------------------------------------------------- 465 465 void OcclusionQueriesQueryManager::GetNodePatchList(GtpVisibility::HierarchyNode *node, 466 GtpVisibility::Patch List*patchList)467 { 468 GtpVisibility::Geometry ListgeomList;466 GtpVisibility::PatchVector *patchList) 467 { 468 GtpVisibility::GeometryVector geomList; 469 469 mHierarchyInterface->GetNodeGeometryList(node, &geomList, false); 470 470 471 471 // geometry list iterator 472 GtpVisibility::Geometry List::iterator geomIt, geomIt_end = geomList.end();472 GtpVisibility::GeometryVector::iterator geomIt, geomIt_end = geomList.end(); 473 473 474 474 for (geomIt = geomList.begin(); geomIt != geomIt_end; ++geomIt) -
trunk/VUT/Ogre/src/OgreOctreeHierarchyInterface.cpp
r346 r370 157 157 //----------------------------------------------------------------------- 158 158 void OctreeHierarchyInterface::GetNodeGeometryList(GtpVisibility::HierarchyNode *node, 159 GtpVisibility::Geometry List*geometryList,159 GtpVisibility::GeometryVector *geometryList, 160 160 bool includeChildren) 161 161 { -
trunk/VUT/Ogre/src/OgreSceneNodeHierarchyInterface.cpp
r345 r370 137 137 //----------------------------------------------------------------------- 138 138 void SceneNodeHierarchyInterface::GetNodeGeometryList(GtpVisibility::HierarchyNode *node, 139 GtpVisibility::Geometry List*geometryList,139 GtpVisibility::GeometryVector *geometryList, 140 140 bool includeChildren) 141 141 { -
trunk/VUT/work/iv/Demo_IV.vcproj
r226 r370 175 175 Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> 176 176 </Filter> 177 <File 178 RelativePath=".\VTune\Demo_IV.vpj"> 179 </File> 177 180 </Files> 178 181 <Globals> -
trunk/VUT/work/iv/TestCullingIVApplication.cpp
r348 r370 92 92 mSceneMgr->setOption("NodeVizScale", &scale); 93 93 // HACK: change this to relative path 94 String path = "E:/svn/gametools/trunk/VUT/Ogre/resources/"; 95 94 //String path = "E:/svn/gametools/trunk/VUT/Ogre/resources/"; 95 String path = "D:/svn/trunk/VUT/Ogre/resources/"; 96 96 97 SceneNode *node1 = mSceneMgr->getRootSceneNode()->createChildSceneNode("Node1"); 97 98 SceneNode *node2 = mSceneMgr->getRootSceneNode()->createChildSceneNode("Node2");
Note: See TracChangeset
for help on using the changeset viewer.