- Timestamp:
- 01/05/06 10:56:50 (19 years ago)
- Location:
- trunk/VUT/GtpVisibilityPreprocessor
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/scripts/default.env
r498 r501 13 13 #;../data/vienna/vienna-plane.x3d 14 14 # filename ../data/vienna/viewcells-25-sel.x3d 15 filename ../data/atlanta/atlanta2.x3d15 # filename ../data/atlanta/atlanta2.x3d 16 16 # filename ../data/soda/soda.dat 17 #filename ../data/soda/soda5.dat17 filename ../data/soda/soda5.dat 18 18 } 19 19 … … 35 35 loadInitialSamples false 36 36 storeInitialSamples false 37 useViewSpaceBox true 37 38 } 38 39 … … 195 196 colorCode Random 196 197 exportRays false 197 exportGeometry false198 exportGeometry true 198 199 } 199 200 … … 222 223 Termination { 223 224 maxDepth 40 224 minPvs 50225 minRays 300226 minSize 0.00 1227 maxCostRatio 0.9 225 minPvs 1 226 minRays 100 227 minSize 0.0001 228 maxCostRatio 0.95 228 229 missTolerance 4 229 230 maxRayContribution 0.5 … … 231 232 232 233 maxTotalMemory 100 233 maxStaticMemory 50234 maxStaticMemory 80 234 235 235 236 splitType regular … … 285 286 minPolygons -1 286 287 maxDepth 30 287 minPvs 2 0288 minPvs 2 288 289 #minArea 0.0001 289 290 minArea 0.000 … … 293 294 #maxAccRayLength 100 294 295 295 maxViewCells 20000296 maxViewCells 8000 296 297 297 298 # used for pvs criterium … … 308 309 PostProcess { 309 310 maxCostRatio 0.1 310 minViewCells 500311 minViewCells 200 311 312 maxPvsSize 1000 312 313 useRaysForMerge false -
trunk/VUT/GtpVisibilityPreprocessor/src/Environment.cpp
r492 r501 1188 1188 1189 1189 1190 RegisterOption("VssPreprocessor.useViewSpaceBox", 1191 optBool, 1192 "-vss_use_viewspace_box=", 1193 "true"); 1194 1195 1190 1196 /************************************************************************************/ 1191 1197 /* View cells related options */ -
trunk/VUT/GtpVisibilityPreprocessor/src/MutualVisibility.h
r359 r501 87 87 bool mUseBoxes; 88 88 89 MutualVisibilitySampler(SceneGraph *sceneGraph, 90 KdTree *kdTree, 91 const AxisAlignedBox3 &source, 92 const AxisAlignedBox3 &target, 93 const float solidAngleThreshold); 89 MutualVisibilitySampler( 90 SceneGraph *sceneGraph, 91 KdTree *kdTree, 92 const AxisAlignedBox3 &source, 93 const AxisAlignedBox3 &target, 94 const float solidAngleThreshold 95 ); 94 96 int 95 97 ComputeVisibility(); 96 98 97 99 void 98 ConstructInitialSamples( 99 const AxisAlignedBox3 &source, 100 const AxisAlignedBox3 &target, 101 vector<RayShaft *> &samples 102 ); 100 ConstructInitialSamples(const AxisAlignedBox3 &source, 101 const AxisAlignedBox3 &target, 102 vector<RayShaft *> &samples 103 ); 103 104 104 105 void 105 106 ConstructInitialSamples2( 106 107 108 109 107 const AxisAlignedBox3 &source, 108 const AxisAlignedBox3 &target, 109 vector<RayShaft *> &samples 110 ); 110 111 111 112 void 112 113 ConstructInitialSamples3( 113 114 115 116 114 const AxisAlignedBox3 &source, 115 const AxisAlignedBox3 &target, 116 vector<RayShaft *> &samples 117 ); 117 118 118 119 void 119 120 AddInitialSamples( 120 121 122 123 121 const Rectangle3 &sourceRect, 122 const Rectangle3 &targetRect, 123 vector<RayShaft *> &samples 124 ); 124 125 125 126 void 126 127 AddInitialSamples2( 127 128 129 130 128 const Rectangle3 &sourceRect, 129 const Rectangle3 &targetRect, 130 vector<RayShaft *> &samples 131 ); 131 132 132 133 // the split sample method contains a methodology to create new samples … … 134 135 bool 135 136 SplitSample( 136 137 138 139 137 const RayShaft &source, 138 RayShaft &sample1, 139 RayShaft &sample2 140 ); 140 141 void 141 142 PerformSplit( 142 143 144 145 146 147 143 const RayShaft &sample, 144 const bool splitSource, 145 const int axis, 146 RayShaft &sample1, 147 RayShaft &sample2 148 ); 148 149 149 150 150 151 bool 151 152 SampleTerminationCriteriaMet( 152 153 const RayShaft &sample); 153 154 154 155 float 155 156 GetSpatialAngle(const RayShaft &sample, 156 157 157 const Vector3 &point 158 ); 158 159 159 160 int -
trunk/VUT/GtpVisibilityPreprocessor/src/RssPreprocessor.cpp
r496 r501 13 13 #include "GlRenderer.h" 14 14 15 static bool useViewSpaceBox = false;15 static bool useViewSpaceBox = true; 16 16 static bool use2dSampling = false; 17 17 static bool fromBoxVisibility = false; -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.cpp
r498 r501 95 95 return mSceneBox.IsInside(viewPoint); 96 96 } 97 97 98 98 99 void ViewCellsManager::ComputeSampleContributions(const VssRayContainer &rays) … … 1765 1766 cout << "collapsing invalid tree regions ... "; 1766 1767 long startTime = GetTime(); 1767 mVspBspTree->CollapseTree();1768 Debug << " treecollapsed in " << TimeDiff(startTime, GetTime()) * 1e-3 << " seconds" << endl;1768 int collapsedLeaves = mVspBspTree->CollapseTree(); 1769 Debug << "collapsed in " << TimeDiff(startTime, GetTime()) * 1e-3 << " seconds" << endl; 1769 1770 cout << "finished" << endl; 1770 1771 -
trunk/VUT/GtpVisibilityPreprocessor/src/VspBspTree.cpp
r500 r501 2111 2111 } 2112 2112 2113 BspNode *VspBspTree::CollapseTree(BspNode *node )2113 BspNode *VspBspTree::CollapseTree(BspNode *node, int &collapsed) 2114 2114 { 2115 2115 if (node->IsLeaf()) … … 2118 2118 BspInterior *interior = dynamic_cast<BspInterior *>(node); 2119 2119 2120 BspNode *front = CollapseTree(interior->GetFront() );2121 BspNode *back = CollapseTree(interior->GetBack() );2120 BspNode *front = CollapseTree(interior->GetFront(), collapsed); 2121 BspNode *back = CollapseTree(interior->GetBack(), collapsed); 2122 2122 2123 2123 if (front->IsLeaf() && back->IsLeaf()) … … 2137 2137 if (leaf->GetParent()) 2138 2138 leaf->GetParent()->ReplaceChildLink(node, leaf); 2139 2139 2140 ++ collapsed; 2140 2141 delete interior; 2141 2142 … … 2148 2149 2149 2150 2150 void VspBspTree::CollapseTree() 2151 { 2152 CollapseTree(mRoot); 2151 int VspBspTree::CollapseTree() 2152 { 2153 int collapsed = 0; 2154 (void)CollapseTree(mRoot, collapsed); 2153 2155 // revalidate leaves 2154 2156 RepairVcLeafLists(); 2157 2158 return collapsed; 2155 2159 } 2156 2160 -
trunk/VUT/GtpVisibilityPreprocessor/src/VspBspTree.h
r497 r501 258 258 259 259 /** Collapses the tree with respect to the view cell partition. 260 */ 261 void CollapseTree(); 262 263 ViewCell * 264 GetViewCell(const Vector3 &point); 260 @returns number of collapsed nodes 261 */ 262 int CollapseTree(); 263 264 /** Returns view cell the current point is located in. 265 */ 266 ViewCell *GetViewCell(const Vector3 &point); 265 267 266 268 /** Constructs bsp rays for post processing and visualization. … … 314 316 /** Collapses the tree with respect to the view cell partition, 315 317 i.e. leaves having the same view cell are collapsed. 318 @param node the root of the subtree to be collapsed 319 @param collapsed returns the number of collapsed nodes 316 320 @returns node of type leaf if the node could be collapsed, 317 321 this node otherwise 318 322 */ 319 BspNode *CollapseTree(BspNode *node );323 BspNode *CollapseTree(BspNode *node, int &collapsed); 320 324 /** Shuffles the leaves, i.e., tests if exchanging 321 325 the leaves helps in improving the view cells. -
trunk/VUT/GtpVisibilityPreprocessor/src/VspKdTree.cpp
r500 r501 951 951 pvsFront = nPvsFront[bestAxis]; 952 952 953 if (bestAxis == 1)954 Debug << "y axis!" << endl;955 953 return nCostRatio[bestAxis]; 956 954 } … … 1211 1209 parent->ReplaceChildLink(leaf, node); 1212 1210 } 1211 1213 1212 // and setup child links 1214 1213 node->SetupChildLinks(back, front); … … 2398 2397 2399 2398 2400 VspKdNode *VspKdTree::CollapseTree(VspKdNode *node )2401 { 2402 2399 VspKdNode *VspKdTree::CollapseTree(VspKdNode *node, int &collapsed) 2400 { 2401 if (node->IsLeaf()) 2403 2402 return node; 2404 2403 2405 2404 VspKdInterior *interior = dynamic_cast<VspKdInterior *>(node); 2406 2405 2407 VspKdNode *front = CollapseTree(interior->GetFront() );2408 VspKdNode *back = CollapseTree(interior->GetBack() );2406 VspKdNode *front = CollapseTree(interior->GetFront(), collapsed); 2407 VspKdNode *back = CollapseTree(interior->GetBack(), collapsed); 2409 2408 2410 2409 if (front->IsLeaf() && back->IsLeaf()) … … 2420 2419 VspKdLeaf *leaf = new VspKdLeaf(interior->GetParent(), 0); 2421 2420 leaf->SetViewCell(vc); 2422 2423 VspKdInterior *parent = 2424 dynamic_cast<VspKdInterior *>(leaf->mParent); 2421 //leaf->SetTreeValid(frontLeaf->TreeValid()); 2422 2425 2423 // replace a link from node's parent 2426 if (parent) 2424 if (leaf->mParent) 2425 { 2426 // replace a link from node's parent 2427 VspKdInterior *parent = 2428 dynamic_cast<VspKdInterior *>(leaf->mParent); 2427 2429 parent->ReplaceChildLink(node, leaf); 2428 2430 } 2431 ++ collapsed; 2429 2432 delete interior; 2430 2433 … … 2437 2440 2438 2441 2439 void VspKdTree::CollapseTree() 2440 { 2441 CollapseTree(mRoot); 2442 int VspKdTree::CollapseTree() 2443 { 2444 int collapsed = 0; 2445 CollapseTree(mRoot, collapsed); 2442 2446 // revalidate leaves 2443 2447 RepairVcLeafLists(); 2444 } 2448 2449 return collapsed; 2450 } 2451 2445 2452 2446 2453 int VspKdTree::RefineViewCells(const VssRayContainer &rays) -
trunk/VUT/GtpVisibilityPreprocessor/src/VspKdTree.h
r500 r501 669 669 670 670 /** Collapses the tree with respect to the view cell partition. 671 */ 672 void CollapseTree(); 671 @returns number of collapsed nodes 672 */ 673 int CollapseTree(); 673 674 674 675 protected: 675 676 676 /** Collapses the tree with respect to the view cell partition. 677 /** Collapses the tree with respect to the view cell partition, 678 i.e. leaves having the same view cell are collapsed. 679 @param node the root of the subtree to be collapsed 680 @param collapsed returns the number of collapsed nodes 677 681 @returns node of type leaf if the node could be collapsed, 678 682 this node otherwise 679 683 */ 680 VspKdNode *CollapseTree(VspKdNode *node); 684 VspKdNode *CollapseTree(VspKdNode *node, int &collapsed); 685 681 686 // incremental construction 682 687 virtual void UpdateRays(VssRayContainer &remove, VssRayContainer &add); -
trunk/VUT/GtpVisibilityPreprocessor/src/VssPreprocessor.cpp
r499 r501 12 12 #include "RenderSimulator.h" 13 13 14 bool useViewSpaceBox = false;15 14 bool use2dSampling = false; 16 bool useViewspacePlane = false;15 bool useViewspacePlane = true; 17 16 18 17 VssPreprocessor::VssPreprocessor(): … … 29 28 environment->GetBoolValue("VssPreprocessor.loadInitialSamples", mLoadInitialSamples); 30 29 environment->GetBoolValue("VssPreprocessor.storeInitialSamples", mStoreInitialSamples); 30 environment->GetBoolValue("VssPreprocessor.useViewSpaceBox", mUseViewSpaceBox); 31 31 32 32 mStats.open("stats.log"); … … 389 389 box->SetMax(1, box->Min(1)); 390 390 391 if ( useViewSpaceBox)391 if (mUseViewSpaceBox) 392 392 { 393 393 mViewSpaceBox = box; -
trunk/VUT/GtpVisibilityPreprocessor/src/VssPreprocessor.h
r490 r501 32 32 /// if initial samples should be stored in file 33 33 bool mStoreInitialSamples; 34 34 /// if box around view space should be used 35 bool mUseViewSpaceBox; 35 36 // rays cast during the processing 36 37 VssRayContainer mVssRays;
Note: See TracChangeset
for help on using the changeset viewer.