- Timestamp:
- 12/05/05 04:42:54 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/RssPreprocessor.cpp
r447 r448 9 9 #include "VssRay.h" 10 10 #include "RssTree.h" 11 11 #include "ViewCellBsp.h" 12 12 13 13 static bool useViewSpaceBox = true;//true; … … 474 474 } 475 475 476 //-- construct BSP view cells477 if (ViewCell::sHierarchy == ViewCell::BSP)478 {479 const int bspSamples = min((int)mVssRays.size(), mBspConstructionSamples);480 481 Debug << "bpssamples: " << bspSamples << endl;482 for (int i = 0; i < bspSamples; ++ i)483 bspRays.push_back(new Ray(*mVssRays[i]));484 485 //-- construct BSP tree using the samples486 mBspTree = new BspTree(&mUnbounded);487 488 ObjectContainer objects;489 mSceneGraph->CollectObjects(&objects);490 mBspTree->Construct(objects, bspRays);491 }492 493 476 rssTree = new RssTree; 494 477 // viewcells = Construct(mVssRays); … … 567 550 } 568 551 569 // cast rays into BSP tree570 if (ViewCell::sHierarchy == ViewCell::BSP)571 {572 for (int i = 0; i < (int)vssRays.size(); ++ i)573 {574 CastRay(*mBspTree, *vssRays[i]);575 }576 }577 578 552 samples+=num; 579 553 float pvs = rssTree->GetAvgPvsSize(); … … 598 572 delete rssTree; 599 573 600 if (ViewCell::sHierarchy == ViewCell::BSP)601 {602 Debug << mBspTree->GetStatistics();603 604 ObjectContainer objects;605 ExportSplits(objects, bspRays, 10000);606 ExportBspPvs(objects, bspRays, 10000);607 608 BspViewCellsStatistics stat;609 mBspTree->EvaluateViewCellsStats(stat);610 Debug << "original view cell partition:\n" << stat << endl;611 612 // clear BSP samples613 CLEAR_CONTAINER(bspRays);614 }615 574 616 575 return true; … … 646 605 BspLeaf *leaf = ray.bspIntersections[j].mLeaf; 647 606 // if ray not in unbounded space 648 if (leaf->GetViewCell() != &mUnbounded)607 /* if (leaf->GetViewCell() != &mUnbounded) 649 608 contributingSamples += 650 leaf->GetViewCell()->GetPvs().AddSample(obj); 609 leaf->GetViewCell()->GetPvs().AddSample(obj);*/ 651 610 } 652 611 … … 657 616 BspLeaf *leaf = ray.bspIntersections[j].mLeaf; 658 617 659 if (leaf->GetViewCell() != &mUnbounded)618 /* if (leaf->GetViewCell() != &mUnbounded) 660 619 leaf->GetViewCell()-> 661 AddPassingRay(ray, contributingSamples ? 1 : 0); 620 AddPassingRay(ray, contributingSamples ? 1 : 0);*/ 662 621 } 663 622
Note: See TracChangeset
for help on using the changeset viewer.