Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/sky_preetham.cg
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/sky_preetham.cg	(revision 3040)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/sky_preetham.cg	(revision 3041)
@@ -1,8 +1,2 @@
-//--------------------------------------------------------------------------------------
-// Input and Output structs
-//--------------------------------------------------------------------------------------
-
-
-
 struct vtxin
 {
@@ -17,12 +11,10 @@
 struct vtxout
 {
-	float4 position: POSITION; // eye space
+	float4 color: COLOR0;  
+	float4 position: POSITION; 
+
 	float4 texCoord: TEXCOORD0;    
-
-	float4 color: COLOR0;  
-	float4 worldPos: TEXCOORD1; // world position
-	float3 normal: TEXCOORD2;
-	float4 mypos: TEXCOORD3;
-	float4 hdrColor: TEXCOORD4;
+	float3 normal: TEXCOORD1;
+	float4 hdrColor: TEXCOORD2;
 };
 
@@ -32,17 +24,17 @@
 {
 	float4 color: COLOR0;  
-	float4 position: POSITION; // eye space
+	//float4 projPos: WPOS;
+	//float4 position: POSITION;
+
 	float4 texCoord: TEXCOORD0;    
-
-	float4 projPos: WPOS;
-	float3 normal: TEXCOORD2;
-	float4 hdrColor: TEXCOORD4;
+	float3 normal: TEXCOORD1;
+	float4 hdrColor: TEXCOORD2;
 };
 
 
-struct fragout
+struct pixel
 {
 	float4 col: COLOR0;
-	float4 norm: COLOR1;
+	float3 norm: COLOR1;
 	float3 pos: COLOR2;
 };
@@ -104,7 +96,7 @@
 
 
-fragout frag_skydome(fragin IN)
+pixel frag_skydome(fragin IN)
 {
-	fragout pix;
+	pixel pix;
 
 	pix.col = IN.hdrColor;
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/treeanimation.cg
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/treeanimation.cg	(revision 3040)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/treeanimation.cg	(revision 3041)
@@ -8,20 +8,18 @@
 	float4 position: POSITION;
 	float3 normal: NORMAL;
-	float3 color: COLOR;
-	float2 texcoord: TEXCOORD0;
+	float4 color: COLOR;
+	float4 texCoord: TEXCOORD0;
 };
-
 
 // vtx output
 struct vtxout
 {
-	float4 position: POSITION; // eye space
+	float4 position: POSITION;
 	float4 texCoord: TEXCOORD0;    
 
 	float4 color: COLOR0;  
+	float4 eyePos: TEXCOORD1; // eye position
 	float3 normal: TEXCOORD2;
-	float4 eyePos: TEXCOORD3;
 };
-
 
 
@@ -34,22 +32,25 @@
 				  uniform float3 windDir,
 				  uniform float windStrength,
-				  uniform float2 minmaxPos,
+				  uniform float frequency,
+				  uniform float2 minMaxPos,
 				  uniform float timer)
 {
 	vtxout OUT;
 
-	OUT.color = IN.color;
+	OUT.color = float4(0);//IN.color;
 	OUT.texCoord = IN.texCoord;
+		
+	const float pos = (minMaxPos.x - IN.position.z) / (minMaxPos.x - minMaxPos.y);
+
+	float factor = pos * windStrength * sin(timer * frequency);
+
+	// transform the vertex position into post projection space
+	OUT.position = mul(glstate.matrix.mvp, IN.position);
+	// displace the input position
+	OUT.position += float4(factor * windDir, 0);
+
 	// transform the vertex position into eye space
 	OUT.eyePos = mul(glstate.matrix.modelview[0], IN.position);
-	
-	const float pos = (minmaxPos.x - IN.position.y / (minmaxPos.x - minmaxPos.y);
-
-	float factor = windStrength * sin(timer);
-
-	// displace the input position
-	float4 newPos = IN.position + float4(factor * windDir, 0.0f);
-	// transform the vertex position into post projection space
-	OUT.position = mul(glstate.matrix.mvp, IN.position);
+	OUT.eyePos += float4(factor * windDir, 0);
 
 	OUT.normal = IN.normal;
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/mrt.cg
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/mrt.cg	(revision 3034)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/mrt.cg	(revision 3041)
@@ -8,13 +8,14 @@
 };
 
+
 // vtx output
 struct vtxout
 {
-  float4 position: POSITION; // eye space
-  float4 texCoord: TEXCOORD0;    
+	float4 position: POSITION;
+	float4 texCoord: TEXCOORD0;    
 
-  float4 color: COLOR0;  
-  float4 eyePos: TEXCOORD1; // eye position
-  float3 normal: TEXCOORD2;
+	float4 color: COLOR0;  
+	float4 eyePos: TEXCOORD1; // eye position
+	float3 normal: TEXCOORD2;
 };
 
@@ -60,5 +61,4 @@
 }
 
-//#pragma position_invariant fragtex
 
 pixel fragtex(fragin IN, 
@@ -78,10 +78,8 @@
 	// save world space normal in rt
 	pix.norm = IN.normal;
-
+	// compute eye linear depth
+	pix.col.w = length(IN.eyePos.xyz);
 	// hack: squeeze some information about ambient into the texture
 	//pix.col.w = glstate.material.emission.x;
-
-	// compute eye linear depth
-	pix.col.w = length(IN.eyePos.xyz);
 
 	return pix;
@@ -92,12 +90,10 @@
 {
 	pixel pix;
-
 	// hack: use comination of emmisive + diffuse (emmisive used as constant ambient term)
 	pix.col = glstate.material.diffuse + glstate.material.emission;
-
+	// save world space normal in rt
 	pix.norm = IN.normal;
-
+	// eye space depth
 	pix.col.w = length(IN.eyePos.xyz);
-
 	// hack: squeeze some information about the ambient term into the target
 	//pix.col.w = glstate.material.emission.x;
