mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-05-19 05:51:16 -04:00
libobs: Add DrawAlphaBlend technique
Useful when fixed-function blend does not provide enough precision.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user