提交 b460f025 编写于 作者: J jpark37 提交者: Jim

obs-filters: Fix pow arguments

GLSL does not auto-promote float to vector where HLSL does.
上级 ccf16ddb
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册