Home Unreal Engine

Product Viz - normal shading problem

polycounter lvl 12
Offline / Send Message
Temppe polycounter lvl 12
Hi guys, I've played with Marmoset for a while now and decided to to a very small product viz type project as an introduction to UE4, which I've been meaning to get my hands dirty with for ages.

Anyway, so far so good(ish) but I've run into a snag which I can't figure out. The first image is of a spindle in a bycicle pedal bearing. The red circle highlighs the issue where it's most apparent, but you can see it along the entire length of the spindle. I made a test (geo)sphere and replicated the problem to make it clearer, which you can see in the second image.



There is a clear seam visible along the edges of the polygons where (it seems) they face more along one object-space axis then the other. I've rotated the sphere in the UE4 editor and the seams rotated with the sphere so it's object space, not world space. At first I thought it was using box mapping instead of the cylindrical mapping which I assigned to UV channel 03 in Max (you can see I'm using the correct UV channel in UE4 - 02). But this isn't the problem because even when I use solid colour (the spheres on the left) the problem persists. If I turn off tangent space the problem goes away, but then of course the maps I intend to use are all made for tangent space so it looks wonky. The spheres on the right have a standard UV test pattern plugged into the normal slot just to show that the UV mapping appears to be innocent in this case.



I'm really at a loss here regarding what to try next. It's my first time getting my hands dirty with UE4 and I'm a bit overwhelmed - there's a LOT more to know compared to Marmoset. Any help would be appreciated.

Replies

  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    Your flat normal value tests are wrong. Normals are in 1,-1 range so the vector should be 0,0,1 to represent flat normals. Would you mind opening up the normal map texture inside unreal engine and showing a screenshot from it and from its settings? Its probably just some checkbox or compression setting needed to be set correctly.

    First 2 guesses:
    - green channel needs to be flipped
    - compression setting isn't set to "normal map"
  • Temppe
    Options
    Offline / Send Message
    Temppe polycounter lvl 12
    Ah, yes you're right about the flat normal test!

    Here is the actual normal map I was using when I noticed the problem. The inset image is what it looks like on the sphere in the scene.

    I tried flipping the green channel but this doesn't fix the problem, unfortunately.
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    Try using the very first uv channel (index 0). In Unreal, tangents aren't generated for all uv channels by default so anything other than index 0 will show wrong. If you must want to use other uv channels for normals, there is a node to generate tangents for them. Its a material function, called derive tangent basis. You will also need to place a tangent output node. The result might still not be  100 % correct in all cases so I would highly recomment simply avoiding uv channels other than 0 for normals, if possible.
  • Temppe
    Options
    Offline / Send Message
    Temppe polycounter lvl 12
    That appears to have solved the problem! Thank you so much for your help, I really appreciate that.
Sign In or Register to comment.