Radial UV From Distance function

The line is definitely a derivatives problem.

The other problem is a little more interesting. Ideally obviously you want the arctan to be centered around the point closest to the “ball”, but what does that really mean in the context of 3D space? How do you choose the correct planar projection for your atan2 that looks seamless for any geometry? The answer is you don’t because it’s not possible. This is a fool’s errand that always seems like there should be an answer just out of arms reach. Really it’s the same kind of problem as trying to unwrapping a sphere onto a flat plane.

My suggestion to you is abandon the arctan and attempting a radial V. Instead find some kind of inexpensive 3D simplex noise, or a 3D noise texture. Honestly just a 2D noise texture on the XZ plane might be good enough. Let the distance based U drive the main shape and use a fairly wide noise just to perturb the effect.

1 Like