So i need a Gradient on a disk to rotate in such a way that it follows the Camera. This is what i got:
The Gradient and the blue line towards the Camera. And this is what i want:
Now my idea was to use Trig. Since i know the lenght to the Camera and the Y or X depth i can theoretically calculate the relative angle between the disk and the Camera depending on the Location. Like this.
However when i go to impliment this angle i get this
And i dont see where the problem is. The math is correct, i have the right axis and so on. And i can clearly rotate the Gradient manually. All i do is plug the node setup above into the Input for the Gradient Z Angle. If i do it manually it works, put with the Node set up i get this weird result.
My suspicion is that Blender does the Angle calculation for all pixels of the Disk and thusly arrives at widly differnt angles for each point. Instead of Rotating them all as a group they get rotate individiually.
Now yes i could keyframe this but i would like to have this gradiant track the Camera a bit more precisly. Also i cant rotate the disk, it has to be the shader.
So are there any other ways ? What am i doing work ?
For those wondering why i need this, i am building a Black Hole Shader that tries to impliment all physical effects. This shader graident tracking stuff is to account for Doppler effect. Preview seen below: