Work on smooth blending.

This commit is contained in:
David Williams
2007-08-17 18:59:06 +00:00
parent 48094c972a
commit 7b43990aa7
5 changed files with 15 additions and 18 deletions

View File

@ -6,6 +6,7 @@ struct v2f
float4 TexCoordsYZ : TEXCOORD1;
float4 TexCoordsXZ : TEXCOORD2;
float4 Normal : TEXCOORD3;
float Alpha : TEXCOORD4;
};
float4 main(v2f IN, uniform sampler2D colourMap : TEXUNIT0) : COLOR
@ -18,5 +19,5 @@ float4 main(v2f IN, uniform sampler2D colourMap : TEXUNIT0) : COLOR
//colourMapValue /= 3.0;
return float4(colourMapValue/*IN.Color.rgb*/, pow(IN.Color.a,0.75));
return float4(colourMapValue*IN.Color.rgb,pow(IN.Alpha,0.75));
}

View File

@ -9,7 +9,7 @@ struct a2v
{
float4 Position : POSITION; //in object space
float3 Normal : NORMAL;
float4 Color : COLOR;
float Alpha : TEXCOORD0;
};
struct v2f
@ -20,6 +20,7 @@ struct v2f
float4 TexCoordsYZ : TEXCOORD1;
float4 TexCoordsXZ : TEXCOORD2;
float4 Normal : TEXCOORD3;
float Alpha : TEXCOORD4;
};
struct light
@ -96,11 +97,10 @@ v2f doWork(a2v IN, float4x4 world, float4x4 viewProj, float textureScale, float4
}
OUT.Color.rgb += ambient.rgb;
//Temporary
OUT.Color = IN.Color;
OUT.Position = mul(viewProj, OUT.Position);
OUT.Alpha = IN.Alpha;
return OUT;
}