libobs: Fix RGBA format output not working
Due to a bug in shader parsing, it thinks that because the token "multiplier" is used here, that the "multiplier" uniform is being used. This is a workaround for the issue because fixing the parser is probably going to be much more annoying than just working around the issue for now.master
parent
d30484cef6
commit
4a2a06b22f
|
@ -166,9 +166,8 @@ float4 PSDrawBicubicRGBAMultiplyTonemap(FragData f_in, bool undistort) : TARGET
|
|||
float4 PSDrawBicubicRGBADivide(FragData f_in) : TARGET
|
||||
{
|
||||
float4 rgba = DrawBicubic(f_in, false);
|
||||
float alpha = rgba.a;
|
||||
float multiplier = (alpha > 0.0) ? (1.0 / alpha) : 0.0;
|
||||
return float4(rgba.rgb * multiplier, alpha);
|
||||
rgba.rgb *= max(1. / rgba.a, 0.);
|
||||
return rgba;
|
||||
}
|
||||
|
||||
technique Draw
|
||||
|
|
|
@ -31,9 +31,8 @@ float4 PSDrawBare(VertInOut vert_in) : TARGET
|
|||
float4 PSDrawAlphaDivide(VertInOut vert_in) : TARGET
|
||||
{
|
||||
float4 rgba = image.Sample(def_sampler, vert_in.uv);
|
||||
float alpha = rgba.a;
|
||||
float multiplier = (alpha > 0.0) ? (1.0 / alpha) : 0.0;
|
||||
return float4(rgba.rgb * multiplier, alpha);
|
||||
rgba.rgb *= max(1. / rgba.a, 0.);
|
||||
return rgba;
|
||||
}
|
||||
|
||||
float4 PSDrawNonlinearAlpha(VertInOut vert_in) : TARGET
|
||||
|
|
|
@ -222,9 +222,8 @@ float4 PSDrawLanczosRGBAMultiplyTonemap(FragData f_in, bool undistort) : TARGET
|
|||
float4 PSDrawLanczosRGBADivide(FragData f_in) : TARGET
|
||||
{
|
||||
float4 rgba = DrawLanczos(f_in, false);
|
||||
float alpha = rgba.a;
|
||||
float multiplier = (alpha > 0.0) ? (1.0 / alpha) : 0.0;
|
||||
return float4(rgba.rgb * multiplier, alpha);
|
||||
rgba.rgb *= max(1. / rgba.a, 0.);
|
||||
return rgba;
|
||||
}
|
||||
|
||||
technique Draw
|
||||
|
|
Loading…
Reference in New Issue