Last active
September 12, 2018 01:32
-
-
Save GunnarKarlsson/19cb813fe8ff0ad241c5be5fa4e89494 to your computer and use it in GitHub Desktop.
Frag shader: circle follows mouse
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void mainImage( out vec4 fragColor, in vec2 fragCoord ) | |
{ | |
vec3 col = vec3(0.5, 0.5, 0.5); | |
float radius = 50.0; | |
float dist_squared = dot(iMouse.xy - fragCoord.xy, iMouse.xy - fragCoord.xy); | |
if (dist_squared < (radius * radius)) { | |
col += vec3(0.0, 1.0, 1.0); | |
} | |
fragColor = vec4(col,1.0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment