This is my first shader ever, so please bear with me if you see something completely off, but firstly I have to ask is what do the : COLOR0 ect do, why are they there. I know the error has something to do with them, but here's the shader. Thank you for any help possible :3
I have a new problem now , nothing appears to anything that's rendered after the apply of either technique, but no errors are displayed.
How I'm using the shader is here and the shader below it
GraphicsDevice.Clear(Color.DarkGray);
spriteBatch.Begin( SpriteSortMode.Immediate,BlendState.AlphaBlend);
textures.ButtonFX.CurrentTechnique = textures.ButtonFX.Techniques["ShimmerTech"];
textures.ButtonFX.CurrentTechnique.Passes[0].Apply();
spriteBatch.Draw(textures.Button, btnPlayPos, Color.White);
textures.ButtonFX.CurrentTechnique = textures.ButtonFX.Techniques["NormalTech"];
textures.ButtonFX.CurrentTechnique.Passes[0].Apply();
spriteBatch.Draw(textures.Button, btnUpgradePos, Color.White);
spriteBatch.Draw(textures.Button, btnQuitPos, Color.White);
spriteBatch.End();
struct VertexShaderInput
{
float4 Position : POSITION0;
float4 Color : COLOR0;
};
struct VertexShaderOutput
{
float4 Position : POSITION0;
float4 Color : COLOR0;
};
VertexShaderOutput VertexShaderFunction(VertexShaderInput input)
{
VertexShaderOutput output;
output.Position = input.Position;
output.Color = input.Color;
return output;
}
float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
{
return input.Color;
}
float4 PixelShaderFunctionHigh(VertexShaderOutput input) : COLOR0
{
return normalize(input.Color);
}
technique NormalTech
{
pass Pass0
{
VertexShader = compile vs_2_0 VertexShaderFunction();
PixelShader = compile ps_2_0 PixelShaderFunction();
}
}
technique ShimmerTech
{
pass Pass0
{
VertexShader = compile vs_2_0 VertexShaderFunction();
PixelShader = compile ps_2_0 PixelShaderFunctionHigh();
}
}