Home Unreal Engine

UDK's Specular seam issue.

polycounter lvl 17
Offline / Send Message
DeadlyFreeze polycounter lvl 17
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.



YzBGY.jpg

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

  • Ace-Angel
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Can we see the UV's of the mesh?

    Also, how is your second channel setup?
  • DeadlyFreeze
    Offline / Send Message
    DeadlyFreeze polycounter lvl 17
    There's nothing really to see ace, it's basically how you would imagine it. The UV's are overlaid and mirrored up so they arent inverted in max. These are the UV's without the seam(pic), the other looks exactly the same, it's just mirrored down and inverted.

    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.

    aQZ5K.jpg
  • Ace-Angel
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    IIRC, in UDK, you have to offset the overlaid part outside the grid, and invert on the vertical axis only, naturally this is the old method, and UDK did change last time anyone used this method.

    Another thing you can try, is turning the Indirect Normal Influence Boost setting to 0 in the "World Properties" before baking, etc.
  • DeadlyFreeze
    Offline / Send Message
    DeadlyFreeze polycounter lvl 17
    Offsetting does nothing, one of the things I tried and didn't see any difference. UDK just seems to push it back in to the grid and mark it red in the UV editor.

    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.

    BfYnp.jpg
  • ZacD
    Offline / Send Message
    ZacD ngon master
    Just a stupid idea, could you use a seamless-overlapping plane projection for uv channel 0 just for the seams, and then use channels 1 and 2 for the actually texture and lightmap?
  • DeadlyFreeze
    Offline / Send Message
    DeadlyFreeze polycounter lvl 17
    ZacD wrote: »
    Just a stupid idea, could you use a seamless-overlapping plane projection for uv channel 0 just for the seams, and then use channels 1 and 2 for the actually texture and lightmap?


    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?
  • sprunghunt
    Offline / Send Message
    sprunghunt polycounter
    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.
  • Ace-Angel
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Hmmm, strange, I'm running out of ideas on what the issue can really be. Normal Map compression issues maybe?

    Also, the seam in the last image isn't really noticeable, how bad is it when you apply the diffuse and other textures?
  • HAWK12HT
  • HAWK12HT
    Offline / Send Message
    HAWK12HT polycounter lvl 12
    I dont know how EPIC call it a fix, I wonder if i will have some real weird enviro where all stuff use concrete texture and is joined like that as they show, if i move all other parts out of UV 1 space than Im in serious trouble oO
  • DeadlyFreeze
    Offline / Send Message
    DeadlyFreeze polycounter lvl 17
    @ace, On other models really bad. Since the spec will sit 'on top' it's much more prominent, what your seeing might not look as bad but I'm just using it to illustrate a point. Not a normal map issue since it show's up with out norms.

    @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.
  • ZacD
    Offline / Send Message
    ZacD ngon master
    Wait, is this only showing up after baking or before or both?
  • HAWK12HT
  • tyddynroger
    Offline / Send Message
    tyddynroger polycounter lvl 6
    this vid was in a similar thread not long ago:

    [ame="http://www.youtube.com/watch?v=ntx10JMl9f4"]Fixing Lighting Seams in UDK - YouTube[/ame]
  • HAWK12HT
    Offline / Send Message
    HAWK12HT polycounter lvl 12
    Also i cant seem to find the UDN document that tells u how to mirror ur UVs when u want overlapping UV clusters that also use Normal maps. In a nut shell if u split ur UV from exact half of ur mesh and overlap it to other you are in a world of hurt :D, you will get that nasty seam. to avoid this you add 10%-20% more from other side to the half UV so its like 75% UV flat on 0 1 space than remaing 25% overlapped and voila!! seams gone.

    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.
  • DeadlyFreeze
    Offline / Send Message
    DeadlyFreeze polycounter lvl 17
    Thanks for the help guys but I need to point out this is not a lightmap issue this is a 'lightmap specular' issue. The key difference here is lightmaps are generated from UV's in channel 1 by default, while the lightmap specular is generated from UV's in channel 0.

    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.
  • HAWK12HT
    Offline / Send Message
    HAWK12HT polycounter lvl 12
    I think may b thats why UDN docs removed the article they had for ages there about how to mirror UVs, and replaced it with new info. Newayz have u tried baking normal map as a whole than breaking it apart in UV and in Photoshop.
    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 :D, 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 :D . I hope it makes sense cause im lost myself here as English is not native language lol.
  • Harbinger
    Offline / Send Message
    Harbinger polycounter lvl 8
    Somebody smarter may come and correct me on the particulars, but here's what's happening:

    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 :)
  • tristamus
    Offline / Send Message
    tristamus polycounter lvl 9
    Harbinger wrote: »
    Somebody smarter may come and correct me on the particulars, but here's what's happening:

    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.
  • biofrost
    Offline / Send Message
    biofrost polycounter lvl 12
    Harbinger I owe you so much! I have been having this issue with my scene for quite sometime, I had just given up and was hoping no one would notice it.

    Old
    S0Cam.jpg
    New
    AFU9i.jpg
  • DeadlyFreeze
    Offline / Send Message
    DeadlyFreeze polycounter lvl 17
    @Harbinger, you win a free internet good sir this is definitely the best work around for this issue, many thanks.
  • Froyok
    Offline / Send Message
    Froyok greentooth
    Harbinger wrote: »
    Somebody smarter may come and correct me on the particulars, but here's what's happening:

    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 :)

    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 :

    uv_spec_1.jpg

    uv_spec_2.jpg
  • _Erik
    Im not sure if this is the same problem, but you might give this a try:
    http://www.polycount.com/forum/showthread.php?t=86635
    Hey guys, had a chat with a friend of mine about this and he told me the following: UDK uses the unwrap to calculate it's specular, so if you start rotating and flipping parts of the uv's it goes nuts. This basiclay happens to all your meshes, but most of the time you don't see it because you're not using a real time reflection (mirror). The way to work around is quite simple though. Swap UV 0 and UV 1 in your modelling package. Specularity is based on the info in UV 0. Since your lightmap unwrap (UV 1) is in fact the data you want( because it's planar mapped and doesn't have rotated parts) you use that on UV 0. Your diffuse unwrap goes to UV 1. In your shader you set up that your diffuse makes use of UV1 with a texcoord node and there you go. Problem fixed.
  • Froyok
    Offline / Send Message
    Froyok greentooth
    Well, it's the same solution as said by Harbinger above (inverting UV channel).
  • DeadlyFreeze
    Offline / Send Message
    DeadlyFreeze polycounter lvl 17
    Check your lightmaps UV's and make sure none of them are inverted. The issue is any inverted UV's, they don't have to be overlaid on top of each other for the seam to crop up.

    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.
  • cptSwing
    Offline / Send Message
    cptSwing polycounter lvl 11
    Harbinger wrote: »
    Somebody smarter may come and correct me on the particulars, but here's what's happening:

    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 :)


    don't tell me this actually works?!
  • Ace-Angel
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    If it does, bloody hell...
  • Froyok
    Offline / Send Message
    Froyok greentooth
    Check your lightmaps UV's and make sure none of them are inverted. The issue is any inverted UV's, they don't have to be overlaid on top of each other for the seam to crop up.

    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.
    Well, nothing is flipped in my uv (and it's just a simple quad). Very strange. I will investigate a little bit more then.
  • cptSwing
    Offline / Send Message
    cptSwing polycounter lvl 11
    it fucking worked. jesus. you made a grown man cry.


    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.
  • Harbinger
    Offline / Send Message
    Harbinger polycounter lvl 8
    Glad you guys are getting it to work :)

    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.
  • DeadlyFreeze
    Offline / Send Message
    DeadlyFreeze polycounter lvl 17
    Sad to say but after more testing, flipping the UV's channels is not a fix.

    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.
  • ZacD
    Offline / Send Message
    ZacD ngon master
    Sad to say but after more testing, flipping the UV's channels is not a fix.

    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.

    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.
  • cptSwing
    Offline / Send Message
    cptSwing polycounter lvl 11
    yeah, it seems that it'd work well for flat textures, it did fix some nasty mirroring seams on my mesh. but yeah. not feasible for normals derived from a high poly source, it seems. UDK.. grmbl..
  • Marchwarden
    Well this fix helped in my particular case... sucks that there's no hope for normals baked to complex meshes.
  • Snefer
    Offline / Send Message
    Snefer polycounter lvl 16
    Holy shit i just found this thread, and that solution WORKS, W T F, so awesome and silly! :D
  • cptSwing
    Offline / Send Message
    cptSwing polycounter lvl 11
    Have you made any progess with this fix on non-flat textures?
  • DeadlyFreeze
    Offline / Send Message
    DeadlyFreeze polycounter lvl 17
    Afraid not, if a real fix is going to happen it's going to need to be done by the UDK team.

    I gave a better explanation and examples in this thread, for more modular stuff for people who find this.
Sign In or Register to comment.