Index: /GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/terito.material
===================================================================
--- /GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/terito.material	(revision 1862)
+++ /GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/terito.material	(revision 1862)
@@ -0,0 +1,38 @@
+material blueChecker
+{
+	technique
+	{
+		pass
+		{
+			//lighting off
+			ambient 0.8 0.8 0.8 1
+			diffuse 0.8 0.8 0.8 1
+			specular 0 0 0 0
+			emissive 0 0 0
+			texture_unit
+			{
+			 filtering none
+			 texture blueChecker.tga
+			}
+		}
+	}
+}
+material redChecker
+{
+	technique
+	{
+		pass
+		{
+		    //lighting off
+			ambient 0.8 0.8 0.8 1
+			diffuse 0.8 0.8 0.8 1
+			specular 0 0 0 0
+			emissive 0 0 0
+			texture_unit
+			{
+			 filtering none
+			 texture redChecker.tga
+			}
+		}
+	}
+}
Index: /GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/colorcube.material
===================================================================
--- /GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/colorcube.material	(revision 1862)
+++ /GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/colorcube.material	(revision 1862)
@@ -0,0 +1,17 @@
+material colorcube
+{
+	technique
+	{
+		pass
+		{
+			//lighting off
+			
+			texture_unit
+			{
+				texture roomc.PNG
+				tex_coord_set 0
+				colour_op replace
+			}
+		}
+	}
+}
Index: /GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/MetalTeapot.material
===================================================================
--- /GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/MetalTeapot.material	(revision 1860)
+++ /GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/MetalTeapot.material	(revision 1862)
@@ -89,5 +89,5 @@
     fragment_program_ref NormalDistancePS
     { 
-		param_named refIndex float 1.6		
+		param_named refIndex float 200		
 	} 
   }
@@ -111,5 +111,5 @@
     fragment_program_ref NormalDistancePS
     { 
-		param_named refIndex float 1.6		
+		param_named refIndex float 200	
 	} 
   }
@@ -196,5 +196,5 @@
 			param_named F0 float3 0.95 0.95 0.95
 			param_named SingleBounce float 0.0
-			param_named refIndex float 1.6			
+			param_named refIndex float 200			
 		} 
 		
Index: /GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/MetalTeapot.hlsl
===================================================================
--- /GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/MetalTeapot.hlsl	(revision 1860)
+++ /GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/MetalTeapot.hlsl	(revision 1862)
@@ -53,5 +53,5 @@
 	ppp = length(p) / dist;
 	*/
-	t = dt;	
+	t = 0.01;	
 		
 	while(t <= 1.0 && !overshoot)
@@ -62,6 +62,13 @@
 		if(dist > 0)
 		{
-			ppp = length(p) / dist;
+			bool us = false;
+			
+			ppp = length(p) / dist;			
 			if(ppp < 1)
+			us = true;
+				
+			us = !us;
+			
+			if(us)
 			{
 				dl = dp;
@@ -225,8 +232,8 @@
 		out float4 Color :COLOR0)
 {
-	if(SingleBounce == 1)
-	 Color = Metal1BouncePS(IN,cameraPos,CubeMap,DistanceMap,lastCenter);
-	else
-	{
+	//if(SingleBounce == 1)
+	// Color = Metal1BouncePS(IN,cameraPos,CubeMap,DistanceMap,lastCenter);
+	//else
+	//{
 		Color = float4(1,1,1,1);
 		
@@ -242,5 +249,5 @@
 		newTexCoord = R;
 		
-		//Color = readCubeMap(NormDistMap1, mPos );
+		//Color = readCubeMap(NormDistMap2, mPos );
 		//return;
 		
@@ -248,5 +255,5 @@
 		float3 newDir1;
 		float d1 = Hit(mPos, R, NormDistMap1, newDir1);
-		float3 normal1 = readCubeMap(NormDistMap1, newDir1);
+		float3 normal1 = readCubeMap(NormDistMap1, newDir1).rgb;
 		bool valid1 = /*dot(normal1, R) < 0 &&*/ dot(newDir1,newDir1) != 0;
 		if(valid1)
@@ -254,5 +261,5 @@
 		float3 newDir2;
 		float d2 = Hit(mPos, R, NormDistMap2, newDir2);
-		float3 normal2 = readCubeMap(NormDistMap2, newDir2);
+		float3 normal2 =  readCubeMap(NormDistMap2, newDir2).rgb;
 		bool valid2 = /*dot(normal2, R) < 0 &&*/ dot(newDir2,newDir2) != 0;
 		if(valid2)
@@ -261,6 +268,6 @@
 		if( !valid1 && !valid2)
 		{
-			Hit(mPos, R, DistanceMap, newTexCoord);	
-			Color = readCubeMap(CubeMap, newTexCoord );
+		//	Hit(mPos, R, DistanceMap, newTexCoord);	
+		//	Color = readCubeMap(CubeMap, newTexCoord );
 			//Color = 1;			
 		}
@@ -309,5 +316,5 @@
 		
 		Color = Color * float4(F,1);	*/
-	}
+	//}
 }
 
@@ -317,5 +324,5 @@
  float4 Color = float4(0, 0, 0, 0);
  //return Color;
- Color = float4(normalize(IN.mNormal) * refIndex, length(IN.cPos));
+ Color = float4(normalize(IN.mNormal)/* * refIndex*/, length(IN.cPos));
  return Color;
 }
Index: /GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/MetalTeapotNew.hlsl
===================================================================
--- /GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/MetalTeapotNew.hlsl	(revision 1861)
+++ /GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/MetalTeapotNew.hlsl	(revision 1862)
@@ -13,8 +13,8 @@
 }
 
-#define MAX_LIN_ITERATIONCOUNT 20
-#define MIN_LIN_ITERATIONCOUNT 6
-#define SECANT_ITERATIONCOUNT 1
-#define MAX_RAY_DEPTH 3
+#define MAX_LIN_ITERATIONCOUNT 80
+#define MIN_LIN_ITERATIONCOUNT 30
+#define SECANT_ITERATIONCOUNT 2
+#define MAX_RAY_DEPTH 4
 
 void linearSearch(  float3 x, float3 R, float3 N, samplerCUBE mp,
@@ -191,11 +191,11 @@
 
 float3 R;	   
-if(refIndex > 100.0)
+//if(refIndex > 100.0)
     R = normalize(reflect( V, N));
-else
-{
-	refIndex = 1.0 / refIndex;
-    R = normalize(refract( V, N, refIndex));
-}
+//else
+//{
+//	refIndex = 1.0 / refIndex;
+//    R = normalize(refract( V, N, refIndex));
+//}
 			
  float3 Nl;
@@ -220,5 +220,5 @@
 	 float4 I = float4(0,0,0,0);
 			
-	 float3 N = normalize(IN.mNormal) * refIndex;
+	 float3 N = normalize(IN.mNormal);// * refIndex;
 	 float3 newTexCoord;	
 	 float3 x = IN.wPos - lastCenter;
@@ -232,12 +232,12 @@
 	 {
 	   float3 R;
-	   float refIndex = length(N);
-	   refIndex = 1.0 / refIndex;
-	   N = normalize(N);
+	  // float refIndex = length(N);
+	  // refIndex = 1.0 / refIndex;
+	  // N = normalize(N);
 	   
-	   if(refIndex > 100.0)
+	   //if(refIndex > 100.0)
 	    R = normalize(reflect( V, N));
-	   else
-	    R = normalize(refract( V, N, refIndex));
+	  // else
+	  //  R = normalize(refract( V, N, refIndex));
 				
 	   float3 Nl;
@@ -258,10 +258,10 @@
 	   V = R;
 	   
-	  if(refIndex <= 100.0)
+	  //if(refIndex <= 100.0)
 	    if(dot(N, V) > 0) N = -N;
 	}
 	
-//	if(I.a == 0)
- //      I = readCubeMap(CubeMap, l);
+	//if(I.a == 0)
+      // I = readCubeMap(CubeMap, l);
   
  	return I;
@@ -282,5 +282,5 @@
 	 Color = SingleReflectionPS(IN,cameraPos, CubeMap, DistanceMap, NormDistMap1,NormDistMap2,lastCenter,refIndex);
 	else
-	 Color = MultipleReflectionPS(IN,cameraPos, CubeMap, DistanceMap, NormDistMap1,NormDistMap2,lastCenter,refIndex);
+	 Color = MultipleReflectionPS(IN,cameraPos, CubeMap, DistanceMap, NormDistMap2,NormDistMap2,lastCenter,refIndex);
 	 
 	return Color;
Index: /GTP/trunk/App/Demos/Illum/Ogre/src/ReflectionTest/include/ReflectionTest.h
===================================================================
--- /GTP/trunk/App/Demos/Illum/Ogre/src/ReflectionTest/include/ReflectionTest.h	(revision 1860)
+++ /GTP/trunk/App/Demos/Illum/Ogre/src/ReflectionTest/include/ReflectionTest.h	(revision 1862)
@@ -30,5 +30,5 @@
 #include "FrameCapture.h"
 
-int scene = 1;
+int scene = 3;
 FrameCapture* capture;
 
@@ -43,4 +43,5 @@
 	
 public:
+	void setMoveSpeed(float speed){mMoveSpeed = speed;}
     RaytraceDemoListener(RenderWindow* window, Camera* maincam, SceneNode* objectNode)
         :ExampleFrameListener(window, maincam) 
@@ -48,4 +49,11 @@
     {
 		this->mMoveSpeed = 0.1;
+		if(scene == 2)
+		this->mMoveSpeed = 1.0;
+		if(scene == 3)
+		this->mMoveSpeed = 5.0;
+		 mStatsOn = false;
+		 showDebugOverlay(mStatsOn);
+
 		framecount = 0;		
 		this->objectNode = objectNode;		
@@ -280,5 +288,5 @@
 		Root::getSingleton()._setCurrentSceneManager(mSceneMgr);
 
-		mCamera->setFOVy(Radian(Degree(80 * 3.0 / 4.0)));
+		mCamera->setFOVy(Radian(Degree(80 * mWindow->getHeight() / mWindow->getWidth())));
 		mCamera->setFarClipDistance(200);
 		mCamera->setNearClipDistance(0.1);
@@ -295,4 +303,5 @@
 		if(scene == 1) createScene1();
 		if(scene == 2) createScene2();
+		if(scene == 3) createScene3();
 
 		OgreIlluminationManager::getSingleton().initTechniques();
@@ -362,14 +371,17 @@
      	SceneNode* rootNode = mSceneMgr->getRootSceneNode();
 		
-		Entity* object = mSceneMgr->createEntity("object", "athene.mesh");
+		mCamera->setPosition(2.3,7.0,2.3);
+		mCamera->lookAt(Vector3(0,5.75,0.0));
+		
+		Entity* object = mSceneMgr->createEntity("object", "teapot.mesh");
 		object->setMaterialName("MetalTeapotMultipleBounce");
 		objectNode = rootNode->createChildSceneNode();
 		objectNode->attachObject(object);
 		//objectNode->scale(0.5,0.5,0.5);
-		objectNode->scale(0.005,0.005,0.005);
-		objectNode->setPosition(0,1.2,0);
+		//objectNode->scale(0.005,0.005,0.005);
+		objectNode->setPosition(0,5.75,0.0);
 		objectNode->_updateBounds();
 
-		Entity* room = mSceneMgr->createEntity("scene", "difflab.mesh");
+		Entity* room = mSceneMgr->createEntity("scene", "terito.mesh");
 		//room->setMaterialName("GameTools/Phong");
 		SceneNode* roomNode = rootNode->createChildSceneNode();
@@ -378,36 +390,35 @@
 
 		mSceneMgr->setShadowTechnique(SHADOWTYPE_NONE);
-		Light* redLight1 = mSceneMgr->createLight("RedLight1");
-		redLight1->setType(Light::LT_POINT);
-		redLight1->setCastShadows(false);
-        redLight1->setDiffuseColour(ColourValue(1,0.055, 0.0));
-		redLight1->setPowerScale(1.6);
-		SceneNode* redLightNode1 = rootNode->createChildSceneNode();
-		redLightNode1->setPosition(0.05,2.361,-1.07);
-		redLightNode1->attachObject(redLight1);
-
-		Light* greenLight1 = mSceneMgr->createLight("GreenLight1");
-		greenLight1->setType(Light::LT_POINT);
-		greenLight1->setCastShadows(false);
-        greenLight1->setDiffuseColour(ColourValue(0.362,0.783, 0.685));
-		greenLight1->setPowerScale(2.0);
-		SceneNode* greenLightNode1 = rootNode->createChildSceneNode();
-		greenLightNode1->setPosition(1.312,1.313,0);
-		greenLightNode1->attachObject(greenLight1); 
-
-		Light* mainBlueLight = mSceneMgr->createLight("MainBlueLight");
-		mainBlueLight->setType(Light::LT_SPOTLIGHT);
-		mainBlueLight->setCastShadows(true);
-        mainBlueLight->setDiffuseColour(ColourValue(0.395,0.766, 1.0));
-		mainBlueLight->setPowerScale(5.0);
-		mainBlueLight->setSpotlightRange(Degree(0),Degree(160));
-		mainBlueLight->setAttenuation(2.5, 0, 1, 0);
-		SceneNode* mainBlueLightNode = rootNode->createChildSceneNode();
-		mainBlueLightNode->setPosition(-0.546,2.095,1.035);
-		//mainBlueLightNode->rotate(Vector3::UNIT_X, Degree(161.396));
-		//mainBlueLightNode->rotate(Vector3::UNIT_Y, Degree(53.955));
-		//mainBlueLightNode->rotate(Vector3::UNIT_Z, Degree(-145.065));
-		mainBlueLight->setDirection(-1.5,-2.0,1.0);
-		mainBlueLightNode->attachObject(mainBlueLight); 
+		Light* Light1 = mSceneMgr->createLight("Light1");
+		Light1->setType(Light::LT_POINT);
+		Light1->setCastShadows(false);
+        Light1->setDiffuseColour(ColourValue(1,1, 1));
+		Light1->setPowerScale(1.0);
+		SceneNode* LightNode1 = rootNode->createChildSceneNode();
+		LightNode1->setPosition(1.5,10.3,0);
+		LightNode1->attachObject(Light1);		
+   }
+
+	void createScene3(void)
+    {
+     	SceneNode* rootNode = mSceneMgr->getRootSceneNode();
+		
+		mCamera->setPosition(6.564,4.328,0.059);
+		mCamera->lookAt(Vector3(0.4,0.16,0.25));
+		
+		Entity* object = mSceneMgr->createEntity("object", "teapot.mesh");
+		object->setMaterialName("MetalTeapotMultipleBounce");
+		objectNode = rootNode->createChildSceneNode();
+		objectNode->attachObject(object);
+		//objectNode->scale(0.5,0.5,0.5);
+		objectNode->scale(2.7,2.7,2.7);
+		objectNode->setPosition(0,0.7,0.0);
+		objectNode->_updateBounds();
+
+		Entity* room = mSceneMgr->createEntity("scene", "colorcube.mesh");
+		//room->setMaterialName("GameTools/Phong");
+		SceneNode* roomNode = rootNode->createChildSceneNode();
+		roomNode->attachObject(room);
+		roomNode->_updateBounds();					
    }
 
Index: /GTP/trunk/App/Demos/Illum/Ogre/bin/Release/ogre.cfg
===================================================================
--- /GTP/trunk/App/Demos/Illum/Ogre/bin/Release/ogre.cfg	(revision 1851)
+++ /GTP/trunk/App/Demos/Illum/Ogre/bin/Release/ogre.cfg	(revision 1862)
@@ -3,8 +3,8 @@
 [Direct3D9 Rendering Subsystem]
 Allow NVPerfHUD=No
-Anti aliasing=None
+Anti aliasing=Level 4
 Floating-point mode=Fastest
-Full Screen=No
-Rendering Device=NVIDIA GeForce 7950 GX2
+Full Screen=Yes
+Rendering Device=NVIDIA GeForce 6800 GT
 VSync=No
 Video Mode=800 x 600 @ 32-bit colour
