Index: GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPAdvancedEnvMap/multibounce/multipleReflectionMinMax/GTPMultipleReflectionMinMax.material
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPAdvancedEnvMap/multibounce/multipleReflectionMinMax/GTPMultipleReflectionMinMax.material	(revision 2095)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPAdvancedEnvMap/multibounce/multipleReflectionMinMax/GTPMultipleReflectionMinMax.material	(revision 2131)
@@ -33,14 +33,14 @@
 				face_angle_calc false
 				update_all_face true
-				get_minmax true
-				min_var_name min
-				max_var_name Max				
+				//get_minmax true
+				//min_var_name min
+				//max_var_name Max				
 			}
 			RenderTechnique ColorCubeMap
 			{
-				resolution 1024
+				resolution 512	
 				layer 1
 				texture_unit_id 2
-				update_interval		0
+				update_interval		1
 				distance_calc false
 				face_angle_calc false
@@ -49,14 +49,14 @@
 				render_self true
 				self_material GTP/MultiBounce/NormalDistanceCCW
-				get_minmax true
-				min_var_name min1
-				max_var_name max1			
+				//get_minmax true
+				//min_var_name min1
+				//max_var_name max1			
 			}
 			RenderTechnique ColorCubeMap
 			{
-				resolution 1024
+				resolution 512
 				layer 2
 				texture_unit_id 3
-				update_interval		0
+				update_interval		1
 				distance_calc false
 				face_angle_calc false
@@ -65,7 +65,7 @@
 				render_self true
 				self_material GTP/MultiBounce/NormalDistanceCW
-				get_minmax true
-				min_var_name min2
-				max_var_name max2
+				//get_minmax true
+				//min_var_name min2
+				//max_var_name max2
 			}				
 		 }
@@ -78,5 +78,11 @@
 		 fragment_program_ref GTP/MultiBounce/Reflection_MinMax_PS
          { 
-			param_named_auto cameraPos camera_position						
+			param_named_auto cameraPos camera_position	
+			param_named min float4 0 0 0 0.76
+			param_named Max float4 0 0 0 3.077
+			param_named min1 float4 0 0 0 0.14
+			param_named max1 float4 0 0 0 0.35
+			param_named min2 float4 0 0 0 0.15
+			param_named max2 float4 0 0 0 0.46
 		 } 
 		
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPAdvancedEnvMap/multibounce/GTPMultipleReflection.hlsl
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPAdvancedEnvMap/multibounce/GTPMultipleReflection.hlsl	(revision 2095)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPAdvancedEnvMap/multibounce/GTPMultipleReflection.hlsl	(revision 2131)
@@ -12,7 +12,7 @@
 
 #define MAX_LIN_ITERATIONCOUNT 50  //80
-#define MIN_LIN_ITERATIONCOUNT 15  //60
+#define MIN_LIN_ITERATIONCOUNT 30  //60
 #define SECANT_ITERATIONCOUNT 1
-#define MAX_RAY_DEPTH 4
+#define MAX_RAY_DEPTH 2
 
 void linearSearch(  float3 x, float3 R, float3 N, samplerCUBE mp,
@@ -240,6 +240,5 @@
 	  float3 l = Hit(x, R, N, NormDistMap1, NormDistMap2, CubeMap, DistanceMap, Il, Nl);
 	  if(Il.a == 0)
-	  {
-		  //I = readCubeMap(CubeMap, l);
+	  {		  
 		   depth += 1;		 
 	  }
@@ -252,6 +251,19 @@
 	  N = normalize(Nl);
 	  V = R;	   	   
-	}  
-	    
+	} 
+		
+	if(I.a == 0)
+	{
+	 float ri = refIndex;	 
+	 if(dot(V,N) > 0)
+	 {
+		ri = 1.0 / ri;
+		N = -N;	    
+	 }
+	 float3 R = refract( V, N, ri);
+	 if(dot(R,R) == 0) R = reflect( V, N);
+	 I = readCubeMap(CubeMap, R);
+ 	}
+	
 	I *= (1.0 - F);	
     
@@ -307,5 +319,5 @@
 	}  
 	if(I.a == 0)
-		I = 0;
+		I = float4(V,1);
 	else
 		I = float4(l,1);
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPAdvancedEnvMap/multibounce/multipleReflection/GTPMultipleReflection.material
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPAdvancedEnvMap/multibounce/multipleReflection/GTPMultipleReflection.material	(revision 2054)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPAdvancedEnvMap/multibounce/multipleReflection/GTPMultipleReflection.material	(revision 2131)
@@ -36,8 +36,8 @@
 			RenderTechnique ColorCubeMap
 			{
-				resolution 1024
+				resolution 512
 				layer 1
 				texture_unit_id 2
-				update_interval		0
+				update_interval		1
 				distance_calc false
 				face_angle_calc false
@@ -49,8 +49,8 @@
 			RenderTechnique ColorCubeMap
 			{
-				resolution 1024
+				resolution 512
 				layer 2
 				texture_unit_id 3
-				update_interval		0
+				update_interval		1
 				distance_calc false
 				face_angle_calc false
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPAdvancedEnvMap/multibounce/multipleRefraction/GTPMultipleRefraction.material
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPAdvancedEnvMap/multibounce/multipleRefraction/GTPMultipleRefraction.material	(revision 2054)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPAdvancedEnvMap/multibounce/multipleRefraction/GTPMultipleRefraction.material	(revision 2131)
@@ -20,5 +20,5 @@
 			{
 				resolution 1024
-				update_interval		0
+				update_interval		1
 				distance_calc false
 				face_angle_calc false
@@ -29,5 +29,5 @@
 			{
 				resolution 1024
-				update_interval		0
+				update_interval		1
 				distance_calc false
 				face_angle_calc false
@@ -39,5 +39,5 @@
 				layer 1
 				texture_unit_id 2
-				update_interval		0
+				update_interval		1
 				distance_calc false
 				face_angle_calc false
@@ -52,5 +52,5 @@
 				layer 2
 				texture_unit_id 3
-				update_interval		0
+				update_interval		1
 				distance_calc false
 				face_angle_calc false
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPAdvancedEnvMap/multibounce/GTPMultipleReflection_MinMax.hlsl
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPAdvancedEnvMap/multibounce/GTPMultipleReflection_MinMax.hlsl	(revision 2095)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPAdvancedEnvMap/multibounce/GTPMultipleReflection_MinMax.hlsl	(revision 2131)
@@ -11,6 +11,6 @@
 }
 
-#define MAX_LIN_ITERATIONCOUNT 80  //80
-#define MIN_LIN_ITERATIONCOUNT 60  //60
+#define MAX_LIN_ITERATIONCOUNT 50  //80
+#define MIN_LIN_ITERATIONCOUNT 30  //60
 #define SECANT_ITERATIONCOUNT 1
 #define MAX_RAY_DEPTH 4
