- Timestamp:
- 01/23/06 10:10:34 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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...
Note: See TracChangeset
for help on using the changeset viewer.