libobs: Add obs_get_opaque_effect function

This returns a common effect useful for rendering an image with the
alpha channel overridden to 1.0.
This commit is contained in:
jp9000
2015-03-14 00:24:32 -07:00
parent e4305d147b
commit 9b238ef71e
4 changed files with 53 additions and 0 deletions

35
libobs/data/opaque.effect Normal file
View File

@@ -0,0 +1,35 @@
uniform float4x4 ViewProj;
uniform texture2d image;
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(float4(vert_in.pos.xyz, 1.0), ViewProj);
vert_out.uv = vert_in.uv;
return vert_out;
}
float4 PSDraw(VertInOut vert_in) : TARGET
{
return float4(image.Sample(def_sampler, vert_in.uv).rgb, 1.0);
}
technique Draw
{
pass
{
vertex_shader = VSDefault(vert_in);
pixel_shader = PSDraw(vert_in);
}
}