Index: /GTP/trunk/Lib/Vis/Preprocessing/scripts/run_demo_arena
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/scripts/run_demo_arena	(revision 2560)
+++ /GTP/trunk/Lib/Vis/Preprocessing/scripts/run_demo_arena	(revision 2564)
@@ -10,7 +10,7 @@
 PREFIX=../work/plots/osp-TEST
 
-
+#-rss_distributions=mutation+object_direction+spatial \
 $COMMAND -preprocessor=combined -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \
--rss_distributions=mutation+object_direction+spatial \
+-rss_distributions=direction \
 -view_cells_use_kd_pvs+ -af_use_kd_pvs+ \
 -preprocessor_visibility_file=$PREFIX-i-mixed-b1-n4a.xml \
Index: /GTP/trunk/Lib/Vis/Preprocessing/scripts/run_demo_soda
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/scripts/run_demo_soda	(revision 2534)
+++ /GTP/trunk/Lib/Vis/Preprocessing/scripts/run_demo_soda	(revision 2564)
@@ -11,7 +11,8 @@
 PREFIX=../work/plots/osp-TEST
 
+#-rss_distributions=mutation+object_direction+spatial \
 
 $COMMAND -preprocessor=combined -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \
--rss_distributions=mutation+object_direction+spatial \
+-rss_distributions=direction \
 -view_cells_use_kd_pvs+ -af_use_kd_pvs+ \
 -preprocessor_visibility_file=$PREFIX-i-mixed-b1-n4a.xml \
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp	(revision 2563)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp	(revision 2564)
@@ -137,5 +137,5 @@
 
 
-	//	glColorMask(GL_TRUE, GL_FALSE, GL_FALSE, GL_FALSE);
+	//glColorMask(GL_TRUE, GL_FALSE, GL_FALSE, GL_FALSE);
 	glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
 	glEnable(GL_STENCIL_TEST); 
@@ -545,5 +545,6 @@
 			mWireFrame = true;
 			RenderIntersectable(viewcell);
-			glPushMatrix();
+			
+			/*glPushMatrix();
 			glTranslatef(mViewPoint.x, mViewPoint.y, mViewPoint.z);
 			glScalef(5.0f,5.0f,5.0f);
@@ -554,4 +555,5 @@
 			glPopAttrib();
 			glPopMatrix();
+			*/
 			mWireFrame = false;
 		}
@@ -841,4 +843,5 @@
 
 	mHideByCost = false;
+	mUseTransparency = false;
 
 	mTransferFunction = 0.2f;
@@ -890,4 +893,5 @@
 	connect(mControlWidget, SIGNAL(SetShowViewCells(bool)), this, SLOT(SetShowViewCells(bool)));
 	connect(mControlWidget, SIGNAL(SetShowRenderCost(bool)), this, SLOT(SetShowRenderCost(bool)));
+	connect(mControlWidget, SIGNAL(SetUseTransparency(bool)), this, SLOT(SetUseTransparency(bool)));
 	connect(mControlWidget, SIGNAL(SetShowPvsSizes(bool)), this, SLOT(SetShowPvsSizes(bool)));
 	connect(mControlWidget, SIGNAL(SetTopView(bool)), this, SLOT(SetTopView(bool)));
@@ -1172,5 +1176,5 @@
 	mUseFalseColors = true;
 
-	glPushAttrib(GL_CURRENT_BIT | GL_ENABLE_BIT | GL_POLYGON_BIT);
+	//glPushAttrib(GL_CURRENT_BIT | GL_ENABLE_BIT | GL_POLYGON_BIT);
 
 	glEnable(GL_CULL_FACE);
@@ -1238,22 +1242,30 @@
 		//glFrontFace(GL_CCW);	
 		//glCullFace(GL_BACK);
-		glEnable(GL_DEPTH_TEST);
-		glDisable(GL_BLEND);
-
-		//glDisable(GL_DEPTH_TEST);
-		//glEnable(GL_BLEND);
-	
-		//glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-		glBlendFunc(GL_SRC_ALPHA, GL_ONE);
-
-		for (i = 0; i < viewcells.size(); ++ i) 
+		if (!mUseTransparency)
 		{
-			ViewCell *vc = viewcells[i];
-			const float dist = SqrDistance(mViewPoint, vc->GetBox().Center());
-
-			vc->SetDistance(dist);
+			glEnable(GL_DEPTH_TEST);
+			glDisable(GL_BLEND);
 		}
-
-		sort(viewcells.begin(), viewcells.end(), nearerThan);
+		else
+		{
+			//glCullFace(GL_BACK);
+			//cout << "here29 " << mTransparency << endl;
+			glDisable(GL_DEPTH_TEST);
+			glEnable(GL_BLEND);
+
+			glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+			//glBlendFunc(GL_SRC_ALPHA, GL_ONE);
+
+			for (i = 0; i < viewcells.size(); ++ i) 
+			{
+				ViewCell *vc = viewcells[i];
+				const Vector3 dummyViewPoint(0.0, 0.0, 1.0);
+				const float dist = SqrDistance(dummyViewPoint, vc->GetBox().Center());
+
+				vc->SetDistance(dist);
+			}
+
+			sort(viewcells.begin(), viewcells.end(), nearerThan);
+		}
 
 		RgbColor c;
@@ -1282,6 +1294,5 @@
 			}
 			
-			const float alpha = 0.2f;
-			glColor4f(c.r, c.g, c.b, alpha);
+			glColor4f(c.r, c.g, c.b, 1.0f - mTransparency);
 			
 			if (!mHideByCost || (mHidingCost < vc->GetNumPiercingRays() / (float)maxPiercingRays)) 
@@ -1439,12 +1450,12 @@
 
 	QButtonGroup *qbuttongroup = new QButtonGroup(hbox);//, "RenderingGroupBox");
-	//qbuttongroup->setTitle(i18n("Rendering options"));
-	/*qbuttongroup->setColumnLayout(0, Qt::Vertical);
-	qbuttongroup->layout()->setSpacing(0);
-	qbuttongroup->layout()->setMargin(0);
-*/
+	//qbuttongroup->setTitle(i18n("Rendering options2"));
+	//qbuttongroup->setColumnLayout(0, Qt::Horizontal);
+	//qbuttongroup->layout()->setSpacing(0);
+	//qbuttongroup->layout()->setMargin(0);
+
 	// Create a layout to organize the widgets.
-/*	QVBoxLayout *qvboxlayout = new QVBoxLayout(qbuttongroup->layout());
-	qvboxlayout->setAlignment(Qt::AlignTop)
+	/*QVBoxLayout *qvboxlayout = new QVBoxLayout;//->layout());
+	qvboxlayout->setAlignment(Qt::AlignTop);
 	qvboxlayout->setSpacing(6);
 	qvboxlayout->setMargin(11);
@@ -1453,13 +1464,12 @@
 
 	// Create a check box to be in the group box
+	
 	rb = new QRadioButton("piercing rays", hbox);
-	rb->setText("here71");
-	//qvboxlayout->addWidget(rb);
-
-	// Create another check box to the group box
-/*	m_qradiobuttonStartFile = new QRadioButton("startFile", hbox);
-	m_qradiobuttonStartFile->setText(i18n( "Start with last file used" ) );
-	qvboxlayout->addWidget(mRadiobuttonStartFile);
-*/
+	rb->setText("piercing rays");
+	vl->addWidget(rb);
+	
+	rb = new QRadioButton("render cost", hbox);
+	rb->setText("render cost");
+	vl->addWidget(rb);
 
 	//////////////////////////////////
@@ -1546,5 +1556,5 @@
 	vbox->layout()->addWidget(cb);
 	cb->setChecked(false);
-	connect(cb, SIGNAL(toggled(bool)), SIGNAL(SetTransparency(bool)));
+	connect(cb, SIGNAL(toggled(bool)), SIGNAL(SetUseTransparency(bool)));
 
 	label = new QLabel("Use transparency");
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h	(revision 2563)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h	(revision 2564)
@@ -120,5 +120,5 @@
 
   void SetHideByCost(bool);
-  void SetTransparency(bool);
+  void SetUseTransparency(bool);
 };
 
@@ -155,4 +155,5 @@
 
 	float mTransparency;
+	bool mUseTransparency;
 
 	// some statistics
@@ -334,4 +335,9 @@
 	void SetHideByCost(bool b) {
 		mHideByCost = b;
+		updateGL();
+	}
+
+	void SetUseTransparency(bool b) {
+		mUseTransparency = b;
 		updateGL();
 	}
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlViewer.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlViewer.cpp	(revision 2562)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlViewer.cpp	(revision 2564)
@@ -53,11 +53,8 @@
 	++ mRenderer->mFrame;
 	
-	glDisable(GL_DEPTH_TEST);
+	//glDisable(GL_DEPTH_TEST);
 
 	glColor3f(0.8f, 0.8f, 0.8f);
 	mRenderer->RenderPvs();
-
-	mRenderer->RenderViewPoint();
-
 	
 // 	if (mRenderer->mShowRays) {
@@ -77,4 +74,6 @@
 	if (mRenderer->mRenderViewCells)
 		mRenderer->RenderViewCells();
+
+	mRenderer->RenderViewPoint();
 
 	glColor3f(1.0f, 1.0f, 1.0f);
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp	(revision 2562)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp	(revision 2564)
@@ -1556,5 +1556,5 @@
 	glPushMatrix();
 	glTranslatef(mViewPoint.x, mViewPoint.y, mViewPoint.z);
-	glScalef(5.0f,5.0f,5.0f);
+	glScalef(5.0f, 5.0f, 5.0f);
 	glPushAttrib(GL_CURRENT_BIT);
 	glColor3f(1.0f, 0.0f, 0.0f);
