Handling huge textures on a quad to simulate landscapes

Hello !

I’m trying to learn how to handle large textures mapping. I have a huge picture (could be like 5x5 640*480 screens) mapped on a quad that represent a landscape and I would like to be able to scroll around. What is the best way to do this so it doesnt only run on high end cards ? I don’t want any joint border effect to be visible between tiles if I have to tile my picture… I need to give the user the illusion its just one big picture.


you have to tile it on to several quads… the problem with the borders are easy to get if u dont use the coordinates 0 to 1 as left and right for textures, but 1/width to (width-1)/width… (and same for height…)

something like this. play around and you get it…

btw, as long as one pixel on texture is one pixel on screen ( no rotating/3d ), you can use GL_NEAREST filtering with no problems… and then you can use 0 to 1, too

OK now why is that? I’ve never understood this point about texturing (the fact that if you don’t want borders and stuff,don’t use tex coords 0 and 1) What’s the reason for this?

Another thing is,an nVidia guy from the XGDC told me that when I want to draw my HUD in 2D and I want to map 1 texel to 1 pixel,he said to use tex coords from -0.5 to 0.5. He was in a rush and I never had the chance to ask him why.So,can anybody explain this to me?

No, use CLAMP_TO_EDGE. Then you can map the entire texture on the surface.

  • Matt