Created
July 17, 2020 09:19
-
-
Save CedricGuillemet/9dba9924ee3a5dde9cc5cf7242e797c9 to your computer and use it in GitHub Desktop.
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
if (sphereDistance(currentPosition, sphereCenter, 1.0) < 0.) { | |
vec3 normal = (currentPosition - sphereCenter); | |
float dotLight = dot(normal, ligthDirection) * 0.5 + 0.5; | |
gl_FragColor = vec4(vec3(1.0, 0.5, 0.2) * dotLight, 1.0); | |
return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment