either you just look inside the PolarCoordinates module and make use of the _ Texture Transform_
or you save yourself some performance and do all of that in a pixelshader:
...
//create a 'polar' gradient from the center
//texturecoordinates start on the upper left, so shift by 0.5 to the center
float polGradient = atan2(In.TexCd.y+0.5,In.TexCd.x+0.5);
//the gradient now has a range from -PI to +PI so normalize
polGradient = polGradient/6.2831853 + 0.5;
//use the gradient as rgb value
col.rgb = polGradient;
...
the shifting and rotation still can be done via texturetransform, since that transform modifies TexCd in the vertexshader
and in case you want to control the colors of your gradient:
...
//of course create two color input pins first
col = lerp(color1, color2, polGradient);
...
Thanks woei!
of course - Texture transform. It’s hidden by default
but would be nice to have shader for that
my copy-pasting knowledge in hlsl is not good enough.
Can someone correct syntax error: line 67 pls?
There’s more than an error on line 67.
Also there were some really minor corrections to be done with woei’s code.
To achieve position\rotation transformation you should create other pins to play with tex coords.
You can (should) also remove those Address = WRAP that I put and left there for no reason.