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