Justin Meiners
Justin Meiners

Reputation: 11113

OpenGL texture tiling/repeating with matrix

I know you can do texture tiling/repeating in OpenGL by setting the texture coordinates to values greater than 1.0 (eg 2.0) but is there a way I can do texture tiling with the OpenGL texture matrix?

Upvotes: 1

Views: 1101

Answers (1)

Calvin1602
Calvin1602

Reputation: 9547

Sure

Your input UVs are multiplied by the texture matrix to give the actual UVs.

If you input (1,1,0,0) and want (2,2,0,0), such a matrix could be

2 0 0 0
0 2 0 0
0 0 1 0
0 0 0 1

Of course, this is just an example, but your question is quite generic.

Upvotes: 3

Related Questions