by Mike Ton 8 years ago
380
More like this
// This now belongs to a family of functions called signed distance functions
0 == sphere surface
negative == inside sphere
positive == outside sphere
float sphereHit (float3 p) { ... }
return distance(p,_Centre) - _Radius;
bool sphereHit (float3 p) { ... }
return distance(p,_Centre) < _Radius;
A variant of raymarching that can render semitransparent surfaces such as fog and smoke.