瀏覽代碼

obs-filters: Avoid skewing chroma key's box filter average

Passes the sample directly to the box filter before it is multiplied by color.
Alex Anderson 7 年之前
父節點
當前提交
72cf77102c
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      plugins/obs-filters/data/chroma_key_filter.effect

+ 2 - 1
plugins/obs-filters/data/chroma_key_filter.effect

@@ -74,6 +74,7 @@ float4 ProcessChromaKey(float4 rgba, VertData v_in)
 	float fullMask = pow(saturate(baseMask / smoothness), 1.5);
 	float spillVal = pow(saturate(baseMask / spill), 1.5);
 
+	rgba.rgba *= color;
 	rgba.a *= fullMask;
 
 	float desat = (rgba.r * 0.2126 + rgba.g * 0.7152 + rgba.b * 0.0722);
@@ -84,7 +85,7 @@ float4 ProcessChromaKey(float4 rgba, VertData v_in)
 
 float4 PSChromaKeyRGBA(VertData v_in) : TARGET
 {
-	float4 rgba = image.Sample(textureSampler, v_in.uv) * color;
+	float4 rgba = image.Sample(textureSampler, v_in.uv);
 	return ProcessChromaKey(rgba, v_in);
 }