- Timestamp:
- 12/14/05 19:38:39 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/VssPreprocessor.cpp
r465 r466 42 42 ) 43 43 { 44 ray. intersections.clear();44 ray.Clear(); 45 45 // do not store anything else then intersections at the ray 46 46 ray.Init(point, direction, Ray::LOCAL_RAY); … … 450 450 } 451 451 452 ObjectContainer objects; 453 mSceneGraph->CollectObjects(&objects); 452 mSceneGraph->CollectObjects(&mObjects); 454 453 455 454 // construct view cells 456 mViewCellsManager->Construct( objects, mVssRays, mViewSpaceBox);455 mViewCellsManager->Construct(mObjects, mVssRays, mViewSpaceBox); 457 456 458 457 vssTree = new VssTree; … … 509 508 num = GenerateImportanceRays(vssTree, num, rays); 510 509 } 511 510 512 511 for (int i=0; i < rays.size(); i++) 513 512 CastRay(rays[i].mOrigin, rays[i].mDirection, vssRays); … … 534 533 535 534 //-- prepare traversal rays for view cell intersections 536 RayContainer passRays;537 538 VssRayContainer::const_iterator it, it_end = vssRays.end();539 540 for (it = vssRays.begin(); it != it_end; ++ it)541 passRays.push_back(new Ray(*(*it)));542 543 int sampleContributions = 0;544 int contributingSamples = 0;545 546 535 /// compute view cell contribution of rays 547 /* mViewCellsManager->ComputeSampleContributions(passRays, 548 sampleContributions, 549 contributingSamples); 550 551 //-- save rays for post processing 552 if (((int)storedRays.size() < mViewCellsManager->GetPostProcessSamples()) || 553 ((int)storedRays.size() < mViewCellsManager->GetVisualizationSamples())) 554 { 555 RayContainer::const_iterator it, it_end = passRays.end(); 556 557 for (it = passRays.begin(); it != it_end; ++ it) 558 storedRays.push_back(new Ray(*(*it))); 559 } 560 else 561 { 562 CLEAR_CONTAINER(passRays); 563 } 564 */ 536 mViewCellsManager->ComputeSampleContributions(vssRays); 537 565 538 samples+=num; 566 539 float pvs = vssTree->GetAvgPvsSize(); 567 540 cout<<"*****************************\n"; 568 541 cout<<samples<<" avgPVS ="<<pvs<<endl; 569 cout<<"sample contributions ="<<sampleContributions<<endl;570 cout<<"contributing sample ="<<contributingSamples<<endl;571 542 cout<<"VssTree root PVS size = "<<vssTree->GetRootPvsSize()<<endl; 572 543 cout<<"*****************************\n"; … … 576 547 } 577 548 578 cout << "here" << endl; 579 //-- post process view cells 580 mViewCellsManager->PostProcess(objects, storedRays); 581 582 //-- several visualizations and statistics 583 mViewCellsManager->PrintStatistics(Debug); 549 { 550 VssRayContainer storedRays; 551 vssTree->CollectRays(storedRays, Max( 552 mViewCellsManager->GetPostProcessSamples(), 553 mViewCellsManager->GetVisualizationSamples())); 554 555 //-- post process view cells 556 mViewCellsManager->PostProcess(mObjects, storedRays); 557 558 //-- several visualizations and statistics 559 mViewCellsManager->PrintStatistics(Debug); 560 561 mViewCellsManager->Visualize(mObjects, storedRays); 562 563 CLEAR_CONTAINER(storedRays); 564 } 584 565 585 566 //-- render simulation after merge 586 567 cout << "\nevaluating bsp view cells render time after merge ... "; 587 568 588 569 const SimulationStatistics ss = mViewCellsManager->SimulateRendering(); 589 570 590 571 cout << " finished" << endl; 591 572 cout << ss << endl; 592 573 Debug << ss << endl; 593 594 mViewCellsManager->Visualize(objects, storedRays); 595 596 CLEAR_CONTAINER(storedRays); 574 597 575 598 576 delete vssTree; 599 577 600 578 return true; 601 579 }
Note: See TracChangeset
for help on using the changeset viewer.