Pan texture to match camera

Hi, everyone.

I have a texture on the outside of a sphere. The texture has cross on it and I would like that cross to the face the camera from any angle using UV panning.

I almost have this working with the CameraDirectionVector node, but it won’t pan the texture all the way around.

I don’t want to use dynamic material with a blueprint tick because that seems costly and inelegant. I’m considering trying to edit the engine source to modify an existing material node, but I’m not sure how much access you’re given to them or how easy they are to find.


Hopefully one of you knows a solution.


Times like these its handy to see whats going on by plugging things into the debug nodes.
try plugging in the CameraDirectionVector into a “DebugFloat3Values” node.
preview that node and change the preview mesh to a cube.
Rotate the camera about in the preview window.

Great idea! Thanks, Opamp. It looks like it’s radians, instead of degrees. If that’s the case then it shouldn’t be too hard to convert it :wink:

Are you sure?
I believe its just the world space direction vector of the camera normalized between -1 and 1.

I’m never really sure of anything, but VectorToRadialValue seems to work.

pan texture to face camera.png

This is what all the trouble was for, a fairly inefficient cel shade material. Without the texture pan method, this wouldn’t have a dark side.

Looking good.