libobs: Add high-precision sRGB support
This commit is contained in:
parent
848e128435
commit
06111d5b10
10 changed files with 329 additions and 101 deletions
|
|
@ -45,6 +45,16 @@ float4 PSDrawNonlinearAlpha(VertInOut vert_in) : TARGET
|
|||
return rgba;
|
||||
}
|
||||
|
||||
float4 PSDrawNonlinearAlphaMultiply(VertInOut vert_in) : TARGET
|
||||
{
|
||||
float4 rgba = image.Sample(def_sampler, vert_in.uv);
|
||||
rgba.rgb = srgb_linear_to_nonlinear(rgba.rgb);
|
||||
rgba.rgb *= rgba.a;
|
||||
rgba.rgb = srgb_nonlinear_to_linear(rgba.rgb);
|
||||
rgba.rgb *= multiplier;
|
||||
return rgba;
|
||||
}
|
||||
|
||||
float4 PSDrawSrgbDecompress(VertInOut vert_in) : TARGET
|
||||
{
|
||||
float4 rgba = image.Sample(def_sampler, vert_in.uv);
|
||||
|
|
@ -105,6 +115,15 @@ technique DrawNonlinearAlpha
|
|||
}
|
||||
}
|
||||
|
||||
technique DrawNonlinearAlphaMultiply
|
||||
{
|
||||
pass
|
||||
{
|
||||
vertex_shader = VSDefault(vert_in);
|
||||
pixel_shader = PSDrawNonlinearAlphaMultiply(vert_in);
|
||||
}
|
||||
}
|
||||
|
||||
technique DrawSrgbDecompress
|
||||
{
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue