2012-08-25 17:27:45 +00:00
|
|
|
// This file is part of the ANX.Framework created by the
|
|
|
|
// "ANX.Framework developer group" and released under the Ms-PL license.
|
|
|
|
// For details see: http://anxframework.codeplex.com/license
|
2011-11-15 12:11:24 +00:00
|
|
|
|
|
|
|
uniform extern float4x4 MatrixTransform;
|
|
|
|
|
|
|
|
Texture2D<float4> Texture : register(t0);
|
2012-09-09 19:59:18 +00:00
|
|
|
sampler TextureSampler : register(s0);
|
2011-11-15 12:11:24 +00:00
|
|
|
|
|
|
|
struct VertexShaderInput
|
|
|
|
{
|
|
|
|
float4 pos : POSITION;
|
|
|
|
float4 col : COLOR;
|
|
|
|
float2 tex : TEXCOORD0;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct PixelShaderInput
|
|
|
|
{
|
|
|
|
float4 pos : SV_POSITION;
|
|
|
|
float4 col : COLOR;
|
|
|
|
float2 tex : TEXCOORD0;
|
|
|
|
};
|
|
|
|
|
2012-09-09 19:59:18 +00:00
|
|
|
PixelShaderInput SpriteVertexShader(VertexShaderInput input)
|
2011-11-15 12:11:24 +00:00
|
|
|
{
|
2012-09-09 19:59:18 +00:00
|
|
|
PixelShaderInput output;
|
2011-11-15 12:11:24 +00:00
|
|
|
output.pos = mul(input.pos, MatrixTransform);
|
|
|
|
output.col = input.col;
|
|
|
|
output.tex = input.tex;
|
|
|
|
return output;
|
|
|
|
}
|
|
|
|
|
2012-09-09 19:59:18 +00:00
|
|
|
float4 SpritePixelShader(PixelShaderInput input) : SV_Target
|
2011-11-15 12:11:24 +00:00
|
|
|
{
|
|
|
|
return Texture.Sample(TextureSampler, input.tex) * input.col;
|
|
|
|
}
|
|
|
|
|
|
|
|
technique10 SpriteTechnique
|
|
|
|
{
|
|
|
|
pass SpriteColorPass
|
|
|
|
{
|
2012-09-09 19:59:18 +00:00
|
|
|
SetVertexShader(CompileShader(vs_4_0, SpriteVertexShader()));
|
|
|
|
SetPixelShader(CompileShader(ps_4_0, SpritePixelShader()));
|
2011-11-15 12:11:24 +00:00
|
|
|
}
|
|
|
|
}
|