- Timestamp:
- 02/01/07 17:38:55 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing
- Files:
-
- 1 added
- 5 deleted
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/manual/integration.tex
r2068 r2072 30 30 Important options for performance are 31 31 32 \begin{verbatim} 33 VspBspTree.Construction.samples 34 VspBspTree.Termination.maxViewCells 32 %\begin{verbatim} 33 %VspBspTree.Construction.samples 34 %VspBspTree.Termination.maxViewCells 35 %\end{verbatim} 36 37 \begin{verbatim} 38 VspTree.Termination.maxLeaves 39 Hierarchy.Construction.samples 35 40 \end{verbatim} 36 41 -
GTP/trunk/Lib/Vis/Preprocessing/manual/manual.log
r2068 r2072 1 This is pdfeTeX, Version 3.141592-1.21a-2.2 (MiKTeX 2.4) (preloaded format=latex 2005.8.25) 31 JAN 2007 13:391 This is pdfeTeX, Version 3.141592-1.21a-2.2 (MiKTeX 2.4) (preloaded format=latex 2005.8.25) 1 FEB 2007 16:05 2 2 entering extended mode 3 3 **D:/svn/gametools/GTP/trunk/Lib/Vis/Preprocessing/manual/manual.tex … … 179 179 ) 180 180 LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <12> not available 181 (Font) Font shape `OT1/ptm/b/n' tried instead on input line 57.182 LaTeX Font Info: Try loading font information for OMS+ptm on input line 6 4.181 (Font) Font shape `OT1/ptm/b/n' tried instead on input line 62. 182 LaTeX Font Info: Try loading font information for OMS+ptm on input line 69. 183 183 184 184 (D:\texmf\tex\latex\psnfss\omsptm.fd … … 186 186 ) 187 187 LaTeX Font Info: Font shape `OMS/ptm/m/n' in size <10> not available 188 (Font) Font shape `OMS/cmsy/m/n' tried instead on input line 6 4.188 (Font) Font shape `OMS/cmsy/m/n' tried instead on input line 69. 189 189 [2 190 190 191 191 ] [3] 192 Overfull \hbox (1.41376pt too wide) in paragraph at lines 1 76--176192 Overfull \hbox (1.41376pt too wide) in paragraph at lines 181--181 193 193 [] \OT1/pcr/m/n/10 IntersectableWrapper<EntityCo 194 194 ntainer *>[] … … 196 196 197 197 198 Overfull \hbox (19.41376pt too wide) in paragraph at lines 1 76--176198 Overfull \hbox (19.41376pt too wide) in paragraph at lines 181--181 199 199 [] \OT1/pcr/m/n/10 EngineIntersectable(EntityContainer *item): GtpVisibilityP 200 200 reprocessor::[] … … 202 202 203 203 [4] 204 Overfull \hbox (31.41376pt too wide) in paragraph at lines 26 0--260204 Overfull \hbox (31.41376pt too wide) in paragraph at lines 265--265 205 205 [] \OT1/pcr/m/n/10 const GtpVisibilityPreprocessor::IndexedBoundingBoxCon 206 206 tainer &iboxes,[] … … 208 208 209 209 210 Overfull \hbox (1.41376pt too wide) in paragraph at lines 26 0--260210 Overfull \hbox (1.41376pt too wide) in paragraph at lines 265--265 211 211 [] \OT1/pcr/m/n/10 EngineIntersectable *entry = new EngineIntersectable(entr 212 212 yObjects);[] … … 214 214 215 215 [5] 216 Overfull \hbox (1.41376pt too wide) in paragraph at lines 3 09--309216 Overfull \hbox (1.41376pt too wide) in paragraph at lines 314--314 217 217 [] \OT1/pcr/m/n/10 for (sit = sceneNodeList.begin(); sit != sceneNodeList.end( 218 218 ); ++ sit)[] … … 220 220 221 221 222 Overfull \hbox (7.41376pt too wide) in paragraph at lines 3 09--309222 Overfull \hbox (7.41376pt too wide) in paragraph at lines 314--314 223 223 [] \OT1/pcr/m/n/10 // test for intersection (note: function provided of pr 224 224 eprocessor)[] … … 242 242 \urw\urwstd\utmri8a.pfb><D:\texmf\fonts\type1\urw\urwstd\utmb8a.pfb><D:\texmf\f 243 243 onts\type1\urw\urwstd\utmr8a.pfb> 244 Output written on manual.pdf (7 pages, 8216 1bytes).244 Output written on manual.pdf (7 pages, 82164 bytes). -
GTP/trunk/Lib/Vis/Preprocessing/scripts/generate_viewcells.env
r2071 r2072 5 5 6 6 Scene { 7 7 8 filename ../data/vienna/vienna_cropped.obj 8 # filename ../data/soda/soda5.obj9 9 # filename ../data/soda/soda5.dat 10 10 } … … 16 16 type vss 17 17 detectEmptyViewSpace true 18 #loadMeshes true19 18 loadMeshes false 20 19 # internal raycaster 21 #rayCastMethod 020 rayCastMethod 0 22 21 # intel raycaster 23 rayCastMethod 122 #rayCastMethod 1 24 23 exportVisibility false 25 24 loadKdTree false … … 88 87 89 88 maxCostRatio 1.5 90 #maxCostRatio 99999991 89 ct_div_ci 0.5 92 90 } … … 96 94 splitBorder 0.01 97 95 } 98 99 96 100 97 MeshKdTree { … … 128 125 loadFromFile false 129 126 127 filename vienna_cropped-viewcells.xml.gz 128 130 129 exportPvs false 131 filename vienna_cropped-visibility.xml.gz132 130 133 131 # type of view cells 134 type vsp BspTree132 type vspOspTree 135 133 136 134 #percentage of total visible objects where pvs is considered invalid … … 157 155 Visualization { 158 156 # how much samples we use for visualization 159 samples 200 00157 samples 200 160 158 exportRays true 161 exportGeometry false159 exportGeometry true 162 160 exportMergedViewCells false 163 161 useClipPlane true … … 188 186 189 187 190 VspBspTree { 188 ################################ 189 # 190 # View space partitioning kd tree 191 # 192 193 VspTree { 191 194 Construction { 195 renderCostDecreaseWeight 1.0 196 } 197 198 Termination { 199 minPvs 0 200 maxViewCells 5000 201 } 202 203 useCostHeuristics true 204 splitUseOnlyDrivingAxis false 205 206 # maximum number of tests per node 207 maxTests 50000 208 } 209 210 211 ########################## 212 # 213 # The bounding volume hierarchy 214 # 215 216 BvHierarchy { 217 218 Construction { 219 renderCostDecreaseWeight 1.0 220 } 221 222 Termination { 223 maxLeaves 50000 224 } 225 226 minRaysForVisibility 15 227 228 # use only surface area heuristic 229 useCostHeuristics true 230 useSah false 231 232 splitUseOnlyDrivingAxis false 233 234 maxTests 50000 235 } 236 237 238 ############################################################### 239 # 240 # Manages the construction of view space and object space partition 241 # 242 243 Hierarchy { 244 # the type of object space partition: view space is always vsp (=kd) partition 245 type bvh 246 247 Construction { 248 192 249 samples 2000000 193 epsilon 0.0000001 194 randomize false 195 renderCostWeight 1.0 196 } 197 198 199 # random polygon = 1 200 # axis aligned = 2 201 # least ray splits = 256 202 # balanced rays = 512 203 # pvs = 1024 204 205 splitPlaneStrategy 1026 206 207 # maximal candidates for split planes 208 maxPolyCandidates 0 209 210 usePolygonSplitIfAvailable false 211 212 # maximal tested rays for split cost heuristics 213 maxTests 100000 214 215 maxTotalMemory 50 216 maxStaticMemory 50 217 218 subdivisionStats ../subdivisionStats.log 219 220 # factors for evaluating split plane costs 221 Factor { 222 leastRaySplits 1.0 223 balancedRays 1.0 224 pvs 1.0 225 } 226 227 Termination { 228 # parameters used for autopartition 229 minRays -1 230 minPolygons -1 231 maxDepth 25 232 minPvs 0 233 minProbability 0.000001 234 maxRayContribution 1 235 maxCostRatio 0.9 236 missTolerance 6 237 globalCostMissTolerance 4 238 minGlobalCostRatio 0.0001 239 240 maxViewCells 3000 241 242 # used for pvs criterium 243 ct_div_ci 0.0 244 245 AxisAligned { 246 minRays 50000 247 maxRayContribution 9.9 248 } 249 } 250 251 useSplitCostQueue true 252 253 splitUseOnlyDrivingAxis false 254 simulateOctree false 255 useRandomAxis false 256 usePolygonSplitIfAvailable false 257 nodePriorityQueueType 0 258 259 useCostHeuristics true 260 261 Visualization { 262 # x3d visualization of the split planes 263 exportSplits false 264 } 265 } 250 251 # type 0 = sequential computation, 1 = interleaved, 2 = gradient 252 type 0 253 254 ############################### 255 # only for interleaved method 256 257 # minimal steps of same type for gradient method 258 minStepsOfSameType 100 259 # maximum steps of same type for gradient method 260 maxStepsOfSameType 900 261 262 # maximum number of repair steps per gradient step 263 maxRepairs 1000 264 } 265 266 Termination { 267 # maximal number of leaves 268 maxLeaves 3000000 269 # maximal memory in MB 270 maxMemory 100 271 # minimum ratio of global cost decrease 272 minGlobalCostRatio -1 273 } 274 } -
GTP/trunk/Lib/Vis/Preprocessing/scripts/generate_viewcells.sh
r2066 r2072 10 10 11 11 SCENE=vienna_cropped 12 #SCENE=soda513 14 12 LOG_PREFIX=../scripts/$SCENE 15 13 ENVIRONMENT=generate_viewcells.env … … 17 15 echo "starting $TARGET mode for $SCENE scene" 18 16 19 # !/bin/sh17 ############################################################################ 20 18 21 PROGRAM=../bin/release/Preprocessor.exe 22 SCENE=generate_viewcells 19 # METHOD=interleaved 20 # echo "$SCENE $METHOD" 23 21 24 LOG_PREFIX=../scripts/vienna 22 # $PROGRAM $ENVIRONMENT \ 23 # -view_cells_filename=$LOG_PREFIX-$METHOD-viewcells.xml.gz \ 24 # -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \ 25 # -vsp_subdivision_stats=$LOG_PREFIX-$METHOD-vsp-subdivisionStats.log \ 26 # -bvh_subdivision_stats=$LOG_PREFIX-$METHOD-bvh-subdivisionStats.log \ 27 # -hierarchy_subdivision_stats=$LOG_PREFIX-$METHOD-hierarchy-subdivisionStats.log \ 28 # -hierarchy_construction_type=2 \ 29 # -hierarchy_construction_consider_memory=true 25 30 26 ENVIRONMENT=$SCENE.env 31 ############################################################################ 27 32 33 echo "$SCENE $METHOD" 28 34 29 ############################################### 35 $PROGRAM $ENVIRONMENT \ 36 -view_cells_filename=$LOG_PREFIX-viewcells.xml.gz \ 37 -view_cells_merge_stats=$LOG_PREFIX-mergeStats.log \ 38 -vsp_subdivision_stats=$LOG_PREFIX-vsp-subdivisionStats.log \ 39 -bvh_subdivision_stats=$LOG_PREFIX-bvh-subdivisionStats.log \ 40 -hierarchy_subdivision_stats=$LOG_PREFIX-hierarchy-subdivisionStats.log \ 41 -hierarchy_construction_type=0 \ 42 -hierarchy_construction_consider_memory=true 30 43 31 METHOD=avs 32 echo "$SCENE $METHOD" 33 34 $PROGRAM $ENVIRONMENT \ 35 -view_cells_filename=$LOG_PREFIX-visibility.xml.zip 36 37 mv debug.log $LOG_PREFIX-$METHOD-debug.log 38 44 # -bvh_term_max_leaves=10000 \ 45 # -hierarchy_term_max_leaves=20000 -
GTP/trunk/Lib/Vis/Preprocessing/src/Exporter.cpp
r2065 r2072 150 150 SetFilled(); 151 151 152 if ( 1)152 if (0) 153 153 ExportGeometry(leaf->mObjects, true, box); 154 154 else -
GTP/trunk/Lib/Vis/Preprocessing/src/InternalRayCaster.cpp
r2071 r2072 201 201 #endif 202 202 203 AxisAlignedBox3 ebox = sbox;204 ebox.Enlarge(Vector3(1e-3f));205 206 203 SimpleRayContainer::const_iterator sit, sit_end = rays.end(); 207 204 … … 210 207 { 211 208 CastRay(*sit, vssRays, sbox, castDoubleRays, pruneInvalidRays); 212 if (!vssRays.empty() && (!vssRays.back() || !ebox.IsInside(*vssRays.back())))213 cout << "error " << *vssRays.back()<<endl;214 209 } 215 210 -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r2070 r2072 745 745 if (!mViewCellsManager) 746 746 { 747 cerr << "no view cells manager could be loaded" << endl; 747 748 return false; 748 749 } … … 1203 1204 } 1204 1205 1205 // reserve constant block of rays 1206 ///// 1207 //-- reserve constant block of rays 1208 1209 // hack: If we dont't use view cells loading, there must be at least as much rays 1210 // as are needed for the view cells construction 1211 bool loadViewCells; 1212 Environment::GetSingleton()->GetBoolValue("ViewCells.loadFromFile", loadViewCells); 1213 1214 int reserveRays; 1215 1216 if (!loadViewCells) 1217 { 1218 cout << "setting ray pool size to view cell construction ize" << endl; 1219 1220 char buf[100]; 1221 Environment::GetSingleton()->GetStringValue("ViewCells.type", buf); 1222 1223 if (strcmp(buf, "vspBspTree") == 0) 1224 { 1225 Environment::GetSingleton()->GetIntValue("VspBspTree.Construction.samples", reserveRays); 1226 reserveRays *= 2; 1227 } 1228 else if (strcmp(buf, "vspOspTree") == 0) 1229 { 1230 Environment::GetSingleton()->GetIntValue("Hierarchy.Construction.samples", reserveRays); 1231 reserveRays *= 2; 1232 } 1233 } 1234 else 1235 { 1236 cout << "setting ray pool size to samples per pass" << endl; 1237 1238 reserveRays = mSamplesPerPass * 2; 1239 } 1240 1206 1241 cout << "======================" << endl; 1207 cout << "reserving " << 2 * mSamplesPerPass << " rays " << endl;1208 mRayCaster->ReserveVssRayPool( 2 * mSamplesPerPass);1242 cout << "reserving " << reserveRays << " rays " << endl; 1243 mRayCaster->ReserveVssRayPool(reserveRays); 1209 1244 1210 1245 return true; … … 1225 1260 if ((int)rays.size() > 10000) { 1226 1261 1227 //mRayCaster->SortRays(rays);1262 mRayCaster->SortRays(rays); 1228 1263 cout<<"Rays sorted in "<<TimeDiff(t1, GetTime())<<" ms."<<endl; 1229 1264 … … 1246 1281 1247 1282 SimpleRayContainer::const_iterator rit, rit_end = rays.end(); 1248 cout << "here1 " << vssRays.size()<<endl; 1283 1249 1284 SimpleRayContainer rayBucket; 1250 1285 int i = 0; 1286 1251 1287 for (rit = rays.begin(); rit != rit_end; ++ rit, ++ i) 1252 1288 { … … 1276 1312 1277 1313 if ((int)rays.size() > 100000 && i % 100000 == 0) 1278 cout << "here2 " << vssRays.size()<<endl;1279 //cout<<"\r"<<i<<"/"<<(int)rays.size()<<"\r";1280 } 1281 cout << "here3 " << vssRays.size()<<endl;1314 //cout << "here2 " << vssRays.size()<<endl; 1315 cout<<"\r"<<i<<"/"<<(int)rays.size()<<"\r"; 1316 } 1317 1282 1318 // cast rest of rays 1283 1319 SimpleRayContainer::const_iterator sit, sit_end = rayBucket.end(); … … 1304 1340 } 1305 1341 1306 cout << "here5 " << vssRays.size()<<endl;1307 1308 1342 int m = 850000; 1309 1343 1310 if ( 1&& (int)rays.size() > m + 50) {1344 if (0 && (int)rays.size() > m + 50) { 1311 1345 VssRayContainer tmpRays; 1312 1346 -
GTP/trunk/Lib/Vis/Preprocessing/src/RayCaster.h
r2069 r2072 82 82 if (mRays) 83 83 delete mRays; 84 cout << "here4" << endl;84 85 85 mRays = new VssRay[number]; 86 86 mNumber = number; -
GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp
r2071 r2072 205 205 bool SpatialBoxBasedDistribution::GenerateSample(SimpleRay &ray) 206 206 { 207 Vector3 origin, direction; 207 /* 208 Vector3 origin, direction; 208 209 209 210 mPreprocessor.mViewCellsManager->GetViewPoint(origin); … … 213 214 214 215 if (c <= Limits::Small) 216 return false; 217 218 const float pdf = 1.0f; 219 220 direction *= 1.0f / c; 221 ray = SimpleRay(origin, direction, SPATIAL_BOX_BASED_DISTRIBUTION, pdf); 222 223 return true; 224 */ 225 226 Vector3 origin, direction; 227 228 float r[6]; 229 sHalton.GetNext(6, r); 230 mPreprocessor.mViewCellsManager->GetViewPoint(origin, Vector3(r[0], r[1], r[2])); 231 232 direction = mPreprocessor.mKdTree->GetBox().GetRandomPoint(Vector3(r[3], 233 r[4], 234 r[5]) 235 ) - origin; 236 //cout << "z"; 237 const float c = Magnitude(direction); 238 239 if (c <= Limits::Small) 215 240 return false; 216 241 … … 219 244 direction *= 1.0f / c; 220 245 ray = SimpleRay(origin, direction, SPATIAL_BOX_BASED_DISTRIBUTION, pdf); 221 222 return true; 223 224 /* 225 Vector3 origin, direction; 226 227 float r[6]; 228 sHalton.GetNext(6, r); 229 mPreprocessor.mViewCellsManager->GetViewPoint(origin, Vector3(r[0],r[1],r[2])); 230 231 direction = mPreprocessor.mKdTree->GetBox().GetRandomPoint(Vector3(r[3], 232 r[4], 233 r[5]) 234 ) - origin; 235 //cout << "z"; 236 const float c = Magnitude(direction); 237 238 if (c <= Limits::Small) 239 return false; 240 241 const float pdf = 1.0f; 242 243 direction *= 1.0f / c; 244 ray = SimpleRay(origin, direction, SPATIAL_BOX_BASED_DISTRIBUTION, pdf); 245 246 return true;*/ 246 247 return true; 247 248 } 248 249 … … 275 276 // $$ jb the pdf is yet not correct for all sampling methods! 276 277 const float pdf = 1.0f; 277 //cout << "p: " << point << " ";278 278 279 direction *= 1.0f / c; 279 280 // a little offset … … 300 301 Intersectable *object = mPreprocessor.mObjects[objIdx]; 301 302 ViewCell *viewCell = viewCells[vcIdx]; 302 303 //cout << "vc: " << vcIdx << endl;304 //cout << "obj: " << objIdx << endl;305 303 306 304 object->GetRandomSurfacePoint(point, normal); -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r2071 r2072 6588 6588 stream << "<VisibilitySolution>" << endl; 6589 6589 6590 // §§ tmp matt: for storage cost 6591 if (0 && exportPvs) 6590 if (exportPvs) 6592 6591 { 6593 6592 /////////////// -
GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp
r2071 r2072 27 27 #define COUNT_ORIGIN_OBJECTS 1 28 28 29 #define STORE_PVS 129 #define STORE_PVS 0 30 30 31 31 … … 451 451 } 452 452 453 // normalize454 453 if (mUseAreaForPvs) 455 454 mTermMinProbability *= mBoundingBox.SurfaceArea(); 456 else 455 else // normalize volume 457 456 mTermMinProbability *= mBoundingBox.GetVolume(); 458 459 457 460 458 mBspStats.nodes = 1; … … 1273 1271 if (ray->mTerminationObject) 1274 1272 { 1275 //cout << "m";1276 1273 if (vc->AddPvsSample(ray->mTerminationObject, ray->mPdf, contribution)) 1277 1274 madeContrib = true; … … 2126 2123 pOverall = data.mProbability; 2127 2124 2128 if (!mUseAreaForPvs) // use front and back cell areas to approximate volume2125 if (!mUseAreaForPvs) 2129 2126 { 2130 2127 pFront = geomFront.GetVolume(); … … 2144 2141 else 2145 2142 { 2143 // use front and back cell areas to approximate volume 2146 2144 pFront = geomFront.GetArea(); 2147 2145 pBack = geomBack.GetArea(); -
GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp
r2066 r2072 578 578 { 579 579 // note: to track for global cost misses does not really 580 // make sense because cost termination happens in the hierarchy mananger581 580 // make sense because termination on cost or memory is done 581 // in the hierarchy mananger 582 582 const bool terminationCriteriaMet = (0 583 583 // || mOutOfMemory
Note: See TracChangeset
for help on using the changeset viewer.