Index: /trunk/VUT/GtpVisibilityPreprocessor/scripts/default.env
===================================================================
--- /trunk/VUT/GtpVisibilityPreprocessor/scripts/default.env	(revision 600)
+++ /trunk/VUT/GtpVisibilityPreprocessor/scripts/default.env	(revision 601)
@@ -13,7 +13,7 @@
 #;../data/vienna/vienna-plane.x3d
 #	filename ../data/vienna/viewcells-25-sel.x3d
-	filename ../data/atlanta/atlanta2.x3d
+#	filename ../data/atlanta/atlanta2.x3d
 #	filename ../data/soda/soda.dat
-#	filename ../data/soda/soda5.dat
+	filename ../data/soda/soda5.dat
 }
 
@@ -25,5 +25,5 @@
 	type vss
 #	type rss
-	detectEmptyViewSpace false
+	detectEmptyViewSpace true
 }
 
@@ -36,5 +36,5 @@
 	loadInitialSamples  false
 	storeInitialSamples false
-	useViewSpaceBox false
+	useViewSpaceBox true
 #	testBeamSampling true
 }
@@ -176,10 +176,10 @@
 	# samples used for view cell construction
 	Construction {
-		samples 2000000
+		samples 1400000
 		samplesPerPass 500000
 	}
 
 	#number of active view cells
-	active 2048
+	active 256
 	maxStaticMemory	40
 
@@ -188,5 +188,5 @@
 
 	#type kdTree
-	#type vspKdTree
+	type vspKdTree
 	#type bspTree
 	type vspBspTree
@@ -213,5 +213,5 @@
 		useRaysForMerge false
 		refine false
-		compress false
+		compress true
 		merge true
 	}
@@ -288,5 +288,5 @@
 VspBspTree {
 	Construction {
-		samples 1000000
+		samples 800000
 		epsilon 0.005
 		randomize false
@@ -304,9 +304,9 @@
 	
 	# maximal candidates for split planes
-	maxPolyCandidates 200
+	maxPolyCandidates 250
 
 	
 	# maximal tested rays for split cost heuristics
-	maxTests 10000
+	maxTests 20000
 	
 	maxTotalMemory	50
@@ -322,14 +322,14 @@
 	Termination {
 		# parameters used for autopartition
-		minRays 		500
+		minRays 		20
 		minPolygons 		-1
-		maxDepth		25
+		maxDepth		40
 		minPvs 			-1
-		minProbability		0.0000001
-		maxRayContribution	0.3
-		maxCostRatio		0.9
+		minProbability		0.00000001
+		maxRayContribution	0.15
+		maxCostRatio		0.8
 		missTolerance		3
 		
-		maxViewCells		30000
+		maxViewCells		100000
 		
 		# used for pvs criterium
@@ -337,5 +337,5 @@
 		
 		AxisAligned {
-			minRays 		20000
+			minRays 		50000
 			maxRayContribution	9.9
 		}
Index: /trunk/VUT/GtpVisibilityPreprocessor/src/ViewCell.cpp
===================================================================
--- /trunk/VUT/GtpVisibilityPreprocessor/src/ViewCell.cpp	(revision 600)
+++ /trunk/VUT/GtpVisibilityPreprocessor/src/ViewCell.cpp	(revision 601)
@@ -44,9 +44,9 @@
 {
 	// clamp to minmax values
-	if (pvs < lower)
+	/*if (pvs < lower)
 		return (float)lower;
 	if (pvs > upper)
 		return (float)upper;
-
+*/
 	return (float)pvs;
 }
@@ -623,7 +623,7 @@
 				++ mergeStats.siblings;
 #endif
-			if (((mergeStats.merged % statsOut) == 0) || 
-				(realNumActiveViewCells == mMergeMinViewCells))
-			{
+		//	if (((mergeStats.merged % statsOut) == 0) || 
+		//		(realNumActiveViewCells == mMergeMinViewCells))
+		//	{
 				cout << "merged " << mergeStats.merged << " view cells" << endl;
 
@@ -635,10 +635,12 @@
 					<< "#TotalRenderCost\n" << totalRenderCost << endl
 					<< "#CurrentPvs\n" << mergedVc->GetPvs().GetSize() << endl
-					<< "#ExpectedCost\n" << realExpectedCost << endl
+					<< "#ExpectedCost\n" << realExpectedCost / (float) realNumActiveViewCells << endl
 					<< "#AvgRenderCost\n" << realAvgRenderCost << endl
 					<< "#Deviation\n" << mDeviation << endl
 					<< "#TotalPvs\n" << totalPvs << endl
-					<< "#PvsSizeDecrease\n" << -pvsDiff << endl;
-			}
+					<< "#PvsSizeDecrease\n" << -pvsDiff << endl
+					<<  "#Volume\n" << mergedVc->GetVolume() << endl
+					<< "#Dummy\n" << (float)mergedVc->GetPvs().GetSize() * mergedVc->GetVolume() / mViewCellsManager->GetViewSpaceBox().GetVolume() << endl;
+		//	}
 		}
 		else
Index: /trunk/VUT/GtpVisibilityPreprocessor/src/VspBspTree.cpp
===================================================================
--- /trunk/VUT/GtpVisibilityPreprocessor/src/VspBspTree.cpp	(revision 600)
+++ /trunk/VUT/GtpVisibilityPreprocessor/src/VspBspTree.cpp	(revision 601)
@@ -55,7 +55,7 @@
 
 
-/**********************************************************************/
-/*                  class VspBspTree implementation                   */
-/**********************************************************************/
+/******************************************************************************/
+/*                       class VspBspTree implementation                      */
+/******************************************************************************/
 
 
@@ -413,4 +413,7 @@
 	const float prop = mUseAreaForPvs ? geom->GetArea() : geom->GetVolume();
 
+	Debug << "herevol: " << geom->GetVolume() << endl;
+	Debug << "herevol:: " << mBox.GetVolume() << endl;
+
 	VspBspTraversalData tData(mRoot,
 							  new PolygonContainer(polys),
@@ -431,6 +434,14 @@
 	mTotalCost = tData.GetCost() / mBox.GetVolume();
 
+	Debug << "**volume** " << mBox.GetVolume() << endl;
+
+	mSplits = 0;
+	mSubdivisionStats 
+			<< "#Nodes\n" << ++ mSplits << endl
+			<< "#RenderCostDecrease\n0\n" << endl 
+			<< "#TotalRenderCost\n" << mTotalCost << endl;
+
 	Debug << "total cost: " << mTotalCost << endl;
-	mSplits = 0;
+	
 	
 	mBspStats.Start();
@@ -664,5 +675,5 @@
 	
 	// if geometry was not already computed
-	if (!frontData.mGeometry && !backData.mGeometry)
+	if (1)//!frontData.mGeometry && !backData.mGeometry)
 	{
 		frontData.mGeometry = new BspNodeGeometry();
@@ -682,6 +693,8 @@
 		else
 		{
+			//Debug << "here2" << endl;
 			frontData.mProbability = frontData.mGeometry->GetVolume();
-			backData.mProbability = backData.mGeometry->GetVolume();
+			backData.mProbability = tData.mProbability - frontData.mProbability;
+			//backData.mProbability = backData.mGeometry->GetVolume();
 		}
 	}
@@ -1328,5 +1341,11 @@
 		{
 			pFront = geomFront.GetVolume();
-			pBack = pOverall - geomFront.GetVolume();
+			//pBack = pOverall - geomFront.GetVolume();
+			pBack = geomBack.GetVolume();
+
+			/*Debug << "volume: " << data.mGeometry->GetVolume() << endl;
+			Debug << "volum1: " << geomFront.GetVolume() << endl;
+			Debug << "volum2: " << geomBack.GetVolume() << endl;
+			Debug << "sum_: " << geomFront.GetVolume() + geomBack.GetVolume() << endl;*/
 		}
 		else
Index: /trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.cpp
===================================================================
--- /trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.cpp	(revision 600)
+++ /trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.cpp	(revision 601)
@@ -189,5 +189,5 @@
 
 		// TODO: leak?
-		ComputeSampleContributions(constructionSamples, true, false);
+		if(0)ComputeSampleContributions(constructionSamples, true, false);
 		cout << "finished" << endl;
 
@@ -211,5 +211,5 @@
 	// store viewCells for postprocessing
 	const bool storeViewCells = true;
-	ComputeSampleContributions(postProcessSamples, true, storeViewCells);
+	if(0)ComputeSampleContributions(postProcessSamples, true, storeViewCells);
 	// merge the view cells
 	PostProcess(preprocessor->mObjects, postProcessSamples);
@@ -224,5 +224,5 @@
 					visualizationSamples);
 
-	ComputeSampleContributions(visualizationSamples, true, storeViewCells);
+	if(0)ComputeSampleContributions(visualizationSamples, true, storeViewCells);
 
 	//Debug << "visualizationsamples: " << mVisualizationSamples << " " << visualizationSamples.size() << endl;
@@ -2516,4 +2516,5 @@
 	cout << "Computing remaining ray contributions ... ";
 	// recast rest of rays
+	if (0)
 	ComputeSampleContributions(savedRays, true, false);
 	cout << "finished" << endl;
@@ -2696,5 +2697,5 @@
 
 	VssRayContainer postProcessRays;
-	GetRaySets(rays, mPostProcessSamples, postProcessRays);
+	if(0)GetRaySets(rays, mPostProcessSamples, postProcessRays);
 
 	Debug << "post processing using " << (int)postProcessRays.size() << " samples" << endl;
