2013-10-24 00:57:55 -07:00
|
|
|
uniform float4x4 ViewProj;
|
|
|
|
uniform float4x4 yuv_matrix;
|
2013-12-22 00:30:18 -08:00
|
|
|
uniform texture2d diffuse;
|
2013-10-24 00:57:55 -07:00
|
|
|
|
|
|
|
sampler_state def_sampler {
|
|
|
|
Filter = Linear;
|
|
|
|
AddressU = Clamp;
|
|
|
|
AddressV = Clamp;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct VertInOut {
|
|
|
|
float4 pos : POSITION;
|
|
|
|
float2 uv : TEXCOORD0;
|
|
|
|
};
|
|
|
|
|
2013-10-25 02:50:08 -07:00
|
|
|
VertInOut VSDefault(VertInOut vert_in)
|
2013-10-24 00:57:55 -07:00
|
|
|
{
|
|
|
|
VertInOut vert_out;
|
2013-12-22 00:30:18 -08:00
|
|
|
vert_out.pos = mul(float4(vert_in.pos.xyz, 1.0), ViewProj);
|
2013-10-24 00:57:55 -07:00
|
|
|
vert_out.uv = vert_in.uv;
|
|
|
|
return vert_out;
|
|
|
|
}
|
|
|
|
|
2013-10-25 10:25:28 -07:00
|
|
|
float4 PSDrawRGB(VertInOut vert_in) : TARGET
|
2013-10-25 02:50:08 -07:00
|
|
|
{
|
2013-12-22 00:30:18 -08:00
|
|
|
return diffuse.Sample(def_sampler, vert_in.uv);
|
2013-10-25 02:50:08 -07:00
|
|
|
}
|
|
|
|
|
2013-10-25 10:25:28 -07:00
|
|
|
float4 PSDrawYUVToRGB(VertInOut vert_in) : TARGET
|
2013-10-24 00:57:55 -07:00
|
|
|
{
|
2013-12-22 00:30:18 -08:00
|
|
|
float4 yuv = diffuse.Sample(def_sampler, vert_in.uv);
|
2013-10-24 00:57:55 -07:00
|
|
|
return saturate(mul(float4(yuv.xyz, 1.0), yuv_matrix));
|
|
|
|
}
|
|
|
|
|
2013-10-25 02:50:08 -07:00
|
|
|
technique DrawRGB
|
|
|
|
{
|
|
|
|
pass
|
|
|
|
{
|
|
|
|
vertex_shader = VSDefault(vert_in);
|
2013-10-25 10:25:28 -07:00
|
|
|
pixel_shader = PSDrawRGB(vert_in);
|
2013-10-25 02:50:08 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-12-22 00:33:11 -08:00
|
|
|
technique DrawYUV
|
2013-10-24 00:57:55 -07:00
|
|
|
{
|
|
|
|
pass
|
|
|
|
{
|
2013-10-25 02:50:08 -07:00
|
|
|
vertex_shader = VSDefault(vert_in);
|
2013-10-25 10:25:28 -07:00
|
|
|
pixel_shader = PSDrawYUVToRGB(vert_in);
|
2013-10-24 00:57:55 -07:00
|
|
|
}
|
|
|
|
}
|