diff options
Diffstat (limited to 'examples/live/shaders/picture.frag')
| -rw-r--r-- | examples/live/shaders/picture.frag | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/examples/live/shaders/picture.frag b/examples/live/shaders/picture.frag new file mode 100644 index 0000000..4621b31 --- /dev/null +++ b/examples/live/shaders/picture.frag @@ -0,0 +1,14 @@ +#version 450 +#extension GL_GOOGLE_include_directive : require +// The color tape at every pixel; x and y in half the target's height, 0 at +// its centre, y up: a circle is round on any window. +#include "Picture.glsl" +#define TAPE(i) u.tape[i] +#include "vm.glsl" + +layout(location = 0) out vec4 out_color; + +void main() { + vec2 p = vec2(gl_FragCoord.x - 0.5 * u.size.x, 0.5 * u.size.y - gl_FragCoord.y) / (0.5 * u.size.y); + out_color = vec4(clamp(vm(0u, u.len, u.time, p.x, p.y), 0.0, 1.0), 1.0); +} |
