2022-01-13 05:24:03 +01:00
|
|
|
//
|
|
|
|
// Simple passthrough fragment shader
|
|
|
|
//
|
|
|
|
varying vec2 v_vTexcoord;
|
|
|
|
varying vec4 v_vColour;
|
|
|
|
|
2022-01-17 08:52:51 +01:00
|
|
|
uniform vec2 position;
|
2022-01-13 05:24:03 +01:00
|
|
|
uniform float angle;
|
|
|
|
uniform float amount;
|
|
|
|
|
|
|
|
void main() {
|
2022-01-17 08:52:51 +01:00
|
|
|
vec2 c = v_vTexcoord - position;
|
2022-01-13 05:24:03 +01:00
|
|
|
float _x = .5 + c.x * cos(angle) - c.y * sin(angle);
|
|
|
|
float _y = .5 + c.x * sin(angle) + c.y * cos(angle);
|
|
|
|
float _a = 1. / amount;
|
|
|
|
|
|
|
|
if(mod(floor(_x / _a) + floor(_y / _a), 2.) > 0.5)
|
|
|
|
gl_FragColor = vec4(vec3(0.), 1.);
|
|
|
|
else
|
|
|
|
gl_FragColor = vec4(vec3(1.), 1.);
|
|
|
|
}
|