Index: GTP/trunk/Lib/Vis/Preprocessing/scripts/gi_final.sh
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/scripts/gi_final.sh	(revision 2228)
+++ GTP/trunk/Lib/Vis/Preprocessing/scripts/gi_final.sh	(revision 2228)
@@ -0,0 +1,121 @@
+#!/bin/sh
+
+# add bin to path
+export PATH=../bin:$PATH
+
+#TARGET=debug
+TARGET=release
+
+PROGRAM=../bin/$TARGET/Preprocessor.exe
+
+SCENE=vienna_cropped.obj
+SCENE_PATH=../data/vienna
+
+#SCENE=arena-high-lods.obj
+#SCENE_PATH=../data/Arena
+
+ENVIRONMENT=gi_final.env
+
+LOG_PREFIX=../scripts/tests/gi/$SCENE
+#LOG_PREFIX=../scripts/tests/gi/vienna_cropped3
+
+echo "starting $TARGET mode for $SCENE scene ($PROGRAM)"
+
+
+##################################################################################
+
+USE_HEUR=true
+ METHOD=int-$USE_HEUR
+ echo "$SCENE $METHOD"
+
+
+#$PROGRAM $ENVIRONMENT \
+#-scene_filename=$SCENE_PATH/$SCENE \
+#  -view_cells_sampling_type=box \
+#  -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \
+#  -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \
+#  -view_cells_filename=$LOG_PREFIX-$METHOD-viewcells.xml.gz \
+#  -vsp_subdivision_stats=$LOG_PREFIX-$METHOD-vsp-subdivisionStats.log \
+#  -bvh_subdivision_stats=$LOG_PREFIX-$METHOD-bvh-subdivisionStats.log \
+#  -hierarchy_subdivision_stats=$LOG_PREFIX-$METHOD-hierarchy-subdivisionStats.log \
+ # -hierarchy_construction_type=2 \
+#  -hierarchy_construction_consider_memory=true \
+#  -bvh_use_sah=false \
+#  -vsp_use_cost_heuristics=$USE_HEUR
+
+#sh movefiles.sh $LOG_PREFIX-$METHOD
+
+#######################################################
+
+USE_HEUR=true
+ METHOD=int
+ echo "$SCENE $METHOD"
+
+
+$PROGRAM $ENVIRONMENT \
+  -scene_filename=$SCENE_PATH/$SCENE \
+  -view_cells_sampling_type=object_directional \
+  -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \
+  -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \
+  -view_cells_filename=$LOG_PREFIX-$METHOD-viewcells.xml.gz \
+  -vsp_subdivision_stats=$LOG_PREFIX-$METHOD-vsp-subdivisionStats.log \
+  -bvh_subdivision_stats=$LOG_PREFIX-$METHOD-bvh-subdivisionStats.log \
+  -hierarchy_subdivision_stats=$LOG_PREFIX-$METHOD-hierarchy-subdivisionStats.log \
+  -hierarchy_construction_type=2 \
+  -hierarchy_construction_min_avg_rays_per_object=1 \
+  -hierarchy_construction_max_avg_rays_per_object=20 \
+  -bvh_use_sah=false \
+  -vsp_use_cost_heuristics=$USE_HEUR
+
+sh movefiles.sh $LOG_PREFIX-$METHOD
+
+
+
+#######################################################
+
+NODES=50000
+USE_HEUR=true
+#USE_HEUR=false
+  
+METHOD=seq-$NODES
+echo "$SCENE $METHOD"
+
+$PROGRAM $ENVIRONMENT \
+-scene_filename=$SCENE_PATH/$SCENE \
+  -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \
+  -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \
+  -view_cells_filename=$LOG_PREFIX-$METHOD-viewcells.xml.gz \
+  -vsp_subdivision_stats=$LOG_PREFIX-$METHOD-vsp-subdivisionStats.log \
+  -bvh_subdivision_stats=$LOG_PREFIX-$METHOD-bvh-subdivisionStats.log \
+  -hierarchy_subdivision_stats=$LOG_PREFIX-$METHOD-hierarchy-subdivisionStats.log \
+  -hierarchy_construction_type=0 \
+  -vsp_use_cost_heuristics=$USE_HEUR \
+  -bvh_term_max_leaves=$NODES
+
+sh movefiles.sh $LOG_PREFIX-$METHOD
+
+
+#######################################################
+
+NODES=10000
+USE_HEUR=true
+#USE_HEUR=false
+  
+METHOD=seq-$NODES
+echo "$SCENE $METHOD"
+
+$PROGRAM $ENVIRONMENT \
+-scene_filename=$SCENE_PATH/$SCENE \
+  -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \
+  -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \
+  -view_cells_filename=$LOG_PREFIX-$METHOD-viewcells.xml.gz \
+  -vsp_subdivision_stats=$LOG_PREFIX-$METHOD-vsp-subdivisionStats.log \
+  -bvh_subdivision_stats=$LOG_PREFIX-$METHOD-bvh-subdivisionStats.log \
+  -hierarchy_subdivision_stats=$LOG_PREFIX-$METHOD-hierarchy-subdivisionStats.log \
+  -hierarchy_construction_type=0 \
+  -vsp_use_cost_heuristics=$USE_HEUR \
+  -bvh_term_max_leaves=$NODES
+
+sh movefiles.sh $LOG_PREFIX-$METHOD
+
+
Index: GTP/trunk/Lib/Vis/Preprocessing/scripts/gi_final.env
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/scripts/gi_final.env	(revision 2228)
+++ GTP/trunk/Lib/Vis/Preprocessing/scripts/gi_final.env	(revision 2228)
@@ -0,0 +1,299 @@
+###############################################################################
+# ERS default configuration file
+# Jiri Bittner 2003
+#############################################################################
+
+Scene {
+
+	filename ../data/vienna/vienna_cropped.obj
+#	filename ../data/soda/soda.dat
+#	filename ../data/soda/soda5.dat
+#	filename ../data/artificial/cube_test.x3d
+#	filename ../data/CityModel.obj
+#	filename ../data/arena/arena-low-lods.obj
+}
+
+
+Preprocessor {
+	samplesPerPass 3000000
+	type vss
+	detectEmptyViewSpace true
+	loadMeshes false
+	# internal raycaster
+	#rayCastMethod 0  
+	# intel raycaster
+	rayCastMethod 1
+	exportVisibility false
+	applyVisibilityFilter false
+	applyVisibilitySpatialFilter false
+}
+
+
+RssPreprocessor {
+	distributions mutation+spatial+object_direction
+	#distributions spatial
+
+
+	useImportanceSampling true
+
+	Export {
+		pvs false
+		rssTree false
+	}
+
+	useViewcells true
+	updateSubdivision true
+	loadInitialSamples false
+	storeInitialSamples false
+
+	useRssTree true
+}
+
+
+
+VssTree {
+	useRss    	false
+	epsilon		1e-6
+	
+	maxDepth 	2
+	minPvs		30
+	minRays		800
+	minSize		0.001
+ 	maxCostRatio	1.5
+	maxRayContribution 0.5
+		
+	maxTotalMemory	50
+	maxStaticMemory	20
+	
+	splitType regular
+	#	splitType heuristic
+	#	splitType hybrid
+	splitUseOnlyDrivingAxis true
+	
+	interleaveDirSplits	true
+    	dirSplitDepth 0
+	
+	numberOfEndPointDomains	10000
+	ct_div_ci	0.0
+	randomize	false
+	
+	refDirBoxMaxSize	0.1
+}
+
+
+Limits {
+       threshold	1e-6
+       small		1e-6
+       infinity		1e9
+}
+
+
+Unigraphics {
+	meshGrouping 1
+}
+
+
+KdTree {
+	sahUseFaces true
+
+	Termination {
+		minCost 0
+		maxDepth 20
+		
+		maxCostRatio 1.5
+		ct_div_ci 0.5
+	}
+
+#	splitMethod spatialMedian
+	splitMethod SAH
+	splitBorder 0.01
+}
+
+MeshKdTree {
+	Termination {
+		minCost 1
+		maxDepth 18
+		maxCostRatio 0.9
+		ct_div_ci 0.5
+	}
+
+#	splitMethod spatialMedian
+	splitMethod SAH
+	splitBorder 0.01
+}
+
+
+ViewCells {
+	
+	# samples used for view cell construction in the merge step
+	Construction {
+		samples 0
+		samplesPerPass 1000000
+	}
+
+	# number of active view cells
+	active 25000
+	maxStaticMemory	40
+
+	exportToFile true
+	loadFromFile false
+
+	#exportPvs true
+
+	# type of view cells
+	type vspOspTree
+	
+	#percentage of total visible objects where pvs is considered invalid
+	maxPvsRatio 1.0
+		
+	processOnlyValidViewCells false
+
+	samplingType box
+
+	PostProcess {
+		# how much samples are used for post processing
+		samples 0
+		maxMergesPerPass 5000
+		useRaysForMerge false
+		refine false
+		compress true
+		merge false
+	}
+
+	Visualization {
+		# how much samples we use for visualization
+		samples 200
+		exportRays true
+		exportGeometry true
+		exportMergedViewCells false
+		useClipPlane true
+		clipPlaneAxis 1
+		clipPlanePos 0.3
+		maxOutput 0
+	}
+
+	showVisualization true
+	#showVisualization false
+	evaluateViewCells true
+	
+	Evaluation {
+		#samples         200000000
+		#samplesForStats 100000000
+		samples          60000000
+		samplesForStats  30000000
+
+		samplesPerPass  1000000
+
+#		#stepSize	500
+		stepSize	100
+
+		samplingType box
+
+		histogram true
+		histoStepSize 200
+		histoMem 60
+
+		statsPrefix ../scripts/viewCells
+	}
+}
+
+
+################################
+#
+# View space partitioning kd tree
+#
+
+VspTree {
+	Construction {
+		renderCostDecreaseWeight 0.999
+	}
+
+	Termination {
+		minPvs 0
+		maxViewCells 500000
+	}
+
+	useCostHeuristics true
+	#splitUseOnlyDrivingAxis true
+
+	#useCostHeuristics false
+	splitUseOnlyDrivingAxis false
+
+	# maximum number of tests per node
+	maxTests 1000000
+}
+
+
+
+#
+# The bounding volume hierarchy
+#
+
+BvHierarchy {
+
+	Construction {		
+		renderCostDecreaseWeight 0.999
+	}
+
+	Termination {
+		maxLeaves 50000000
+	}
+
+	minRaysForVisibility 3
+	#minRaysForVisibility 15
+
+	# use only surface area heuristic
+	useCostHeuristics true
+	#useCostHeuristics false
+	useSah false
+
+	#splitUseOnlyDrivingAxis true
+	splitUseOnlyDrivingAxis false
+
+	maxTests 50000000
+}
+
+
+###############################################################
+#
+# Manages the construction of view space and object space partition
+#
+
+Hierarchy {
+	# the type of object space partition: view space is always vsp (=kd) partition
+	type bvh
+	
+	Construction {
+
+		samples 5000000
+
+		# type 0 = sequential computation, 1 = interleaved, 2 = gradient
+		type 2
+
+		###############################
+		# only for interleaved method
+
+		# if dirty split candidates are reevaluated 
+		repairQueue true
+
+		###################################################
+
+		# minimal steps of same type: for interleaved, this is only valid for the first few splits
+		minStepsOfSameType 100
+		#maxStepsOfSameType 3000
+		maxStepsOfSameType 1000
+
+		maxRepairs 1000
+	}
+
+	Termination {
+		# maximal number of leaves
+		maxLeaves 300000
+#		maxLeaves 6000
+		# maximal memory in MB
+#		maxMemory 4
+		maxMemory 30
+		# minimum ratio of global cost decrease
+		minGlobalCostRatio -1
+	}
+}
Index: GTP/trunk/Lib/Vis/Preprocessing/scripts/preprocess_visibility_internal.sh
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/scripts/preprocess_visibility_internal.sh	(revision 2227)
+++ GTP/trunk/Lib/Vis/Preprocessing/scripts/preprocess_visibility_internal.sh	(revision 2228)
@@ -14,5 +14,5 @@
 
 NUM_SAMPLE_RAYS=200000000
-NUM_SAMPLE_RAYS=50000000
+#NUM_SAMPLE_RAYS=50000000
 
 $PREPROCESSOR -total_samples=$NUM_SAMPLE_RAYS \
