# Radial vector displacement

I'm struggle with vector displacement shader. I'm trying to do something like reverse cone but I can't figure out how to add radial direction. I would like to use RGB curves like screw (lathe) modifier but in shader. My actual setup:

• Hi, I've got it into Tangent space, but with a limitation. See edit – Robin Betts Mar 27 at 8:30

The strategy in this example is to generate the displaced position Q of the shading point P (in an originally planar Object space), and subtract P from Q to give the displacement vector.

The displacement is masked. If P is outside the input Radius (r2 in the tree) from object 0 , it is not displaced. A soft border has been put on the mask to prevent unsightly tearing of the surface.

Q's Z is a mapping of the mask-circle. The circumference of the circle is mapped to Z = 0, the center to Z = (Input) h. The circle is 'drawn upwards' from its center.

Q's X and Y are more easily calculated in polar coordinates. There are 2 groups in the tree, for converting between polar and Cartesian coordinates, so the mapping need only be of r, the radius of P. (Pr -> Qr)

First, Pr, the radius of the shading point, is remapped from 0->r2 to -1->1, so it uses the full range of the Vector Curves node. The result of the curve in the node is then mapped to 0-1. The result, Qr, is recombined with the original theta to get Q's X and Y, and plugged into the 3D vector Q, the displaced position of the shading point. That is then subtracted from the original shading point. The Y and Z components in the Curve node have been set to map to 0.