Home Technical Talk

Mysterious Lighting Seams in UDK

polycounter lvl 8
Offline / Send Message
dirigible polycounter lvl 8
Hey, all. I recently finished an environmental asset - a silo structure. It's little more than a cylinder. The uv's for the textures are mirrored left/right. The uv's for the lightmap, obviously, are not. When I put it into unreal it looked fine.
yeb90.png
Until I baked lighting, when I got a gigantic lighting seam right down the line of symmetry.
jj2tkw.png
Now I wasn't sure what was causing it, but I figured it was either the model itself or the textures. So to check the model I hit "Lighting Only", and sure enough it looks fine. EDIT: ACTUALLY THERE IS STILL A SEAM, IT's JUST VERY SUBTLE - LOOK ON THE SIDE OF THE SILO.
sq1u02.png
But then, to be sure, I applied a neutral material to the model (.2 diffuse & specular, no normal map), and went back to "Lit" mode, and this is what I got:
sza491.png
So now I don't know whether the problem is with the model, the texture, or even the uv's. The uv's should be fine. As I said, they are mirrored for the textures, but the lightmap UV's don't even have a seam there.
rvkm6a.png

Other things I've checked: Explicit Normals import option is checked, Object Normals are correct (checked in maya & UDK), Lightmap IS using uv set 1, Normal Map green channel is correct, and the baked lighting map even looks correct.

Does anyone know what's causing this seam, and how to get rid of it? It seems pretty ridiculous that simply mirroring a texture would cause such an enormous lighting error, I feel like I have to be doing something wrong.

Replies

  • Froyok
    Options
    Offline / Send Message
    Froyok greentooth
    UV seams will always make some lighting artifacts (it's not perfect), even if you have a different UV for the lightmap.

    Also, what version of the UDK do you use ?
    I'm currently using the October 2011 and I have noticed some normal seams artifacts event with smooth normal on FBX models.
  • Mark Dygert
    Options
    Offline / Send Message
    This might help, but skip down to the very bottom where it talks about specular seams,
    http://udn.epicgames.com/Three/LightMapUnwrapping.html

    I've run into the same thing. I think it comes from the specular, its generated using the first UV coordinates instead of the second lightmap set? Or if there is a difference between the two you get a spec seam. Or it could be that any overlap (even offset UVs) will generate a seam.

    In the end I think the best thing I've found is to go with a unique unwrap with as few seams as possible across that area. Mirroring helps but it always seems to bite you in some way or another.
  • dirigible
    Options
    Offline / Send Message
    dirigible polycounter lvl 8
    Froyok,
    I'm using November '11. I checked, and this is happening on every model that has a visible line of symmetry. Luckily most of them are more subtle, but this one is pretty visible.

    Mark Dygert,
    Thanks for the info, it's good to know that this isn't just me being retarded at udk. I don't know if Epic rewrote the page you linked to, but it no longer mentions anything about specular.

    It sounds like from now on I need to either cover my seams or hide them, no matter what type of seams they are. I'd be interested in hearing if anyone has an in-depth explanation, or even a workaround.
  • Mark Dygert
    Options
    Offline / Send Message
    Yea they edited the entry, it actually makes much more sense overall but the bit at the bottom that pretty much said "yea light maps and specular are a bitch, watch out and hide your seams as best you can" is gone, ha! Figures...

    I think I had it wrong, it uses the lightmap UV set to generate specular, so you want the lightmap UV channel to be as contiguous as possible. I thought I tested for that on my globe but I think I just arranged all of the separate pieces uniquely and never merged them together.

    So yea hide your seams well, especially for the lightmap UV. I think you can still mirror/tile normal and diffuse maps like crazy which could be good news, but watch out for the lightmap UV channel, I'll have to test it when I get a chance.
  • dirigible
    Options
    Offline / Send Message
    dirigible polycounter lvl 8
    Mark,
    Well that's the strange thing. My lightmap uv's don't even have a seam there - check the screenshot with the uv layouts, the lightmap layout is on the right. They ARE as contiguous as I can get them. What you said the first time seems right, I just don't understand why udk would work that way.
  • Marine
    Options
    Offline / Send Message
    Marine polycounter lvl 18
    This is really vague, half remembered stuff but try rotating those mirrored bits so the seam runs vertical
  • nfrrtycmplx
    Options
    Offline / Send Message
    nfrrtycmplx polycounter lvl 18
    The seem looks like it's coming from your normal map contribution to the baked lighting.

    Your UV1 and your UV2 tangents are different. Broken/rotated 90 degrees... Try rotating your lightmap uvws for the top of the canister 90 degrees and baking it again... if that doesn't fix it, try making your UV1 and your UV2 more similar.

    This is a common problem, and one that many people have a hard time solving.

    Did a mini tut a while back about this same kinda thing (but on the ground of someone's level... Your lightmaps are going to be bit wacky if you rotate/flip uvws around. This kind of thing works well for characters because they're dynamically lit 100% of the time. Not so much on static env props.

    If i'm wrong, someone will surely point it out :)...

    Cheers and good luck mang,
    D
  • dirigible
    Options
    Offline / Send Message
    dirigible polycounter lvl 8
    I tried Marine's and nfr..nfrr...that guy's suggestions.
    2i6j3nd.jpg
    They both show a lighting seam, even with only a neutral material (no normal map) applied.

    To be explicit, the silo on the left has the uv seams rotated 90 degrees, so that the seams are vertical, not horizontal. The silo on the right has the lightmap uv's at the same angle as the texture uv's. The material applied is a neutral grey material (.2 diffuse, .5 specular, 10.0 specular power).
  • Mark Dygert
    Options
    Offline / Send Message
    Yep after some testing, it looks like the specular uses whatever UV channel the normal map uses, which makes mirroring normal maps kind of useless? The best way to deal with it that I found was to have it as contiguous as possible and to hide the seams at smoothing breaks if at all possible, if not disguise the seam with noise.

    I poked around for a way to force specular to use the lightmap UV channel but couldn't find an option for it, but there might be some trick I don't know about. It seems pretty limiting to not be able to mirror normal maps like that thanks to the specular going fubar =/
  • sinistergfx
    Options
    Offline / Send Message
    sinistergfx polycounter lvl 18
    You want your mirroring to be oriented vertically in your uv0 (regular uvs).
    In uv1 (lightmap uvs) you need to break apart and space out any bits that are mirrored in uv0.
  • dirigible
    Options
    Offline / Send Message
    dirigible polycounter lvl 8
    Mark,
    I'm not sure baked lighting specularity is attached to the normal map uv's, I think it might just be attached to uv set 0, no matter what you do. To test, I changed the material and gave it a neutral (127,127,255) normal map, assigned to the lightmap uvs. If baked lighting specularity uses the normal map uv's then that should make it use the lightmap uv's. But there is still a seam.
    1znq6vp.jpg

    So then I thought "well maybe baked lighting specularity uses whatever uvs the spec map is attached to", so I hooked up a flat grey texture to uv set 1. If anything, that made the seam look even worse.
    x1knds.png

    The workaround, as far as I can tell, is to
    1. Only use mirrored uv's on non-contiguous geo (ie mirror a car's tires, but not it's hood)
    2. If you can't do 1, then at least hide the mirroring seams
    3. If you can't do 2, then cover the mirroring seams with geo.

    Still, it'd be cool to know if there's a fix, or at least an explanation.
  • ImSlightlyBored
    Options
    Offline / Send Message
    ImSlightlyBored polycounter lvl 13
    in your UV0 instead of mirroring the top cap on Y, mirror it on X. so rotate that island 90 degrees and give it a go.
  • dirigible
    Options
    Offline / Send Message
    dirigible polycounter lvl 8
    sinistergfk & ImSlightlyBored,
    Tried what you said, problem persists. All the seams are running vertical. All pieces that are mirrored in UV0 are spaced out in UV1.
    250s5zs.png
  • Calypso75
    Options
    Offline / Send Message
    Calypso75 null
    Try turning the Indirect Normal Influence Boost setting down to 0 in the World Properties and rebake the lighting. Even with no normal map applied it should fix the specular seam.
  • dirigible
    Options
    Offline / Send Message
    dirigible polycounter lvl 8
    Calypso75,
    You are a god among men! That fixed the problem.
    20u525s.png
    It looks like Indirect Normal Influence Boost is a feature intended to improve the way normal maps look under indirect lighting, at the cost of increasing normal map compression seams and (apparently) baked lighting seams.

    Thanks very much, Calypso75!

    I wound up simply covering the seam, by the way
    5p0oli.png
    But at least now I know WHY it happened, and how I can fix it in the future.
  • Mark Dygert
    Options
    Offline / Send Message
    Sweet, I'm glad you fixed it! I'll give that a try on my globe and see how it works! Thanks for the tip!
  • Calypso75
    Options
    Offline / Send Message
    Calypso75 null
    Nice, glad to help. :) The unreal engine has enough problems displaying assets cleanly as it is, don't need to be adding even more problems on top of it.
  • dirigible
    Options
    Offline / Send Message
    dirigible polycounter lvl 8
    BUT WAIT, THAT'S NOT ALL!
    Setting Indirect Normal Influence Boost (INIB) to 0 is NOT ENOUGH to fix all the problems!
    6pnwr9.png
    In this picture are two cylinders, which are completely identical except that the seams in the left one run horizontal, while the seams in the right one run vertical. When INIB > 0, both cylinders display baked lighting errors. But when INIB = 0, only the cylinder with horizontal seams displays baked lighting errors.

    Very mysterious.
  • cptSwing
    Options
    Offline / Send Message
    cptSwing polycounter lvl 11
    wtf man. correctly displaying stuff in udk is wizardry.

    does setting Indirect Normal Influence Boost to 0 have any bad effects (performance, overall visual quality)?
  • Mark Dygert
    Options
    Offline / Send Message
    That at least partially explains why Will said to align the mirror seam vertically and not horizontally.

    It looks like there are a bunch of hoops you need to jump through and mirroring a cylinder seems to have the most... Ben Apuna linked me to a few other threads about seams and a few more hoops you might have to jump through.

    http://www.polycount.com/forum/showthread.php?p=1498164#post1498164

    If that image is true and a seam can't fall on an outer edge of a cylinder, you should rotate your 12 sided cylinders 15 degrees, reset xform, and then run symmetry so the mirrored edge runs along a flat side and one that isn't contributing to the silhouette, like this:
    UDK_CylinderSymmetry.jpg
    Of course that could be just hiding the seam or minimizing it to an unrecognizable level by flattening out the normals.
  • Calypso75
    Options
    Offline / Send Message
    Calypso75 null
    Hm, so that was dumb of me.

    The whole indirect influence thing worked since in this case the seam was being caused by the bounced lighting and not the direct lighting since a dominant light was being used. Which means the direct lighting and specular calculations were being done dynamically. However, if you light the scene with just a single point light and the direct lighting is completely baked this whole fix goes right out the window.

    Who knows how much of this is a unreal problem or just simply a drawback of using light maps to figure out specular direction.
  • Kensey Quarantine
    Sorry for necromancy, but is there a solution on this problem?
  • dirigible
    Options
    Offline / Send Message
    dirigible polycounter lvl 8
    Sort of, Kensey.

    The answer is "don't mirror normal maps on static meshes unless you plan on covering the seam".

    If you plan using a mirrored normal map, either mirror it in such a way that there is no mirror-seam (for instance if all tires on a car use the same uvs) or cover the seam with more geometry (like I did with my model). Or if you're super determined not to do either of those, then make it look like the inevitable lighting seam is intentional (for instance have a groove running down the middle, separating the model into two halfs).

    The only way to even mitigate the effect is to add a detail normal map.
  • SittingDucky
    Options
    Offline / Send Message
    SittingDucky polycounter lvl 10
    omg thank you guys for Normal Influence Boost thing!

    i see this is an old thread but it seems mirrored uv problems never get old. last year i stumbled upon a simple solution here at polycount. i wish i could remember the guy's name to give him the credit. anyway, try using the 0 channel for lightmap and channel 1 for your mirrored, tiled or overlapped uvs..the thing is, unreal internally uses the first channel to build the object's normal info ( or something ) and wherever you have a seam, it will be interpreted as a broken edge. the only problem i found is that when using opacity map in channel 1, lightmass doesn't seem to see it : ))
  • dirigible
    Options
    Offline / Send Message
    dirigible polycounter lvl 8
    Nice, Ducky. I like that solution, I'm gonna have to try it out. The opacity thing is a little bothersome but hey - most stuff doesn't need an opacity map anyway :D
Sign In or Register to comment.