Moving a texture on a shape

I have a large Box setup like a backdrop with a starfield jpg on it, i wanted to simply make it wrap continuously in one direction to make it look like the viewer is moving (camera is stationary).

I’ve seen the tutorial which adjusts textcoords to shrink and expand a texture on a trimesh but I want to wrap it in one direction, never changing the size. What methods would I need to employ to accomplish this?

You can put 2 Spheres: The outer one is black, and the inner one has a texture with most of alpha value so the alpha will be seen as black. Just rotate the inner sphere and you will have stars moving :slight_smile:

assume a quad for simplicity here

we have four texturecoordinates:



00-10

| |

01-11



now if we have the repeatmode for the texturewrap and move them like this



0.1,0-1.1,0

| |

0.1,1-1.1,1



we moved it by 10% right

Sof or one line with 10 pixel they will have this value

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0=0 0.1

Note this will of course look horrible if 0 and 1 do not fit together



bad repeating texture with seams





and a good one if you reapeat tihs you will not see where repeation beginns because the edges fit perfectly with the opposite side





Note that you can probably save performance, if you don’t change the texturecoordinates in software, but with shaders and just pass them a movex, movey uniform. However you have to write the shader for this yourself.