blob: 4bb68107faa36ed7c61ef2dc1716144e10ef9c49 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#version 450 core
#ifdef GL_ES
precision mediump float;
#endif
uniform vec2 resolution;
uniform float ticks;
uniform int program;
uniform sampler2D images[4];
layout (binding = 0,rgba32f) uniform image2D backbuffer;
uniform float ratios[4];
uniform int idx[2];
uniform float vel[2];
uniform float params[4];
out vec4 fragColor;
float random (in float x) {
return fract(sin(x)*43758.5453123)-0.5;
}
vec2 coordinates(int i) {
vec2 st = gl_FragCoord.xy/resolution.xy;
return st;
}
void main (void) {
vec4 img;
vec2 st = coordinates(idx[0]);
img = texture2D(images[idx[0]],st);
st = coordinates(idx[1]);
img = pow(img, texture2D(images[idx[1]],st));
fragColor = img;
}
|