scene.org File Archive

File download

<root>­/­parties­/­2017­/­tokyodemofest17­/­glsl_graphics_compo/neonring.txt

File size:
432 bytes (432B)
File date:
2017-02-20 05:45:01
Download count:
all-time: 818

Preview

#ifdef GL_ES
precision mediump float;
#endif

uniform float time;
uniform vec2 mouse;
uniform vec2 resolution;

void main(void) {	
	// fragment position
	vec2 p = (gl_FragCoord.xy/resolution.xy);
	
	float d = length(p - mouse);
	d = 	(d * mod(time, 2.0)*2.0)-1.0;

	float v = sin(d*50.0);
	
	float rc = mod(time,2.0)-1.0;
	float gc = mod(time,3.0)-1.0;
	float bc = mod(time,4.0)-1.0;

 	gl_FragColor = vec4(v*rc, v*gc, v*bc, 1.0);
}