summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2016-02-03 10:13:49 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2016-02-03 10:13:49 +0100
commitfdb86173bc35422315859e37ed27f9ad63fa7aec (patch)
tree2d0d7d3b87b29bd03becd0173031cff791092452 /examples
parentecbb66b21ee077b90f44973f5858a7913aa393b8 (diff)
downloadglslview-fdb86173bc35422315859e37ed27f9ad63fa7aec.tar
glslview-fdb86173bc35422315859e37ed27f9ad63fa7aec.zip
Add support for modifiable parameters
Diffstat (limited to 'examples')
-rw-r--r--examples/symmetry.frag7
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/symmetry.frag b/examples/symmetry.frag
index faebd75..f1a72ad 100644
--- a/examples/symmetry.frag
+++ b/examples/symmetry.frag
@@ -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);