Avoid Seams in Textured Objects!

Hey! I have seen SOOO many posts in the game engine section of BlenderArtists on the subject of bad seams…

Example:

Heres what I suggest to fix this, if the farther away from an object you are the worse the seam separation occurs:

First, make the object a JPEG!!! with the background color the same as the general color of the object.

Second, when preparing the UV’s in the first place, leave about 10-20 pixels in between the ends of the maps and the uv’s. example:


enjoy! :smiley:

1 Like

My I ask why JPEG? To prevent transparency issues?

Well, a couple reasons come instantly to my mind.

One: If you use a .png on a texture that doesn’t need transparency, yes it could cause more issues than non-transparent textures, but the main reason is that it takes up more memory than JPEG’s :slight_smile:

Two: If you fill the background with the color as shown in the second picture above… then the seams won’t be nearly as visible as the first picture.

THANKS…helpfull.

I happen to have a strong personal dislike toward jpegs. I feel the compression artifacts aren’t worth the space saved.

And for the record the extra margin around UV islands is most likely helping with problems from mipmapping.

Image format
The image format only matters on disc space.
In memory all textures are converted to the format the GPU supports.

I do not think the image format influences visible seems.

Why are there visible seams?
The described problem with the seams has a quite simple reason.

Usually only the texture pixels inside the UV-face (including the edges) are used to draw the rendered face.

But the texture is not used directly. Before it is used as texture it is processed by the OpenGL mid-map filter. The default is to blur/anti-alias the texture. A side effect of this is that the color of a texture pixel is mixed with the color of it’s surrounding pixels.

On the edges the surrounding pixels are not all part of the UV-face. Therefore the rendered face can get color information from outside the UV-face (e.g. from a black border).


This is very noticeable on high contrast textures e.g. when a skin texture is bordered by black color.

How to avoid visible seams:
A) Switch off mip-mapping to prevent the color mix. Unfortunately the resulting render looks not that good anymore. Wich means this is not really an option.

B) Continue the texture over the borders of the UV-face as recommended by micha702. Keep in mind to keep distance to the texture borders too.

There are two ways to do that:

I hope it helps

Well, thanks monster for this detailed explanation. I feel like I understand what is going on a lot more now.

Yes, thanks Monster, you know more about what you are talking about than I. :slight_smile: Hope this thread is useful to some people!

Just want to provide some background information. I think it is important to know about that. Micah your solution is absolutely fine.

I think it is worth a resource.

You might want to change the title of the thread as it does not only belong to characters (edit top post - advanced mode). It belongs to any object with textures. E.g. “Avoid seems in textured objects”.

.Jpeg and mip mapping!??
So mip maps in BGE are calculated in real time, rather then saving them beforehand?
Im not very experienced in blender game engine or game engines in general, but the game engine I previously worked with required that you stored the mip maps within the texture itself beforehand, fx as a .DDS texture.

So im wondering if you know whether theres actually benefit in using an image format that stores mip maps within in BGE?

(Also for those reading this and dont know exacly what I am talking about read this and look at the images)

If you want a completely seamless texture, the best way is to make another UV layer and then unwrap the texture again, but avoiding the original seams. Now bake your original texture on to a new UV sheet and set the border in bake to about 12. This will leave a border of pixels around each UV island which are the same as the neighboring pixels. You can also go back and clean up your original seams by using a blur or clone tool where they don’t match well.

Yes. It is an OpenGL feature and enabled by default.

As far as I know you can use DDS with it’s mip-maps, but I never tried.

Update:

With “Texture Paint” you set the margin with the “Bleed” parameter:

<T> to toggle tool options
Project Paint/Bleed

I recommend at least a margin of 4. You might wan to check the texture at various detail levels. Be aware the “seam” effect increases with zoomed out (small model) view rather than zoomed in (large model).

This is what I do for my baking. After creating seams UV unwrap with a margin of 0.08. Go into the uvw editior and select the border of each island and scale it up so that the edges aren’t packed too closely. Bake the Ambient occ or other map with a margin set to 5 px. For Ambient occ I also turn on normalised so ugly artifacts and noise will be less visible.

After baking apply the bake image with shadeless material to check for seams … if they still show up. Easy fix! Go back to your UVW and scale your outer edges back in to where they were before! Fixed!

Additional notes :
Also before baking I would add a subdiv modifier to make sure edges of my model’s tesellation don’t show up, however this will require you to model carefully as subdiv modifier may change the shape and outline of your model alot if not done correctly.


^ Before Outer edge Scaling.


^ After Scaling.

That’s all folks!