obs-studio/build/libobs/default.effect

52 lines
886 B
Plaintext
Raw Normal View History

uniform float4x4 ViewProj;
uniform float4x4 yuv_matrix;
uniform texture2d tex;
sampler_state def_sampler {
Filter = Linear;
AddressU = Clamp;
AddressV = Clamp;
};
struct VertInOut {
float4 pos : POSITION;
float2 uv : TEXCOORD0;
};
VertInOut VSDefault(VertInOut vert_in)
{
VertInOut vert_out;
vert_out.pos = mul(vert_in.pos, ViewProj);
vert_out.uv = vert_in.uv;
return vert_out;
}
float4 PSDrawRGB(VertInOut vert_in) : TARGET
{
return tex.Sample(def_sampler, vert_in.uv);
}
float4 PSDrawYUVToRGB(VertInOut vert_in) : TARGET
{
float4 yuv = tex.Sample(def_sampler, vert_in.uv);
return saturate(mul(float4(yuv.xyz, 1.0), yuv_matrix));
}
technique DrawRGB
{
pass
{
vertex_shader = VSDefault(vert_in);
pixel_shader = PSDrawRGB(vert_in);
}
}
technique DrawYUVToRGB
{
pass
{
vertex_shader = VSDefault(vert_in);
pixel_shader = PSDrawYUVToRGB(vert_in);
}
}