Hi!
I’m trying to make a simple/stylized reflection on windows that’s basically a diagonal line texture that I want to offset on the UV X axis if the camera moves horizontally with the object and on the Y axis if the camera moves vertically. This to creates the illusion that the reflection “changes” based on the viewing angle. It also shouldn’t, preferably, change based on distance to the object as long as the angle is the same (I think that’s how reflections work?).
This will only be used on flat planes so it doesn’t have to apply to other cases, but the planes will be rotated differently in the world.
I’ve tried adding the camera position to the UV coordinates, but that becomes inconsistent if the objects have different rotations.
I’ve also tried using the camera vector, but I only get gradient values which makes the UVs warp into circles (which I solved in some weird ways I no longer understand why I did)
I’ve tried a bunch of things and worked on this material on several occasions during the past year (it’s part of a bigger project) without ever solving it so I think this is just beyond my knowledge.
I would appreciate any help or insight!
Here’s some pics of stuff I’ve tried that hasn’t worked:
When trying it out it seems to give very similar results as my top image, but with fewer nodes, which is nice. But the problem still remains that the lines behave differently based on the rotation of the object as the camera move on different axes.
Here’s a video of what I mean. The first example is how I want all windows to behave in relationship to the camera, regardless of their rotation or the camera’s movement direction in the world:
If the camera moves back and forth the lines shouldn’t move.
Moving sideways the lines should move sideways.
Moving up and down the lines should move up and down.
But as seen in my video, this doesn’t work if the surface has been rotated as the relation between the world axes and the object’s rotation changes.
So I would like to have something that works universally, regardless of the object’s rotation?