Strange Borders

Started by
4 comments, last by Stani R 18 years, 4 months ago
Hi, i have a menu. In the standard resolution (800x600) all the textures aren't scaled. In a bigger resolution (e.g. 1024x768) they are. I use linear filtering to scale them. But there are those borders. When i don't use the linear filtering ( GL_NEAREST instead GL_LINEAR) the borders disappear but so it don't looks well... Here is a screenshoot ( text isn't interesting if you don't unterstand german :) ) Screenshoot
Advertisement
You don't give much info and I didn't understand exactly the situation. You say you use nearest or filtering, scaled or not scaled... but I didn't understand exactly when you have a problem and when not.

1)What is the size of the texture when you have this problem?
2)What is the size of the window?
3)What is the filtering?
4)How do you render this texture(ortho setup, render code)?
1) if you're not working for bluebyte, you're gonna get in trouble *g*
2) try using GL_CLAMP parameters.
3) Is the border color the color next to the image on the texture? it might be taking that color when interpolating.
Here ist a screenshoot with original size (800x600):

800x600

You can compare the two and I hope you see the difference..


mikeman:

1) The size of the textures is different. For example each letter is a texture and the whole background with the ship too. And all have these "borders". But the width and the height of textures are rounded to 2^n. So the rest of the texture has an unknown color. I think there is the problem... I could use GL_NEAREST instead GL_LINEAR. So i don't have the borders but then it looks terrible...

2)800x600 and the other 1024x768

3)GL_LINEAR

4) Simple Ortho Projection ( glOrtho..)
I can post the code tomorrow...


lightbringer:

1) Hmm no. The game needs the orginal Settlers2 files and Settlers2 is abandonware. I think they don't interested any more in the old Settlers Games.
I hate the 3,4 and especially 5. So i want make a remake because I want to play it online :)
2) What do you mean?
3) Yes ( last 4), but there are borders on the left side and at the top and there isn't an other color.
Sry, here's the Screenshoot:

800x600
The borders on the left are probably from wrapping around the texture due to absence of clamping (my best guess, sorry if it's wrong). To enable clamping, when you load the texture and set the filter, do this:

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);

Also, I was making a joke, but actually I also hated Settlers 3+. Anything that brings back settlers 2 is a Good Thing(tm) ^_^.

Edit: that doesn't solve the linear interpolation of the color though (or I might be completely off target), so you might want to make the rest of the texture look the same as the actual image (selber Hintergrund).

This topic is closed to new replies.

Advertisement