av Mike Ton för 8 årar sedan
393
Mer av detta
// 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.