Yes, i do this in my VS because it did not work in PS.
Why can´t use a temp var to copy and apply that in PS?


Code:


struct PS_IN
{
float2 Shadow : TEXCOORD0;
float2 Base : TEXCOORD1;
float2 Alpha : TEXCOORD2;
float2 Grass : TEXCOORD3;
};

struct VS_OUT
{
float4 Pos : POSITION;
float2 Shadow : TEXCOORD0;
float2 Base : TEXCOORD1;
float2 Alpha : TEXCOORD2;
float2 Grass : TEXCOORD3;
};

//simple vertex shader calculates the vertex position and tex coords
VS_OUT vs( float4 Pos : POSITION,
float2 Shadow : TEXCOORD0,
float2 Base : TEXCOORD1,
float2 Alpha : TEXCOORD2,
float2 Grass : TEXCOORD3 )
{
VS_OUT Out = ( VS_OUT ) 0;
Out.Pos = mul( Pos, matWorldViewProj );

Out.Shadow = Shadow;
Out.Base = Base;
Out.Alpha = Base; //using base, must be done cause they have no coords (they not applied to level geo, only at runtime)
Out.Grass = Base;
return Out;
}

float4 ps( PS_IN In ) : COLOR
{
float4 color;
float4 shadow;
float4 alpha;
float4 grass;

color = tex2D( sBase, In.Base.xy );
shadow = tex2D( sShadow, In.Shadow.xy );
alpha = tex2D( sAlpha, In.Alpha.xy );
grass = tex2D( sGrass, In.Grass.xy );

color = lerp( color, grass, alpha );
color = color * shadow;

return color;
}