Jump to content
  • Advertisement
Sign in to follow this  
Relfos

Seams between tiles

This topic is 2366 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!