Hello Guest

Problem with texture Mapping

  • 2 Replies
Problem with texture Mapping
« on: May 14, 2005, 18:43:47 »
Hallo everybody,

many hours of the past months, i've spent developing a game using the java lightweight game library and now it's the first time, i have to face a problem which seems unsolvable to me.

Some textures (with transparent backgrounds) reach the edges on one side, and when they are mapped and displayed in the game, you can see a small stripe on the opposite side, which is very annoying.

If anyone of you could possibly tell me what to do, or give some hints, what the problem could be, i would be very grateful.



Problem with texture Mapping
« Reply #1 on: May 14, 2005, 20:10:25 »
Use clamping so the tile is not repeated/tiled:

Code: [Select]
boolean clamp = ...;

GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, clamp ? GL11.GL_CLAMP : GL11.GL_REPEAT);
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, clamp ? GL11.GL_CLAMP : GL11.GL_REPEAT);

« Reply #2 on: May 15, 2005, 21:19:23 »
thank you!

seems to work!