Author Topic: texture repeat mode support  (Read 2125 times)

Offline mxar

  • int
  • **
  • Posts: 78
    • View Profile
texture repeat mode support
« on: October 11, 2018, 02:33:03 pm »
Hi,

I'm  wondering if it is possible to set a repeat mode for a texture like the one in the following Opengl code.


GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_REPEAT);
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_REPEAT);

If yes then is it possible to set the number of repetition in S and T?

thanks


Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: texture repeat mode support
« Reply #1 on: October 11, 2018, 03:54:58 pm »
Yes, you can use this http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Texture.html#setClamping(boolean). To repeat properly, your model has to be build in a way so this makes sense, of course (i.e. using uv-coodinates <0 or >1 for some polygons). This setting (as well as the GL settings you've mentioned) don't make textures magically repeat whose uv-coordinates are just between 0 and 1.
However, you can't specify the number of repeats because that's defined by the way in which the model has been build. It's NOT a texture related attribute.

Edit: Added a 'not' where it belonged...
« Last Edit: October 12, 2018, 07:56:10 am by EgonOlsen »

Offline mxar

  • int
  • **
  • Posts: 78
    • View Profile
Re: texture repeat mode support
« Reply #2 on: October 11, 2018, 06:53:48 pm »
Thanks for the answer.