소스 검색

avoid if in highlights

Trevor Baron 7 년 전
부모
커밋
f69cf9748b
1개의 변경된 파일1개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 3
      src/Shaders/extractHighlights.fragment.fx

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

@@ -9,7 +9,5 @@ void main(void)
 	gl_FragColor = texture2D(textureSampler, vUV);
 	vec3 c = gl_FragColor.rgb;
 	float luma = dot(c.rgb, RGBLuminanceCoefficients);
-	if(luma<threshold){
-        gl_FragColor.rgb = vec3(0.,0.,0.);
-    }
+	gl_FragColor.rgb = step(threshold, luma) * gl_FragColor.rgb;
 }