I have a 1 meter x 1 meter polygon I made in max. I duplicated it, moved the duplicate 1 meter to the left and then attached and merged the verts. So now I have a 2m x 1m plane.
I then broke and rotated the UVs so my UV texture was mirrored down the middle.
- Everything is a single smoothing group
- I Imported the normal map using normal map compression in unreal.
- This seam is still visible on my mesh even if I flood fill my material with the neutral normal map color
- My verts are welded.
- I tried flipping the red and green channels, but really that's not even relevant because as I stated earlier this seam appears if I flood fill the entire normal map with the neutral color.
If I leave the normal map slot in the material empty this issue does not occur. Yet it does occur with any normal map even one flood filled with R:128 G:128 B:255 What gives?
You can download the FBX (I also tried this with ASE and the exact same thing happens) here:
http://dl.dropbox.com/u/2997790/UDKSeammodel.zip
Replies
Also make sure that when you make your light map UVs that the two sides are welded together.
And this isn't directed specifically at you jocose, but what's with the trend lately of people posting UDK questions outside of the UDK sub forum?
That didn't fix the issue. I get the exact same results.
That said i'm pretty sure its not related to anything in max specifically since the exact same thing happens out of Maya and modo in both the ASE and FBX file formats.
Also I neglected to mention I am using a TGA for my texture so its lossless. I'm hosting the TGA here in case anyone wants to try to use it with the model I posted: http://dl.dropbox.com/u/2997790/floor.tga
I also just noticed that this appears to happen even on the stock checkered material. The seam is so subtle its hard to notice, and really probably wont be an issue when I apply a diffuse color, but I don't get why its happening in the first place. Is unreal broken when it comes to normal map mirroring?
Yes, Unreal is broken when it comes to normal map mirroring. You must mirror your textures horizontally NOT vertically.
Your texture doesn't tile with itself so you are also getting a seam along the mirror edge because it is mip mapping with the opposite side.
EDIT:
It looks like you can get rid of the second problem by changing the Address X and Address Y properties of your texture from TA_Wrap to TA_Mirror.
View -> World Properties -> Lightmass -> Lightmass Settings -> Indirect Normal Influence Boost
Unfortunately it's not a perfect fix
Heres a copy of what I've done:
http://dl.dropbox.com/u/1447878/mirroring_UVs_UDK.zip
BTW Ben, it looks like Modo FBX files dont save out normals correct, and collada files don't re-import correctly? I have only gotten re-importing to work on fbx files from maya and max and ASE files from max
Also changing the lighting boost doesn't appear to have any effect as far as I can tell both sides look the same.
After testing this for several hours I am starting to come to the conclusion that Unreal just screws up the binormal and tangent calculations because it isn't expecting any of the UVs to be flipped. This causes the shading to get screwed on the other side.
What this basically means is that I can't have any normal maps that are where the UVs are flipped. This seams nuts to me but every test I try confirms it.
Has anyone else confirmed this, or has anyone successfully flipped the uvs of a model and not gotten at least a subtle seam? Non-flipped uvs tile PERFECTLY
If you read the last post there it appears as though unreal just plane out does not support mirrored normal maps (either vertically or horizontally) if you have specular. However, I was able to even notice the issue without spec its just more subtle.
Also, I went through every single static mesh in the UDK library and did not find a single one that was mirrored. (Please let me know if you can find one)
I ran some additional tests using a simpler texture and also tried to hide the seam with detail normals.
Here is my conclusion so far:
The total lack of any mirrored assets from the UDK library suggest that mirrored normal maps is not a priority for Epic and so this will probably not get fixed any time soon.
It appears as though the cause of this is that Unreals tangent space calculation does not take into account flipped UVs especially along the V axis.
If you don't use a normal map in your shader this issue does not exist. Straight up per-pixel lighting with a high spec does not produce this issue.
If the engine just isn't calculating things correctly then there is very little that can be done to resolve this.
You have two options:
The second option is the one I'm going to have to go with especially since this is for the PC. You have plenty of texture memory to spare on the PC and if you look at the UVs for the assets in UDK they are completely unoptimized in most cases. Hardly any of the "UV tricks" that I see employed are used at all. Its just about getting things to look good.
If anyone has an opinion to the contrary or thinks they can do better please post back here. All of my files I posted earlier should still work just fine.
I really hope they fix this sometime.
There's something in the graphical programming world that I can't remember that'll mess up if a normalmap is mirrored but still sharing the same set of vertices.
Thanks a bunch for the response.
Yes, in the above example I tried both those tests with another model that had the geometry completely split (the polygons were seprate), and another test where the verts were merged but the smoothing groups were seprate (hard edges), and a final test where the verts were merged and averaged. As one might expect, since it is a flat plane, it looked exactly the same in all cases, it doesn't make a bit of difference.
but here's a UDN page that might help:
http://udn.epicgames.com/Three/LightMapUnwrapping.html
I don't think you should attempt to mirror both horizontally and vertically at the same time like in your latest examples because vertically just does not work well at all. If you look at your new examples the horizontal mirroring is much more successful than your vertical mirroring.
I think you should mirror your mesh triangulation as well as your UVs for best results, though this really only applies to non-flat meshes.
Testing with dynamic lights is a bad idea IMHO because the baked lighting in Unreal will be drastically different from the dynamic lighting.
From my own experience how you lay out your lightmap UVs will have a huge impact on how drastic the mirrored and/or stacked UV seams will be, but only once the lighting is built. I don't think they have any effect when using dynamic lights.
Whenever possible it's a good idea to design your assets with a mirror seam in mind so that you can get away with them with less trouble.
Also as you said, hide them as much as possible as well.
I know what you posted is just for simple example purposes but, just in case: Don't forget you need to recalculate your normal map channels a bit when rotating them, check out these Normal Map Actions for Photoshop by Will "sinistergfx" Fuller for quick normal map 90° rotating.
With all of that said, I've never seen a "perfect" mirror without a "any" seam in Unreal. At best you can only minimize them to being less visible.
EDIT:
For the sake of completeness, here's a post on how I mirror cylindrical forms in Unreal (model and the rest of the UVs by oXYnary).
The issue with Unreal, even if you mirror horizontal, is that something is off in the way its calculating the binormal and the tangent. You can see this in my test model the highlight on one side is on the bottom of the bevel and on the other its in the top. Its effectivly flipping somthing. I'm not sure what exactly without understanding how its all coded, but as far as I can tell there is no fix.
Also, unless your using 100% unique art assets for your mod you will probably want to use some of the UDK assets, and non of those will be mirrored. So optimizing your props will give them a higher texel density than everything else in the game.
So my thought was just to avoid the issue entirely and just build everything like they do in unreal and don't fight it.
UDK is design for the PC, and most modern PCs have NO shortage of video memory.
Every other game engine I have worked with handles mirrored UVs just fine, Unreal is the first I have seen to have this problem. I guess you can either try to hide the problems/limitations of an engine, or work with in them.