From 17d48c425cd6b16a015f7f88988bdbd1ec8a3233 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 3 Feb 2016 10:36:51 +0100 Subject: examples/symmetry: allow scaling the squares --- examples/symmetry.frag | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'examples') diff --git a/examples/symmetry.frag b/examples/symmetry.frag index f1a72ad..0e237cc 100644 --- a/examples/symmetry.frag +++ b/examples/symmetry.frag @@ -5,6 +5,7 @@ out vec4 fragColor; uniform vec2 res; uniform float time; +uniform int param_k; uniform int param_l; uniform int param_m; @@ -34,10 +35,10 @@ void main(void) { float scene = 0; - int n = param_l + 32; - float k = param_m; + int n = param_k + 32; + float k = param_l; 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); + float c = square(vec2(0.5, 0) * rot(PI/2*(4.0*i/n)) * vec2(1, 1), 0.3 + 0.02 * param_m, -PI/2*(k*i/n + time/1500), p * (1 + 0.03*param_m)); scene = abs(scene - c); } -- cgit v1.2.3