0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-19 20:32:15 +02:00

libobs: Add DrawAlphaBlend technique

Useful when fixed-function blend does not provide enough precision.
This commit is contained in:
jpark37 2021-05-04 18:29:36 -07:00 committed by Jim
parent 67c2c45964
commit de7cec3dee

View File

@ -62,6 +62,13 @@ float4 PSDrawNonlinearAlpha(VertInOut vert_in) : TARGET
return rgba;
}
float4 PSDrawAlphaBlend(VertInOut vert_in) : TARGET
{
float4 rgba = image.Sample(def_sampler, vert_in.uv);
rgba.rgb *= rgba.a;
return rgba;
}
technique Draw
{
pass
@ -88,3 +95,12 @@ technique DrawNonlinearAlpha
pixel_shader = PSDrawNonlinearAlpha(vert_in);
}
}
technique DrawAlphaBlend
{
pass
{
vertex_shader = VSDefault(vert_in);
pixel_shader = PSDrawAlphaBlend(vert_in);
}
}