How to use GL_REPEAT to repeat only a selection of a texture atlas? (OpenGL)

前端 未结 6 1855
臣服心动
臣服心动 2021-02-12 19:00

How can I repeat a selection of a texture atlas?

For example, my sprite (selection) is within the texture coordinates:

GLfloat textureC         


        
6条回答
  •  后悔当初
    2021-02-12 19:34

    Can be done with modulo of your tex-coords in shader. The mod will repeat your sub range coords.

提交回复
热议问题