0
\$\begingroup\$

Is there a way to change the UV's origin (bottom-left) on shader?

\$\endgroup\$
3
\$\begingroup\$

Yes, you can use a texture matrix. In addition to your model, view, and projection matrices, you can pass a texture matrix to your shader. Before using the UV coordinates, you can multiply them by the matrix and use the result of the multiplication. For something as simple as just a translation, you could just pass a vector with the translation in it, and add that to the UV coords, but a matrix is more general if you change your mind later.

\$\endgroup\$
  • \$\begingroup\$ ok i'll try that! \$\endgroup\$ – khofez Nov 15 '16 at 22:56
  • \$\begingroup\$ Just want to say thank you ! i did what you said, and it works perfectly! \$\endgroup\$ – khofez Nov 20 '16 at 12:12
  • \$\begingroup\$ Sure thing! If it solved your problem, you can check the green checkmark above (just below the count) to let others know that this worked. \$\endgroup\$ – user1118321 Nov 20 '16 at 16:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.