aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2020-01-27 10:46:19 +0000
committers-ol <s-ol@users.noreply.github.com>2020-01-27 10:46:19 +0000
commitd0e624e38d63b38bf0142f440dba3d53d04ca65e (patch)
tree2361d933e4b7d3e3695aee382398d8758e54a91c
parentreimplement working OSC control (diff)
downloadglsl-view-d0e624e38d63b38bf0142f440dba3d53d04ca65e.tar.gz
glsl-view-d0e624e38d63b38bf0142f440dba3d53d04ca65e.zip
better config
-rw-r--r--config.yaml4
-rw-r--r--shaders/test.frag25
2 files changed, 10 insertions, 19 deletions
diff --git a/config.yaml b/config.yaml
index 4799aa1..e8fe933 100644
--- a/config.yaml
+++ b/config.yaml
@@ -3,6 +3,6 @@ width: 480
height: 270
outputs:
- type: window
- width: 270
- height: 480
+ width: 480
+ height: 270
fullscreen: false
diff --git a/shaders/test.frag b/shaders/test.frag
index 9dd03ea..99dbb6d 100644
--- a/shaders/test.frag
+++ b/shaders/test.frag
@@ -4,26 +4,17 @@ in vec2 uv;
out vec4 color;
uniform float offset;
-uniform float r;
+uniform float r = 1.;
-uniform float radius = 1.;
-uniform float pitch = 440.;
+uniform float radius = 0.1;
-vec3 getcol() {
- vec2 c = vec2(0.8, 0.2);
- if (pitch > 4.0)
- return c.xyy;
- else if (pitch > 3.0)
- return c.yxy;
- else
- return c.yxx;
-}
+uniform vec3 ball_color;
void main() {
- vec2 p = uv*2.-1.;
- p.y *= 16./9.;
+ vec2 p = uv*2.-1.;
+ p.y *= 9./16.;
- color = vec4(mod(p.xyx + offset + vec2(0,0.5).xxy, vec3(1)), 1);
- color.r = r;
- color.rgb = mix(color.rgb, getcol(), smoothstep(1, 0.9, length(p) / pow(radius, 0.4)));
+ color = vec4(mod(p.xyx + offset + vec2(0,0.5).xxy, vec3(1)), 1);
+ color.r = r;
+ color.rgb = mix(color.rgb, ball_color, smoothstep(1, 0.9, length(p) / radius));
}