-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy patheffect.glsl
More file actions
30 lines (24 loc) · 723 Bytes
/
effect.glsl
File metadata and controls
30 lines (24 loc) · 723 Bytes
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
//
// Post FX
#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D texture0;
uniform vec2 resolution;
uniform float lowFreq;
uniform float editorCursorY;
void main( void ) {
vec2 pos = gl_FragCoord.xy;
vec2 res = resolution;
int i = 0;
int cnt = 32;
gl_FragColor = texture2D(texture0, vec2(pos.x/res.x, pos.y/res.y));
for (i = 0; i < cnt; i ++) {
float a = 0.03;
float offset = 0.0;
float offset2 = 1500.0 * lowFreq * lowFreq * (float(i) - 16.0) / 16.0;
a = (16.0 - abs(float(i) - 16.0)) / 128.0;
if (abs(editorCursorY - (pos.y + offset2)) < 5.0)
gl_FragColor += a * texture2D(texture0, vec2((pos.x + offset) / res.x, (pos.y + offset2) / res.y));
}
}