2013-09-30 19:37:13 -07:00
|
|
|
uniform float4x4 ViewProj;
|
2014-04-14 14:10:47 -07:00
|
|
|
uniform texture2d image;
|
2013-09-30 19:37:13 -07:00
|
|
|
|
2015-02-25 21:19:23 -08:00
|
|
|
uniform float4 color = {0.5, 1.0, 0.5, 1.0};
|
2013-09-30 19:37:13 -07:00
|
|
|
|
|
|
|
sampler_state texSampler {
|
|
|
|
AddressU = Clamp;
|
|
|
|
AddressV = Clamp;
|
|
|
|
Filter = Linear;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct VertexInOut {
|
|
|
|
float4 pos : POSITION;
|
|
|
|
float2 uv : TEXCOORD0;
|
|
|
|
};
|
|
|
|
|
2013-10-14 12:37:52 -07:00
|
|
|
VertexInOut VShader(VertexInOut vert_in)
|
2013-09-30 19:37:13 -07:00
|
|
|
{
|
2013-10-14 12:37:52 -07:00
|
|
|
VertexInOut vert_out;
|
|
|
|
vert_out.pos = mul(float4(vert_in.pos.xyz, 1.0), ViewProj);
|
|
|
|
vert_out.uv = vert_in.uv;
|
|
|
|
return vert_out;
|
2013-09-30 19:37:13 -07:00
|
|
|
}
|
|
|
|
|
2013-10-14 12:37:52 -07:00
|
|
|
float4 PShader(VertexInOut fragment_in) : TARGET
|
2013-09-30 19:37:13 -07:00
|
|
|
{
|
2014-04-14 14:10:47 -07:00
|
|
|
return image.Sample(texSampler, fragment_in.uv) * color;
|
2013-09-30 19:37:13 -07:00
|
|
|
}
|
|
|
|
|
2014-04-14 14:10:47 -07:00
|
|
|
technique Draw
|
2013-09-30 19:37:13 -07:00
|
|
|
{
|
|
|
|
pass
|
|
|
|
{
|
2013-10-14 12:37:52 -07:00
|
|
|
vertex_shader = VShader(vert_in);
|
|
|
|
pixel_shader = PShader(fragment_in);
|
2013-09-30 19:37:13 -07:00
|
|
|
}
|
|
|
|
}
|