# How to create an accurate procedural spin gradient?

I created this texture in Photoshop. It's 4096x4096 pixels, Grayscale, 16-bit, PNG. At 1.8MB the file size is reasonable, but I feel like if I could create this procedurally with nodes it would be considerably more memory-efficient, and possibly even more accurate. (I do get small artifacts when driving a ColorRamp with this texture - albeit they're only noticeable when zoomed in close.)

This is the sort of case where I usually give up and use textures, but I thought someone who is good with math might be willing to have a go at this... :-)

Furthermore, I just noticed that when this is fed into an equally-spaced 12-band ColorRamp, the bands in the mapped result are not equally spaced. So my texture doesn't serve as a very accurate map. This may be due to color space issues, and I will try to dig further in search of the cause. But this is all the more reason to try for a more precise procedural solution.

Above: The first and last bands of this color ramp are visibly wider than the others, indicating that the gradient is not distributed linearly around the circular path.

Quite an easy thing to do procedurally, since radial gradient is already there in the Gradient Texture node, just select Radial mode and use Object space for the centre of the texture to be at the origin of the plane.

• Wow! So easy I feel foolish for asking now! I guess I never tried Radial with Object space before. Well that is perfect and solves everything for me. Thanks! Aug 27, 2021 at 7:16
• Doesn't seem foolish to me :D I mean, I certainly did not know it's a thing or how one would call it before I found out about the node just by exploring. Aug 27, 2021 at 7:32

I ran into a similar problem when trying to make "radial polka dots" and found this thread. Expanding on Martynas Žiemys technique, I came up with this:

Still using the object vector from before, I generate a quadratic sphere and map the Arccosine value from -1 to 1 for the X component.

I use the radial texture from before mapped from -1 to 1 for the Y component.

The Z component simply carries over, and all get combined to a vector. The rest is hopefully self explanitory.

I hope this is helpful to someone in the future. Sorry if it is super obvious, and also sorry for my English, spelling and Grammar. I'm from America.

• Hey, that's cool! Probably can be modified further to create other interesting effects too. I didn't notice at the time you posted, but thanks for sharing. :-) May 31, 2023 at 5:15