mirror of https://git.s-ol.nu/glsl-view
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
367 B
GLSL
21 lines
367 B
GLSL
#version 330 core
|
|
|
|
in vec2 uv;
|
|
out vec4 color;
|
|
|
|
uniform float offset;
|
|
uniform float r = 1.;
|
|
|
|
uniform float radius = 0.1;
|
|
|
|
uniform vec3 ball_color;
|
|
|
|
void main() {
|
|
vec2 p = uv*2.-1.;
|
|
p.y *= 9./16.;
|
|
|
|
color = vec4(mod(p.xyx + offset + vec2(0,0.5).xxy, vec3(1)), 1);
|
|
color.r = r;
|
|
color.rgb = mix(color.rgb, ball_color, smoothstep(1, 0.9, length(p) / radius));
|
|
}
|