I want to distort a 3D texture around the Z axis in Cycles.
I found here that you can convert cartesian texture coortinates to polar coordinates but the problem is that you end up with a projected 2D texture. I want to preserve all the 3 dimensions and stretch or squash the texture around the Z axis to get a behavior like this :
The idea is to use a gradient node in radial mode and plug it to the angle of a rotation node (just like a Mapping node but with an input socket for the rotation). Since such a node doesn't exist in Blender we make it with math nodes.
First the rotation node itself (it's a node group) :
then the general setup (the green node is the rotation we made above and the yellow node is the one to animate (the second value in the Multiply node) :