по Mike Ton 8 лет назад
380
Больше похоже на это
// 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.