obs-filters: Fix pow arguments

GLSL does not auto-promote float to vector where HLSL does.
This commit is contained in:
jpark37 2021-01-22 22:20:48 -08:00 committed by Jim
parent ccf16ddb65
commit b460f025ed
3 changed files with 3 additions and 3 deletions

View File

@ -36,7 +36,7 @@ VertData VSDefault(VertData v_in)
float4 CalcColor(float4 rgba)
{
return float4(pow(rgba.rgb, gamma) * contrast + brightness, rgba.a);
return float4(pow(rgba.rgb, float3(gamma, gamma, gamma)) * contrast + brightness, rgba.a);
}
float GetChromaDist(float3 rgb)

View File

@ -49,7 +49,7 @@ float4 PSColorFilterRGBA(VertData vert_in) : TARGET
float4 currentPixel = image.Sample(textureSampler, vert_in.uv);
/* Always address the gamma first. */
currentPixel.rgb = pow(currentPixel.rgb, gamma);
currentPixel.rgb = pow(currentPixel.rgb, float3(gamma, gamma, gamma));
/* Much easier to manipulate pixels for these types of operations
* when in a matrix such as the below. See

View File

@ -31,7 +31,7 @@ VertData VSDefault(VertData v_in)
float4 CalcColor(float4 rgba)
{
return float4(pow(rgba.rgb, gamma) * contrast + brightness, rgba.a);
return float4(pow(rgba.rgb, float3(gamma, gamma, gamma)) * contrast + brightness, rgba.a);
}
float GetColorDist(float3 rgb)