Add support for modifiable parameters

This commit is contained in:
Matthias Schiffer 2016-02-03 10:13:49 +01:00
parent ecbb66b21e
commit fdb86173bc
2 changed files with 54 additions and 2 deletions

View file

@ -5,6 +5,9 @@ out vec4 fragColor;
uniform vec2 res;
uniform float time;
uniform int param_l;
uniform int param_m;
const float sharpness = 300;
const float PI = 3.14159265358979323846;
@ -31,8 +34,8 @@ void main(void) {
float scene = 0;
int n = 32;
float k = 0;
int n = param_l + 32;
float k = param_m;
for (int i = 0; i < n; i++) {
float c = square(vec2(0.5, 0) * rot(PI/2*(4.0*i/n)) * vec2(1, 1), 0.3, -PI/2*(k*i/n + time/1500), p);
scene = abs(scene - c);