diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2020-07-09 13:02:31 +0200 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2020-07-09 13:02:31 +0200 |
| commit | 12829892b262a0c7fcccba9198e5b6b31b2a8015 (patch) | |
| tree | 908152ccc4fd1f4ee2c16b4bb8e0bee215ebdae7 /resources/shaders/objects/sphere.frag | |
| parent | aac94e911b0bab8db5cdb5efb8d4d8f2d4072610 (diff) | |
Diffstat (limited to 'resources/shaders/objects/sphere.frag')
| -rw-r--r-- | resources/shaders/objects/sphere.frag | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/resources/shaders/objects/sphere.frag b/resources/shaders/objects/sphere.frag new file mode 100644 index 0000000..e69deaa --- /dev/null +++ b/resources/shaders/objects/sphere.frag @@ -0,0 +1,7 @@ +/** + * Compute the Signed Distance Function (SDF) + * of a sphere. + */ +float SphereSDF(vec3 ray_position, vec3 sphere_position, float radius){ + return(length(ray_position - sphere_position)-radius); +}
\ No newline at end of file |
