obs-filters: Fix pow arguments
GLSL does not auto-promote float to vector where HLSL does.
This commit is contained in:
parent
ccf16ddb65
commit
b460f025ed
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user