Index: /trunk/VUT/GtpVisibilityPreprocessor/src/Preprocessor.cpp
===================================================================
--- /trunk/VUT/GtpVisibilityPreprocessor/src/Preprocessor.cpp	(revision 563)
+++ /trunk/VUT/GtpVisibilityPreprocessor/src/Preprocessor.cpp	(revision 567)
@@ -444,5 +444,4 @@
 	mViewCellsManager->GetViewPoint(origin);
 	
-	
 	// now get the direction
 	switch (sampleType) {
Index: /trunk/VUT/GtpVisibilityPreprocessor/src/RssTree.cpp
===================================================================
--- /trunk/VUT/GtpVisibilityPreprocessor/src/RssTree.cpp	(revision 563)
+++ /trunk/VUT/GtpVisibilityPreprocessor/src/RssTree.cpp	(revision 567)
@@ -2097,5 +2097,5 @@
   
   float extendedConvexCombinationProb = 0.0f; //0.7f
-  float silhouetteCheckPercentage = 0.0f; //0.5f
+  float silhouetteCheckPercentage = 1.0f; //0.5f
   for (int i=0; generated < numberOfRays && i < numberOfTries; i++) {
 	bool useExtendedConvexCombination = ((nrays >= 2) && (Random(1.0f) <
@@ -2178,5 +2178,5 @@
 		selectedRays.push_back(ray);
 	  }
-
+	  
 	  // check whether the ray does not intersect already visible objects
 	  Ray traversalRay;
@@ -2186,4 +2186,7 @@
 		  oi++) {
 		Intersectable *object = *oi;
+		// do not test every object
+		if (Random(1.0f) > 0.5f)
+		  break;
 		if ( object->CastRay(traversalRay) ) {
 		  intersects = true;
@@ -2322,5 +2325,5 @@
 				   )
 {
-  bool globalPrunning = false;
+  bool globalPrunning = true;
 
   stack<RssTreeNode *> tstack;
@@ -2369,5 +2372,5 @@
 	  if (node->IsLeaf()) {
 		RssTreeLeaf *leaf = (RssTreeLeaf *)node;
-		//		prunned += PruneRaysRandom(leaf, ratio);
+		// prunned += PruneRaysRandom(leaf, ratio);
 		prunned += PruneRaysContribution(leaf, ratio);
 	  } else {
@@ -2474,5 +2477,5 @@
 // if small very high importance of the last sample
 // if 1.0f then weighs = 1 1/2 1/3 1/4
-float passSampleWeightDecay = 0.5f;
+float passSampleWeightDecay = 1.0f;
 
 void
@@ -2503,5 +2506,5 @@
 	  break;
 	default:
-	  weight = 0.01f;
+	  weight = 0.0f;
 	  break;
 	  // 	case 1:
Index: /trunk/VUT/GtpVisibilityPreprocessor/src/RssPreprocessor.cpp
===================================================================
--- /trunk/VUT/GtpVisibilityPreprocessor/src/RssPreprocessor.cpp	(revision 563)
+++ /trunk/VUT/GtpVisibilityPreprocessor/src/RssPreprocessor.cpp	(revision 567)
@@ -64,5 +64,5 @@
 	  GenerateImportanceRays(mRssTree, number, rays);
 	  result = true;
-	  rays.NormalizePdf();
+	  //	  rays.NormalizePdf();
 	}
 	break;
@@ -214,17 +214,4 @@
 
 
-Vector3
-RssPreprocessor::GetViewpoint(AxisAlignedBox3 *viewSpaceBox)
-{
-  AxisAlignedBox3 box;
-	
-  if (viewSpaceBox)
-	box =*viewSpaceBox;
-  else 
-	box = mKdTree->GetBox();
-	
-  // shrink the box in the y direction
-  return box.GetRandomPoint();
-}
 
 
@@ -432,8 +419,6 @@
 {
 
-  //  connect(this, SIGNAL(EvalPvsStat()), renderer, SLOT(EvalPvsStat()) );
-  
   cout<<"Rss Preprocessor started\n"<<flush;
-  cout<<"Memory/ray "<<sizeof(VssRay)+sizeof(RssTreeNode::RayInfo)<<endl;
+  //  cout<<"Memory/ray "<<sizeof(VssRay)+sizeof(RssTreeNode::RayInfo)<<endl;
 
   Randomize(0);
@@ -566,6 +551,10 @@
 	if (mUseImportanceSampling) {
 	  VssRayContainer tmpVssRays;
-	  
-	  GenerateRays(mRssSamplesPerPass/2, RSS_BASED_DISTRIBUTION, rays);
+
+	  float ratios[] = {1.0f,0,0};
+
+	  
+	  
+	  GenerateRays(mRssSamplesPerPass*ratios[0], RSS_BASED_DISTRIBUTION, rays);
 	  CastRays(rays, tmpVssRays);
 	  castRays += rays.size();
@@ -576,27 +565,31 @@
 	  rays.clear();
 	  tmpVssRays.clear();
-	  
-	  GenerateRays(mRssSamplesPerPass/4, SPATIAL_BOX_BASED_DISTRIBUTION, rays);
-	  CastRays(rays, tmpVssRays);
-	  castRays += rays.size();
-	  float c2 = mViewCellsManager->ComputeSampleContributions(tmpVssRays, false);
-	  mStats<<"#SpatialRelContrib"<<endl<<c2/rays.size()<<endl;
-
-	  vssRays.insert(vssRays.end(), tmpVssRays.begin(), tmpVssRays.end() );
-	  
-	  rays.clear();
-	  tmpVssRays.clear();
-	  
-	  
-	  GenerateRays(mRssSamplesPerPass/4, DIRECTION_BASED_DISTRIBUTION, rays);
-	  CastRays(rays, tmpVssRays);
-	  castRays += rays.size();
-	  float c3 = mViewCellsManager->ComputeSampleContributions(tmpVssRays, false);
-	  mStats<<"#DirectionalRelContrib"<<endl<<c3/rays.size()<<endl;
-	  
-	  vssRays.insert(vssRays.end(), tmpVssRays.begin(), tmpVssRays.end() );
-	  
-	  rays.clear();
-	  tmpVssRays.clear();
+
+	  if (ratios[1]!=0.0f) {
+		GenerateRays(mRssSamplesPerPass*ratios[1], SPATIAL_BOX_BASED_DISTRIBUTION, rays);
+		CastRays(rays, tmpVssRays);
+		castRays += rays.size();
+		float c2 = mViewCellsManager->ComputeSampleContributions(tmpVssRays, false);
+		mStats<<"#SpatialRelContrib"<<endl<<c2/rays.size()<<endl;
+		
+		vssRays.insert(vssRays.end(), tmpVssRays.begin(), tmpVssRays.end() );
+		
+		rays.clear();
+		tmpVssRays.clear();
+	  }
+	  
+	  
+	  if (ratios[2]!=0.0f) {
+		GenerateRays(mRssSamplesPerPass*ratios[2], DIRECTION_BASED_DISTRIBUTION, rays);
+		CastRays(rays, tmpVssRays);
+		castRays += rays.size();
+		float c3 = mViewCellsManager->ComputeSampleContributions(tmpVssRays, false);
+		mStats<<"#DirectionalRelContrib"<<endl<<c3/rays.size()<<endl;
+		
+		vssRays.insert(vssRays.end(), tmpVssRays.begin(), tmpVssRays.end() );
+		
+		rays.clear();
+		tmpVssRays.clear();
+	  }
 	  
 	  // add contributions of all rays at once...
Index: /trunk/VUT/GtpVisibilityPreprocessor/src/default.env
===================================================================
--- /trunk/VUT/GtpVisibilityPreprocessor/src/default.env	(revision 563)
+++ /trunk/VUT/GtpVisibilityPreprocessor/src/default.env	(revision 567)
@@ -14,5 +14,5 @@
 # filename ../data/vienna/viewcells-25-sel.x3d
 # filename ../data/atlanta/atlanta2.x3d
-# filename ../data/soda/soda.dat
+#filename ../data/soda/soda.dat
 filename ../data/soda/soda5.dat
 }
@@ -25,5 +25,5 @@
 #	type vss
 	type rss
-	detectEmptyViewSpace false
+	detectEmptyViewSpace true
 	pvsRenderErrorSamples 10000
 
@@ -97,13 +97,13 @@
 RssTree {
 	epsilon		1e-6
-	perObjectTree false
+	perObjectTree true
 
 	maxDepth 	40
 	minPvs		1
-	minRays		100
+	minRays		50
 	minSize		0.001
  	maxCostRatio 1.0
 	maxRayContribution 0.5
-	maxRays		5000000
+	maxRays		2000000
 	maxTotalMemory	200
 	maxStaticMemory	100
@@ -118,9 +118,5 @@
     dirSplitDepth 0
 
-	numberOfEndPointDomains	10000
 	ct_div_ci	0.0
-	randomize	false
-
-	refDirBoxMaxSize	0.1
 }
 
@@ -204,6 +200,6 @@
 	}
 	
-#	filename ../data/soda/viewcells_soda5-2.xml
-	filename ../data/atlanta/viewcells_atlanta2.xml
+	filename ../data/soda/viewcells_soda5-2.xml
+#	filename ../data/atlanta/viewcells_atlanta2.xml
 #	filename ../data/atlanta/atlanta_viewcells_large.x3d
 #	filename ../data/vienna/viewcells-25-sel.x3d
Index: /trunk/VUT/GtpVisibilityPreprocessor/src/RssPreprocessor.h
===================================================================
--- /trunk/VUT/GtpVisibilityPreprocessor/src/RssPreprocessor.h	(revision 563)
+++ /trunk/VUT/GtpVisibilityPreprocessor/src/RssPreprocessor.h	(revision 567)
@@ -52,7 +52,4 @@
 
   virtual bool ComputeVisibility();
-
-  Vector3
-  GetViewpoint(AxisAlignedBox3 *viewSpaceBox);
 
 
Index: /trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.cpp
===================================================================
--- /trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.cpp	(revision 565)
+++ /trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.cpp	(revision 567)
@@ -189,4 +189,6 @@
   for (it = rays.begin(); it != it_end; ++ it) {
 	sum += ComputeSampleContributions(*(*it), addRays);
+	//ComputeSampleContributions(*(*it), addRays);
+	//	sum += (*it)->mPvsContribution;
   }
   return sum;
