summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2016-02-03 10:36:51 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2016-02-03 10:36:51 +0100
commit17d48c425cd6b16a015f7f88988bdbd1ec8a3233 (patch)
treef50981477dcdcb5b324344c955e51d14d23d2e54
parentfdb86173bc35422315859e37ed27f9ad63fa7aec (diff)
downloadglslview-17d48c425cd6b16a015f7f88988bdbd1ec8a3233.tar
glslview-17d48c425cd6b16a015f7f88988bdbd1ec8a3233.zip
examples/symmetry: allow scaling the squares
-rw-r--r--examples/symmetry.frag7
1 files changed, 4 insertions, 3 deletions
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);
}