Home Technical Talk

Small UE4 Lighting Issue?

polycounter lvl 11
Offline / Send Message
Scizz polycounter lvl 11
For some reason the lighting on one of my pieces is acting up. I've rebuilt a bunch of times, made sure I have no overlapping or inverted UVs (for the lightmap). The pieces I'm referring to are obvious. All I did was replace the normal map and color_ID in Substance, so every color is exactly the same.

Diffuse showing that the colors are exactly the same
4f509987ee.png

The lighting issue, after a lighting bake(The section in the background is easier to see)
a20eea4dd8.png

For testing purposes, I even replaced the top piece with the bottom one, and the lighting seems fine.
2ce938ec42.png

And if you look at the materials. They are exactly the same in the editor.

Bottom Piece
176671e25f.png

Top Piece
91e60206b5.png

The bottom is what it's supposed to look like. I've even moved the top piece to where the bottom piece is to test, and the lighting still ended up the same. Not sure what to troubleshoot next. :(

Replies

  • Elrinion
    Offline / Send Message
    Elrinion polycounter lvl 2
    This really seems more of a normal problem than a lightning one, sometimes they only show up after baking.

    Do you for any instance use mirroring in your UV's? If so, try moving one of the pieces a full UV space to the side.

    You could also try checking again the normals in the mesh, one of the surfaces could have its normals skewed and is affecting the normal map.

    In the case it's not the normals, try checking the lightmap UV's and upping a little the resolution. Also make sure there's proper spacing between the islands.

    Keep up the good work. o/
  • Scizz
    Offline / Send Message
    Scizz polycounter lvl 11
    Oh, I haven't considered it a normal issue! Here are my normal maps, the bottom piece which is correct, and the top piece which is incorrect. I know I have some strong gradients, but I seem to get away with it because all the details. Plus, there are gradients in the bottom(correct lighting) piece and it looks fine.

    Bottom Piece
    fb57c73687.png

    Top Piece(one with issues)
    94635a6349.png

    I'm not mirroring any UVs. I also made sure in my lightmap UVs that there are no overlapping or inverted UVs. I bumped the lightmap res from the default 64 to 128 and it made no difference.

    EDIT: Showing the flipped Y normals instead.
  • Elrinion
    Offline / Send Message
    Elrinion polycounter lvl 2
    Really looks normal at first instance. Try something crazy and see if it sticks: Try inverting the direction (red and green channel) on the bottom texture normal map.

    If it's not even that, then you got me. Perhaps one of the pros around here can give you a better answer.

    edit: also try checking the mesh itself. In max just put an edit normals stack and see where they're pointing.
  • Scizz
    Offline / Send Message
    Scizz polycounter lvl 11
    db07fb2717.png

    Doesn't seem like anything is out of the ordinary.
  • Elrinion
    Offline / Send Message
    Elrinion polycounter lvl 2
    http://wiki.polycount.com/wiki/VertexNormal

    You're doing all the islands as a single smoothing group, this is usually bad for these kind of surfaces because it introduces too many gradients in the flat parts, which are prone to errors like bit depth compression banding and others.

    Try separating all the angles > 90 and flat surfaces in their own smoothing groups.

    On a personal note: You seem to have a lot of wasted UV space on these pieces. Any reason why both parts can't be on the same texture?
  • Scizz
    Offline / Send Message
    Scizz polycounter lvl 11
    The reason I used one smoothing group was because, when I used different smoothing groups wherever there was a hard edge, I got this
    c4a6732220.png

    I didn't get that seam when everything was smoothed. Also, the bottom piece seems to be working out fine, and it is also one smoothing group which is weird. Or maybe the bottom piece is also incorrect, and can look better. :( I did split up the smoothing groups on the top piece though, but I did not rebake and apply to the texture. I will try that next if you guys think that also might be an issue.

    It did get a bit brighter, but still not the same. Based on this lighting set up, they should be receiving about the same amount of light, correct?
    9f550efa47.png
    fc121aedd6.png
    Elrinion wrote: »
    On a personal note: You seem to have a lot of wasted UV space on these pieces. Any reason why both parts can't be on the same texture?
    Yeah, in the beginning I think I was just overthinking how it would be a hassle to combine the maps. But just thinking about it now, all I would have to do is model and unwrap both pieces separately like normal, attach them, layout the uvs as accordingly, detach/separate them, and bake them individually in xnormal. Then just combine the normals in photoshop. That the best way?
  • Tzur_H
    Offline / Send Message
    Tzur_H polycounter lvl 9
    You should read the sticky threads about normal maps, also read the one about skewing in normal maps, which for some reason isn't a sticky.

    You're getting the seams in the normal maps because you set the smoothing groups / hard edges but don't have a UV split.
  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    http://www.polycount.com/forum/showthread.php?t=154664
    This can completely elimitate the gradients in your normalmap, which are causing the shading issues.
    But yeah, you should read that sticky normalmap thread.

    Also, combining in ps is not the best way.
  • Scizz
    Offline / Send Message
    Scizz polycounter lvl 11
    Tzur_H wrote: »
    You should read the sticky threads about normal maps, also read the one about skewing in normal maps, which for some reason isn't a sticky.

    You're getting the seams in the normal maps because you set the smoothing groups / hard edges but don't have a UV split.

    I've skimmed through a lot of it. That whole 70 something page write up. And that's where I got confused. I DO have a UV split in that corner. I always have.
    f58b3988cc.png
    Obscura wrote: »
    http://www.polycount.com/forum/showthread.php?t=154664
    This can completely elimitate the gradients in your normalmap, which are causing the shading issues.
    But yeah, you should read that sticky normalmap thread.

    Also, combining in ps is not the best way.

    I'll try that method of getting rid of the gradients from that thread. Although, I would have never had such strong gradients if there wasn't a seam on the hard edge.
    07ac9c888a.png
    This is the same normal applied to this
    c4a6732220.png

    UV split where the hard edge is, and a different smoothing for the front and the side faces.

    Also, why does the bottom piece, which has a strong gradient as well, seemingly look fine in terms of shading from the top piece. And maybe a better way would be Substance Designers normal combine node, and just export. Thanks for all the help btw :D
  • Eric Chadwick
    How are you baking that last normal map? If you're not using a cage, you get those long crevices in the normal map everywhere you have a hard edge in the low-poly. This is because the baker is missing big chunks of your high-poly.
    Normalmap_raycasting_1.jpgNormalmap_raycasting_2.jpg
  • Elrinion
    Offline / Send Message
    Elrinion polycounter lvl 2
    That seam also could be just because you didn't put in the edge padding. For this res it should be at least 4px.
  • Scizz
    Offline / Send Message
    Scizz polycounter lvl 11
    I figured since this was a simple object I could just create the cage file in xnormal. So I did. Same UV layout. It's still giving me the seam. It seems like the bevel only grew larger. And I've always had 4px edge padding. Maybe it needs more? :(
    2b56b45499.png

    This is with 16px edge padding. Bevel just keeps getting bigger.
  • Eric Chadwick
    Looks like no edge padding, or very little. (forgive me for overlaying your two images)

    yE1HvMd.jpg
  • Scizz
    Offline / Send Message
    Scizz polycounter lvl 11
    2px Edge padding
    8aba573441.png
    39c111699e.png
    3f8a625ad0.png

    16x Edge Padding
    3f7a7f7072.png
    8f375ba919.png
    3cd9bebc9f.png

    Something is not right lol
  • SonicBlue
    Offline / Send Message
    SonicBlue polycounter lvl 10
    The mesh you're applying the normal map, is the same low poly mesh that you used in xNormal?
  • Scizz
    Offline / Send Message
    Scizz polycounter lvl 11
    SonicBlue wrote: »
    The mesh you're applying the normal map, is the same low poly mesh that you used in xNormal?

    Yup, just triple checked. Exported my LP and HP form 3ds Max. Brought them into xnormal, used 16x edge padding, opened the same mesh in Marmoset. Applied the normal, same result.
  • Tzur_H
    Offline / Send Message
    Tzur_H polycounter lvl 9
    Mind sharing your meshes?
  • Scizz
    Offline / Send Message
    Scizz polycounter lvl 11
  • Tzur_H
    Offline / Send Message
    Tzur_H polycounter lvl 9
    I tested your mesh using a cage, bakes fine for me.
    I'd highly suggest though that add a small bevel in your 90 degree edges, to better match the shape of your high poly.
    Bakes
  • Scizz
    Offline / Send Message
    Scizz polycounter lvl 11
    Hmmm. Thanks for these. What did you do differently? Only thing I could think of was, I put an edit poly modifier on the top of my stack, and applied the smoothing group information to that. Not sure if that's bad practice. Also, whenever I try and bake a normal with xnormal using an external cage, it gives me an error saying my cage doesn't have the same amount of vertices as the mesh. But all I did was take my LP, and push it out a bit and export. When I try to use the cage in xnormal, it doesn't seem to make a difference in the resulting bake.
  • Tzur_H
    Offline / Send Message
    Tzur_H polycounter lvl 9
    I'm working with MODO. All I changed was smoothing groups + UVs in the 2nd version only, where I beveled the 90 degree angled edges.

    Triangulate your LP before you make the cage, maybe when you export the auto triangulate is causing a difference in low poly and the cage, then you'll have an error in xNormal, the geo must be the same. It's kind of a pain to be honest haha.
  • Scizz
    Offline / Send Message
    Scizz polycounter lvl 11
    I'm stumped dude. I think my programs are broken. I copied exactly what Tzur_H did in his FIX 1 file. His UVs are the same as mine except oriented a little differently. I manually triangulated the LP and cage file before exporting into xnormal to bake. Tried everything from 4 to 32 edge padding. I still cant get rid of that seam in the middle without making the whole mesh one smoothing group.....
  • wirrexx
    Offline / Send Message
    wirrexx ngon master
    Try to amp up your edgepadding to 16 or 32 in xNormal, another thing is to make sure that your edges in the UV islands are rotated (faced to eachother, which by the looks of it you've done) .

    Create a Cage in 3Ds max and try that one out

    1. Make sure that the LP follows the silhouette of the HP as close as possible.
    2. reset xforms
    3. select the low poly and apply a push modifier
    4. increase the push untill the entire HP is overtaken
    5. Export the LPWith the push as a cage.
    6. Import HP and LP
    7. Right click on the LP and use external Cage
    8. Try to bake! =)
  • Joopson
    Offline / Send Message
    Joopson quad damage
    Your cage only has one smoothing group, right?
  • repete
  • Scizz
    Offline / Send Message
    Scizz polycounter lvl 11
    @Joopson Nah. My cage was an exact copy of my low poly, just pushed out.

    @repete I'm sorry haha. I have watched that video like 6 times already though, I was doing everything right! :(

    I figured it out. I decided to record me doing it so you guys could see I wasn't doing anything wrong. As I was recording it, it magically worked. But I wasn't satisfied with that, so I looked at what I did different. Turns out, I was exporting my cage from 3ds Max without tangents and binormals checked. Relieved that problem is fixed yet pissed off that it was something so simple. Sorry for the trouble, thanks to everyone for helping me out!
  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    Maybe you don't listen to me, but actually I mentioned a thing at your start, that would have been solved your problem instantly... You could save yourself so much time...
  • Scizz
    Offline / Send Message
    Scizz polycounter lvl 11
    Obscura wrote: »
    Maybe you don't listen to me, but actually I mentioned a thing at your start, that would have been solved your problem instantly... You could save yourself so much time...

    Oh, I read through your thread a bit, it's very helpful, thank you! But I was more so looking for a reason as to why my normal map wasn't working as intended, as apposed to finding a way to get rid of my gradients. I know there are a multitude of ways to do everything, and the way I was doing it (hard edge, with a smoothing split and uv spit) was one of them, but it wasn't working when it should have been. Thats the main reason I didn't use that method. I'm sorry. :(
  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    I would like to mention, that method would completely remove the gradients. Actually it works much better than the synced workflow, cause of one simple reason. Basically its less involved work if you know what you are doing, and there are almost no limitations and external tools. There are helper tools (scripts mainly) for every popular modeling packages for such workflow. You don't need to say sorry anyways.
Sign In or Register to comment.