aboutsummaryrefslogtreecommitdiff
path: root/resources/shaders/objects
diff options
context:
space:
mode:
Diffstat (limited to 'resources/shaders/objects')
-rw-r--r--resources/shaders/objects/sphere.frag7
-rw-r--r--resources/shaders/objects/sphere.glsl4
2 files changed, 7 insertions, 4 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
diff --git a/resources/shaders/objects/sphere.glsl b/resources/shaders/objects/sphere.glsl
deleted file mode 100644
index a3d25eb..0000000
--- a/resources/shaders/objects/sphere.glsl
+++ /dev/null
@@ -1,4 +0,0 @@
-
-float Sphere(vec3 ray_position, vec3 sphere_position){
-
-} \ No newline at end of file