- Timestamp:
- 11/10/05 13:59:18 (19 years ago)
- Location:
- trunk/VUT/GtpVisibilityPreprocessor/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/Environment.cpp
r397 r403 1150 1150 "10"); 1151 1151 1152 RegisterOption("VssPreprocessor. totalSamples",1152 RegisterOption("VssPreprocessor.initialSamples", 1153 1153 optInt, 1154 "-total_samples=", 1154 "-initial_samples=", 1155 "100000"); 1156 1157 RegisterOption("VssPreprocessor.vssSamples", 1158 optInt, 1159 "-vss_samples=", 1155 1160 "1000000"); 1156 1161 … … 1160 1165 "100000"); 1161 1166 1167 RegisterOption("VssPreprocessor.useImportanceSampling", 1168 optBool, 1169 "-vss_use_importance=", 1170 "true"); 1171 1162 1172 RegisterOption("ViewCells.hierarchy", 1163 1173 optString, … … 1303 1313 1304 1314 RegisterOption("VssTree.maxDepth", optInt, "kd_depth=", "12"); 1305 RegisterOption("VssTree.minPvs", optInt, "kd_minpvs=", "32"); 1306 RegisterOption("VssTree.maxCostRatio", optFloat, "maxcost=", "0.9"); 1315 RegisterOption("VssTree.minPvs", optInt, "kd_minpvs=", "1"); 1316 RegisterOption("VssTree.minRays", optInt, "kd_minrays=", "10"); 1317 RegisterOption("VssTree.maxCostRatio", optFloat, "maxcost=", "0.95"); 1307 1318 RegisterOption("VssTree.maxRayContribution", optFloat, "maxraycontrib=", "0.5"); 1308 1319 -
trunk/VUT/GtpVisibilityPreprocessor/src/KdTree.cpp
r376 r403 292 292 app << "===== KdTree statistics ===============\n"; 293 293 294 app << "#N_RAYS Number of rays )\n"295 << rays <<endl;296 app << "#N_DOMAINS ( Number of query domains )\n"297 << queryDomains <<endl;298 299 294 app << "#N_NODES ( Number of nodes )\n" << nodes << "\n"; 300 295 -
trunk/VUT/GtpVisibilityPreprocessor/src/VssPreprocessor.cpp
r401 r403 16 16 // this should increase coherence of the samples 17 17 environment->GetIntValue("VssPreprocessor.samplesPerPass", mSamplesPerPass); 18 environment->GetIntValue("VssPreprocessor.totalSamples", mTotalSamples); 18 environment->GetIntValue("VssPreprocessor.initialSamples", mInitialSamples); 19 environment->GetIntValue("VssPreprocessor.vssSamples", mVssSamples); 20 environment->GetBoolValue("VssPreprocessor.useImportanceSampling", mUseImportanceSampling); 21 19 22 mStats.open("stats.log"); 20 23 } … … 212 215 VssTree *vssTree = NULL; 213 216 214 while (totalSamples < m TotalSamples) {217 while (totalSamples < mInitialSamples) { 215 218 int passContributingSamples = 0; 216 219 int passSampleContributions = 0; … … 305 308 306 309 int samples = 0; 307 for (int i=0; i < 50; i++) {308 int num = 100000;309 if ( 0) {310 while (1) { 311 int num = mSamplesPerPass; 312 if (!mUseImportanceSampling) { 310 313 VssRayContainer vssRays; 311 314 for (int j=0; j < num; j++) { … … 321 324 float pvs = vssTree->GetAvgPvsSize(); 322 325 cout<<samples<<" avgPVS ="<<pvs<<endl; 326 if (samples >= mVssSamples) 327 break; 323 328 } 324 329 -
trunk/VUT/GtpVisibilityPreprocessor/src/VssPreprocessor.h
r401 r403 15 15 int mPass; 16 16 int mSamplesPerPass; 17 int mTotalSamples; 18 ofstream mStats; 17 int mInitialSamples; 18 int mVssSamples; 19 bool mUseImportanceSampling; 20 21 ofstream mStats; 19 22 20 23 ObjectContainer mObjects; -
trunk/VUT/GtpVisibilityPreprocessor/src/VssTree.cpp
r401 r403 71 71 environment->GetIntValue("VssTree.maxDepth", termMaxDepth); 72 72 environment->GetIntValue("VssTree.minPvs", termMinPvs); 73 environment->GetIntValue("VssTree.minRays", termMinRays); 73 74 environment->GetFloatValue("VssTree.maxRayContribution", termMaxRayContribution); 74 75 environment->GetFloatValue("VssTree.maxCostRatio", termMaxCostRatio); … … 172 173 maxDepthNodes*100/(double)Leaves()<<endl; 173 174 174 app << "#N_PMINCOSTLEAVES ( Percentage of leaves with minCost )\n"<< 175 minCostNodes*100/(double)Leaves()<<endl; 175 app << "#N_PMINPVSLEAVES ( Percentage of leaves with minCost )\n"<< 176 minPvsNodes*100/(double)Leaves()<<endl; 177 178 app << "#N_PMINRAYSLEAVES ( Percentage of leaves with minCost )\n"<< 179 minRaysNodes*100/(double)Leaves()<<endl; 176 180 177 181 app << "#N_PMINSIZELEAVES ( Percentage of leaves with minSize )\n"<< … … 744 748 // stat.minCostNodes++; 745 749 if ( leaf->GetPvsSize() < termMinPvs) 746 stat.minCostNodes++; 747 748 if (leaf->GetAvgRayContribution() > termMaxRayContribution ) 750 stat.minPvsNodes++; 751 752 if ( leaf->GetPvsSize() < termMinRays) 753 stat.minRaysNodes++; 754 755 if (0 && leaf->GetAvgRayContribution() > termMaxRayContribution ) 749 756 stat.maxRayContribNodes++; 750 757 … … 770 777 771 778 if ( (leaf->GetPvsSize() < termMinPvs) || 772 (leaf->GetAvgRayContribution() > termMaxRayContribution ) || 779 (leaf->rays.size() < termMinRays) || 780 // (leaf->GetAvgRayContribution() > termMaxRayContribution ) || 773 781 (leaf->depth >= termMaxDepth) || 774 782 SqrMagnitude(box.Size()) <= termMinSize ) { -
trunk/VUT/GtpVisibilityPreprocessor/src/VssTree.h
r401 r403 54 54 int maxDepthNodes; 55 55 // max depth nodes 56 int minCostNodes; 56 int minPvsNodes; 57 int minRaysNodes; 57 58 // max ray contribution nodes 58 59 int maxRayContribNodes; … … 83 84 rayRefs = 0; 84 85 maxDepthNodes = 0; 85 minCostNodes = 0; 86 minPvsNodes = 0; 87 minRaysNodes = 0; 86 88 maxRayRefs = 0; 87 89 addedRayRefs = removedRayRefs = 0; … … 426 428 return GetPvsSize()/((float)rays.size() + Limits::Small); 427 429 } 430 431 float GetSqrRayContribution() const { 432 return sqr(GetPvsSize()/((float)rays.size() + Limits::Small)); 433 } 434 428 435 }; 429 436 … … 555 562 int termMinPvs; 556 563 564 // minimal ray number per node to still get subdivided 565 int termMinRays; 566 557 567 // maximal cost ration to subdivide a node 558 568 float termMaxCostRatio; -
trunk/VUT/GtpVisibilityPreprocessor/src/default.env
r401 r403 24 24 25 25 VssPreprocessor { 26 totalSamples 200000 27 samplesPerPass 50000 26 samplesPerPass 100000 27 initialSamples 200000 28 vssSamples 1000000 29 useImportanceSampling true 28 30 } 29 31 … … 32 34 33 35 maxDepth 40 34 minPvs 5 36 minPvs 1 37 minRays 50 35 38 minSize 0.00001 36 39 maxCostRatio 0.95 37 maxRayContribution 0. 340 maxRayContribution 0.05 38 41 39 42 maxTotalMemory 400
Note: See TracChangeset
for help on using the changeset viewer.