Mindustry/core/assets/shaders/tar.frag

27 lines
712 B
GLSL
Raw Normal View History

#define HIGHP
2020-04-10 07:55:59 +07:00
#define NSCALE 180.0 / 2.0
2020-04-10 07:50:11 +07:00
uniform sampler2D u_texture;
2020-04-10 07:50:11 +07:00
uniform sampler2D u_noise;
2020-04-10 07:50:11 +07:00
uniform vec2 u_campos;
uniform vec2 u_resolution;
uniform float u_time;
2020-06-15 05:41:42 +07:00
varying vec2 v_texCoords;
2020-04-10 07:50:11 +07:00
void main(){
2020-06-15 05:41:42 +07:00
vec2 c = v_texCoords.xy;
2020-04-10 07:50:11 +07:00
vec2 coords = vec2(c.x * u_resolution.x + u_campos.x, c.y * u_resolution.y + u_campos.y);
2020-04-10 07:50:11 +07:00
float btime = u_time / 8000.0;
float noise = (texture2D(u_noise, (coords) / NSCALE + vec2(btime) * vec2(-0.9, 0.8)).r + texture2D(u_noise, (coords) / NSCALE + vec2(btime * 1.1) * vec2(-0.8, -1.0)).r) / 2.0;
2020-04-24 02:08:32 +07:00
vec4 color = texture2D(u_texture, c);
2020-04-10 07:50:11 +07:00
if(!(noise > 0.54 && noise < 0.58)){
2020-09-19 22:40:11 +07:00
color.rgb *= vec3(0.6, 0.6, 0.7);
}
2020-04-24 02:08:32 +07:00
gl_FragColor = color;
}