Files
glsl_playground/basic/nightsky.glsl

31 lines
581 B
GLSL

#ifdef GL_ES
precision mediump float;
#endif
#define PI 3.14159265358979323846
uniform vec2 u_resolution;
uniform vec2 u_mouse;
uniform float u_time;
float random (in vec2 _st) {
return fract(sin(dot(_st.xy,
vec2(12.9898,78.233)))*
43758.5453123);
}
float line(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.xy;
float color = 0.;
color = line(st, random(st));
gl_FragColor = vec4(vec3(color),1.0);
}