浏览代码

obs-filters: Fix pow arguments

GLSL does not auto-promote float to vector where HLSL does.
jpark37 4 年之前
父节点
当前提交
b460f025ed

+ 1 - 1
plugins/obs-filters/data/chroma_key_filter_v2.effect

@@ -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)

+ 1 - 1
plugins/obs-filters/data/color_correction_filter.effect

@@ -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

+ 1 - 1
plugins/obs-filters/data/color_key_filter_v2.effect

@@ -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)