initial
This commit is contained in:
commit
0bf035e7bb
18
fence/art-of-code-example.frag
Normal file
18
fence/art-of-code-example.frag
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
#ifdef GL_ES
|
||||||
|
precision mediump float;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
uniform vec2 u_resolution;
|
||||||
|
uniform vec2 u_mouse;
|
||||||
|
uniform float u_time;
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
vec3 color = vec3(0);
|
||||||
|
vec2 st = (gl_FragCoord.xy-.5*u_resolution.xy)/u_resolution.y;
|
||||||
|
|
||||||
|
float m = smoothstep(0.05, 0.0, abs(st.x));
|
||||||
|
color += m;
|
||||||
|
|
||||||
|
gl_FragColor = vec4(color,1.0);
|
||||||
|
}
|
||||||
|
|
28
fence/example.frag
Normal file
28
fence/example.frag
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#ifdef GL_ES
|
||||||
|
precision mediump float;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
uniform vec2 u_resolution;
|
||||||
|
uniform vec2 u_mouse;
|
||||||
|
uniform float u_time;
|
||||||
|
|
||||||
|
// Plot a line on Y using a value between 0.0-1.0
|
||||||
|
float plot(vec2 st, float pct){
|
||||||
|
return smoothstep( pct-0.02, pct, st.y) -
|
||||||
|
smoothstep( pct, pct+0.02, st.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
vec2 st = gl_FragCoord.xy/u_resolution;
|
||||||
|
|
||||||
|
float y = st.x;
|
||||||
|
|
||||||
|
vec3 color = vec3(y);
|
||||||
|
|
||||||
|
// Plot a line
|
||||||
|
float pct = plot(st,y);
|
||||||
|
color = (1.0-pct)*color+pct*vec3(0.0,1.0,0.0);
|
||||||
|
|
||||||
|
gl_FragColor = vec4(color,1.0);
|
||||||
|
}
|
||||||
|
|
BIN
fence/kynd functions.png
Normal file
BIN
fence/kynd functions.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
28
fence/mod_with_number_first.frag
Normal file
28
fence/mod_with_number_first.frag
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#ifdef GL_ES
|
||||||
|
precision mediump float;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
uniform vec2 u_resolution;
|
||||||
|
uniform vec2 u_mouse;
|
||||||
|
uniform float u_time;
|
||||||
|
|
||||||
|
// Plot a line on Y using a value between 0.0-1.0
|
||||||
|
float plot(vec2 st, float pct){
|
||||||
|
return smoothstep( pct-0.02, pct, st.y) -
|
||||||
|
smoothstep( pct, pct+0.02, st.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
vec2 st = gl_FragCoord.xy/u_resolution;
|
||||||
|
|
||||||
|
float y = mod(13.5, st.x);
|
||||||
|
|
||||||
|
vec3 color = vec3(y);
|
||||||
|
|
||||||
|
// Plot a line
|
||||||
|
float pct = plot(st,y);
|
||||||
|
color = (1.0-pct)*color+pct*vec3(0.0,1.0,0.0);
|
||||||
|
|
||||||
|
gl_FragColor = vec4(color,1.0);
|
||||||
|
}
|
||||||
|
|
19
fence/scratch.frag
Normal file
19
fence/scratch.frag
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
#ifdef GL_ES
|
||||||
|
precision mediump float;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
uniform vec2 u_resolution;
|
||||||
|
uniform vec2 u_mouse;
|
||||||
|
uniform float u_time;
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
vec3 color = vec3(0);
|
||||||
|
vec2 st = (gl_FragCoord.xy-.5*u_resolution.xy)/u_resolution.y;
|
||||||
|
st *= u_time;
|
||||||
|
|
||||||
|
float m = .5 - abs(sin(st.x));
|
||||||
|
color += m;
|
||||||
|
|
||||||
|
gl_FragColor = vec4(color,1.0);
|
||||||
|
}
|
||||||
|
|
15
simplest.frag
Normal file
15
simplest.frag
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
#ifdef GL_ES
|
||||||
|
precision mediump float;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
uniform vec2 u_resolution;
|
||||||
|
uniform vec2 u_mouse;
|
||||||
|
uniform float u_time;
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
// make a vector that puts all x and y values between 0.0 - 1.0 so we can use it as a color
|
||||||
|
vec2 st = gl_FragCoord.xy/u_resolution;
|
||||||
|
// use time to change the blue hue of the screen
|
||||||
|
gl_FragColor = vec4(st.x,st.y,abs(sin(u_time)),1.0);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue