Sign in to follow this  
Solance

Question on textures clippings

Recommended Posts

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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this