浏览代码

use existing get luma function

Trevor Baron 7 年之前
父节点
当前提交
1f814fa67b
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      src/Shaders/extractHighlights.fragment.fx

+ 3 - 2
src/Shaders/extractHighlights.fragment.fx

@@ -1,3 +1,5 @@
+#include<helperFunctions>
+
 // Samplers
 varying vec2 vUV;
 uniform sampler2D textureSampler;
@@ -7,7 +9,6 @@ const vec3 RGBLuminanceCoefficients = vec3(0.2126, 0.7152, 0.0722);
 void main(void) 
 {
 	gl_FragColor = texture2D(textureSampler, vUV);
-	vec3 c = gl_FragColor.rgb;
-	float luma = dot(c.rgb, RGBLuminanceCoefficients);
+	float luma = getLuminance(gl_FragColor.rgb);
 	gl_FragColor.rgb = step(threshold, luma) * gl_FragColor.rgb;
 }