Texture offset look at 3D position
Hi everyone,
i am trying to write a shader with Shader Forge that mimics an eye shader that constantly looks at a given Vector3. But I am overwhelmed by all the necessary space transformations.
I am no coder but here is my thinking process so far: All space transformations ignored, a plane has a material with two slider properties (X & Y) with a range of [-0.5,0.5]. X and Y get added to U and V, and some basic movement is possible. My problem is how to translate a Vector3 (object position) to those two [-0.5,0.5] values. My goal is a shader with a Vector3 property that I can assign an objects position via code, and can assign the material to multiple objects which all look at their specific X and Y position.
I hope that makes at least some sense, code talk makes my head dizzy and I have no clue of the lingo. I don't expect any code examples, but I would be very grateful for any ideas and clues on how to tackle that problem.
EDIT: For clarification, i got something similiar to this. Now I need the math to use it globally with a world position.
Your answer
![](https://koobas.hobune.stream/wayback/20220612120130im_/https://answers.unity.com/themes/thub/images/avi.jpg)