Created
July 17, 2020 09:19
-
-
Save CedricGuillemet/f4bd93814d100ca7926e32b1998a740a 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
| float sphereDistance(vec3 point, vec3 sphereOrigin, float sphereRadius) { | |
| return length(point - sphereOrigin) - sphereRadius; | |
| } | |
| void main(void) { | |
| vec3 rayDir = normalize(vPosition - vEyePosition); | |
| if (sphereDistance(vPosition, vec3(0,1,0), 1.1) > 0.) | |
| discard; | |
| gl_FragColor = vec4(rayDir, 1.0); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment