Skip to main content
GameDev.net gamedev.net
🔒 Locked

Question on textures clippings

Started by Solance Nov 6, 2006 at 11:02 PM 0 replies 800+ views
Original Post
Solance
Solance
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]
MARS_999
MARS_999
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.