armory/Shaders/bloom_pass/bloom_pass.frag.glsl

24 lines
391 B
Plaintext
Raw Normal View History

2016-04-01 01:48:18 +02:00
#version 450
#ifdef GL_ES
precision mediump float;
#endif
2017-12-13 14:21:42 +01:00
#include "compiled.glsl"
2016-04-01 01:48:18 +02:00
uniform sampler2D tex;
2016-10-21 19:36:08 +02:00
uniform vec2 texStep;
2016-04-01 01:48:18 +02:00
in vec2 texCoord;
2016-10-12 17:52:27 +02:00
out vec4 fragColor;
2016-04-01 01:48:18 +02:00
void main() {
2017-11-16 08:52:42 +01:00
vec4 col = texture(tex, texCoord);
float brightness = dot(col.rgb, vec3(0.2126, 0.7152, 0.0722));
if (brightness > bloomThreshold) {
2017-06-26 22:39:02 +02:00
fragColor.rgb = col.rgb;
2017-06-25 23:16:49 +02:00
return;
}
2016-10-12 17:52:27 +02:00
fragColor.rgb = vec3(0.0);
2016-04-01 01:48:18 +02:00
}