-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwaterfall.txt
More file actions
64 lines (44 loc) · 1.47 KB
/
Copy pathwaterfall.txt
File metadata and controls
64 lines (44 loc) · 1.47 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#version 330 core
uniform vec4 iResolution;
uniform vec4 iMouse;
uniform vec4 iGlobalTime;
uniform sampler2D iTexture0; // Albedo
uniform mat4 iModelMatrix;
uniform mat4 iViewMatrix;
uniform mat4 iProjectionMatrix;
uniform mat4 iInverseViewMatrix;
uniform mat4 iModelViewMatrix;
uniform mat4 iModelViewProjectionMatrix;
uniform mat4 iTransposeInverseModelMatrix;
uniform mat4 iTransposeInverseModelViewMatrix;
// BEGIN --- Input Interpolants ---
smooth in vec3 iPosition;
smooth in vec3 iPositionWorld;
smooth in vec3 iPositionCamera;
smooth in vec3 iNormal;
smooth in vec3 iNormalWorld;
smooth in vec3 iNormalCamera;
smooth in vec2 iTexCoord0;
smooth in vec2 iTexCoord1;
// END --- Input Interpolants ---
// BEGIN --- Framebuffer Outputs ---
layout(location = 0) out vec4 out_color;
// END --- Framebuffer Outputs ---
/*
void main(void) {
vec4 col = texture(iTexture0, iTexCoord0.xy);
float i = abs(sin(15.0 * col.w + iGlobalTime.x * 6.0) * 3.0 * col.w) * 0.7;
out_color = vec4(i * 0.2, i * 0.48, i, 0.0);
}
*/
void main(void)
{
vec2 uv = iTexCoord0.xy/-1.0;
float yOffset = iGlobalTime.x*0.5;
float y = mod(uv.y+yOffset,1.0);
float red = texture(iTexture0, vec2(uv.x,y)).r;
float green = texture(iTexture0, vec2(uv.x,y)).g;
float blue = texture(iTexture0, vec2(uv.x,y)).b;
float alpha = texture(iTexture0, vec2(uv.x,y)).a;
out_color = vec4(red,green,blue,alpha);
}