Index: GTP/trunk/App/Demos/Illum/Standalone/EnvMap [DirectX]/Parameters.h
===================================================================
--- GTP/trunk/App/Demos/Illum/Standalone/EnvMap [DirectX]/Parameters.h	(revision 1672)
+++ GTP/trunk/App/Demos/Illum/Standalone/EnvMap [DirectX]/Parameters.h	(revision 3188)
@@ -15,9 +15,9 @@
 typedef enum { 
 	DIFFUSE_SPECULAR_CLASSIC,			///< Classic environment mapping technique.
+	DIFFUSE_SPECULAR_LOCALIZED_P2P,     ///< Point to point form factor
 	DIFFUSE_SPECULAR_LOCALIZED,			///< Our proposal.
 	DIFFUSE_SPECULAR_LOCALIZED_5TEX,	///< Our proposal, using 5 texel only.
-	DIFFUSE_SPECULAR_LOCALIZED_NEW,		///< Our proposal.	
-	DIFFUSE_SPECULAR_LOCALIZED_P2P,		///< Point to point form factor
-	DIFFUSE_SPECULAR_LOCALIZED_ADAPT	///< Point to point form factor
+	DIFFUSE_SPECULAR_LOCALIZED_NEW		///< Our proposal with roboust form factor	
+	
 } method_t;
 
Index: GTP/trunk/App/Demos/Illum/Standalone/EnvMap [DirectX]/EnvMap.fx
===================================================================
--- GTP/trunk/App/Demos/Illum/Standalone/EnvMap [DirectX]/EnvMap.fx	(revision 2482)
+++ GTP/trunk/App/Demos/Illum/Standalone/EnvMap [DirectX]/EnvMap.fx	(revision 3188)
@@ -293,6 +293,5 @@
 	
 	float3 R = reflect(IN.View, IN.Normal);
-	//float3 R = refract(IN.View, IN.Normal, 1);
-
+	
 	if (shininess <= 0)	// diffuse
 		return intensity * readCubeMap(PreconvolvedEnvironmentMapSampler, IN.Normal) *2; 		
@@ -757,199 +756,5 @@
 	
 }
-/*
-float4 EnvMapDiffuseAdaptPS( _EnvMapVS_output IN ) : COLOR			
-{		
-	float M = 4.0;																			
-	IN.View = -normalize( IN.View );												
-	IN.Normal = normalize( IN.Normal );												
-	IN.Position -= reference_pos.xyz;				
-	float3 pos = IN.Position.xyz;	
-	
-	//return	reference_pos;
-	//return  readCubeMap(SmallEnvironmentMapSampler, pos);	
-												
-	float3 N =IN.Normal;																				
-	float3 R = -reflect( IN.View, IN.Normal );		
-													
-    float4 I = 0;									
-	float3 L1, L2, L3, L4, L;						
-	float4 Le;
-	float Ld;										
-	float width = 1.0 / M;							
-	float width2 = width * 2;
-	float d; 
-	
-	for (float x = 0; x < M; x++)			
-	 for (float y = 0; y < M; y++)											
-	 {																
-		float2 p, tpos; 
-	    tpos.x = x * width;
-	    tpos.y = y * width;
-	    
-	    p = tpos.xy;    
-	    p = 2.0 * p - 1.0; //-1..1
-	    
-	    L = float3(p.x + width, p.y + width, 1);
-		Ld = readCubeMap(SmallEnvironmentMapSampler, L).a;
-		
-		float dist = length(normalize(L) * Ld - pos);
-		if(dist < 1.0)
-		{	    	    
-			L1 = float3(p.x, p.y, 1);	
-			L2 = float3(p.x + width2, p.y, 1);	
-			L3 = float3(p.x + width2, p.y + width2, 1);	
-			L4 = float3(p.x, p.y + width2, 1);
-			Le = float4(readCubeMap(SmallEnvironmentMapSampler, L).rgb, 1);
-		
-			I += 0.5 * Le * GetContibution( L, L1, L2, L3, L4, pos, N, SmallEnvironmentMapSampler);
-		}
-		else
-			I += P2PContr(N, float3(0,0,-1), pos, L, SmallEnvironmentMapSampler);				
-			
-	}																			
-	
-	for (float x = 0; x < M; x++)			
-	 for (float y = 0; y < M; y++)											
-	 {																
-		float2 p, tpos; 
-	    tpos.x = x * width;	// 0..1
-	    tpos.y = y * width;	// 0..1
-	    
-	    p = tpos.xy;    
-	    p = 2.0 * p - 1.0; //-1..1
-	    
-	    L = float3(p.x + width, p.y + width, -1);
-		Ld = readCubeMap(SmallEnvironmentMapSampler, L).a;
-		
-		float dist = length(normalize(L) * Ld - pos);
-		if(dist < 1.0)
-		{	   	    	    
-			L4 = float3(p.x, p.y, -1);	
-			L3 = float3(p.x + width2, p.y, -1);	
-			L2 = float3(p.x + width2, p.y + width2, -1);	
-			L1 = float3(p.x, p.y + width2, -1);
-			Le = float4(readCubeMap(SmallEnvironmentMapSampler, L).rgb, 1);
-			
-			I += 0.5 * Le * GetContibution( L, L1, L2, L3, L4, pos, N, SmallEnvironmentMapSampler);			
-		}
-		else
-			I += P2PContr(N, float3(0,0,1), pos, L, SmallEnvironmentMapSampler);		
-	 }	
-	 
-	for (float x = 0; x < M; x++)			
-	 for (float y = 0; y < M; y++)											
-	 {																
-		float2 p, tpos; 
-	    tpos.x = x * width;	// 0..1
-	    tpos.y = y * width;	// 0..1
-	    
-	    p = tpos.xy;    
-	    p = 2.0 * p - 1.0; //-1..1
-	    
-	    L = float3(p.x + width, 1, p.y + width);
-		Ld = readCubeMap(SmallEnvironmentMapSampler, L).a;
-		
-		float dist = length(normalize(L) * Ld - pos);
-		if(dist < 1.0)
-		{	   	    	    
-			L4 = float3(p.x, 1, p.y);
-			L3 = float3(p.x + width2, 1, p.y);	
-			L2 = float3(p.x + width2, 1, p.y + width2);	
-			L1 = float3(p.x, 1, p.y + width2);			
-			Le = float4(readCubeMap(SmallEnvironmentMapSampler, L).rgb, 1);
-			
-			I += 0.5 * Le * GetContibution( L, L1, L2, L3, L4, pos, N, SmallEnvironmentMapSampler);			
-		}
-		else
-			I += P2PContr(N, float3(0,-1,0), pos, L, SmallEnvironmentMapSampler);
-		
-	 }		
-	 
-	for (float x = 0; x < M; x++)			
-	 for (float y = 0; y < M; y++)											
-	 {																
-		float2 p, tpos; 
-	    tpos.x = x * width;	// 0..1
-	    tpos.y = y * width;	// 0..1
-	    
-	    p = tpos.xy;    
-	    p = 2.0 * p - 1.0; //-1..1
-	    
-	    L = float3(p.x + width, -1, p.y + width);
-		Ld = readCubeMap(SmallEnvironmentMapSampler, L).a;
-		
-		float dist = length(normalize(L) * Ld - pos);
-		if(dist < 1.0)
-		{	    	    
-			L1 = float3(p.x, -1, p.y);
-			L2 = float3(p.x + width2, -1, p.y);	
-			L3 = float3(p.x + width2, -1, p.y + width2);	
-			L4 = float3(p.x, -1, p.y + width2);			
-			Le = float4(readCubeMap(SmallEnvironmentMapSampler, L).rgb, 1);
-			
-			I += 0.5 * Le * GetContibution( L, L1, L2, L3, L4, pos, N, SmallEnvironmentMapSampler);			
-		}
-		else
-			I += P2PContr(N, float3(0,1,0), pos, L, SmallEnvironmentMapSampler);
-		
-	 }
-	 
-	 for (float x = 0; x < M; x++)			
-		for (float y = 0; y < M; y++)											
-		{																
-		float2 p, tpos; 
-	    tpos.x = x * width;	// 0..1
-	    tpos.y = y * width;	// 0..1
-	    
-	    p = tpos.xy;    
-	    p = 2.0 * p - 1.0; //-1..1
-	    
-		L = float3(1, p.x + width, p.y + width);
-		Ld = readCubeMap(SmallEnvironmentMapSampler, L).a;
-		float dist = length(normalize(L) * Ld - pos);
-		if(dist < 1.0)
-		{		    	    
-			L1 = float3(1, p.x, p.y);
-			L2 = float3(1, p.x + width2, p.y);	
-			L3 = float3(1, p.x + width2, p.y + width2);	
-			L4 = float3(1, p.x, p.y + width2);	
-			Le = float4(readCubeMap(SmallEnvironmentMapSampler, L).rgb, 1);
-			
-			I += 0.5 * Le * GetContibution( L, L1, L2, L3, L4, pos, N, SmallEnvironmentMapSampler);			
-		}
-		else
-			I += P2PContr(N, float3(-1,0,0), pos, L, SmallEnvironmentMapSampler);
-		
-	}
-
-	for (float x = 0; x < M; x++)			
-	 for (float y = 0; y < M; y++)											
-	 {																
-		float2 p, tpos; 
-	    tpos.x = x * width;	// 0..1
-	    tpos.y = y * width;	// 0..1
-	    
-	    p = tpos.xy;    
-	    p = 2.0 * p - 1.0; //-1..1
-	    
-	    L = float3(-1, p.x + width, p.y + width);
-		Ld = readCubeMap(SmallEnvironmentMapSampler, L).a;
-		float dist = length(normalize(L) * Ld - pos);
-		if(dist < 1.0)
-		{	    	    
-			L4 = float3(-1, p.x, p.y);
-			L3 = float3(-1, p.x + width2, p.y);	
-			L2 = float3(-1, p.x + width2, p.y + width2);	
-			L1 = float3(-1, p.x, p.y + width2);	
-			Le = float4(readCubeMap(SmallEnvironmentMapSampler, L).rgb, 1);
-			
-			I += 0.5 * Le * GetContibution( L, L1, L2, L3, L4, pos, N, SmallEnvironmentMapSampler);				
-			
-		}
-		else
-			I += P2PContr(N, float3(1,0,0), pos, L, SmallEnvironmentMapSampler);		
-	 }																				
-	return intensity * I;															
-}*/
+
 //--------------------------------------------------------------------------------------
 // Shading the environment
@@ -1047,8 +852,6 @@
 TechniqueUsingCommonVS( EnvMapDiffuseLocalized8 );
 TechniqueUsingCommonVS( EnvMapDiffuseLocalized16 );
-
 TechniqueUsingCommonVS( EnvMapDiffuseLocalizedNew );
 TechniqueUsingCommonVS( EnvMapDiffuseP2P );
-//TechniqueUsingCommonVS( EnvMapDiffuseAdapt );
 
 #define ReduceTextureTechnique(M);									\
Index: GTP/trunk/App/Demos/Illum/Standalone/EnvMap [DirectX]/Main.cpp
===================================================================
--- GTP/trunk/App/Demos/Illum/Standalone/EnvMap [DirectX]/Main.cpp	(revision 1672)
+++ GTP/trunk/App/Demos/Illum/Standalone/EnvMap [DirectX]/Main.cpp	(revision 3188)
@@ -199,5 +199,5 @@
 
 	// SLIDERS
-	pp.Add( iWhichMethod, "WhichMethod [TAB,Q]", 5, VK_TAB, 'Q', noconvert, OnChangeCubeMap );	
+	pp.Add( iWhichMethod, "WhichMethod [TAB,Q]", 4, VK_TAB, 'Q', noconvert, OnChangeCubeMap );	
 	pp.Add( iWhichMesh, "WhichMesh [Home,End]", 9, VK_HOME, VK_END, noconvert, OnChangeMesh );	
 	pp.Add( fMeshScale, "Mesh size [Ins,Del]", 100, VK_DELETE, VK_INSERT, noconvert, OnChangeMeshSize );	
@@ -709,5 +709,5 @@
 			break;
 		case DIFFUSE_SPECULAR_LOCALIZED_NEW:
-				txtHelper.DrawFormattedTextLine( L"Method : Our method New (diffuse)"); 
+				txtHelper.DrawFormattedTextLine( L"Method : Our method (diffuse), roboust form factor"); 
 			break;
 		case DIFFUSE_SPECULAR_LOCALIZED_P2P:
Index: GTP/trunk/App/Demos/Illum/Standalone/EnvMap [DirectX]/EnvMap.cpp
===================================================================
--- GTP/trunk/App/Demos/Illum/Standalone/EnvMap [DirectX]/EnvMap.cpp	(revision 1672)
+++ GTP/trunk/App/Demos/Illum/Standalone/EnvMap [DirectX]/EnvMap.cpp	(revision 3188)
@@ -297,8 +297,5 @@
 		case DIFFUSE_SPECULAR_LOCALIZED_5TEX:
 			V( g_pEffect->SetTechnique( "EnvMapDiffuseLocalized5Tex" ) );
-			break;
-		case DIFFUSE_SPECULAR_LOCALIZED_ADAPT:
-			V( g_pEffect->SetTechnique( "EnvMapDiffuseAdapt" ) );
-			break;
+			break;		
 	}
 
