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;
|
|
|
|
uniform int blend;
|
|
|
|
|
|
|
|
void main() {
|
2022-01-17 08:52:51 +01:00
|
|
|
vec2 pos = v_vTexcoord - position;
|
|
|
|
float prog = pos.x * cos(angle) - pos.y * sin(angle);
|
2022-01-13 05:24:03 +01:00
|
|
|
float _a = 1. / amount;
|
|
|
|
|
|
|
|
float _s = mod(prog, _a);
|
|
|
|
if(blend == 0) {
|
|
|
|
if(_s > _a / 2.)
|
|
|
|
gl_FragColor = vec4(vec3(0.), 1.);
|
|
|
|
else
|
|
|
|
gl_FragColor = vec4(vec3(1.), 1.);
|
|
|
|
} else {
|
|
|
|
gl_FragColor = vec4(vec3(abs(_s / _a - 0.5) * 2.), 1.);
|
|
|
|
}
|
|
|
|
}
|