Parallax effect that isn't disjointed by UV orientation

Need some help figuring out a ‘panning’ layered node network because I’m smooth brain. I’m using a mask to mix a top set of stationary textures with an underlying texture to make it look like there’s a ‘window’ into a far away field of stars or pocket dimension. Hooking up the Camera input almost accomplishes what I’m after, but the underlying texture remains stationary relative to the camera movement. What I would like is for there to be a panning or parallax effect when the camera moves. Sort of like if there were a wrapping skybox or environment texture only visible through the mask. I notice that I can pan the texture with the Rotation on the Mapping node but I’m not sure what I can plug in there to get what I want.




I’ve looked at various tutorials and example node networks for parallax style effects and they all have the problem that they’re really only intended to work on a single surface with contiguous UVs, but it’s not possible to UV an icosahedron like that. This might not be a problem if the interior texture was a simple star pattern (indistinguishable noise) but I’ve also got some drawn constellations on there and they don’t coherently cross over the shell borders when using the tutorial techniques.

See the difference below where the first video has the Camera mapping and the second video is using one of the tutorial methods. You can see that the constellations are in different orientations and don’t cross the faces in the second video; each face is sliding independently.


In fact, there are limitations when there are seams in the UV space… But in your case, it looks you won’t have any problem…
Your depth texture is not contiguous at the icosahedron’s edges (just at the center of the faces), so the parallax shader won’t need any transformation of the UV coordinates at possible seams/discontinuities in the UV space.
You might need, thought, to have all the faces as islands, with a margin enough to hold texture information for each of them.

The limitation occurs when you’re sampling one triangle, but you need the texture coordinate of a non-adjacent triangle (in UV space). So the algorithm for finding the ‘projected’ texel will fail, as that texel may be somewhere else in the image texture.

Yes I do have the benefit of fading to opaque at the actual UV seams and edge bevels so any weirdness at those transitions is hidden as part of the visual design.

The UVs look like this but I can always add a second UV channel for the interior effect with a different layout if needed.

In fact I did experiment with making a second UV channel and orienting all the islands the same and stacking them. But of course that made the texture duplicated on each face and oriented toward the top of the texture, whereas in 3D space the “tops” of each triangle are all pointed in different directions instead of having a universal up direction.

But again, using the Camera output from the Texture Coordinate node and then changing the values of the Rotation in the Mapping node is effective for panning the texture while allowing it to cross UV islands the way I want, I just don’t know what vector needs to be plugged into Rotation to get it to react to camera orientation.

-Edit:
Actually I did discover that there’s a stretching issue with some rotation values. Sigh.