I'm trying to find a better fix to UDK's issue with specular seams. The problem comes down to having mirrored UV's with inverted faces as far as I can tell.
The half cylinder on left and the right are exactly the same, both have the same light map and both have symmetrical UV's overlaid on top of each other. The difference is the one on the left has it's inverted UV mirrored up so it isn't inverted, while the other isn't. This fixes the issue with the seam showing up.
Problem being of course you can't just un-invert a shape if it isn't perfectly symmetrical.
So the only fixes are either too:
1. Offset your seam to try and hide it.
2. Don't mirror things that end up getting inverted.
3. Turn off 'specular lightmass' in the material setting.
None of which are really ideal.
I've also read in the UDK doc that you can offset the uv in 0-1 space but this doesn't do anything. Is there a better fix to this out there that I missed? Maybe forcing UDK to use a different set of UV's instead of whatever is in channel 0?
Replies
Also, how is your second channel setup?
The light map has no overlays as per all standard protocol.
This isn't a light map issue though, specular is determined by anything in channel 0 in UDK.
Another thing you can try, is turning the Indirect Normal Influence Boost setting to 0 in the "World Properties" before baking, etc.
The Normal Influence Boost will work fine if the object doesn't have a normal map. As soon as you add a normal you get the same issue.
Left with normal and seam, right no normal no seam.
The problem with that is there is only a spinner to change the light map channel, everything else seems to be hard coded to use channel 0 as far as I can tell.
Maybe there is a material function to pick a channel per texture that I've missed?
the texture coordinates node lets you set which channel to use.
Also, the seam in the last image isn't really noticeable, how bad is it when you apply the diffuse and other textures?
@hawk, thanks but again offsetting is not a fix.
I tried the tex coord function in both the spec and gloss but still shows up. The lightmap specular seems independent from the specular in materials.
http://udn.epicgames.com/Three/LightMapUnwrapping.html
http://stephenjameson.com/tutorials/lightmap-uvs-tutorial/
http://udn.epicgames.com/Three/LightMapUnwrapping.html
[ame="http://www.youtube.com/watch?v=ntx10JMl9f4"]Fixing Lighting Seams in UDK - YouTube[/ame]
I did not made this up, the whole detailed description is on UDN docs, somewhere in lightmass, UVW unwrapping area. If neone know what im talking about please attach the link to the doc. Cheers.
It is completely irrelevant how your UV's are setup for your lightmap in channel 1.
@zac, after lightmass runs. The lightmap specular seems to be real time though, it's like additional specular you get from bounce light that was calculated by lightmass.
@hawk, offsetting the seam only moves it, the problem is any inverted faces.
Yes the issue is from channel 0 which happens to b your Normal map, I had the exact same issue on Modular floor piece, The final solution from Pros and High end 3D motive tutorials was to PLAN ur mesh ahead in a way that seams fall on natural areas like metal joints on textures etc.
Secondly the Most important bit, UDK dont like plain simple textures, even if the object is brand new it has details, like ur oil tank has lots of pipes around, a spiral staircase to check tank from top, bird poo , rust, wear and tear from just placing the object in place from factory to the actual location. Personally I would just put a simple box running from side kinda make it look like a pipe and cover that seam, and rotat the box to face the seam on oil tank to hide the seam of pipe . I hope it makes sense cause im lost myself here as English is not native language lol.
UDK uses directional lightmaps, and to compute that directionality UDK has to establish some tangent basis for the surface. The editor does this based on whatever UV's are in channel 0 by default. So, if your doing any kind of texture atlasing or mirroring UV's with normal maps, you can do a little trick. Since your lightmap UV's will always be laid out nice and clean with no overlaps or mirroring, put your lightmap UV's in channel 0 so UDK calculates tangent basis based on those, then your diffuse UV's in channel 1. Then use the coordinate node to set all your UV coordinates to channel 1 in your shaders.
It takes a few extra steps to set up your materials like this but it should fix the issue. Otherwise, stick a mesh in front of it and cover it up
Harbinger, if this actually works, that's fucking amazing. Thank you for that.
Old
New
Well, regarding my personals tests using your tips, it makes worse results than a classic pipeline. Are sure about this ? Maybe I have done something wrong, but in my case :
http://www.polycount.com/forum/showthread.php?t=86635
Max has the 'select inverted' in the UV editor. If you don't have any in your lightmaps UV's then you have something else going wrong.
don't tell me this actually works?!
EDIT: But as always, there seems to be a downside.. while the mirrored parts of the mesh look lots, lots better, there are visible seams in other previously good areas. might it be related to the uv-shell smoothing groups matching up to channel 2 now, while the specularity is derived from channel 1? bleh.
I should have noted, I've only ever tried this process with environment models based off of texture paged normal maps, in which the normals were baked flat, meaning no complex tangent basis to worry about. cptSwing, you might be right, something wacky might be going on with smoothing groups. I always import .FBX with explicit normals checked on these days, so maybe there's a fix there.
If I get the time I'll dig out my old test files and play around with it.
As far as I can tell UDK uses some data stored in 0 channel(normal tangents, smoothing?) so flipping the UV channels gives you the wrong set of data and completely fucks up your normals.
So back to square one, don't use inverted normals or turn the stupid fucking thing off.
If you bake the mesh uniquely, and added smoothing groups to match your UV seams before the back, you DO NOT want to flip them, but if you are using a generic tiling texture it /may/ be better to swap them, I'd like to see more testing.
I gave a better explanation and examples in this thread, for more modular stuff for people who find this.