blob: e69deaadf838cb3a26d42fbec7ce9f33b9996ca6 (
plain)
1
2
3
4
5
6
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);
}
|