// plain old grey scale is this.
float4 Color = tex2D(TextureSampler, Tex);
Color.rgb = (Color.r + Color.g + Color.b) / 3.0f;
return Color;
// the magic values are just supposed to make it look better.
Color.rgb = Color.rgb * float3(0.7f, 0.59f, 0.11f);
Color.rgb = (Color.r + Color.g + Color.b) * 0.333f;
As for the texture it’ s probably just simpler to have you look at a full shader used with spritebatch.
At the least you need to have your pixel shader input match the vertex shader output
struct VertexShaderOutput
{
float4 Position : SV_Position;
float4 Color : COLOR0;
float2 TexureCoordinate : TEXCOORD0;
}
PixelShaderOutput PixelShaderFunction(VertexShaderOutput input)
{
PixelShaderOutput output;
float4 col = tex2D(TextureSampler, input.TexureCoordinate) * input.Color;
// ect...