开发者

OpenGL texture tiling/repeating with matrix

开发者 https://www.devze.com 2023-01-15 12:31 出处:网络
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开发者_如何学C a way I can do texture tiling with the OpenGL tex

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开发者_如何学C a way I can do texture tiling with the OpenGL texture matrix?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消