mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-14 23:34:08 +00:00
libobs: DrawSrgbDecompress for default_rect.effect
Necessary for upcoming fix to browser source alpha.
This commit is contained in:
parent
0c0ff1195f
commit
10cf411f99
|
@ -40,6 +40,13 @@ float3 srgb_nonlinear_to_linear(float3 v)
|
|||
return float3(srgb_nonlinear_to_linear_channel(v.r), srgb_nonlinear_to_linear_channel(v.g), srgb_nonlinear_to_linear_channel(v.b));
|
||||
}
|
||||
|
||||
float4 PSDrawSrgbDecompress(VertInOut vert_in) : TARGET
|
||||
{
|
||||
float4 rgba = image.Sample(def_sampler, vert_in.uv);
|
||||
rgba.rgb = srgb_nonlinear_to_linear(rgba.rgb);
|
||||
return rgba;
|
||||
}
|
||||
|
||||
float4 PSDrawSrgbDecompressPremultiplied(VertInOut vert_in) : TARGET
|
||||
{
|
||||
float4 rgba = image.Sample(def_sampler, vert_in.uv);
|
||||
|
@ -66,6 +73,15 @@ technique DrawOpaque
|
|||
}
|
||||
}
|
||||
|
||||
technique DrawSrgbDecompress
|
||||
{
|
||||
pass
|
||||
{
|
||||
vertex_shader = VSDefault(vert_in);
|
||||
pixel_shader = PSDrawSrgbDecompress(vert_in);
|
||||
}
|
||||
}
|
||||
|
||||
technique DrawSrgbDecompressPremultiplied
|
||||
{
|
||||
pass
|
||||
|
|
Loading…
Reference in a new issue