opengl: how to avoid texture scaling

后端 未结 3 1953
有刺的猬
有刺的猬 2021-01-03 10:36

How do I apply a repeating texture that always maintains its original scale (1 pixel in the texture = 1 pixel on screen), regardless of the vertex data it is applie

3条回答
  •  时光取名叫无心
    2021-01-03 10:46

    I'm not really sure, but try something like this:

    Take your model matrix, perspective matrix, and stuff like that. Mash them together in the proper order by multiplying them. Take that matrix's inverse. Multiply it by your texture matrix (which is probably the identity matrix). Set that as your texture matrix.

提交回复
热议问题