によって Mike Ton 8年前.
393
もっと見る
// 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.