# How can I rotate a spherical texture without getting a distortion?

I've tried to search for tutorials but they all say I have to have a Texture Cordinate Node, attach the 'Generated' Output to a Mapping Node, and that one to my Image Texture, and in the Mapping Node to move the Z Rotation and it should work. However I'm getting this weird distortion effect.

Any Idea what to do?

Using UV Map

If that's a NASA mars projection, chances are it's an equirectangular, ie longs -180 to 180 mapped 0 to 1 in U and lats -90 to 90 0 to 1 in V. To make it rotate around the pole to pole axis increment, ie translate (not rotate) the U coordinate. The default uv sphere UV is pretty much the equirectangular projection.

Result with default UV map of default UV sphere. Rotating texture about axis by translating U

Because of the nature of the projection adjusting other values will warp the projection, eg ring the equator with ice lol.

I'm not a big nodes guy, in theory could emulate the UV map using the object vector output and converting it into spherical coordinates with some math nodes.

Give that a go.

Here is the set up the normalized object coordinates are projected into spherical coordinates and fed to the flat image texture (as used above)

by placing the mapping node before the projection, can now rotate freely using use x, y, z rotation.

Using http://celestiamotherlode.net/creators/praesepe/MarsV3-Shaded-2k.jpg and crunching some simple drivers #frame / 30 directly into rotation fields.

Please note: Using the object texture coordinate relies on the object being at location (0, 0, 0) and having origin at center of geometry for the above set up.

Subtracting the object location allows for non global origin object location.

EDIT.

Much simpler using environment texture node as pointed out by @ISCREAM kevin deguisne https://blender.stackexchange.com/a/159521/15543 Have taken the liberty of making an image of the setup.

use the environment texture node and object coordinates , not UVs