Mindustry/core/assets/shaders/menu.fragment

30 lines
543 B
Plaintext

#ifdef GL_ES
precision mediump float;
precision mediump int;
#endif
uniform sampler2D u_texture;
uniform float resolution;
uniform vec4 u_color;
varying vec4 v_color;
varying vec2 v_texCoord;
bool hex(vec2 p) {
p.x *= 0.57735*2.0;
p.y += mod(floor(p.x), 2.0)*0.5;
p = abs((mod(p, 1.0) - 0.5));
return abs(max(p.x*1.5 + p.y, p.y*2.0) - 1.0) > 0.1;
}
vec3 palette(float i) {
return vec3(1.0, 1.0, 1.0);
}
void main() {
bool h = hex(v_texCoord.xy/100.0);
gl_FragColor.rgb = vec3(h,h,h);
gl_FragColor.a = 1.0;
}