Archived

This topic is now archived and is closed to further replies.

Wickeeed

AboUt Offset && Tiling

Recommended Posts

Tiling is a combination of having an clampmode of GL_REPEAT, and having texture coords above the span of 0 to 1 ( if you have a wuad with texture cords from 0 to 2 you end up with 4 copies of the texture on it)

offsetting texturecoords is made by the texture matrix, help on glMatrixMode should give more information.

Share this post


Link to post
Share on other sites
glTexCoord2f(0.0f, 2.0f)



Member of the Shove Pouya Off A Cliff club, SPOAC. (If you wish to join, add this line to your signature.)
Member of "Un-Ban nes8bit" association, UNA (to join put this in your sig)

"C lets you shoot yourself in the foot rather easily. C++ allows you to reuse the bullet!"

Share this post


Link to post
Share on other sites
If you want to enable tiling with a certain texture, then add these lines when creating your texture:

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

Then whenever you supply texture coordinates over 1.0 for that texture, the texture will be tiled.

Share this post


Link to post
Share on other sites