source: trunk/VUT/GtpVisibilityPreprocessor/src/RssPreprocessor.cpp @ 572

Revision 572, 18.6 KB checked in by bittner, 18 years ago (diff)

gl render error estimation changes for backface culling empty viewspace detection

Line 
1#include "SceneGraph.h"
2#include "KdTree.h"
3#include "RssPreprocessor.h"
4#include "X3dExporter.h"
5#include "Environment.h"
6#include "MutualVisibility.h"
7#include "Polygon3.h"
8#include "ViewCell.h"
9#include "VssRay.h"
10#include "RssTree.h"
11#include "ViewCellsManager.h"
12#include "RenderSimulator.h"
13#include "GlRenderer.h"
14
15static bool useViewSpaceBox = false;
16static bool use2dSampling = false;
17
18
19// not supported anymore!
20static bool fromBoxVisibility = false;
21
22
23RssPreprocessor::RssPreprocessor():
24  mPass(0),
25  mVssRays()
26{
27  // this should increase coherence of the samples
28  environment->GetIntValue("RssPreprocessor.samplesPerPass", mSamplesPerPass);
29  environment->GetIntValue("RssPreprocessor.initialSamples", mInitialSamples);
30  environment->GetIntValue("RssPreprocessor.vssSamples", mRssSamples);
31  environment->GetIntValue("RssPreprocessor.vssSamplesPerPass", mRssSamplesPerPass);
32  environment->GetBoolValue("RssPreprocessor.useImportanceSampling", mUseImportanceSampling);
33
34  environment->GetBoolValue("RssPreprocessor.Export.pvs", mExportPvs);
35  environment->GetBoolValue("RssPreprocessor.Export.rssTree", mExportRssTree);
36  environment->GetBoolValue("RssPreprocessor.Export.rays", mExportRays);
37  environment->GetIntValue("RssPreprocessor.Export.numRays", mExportNumRays);
38  environment->GetBoolValue("RssPreprocessor.useViewcells", mUseViewcells);
39  environment->GetBoolValue("RssPreprocessor.objectBasedSampling", mObjectBasedSampling);
40  environment->GetBoolValue("RssPreprocessor.directionalSampling", mDirectionalSampling);
41
42  environment->GetBoolValue("RssPreprocessor.loadInitialSamples", mLoadInitialSamples);
43  environment->GetBoolValue("RssPreprocessor.storeInitialSamples", mStoreInitialSamples);
44  environment->GetBoolValue("RssPreprocessor.updateSubdivision", mUpdateSubdivision);
45 
46  mStats.open("stats.log");
47  mRssTree = NULL;
48}
49
50
51bool
52RssPreprocessor::GenerateRays(
53                                                          const int number,
54                                                          const int sampleType,
55                                                          SimpleRayContainer &rays
56                                                          )
57{
58  bool result = false;
59
60  switch (sampleType) {
61  case RSS_BASED_DISTRIBUTION:
62  case RSS_SILHOUETTE_BASED_DISTRIBUTION:
63        if (mRssTree) {
64          GenerateImportanceRays(mRssTree, number, rays);
65          result = true;
66          //      rays.NormalizePdf();
67        }
68        break;
69  default:
70        result = Preprocessor::GenerateRays(number, sampleType, rays);
71  }
72
73  return result;
74}
75
76void
77RssPreprocessor::CastRays(
78                                                  SimpleRayContainer &rays,
79                                                  VssRayContainer &vssRays
80                                                  )
81{
82  for (int i=0; i < rays.size(); i++)
83        CastRay(rays[i].mOrigin, rays[i].mDirection, rays[i].mPdf, vssRays);
84}
85
86
87RssPreprocessor::~RssPreprocessor()
88{
89  // mVssRays get deleted in the tree
90  //  CLEAR_CONTAINER(mVssRays);
91}
92
93void
94RssPreprocessor::SetupRay(Ray &ray,
95                                                  const Vector3 &point,
96                                                  const Vector3 &direction
97                                                  )
98{
99  ray.intersections.clear();
100  // do not store anything else then intersections at the ray
101  ray.Init(point, direction, Ray::LOCAL_RAY);
102}
103
104int
105RssPreprocessor::CastRay(
106                                                 Vector3 &viewPoint,
107                                                 Vector3 &direction,
108                                                 const float probability,
109                                                 VssRayContainer &vssRays
110                                                 )
111{
112  int hits = 0;
113  static Ray ray;
114  AxisAlignedBox3 box = mKdTree->GetBox();
115
116  AxisAlignedBox3 sbox = box;
117  sbox.Enlarge(Vector3(-Limits::Small));
118  if (!sbox.IsInside(viewPoint))
119        return 0;
120       
121  SetupRay(ray, viewPoint, direction);
122
123  if (!mDetectEmptyViewSpace)
124        ray.mFlags &= ~Ray::CULL_BACKFACES;
125  else
126        ray.mFlags |= Ray::CULL_BACKFACES;
127
128
129  // cast ray to KD tree to find intersection with other objects
130  Intersectable *objectA, *objectB;
131  Vector3 pointA, pointB;
132  float bsize = Magnitude(box.Size());
133
134 
135  if (mKdTree->CastRay(ray)) {
136        objectA = ray.intersections[0].mObject;
137        pointA = ray.Extrap(ray.intersections[0].mT);
138  } else {
139        objectA = NULL;
140        // compute intersection with the scene bounding box
141        float tmin, tmax;
142        if (box.ComputeMinMaxT(ray, &tmin, &tmax) && tmin < tmax)
143          pointA = ray.Extrap(tmax);
144        else
145          return 0;
146  }
147
148
149  if (mDetectEmptyViewSpace) {
150        SetupRay(ray, pointA, -direction);
151  } else
152        SetupRay(ray, viewPoint, -direction);
153       
154  if (!mDetectEmptyViewSpace)
155        ray.mFlags &= ~Ray::CULL_BACKFACES;
156  else
157        ray.mFlags |= Ray::CULL_BACKFACES;
158
159  if (mKdTree->CastRay(ray)) {
160        objectB = ray.intersections[0].mObject;
161        pointB = ray.Extrap(ray.intersections[0].mT);
162  } else {
163        objectB = NULL;
164        float tmin, tmax;
165        if (box.ComputeMinMaxT(ray, &tmin, &tmax) && tmin < tmax)
166          pointB = ray.Extrap(tmax);
167        else
168          return 0;
169  }
170
171  //  if (objectA == NULL && objectB != NULL) {
172  if (mDetectEmptyViewSpace) {
173        // cast again to ensure that there is no objectA
174        SetupRay(ray, pointB, direction);
175        ray.mFlags |= Ray::CULL_BACKFACES;
176        if (mKdTree->CastRay(ray)) {
177          objectA = ray.intersections[0].mObject;
178          pointA = ray.Extrap(ray.intersections[0].mT);
179        }
180  }
181 
182 
183  VssRay *vssRay  = NULL;
184
185  bool validSample = (objectA != objectB);
186  if (validSample) {
187        if (objectA) {
188          vssRay = new VssRay(pointB,
189                                                  pointA,
190                                                  objectB,
191                                                  objectA,
192                                                  mPass,
193                                                  probability
194                                                  );
195          vssRays.push_back(vssRay);
196          hits ++;
197        }
198       
199        if (objectB) {
200          vssRay = new VssRay(pointA,
201                                                  pointB,
202                                                  objectA,
203                                                  objectB,
204                                                  mPass,
205                                                  probability
206                                                  );
207          vssRays.push_back(vssRay);
208          hits ++;
209        }
210  }
211       
212  return hits;
213}
214
215
216
217
218int
219RssPreprocessor::GenerateImportanceRays(RssTree *rssTree,
220                                                                                const int desiredSamples,
221                                                                                SimpleRayContainer &rays
222                                                                                )
223{
224  int num;
225
226  rssTree->UpdateTreeStatistics();
227
228  cout<<
229        "#RSS_AVG_PVS_SIZE\n"<<rssTree->stat.avgPvsSize<<endl<<
230        "#RSS_AVG_RAYS\n"<<rssTree->stat.avgRays<<endl<<
231        "#RSS_AVG_RAY_CONTRIB\n"<<rssTree->stat.avgRayContribution<<endl<<
232        "#RSS_AVG_PVS_ENTROPY\n"<<rssTree->stat.avgPvsEntropy<<endl<<
233        "#RSS_AVG_RAY_LENGTH_ENTROPY\n"<<rssTree->stat.avgRayLengthEntropy<<endl<<
234        "#RSS_AVG_IMPORTANCE\n"<<rssTree->stat.avgImportance<<endl;
235 
236  if (0) {
237        float p = desiredSamples/(float)(rssTree->stat.avgRayContribution*rssTree->stat.Leaves());
238        num = rssTree->GenerateRays(p, rays);
239  } else {
240        int leaves = rssTree->stat.Leaves()/1;
241        num = rssTree->GenerateRays(desiredSamples, leaves, rays);
242  }
243       
244       
245  return num;
246}
247
248
249bool
250RssPreprocessor::ExportRays(const char *filename,
251                                                        const VssRayContainer &vssRays,
252                                                        const int number
253                                                        )
254{
255  cout<<"Exporting vss rays..."<<endl<<flush;
256       
257  Exporter *exporter = NULL;
258  exporter = Exporter::GetExporter(filename);
259  //    exporter->SetWireframe();
260  //    exporter->ExportKdTree(*mKdTree);
261  exporter->SetFilled();
262  // $$JB temporarily do not export the scene
263  if (0)
264        exporter->ExportScene(mSceneGraph->mRoot);
265  exporter->SetWireframe();
266
267  if (mViewSpaceBox) {
268        exporter->SetForcedMaterial(RgbColor(1,0,1));
269        exporter->ExportBox(*mViewSpaceBox);
270        exporter->ResetForcedMaterial();
271  }
272       
273  VssRayContainer rays;
274 
275  vssRays.SelectRays( number, rays);
276
277  exporter->ExportRays(rays, RgbColor(1, 0, 0));
278       
279  delete exporter;
280
281  cout<<"done."<<endl<<flush;
282
283  return true;
284}
285
286
287bool
288RssPreprocessor::ExportRssTree(char *filename,
289                                                           RssTree *tree,
290                                                           const Vector3 &dir
291                                                           )
292{
293  Exporter *exporter = Exporter::GetExporter(filename);
294  exporter->SetFilled();
295  exporter->ExportScene(mSceneGraph->mRoot);
296  //  exporter->SetWireframe();
297  bool result = exporter->ExportRssTree2( *tree, dir );
298  delete exporter;
299  return result;
300}
301
302bool
303RssPreprocessor::ExportRssTreeLeaf(char *filename,
304                                                                   RssTree *tree,
305                                                                   RssTreeLeaf *leaf)
306{
307  Exporter *exporter = NULL;
308  exporter = Exporter::GetExporter(filename);
309  exporter->SetWireframe();
310  exporter->ExportKdTree(*mKdTree);
311       
312  if (mViewSpaceBox) {
313        exporter->SetForcedMaterial(RgbColor(1,0,0));
314        exporter->ExportBox(*mViewSpaceBox);
315        exporter->ResetForcedMaterial();
316  }
317       
318  exporter->SetForcedMaterial(RgbColor(0,0,1));
319  exporter->ExportBox(tree->GetBBox(leaf));
320  exporter->ResetForcedMaterial();
321       
322  VssRayContainer rays[4];
323  for (int i=0; i < leaf->rays.size(); i++) {
324        int k = leaf->rays[i].GetRayClass();
325        rays[k].push_back(leaf->rays[i].mRay);
326  }
327       
328  // SOURCE RAY
329  exporter->ExportRays(rays[0], RgbColor(1, 0, 0));
330  // TERMINATION RAY
331  exporter->ExportRays(rays[1], RgbColor(1, 1, 1));
332  // PASSING_RAY
333  exporter->ExportRays(rays[2], RgbColor(1, 1, 0));
334  // CONTAINED_RAY
335  exporter->ExportRays(rays[3], RgbColor(0, 0, 1));
336
337  delete exporter;
338  return true;
339}
340
341void
342RssPreprocessor::ExportRssTreeLeaves(RssTree *tree, const int number)
343{
344  vector<RssTreeLeaf *> leaves;
345  tree->CollectLeaves(leaves);
346
347  int num = 0;
348  int i;
349  float p = number / (float)leaves.size();
350  for (i=0; i < leaves.size(); i++) {
351        if (RandomValue(0,1) < p) {
352          char filename[64];
353          sprintf(filename, "rss-leaf-%04d.x3d", num);
354          ExportRssTreeLeaf(filename, tree, leaves[i]);
355          num++;
356        }
357        if (num >= number)
358          break;
359  }
360}
361
362
363float
364RssPreprocessor::GetAvgPvsSize(RssTree *tree,
365                                                           const vector<AxisAlignedBox3> &viewcells
366                                                           )
367{
368  vector<AxisAlignedBox3>::const_iterator it, it_end = viewcells.end();
369
370  int sum = 0;
371  for (it = viewcells.begin(); it != it_end; ++ it)
372        sum += tree->GetPvsSize(*it);
373       
374  return sum/(float)viewcells.size();
375}
376
377
378void
379RssPreprocessor::ExportPvs(char *filename,
380                                                   RssTree *rssTree
381                                                   )
382{
383  ObjectContainer pvs;
384  if (rssTree->CollectRootPvs(pvs)) {
385        Exporter *exporter = Exporter::GetExporter(filename);
386        exporter->SetFilled();
387        exporter->ExportGeometry(pvs);
388        exporter->SetWireframe();
389        exporter->ExportBox(rssTree->bbox);
390        exporter->ExportViewpoint(rssTree->bbox.Center(), Vector3(1,0,0));
391        delete exporter;
392  }
393}
394
395
396void
397RssPreprocessor::ComputeRenderError()
398{
399  // compute rendering error
400  if (renderer) {
401        //      emit EvalPvsStat();
402        //      QMutex mutex;
403        //      mutex.lock();
404        //      renderer->mRenderingFinished.wait(&mutex);
405        //      mutex.unlock();
406
407        renderer->EvalPvsStat();
408        mStats <<
409          "#AvgPvsRenderError\n" <<renderer->mPvsStat.GetAvgError()<<endl<<
410          "#MaxPvsRenderError\n" <<renderer->mPvsStat.GetMaxError()<<endl<<
411          "#ErrorFreeFrames\n" <<renderer->mPvsStat.GetErrorFreeFrames()<<endl;
412  }
413}
414
415
416
417bool
418RssPreprocessor::ComputeVisibility()
419{
420
421  cout<<"Rss Preprocessor started\n"<<flush;
422  //  cout<<"Memory/ray "<<sizeof(VssRay)+sizeof(RssTreeNode::RayInfo)<<endl;
423
424  Randomize(0);
425 
426       
427  long startTime = GetTime();
428 
429  int totalSamples = 0;
430
431  mViewSpaceBox = NULL;
432  mViewCellsManager->SetViewSpaceBox(mKdTree->GetBox());
433 
434 
435  //-- load view cells from file if requested
436  if (mLoadViewCells) {
437        // load now because otherwise bounding box not correct
438        mViewCellsManager->LoadViewCells(mViewCellsFilename, &mObjects);
439        // $$JB tmp make all viewcelss valid
440        mViewCellsManager->SetValidity(0, 9999999999);
441
442  }
443 
444  int rssPass = 0;
445  int rssSamples = 0;
446 
447  if (mLoadInitialSamples) {
448        cout << "Loading samples from file ... ";
449        LoadSamples(mVssRays, mObjects);
450        cout << "finished\n" << endl;
451  } else {
452        SimpleRayContainer rays;
453
454        GenerateRays(mInitialSamples, SPATIAL_BOX_BASED_DISTRIBUTION, rays);
455       
456        CastRays(rays, mVssRays);
457  }
458 
459  cout << "#totalRayStackSize=" << (int)mVssRays.size() << endl <<flush;
460 
461  rssSamples += (int)mVssRays.size();
462  totalSamples += mInitialSamples;
463  mPass++;
464 
465  if (mExportRays) {
466        char filename[64];
467        sprintf(filename, "rss-rays-initial.x3d");
468        ExportRays(filename, mVssRays, mExportNumRays);
469  }
470 
471  if (mStoreInitialSamples) {
472        cout << "Writing samples to file ... ";
473        ExportSamples(mVssRays);
474        cout << "finished\n" << endl;
475  }
476       
477  if (mUseViewcells) {
478        // construct view cells
479        if (!mLoadViewCells)
480          mViewCellsManager->Construct(mObjects, mVssRays);
481
482       
483
484        // evaluate contributions of the intitial rays
485        mViewCellsManager->ComputeSampleContributions(mVssRays);
486       
487       
488        mStats <<
489          "#Pass\n" <<mPass<<endl<<
490          "#RssPass\n" <<rssPass<<endl<<
491          "#Time\n" << TimeDiff(startTime, GetTime())*1e-3<<endl<<
492          "#TotalSamples\n" <<totalSamples<<endl<<
493          "#RssSamples\n" <<rssSamples<<endl;
494
495        {
496          VssRayContainer contributingRays;
497          mVssRays.GetContributingRays(contributingRays, mPass);
498          mStats<<"#NUM_CONTRIBUTING_RAYS\n"<<(int)contributingRays.size()<<endl;
499        }
500       
501        mVssRays.PrintStatistics(mStats);
502        mViewCellsManager->PrintPvsStatistics(mStats);
503         
504        VssRayContainer selectedRays;
505        int desired = Max(
506                                          mViewCellsManager->GetPostProcessSamples(),
507                                          mViewCellsManager->GetVisualizationSamples());
508       
509        mVssRays.SelectRays(desired, selectedRays);
510         
511        //-- post process view cells
512        mViewCellsManager->PostProcess(mObjects, selectedRays);
513         
514        //-- several visualizations and statistics
515        Debug << "view cells after post processing: " << endl;
516        mViewCellsManager->PrintStatistics(Debug);
517       
518        if (1)
519          mViewCellsManager->Visualize(mObjects, selectedRays);
520
521        // viewcells->UpdatePVS(newVssRays);
522        Debug<<"Valid viewcells before set validity: "<<mViewCellsManager->CountValidViewcells()<<endl;
523        // cull viewcells with PVS > median (0.5f)
524        mViewCellsManager->SetValidityPercentage(0, 0.5f);
525        Debug<<"Valid viewcells after set validity: "<<mViewCellsManager->CountValidViewcells()<<endl;
526       
527        ComputeRenderError();
528  }
529 
530  rssPass++;
531 
532  mRssTree = new RssTree;
533  mRssTree->SetPass(mPass);
534 
535  /// compute view cell contribution of rays if view cells manager already constructed
536  mViewCellsManager->ComputeSampleContributions(mVssRays);
537
538  if (mUseImportanceSampling) {
539       
540        mRssTree->Construct(mObjects, mVssRays);
541       
542        mRssTree->stat.Print(mStats);
543        cout<<"RssTree root PVS size = "<<mRssTree->GetRootPvsSize()<<endl;
544       
545        if (mExportRssTree) {
546          ExportRssTree("rss-tree-100.x3d", mRssTree, Vector3(1,0,0));
547          ExportRssTree("rss-tree-001.x3d", mRssTree, Vector3(0,0,1));
548          ExportRssTree("rss-tree-101.x3d", mRssTree, Vector3(1,0,1));
549          ExportRssTree("rss-tree-101m.x3d", mRssTree, Vector3(-1,0,-1));
550          ExportRssTreeLeaves(mRssTree, 10);
551        }
552       
553        if (mExportPvs) {
554          ExportPvs("rss-pvs-initial.x3d", mRssTree);
555        }
556  }
557 
558 
559  while (1) {
560        SimpleRayContainer rays;
561        VssRayContainer vssRays;
562        int castRays = 0;
563        if (mUseImportanceSampling) {
564          VssRayContainer tmpVssRays;
565
566          float ratios[] = {1.0f,0,0};
567
568         
569         
570          GenerateRays(mRssSamplesPerPass*ratios[0], RSS_BASED_DISTRIBUTION, rays);
571          CastRays(rays, tmpVssRays);
572          castRays += rays.size();
573          float c1 = mViewCellsManager->ComputeSampleContributions(tmpVssRays, false);
574          mStats<<"#RssRelContrib"<<endl<<c1/rays.size()<<endl;
575
576          vssRays.insert(vssRays.end(), tmpVssRays.begin(), tmpVssRays.end() );
577          rays.clear();
578          tmpVssRays.clear();
579
580          if (ratios[1]!=0.0f) {
581                GenerateRays(mRssSamplesPerPass*ratios[1], SPATIAL_BOX_BASED_DISTRIBUTION, rays);
582                CastRays(rays, tmpVssRays);
583                castRays += rays.size();
584                float c2 = mViewCellsManager->ComputeSampleContributions(tmpVssRays, false);
585                mStats<<"#SpatialRelContrib"<<endl<<c2/rays.size()<<endl;
586               
587                vssRays.insert(vssRays.end(), tmpVssRays.begin(), tmpVssRays.end() );
588               
589                rays.clear();
590                tmpVssRays.clear();
591          }
592         
593         
594          if (ratios[2]!=0.0f) {
595                GenerateRays(mRssSamplesPerPass*ratios[2], DIRECTION_BASED_DISTRIBUTION, rays);
596                CastRays(rays, tmpVssRays);
597                castRays += rays.size();
598                float c3 = mViewCellsManager->ComputeSampleContributions(tmpVssRays, false);
599                mStats<<"#DirectionalRelContrib"<<endl<<c3/rays.size()<<endl;
600               
601                vssRays.insert(vssRays.end(), tmpVssRays.begin(), tmpVssRays.end() );
602               
603                rays.clear();
604                tmpVssRays.clear();
605          }
606         
607          // add contributions of all rays at once...
608          mViewCellsManager->AddSampleContributions(vssRays);
609         
610        }
611        else {
612          int rayType = SPATIAL_BOX_BASED_DISTRIBUTION;
613          if (mObjectBasedSampling)
614                rayType = OBJECT_BASED_DISTRIBUTION;
615          else
616                if (mDirectionalSampling)
617                  rayType = DIRECTION_BASED_DISTRIBUTION;
618         
619          GenerateRays(mRssSamplesPerPass, rayType, rays);
620          CastRays(rays, vssRays);
621          castRays += rays.size();
622          if (mUseViewcells) {
623                /// compute view cell contribution of rays
624                mViewCellsManager->ComputeSampleContributions(vssRays);
625          }
626               
627         
628        }
629        totalSamples += castRays;
630        rssSamples += (int)vssRays.size();
631
632        cout<<"Generated "<<castRays<<" rays, progress "<<totalSamples/((float) mRssSamples +
633                                                                                                                                        mInitialSamples)<<"%\n";
634       
635       
636        mStats <<
637          "#Pass\n" <<mPass<<endl<<
638          "#RssPass\n" <<rssPass<<endl<<
639          "#Time\n" << TimeDiff(startTime, GetTime())*1e-3<<endl<<
640          "#TotalSamples\n" <<totalSamples<<endl<<
641          "#RssSamples\n" <<rssSamples<<endl;
642
643
644        if (mUseViewcells) {
645          vssRays.PrintStatistics(mStats);
646          mViewCellsManager->PrintPvsStatistics(mStats);
647        }
648
649
650        ComputeRenderError();
651       
652        // epxort rays before adding them to the tree -> some of them can be deleted
653
654        if (mExportRays) {
655          char filename[64];
656          if (mUseImportanceSampling)
657                sprintf(filename, "rss-rays-i%04d.x3d", rssPass);
658          else
659                sprintf(filename, "rss-rays-%04d.x3d", rssPass);
660         
661          ExportRays(filename, vssRays, mExportNumRays);
662
663          // now export all contributing rays
664          VssRayContainer contributingRays;
665          vssRays.GetContributingRays(contributingRays, mPass);
666          mStats<<"#NUM_CONTRIBUTING_RAYS\n"<<(int)contributingRays.size()<<endl;
667          sprintf(filename, "rss-crays-%04d.x3d", rssPass);
668          ExportRays(filename, contributingRays, mExportNumRays);
669        }
670
671       
672        // add rays to the tree after the viewcells have been cast to have their contributions
673        // already when adding into the tree
674        // do not add those rays which have too low or no contribution....
675       
676        if (mUseImportanceSampling) {
677          mRssTree->AddRays(vssRays);
678         
679          if (mUpdateSubdivision) {
680                int updatePasses = 1;
681                if (mPass % updatePasses == 0) {
682                  int subdivided = mRssTree->UpdateSubdivision();
683                  cout<<"subdivided leafs = "<<subdivided<<endl;
684                  cout<<"#total leaves = "<<mRssTree->stat.Leaves()<<endl;
685                }
686          }
687        }
688       
689        if (mExportPvs) {
690          char filename[64];
691          sprintf(filename, "rss-pvs-%04d.x3d", rssPass);
692          ExportPvs(filename, mRssTree);
693        }
694       
695       
696        if (!mUseImportanceSampling)
697          CLEAR_CONTAINER(vssRays);
698        // otherwise the rays get deleted by the rss tree update according to RssTree.maxRays ....
699
700        if (totalSamples >= mRssSamples + mInitialSamples)
701          break;
702
703       
704        rssPass++;
705        mPass++;
706        mRssTree->SetPass(mPass);
707  }
708 
709  if (mUseViewcells) {
710
711       
712        //-- render simulation after merge
713        cout << "\nevaluating bsp view cells render time after merge ... ";
714       
715        mRenderSimulator->RenderScene();
716        SimulationStatistics ss;
717        mRenderSimulator->GetStatistics(ss);
718       
719        cout << " finished" << endl;
720        cout << ss << endl;
721        Debug << ss << endl;
722       
723  }
724 
725  Debug<<"Deleting RSS tree...\n";
726  delete mRssTree;
727  Debug<<"Done.\n";
728
729 
730  return true;
731}
732
Note: See TracBrowser for help on using the repository browser.