Index: /GTP/trunk/Lib/Vis/Preprocessing/scripts/generate_viewcells.env
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/scripts/generate_viewcells.env	(revision 1746)
+++ /GTP/trunk/Lib/Vis/Preprocessing/scripts/generate_viewcells.env	(revision 1969)
@@ -46,6 +46,4 @@
 
 VssPreprocessor {
-	initialSamples 0
-	vssSamples 0
 	useImportanceSampling true
 	loadInitialSamples  false
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/Ray.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/Ray.h	(revision 1942)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/Ray.h	(revision 1969)
@@ -341,6 +341,11 @@
   
   Vector3 Extrap(const float t) const {
-	return mOrigin + mDirection * t;
-  }
+	  return mOrigin + mDirection * t;
+  }
+
+  friend ostream &operator<<(ostream &s, const SimpleRay &r)
+  {
+	  return s << "origin=" << r.mOrigin << " dir=" << r.mDirection;
+  };
 };
 
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp	(revision 1968)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp	(revision 1969)
@@ -1352,10 +1352,18 @@
 
 	Environment::GetSingleton()->GetIntValue("Preprocessor.HwGlobalLines.texHeight", texHeight);
-	Environment::GetSingleton()->GetIntValue("Preprocessor.HwGlobalLines.texHeight", texWidth);
+	Environment::GetSingleton()->GetIntValue("Preprocessor.HwGlobalLines.texWidth", texWidth);
 	Environment::GetSingleton()->GetFloatValue("Preprocessor.HwGlobalLines.stepSize", eps);
 	Environment::GetSingleton()->GetIntValue("Preprocessor.HwGlobalLines.maxDepth", maxDepth);
 	Environment::GetSingleton()->GetBoolValue("Preprocessor.HwGlobalLines.sampleReverse", sampleReverse);
 
-	mGlobalLinesRenderer = 
+	Debug << "****** hw global line options *******" << endl;
+	Debug << "texWidth: " << texWidth << endl;
+	Debug << "texHeight: " << texHeight << endl;
+	Debug << "sampleReverse: " << sampleReverse << endl;
+	Debug << "max depth: " << maxDepth << endl;
+	Debug << "step size: " << eps << endl;
+	Debug << endl;
+
+	globalLinesRenderer = mGlobalLinesRenderer = 
 		new GlobalLinesRenderer(this,
 								texHeight,
@@ -1364,7 +1372,10 @@
 								maxDepth,
 								sampleReverse);
-
+								
+cout << "here2" << endl;
 	mGlobalLinesRenderer->InitGl();
-}
-
-}
+cout << "here8" << endl;
+	//return mGlobalLinesRenderer;
+}
+
+}
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlViewer.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlViewer.h	(revision 1943)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlViewer.h	(revision 1969)
@@ -2,5 +2,4 @@
 #define __QTGLVIEWER_H
 
-#ifdef USE_QT
 #include <QtOpenGL>
 
@@ -12,5 +11,5 @@
 class QtGlViewer : public QGLWidget
 {
-  Q_OBJECT
+  //Q_OBJECT
 
 	friend class QtGlRendererWidget;
@@ -21,5 +20,5 @@
 	
 	QtGlViewer(QWidget *parent,
-						 QtGlRendererWidget *renderer);
+			   QtGlRendererWidget *renderer);
 	
   virtual ~QtGlViewer(){};
@@ -53,3 +52,2 @@
 
 #endif
-#endif
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtInterface.vcproj
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtInterface.vcproj	(revision 1947)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtInterface.vcproj	(revision 1969)
@@ -67,5 +67,5 @@
 			OutputDirectory="Release"
 			IntermediateDirectory="Release"
-			ConfigurationType="2"
+			ConfigurationType="4"
 			CharacterSet="2">
 			<Tool
@@ -81,33 +81,19 @@
 				Name="VCCustomBuildTool"/>
 			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="Preprocessor.lib qtmain.lib QtGui4.lib Qt3Support4.lib QAxContainer.lib QtCore4.lib QtOpenGL4.lib xerces-c_2.lib glew32.lib OpenGL32.Lib glu32.lib cg.lib cgGL.lib"
-				OutputFile="Release/QtInterface.dll"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories="&quot;..\$(ConfigurationName)&quot;;&quot;..\..\lib\$(ConfigurationName)&quot;;..\..\src\GL;..\..\..\..\..\..\..\NonGTP\Zlib\lib;..\..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;&quot;$(CG_LIB_PATH)&quot;;&quot;$(QTDIR)\lib&quot;"
-				GenerateDebugInformation="FALSE"
-				SubSystem="2"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				ImportLibrary="$(OutDir)/QtInterface.lib"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="&quot;copy dll to preprocessor dir&quot;"
-				CommandLine="copy $(OutDir)\*.dll ..\..\bin\"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
+				Name="VCLibrarianTool"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
 			<Tool
 				Name="VCManagedWrapperGeneratorTool"/>
@@ -175,5 +161,5 @@
 			OutputDirectory="$(ConfigurationName)"
 			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="2"
+			ConfigurationType="4"
 			CharacterSet="2">
 			<Tool
@@ -189,15 +175,6 @@
 				Name="VCCustomBuildTool"/>
 			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="Preprocessor.lib qtmain.lib QtGui4.lib Qt3Support4.lib QAxContainer.lib QtCore4.lib QtOpenGL4.lib xerces-c_2.lib glew32.lib OpenGL32.Lib glu32.lib cg.lib cgGL.lib RTScene.lib RTWorld.lib"
-				OutputFile="Release/QtInterface.dll"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories="&quot;$(QTDIR)\lib&quot;;..\..\..\..\..\..\..\NonGTP\Zlib\lib;&quot;$(CG_LIB_PATH)&quot;;..\..\src\GL;..\..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\lib\Release;..\..\MultiLevelRayTracing\RTScene\Release;..\..\MultiLevelRayTracing\RTWorld\Release"
-				GenerateDebugInformation="FALSE"
-				SubSystem="2"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				ImportLibrary="Release/QtInterface.lib"
-				TargetMachine="1"/>
+				Name="VCLibrarianTool"
+				OutputFile="Release/$(ProjectName).lib"/>
 			<Tool
 				Name="VCMIDLTool"/>
@@ -216,6 +193,4 @@
 			<Tool
 				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
 			<Tool
 				Name="VCManagedWrapperGeneratorTool"/>
@@ -238,5 +213,5 @@
 			</File>
 			<File
-				RelativePath=".\QtGlRendererDll.cpp">
+				RelativePath=".\QtGlViewer.cpp">
 			</File>
 			<File
@@ -258,5 +233,6 @@
 						Name="VCCustomBuildTool"
 						Description="Performing moc on $(InputName).h"
-						CommandLine="%qtdir%\bin\moc.exe $(InputDir)$(InputName).h -o $(InputDir)moc_$(InputName).cpp"
+						CommandLine="%qtdir%\bin\moc.exe $(InputDir)$(InputName).h -o $(InputDir)moc_$(InputName).cpp
+"
 						Outputs="$(InputDir) moc_$(InputName).cpp"/>
 				</FileConfiguration>
@@ -288,4 +264,7 @@
 						Outputs="$(InputDir) moc_$(InputName).cpp"/>
 				</FileConfiguration>
+			</File>
+			<File
+				RelativePath=".\QtGlViewer.h">
 			</File>
 		</Filter>
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlViewer.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlViewer.cpp	(revision 1942)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlViewer.cpp	(revision 1969)
@@ -1,5 +1,4 @@
 // ===================================================================
 // $Id$
-#ifdef USE_QT
 
 // Qt headers
@@ -186,5 +185,5 @@
 updateGL();
 }
+
 }
 
-#endif
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/GlobalLinesRenderer.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/GlobalLinesRenderer.cpp	(revision 1968)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/GlobalLinesRenderer.cpp	(revision 1969)
@@ -7,4 +7,5 @@
 #include "Exporter.h"
 #include "ViewCellsManager.h"
+#include "SamplingStrategy.h"
 
 
@@ -161,4 +162,35 @@
 			return;
 		}
+	case '5':
+		{
+			VssRayContainer rays;
+
+			HwGlobalLinesDistribution glStrategy(*globalLinesRenderer->mPreprocessor);
+
+			SimpleRayContainer simpleRays;
+			glStrategy.GenerateSamples(5, simpleRays);
+
+			//cout << "simple ray: " << simpleRays[4] << endl;
+			globalLinesRenderer->CastGlobalLines(simpleRays[1], rays);
+
+			// visualize
+			VssRayContainer outRays;
+			VssRayContainer::const_iterator vit, vit_end = rays.end();
+
+			const float p = 8.0f / (float)rays.size();
+
+			for (vit = rays.begin(); vit != vit_end; ++ vit)
+			{
+				if (Random(1.0f) < p)
+				{
+					outRays.push_back(*vit);
+				}
+			}
+
+			globalLinesRenderer->Visualize(rays);
+
+			CLEAR_CONTAINER(rays);
+			return;
+		}
 	case '8':
 		{
@@ -170,4 +202,6 @@
 			VssRayContainer rays;
 			globalLinesRenderer->ApplyDepthPeeling(rays);
+
+			// visualize
 			VssRayContainer outRays;
 			VssRayContainer::const_iterator vit, vit_end = rays.end();
@@ -209,6 +243,6 @@
 mOldTexture(NULL), 
 mPreprocessor(preprocessor),
-mTexHeight(mTexHeight),
-mTexWidth(mTexWidth),
+mTexHeight(texHeight),
+mTexWidth(texWidth),
 mEpsilon(eps),
 mMaxDepth(maxDepth),
@@ -325,7 +359,8 @@
 void GlobalLinesRenderer::InitScene(const float alpha, const float beta)
 {
+	cout << "here44"<<endl;
 	AxisAlignedBox3 bbox = 
 		globalLinesRenderer->mPreprocessor->mKdTree->GetBox();
-	
+	cout << "here77"<<endl;
 	const float sceneSize = Magnitude(bbox.Diagonal());
 
@@ -356,12 +391,12 @@
 	mViewPoint = mTermination - 0.5f * sceneSize * mEyeVec;
 
-	cout << "termination point: " << mTermination << endl;
-	cout << "view point: " << mViewPoint << endl;
-	cout << "scene: " << bbox << endl;
+	//cout << "termination point: " << mTermination << endl;
+	//cout << "view point: " << mViewPoint << endl;
+	//cout << "scene: " << bbox << endl;
 
 	InitRenderTexture(mNewTexture);
 	InitRenderTexture(mOldTexture);
 	
-	cout << "eye: " << mEyeVec << " left: " << mLeftVec << " up: " << mUpVec << endl;
+	//cout << "eye: " << mEyeVec << " left: " << mLeftVec << " up: " << mUpVec << endl;
 }
 
@@ -385,20 +420,18 @@
 
 	mEyeVec.RightHandedBase(mUpVec, mLeftVec);
-    mViewPoint = mTermination - 0.5f * sceneSize * mEyeVec;
-
-	cout << "termination point: " << mTermination << endl;
-	cout << "view point: " << mViewPoint << endl;
-	cout << "scene: " << bbox << endl;
+
+	//cout << "termination point: " << mTermination << endl;
+	//cout << "view point: " << mViewPoint << endl;
+	//cout << "scene: " << bbox << endl;
 
 	InitRenderTexture(mNewTexture);
 	InitRenderTexture(mOldTexture);
 	
-	cout << "eye: " << mEyeVec << " left: " << mLeftVec << " up: " << mUpVec << endl;
-}
-
-
-void GlobalLinesRenderer::CastGlobalLines(const float alpha, 
+	//cout << "eye: " << mEyeVec << " left: " << mLeftVec << " up: " << mUpVec << endl;
+}
+
+
+int GlobalLinesRenderer::CastGlobalLines(const float alpha, 
 										  const float beta, 
-										  //const int samples,
 										  VssRayContainer &rays)
 {
@@ -406,20 +439,24 @@
 
 	// bind pixel shader implementing the front depth buffer functionality
-	ApplyDepthPeeling(rays);
-}
-
-
-void GlobalLinesRenderer::CastGlobalLines(const SimpleRay &ray, 
+	const int layers = ApplyDepthPeeling(rays);
+
+	return layers;
+}
+
+
+int GlobalLinesRenderer::CastGlobalLines(const SimpleRay &ray, 
 										  VssRayContainer &rays)
 {
+	const long startTime = GetTime();
+	cout << "casting global lines ... " << endl;
+
 	InitScene(ray);
 
 	// bind pixel shader implementing the front depth buffer functionality
-	ApplyDepthPeeling(rays);
-}
-
-void GlobalLinesRenderer::RenderObject(Intersectable *obj)
-{
-	mRenderer->RenderIntersectable(obj);
+	const int layers = ApplyDepthPeeling(rays);
+
+	const float rays_per_sec = rays.size() / TimeDiff(startTime, GetTime()) * 1e-3;
+	cout << "cast " << rays.size() << " samples in " << layers << " layers in " << TimeDiff(startTime, GetTime()) * 1e-3 << " secs (" << rays_per_sec << " r / s)" << endl;
+	return layers;
 }
 
@@ -436,10 +473,6 @@
 
 		Intersectable::NewMail();
-
-		for (oit = mPreprocessor->mObjects.begin(); oit != oit_end; ++ oit)
-		{
-			//cout << (*oit)->GetId() << " ";
-			RenderObject(*oit);
-		}
+	
+		mRenderer->RenderScene();
 	}
 	glPopMatrix();
@@ -534,10 +567,10 @@
 	// depth and stencil.
 	// Note that RT_COPY_TO_TEXTURE is required for depth textures on ATI hardware
-	
+	cout << "texwidth: " << mTexWidth << " texheight: " << mTexHeight << endl;
 	mNewTexture = new RenderTexture(mTexWidth, mTexHeight, true, true);
 #ifdef ATI
-	mNewTexture->Initialize(true, true, false, true, true, 8, 8, 8, 8, RenderTexture::RT_COPY_TO_TEXTURE);
+	mNewTexture->Initialize(true, true, false, false, false, 8, 8, 8, 8, RenderTexture::RT_COPY_TO_TEXTURE);
 #else
-	mNewTexture->Initialize(true, true, false, true, true, 8, 8, 8, 8);//, RenderTexture::RT_COPY_TO_TEXTURE);
+	mNewTexture->Initialize(true, true, false, false, false, 8, 8, 8, 8);//, RenderTexture::RT_COPY_TO_TEXTURE);
 #endif
 
@@ -545,7 +578,7 @@
 
 #ifdef ATI
-	mOldTexture ->Initialize(true, true, false, true, true, 8, 8, 8, 8, RenderTexture::RT_COPY_TO_TEXTURE);
+	mOldTexture ->Initialize(true, true, false, false, false, 8, 8, 8, 8, RenderTexture::RT_COPY_TO_TEXTURE);
 #else
-	mOldTexture ->Initialize(true, true, false, true, true, 8, 8, 8, 8);//, RenderTexture::RT_COPY_TO_TEXTURE);
+	mOldTexture ->Initialize(true, true, false, false, false, 8, 8, 8, 8);//, RenderTexture::RT_COPY_TO_TEXTURE);
 #endif
 
@@ -579,10 +612,10 @@
 		if (!mNewTexture->IsRectangleTexture()) 
 		{
-			sTexWidthParam = cgGetNamedParameter(sCgDepthPeelingProgram, "texWidth");
+			sTexWidthParam = cgGetNamedParameter(sCgDepthPeelingProgram, "invTexWidth");
 		}
 
 		sStepSizeParam = cgGetNamedParameter(sCgDepthPeelingProgram, "stepSize"); 
 
-		cgGLSetParameter1f(sTexWidthParam, (float)mTexWidth);
+		cgGLSetParameter1f(sTexWidthParam, 1.0f / (float)mTexWidth);
 		cgGLSetParameter1f(sStepSizeParam, mEpsilon);
 	}
@@ -600,9 +633,9 @@
 		cgGLLoadProgram(sCgPassThroughProgram);
 	}
-
+cout << "here45" << endl;
 	const float alpha = 1.1;
 	const float beta = 0.9;
 	InitScene(alpha, beta);
-
+cout << "here4005" << endl;
 	PrintGLerror("init");
 }
@@ -748,19 +781,21 @@
 			Vector3 clippedOldPt, clippedNewPt;
 
-			ClipToViewSpaceBox(oldPt, newPt, clippedOldPt, clippedNewPt);
-			//clippedOldPt = oldPt;
-			//clippedNewPt = newPt;
-
-			// create rays in both directions
-			if (termObj1)
+			ClipToViewSpaceBox(oldPt, newPt, clippedOldPt, clippedNewPt);if(1)
 			{
-				vssRays.push_back(new VssRay(clippedOldPt, clippedNewPt, NULL, termObj1, pass));
-				//cout << "new pt: " << newPt << endl;
-			}
-
-			if (mSampleReverse && termObj2)
-			{
-				vssRays.push_back(new VssRay(clippedNewPt, clippedOldPt, NULL, termObj2, pass));
-				//cout << "old pt: " << oldPt << endl;
+				//clippedOldPt = oldPt;
+				//clippedNewPt = newPt;
+
+				// create rays in both directions
+				if (termObj1)
+				{
+					vssRays.push_back(new VssRay(clippedOldPt, clippedNewPt, NULL, termObj1, pass));
+					//cout << "new pt: " << newPt << endl;
+				}
+
+				if (mSampleReverse && termObj2)
+				{
+					vssRays.push_back(new VssRay(clippedNewPt, clippedOldPt, NULL, termObj2, pass));
+					//cout << "old pt: " << oldPt << endl;
+				}
 			}
 		}
@@ -936,6 +971,8 @@
 
 
-void GlobalLinesRenderer::ApplyDepthPeeling(VssRayContainer &rays)
-{
+int GlobalLinesRenderer::ApplyDepthPeeling(VssRayContainer &rays)
+{
+	int layers = 1;
+
 	mNewTexture->BeginCapture();
 	{
@@ -952,5 +989,5 @@
 	ProcessDepthBuffer(rays, false, 0);
 
-	for(int i = 1; i < mMaxDepth; ++ i) 
+	for(; layers < mMaxDepth; ++ layers) 
 	{
 		// Peel another layer
@@ -976,11 +1013,13 @@
 		// process the buffers for following layer
 		// jump out of loop for the first invalid buffer
-		if (!ProcessDepthBuffer(rays, true, i))
+		if (!ProcessDepthBuffer(rays, true, layers))
 			break;
 	}
 
 	PrintGLerror("endpeeling");
-}
-
-
-}
+
+	return layers;
+}
+
+
+}
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp	(revision 1960)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp	(revision 1969)
@@ -427,4 +427,5 @@
 	  glEndList();
 	}
+	
 	glCallList(glList);
   } else
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/GlobalLinesRenderer.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/GlobalLinesRenderer.h	(revision 1968)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/GlobalLinesRenderer.h	(revision 1969)
@@ -35,8 +35,8 @@
 
 	/** Casts global lines in the angle specified by alpha and
-		beta. 
-		@returns Computed samples in the container rays
+		beta. The computed samples are stored in the ray container.
+		@returns # of layers
 	*/
-	void CastGlobalLines(const float alpha, 
+	int CastGlobalLines(const float alpha, 
 						 const float beta, 
 						 VssRayContainer &rays);
@@ -46,6 +46,6 @@
 		@returns Computed samples in the container rays
 	*/
-	void CastGlobalLines(const SimpleRay &ray, 
-						 VssRayContainer &rays);
+	int CastGlobalLines(const SimpleRay &ray, 
+						VssRayContainer &rays);
 
 
@@ -60,7 +60,4 @@
 	int ComputePvs(ObjectContainer &objects, ObjectContainer &pvs) const;
 
-	void RenderObject(Intersectable *obj);
-
-	
 	/** Draws the geometry for one pass.
 	*/
@@ -69,5 +66,5 @@
 	void GrabDepthBuffer(float *data, RenderTexture *rt);
 	void GrabItemBuffer(unsigned char *data, RenderTexture *rt);
-	void ApplyDepthPeeling(VssRayContainer &rays);
+	int ApplyDepthPeeling(VssRayContainer &rays);
 	void ExportDepthBuffer();
 	void ExportItemBuffer();
@@ -120,4 +117,6 @@
 					   Vector3 &left);
 
+	Preprocessor *mPreprocessor;
+
 protected:
 
@@ -129,5 +128,5 @@
 	void InitRenderTexture(RenderTexture *rt);
 
-	Preprocessor *mPreprocessor;
+	
 
 	GlRenderer *mRenderer;
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp	(revision 1968)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp	(revision 1969)
@@ -271,9 +271,10 @@
 #ifdef TRY_GLOBAL_LINES
 	
-	globalLinesRenderer = new GlobalLinesRenderer(preprocessor);
-	globalLinesRenderer->InitGl();
+	preprocessor->PrepareHwGlobalLines();
+	//globalLinesRenderer = new GlobalLinesRenderer(preprocessor);
+	//globalLinesRenderer->InitGl();
+	cout << "here22" << endl;
 	globalLinesRenderer->Run();
 
-	//delete renderer;
 #else
 
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/depth_peeling2d.cg
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/depth_peeling2d.cg	(revision 1964)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/depth_peeling2d.cg	(revision 1969)
@@ -2,9 +2,9 @@
 float3 main(in float4 col : COL0,
 	    in float3 pos : WPOS,
-	    uniform float texWidth,
+	    uniform float invTexWidth,
 	    uniform float stepSize,
 	    uniform sampler2D depthTex) : COLOR
 {
-   float zold = tex2D(depthTex, pos.xy / texWidth);
+   float zold = tex2D(depthTex, pos.xy * invTexWidth);
 
    if(pos.z < (zold + stepSize))
