Created
August 29, 2017 09:17
-
-
Save andybak/9ac5da62d5cfb04afdbd9a658b9ff06a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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