Changeset 567
- Timestamp:
- 01/23/06 10:10:34 (19 years ago)
- Location:
- trunk/VUT/GtpVisibilityPreprocessor/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/Preprocessor.cpp
r563 r567 444 444 mViewCellsManager->GetViewPoint(origin); 445 445 446 447 446 // now get the direction 448 447 switch (sampleType) { -
trunk/VUT/GtpVisibilityPreprocessor/src/RssPreprocessor.cpp
r563 r567 64 64 GenerateImportanceRays(mRssTree, number, rays); 65 65 result = true; 66 rays.NormalizePdf();66 // rays.NormalizePdf(); 67 67 } 68 68 break; … … 214 214 215 215 216 Vector3217 RssPreprocessor::GetViewpoint(AxisAlignedBox3 *viewSpaceBox)218 {219 AxisAlignedBox3 box;220 221 if (viewSpaceBox)222 box =*viewSpaceBox;223 else224 box = mKdTree->GetBox();225 226 // shrink the box in the y direction227 return box.GetRandomPoint();228 }229 216 230 217 … … 432 419 { 433 420 434 // connect(this, SIGNAL(EvalPvsStat()), renderer, SLOT(EvalPvsStat()) );435 436 421 cout<<"Rss Preprocessor started\n"<<flush; 437 cout<<"Memory/ray "<<sizeof(VssRay)+sizeof(RssTreeNode::RayInfo)<<endl;422 // cout<<"Memory/ray "<<sizeof(VssRay)+sizeof(RssTreeNode::RayInfo)<<endl; 438 423 439 424 Randomize(0); … … 566 551 if (mUseImportanceSampling) { 567 552 VssRayContainer tmpVssRays; 568 569 GenerateRays(mRssSamplesPerPass/2, RSS_BASED_DISTRIBUTION, rays); 553 554 float ratios[] = {1.0f,0,0}; 555 556 557 558 GenerateRays(mRssSamplesPerPass*ratios[0], RSS_BASED_DISTRIBUTION, rays); 570 559 CastRays(rays, tmpVssRays); 571 560 castRays += rays.size(); … … 576 565 rays.clear(); 577 566 tmpVssRays.clear(); 578 579 GenerateRays(mRssSamplesPerPass/4, SPATIAL_BOX_BASED_DISTRIBUTION, rays); 580 CastRays(rays, tmpVssRays); 581 castRays += rays.size(); 582 float c2 = mViewCellsManager->ComputeSampleContributions(tmpVssRays, false); 583 mStats<<"#SpatialRelContrib"<<endl<<c2/rays.size()<<endl; 584 585 vssRays.insert(vssRays.end(), tmpVssRays.begin(), tmpVssRays.end() ); 586 587 rays.clear(); 588 tmpVssRays.clear(); 589 590 591 GenerateRays(mRssSamplesPerPass/4, DIRECTION_BASED_DISTRIBUTION, rays); 592 CastRays(rays, tmpVssRays); 593 castRays += rays.size(); 594 float c3 = mViewCellsManager->ComputeSampleContributions(tmpVssRays, false); 595 mStats<<"#DirectionalRelContrib"<<endl<<c3/rays.size()<<endl; 596 597 vssRays.insert(vssRays.end(), tmpVssRays.begin(), tmpVssRays.end() ); 598 599 rays.clear(); 600 tmpVssRays.clear(); 567 568 if (ratios[1]!=0.0f) { 569 GenerateRays(mRssSamplesPerPass*ratios[1], SPATIAL_BOX_BASED_DISTRIBUTION, rays); 570 CastRays(rays, tmpVssRays); 571 castRays += rays.size(); 572 float c2 = mViewCellsManager->ComputeSampleContributions(tmpVssRays, false); 573 mStats<<"#SpatialRelContrib"<<endl<<c2/rays.size()<<endl; 574 575 vssRays.insert(vssRays.end(), tmpVssRays.begin(), tmpVssRays.end() ); 576 577 rays.clear(); 578 tmpVssRays.clear(); 579 } 580 581 582 if (ratios[2]!=0.0f) { 583 GenerateRays(mRssSamplesPerPass*ratios[2], DIRECTION_BASED_DISTRIBUTION, rays); 584 CastRays(rays, tmpVssRays); 585 castRays += rays.size(); 586 float c3 = mViewCellsManager->ComputeSampleContributions(tmpVssRays, false); 587 mStats<<"#DirectionalRelContrib"<<endl<<c3/rays.size()<<endl; 588 589 vssRays.insert(vssRays.end(), tmpVssRays.begin(), tmpVssRays.end() ); 590 591 rays.clear(); 592 tmpVssRays.clear(); 593 } 601 594 602 595 // add contributions of all rays at once... -
trunk/VUT/GtpVisibilityPreprocessor/src/RssPreprocessor.h
r563 r567 52 52 53 53 virtual bool ComputeVisibility(); 54 55 Vector356 GetViewpoint(AxisAlignedBox3 *viewSpaceBox);57 54 58 55 -
trunk/VUT/GtpVisibilityPreprocessor/src/RssTree.cpp
r563 r567 2097 2097 2098 2098 float extendedConvexCombinationProb = 0.0f; //0.7f 2099 float silhouetteCheckPercentage = 0.0f; //0.5f2099 float silhouetteCheckPercentage = 1.0f; //0.5f 2100 2100 for (int i=0; generated < numberOfRays && i < numberOfTries; i++) { 2101 2101 bool useExtendedConvexCombination = ((nrays >= 2) && (Random(1.0f) < … … 2178 2178 selectedRays.push_back(ray); 2179 2179 } 2180 2180 2181 2181 // check whether the ray does not intersect already visible objects 2182 2182 Ray traversalRay; … … 2186 2186 oi++) { 2187 2187 Intersectable *object = *oi; 2188 // do not test every object 2189 if (Random(1.0f) > 0.5f) 2190 break; 2188 2191 if ( object->CastRay(traversalRay) ) { 2189 2192 intersects = true; … … 2322 2325 ) 2323 2326 { 2324 bool globalPrunning = false;2327 bool globalPrunning = true; 2325 2328 2326 2329 stack<RssTreeNode *> tstack; … … 2369 2372 if (node->IsLeaf()) { 2370 2373 RssTreeLeaf *leaf = (RssTreeLeaf *)node; 2371 // 2374 // prunned += PruneRaysRandom(leaf, ratio); 2372 2375 prunned += PruneRaysContribution(leaf, ratio); 2373 2376 } else { … … 2474 2477 // if small very high importance of the last sample 2475 2478 // if 1.0f then weighs = 1 1/2 1/3 1/4 2476 float passSampleWeightDecay = 0.5f;2479 float passSampleWeightDecay = 1.0f; 2477 2480 2478 2481 void … … 2503 2506 break; 2504 2507 default: 2505 weight = 0.0 1f;2508 weight = 0.0f; 2506 2509 break; 2507 2510 // case 1: -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.cpp
r565 r567 189 189 for (it = rays.begin(); it != it_end; ++ it) { 190 190 sum += ComputeSampleContributions(*(*it), addRays); 191 //ComputeSampleContributions(*(*it), addRays); 192 // sum += (*it)->mPvsContribution; 191 193 } 192 194 return sum; -
trunk/VUT/GtpVisibilityPreprocessor/src/default.env
r563 r567 14 14 # filename ../data/vienna/viewcells-25-sel.x3d 15 15 # filename ../data/atlanta/atlanta2.x3d 16 # 16 #filename ../data/soda/soda.dat 17 17 filename ../data/soda/soda5.dat 18 18 } … … 25 25 # type vss 26 26 type rss 27 detectEmptyViewSpace false27 detectEmptyViewSpace true 28 28 pvsRenderErrorSamples 10000 29 29 … … 97 97 RssTree { 98 98 epsilon 1e-6 99 perObjectTree false99 perObjectTree true 100 100 101 101 maxDepth 40 102 102 minPvs 1 103 minRays 100103 minRays 50 104 104 minSize 0.001 105 105 maxCostRatio 1.0 106 106 maxRayContribution 0.5 107 maxRays 5000000107 maxRays 2000000 108 108 maxTotalMemory 200 109 109 maxStaticMemory 100 … … 118 118 dirSplitDepth 0 119 119 120 numberOfEndPointDomains 10000121 120 ct_div_ci 0.0 122 randomize false123 124 refDirBoxMaxSize 0.1125 121 } 126 122 … … 204 200 } 205 201 206 #filename ../data/soda/viewcells_soda5-2.xml207 filename ../data/atlanta/viewcells_atlanta2.xml202 filename ../data/soda/viewcells_soda5-2.xml 203 # filename ../data/atlanta/viewcells_atlanta2.xml 208 204 # filename ../data/atlanta/atlanta_viewcells_large.x3d 209 205 # filename ../data/vienna/viewcells-25-sel.x3d
Note: See TracChangeset
for help on using the changeset viewer.