Seams between tiles

Started by
21 comments, last by szecs 11 years, 10 months ago
I'm creating a 3d tile based game, where a level is composed of lots of small tiles 10x10 in size, that are stitched together in a big mesh during loading.
The problem is, there are some visible seams between each tile, that seem to be dependent of the camera position.
What could be causing this?
The problem looks a lot worse when multisampling is enabled (and the problem appears on both PC and iPhone port)
seamsabug.jpg
Advertisement
Have a look at: http://www.sjbaker.org/steve/omniv/tiling_textures.html
sadly, opengl hasnt got past the point where you have to make the image bigger because sampling reads outside the borders
this is especially the case for atlasing
if you have any plans to allow people with older (power of 2) cards, your textures suddenly get twice as big :)
if it was up to me, this shouldnt be needed

most people will tell you to use "border", but border doesnt work with multisampling
so, if you plan on enabling GL_MULTISAMPLE, then you must make all your textures twice as big, place the actual texture in the middle, and extrude all the edge pixels out to the sides
then your texcoords will be something like { 0.0 + 0.25, 1.0 - 0.25 } etc. where 0.25 is a const float based on your particular texture sizes

sadly, opengl hasnt got past the point where you have to make the image bigger because sampling reads outside the borders
this is especially the case for atlasing
if you have any plans to allow people with older (power of 2) cards, your textures suddenly get twice as big :)
if it was up to me, this shouldnt be needed


Gotten past the point?
Textures work precisely like they are supposed to. And what does power of 2 have to do with anything about borders?
That certainly doesn't require your textures to be twice as big, especially not in a texture atlas. Also cards that require powers of two get more and more rare.


most people will tell you to use "border", but border doesnt work with multisampling
so, if you plan on enabling GL_MULTISAMPLE, then you must make all your textures twice as big, place the actual texture in the middle, and extrude all the edge pixels out to the sides
then your texcoords will be something like { 0.0 + 0.25, 1.0 - 0.25 } etc. where 0.25 is a const float based on your particular texture sizes
[/quote]

Why doesn't it work?
And why in the world would it require textures to be TWICE as big?
That's certainly not the case either.
Just add a one-pixel wide border.

wisdom


i just havent gotten it to work in my case, ive tried many times :)
the 2^n may be just me reading old tutorials, maybe wrong impression
and the atlasing thing was based on the first assumption, that multisampling requires even more pixels

you see, it works fine with a border until i move far away, then the seams start appearing
Could be the derivatives being messed up. Are you storing the tiles in a single texture?
Yes, all tiles are stored in a single 512x512. This does not use shaders, as it is an iPhone game.
For now setting the texture filter as GL_NEAREST_MIPMAP_NEAREST fixed the issue (well, almost).
For the other cases, slighty offsetting the UV coords of the tiles one pixel fixed it.
i just checked my code to find out why im doing what i do :)
and yes, im also storing "tiles" in single textures, so i need internal borders too
i think ill try to reduce the images somewhat :)
Does the view-dependent issue dissappear when you disable mipmapping for the atlas?

This topic is closed to new replies.

Advertisement