Game Development Community

Best way to get rid of normal map seams?

by Duion · in Artist Corner · 08/04/2013 (7:06 pm) · 47 replies

So I just made a individual texture map for a model to get rid of the seams just to see they are back there when I apply the normal map.
Any experienced artist here who has a good solution for this?

It looks like that:
s1.directupload.net/images/130805/4bpkrfsu.jpg
And this is the original seamless texture without normal map:
s1.directupload.net/images/130805/e29tmf48.jpg
I found that other engines and modeling programs seem to have some fancy buttons and options to play around with, but in Torque I have not found options for normal maps so far and in blender it did not look that bad.
#21
08/06/2013 (1:58 pm)
I think you are right. The gamedev comments indicated you sometimes just have to make the model so you can hide the seams. With rocks that would be simple by putting a crack in them. Other structures usually have sharp edges you can use.
#22
08/22/2013 (2:55 am)
These rocks have no crack, but I found when you generate a normal map with small pattern, then it is not much visible. When you generate normal maps with an algorithm you can chose between small and large bumps, so you have to chose as small as possible. Example if you can chose between 3x3, 5x5, 7x7 and 9x9 chose 3x3 this will generate small patterns causing small seam.
#23
08/22/2013 (7:22 am)
Are you creating the normal map from the texture ? If so then thats the problem, because of the orientation of the UV islands.

When generating from the diffuse, the highlight/shadows are all projected in the same direction, which is why you have shadows next to highlights causing the seam, because when your normal is wrapped around the model, its orientation changes.

To hide them or minimise them, it will take a bit of work remapping the UV's, pull it open in UU3D and reorientate the islands of the diffuse to get roughly the same seam edges next to eachother, that way the shadows will be heading in roughly the right direction minimising the seams. You could then open the normal back up afterwards in photoshop and feather out the edges of each island a little so they "overlap" into nothing, as creating from a UV will usually end up with a very distinct border around the island especially if the diffuse is on a flat black/white background
#24
08/22/2013 (8:04 am)
Does not help, if you bake the normals you have the same issue and remapping the UV's also does not help, since the sides never fully fit to each other and also this will be so much work, that you can almost build completely new models in that time.
I have some other stones where I made square UV-islands in all the same orientations and they seem to work, even though the normals are generated from texture, so I kept on this way.

There is always a seam even in the diffuse texture, if the UV-maps do not end straight, because of different orientation. Only way to avoid that is to try to make straight seams and not rotating the UV-maps.
For example cut the shape horizontally or vertically in half / half and project straight onto it.
#25
08/22/2013 (9:26 am)
Without actually reading through the thread -

Just to check, you exported the nm with wrap/tile on and axisY inverted? Also try saving as the _nm/dxt5nm for dds.
#26
08/22/2013 (9:48 am)
This is not a tiling texture so wrap/tile will not do anything and I have no idea what the dxt5nm format does, I tested and it looks no different.
#27
08/22/2013 (2:48 pm)
On my non-tiling textures I always found the UV went a few pixels over the UVmap ... I think it was 1px for 256, 2px for 512, 4px for 1024, etc ...

So I would copy the #pixels on the image or make the UV # pixels shorter (this is working with old Blender).

Yeah, I know it's a pain in the backside, but it's something which I observed through testing.
#28
08/22/2013 (2:50 pm)
Yes, I already extended the texture over the UV-map seams to cover that up, does not help.
#29
08/23/2013 (5:34 am)
Duion, im not suggesting it as a 'its possible it is this' kind of case, im making a statement that the reason you get the "seams" showing up like this is not because of the texture, or the UV seams not lining up, it is because the shadow on the normal map is being projected from the wrong angle when its wrapped around the model, the orientation is wrong. When the normal map is generated from the texture all the shadows and highlights are projected from the same direction relative to how the UV islands are angled on your map.

In UU3D for example, select the area on your UV map, and you will see the edges of it on your model highlighted in red around the tri's, find the island thats next to it and select that, see if the edge's are in a contiguous direction with eachother, if they arent and they are opposite sides as such, that is why the seam is created like that, because one island, when the model is that way around, is trying to behave like its a shadowed area instead of a highlighted area to match up with the opposing side...

If you want to upload that rock somewhere with the textures, ill have a look and fix it to show what i mean. or mail it to fenyx83@gmail

[Edit]
www.torqueterrains.com/Images/duionrock
The bit squared in red, look at it, the highlight turns into a shadow and vice versa at the seam, the orientation is wrong for that island on the models UV.
#30
08/23/2013 (1:59 pm)
Can this be fixed by doing a different kind of UV baking? Or am I completely missing the idea of an island? Is it a UV projection issue or the way the engine uses the UV? Or a misconception about both?
#31
08/23/2013 (2:40 pm)
Ok, heres one of mine that has bad seams cause of lazy boxmapping when i made it ages ago. hopefully the step by steps through the screenshot wall will explain what i mean by orientation of the normal map...

Model with diffuse works fine in T3D, because it is flat colour data, no dynamic lighting as such is being done to it:
torqueterrains.com/Images/UV6
Adding the normal map breaks it, visible seams:
torqueterrains.com/Images/UV7
Taking the model into UU3D to see how its mapped shows a 'neat' layout from being box projection mapped:
torqueterrains.com/Images/UV1
Selecting one of the UV islands you can see which edges that matches upto all around it (look for the green lines highlighted on the other islands, thats where this one connects too, all looks ok at the moment but...
torqueterrains.com/Images/UV2
When selecting just across 1 edge, you can see that its trying to latch onto an island that has an orientation 90 degrees off from it
torqueterrains.com/Images/UV3
zooming into it with it textured shows this, youll notice to the left that its shadowed in a different direction to whats on the other side
torqueterrains.com/Images/UV4torqueterrains.com/Images/UV5
To fix it means spinning that island 90 degrees, so its got the correct orientation to the rest of it, however, you'll then have to retexture it and recreate the normal map as the corrected UV's will no longer match up with your diffuse texture... so its not just a 2 minute job
#32
08/23/2013 (6:12 pm)
I've found a pretty nifty way around this in Blender, but it does require a little bit of extra time and care :)

First of, create your low-poly model. UV unwrap it (don't use Smart UV unwrap you lazy bastard) and paint some textures in Texture Paint mode. Then, duplicate the object and apply a subdivision surface modifier until you reach an amount of polys that will fit your model (I set it to a million polys). Now, add a Displacement modifier and use the UV unwrapped texture. Set the Texture Coordinates to UV and the strength to something that makes sense and apply the modifier. Now, just bake your normals from the high poly mesh to the low poly mesh.

Here's what I did in about 5 minutes after thinking about how to do this for about a week.

before:
s22.postimg.org/gkycjla0x/without_Normal.png
after:
s22.postimg.org/cd3kau8ld/with_Normal.png

Note that this model sucks, and if you spend some actual time doing this, you'll get more decent results than this.
#33
08/23/2013 (8:05 pm)
These pictures do not show much, could be any model, the normal seams are only visible between light and shadow side and with such small bumps probably not much at all, since you have to go very close to detect them.

But using displacement of the UV-map is a good idea, since you will not likely bake geometry over the seams.

I found another cheap solution, just use sphere projection, on a sphere there are no seams, just two not so nice spots, a good compromise.

If you look at a globe of planet earth, then you can see why they use sphere projection on that, because it looks fine everywhere, just not at the poles.
#34
08/23/2013 (8:47 pm)
I should've probably made it a bit better and a bit less jaggedy, but it does indeed work. I'm glad that at least a bit of this is valuable to you.

Also, there are better ways to UV unwrap a sphere when you have a flat texture (say for planets or moons), but that's not really relevant here.
#35
08/23/2013 (9:37 pm)
Hm false alarm, does not work.

s1.directupload.net/images/130824/pwrodgul.jpg
#36
08/24/2013 (6:38 am)
Well, this sucks. I'll try to find another way around this. Just an idea from the top of my head, maybe you can sculpt the UV mapped texture on the high poly mesh? That way you could have much more control, but I'm not sure if it even works.
#37
08/25/2013 (4:14 pm)
@Andy,
This just means to me that making the UV in the first place takes more time and patience. Thanks for the very clear explanation.
#38
08/25/2013 (6:07 pm)
Im about ready to admit defeat on this one, Because i have a load of rock models that I have to fix this too, ive just gone through each and every possible way of making UV's in UU3d, and retexturing it, and each time I come out with a seam.

The problem I believe is not the UV's themselves, but when the normal map is generated from texture, as up and down etc is relative to the UV layout for the way its shadows are generated for the normal map. If a normal map is baked from a high poly model, i dont believe this problem would arise but its when a normal is made from a texture that it happens.

The lesser of the evils seems to be either capped cylindrical mapping, but you still end up with a seam either end when viewed from one side... or spherical but youll have a bit of weirdness going on at each cap point...
#39
08/26/2013 (4:24 am)
I just proved that baking is no different than generating from texture.

Solutions I found so far are:

1.Using small pattern normal map with no big bumps, so there will be no big shadow areas which can cause a big seam. Easy solution, but seams are still there, just smaller.

2.Spherical mapping, no seams but ugly at each pole, probably worth the compromise.

3.Using inline edges. I found a tutorial for this here ddnetworkofartists.net/index.php?itemid=34
Much work and can get difficult to do on round shapes, but will solve the problem best.

4.Just paint over the seams in image editor with 128.128.255, will simulate the same effect as inline edges, but you have no normal effect around the seams, which may be ugly also.

5.Build so this problem does not occur, like creating sharp edges or grooving where you can hide the seams in.
#40
08/26/2013 (5:06 am)
Try a combination of painting with 128 128 255 (4) using a brush that's not fully opaque and following the contours of the material (normal slopes: strong blue, yellow, cyan or magenta) and adding a smaller pattern (1) to cover that up. Using a screenshot of the UV editor as overlay will greatly help as I mentioned before. The trick is to avoid painting straight lines, but more like Bob Ross, painting with natural strokes :)

Instead of adding the smaller pattern in the normal map you can experiment with detail > normal in the material editor. Adding a tillable map there will be more effective in covering up seams and other issues. Also adding diffuse detail will greatly improve the visual appearance of your rocks.