aboutsummaryrefslogtreecommitdiff
path: root/resources/shaders/objects/sphere.frag
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2020-07-09 13:02:31 +0200
committerLoic Guegan <manzerbredes@mailbox.org>2020-07-09 13:02:31 +0200
commit12829892b262a0c7fcccba9198e5b6b31b2a8015 (patch)
tree908152ccc4fd1f4ee2c16b4bb8e0bee215ebdae7 /resources/shaders/objects/sphere.frag
parentaac94e911b0bab8db5cdb5efb8d4d8f2d4072610 (diff)
Cleaning codeHEADmaster
Diffstat (limited to 'resources/shaders/objects/sphere.frag')
-rw-r--r--resources/shaders/objects/sphere.frag7
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