Skip to content

Instantly share code, notes, and snippets.

@andybak
Created August 29, 2017 09:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andybak/9ac5da62d5cfb04afdbd9a658b9ff06a to your computer and use it in GitHub Desktop.
Save andybak/9ac5da62d5cfb04afdbd9a658b9ff06a to your computer and use it in GitHub Desktop.
inline float DistanceFunction(float3 pos)
{
float t = myMod(_Time.x * 14, 360);
//pModMirror2(pos.xy, float2(t,t));
//pModMirror2(pos.xz, t);
pModPolar(pos.xz, t);
float box = Box(pos, float3(1,1,1));
float sphere = Sphere(pos - float3(1,1,1), 1);
float d = min(box,sphere);
float guard = -fBoxCheap(pos, float3(.25,.25,.25));
guard = abs(guard) + .5;
return min(d,guard);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment