libobs: Add DrawSrgbDecompress default technique

Useful when the texture does not support SRGB conversion on load.
master
jpark37 2021-07-06 21:46:13 -07:00
parent 05b507d900
commit c9766d8e28
1 changed files with 16 additions and 0 deletions

View File

@ -62,6 +62,13 @@ float4 PSDrawNonlinearAlpha(VertInOut vert_in) : TARGET
return rgba;
}
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);
@ -97,6 +104,15 @@ technique DrawNonlinearAlpha
}
}
technique DrawSrgbDecompress
{
pass
{
vertex_shader = VSDefault(vert_in);
pixel_shader = PSDrawSrgbDecompress(vert_in);
}
}
technique DrawSrgbDecompressPremultiplied
{
pass