Mindustry/core/assets/bloomshaders/alpha_bloom.frag

16 lines
536 B
GLSL
Raw Normal View History

2020-06-11 23:03:27 +07:00
uniform lowp sampler2D u_texture0;
uniform lowp sampler2D u_texture1;
uniform lowp float BloomIntensity;
uniform lowp float OriginalIntensity;
2019-06-25 06:39:57 +07:00
2020-06-11 23:03:27 +07:00
varying vec2 v_texCoords;
2019-06-25 06:39:57 +07:00
2020-05-11 11:41:35 +07:00
void main(){
2022-04-26 11:19:14 +07:00
vec4 original = texture2D(u_texture0, v_texCoords) * OriginalIntensity;
vec4 bloom = texture2D(u_texture1, v_texCoords) * BloomIntensity;
original = original * (vec4(1.0) - bloom);
vec4 combined = original + bloom;
float mx = min(max(combined.r,max(combined.g,combined.b)), 1.0);
gl_FragColor = vec4(combined.rgb / mx, mx);
2020-10-28 02:08:53 +07:00
}