Disabling texture filtering ?

Started by
0 comments, last by cmdkeen 22 years, 1 month ago
Hello, I''m making a 2d sprite library using OpenGl. I have a texture that contains multiple sprites. I display each sprite by drawing a textured quad and setting texture coordinates in a way only the part of the texture I want to be displayed will be drawn. This works fine but there''s one problem: due to texture filtering I get parts of the texture that are around my sprite blurred to the border of my sprite. For example if I have a texture that contains a white and a blue rect and I display only the blue part of it, the border of my quad on screen gets a bit lighter because of the texture filtering. How can I disable this ? I would like filtering to be still enabled but not at the edges of my quads. thanks in advandce http://www.turtlegame.de.vu- my 2D Platformer. Version 3 available since Feb'' 02 ! [Edited by - cmdkeen on May 19, 2008 8:38:55 PM]
Advertisement
Either make each texture for each tile, and use GL_CLAMP_TO_EDGE as your S and T texture wrap mode, or make your own borders between tiles which match the edge (note that this will only work well if you''re not using mipmapping).

This topic is closed to new replies.

Advertisement