Question on textures clippings

Started by
0 comments, last by MARS_999 17 years, 5 months ago
this code draws a specific portion of the texture, yet it seems like every few tiles it will grab a small sliver of the portion left or right of it...

glTexCoord2f(float(((.25) * (tilex))), float(((.25) * ((tiley))))); glVertex3f(float(x), float(y), 0.0f);
		glTexCoord2f(float(((.25) * (tilex+1))), float(((.25) * ((tiley))))); glVertex3f(float((x + 1)), float(y), 0.0f);
		glTexCoord2f(float(((.25) * (tilex+1))), float(((.25) * (tiley+1)))); glVertex3f(float((x + 1)), float((y + 1)), 0.0f);
		glTexCoord2f(float(((.25) * (tilex))), float(((.25) * (tiley+1)))); glVertex3f(float(x), float((y + 1)), 0.0f);
Edit: i do believe i resolved the problem with this

glTexCoord2f(float(((.25) * (tilex))+.01), float(((.25) * ((tiley))))+.01); glVertex3f(float(x), float(y), 0.0f);
		glTexCoord2f(float(((.25) * (tilex+1))-.01), float(((.25) * ((tiley))))+.01); glVertex3f(float((x + 1)), float(y), 0.0f);
		glTexCoord2f(float(((.25) * (tilex+1))-.01), float(((.25) * (tiley+1)))-.01); glVertex3f(float((x + 1)), float((y + 1)), 0.0f);
		glTexCoord2f(float(((.25) * (tilex))+.01), float(((.25) * (tiley+1)))-.01); glVertex3f(float(x), float((y + 1)), 0.0f);
[Edited by - Solance on November 6, 2006 11:22:36 PM]
Advertisement
What mode are you using? GL_REPEAT? GL_CLAMP? Are you using mipmapping? If so don't use trilinear filtering or anisotropy filtering. Use nearest.

This topic is closed to new replies.

Advertisement