Changeset 556 for trunk/VUT/GtpVisibilityPreprocessor/src/VspBspTree.cpp
- Timestamp:
- 01/19/06 15:30:44 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/VspBspTree.cpp
r555 r556 493 493 494 494 //-- update pvs 495 int conSamp = 0, sampCon = 0; 496 AddToPvs(leaf, *tData.mRays, conSamp, sampCon); 495 int conSamp = 0; 496 float sampCon = 0.0f; 497 AddToPvs(leaf, *tData.mRays, sampCon, conSamp); 497 498 498 499 mStat.contributingSamples += conSamp; … … 660 661 void VspBspTree::AddToPvs(BspLeaf *leaf, 661 662 const RayInfoContainer &rays, 662 int &sampleContributions,663 float &sampleContributions, 663 664 int &contributingSamples) 664 665 { 665 sampleContributions = 0; 666 contributingSamples = 0; 667 668 RayInfoContainer::const_iterator it, it_end = rays.end(); 669 670 ViewCell *vc = leaf->GetViewCell(); 671 672 // add contributions from samples to the PVS 673 for (it = rays.begin(); it != it_end; ++ it) 674 { 675 int contribution = 0; 676 VssRay *ray = (*it).mRay; 677 678 if (ray->mTerminationObject) 679 contribution += vc->GetPvs().AddSample(ray->mTerminationObject); 680 681 if (ray->mOriginObject) 682 contribution += vc->GetPvs().AddSample(ray->mOriginObject); 683 684 if (contribution) 685 { 686 sampleContributions += contribution; 687 ++ contributingSamples; 688 } 689 //leaf->mVssRays.push_back(ray); 666 sampleContributions = 0; 667 contributingSamples = 0; 668 669 RayInfoContainer::const_iterator it, it_end = rays.end(); 670 671 ViewCell *vc = leaf->GetViewCell(); 672 673 // add contributions from samples to the PVS 674 for (it = rays.begin(); it != it_end; ++ it) 675 { 676 float sc = 0.0f; 677 VssRay *ray = (*it).mRay; 678 bool madeContrib = false; 679 float contribution; 680 if (ray->mTerminationObject) { 681 if (vc->GetPvs().AddSample(ray->mTerminationObject, ray->mPdf, contribution)) 682 madeContrib = true; 683 sc += contribution; 684 } 685 686 if (ray->mOriginObject) { 687 if (vc->GetPvs().AddSample(ray->mOriginObject, ray->mPdf, contribution)) 688 madeContrib = true; 689 sc += contribution; 690 } 691 692 sampleContributions += sc; 693 if (madeContrib) 694 ++ contributingSamples; 695 696 //leaf->mVssRays.push_back(ray); 690 697 } 691 698 } … … 1499 1506 << "Depth: " << data.mDepth << " (max: " << mTermMaxDepth << "), " 1500 1507 << "PVS: " << data.mPvs << " (min: " << mTermMinPvs << "), " 1501 << "Area: " << data.mArea << " (min: " << mTermMinArea << "), "1508 // << "Area: " << data.mArea << " (min: " << mTermMinArea << "), " 1502 1509 << "#rays: " << (int)data.mRays->size() << " (max: " << mTermMinRays << "), " 1503 1510 << "#pvs: " << leaf->GetViewCell()->GetPvs().GetSize() << "=, "
Note: See TracChangeset
for help on using the changeset viewer.